feat: 实现友链页面功能并优化其他页面

添加友链页面表单和展示功能,包括申请友链和显示友链列表
优化首页搜索框自动聚焦和画廊页面图片样式
修复博客列表分页器显示条件
This commit is contained in:
2026-01-07 16:06:44 +08:00
parent e924fcca2b
commit 8a3cc98330
11 changed files with 270 additions and 11 deletions

17
src/api/plink/index.ts Normal file
View File

@ -0,0 +1,17 @@
import request from "@/util/request";
// getPlinkList
export function getPlinkList() {
return request({
url: "/plink?sh=1",
method: "get",
});
}
// addPlink
export function addPlink(data: any) {
return request({
url: "/plink",
method: "post",
data
});
}

11
src/icon/plink/ava.svg Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
<defs>
<clipPath id="clipPath9237879253">
<path d="M0 0L16 0L16 16L0 16L0 0Z" fill-rule="nonzero" transform="matrix(1 0 0 1 0 0)"/>
</clipPath>
</defs>
<g clip-path="url(#clipPath9237879253)">
<path d="M12 0L2 0C1.44797 0.000602881 0.976774 0.196078 0.586426 0.586426C0.196078 0.976774 0.000602802 1.44797 0 2L0 10C0.000602802 10.552 0.196078 11.0232 0.586426 11.4136C0.976774 11.8039 1.44797 11.9994 2 12L12 12C12.552 11.9994 13.0232 11.8039 13.4136 11.4136C13.8039 11.0232 13.9994 10.552 14 10L14 2C13.9994 1.44796 13.8039 0.976774 13.4136 0.586426C13.0232 0.196078 12.552 0.000602563 12 0ZM9.5 2C9.91421 2 10.2678 2.14645 10.5607 2.43934C10.8536 2.73223 11 3.08579 11 3.5C11 3.91421 10.8536 4.26777 10.5607 4.56066C10.2678 4.85355 9.91421 5 9.5 5C9.08579 5 8.73223 4.85355 8.43934 4.56066C8.14645 4.26777 8 3.91421 8 3.5C8.00043 3.08596 8.14703 2.73256 8.4398 2.4398C8.73256 2.14703 9.08596 2.00043 9.5 2ZM2 11C1.72386 11 1.48816 10.9024 1.29289 10.7071C1.09763 10.5118 1 10.2761 1 10L1 7.88656L3.96375 5.25219C4.26051 4.98899 4.60714 4.86312 5.00364 4.87457C5.40013 4.88602 5.73892 5.03168 6.02 5.31156L8.04969 7.33687L4.38656 11L2 11ZM13 10C13 10.2761 12.9024 10.5118 12.7071 10.7071C12.5118 10.9024 12.2761 11 12 11L5.80094 11L9.59531 7.20563C9.87268 6.96975 10.1934 6.85133 10.5575 6.85039C10.9216 6.84944 11.243 6.96619 11.5216 7.20063L13 8.4325L13 10Z" fill-rule="nonzero" transform="matrix(1 0 0 1 1 2)" fill="rgb(55, 65, 81)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

