Sfoglia il codice sorgente

feat: 创客搜索

Basil 2 anni fa
parent
commit
832a5b28f0
3 ha cambiato i file con 21 aggiunte e 7 eliminazioni
  1. 1 1
      src/pages.json
  2. 1 1
      src/pages/home/index.vue
  3. 19 5
      src/pages/store/nearby/index.vue

File diff suppressed because it is too large
+ 1 - 1
src/pages.json


+ 1 - 1
src/pages/home/index.vue

@@ -162,7 +162,7 @@ page {
162
   background-color: #f8f8f8;
162
   background-color: #f8f8f8;
163
 }
163
 }
164
 </style>
164
 </style>
165
-<route lang="yaml"   type="home">
165
+<route lang="yaml">
166
 style:
166
 style:
167
   navigationStyle: custom
167
   navigationStyle: custom
168
   navigationBarTitleText: 储蓄保
168
   navigationBarTitleText: 储蓄保

+ 19 - 5
src/pages/store/nearby/index.vue

@@ -22,6 +22,7 @@ const state = reactive<any>({
22
   currentMerchantCategoryId: 0,
22
   currentMerchantCategoryId: 0,
23
   // merchantPageInfo: {}
23
   // merchantPageInfo: {}
24
 })
24
 })
25
+const searchValue = ref('')
25
 
26
 
26
 const { windowHeight } = uni.getSystemInfoSync()
27
 const { windowHeight } = uni.getSystemInfoSync()
27
 state.scrollHeight = windowHeight
28
 state.scrollHeight = windowHeight
@@ -48,20 +49,21 @@ onLoad(() => {
48
 })
49
 })
49
 
50
 
50
 function handleCategoryChange(category) {
51
 function handleCategoryChange(category) {
51
-  console.log(category)
52
+  // console.log(category)
52
   state.currentMerchantCategoryId = category.merchant_category_id
53
   state.currentMerchantCategoryId = category.merchant_category_id
53
   // console.log(category)
54
   // console.log(category)
54
   // loadSelectMerchant()
55
   // loadSelectMerchant()
55
   loadSelectMerchant(category.merchant_category_id)
56
   loadSelectMerchant(category.merchant_category_id)
56
 }
57
 }
57
-function loadSelectMerchant(category_id) {
58
+function loadSelectMerchant(category_id: number, mer_keyword?: string) {
58
   if (category_id == 0) {
59
   if (category_id == 0) {
59
     state.currentMerchantCategoryId = category_id
60
     state.currentMerchantCategoryId = category_id
60
   }
61
   }
61
   let params: StoreParams = {
62
   let params: StoreParams = {
62
     pageNum: 1,
63
     pageNum: 1,
63
     pageSize: 10,
64
     pageSize: 10,
64
-    mer_keyword: '',
65
+    mer_keyword: mer_keyword ? mer_keyword : '',
66
+    // mer_keyword: mer_keyword,
65
     lat: '',
67
     lat: '',
66
     lng: '',
68
     lng: '',
67
   }
69
   }
@@ -84,6 +86,7 @@ function handleShowMerchant(merchant) {
84
   })
86
   })
85
 }
87
 }
86
 
88
 
89
+
87
 function change() {}
90
 function change() {}
88
 function onChange() {}
91
 function onChange() {}
89
 </script>
92
 </script>
@@ -92,6 +95,13 @@ function onChange() {}
92
 <!--    <nut-category-pane :categoryChild="state.merchantList" @onChange="onChange">-->
95
 <!--    <nut-category-pane :categoryChild="state.merchantList" @onChange="onChange">-->
93
 <!--    </nut-category-pane>-->
96
 <!--    </nut-category-pane>-->
94
 <!--  </nut-category>-->
97
 <!--  </nut-category>-->
98
+  <nut-searchbar v-model="searchValue" @search="loadSelectMerchant(0, searchValue)" @clear="loadSelectMerchant(0, '')">
99
+    <template v-slot:rightout>
100
+      <div @tap="loadSelectMerchant(0, searchValue)">
101
+        搜索
102
+      </div>
103
+    </template>
104
+  </nut-searchbar>
95
   <div class="flex">
105
   <div class="flex">
96
     <!-- 左侧 一级分类 -->
106
     <!-- 左侧 一级分类 -->
97
     <scroll-view
107
     <scroll-view
@@ -103,7 +113,11 @@ function onChange() {}
103
           @tap="loadSelectMerchant(0)"
113
           @tap="loadSelectMerchant(0)"
104
           :class="state.currentMerchantCategoryId == 0 ? 'bg-white font-bold' : ''"
114
           :class="state.currentMerchantCategoryId == 0 ? 'bg-white font-bold' : ''"
105
           class="relative h-15 block text-sm flex justify-center items-center">
115
           class="relative h-15 block text-sm flex justify-center items-center">
106
-        <div>全部</div>
116
+        <div class="flex items-center gap-1">
117
+          <div class="h-4 bg-primary w-1"></div>
118
+          <div>全部</div>
119
+        </div>
120
+
107
       </div>
121
       </div>
108
       <div v-for="(item, index) in state.merchantCategory" :key="index"
122
       <div v-for="(item, index) in state.merchantCategory" :key="index"
109
            @tap="handleCategoryChange(item)"
123
            @tap="handleCategoryChange(item)"
@@ -156,7 +170,7 @@ function onChange() {}
156
     </scroll-view>
170
     </scroll-view>
157
   </div>
171
   </div>
158
 </template>
172
 </template>
159
-<route lang="yaml">
173
+<route lang="yaml" type="home">
160
 style:
174
 style:
161
   navigationBarTitleText: 储蓄保
175
   navigationBarTitleText: 储蓄保
162
   enablePullDownRefresh: true
176
   enablePullDownRefresh: true