houwei 4 years ago
parent
commit
8f3e5b2889
1 changed files with 14 additions and 8 deletions
  1. 14 8
      pages/index/index.js

+ 14 - 8
pages/index/index.js

@@ -62,15 +62,21 @@ Page({
       success: (res) => {
         console.log(res)
         if (res.data.code == 0) {
-          let deleteArr = []
-          for (let i = 0; i < res.data.actives.length; i++) {
-            if (res.data.actives[i].activeStatus == -1) {
-              deleteArr.push(res.data.actives[i])
-              res.data.actives.splice(i, 1);
-            }
-          }
+          console.log(res.data.actives)
+          // let deleteArr = []
+          // let primaryArr = []
+          // for (let i = 0; i < res.data.actives.length; i++) {
+          //   if (res.data.actives[i].activeStatus == -1) {
+          //     deleteArr.push(res.data.actives[i])
+          //     // res.data.actives.splice(i, 1);
+          //   }else{
+          //     primaryArr.push(res.data.actives[i])
+          //   }
+          // }
+          // console.log(primaryArr)
+          // console.log(deleteArr)
           this.setData({
-            arr: res.data.actives.concat(deleteArr)
+            arr:res.data.actives
           })
         }
       },