12
src/icon/plink/desc.svg Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
<defs>
<clipPath id="clipPath9650034066">
<path d="M0 0L16 0L16 16L0 16L0 0Z" fill-rule="nonzero" transform="matrix(1 0 0 1 0 0)"/>
</clipPath>
</defs>
<g clip-path="url(#clipPath9650034066)">
<path d="M10.875 6L6.5 6C6.08579 6 5.73223 5.85355 5.43934 5.56066C5.14645 5.26777 5 4.91421 5 4.5L5 0.125C5 0.0904822 4.9878 0.0610193 4.96339 0.0366116C4.93898 0.0122039 4.90952 0 4.875 0L2 0C1.44772 0 0.976311 0.195262 0.585786 0.585786C0.195262 0.976311 0 1.44772 0 2L0 12C0 12.5523 0.195262 13.0237 0.585786 13.4142C0.976311 13.8047 1.44772 14 2 14L9 14C9.55228 14 10.0237 13.8047 10.4142 13.4142C10.8047 13.0237 11 12.5523 11 12L11 6.125C11 6.09048 10.9878 6.06102 10.9634 6.03661C10.939 6.0122 10.9095 6 10.875 6ZM8 11L3 11C2.86193 11 2.74408 10.9512 2.64645 10.8536C2.54882 10.7559 2.5 10.6381 2.5 10.5C2.5 10.3619 2.54882 10.2441 2.64645 10.1464C2.74408 10.0488 2.86193 10 3 10L8 10C8.13807 10 8.25592 10.0488 8.35355 10.1464C8.45118 10.2441 8.5 10.3619 8.5 10.5C8.5 10.6381 8.45118 10.7559 8.35355 10.8536C8.25592 10.9512 8.13807 11 8 11ZM8 8.5L3 8.5C2.86193 8.5 2.74408 8.45118 2.64645 8.35355C2.54882 8.25592 2.5 8.13807 2.5 8C2.5 7.86193 2.54882 7.74408 2.64645 7.64645C2.74408 7.54882 2.86193 7.5 3 7.5L8 7.5C8.13807 7.5 8.25592 7.54882 8.35355 7.64645C8.45118 7.74408 8.5 7.86193 8.5 8C8.5 8.13807 8.45118 8.25592 8.35355 8.35355C8.25592 8.45118 8.13807 8.5 8 8.5Z" fill-rule="nonzero" transform="matrix(1 0 0 1 2.5 1)" fill="rgb(55, 65, 81)"/>
<path d="M4.60063 4.51228L0.106563 0.0182223C0.097628 0.00934013 0.0869808 0.00367733 0.0746212 0.00123394C0.0622616 -0.00120946 0.0502605 -2.40803e-05 0.0386181 0.00479007C0.0269756 0.00960422 0.017642 0.0172406 0.0106173 0.0276991C0.00359249 0.0381577 5.34058e-05 0.0496862 0 0.0622848L0 4.11885C0 4.25692 0.0488154 4.37477 0.146446 4.4724C0.244077 4.57003 0.361928 4.61885 0.5 4.61885L4.55656 4.61885C4.56916 4.61879 4.58069 4.61526 4.59115 4.60823C4.60161 4.60121 4.60924 4.59187 4.61406 4.58023C4.61887 4.56859 4.62006 4.55659 4.61761 4.54423C4.61517 4.53187 4.60951 4.52122 4.60063 4.51228Z" fill-rule="nonzero" transform="matrix(1 0 0 1 8.5 1.38115)" fill="rgb(55, 65, 81)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

12
src/icon/plink/site.svg Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
<defs>
<clipPath id="clipPath4437362061">
<path d="M0 0L16 0L16 16L0 16L0 0Z" fill-rule="nonzero" transform="matrix(1 0 0 1 0 0)"/>
</clipPath>
</defs>
<g clip-path="url(#clipPath4437362061)">
<path d="M10.875 6L6.5 6C6.08579 6 5.73223 5.85355 5.43934 5.56066C5.14645 5.26777 5 4.91421 5 4.5L5 0.125C5 0.0904822 4.9878 0.0610193 4.96339 0.0366116C4.93898 0.0122039 4.90952 0 4.875 0L2 0C1.44772 0 0.976311 0.195262 0.585786 0.585786C0.195262 0.976311 0 1.44772 0 2L0 12C0 12.5523 0.195262 13.0237 0.585786 13.4142C0.976311 13.8047 1.44772 14 2 14L9 14C9.55228 14 10.0237 13.8047 10.4142 13.4142C10.8047 13.0237 11 12.5523 11 12L11 6.125C11 6.09048 10.9878 6.06102 10.9634 6.03661C10.939 6.0122 10.9095 6 10.875 6ZM8 11L3 11C2.86193 11 2.74408 10.9512 2.64645 10.8536C2.54882 10.7559 2.5 10.6381 2.5 10.5C2.5 10.3619 2.54882 10.2441 2.64645 10.1464C2.74408 10.0488 2.86193 10 3 10L8 10C8.13807 10 8.25592 10.0488 8.35355 10.1464C8.45118 10.2441 8.5 10.3619 8.5 10.5C8.5 10.6381 8.45118 10.7559 8.35355 10.8536C8.25592 10.9512 8.13807 11 8 11ZM8 8.5L3 8.5C2.86193 8.5 2.74408 8.45118 2.64645 8.35355C2.54882 8.25592 2.5 8.13807 2.5 8C2.5 7.86193 2.54882 7.74408 2.64645 7.64645C2.74408 7.54882 2.86193 7.5 3 7.5L8 7.5C8.13807 7.5 8.25592 7.54882 8.35355 7.64645C8.45118 7.74408 8.5 7.86193 8.5 8C8.5 8.13807 8.45118 8.25592 8.35355 8.35355C8.25592 8.45118 8.13807 8.5 8 8.5Z" fill-rule="nonzero" transform="matrix(1 0 0 1 2.5 1)" fill="rgb(55, 65, 81)"/>
<path d="M4.60063 4.51228L0.106563 0.0182223C0.097628 0.00934013 0.0869808 0.00367733 0.0746212 0.00123394C0.0622616 -0.00120946 0.0502605 -2.40803e-05 0.0386181 0.00479007C0.0269756 0.00960422 0.017642 0.0172406 0.0106173 0.0276991C0.00359249 0.0381577 5.34058e-05 0.0496862 0 0.0622848L0 4.11885C0 4.25692 0.0488154 4.37477 0.146446 4.4724C0.244077 4.57003 0.361928 4.61885 0.5 4.61885L4.55656 4.61885C4.56916 4.61879 4.58069 4.61526 4.59115 4.60823C4.60161 4.60121 4.60924 4.59187 4.61406 4.58023C4.61887 4.56859 4.62006 4.55659 4.61761 4.54423C4.61517 4.53187 4.60951 4.52122 4.60063 4.51228Z" fill-rule="nonzero" transform="matrix(1 0 0 1 8.5 1.38115)" fill="rgb(55, 65, 81)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

