查看更多

diff --git a/css/bi.css b/css/bi.css
new file mode 100644
index 0000000..7fd8139
--- /dev/null
+++ b/css/bi.css
@@ -0,0 +1,203 @@
+body {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
+ font-size: 14px;
+ color: #333;
+ margin: 0;
+ padding: 0;
+}
+.container {
+ width: 1027px;
+ height: 755px;
+ border: 1px solid #e4e4e4;
+ border-radius: 11px;
+ margin: 20px;
+ padding-top: 22px;
+}
+.container * {
+ padding: 0;
+ margin: 0;
+}
+.title {
+ display: flex;
+ align-items: center;
+ margin: 0 12px 20px;
+}
+.title img {
+ width: 29px;
+ height: 34px;
+ margin-right: 8px;
+}
+.title h2 {
+ font-family: PingFangSC-Semibold, "PingFang SC Semibold", "PingFang SC", sans-serif;
+ font-weight: 650;
+ font-style: normal;
+ font-size: 16px;
+ color: #000000;
+ line-height: 30px;
+}
+/* 主标题样式扩展 */
+.bi-main-title {
+ display: flex;
+ align-items: center;
+ margin: 0 12px 20px;
+}
+.bi-main-title-icon {
+ width: 29px;
+ height: 34px;
+ margin-right: 8px;
+}
+.bi-main-title-heading {
+ font-family: PingFangSC-Semibold, "PingFang SC Semibold", "PingFang SC", sans-serif;
+ font-weight: 650;
+ font-style: normal;
+ font-size: 16px;
+ color: #000000;
+ line-height: 30px;
+}
+/* 寄托币表格样式扩展 */
+.bi-table {
+ width: calc(100% - 24px);
+ border-collapse: collapse;
+ margin: 0 12px 25px;
+}
+.bi-table-header {
+ background-color: #f5f5f5;
+ font-weight: bold;
+ font-family: PingFangSC-Semibold, "PingFang SC Semibold", "PingFang SC", sans-serif;
+ font-weight: 650;
+ font-style: normal;
+ font-size: 14px;
+ color: #000000;
+ text-align: center;
+ height: 33px;
+}
+.bi-table-header.bi-table-event {
+ /* 事件列特殊样式 */
+}
+.bi-table-header.bi-table-reward {
+ /* 奖励列特殊样式 */
+}
+.bi-table-header.bi-table-limit {
+ /* 上限列特殊样式 */
+}
+.bi-table-body {
+ /* 表格主体样式 */
+}
+.bi-table-row:nth-child(even) {
+ background-color: #f5f5f5;
+}
+.bi-table-cell {
+ color: #333333;
+ font-size: 14px;
+ text-align: center;
+ height: 33px;
+}
+.bi-table-cell.bi-table-event {
+ /* 事件单元格样式 */
+}
+.bi-table-cell.bi-table-reward {
+ /* 奖励单元格样式 */
+}
+.bi-table-cell.bi-table-limit {
+ /* 上限单元格样式 */
+}
+.supplement {
+ margin: 0 12px 30px;
+}
+.supplement h3 {
+ font-weight: bold;
+ font-size: 14px;
+ line-height: 25px;
+}
+.supplement ul {
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+}
+.supplement li {
+ font-size: 14px;
+ line-height: 25px;
+}
+/* 补充说明样式扩展 */
+.bi-supplement {
+ margin: 0 12px 30px;
+}
+.bi-supplement-title {
+ font-weight: bold;
+ font-size: 14px;
+ line-height: 25px;
+}
+.bi-supplement-list {
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+}
+.bi-supplement-item {
+ font-size: 14px;
+ line-height: 25px;
+}
+.divider {
+ height: 1px;
+ background-color: #eee;
+ margin-bottom: 37px;
+}
+.usage {
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 8px;
+}
+.usage img {
+ width: 29px;
+ height: 34px;
+ margin-right: 8px;
+}
+.usage h3 {
+ font-family: PingFangSC-Semibold, "PingFang SC Semibold", "PingFang SC", sans-serif;
+ font-weight: 650;
+ font-style: normal;
+ font-size: 16px;
+ color: #000000;
+ line-height: 30px;
+}
+.usage ul {
+ list-style-type: none;
+ padding: 0 0 0 32px;
+ margin: 0;
+}
+.usage li {
+ margin-bottom: 4px;
+}
+/* 寄托币用途样式扩展 */
+.bi-usage {
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 8px;
+}
+.bi-usage-title {
+ display: flex;
+ align-items: center;
+ margin-bottom: 10px;
+}
+.bi-usage-icon {
+ width: 29px;
+ height: 34px;
+ margin-right: 8px;
+}
+.bi-usage-heading {
+ font-family: PingFangSC-Semibold, "PingFang SC Semibold", "PingFang SC", sans-serif;
+ font-weight: 650;
+ font-style: normal;
+ font-size: 16px;
+ color: #000000;
+ line-height: 30px;
+}
+.bi-usage-list {
+ list-style-type: none;
+ padding: 0 0 0 32px;
+ margin: 0;
+}
+.bi-usage-item {
+ margin-bottom: 4px;
+ font-size: 14px;
+ color: #333;
+}
diff --git a/css/bi.less b/css/bi.less
new file mode 100644
index 0000000..a299887
--- /dev/null
+++ b/css/bi.less
@@ -0,0 +1,259 @@
+body {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
+ font-size: 14px;
+ color: #333;
+ margin: 0;
+ padding: 0;
+}
+.container {
+ width: 1027px;
+ height: 755px;
+ border: 1px solid rgb(228, 228, 228);
+ border-radius: 11px;
+ margin: 20px;
+ padding-top: 22px;
+ * {
+ padding: 0;
+ margin: 0;
+ }
+}
+.title {
+ display: flex;
+ align-items: center;
+ margin: 0 12px 20px;
+
+ img {
+ width: 29px;
+ height: 34px;
+ margin-right: 8px;
+ }
+ h2 {
+ font-family: PingFangSC-Semibold, "PingFang SC Semibold", "PingFang SC", sans-serif;
+ font-weight: 650;
+ font-style: normal;
+ font-size: 16px;
+ color: rgb(0, 0, 0);
+ line-height: 30px;
+ }
+}
+
+/* 主标题样式扩展 */
+.bi-main-title {
+ display: flex;
+ align-items: center;
+ margin: 0 12px 20px;
+
+ &-icon {
+ width: 29px;
+ height: 34px;
+ margin-right: 8px;
+ }
+
+ &-heading {
+ font-family: PingFangSC-Semibold, "PingFang SC Semibold", "PingFang SC", sans-serif;
+ font-weight: 650;
+ font-style: normal;
+ font-size: 16px;
+ color: rgb(0, 0, 0);
+ line-height: 30px;
+ }
+}
+
+// .table {
+// width: calc(100% - 24px);
+// border-collapse: collapse;
+// margin: 0 12px 25px;
+// }
+// .table th,
+// .table td {
+// text-align: center;
+// height: 33px;
+// }
+// .table th {
+// background-color: #f5f5f5;
+// font-weight: bold;
+// font-family: PingFangSC-Semibold, "PingFang SC Semibold", "PingFang SC", sans-serif;
+// font-weight: 650;
+// font-style: normal;
+// font-size: 14px;
+// color: rgb(0, 0, 0);
+// }
+
+// .table td {
+// color: rgb(51, 51, 51);
+// font-size: 14px;
+// }
+
+// .table tr:nth-child(even) {
+// background-color: rgb(245, 245, 245);
+// }
+
+/* 寄托币表格样式扩展 */
+.bi-table {
+ width: calc(100% - 24px);
+ border-collapse: collapse;
+ margin: 0 12px 25px;
+
+ &-header {
+ background-color: #f5f5f5;
+ font-weight: bold;
+ font-family: PingFangSC-Semibold, "PingFang SC Semibold", "PingFang SC", sans-serif;
+ font-weight: 650;
+ font-style: normal;
+ font-size: 14px;
+ color: rgb(0, 0, 0);
+ text-align: center;
+ height: 33px;
+
+ &.bi-table-event {
+ /* 事件列特殊样式 */
+ }
+
+ &.bi-table-reward {
+ /* 奖励列特殊样式 */
+ }
+
+ &.bi-table-limit {
+ /* 上限列特殊样式 */
+ }
+ }
+
+ &-body {
+ /* 表格主体样式 */
+ }
+
+ &-row {
+ &:nth-child(even) {
+ background-color: rgb(245, 245, 245);
+ }
+ }
+
+ &-cell {
+ color: rgb(51, 51, 51);
+ font-size: 14px;
+ text-align: center;
+ height: 33px;
+
+ &.bi-table-event {
+ /* 事件单元格样式 */
+ }
+
+ &.bi-table-reward {
+ /* 奖励单元格样式 */
+ }
+
+ &.bi-table-limit {
+ /* 上限单元格样式 */
+ }
+ }
+}
+.supplement {
+ margin: 0 12px 30px;
+}
+.supplement h3 {
+ font-weight: bold;
+ font-size: 14px;
+ line-height: 25px;
+}
+.supplement ul {
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+}
+.supplement li {
+ font-size: 14px;
+ line-height: 25px;
+}
+
+/* 补充说明样式扩展 */
+.bi-supplement {
+ margin: 0 12px 30px;
+
+ &-title {
+ font-weight: bold;
+ font-size: 14px;
+ line-height: 25px;
+ }
+
+ &-list {
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+ }
+
+ &-item {
+ font-size: 14px;
+ line-height: 25px;
+ }
+}
+.divider {
+ height: 1px;
+ background-color: #eee;
+ margin-bottom: 37px;
+}
+.usage {
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 8px;
+}
+.usage img {
+ width: 29px;
+ height: 34px;
+ margin-right: 8px;
+}
+.usage h3 {
+ font-family: PingFangSC-Semibold, "PingFang SC Semibold", "PingFang SC", sans-serif;
+ font-weight: 650;
+ font-style: normal;
+ font-size: 16px;
+ color: rgb(0, 0, 0);
+ line-height: 30px;
+}
+.usage ul {
+ list-style-type: none;
+ padding: 0 0 0 32px;
+ margin: 0;
+}
+.usage li {
+ margin-bottom: 4px;
+}
+
+/* 寄托币用途样式扩展 */
+.bi-usage {
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 8px;
+
+ &-title {
+ display: flex;
+ align-items: center;
+ margin-bottom: 10px;
+ }
+
+ &-icon {
+ width: 29px;
+ height: 34px;
+ margin-right: 8px;
+ }
+
+ &-heading {
+ font-family: PingFangSC-Semibold, "PingFang SC Semibold", "PingFang SC", sans-serif;
+ font-weight: 650;
+ font-style: normal;
+ font-size: 16px;
+ color: rgb(0, 0, 0);
+ line-height: 30px;
+ }
+
+ &-list {
+ list-style-type: none;
+ padding: 0 0 0 32px;
+ margin: 0;
+ }
+
+ &-item {
+ margin-bottom: 4px;
+ font-size: 14px;
+ color: #333;
+ }
+}
diff --git a/css/details.css b/css/details.css
index 4c5fc96..12dc3aa 100644
--- a/css/details.css
+++ b/css/details.css
@@ -211,7 +211,7 @@
position: absolute;
left: 50%;
transform: translateX(-50%);
- bottom: 42px;
+ bottom: 48px;
width: 130px;
height: 100px;
background-color: #ffffff;
@@ -220,10 +220,22 @@
flex-direction: column;
display: none;
}
+#details .matter .matter-left .action-bar .action-bar-item .share-box::after {
+ content: "";
+ width: 0;
+ height: 0;
+ border-left: 8px solid transparent;
+ border-right: 8px solid transparent;
+ border-top: 8px solid #000000;
+ position: absolute;
+ bottom: -8px;
+ left: 50%;
+ transform: translateX(-50%);
+}
#details .matter .matter-left .action-bar .action-bar-item .share-box .share-item {
width: 100%;
height: 40px;
- color: #555555;
+ color: #333;
font-size: 14px;
}
#details .matter .matter-left .action-bar .action-bar-item .share-box .share-item:hover {
@@ -689,7 +701,7 @@
cursor: pointer;
}
.answer-discuss .input-box .bottom {
- padding: 0 20px;
+ padding: 0 20px 20px;
justify-content: flex-end;
}
.answer-discuss .input-box .bottom .operate .item {
@@ -1146,7 +1158,7 @@
margin-right: 5px;
}
.answer-discuss .no-discussion-box {
- margin: 36px 0;
+ margin: 72px 0;
color: #7f7f7f;
font-size: 15px;
flex-direction: column;
diff --git a/css/details.less b/css/details.less
index 6a66ff7..6711867 100644
--- a/css/details.less
+++ b/css/details.less
@@ -244,7 +244,7 @@
position: absolute;
left: 50%;
transform: translateX(-50%);
- bottom: 42px;
+ bottom: 48px;
width: 130px;
height: 100px;
background-color: rgba(255, 255, 255, 1);
@@ -253,10 +253,23 @@
flex-direction: column;
display: none;
+ &::after {
+ content: "";
+ width: 0;
+ height: 0;
+ border-left: 8px solid transparent;
+ border-right: 8px solid transparent;
+ border-top: 8px solid #000000;
+ position: absolute;
+ bottom: -8px;
+ left: 50%;
+ transform: translateX(-50%);
+ }
+
.share-item {
width: 100%;
height: 40px;
- color: #555555;
+ color: #333;
font-size: 14px;
&:hover {
@@ -810,7 +823,7 @@
.answer-discuss .input-box .bottom {
// height: 52px;
- padding: 0 20px;
+ padding: 0 20px 20px;
justify-content: flex-end;
}
@@ -1340,7 +1353,7 @@
}
.answer-discuss .no-discussion-box {
- margin: 36px 0;
+ margin: 72px 0;
color: #7f7f7f;
font-size: 15px;
flex-direction: column;
diff --git a/css/public.css b/css/public.css
index 894edf5..307860d 100644
--- a/css/public.css
+++ b/css/public.css
@@ -627,7 +627,7 @@ body {
position: absolute;
left: 50%;
transform: translateX(-50%);
- bottom: 42px;
+ bottom: 48px;
width: 130px;
height: 100px;
background-color: #ffffff;
@@ -636,10 +636,22 @@ body {
flex-direction: column;
display: none;
}
+.item-box .bottom .bottom-item .share-box::after {
+ content: "";
+ width: 0;
+ height: 0;
+ border-left: 8px solid transparent;
+ border-right: 8px solid transparent;
+ border-top: 8px solid #000000;
+ position: absolute;
+ bottom: -8px;
+ left: 50%;
+ transform: translateX(-50%);
+}
.item-box .bottom .bottom-item .share-box .share-item {
width: 100%;
height: 40px;
- color: #555555;
+ color: #333;
font-size: 14px;
}
.item-box .bottom .bottom-item .share-box .share-item:hover {
@@ -1448,6 +1460,7 @@ body {
justify-content: space-between;
margin-right: 20px;
transition: all 0.3s;
+ position: relative;
}
.head-top .input-box.pitch {
border-color: #000;
@@ -1465,6 +1478,32 @@ body {
margin-left: 15px;
cursor: pointer;
}
+.head-top .input-box .search-box-history {
+ width: 460px;
+ /* height: 267px; */
+ background-color: #ffffff;
+ border: 1px solid #ebebeb;
+ border-radius: 10px;
+ position: absolute;
+ top: 50px;
+ left: 0;
+ padding: 16px;
+ z-index: 1;
+}
+.head-top .input-box .search-box-history .search-box-history-title {
+ font-size: 13px;
+ color: #aaaaaa;
+ margin-bottom: 14px;
+}
+.head-top .input-box .search-box-history .search-box-history-list {
+ color: #333;
+ font-size: 14px;
+}
+.head-top .input-box .search-box-history .search-box-history-list .search-box-history-item {
+ margin-bottom: 10px;
+ cursor: pointer;
+ display: block;
+}
.head-top .sign-in {
width: 192px;
height: 40px;
diff --git a/css/public.less b/css/public.less
index 49591d3..a1f3bd7 100644
--- a/css/public.less
+++ b/css/public.less
@@ -754,7 +754,7 @@ body {
position: absolute;
left: 50%;
transform: translateX(-50%);
- bottom: 42px;
+ bottom: 48px;
width: 130px;
height: 100px;
background-color: rgba(255, 255, 255, 1);
@@ -763,10 +763,23 @@ body {
flex-direction: column;
display: none;
+ &::after {
+ content: "";
+ width: 0;
+ height: 0;
+ border-left: 8px solid transparent;
+ border-right: 8px solid transparent;
+ border-top: 8px solid #000000;
+ position: absolute;
+ bottom: -8px;
+ left: 50%;
+ transform: translateX(-50%);
+ }
+
.share-item {
width: 100%;
height: 40px;
- color: #555555;
+ color: #333;
font-size: 14px;
&:hover {
@@ -1727,6 +1740,7 @@ body {
justify-content: space-between;
margin-right: 20px;
transition: all 0.3s;
+ position: relative;
&.pitch {
border-color: #000;
@@ -1746,6 +1760,35 @@ body {
margin-left: 15px;
cursor: pointer;
}
+
+ .search-box-history {
+ width: 460px;
+ /* height: 267px; */
+ background-color: rgba(255, 255, 255, 1);
+ border: 1px solid rgba(235, 235, 235, 1);
+ border-radius: 10px;
+ position: absolute;
+ top: 50px;
+ left: 0;
+ padding: 16px;
+ z-index: 1;
+
+ .search-box-history-title {
+ font-size: 13px;
+ color: #aaaaaa;
+ margin-bottom: 14px;
+ }
+
+ .search-box-history-list {
+ color: #333;
+ font-size: 14px;
+ .search-box-history-item {
+ margin-bottom: 10px;
+ cursor: pointer;
+ display: block;
+ }
+ }
+ }
}
.sign-in {
diff --git a/css/search.css b/css/search.css
index 0e40580..850f6b0 100644
--- a/css/search.css
+++ b/css/search.css
@@ -64,9 +64,17 @@
#search .matter {
align-items: flex-start;
}
+#search .matter.bottom {
+ align-items: flex-end;
+}
#search .matter .matter-content {
margin-right: 12px;
}
+#search .matter .matter-content.fixed {
+ position: fixed;
+ left: calc((100% - 1200px) / 2);
+ bottom: 10px;
+}
#search .matter .matter-content .list-box .item-box {
margin-bottom: 12px;
}
@@ -121,6 +129,6 @@
}
#search .matter .sidebar-box.fixed {
position: fixed;
- right: calc((100% - 1200px) / 2);
+ left: calc((100% - 1200px) / 2 + 909px);
bottom: 10px;
}
diff --git a/css/search.less b/css/search.less
index 4574269..9ad15df 100644
--- a/css/search.less
+++ b/css/search.less
@@ -72,10 +72,20 @@
.matter {
align-items: flex-start;
-
+
+ &.bottom {
+ align-items: flex-end;
+ }
+
.matter-content {
margin-right: 12px;
+ &.fixed {
+ position: fixed;
+ left: calc((100% - 1200px) / 2);
+ bottom: 10px;
+ }
+
.list-box {
.item-box {
margin-bottom: 12px;
@@ -142,7 +152,9 @@
&.fixed {
position: fixed;
- right: calc((100% - 1200px) / 2);
+ // right: calc((100% - 1200px) / 2);
+ // left: 909px;
+ left: calc((100% - 1200px) / 2 + 909px);
bottom: 10px;
}
}
diff --git a/js/index.js b/js/index.js
index 8201e4c..8345b1e 100644
--- a/js/index.js
+++ b/js/index.js
@@ -286,7 +286,6 @@ const appIndex = createApp({
};
const clickbtn = () => {
- console.log("点击按钮");
BiComponent.initComponent();
};
diff --git a/js/search.js b/js/search.js
index 7411c93..a1ba735 100644
--- a/js/search.js
+++ b/js/search.js
@@ -1,40 +1,43 @@
const { createApp, ref, onMounted, nextTick, onUnmounted, computed, watch, provide } = Vue;
-import { itemForum } from "../component/item-forum/item-forum.js";
-import { itemOffer } from "../component/item-offer/item-offer.js";
-import { itemSummary } from "../component/item-summary/item-summary.js";
-import { itemVote } from "../component/item-vote/item-vote.js";
-import { itemMj } from "../component/item-mj/item-mj.js";
-import { itemTenement } from "../component/item-tenement/item-tenement.js";
-import { headTop } from "../component/head-top/head-top.js";
-import { hotTag } from "../component/hot-tag/hot-tag.js";
-import { hotSearch } from "../component/hot-search/hot-search.js";
-import { slideshowBox } from "../component/slideshow-box/slideshow-box.js";
-import { latestList } from "../component/latest-list/latest-list.js";
+import { itemForum } from "/component/item-forum/item-forum.js";
+import { itemOffer } from "/component/item-offer/item-offer.js";
+import { itemSummary } from "/component/item-summary/item-summary.js";
+import { itemVote } from "/component/item-vote/item-vote.js";
+import { itemMj } from "/component/item-mj/item-mj.js";
+import { itemTenement } from "/component/item-tenement/item-tenement.js";
+import { headTop } from "/component/head-top/head-top.js";
+import { hotTag } from "/component/hot-tag/hot-tag.js";
+import { hotSearch } from "/component/hot-search/hot-search.js";
+import { slideshowBox } from "/component/slideshow-box/slideshow-box.js";
+import { latestList } from "/component/latest-list/latest-list.js";
+import { loadBox } from "/component/load-box/load-box.js";
const appSearch = createApp({
setup() {
+ let kwValue = ref(null);
+ let typeValue = ref(null);
let kw = ref("");
onMounted(() => {
- const params = getUrlParams();
- kw.value = params.kw || "";
+ // const params = getUrlParams();
+ // kw.value = params.kw || "";
+ // const urlObj = new URL(location.href);
+ // const pathParts = urlObj.pathname.split("/").filter((part) => part);
+ // kw.value = decodeURIComponent(pathParts.pop());
+ kw.value = kwValue.value.innerText;
+ const tab = typeValue.value.innerText;
+ if (tab) tabValue.value = tab;
+
+ page.value = 1;
getList();
getUserInfoWin();
- setTimeout(() => (permissions.value = window["permissions"] || ["comment.edit", "comment.delete", "offercollege.hide", "offersummary.hide", "mj.hide", "topic:manager", "topic:hide"]), 1000);
+
+ window.addEventListener("scroll", handleScroll);
});
- let isLogin = ref(true);
- let realname = ref(1); // 是否已经实名
- let userInfoWin = ref({
- authority: ["comment.edit", "comment.delete", "offercollege.hide", "offersummary.hide", "mj.hide", "topic:manager", "topic:hide"],
- avatar: "https://nas.gter.net:9008/avatar/97K4EWIMLrsbGTWXslC2WFVSEKWOikN42jDKLNjtax7HL4xtfMOJSdU9oWFhY2E~/middle?random=1761733169",
- groupid: 3,
- nickname: "肖荣豪",
- realname: 1,
- token: "01346a38444d71aaadb3adad52b52c39",
- uid: 500144,
- uin: 4238049,
- });
+ let isLogin = ref(false);
+ let realname = ref(0); // 是否已经实名
+ let userInfoWin = ref({});
let permissions = ref([]);
@@ -84,6 +87,8 @@ const appSearch = createApp({
tabValue.value = type;
pagination.value = [];
+ updateUrlParams({ type: type == "all" ? null : type });
+
getList();
};
@@ -110,19 +115,18 @@ const appSearch = createApp({
});
};
- let loading = false;
+ let loading = ref(false);
let page = ref(0);
let maxPage = ref(0);
let count = ref(0);
let list = ref([]);
let pagination = ref([]);
const getList = () => {
- if (loading || page.value == null) return;
- loading = true;
+ if (loading.value || page.value == null) return;
+ loading.value = true;
const limit = 20;
ajaxGet(`/v2/api/forum/topicLists?type=${tabValue.value == "all" ? "" : tabValue.value}&page=${page.value}&limit=${limit}&keyword=${kw.value}`)
.then((res) => {
- // wx.hideLoading();
if (res.code != 200) {
creationAlertBox("error", res.message);
return;
@@ -130,19 +134,19 @@ const appSearch = createApp({
let data = res.data;
list.value = data.data;
- // page.value = data.count > limit * data.page ? page.value : null;
- if (data.count <= limit * data.page) page.value = null
-
+ if (list.value.length == 0) page.value = null;
+
count.value = data.count;
- loading = false;
+ loading.value = false;
maxPage.value = Math.ceil(count.value / limit);
pagination.value = calculatePagination(page.value, maxPage.value);
+
+ updateUrlLastPath(kw.value);
})
.catch((err) => {
- // wx.hideLoading();
err = err.data;
if (err.code == 401) goLogin();
- loading = false;
+ loading.value = false;
});
};
@@ -190,17 +194,20 @@ const appSearch = createApp({
if (value == "...") return;
if (value == page.value) return;
page.value = value;
+ list.value = [];
getList();
};
const prevPage = () => {
page.value -= 1;
+ list.value = [];
pagination.value = [];
getList();
};
const nextPage = () => {
page.value += 1;
+ list.value = [];
pagination.value = [];
getList();
};
@@ -218,7 +225,34 @@ const appSearch = createApp({
getList();
};
- return { startSearch, kw, maxPage, prevPage, nextPage, tabValue, cutTab, tabList, count, list, page, pagination, cutPage };
+ const sidebarFixed = ref(false);
+ const matterFixed = ref(false);
+
+ const handleScroll = () => {
+ const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
+ const clientHeight = window.innerHeight;
+
+ const sideHeight = sidebarRef.value.offsetHeight;
+ const matterTop = matterRef.value.offsetTop;
+ const matterHeight = matterContentRef.value.offsetHeight;
+
+ console.log("sideHeight", sideHeight);
+ console.log("matterHeight", matterHeight);
+ if (sideHeight < matterHeight) {
+ // 侧边栏滚动固定
+ if (scrollTop >= matterTop + sideHeight - clientHeight) sidebarFixed.value = true;
+ else sidebarFixed.value = false;
+ } else {
+ if (scrollTop >= matterTop + matterHeight - clientHeight) matterFixed.value = true;
+ else matterFixed.value = false;
+ }
+ };
+
+ const matterRef = ref(null);
+ const sidebarRef = ref(null);
+ const matterContentRef = ref(null);
+
+ return { matterFixed, matterContentRef, sidebarFixed, matterRef, sidebarRef, loading, typeValue, kwValue, startSearch, kw, maxPage, prevPage, nextPage, tabValue, cutTab, tabList, count, list, page, pagination, cutPage };
},
});
appSearch.component("item-forum", itemForum);
@@ -232,4 +266,5 @@ appSearch.component("hot-tag", hotTag);
appSearch.component("hot-search", hotSearch);
appSearch.component("slideshow-box", slideshowBox);
appSearch.component("latest-list", latestList);
+appSearch.component("load-box", loadBox);
appSearch.mount("#search");
diff --git a/search.html b/search.html
index 5afe047..c70266e 100644
--- a/search.html
+++ b/search.html
@@ -1,83 +1,84 @@
+
+
+
+
搜索
+
+
+
+
+
-
-
-
-
搜索
-
-
-
-
-
+
+
+
香港
+
-
-
-
-

-
-
-
-
-

-
+
+

+
+
+
+
+

+
-
+
-
- {{ tabList[tabValue] }}
-
- 共
-
{{ count }}
- 条
-
+
+ {{ tabList[tabValue] }}
+
+ 共
+
{{ count }}
+ 条
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
- 暂无内容 -
+
+
+
+

+

+
+
{{ item }}
+
+

+

+
-
-
-

-
- 暂无内容 -
-
-
-
-

-

-
-
{{ item }}
-
-

-

+
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+