shish 2 лет назад
Родитель
Сommit
248b61cbcf
1 измененных файлов с 24 добавлено и 4 удалено
  1. 24 4
      ghsApp/src/admin/cp/item.vue

+ 24 - 4
ghsApp/src/admin/cp/item.vue

@@ -1,6 +1,13 @@
 <template>
     <view class="app-content" style="background:white;">
           <view class="billing_box_bg">
+
+            <view class="input-wrap">
+                  <view class="search-bar">
+                      <app-search-module v-model="py" placeholder="这里搜索花材" @input="searchFn"/>
+                  </view>
+              </view>
+
               <view class="scroll-middle_bx">
 
                 <scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true"
@@ -140,7 +147,8 @@
             currentCpItemList:[],
             page:1,
             currentCpId:0,
-            finishGetItem:0
+            finishGetItem:0,
+            py:''
           };
       },
       computed:{
@@ -148,22 +156,34 @@
           ...mapGetters({ loginInfo: "getLoginInfo",dictInfo:"getDictionariesInfo" })
       },
       onLoad() {
-
         let that = this
         getWeixinId().then(res => {
             that.getAppIdList = res.data
         })
         this.currentCpId = this.option.cpId ? this.option.cpId : 0
         that.getListFn()
-
       },
       methods: {
+        searchFn(e){
+            console.log(e)
+            if(!this.$util.isEmpty(e)){
+                this.py = e
+                this.page = 1
+                this.finishGetItem = 0
+                this.getListFn()
+            }else{
+                this.py = ''
+                this.page = 1
+                this.finishGetItem = 0
+                this.getListFn()
+            }
+        },
         getListFn(){
             if(this.finishGetItem == 1){
                 return false
             }
             let that = this
-            getCpItemList({cpId:that.currentCpId,page:that.page}).then(res=>{
+            getCpItemList({cpId:that.currentCpId,page:that.page,search:that.py}).then(res=>{
                 if(res.code == 1){
                     that.currentCpItemList = that.page == 1 ? res.data.list : that.currentCpItemList.concat(res.data.list)
                     if(res.data.moreData == 1){