11
src/icon/plink/tag.svg Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
<defs>
<clipPath id="clipPath5101496573">
<path d="M0 0L16 0L16 16L0 16L0 0Z" fill-rule="nonzero" transform="matrix(1 0 0 1 0 0)"/>
</clipPath>
</defs>
<g clip-path="url(#clipPath5101496573)">
<path d="M13.5939 0.412504C13.4631 0.280143 13.3117 0.178199 13.1399 0.106672C12.9681 0.0351444 12.7891 -0.00041159 12.603 3.57628e-06L8.76141 3.57628e-06C8.63541 0.000238498 8.51418 0.0244096 8.39773 0.0725168C8.28128 0.120624 8.17834 0.189057 8.08891 0.277816L0.409219 7.95594C0.136406 8.22931 0 8.55911 0 8.94532C0 9.33153 0.136406 9.66132 0.409219 9.93469L4.06547 13.5909C4.33891 13.8639 4.66881 14.0003 5.05516 14.0003C5.4415 14.0003 5.7714 13.8639 6.04484 13.5909L13.7214 5.91594C13.8103 5.82666 13.8789 5.72381 13.9272 5.6074C13.9755 5.49099 13.9998 5.36977 14.0002 5.24375L14.0002 1.4C14.0013 1.21486 13.9667 1.03667 13.8962 0.865449C13.8258 0.694224 13.725 0.543242 13.5939 0.412504ZM11.0002 4C10.724 4 10.4883 3.90237 10.293 3.70711C10.0978 3.51185 10.0002 3.27615 10.0002 3C10.0002 2.72386 10.0978 2.48816 10.293 2.2929C10.4883 2.09763 10.724 2 11.0002 2C11.2763 2 11.512 2.09763 11.7073 2.2929C11.9025 2.48816 12.0002 2.72386 12.0002 3C12.0002 3.27615 11.9025 3.51185 11.7073 3.70711C11.512 3.90237 11.2763 4 11.0002 4Z" fill-rule="nonzero" transform="matrix(1 0 0 1 0.999844 0.999996)" fill="rgb(55, 65, 81)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

