Browse Source

营销物料

zhaoxiaohai 3 years ago
parent
commit
8e6ec67f49

+ 9 - 5
pages/tabbar/smartStore/modules/viewPage.js

@@ -40,12 +40,12 @@ Component({
             "parentid": 1,
             "pageTotal": 1,
             "where": {
-                "condition": "", //搜索内容
-                "sorttype": 2 //1:热门,2:最新,不传默认最新
+                "condition": ""
             }
         },
         list: [], //文件列表
         inTotal: 0, //总计
+        sort: [], //排序规则
     },
 
     /**
@@ -101,10 +101,13 @@ Component({
                 ['content.pageNumber']: 1
             })
             if (this.data.content.pageNumber > this.data.content.pageTotal) return;
+            let content = this.data.content;
+            if (this.data.sort[0]) content.sort = this.data.sort;
+            console.log(content)
             _Http.basic({
                 "classname": "saletool.salematerial.salematerial",
                 "method": (this.data.tabActiveTitle == '列表') ? "selectList" : "selectMyList",
-                "content": this.data.content
+                content
             }).then(res => {
                 console.log("营销", res)
                 this.selectComponent('#ListBox').RefreshToComplete();
@@ -116,7 +119,8 @@ Component({
                     list: (res.pageNumber == 1) ? MFT.fileList(res.data) : this.data.list.concat(MFT.fileList(res.data)),
                     ['content.pageNumber']: res.pageNumber + 1,
                     ['content.pageTotal']: res.pageTotal,
-                    inTotal: res.total
+                    inTotal: res.total,
+                    sort: res.sort
                 })
             })
         },
@@ -149,7 +153,7 @@ Component({
             detail
         }) {
             this.setData({
-                ["content.where.sorttype"]: detail == '最新' ? 2 : 1
+                sort: detail
             })
             this.getList(true);
         },

+ 1 - 1
pages/tabbar/smartStore/modules/viewPage.wxml

@@ -3,7 +3,7 @@
     <van-tab title="列表" />
     <van-tab title="收藏夹" />
     <view slot='nav-right' class="switch">
-        <My_switch bindchange='changeSwitch' />
+        <My_switch bindchange='changeSwitch' sort="{{sort}}" />
     </view>
 </van-tabs>
 <My_listBox id="ListBox" height='{{listHeight}}' bind:getlist='getList'>