zhaoxiaohai 2 yıl önce
ebeveyn
işleme
9626086f5a
2 değiştirilmiş dosya ile 22 ekleme ve 4 silme
  1. 21 3
      pages/threadedTree/index.js
  2. 1 1
      pages/threadedTree/index.wxml

+ 21 - 3
pages/threadedTree/index.js

@@ -11,6 +11,7 @@ Page({
             }
         },
         list: [],
+        sort: null,
         tagColor: '#FA8C16'
     },
     onLoad(options) {
@@ -24,7 +25,7 @@ Page({
         })
         if (this.data.content.pageNumber > this.data.content.pageTotal) return;
         let content = this.data.content;
-
+        if (this.data.sort != null) content.sort = this.data.sort;
         _Http.basic({
             "classname": "saletool.orderclue.web.orderclue",
             "method": "selectList",
@@ -39,7 +40,8 @@ Page({
             this.setData({
                 list: (res.pageNumber == 1) ? res.data : this.data.list.concat(res.data),
                 ['content.pageNumber']: res.pageNumber + 1,
-                ['content.pageTotal']: res.pageTotal
+                ['content.pageTotal']: res.pageTotal,
+                sort: res.sort
             })
         })
     },
@@ -64,7 +66,8 @@ Page({
         }
         this.setData({
             'content.where.status': detail.title,
-            tagColor
+            tagColor,
+            list: []
         })
         this.getList(true);
     },
@@ -77,6 +80,21 @@ Page({
         });
         this.getList(true);
     },
+    /* 选择排序方式 */
+    selectSort() {
+        if (this.data.sort[0].sorted == 1) {
+            this.setData({
+                'sort[0].sorted': 0,
+                'sort[1].sorted': 1,
+            })
+        } else {
+            this.setData({
+                'sort[0].sorted': 1,
+                'sort[1].sorted': 0,
+            })
+        };
+        this.getList(true)
+    },
     onReady() {
         getHeight.getHeight('.tabs', this).then(res => {
             this.setData({

+ 1 - 1
pages/threadedTree/index.wxml

@@ -1,4 +1,4 @@
-<Search bindinputSharch='inputSharch' />
+<Search bind:inputSharch='inputSharch' bind:selectSort='selectSort' />
 
 <van-tabs class="tabs" active="{{ content.where.status }}" tab-class='tab-class' color='#3874F6' title-active-color='#3874F6' bind:change="tabsChange">
     <van-tab title="待跟进" />