12
src/icon/plink/uri.svg Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
<defs>
<clipPath id="clipPath6925244028">
<path d="M0 0L16 0L16 16L0 16L0 0Z" fill-rule="nonzero" transform="matrix(1 0 0 1 0 0)"/>
</clipPath>
</defs>
<g clip-path="url(#clipPath6925244028)">
<path d="M5.64616 8.58154C5.83085 7.93467 5.95303 7.1831 5.9996 6.46154C6.00177 6.42172 5.98905 6.38742 5.96145 6.35864C5.93384 6.32985 5.9001 6.31572 5.86022 6.31623L3.6396 6.31623C3.60137 6.31588 3.56861 6.3291 3.54134 6.35589C3.51406 6.38268 3.50025 6.41519 3.49991 6.45342L3.49991 8.18154C3.50031 8.21774 3.51295 8.24899 3.53781 8.27529C3.56268 8.3016 3.59317 8.31598 3.62928 8.31842C3.94218 8.3437 4.25274 8.3861 4.56096 8.4456C4.86919 8.5051 5.17321 8.58136 5.47303 8.67436C5.50975 8.6854 5.545 8.68186 5.57879 8.66374C5.61258 8.64563 5.63503 8.61823 5.64616 8.58154ZM5.10959 9.60717C4.87173 9.53772 4.63118 9.47927 4.38797 9.43183C4.14475 9.38439 3.89988 9.34815 3.65334 9.3231C3.61305 9.3186 3.57764 9.32969 3.54711 9.35636C3.51659 9.38303 3.50085 9.41664 3.49991 9.45717L3.49991 11.4959C3.50155 11.5492 3.52573 11.5886 3.57246 11.6142C3.61919 11.6397 3.66542 11.6389 3.71116 11.6115C4.20803 11.3219 4.61741 10.8353 4.98741 10.1919C5.04803 10.0869 5.14022 9.90592 5.19585 9.79529C5.21426 9.75735 5.21468 9.71922 5.1971 9.68088C5.17953 9.64255 5.15036 9.61797 5.10959 9.60717ZM2.35053 9.32873C2.1043 9.35215 1.85968 9.38688 1.61666 9.43292C1.37364 9.47895 1.13327 9.5361 0.895532 9.60435C0.813032 9.62811 0.778344 9.74185 0.815844 9.81654C0.871781 9.92779 0.940844 10.07 0.999907 10.1762C1.40616 10.895 1.83866 11.3481 2.28866 11.6115C2.33439 11.6389 2.38062 11.6397 2.42735 11.6142C2.47408 11.5886 2.49827 11.5492 2.49991 11.4959L2.49991 9.45623C2.49959 9.41669 2.48439 9.38408 2.45431 9.3584C2.42423 9.33273 2.38964 9.32283 2.35053 9.32873ZM2.36022 6.31623L0.139594 6.31623C0.0997814 6.31572 0.0660791 6.32982 0.0384874 6.35853C0.0108951 6.38723 -0.0018611 6.42147 0.000218868 6.46123C0.0464687 7.18186 0.168031 7.93498 0.352094 8.58123C0.363079 8.61845 0.385668 8.64623 0.419861 8.66458C0.454054 8.68293 0.489694 8.6864 0.526781 8.67498C0.826582 8.58198 1.1306 8.5058 1.43883 8.44645C1.74706 8.3871 2.05763 8.34495 2.37053 8.31998C2.40671 8.31761 2.43726 8.30327 2.4622 8.27696C2.48713 8.25064 2.49981 8.21936 2.50022 8.18311L2.50022 6.45373C2.49996 6.41538 2.48615 6.38277 2.45879 6.35589C2.43143 6.32902 2.39857 6.3158 2.36022 6.31623ZM3.65397 2.30935C3.90034 2.28627 4.14492 2.25086 4.38773 2.20314C4.63053 2.15542 4.87032 2.09561 5.1071 2.02373C5.14758 2.01279 5.17658 1.98826 5.19411 1.95017C5.21163 1.91207 5.21138 1.87409 5.19335 1.83623C5.13741 1.72467 5.05991 1.56498 5.00053 1.45842C4.61647 0.770917 4.18366 0.29123 3.71178 0.0209172C3.66604 -0.00616765 3.61986 -0.00694919 3.57323 0.0185726C3.5266 0.0440942 3.50237 0.0834173 3.50053 0.136542L3.50053 2.17498C3.50148 2.21553 3.51721 2.24916 3.54773 2.27588C3.57824 2.3026 3.61365 2.31376 3.65397 2.30935ZM3.6396 5.31623L5.86022 5.31623C5.89972 5.3169 5.93326 5.30308 5.96082 5.27477C5.98839 5.24647 6.00131 5.21258 5.9996 5.1731C5.95334 4.46154 5.83491 3.67935 5.65085 3.04123C5.63952 3.00433 5.61679 2.97687 5.58265 2.95885C5.54851 2.94083 5.51301 2.93756 5.47616 2.94904C4.88241 3.12842 4.26397 3.27498 3.6296 3.32404C3.59364 3.32608 3.56318 3.34009 3.53823 3.36606C3.51328 3.39204 3.5005 3.42303 3.49991 3.45904L3.49991 5.18123C3.50059 5.21914 3.51457 5.25127 3.54183 5.27762C3.56909 5.30397 3.60168 5.31684 3.6396 5.31623ZM2.28866 0.0212295C1.80678 0.289042 1.37709 0.784667 0.99272 1.47029C0.933032 1.57685 0.861782 1.72373 0.80522 1.83498C0.787316 1.87284 0.787115 1.91079 0.804617 1.94884C0.82212 1.98689 0.85107 2.01144 0.89147 2.02248C1.12815 2.09568 1.36803 2.15623 1.6111 2.20412C1.85417 2.25202 2.09908 2.28699 2.34584 2.30904C2.3861 2.31344 2.42148 2.30232 2.45198 2.27568C2.48247 2.24903 2.49824 2.21546 2.49928 2.17498L2.49928 0.136855C2.49712 0.0840894 2.4729 0.0450005 2.42661 0.0195878C2.38031 -0.00582512 2.33433 -0.00527803 2.28866 0.0212295ZM2.37022 3.32435C1.73584 3.27592 1.11678 3.12935 0.523657 2.94935C0.486801 2.93788 0.451304 2.94114 0.417164 2.95916C0.383024 2.97718 0.360293 3.00464 0.34897 3.04154C0.164907 3.67967 0.0464697 4.46185 0.000219822 5.17342C-0.00149584 5.21289 0.0114285 5.24678 0.0389929 5.27508C0.0665569 5.30339 0.100091 5.31721 0.139595 5.31654L2.36022 5.31654C2.39825 5.31715 2.43091 5.30421 2.4582 5.27771C2.48549 5.25121 2.49939 5.21895 2.49991 5.18092L2.49991 3.45935C2.49931 3.42334 2.48654 3.39235 2.46159 3.36638C2.43663 3.3404 2.40618 3.3264 2.37022 3.32435Z" fill-rule="nonzero" transform="matrix(1 0 0 1 5.00228 2.18377)" fill="rgb(55, 65, 81)"/>
<path d="M11.9739 2.07454C10.6091 0.696278 8.95682 0.00477179 7.01714 2.45571e-05C5.07745 -0.00472267 3.42182 0.678688 2.05026 2.05026C0.678688 3.42182 -0.00472267 5.07745 2.45571e-05 7.01714C0.00477179 8.95682 0.696278 10.6091 2.07454 11.9739C3.43938 13.3522 5.09164 14.0437 7.03133 14.0484C8.97101 14.0532 10.6266 13.3698 11.9982 11.9982C13.3698 10.6266 14.0532 8.97101 14.0484 7.03133C14.0437 5.09164 13.3522 3.43938 11.9739 2.07454ZM4.54298 12.4883C4.47258 12.3894 4.40486 12.2888 4.33981 12.1863C4.27477 12.0838 4.21249 11.9797 4.15298 11.8739C4.09048 11.7586 4.00173 11.5845 3.94267 11.4636C3.91402 11.4029 3.86759 11.3627 3.8034 11.343C3.73921 11.3233 3.67824 11.3306 3.62048 11.3649C3.48611 11.4402 3.30798 11.5436 3.17892 11.6283C3.04359 11.5254 2.91436 11.4154 2.79122 11.2982C2.66809 11.181 2.5518 11.0574 2.44236 10.9274C2.59371 10.8205 2.74867 10.7192 2.90726 10.6235C3.06585 10.5278 3.22765 10.4378 3.39267 10.3536C3.45079 10.3224 3.47923 10.2867 3.46079 10.223C3.33989 9.80453 3.24263 9.38066 3.16902 8.95135C3.0954 8.52205 3.04589 8.08999 3.02048 7.65517C3.01891 7.61907 3.00515 7.58844 2.97921 7.56328C2.95327 7.53813 2.92224 7.52532 2.88611 7.52486L1.11298 7.52486C1.0974 7.52503 1.08367 7.52007 1.0718 7.50998C1.05992 7.49989 1.05282 7.48714 1.05048 7.47173C1.04066 7.39757 1.03356 7.32314 1.02918 7.24846C1.0248 7.17378 1.02315 7.09903 1.02423 7.02423C1.02316 6.94957 1.02487 6.87498 1.02936 6.80045C1.03384 6.72592 1.04109 6.65166 1.05111 6.57767C1.05344 6.56226 1.06055 6.54951 1.07242 6.53942C1.0843 6.52933 1.09802 6.52437 1.11361 6.52454L2.88673 6.52454C2.95829 6.52454 3.01704 6.48329 3.02079 6.41111C3.04587 5.97809 3.09498 5.54782 3.16812 5.12029C3.24127 4.69276 3.33799 4.27064 3.45829 3.85392C3.46754 3.82254 3.46571 3.79182 3.45283 3.76175C3.43994 3.73169 3.41895 3.70918 3.38986 3.69423C3.22838 3.61149 3.06985 3.52346 2.91426 3.43012C2.75867 3.33679 2.60637 3.23837 2.45736 3.13486C2.56622 3.00483 2.68104 2.8803 2.80184 2.76128C2.92264 2.64225 3.04885 2.52928 3.18048 2.42236C3.30798 2.50611 3.47423 2.60079 3.60736 2.67579C3.66932 2.71102 3.73434 2.71805 3.8024 2.69689C3.87047 2.67573 3.92004 2.63307 3.95111 2.56892C4.00986 2.44798 4.07611 2.31329 4.14048 2.19767C4.20025 2.09058 4.26281 1.98515 4.32817 1.88138C4.39353 1.77761 4.46159 1.67564 4.53236 1.57548C4.92195 1.39194 5.327 1.25366 5.7475 1.16064C6.16799 1.06761 6.59357 1.02215 7.02423 1.02423C7.92861 1.02423 8.77111 1.24298 9.54079 1.60111C9.60875 1.69651 9.674 1.79373 9.73655 1.89277C9.7991 1.9918 9.85884 2.0925 9.91579 2.19486C9.99673 2.34048 10.0827 2.51892 10.1552 2.67361C10.1716 2.70837 10.1981 2.73174 10.2346 2.74372C10.2712 2.75569 10.3063 2.75253 10.3402 2.73423C10.5083 2.64329 10.6905 2.53861 10.8508 2.43329C10.9828 2.54127 11.1094 2.65529 11.2305 2.77535C11.3516 2.89542 11.4667 3.02098 11.5758 3.15204C11.4309 3.25256 11.2826 3.34795 11.1311 3.43821C10.9795 3.52847 10.8251 3.6134 10.6677 3.69298C10.6385 3.70795 10.6175 3.73051 10.6047 3.76066C10.5918 3.79082 10.5901 3.82159 10.5995 3.85298C10.7218 4.26687 10.8191 4.68654 10.8915 5.112C10.9639 5.53745 11.0109 5.9657 11.0324 6.39673C11.0341 6.43263 11.0479 6.46301 11.0739 6.48787C11.0998 6.51274 11.1308 6.52527 11.1667 6.52548L12.9361 6.52329C12.9517 6.52312 12.9654 6.52807 12.9773 6.53817C12.9892 6.54826 12.9963 6.56101 12.9986 6.57642C13.0168 6.72492 13.0259 6.87399 13.0259 7.02361C13.0259 7.17323 13.0168 7.32229 12.9986 7.47079C12.9964 7.48632 12.9894 7.49921 12.9775 7.50943C12.9656 7.51966 12.9518 7.5247 12.9361 7.52454L11.1652 7.52454C11.129 7.52493 11.0979 7.53771 11.072 7.56289C11.046 7.58806 11.0323 7.61872 11.0308 7.65486C11.0065 8.08508 10.9581 8.51259 10.8856 8.93737C10.8131 9.36215 10.717 9.78152 10.5974 10.1955C10.588 10.2272 10.5898 10.2583 10.6026 10.2888C10.6155 10.3193 10.6366 10.3422 10.6658 10.3577C10.822 10.4386 10.9961 10.5289 11.1461 10.6208C11.2961 10.7127 11.4445 10.8108 11.5877 10.9127C11.4794 11.0431 11.3652 11.1682 11.2452 11.2879C11.1251 11.4076 10.9997 11.5214 10.8689 11.6292C10.7927 11.5789 10.702 11.5217 10.6239 11.4749C10.5702 11.4436 10.4711 11.3883 10.4161 11.3574C10.2967 11.2905 10.1699 11.3405 10.1102 11.4636C10.0505 11.5867 9.95923 11.7633 9.89548 11.8777C9.83674 11.9828 9.77519 12.0863 9.71082 12.1881C9.64645 12.2899 9.57936 12.3898 9.50954 12.488C8.74017 12.8483 7.92861 13.0242 7.02423 13.0242C6.11986 13.0242 5.31267 12.8483 4.54298 12.4883Z" fill-rule="nonzero" transform="matrix(1 0 0 1 0.975769 0.975769)" fill="rgb(55, 65, 81)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.0 KiB

