hookehuyr

排行榜新增搜索

...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 * @Author: hookehuyr hookehuyr@gmail.com 2 * @Author: hookehuyr hookehuyr@gmail.com
3 * @Date: 2022-05-30 13:51:47 3 * @Date: 2022-05-30 13:51:47
4 * @LastEditors: hookehuyr hookehuyr@gmail.com 4 * @LastEditors: hookehuyr hookehuyr@gmail.com
5 - * @LastEditTime: 2022-06-25 12:26:56 5 + * @LastEditTime: 2024-12-03 15:13:35
6 * @FilePath: /tswj/src/views/client/rankList.vue 6 * @FilePath: /tswj/src/views/client/rankList.vue
7 * @Description: 幼儿园儿童捐赠金额排行榜 7 * @Description: 幼儿园儿童捐赠金额排行榜
8 --> 8 -->
...@@ -32,6 +32,13 @@ ...@@ -32,6 +32,13 @@
32 </van-row> 32 </van-row>
33 </div> 33 </div>
34 34
35 + <div style="background-color: #F7F7F7; height: auto; padding: 1rem; padding-top: 0;">
36 + <div style="background-color: #FFF; border-radius: 1rem; padding: 0.5rem 1rem; display: flex; align-items: center; justify-content: space-between;">
37 + <input type="text" v-model="perf_name" placeholder="请输入要搜索的表演者姓名" @blur="onSearch" style="border: 0; width: 100%;">
38 + <van-icon name="search" />
39 + </div>
40 + </div>
41 +
35 <van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''" 42 <van-list v-model:loading="loading" :finished="finished" :finished-text="finishedTextStatus ? '没有更多了' : ''"
36 @load="onLoad"> 43 @load="onLoad">
37 <div v-for="(rank, indexKey) in donateRankList" :key="indexKey" class="van-hairline--bottom"> 44 <div v-for="(rank, indexKey) in donateRankList" :key="indexKey" class="van-hairline--bottom">
...@@ -95,9 +102,10 @@ const limit = ref(10) ...@@ -95,9 +102,10 @@ const limit = ref(10)
95 const offset = ref(0) 102 const offset = ref(0)
96 const finishedTextStatus = ref(false); 103 const finishedTextStatus = ref(false);
97 const emptyStatus = ref(false); 104 const emptyStatus = ref(false);
105 +const perf_name = ref('');
98 106
99 const onLoad = async () => { 107 const onLoad = async () => {
100 - const { data } = await kgDonateRankAPI({ kg_id, limit: limit.value, offset: offset.value }); 108 + const { data } = await kgDonateRankAPI({ kg_id, limit: limit.value, offset: offset.value, perf_name: perf_name.value });
101 kgInfo.value = data; 109 kgInfo.value = data;
102 // 有空格分割name 110 // 有空格分割name
103 if (kgInfo.value.kg_name.indexOf(' ') > -1) { 111 if (kgInfo.value.kg_name.indexOf(' ') > -1) {
...@@ -118,6 +126,13 @@ const onLoad = async () => { ...@@ -118,6 +126,13 @@ const onLoad = async () => {
118 emptyStatus.value = false; 126 emptyStatus.value = false;
119 } 127 }
120 } 128 }
129 +
130 +const onSearch = () => {
131 + offset.value = 0;
132 + donateRankList.value = [];
133 + finished.value = false;
134 + onLoad()
135 +}
121 </script> 136 </script>
122 137
123 <style lang="less" scoped> 138 <style lang="less" scoped>
......