shish 2 месяцев назад
Родитель
Сommit
68592695aa
2 измененных файлов с 50 добавлено и 4 удалено
  1. 1 1
      hdApp/src/pagesPurchase/ghsProduct.vue
  2. 49 3
      hdApp/src/pagesPurchase/pb.vue

+ 1 - 1
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -182,7 +182,7 @@
 		</uni-popup>
 
 		<view v-if="superWx!=''" @click="toViewWx" style="width:200upx;height:84upx;position:fixed;bottom:210upx;right:-34upx;border-radius:40upx;background: rgba(0,0,0,.60);display: flex;align-items: center;">
-			<image :src="`${constant.imgUrl}/mall/wx_code.png`" style="width:74upx;height:74upx;margin-left:8upx;" mode="widthFix"></image>
+			<image :src="`${constant.imgUrl}/mall/wx_code2.png`" style="width:74upx;height:74upx;margin-left:8upx;" mode="widthFix"></image>
 			<view style="width:90upx;color:white;margin-left:8upx;">扫码添加微信</view>
 		</view>
 

+ 49 - 3
hdApp/src/pagesPurchase/pb.vue

@@ -1,5 +1,10 @@
 <template>
   <view class="ghs_list_page flex-col">
+    <view class="search-wrap">
+      <view class="search-inner">
+        <AppSearchModule placeholder="搜索批发店" @input="searchFn" />
+      </view>
+    </view>
     <template v-if="!$util.isEmpty(list.data)">
     <view class="ghs_list_area flex-col justify-end">
       
@@ -42,16 +47,19 @@
 </template>
 <script>
 import emptyComponent from "@/components/empty";
+import AppSearchModule from "@/components/module/app-search";
 import { ghsList } from "@/api/purchase";
 import { changeDelStatus } from "@/api/ghs";
 import { list } from "@/mixins";
 export default {
   components: {
-    emptyComponent
+    emptyComponent,
+    AppSearchModule
   },
   mixins: [list],
   data () {
     return {
+      seekVal: ''
     }
   },
   onReachBottom () {
@@ -64,6 +72,7 @@ export default {
     }
   },
   onPullDownRefresh() {
+    this.resetList()
     this.getGhsList().then(res => {
       uni.stopPullDownRefresh();
     })
@@ -96,8 +105,20 @@ export default {
     init() {
       this.getGhsList()
     },
+    searchFn(e) {
+      const keyword = (e || '').trim()
+      if (!keyword) {
+        return
+      }
+      if (keyword === this.seekVal) {
+        return
+      }
+      this.seekVal = keyword
+      this.resetList()
+      this.getGhsList()
+    },
     getGhsList () {
-      return ghsList({delStatus:1,page: this.list.page}).then(res => {
+      return ghsList({ delStatus: 1, page: this.list.page, name: this.seekVal || '' }).then(res => {
         this.completes(res)
       })
     },
@@ -114,8 +135,33 @@ export default {
 .ghs_list_page {
   background-color: rgba(255, 255, 255, 1);
   position: relative;
-  width: 750upx; 
+  width: 750upx;
+  padding-top: 100upx;
   overflow: hidden;
+
+  .search-wrap {
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: 10;
+    width: 750upx;
+    height: 100upx;
+    display: flex;
+    align-items: center;
+    padding: 0 24upx;
+    box-sizing: border-box;
+    background: #fff;
+    box-shadow: 0 2upx 8upx rgba(0, 0, 0, 0.06);
+  }
+
+  .search-inner {
+    width: 100%;
+    flex: 1;
+
+    ::v-deep .app-search-module {
+      width: 100%;
+    }
+  }
   .flex-col {
     display: flex;
     flex-direction: column;