11
src/icon/plink/user.svg Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
<defs>
<clipPath id="clipPath7820171251">
<path d="M0 0L16 0L16 16L0 16L0 0Z" fill-rule="nonzero" transform="matrix(1 0 0 1 0 0)"/>
</clipPath>
</defs>
<g clip-path="url(#clipPath7820171251)">
<path d="M8.89518 1.01813C8.28705 0.361562 7.43768 0 6.50018 0C5.55768 0 4.70549 0.359375 4.10018 1.01188C3.4883 1.67156 3.19018 2.56813 3.26018 3.53625C3.39893 5.44625 4.85237 7 6.50018 7C8.14799 7 9.59893 5.44656 9.73987 3.53687C9.8108 2.5775 9.5108 1.68281 8.89518 1.01813ZM12.0002 14L1.00018 14C0.854387 14.0019 0.715258 13.9724 0.582793 13.9115C0.450327 13.8505 0.337372 13.7641 0.243929 13.6522C0.0408037 13.4094 -0.0410713 13.0778 0.0195537 12.7425C0.283304 11.2794 1.10643 10.0503 2.40018 9.1875C3.54955 8.42156 5.00549 8 6.50018 8C7.99487 8 9.4508 8.42188 10.6002 9.1875C11.8939 10.05 12.7171 11.2791 12.9808 12.7422C13.0414 13.0775 12.9596 13.4091 12.7564 13.6519C12.663 13.7639 12.5501 13.8503 12.4176 13.9113C12.2851 13.9723 12.146 14.0019 12.0002 14Z" fill-rule="nonzero" transform="matrix(1 0 0 1 1.49982 1)" fill="rgb(55, 65, 81)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -16,7 +16,7 @@
<div
class="card h-full flex items-center justify-center rounded-md shadow-lg overflow-hidden group transition-transform duration-300 box-border hover:-translate-y-1.5">
<!-- <div class="image-wrapper"> -->
<LazyImg class="rounded-md shadow overflow-hidden" :Pwidth="item.width" :Pheight="item.height" :url="item.filepath" />
<LazyImg class="rounded-md overflow-hidden" :Pwidth="item.width" :Pheight="item.height" :url="item.filepath" />
<!-- </div> -->
<div
class="hidden truncate group-hover:block absolute rounded-md z-10 truncate top-0 text-center w-full bg-[#00000070] text-white">

View File

@ -6,7 +6,7 @@
<n-input-group class="shadow ">
<n-select class="w-24" size="large" v-model:value="broswer" :options="options"
@click="cancelSbox"></n-select>
<n-input class="flex-1" size="large" v-model:value="searchWord" @blur="cancelSbox" placeholder="请输入">
<n-input class="flex-1" size="large" autofocus v-model:value="searchWord" @blur="cancelSbox" placeholder="请输入">
<template #suffix>
<n-icon size="large">
<icon-search />

View File

@ -1,12 +1,115 @@
<template>
<div class="plink-page">
<h1>友链页</h1>
<!-- 友链内容 -->
<icon-loading class="zhuan text-primary w-12 h-12" />
<div class="plink-page pt-4 flex justify-between" :style="boxStyle">
<div class="left ml-4 ">
<n-card class="card w-100 shadow">
<template #header>
<div class="flex items-center gap-4 text-primary text-xl font-bold">
<icon-loading class="zhuan text-primary w-6 h-6" />
申请友链
</div>
</template>
<div>
<n-form :model="plinkData" ref="formRef" :rules="rules" label-width="80" :inline="false"
feedback-style="font-size: 12px">
<n-form-item path="name">
<template #label>
<div class="flex items-center gap-1 text-sm text-gray-500">
<user-icon></user-icon>
昵称
</div>
</template>
<n-input v-model:value="plinkData.name" placeholder="请输入你的昵称" />
</n-form-item>
<n-form-item path="title">
<template #label>
<div class="flex items-center gap-1 text-sm text-gray-500">
<site-icon></site-icon>
网站名称
</div>
</template>
<n-input v-model:value="plinkData.title" placeholder="请输入你的网站名称" />
</n-form-item>
<n-form-item path="url">
<template #label>
<div class="flex items-center gap-1 text-sm text-gray-500">
<url-icon></url-icon>
站点地址
</div>
</template>
<n-input v-model:value="plinkData.url" placeholder="请输入你的网站地址" />
</n-form-item>
<n-form-item path="avater">
<template #label>
<div class="flex items-center gap-1 text-sm text-gray-500">
<ava-icon></ava-icon>
头像链接
</div>
</template>
<n-input v-model:value="plinkData.avater" placeholder="请输入你的头像链接" />
</n-form-item>
<n-form-item path="desc">
<template #label>
<div class="flex items-center gap-1 text-sm text-gray-500">
<desc-icon></desc-icon>
站点介绍
</div>
</template>
<n-input type="textarea" :autosize="{ minRows: 2, maxRows: 3 }" maxlength="50" v-model:value="plinkData.desc"
placeholder="请用一句话简短的描述你的站点" />
</n-form-item>
<n-form-item path="tagname">
<template #label>
<div class="flex items-center gap-1 text-sm text-gray-500">
<tag-icon></tag-icon>
标签
</div>
</template>
<n-input type="textarea" :autosize="{ minRows: 2, maxRows: 3 }" maxlength="50" v-model:value="plinkData.tagname"
placeholder="输入你的标签用逗号隔开注意每个标签最多3个字符且只显示前3个标签哦~" />
</n-form-item>
<n-form-item>
<n-button class="w-full" type="primary" @click="submitPut">申请友链</n-button>
</n-form-item>
</n-form>
</div>
</n-card>
<div class="mt-4 text-right text-primary text-sm font-italic">申请完不显示是因为需要审核奥~~</div>
</div>
<n-scrollbar class="h-full">
<div class="right h-full grid grid-cols-3 gap-5 flex-1 px-12">
<div
class="rounded-lg bg-white shadow flex flex-col items-center justify-center p-4 cursor-pointer transition-transform duration-300 box-border hover:-translate-y-1.5"
v-for="p in pList" :key="p.pid" @click="gotoWebsite(p.url)">
<div class="ava">
<n-avatar round size="large" :src="p.avater"></n-avatar>
</div>
<div class="text-primary">
{{ p.title }}
</div>
<em class="text-gray-400 text-sm">{{ p.name }}</em>
<div class="flex gap-1 truncate">
<div v-for="i in getTags(p.tagname)" :key="i.tid" class="flex items-center gap-1 text-deepp text-sm">
<icon-tag2 class="w-3 h-3 !text-deepp" />{{ i }}
</div>
</div>
<div class="truncate w-full text-gray-400 text-sm text-center">
{{ p.desc }}
</div>
</div>
</div>
</n-scrollbar>
</div>
</template>
<script setup lang="ts">
import avaIcon from '@/icon/plink/ava.svg';
import descIcon from '@/icon/plink/desc.svg';
import siteIcon from '@/icon/plink/site.svg';
import tagIcon from '@/icon/plink/tag.svg';
import urlIcon from '@/icon/plink/uri.svg';
import userIcon from '@/icon/plink/user.svg';
definePage({
name: 'plink',
meta: {
@ -14,6 +117,74 @@ definePage({
}
})
// 友链页逻辑
const boxStyle: any = ref({})
const nav: any = $store.nav.useNavStore()
const plinkData = reactive<any>({
name: '',
title: '',
avater: '',
url: '',
desc: '',
tagname: '',
});
const rules: any = {
name: [{ required: true, message: '昵称不能为空~~', trigger: ['blur'] }],
title: [{ required: true, message: '网站名称不能为空~~', trigger: ['blur'] }],
url: [{ required: true, message: '站点地址不能为空~~', trigger: ['blur'] }],
avater: [{ required: true, message: '头像链接不能为空~~', trigger: ['blur'] }],
desc: [{ required: true, message: '站点介绍不能为空~~', trigger: ['blur'] }],
tagname: [{ required: true, message: '标签不能为空~~', trigger: ['blur'] }],
}
const pList = ref<any>([])
const formRef = ref<any>(null)
async function getPlinkList() {
const res = await $http.plink.getPlinkList()
pList.value = res.data
// for (let i = 0; i < 20; i++) {
// pList.value.push(res.data[0])
// }
}
function getTags(str: any) {
str = str.replaceAll('', ',')
let tags = str.split(',').slice(0, 3)
tags.forEach((tag: any, idx: number) => {
tags[idx] = tag.trim().slice(0, 3)
});
return tags
}
function gotoWebsite(url: string) {
window.open(url, '_blank')
}
function submitPut() {
formRef.value?.validate(async (valid: boolean) => {
if (valid) {
$msg.error('请完善表单~~')
} else {
const res = await $http.plink.addPlink(plinkData)
if (res?.code !== 200) {
$msg.error(res.msg)
return
}
$msg.success(res.msg)
plinkData.name = ''
plinkData.title = ''
plinkData.avater = ''
plinkData.url = ''
plinkData.desc = ''
plinkData.tagname = ''
getPlinkList()
}
})
}
onMounted(() => {
boxStyle.value = {
height: window.innerHeight - nav.navH - 1 + 'px',
}
getPlinkList()
})
</script>
<style scoped>
@ -22,6 +193,7 @@ definePage({
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
@ -34,7 +206,8 @@ definePage({
animation: spin 1.5s linear infinite;
}
:deep(.n-form-item-feedback__line) {
text-align: right;
font-size: 12px !important;
}
</style>

View File

@ -41,7 +41,7 @@
</div>
</div>
</div>
<div class="mt-20 w-[80%] ml-1/10 cursor-pointer flex justify-center">
<div v-show="blogList.length != 0" class="mt-20 w-[80%] ml-1/10 cursor-pointer flex justify-center">
<n-pagination v-model:page="page_num" :page-count="total" :page-slot="5" @update:page="getBlogList" />
</div>
</div>