ssfg 4 年之前
父节点
当前提交
2c90c95b52
共有 2 个文件被更改,包括 70 次插入68 次删除
  1. 1 1
      pages/userBook/userBook.wxml
  2. 69 67
      pages/visitandinfo/visitandinfo.js

+ 1 - 1
pages/userBook/userBook.wxml

@@ -109,6 +109,6 @@
 		</view>
 	</view>
 	<view class="hd">①点击首页->我的排名</view>
-	<view class="hd">②当前在的</view>
+	<view class="hd">②当前在省里排名以及积分获得情况</view>
 	<van-divider contentPosition="center">赡养人使用手册</van-divider>
 </view>

+ 69 - 67
pages/visitandinfo/visitandinfo.js

@@ -70,61 +70,76 @@ Page({
   deletes() {
     console.log("ssss");
     let that = this;
-    wx.showModal({  
-      content: '该操作会将所有选中数据删除", "是否删除?',
+    wx.showModal({
+      content: '该操作会将所有选中数据删除,是否删除?',
       success(res) {
         if (res.confirm) {
           //确定绑定的操作
-          let isDeteleTrue = true;
+          let num = 0;
           if (that.data.batchIds.length) {
             for (let item of that.data.batchIds) {
-              that.deleteById(item);
-              isDeteleTrue = false;
-            }
-            if(!isDeteleTrue){
-              wx.showToast({
-                title: '删除成功',
-                icon: 'none',
-                duration: 2000,
-                success: function () {
-                  switch (that.data.number) {
-                    case 0:
-                      that.openIdInfo();
-                      break;
-                    case 1:
-                      that.openIdInfo({
-                        status: "1"
-                      });
-                      break;
-                    case 2:
-                      that.openIdInfo({
-                        status: "0"
-                      });
-                      break;
-                    case 3:
-                      this.openIdInfo({
-                        status: "2"
-                      });
-                      break;
-                    case 4:
-                      this.openIdInfo({
-                        status: "3"
-                      });
-                      break;
-                    case 5:
-                      that.openIdInfo({
-                        status: "4"
-                      });
-                      break;
-                    default:
-                      that.openIdInfo();
+              wx.request({
+                url: app.globalData.publicUrl + '/wxinfo/delete',
+                method: "GET",
+                header: {
+                  appletsId: wx.getStorageSync('openId')
+                },
+                data: {
+                  id: item
+                },
+                success: (res) => {
+                  console.log(res, "000");
+                  num += 1;
+                  if (num == that.data.batchIds.length) {
+                    console.log("删除了么")
+                    wx.showToast({
+                      title: '删除成功',
+                      icon: 'none',
+                      duration: 2000,
+                      success: function () {
+                        switch (that.data.number) {
+                          case 0:
+                            that.openIdInfo();
+                            break;
+                          case 1:
+                            that.openIdInfo({
+                              status: "1"
+                            });
+                            break;
+                          case 2:
+                            that.openIdInfo({
+                              status: "0"
+                            });
+                            break;
+                          case 3:
+                            this.openIdInfo({
+                              status: "2"
+                            });
+                            break;
+                          case 4:
+                            this.openIdInfo({
+                              status: "3"
+                            });
+                            break;
+                          case 5:
+                            that.openIdInfo({
+                              status: "4"
+                            });
+                            break;
+                          default:
+                            that.openIdInfo();
+                        }
+                      }
+                    })
+                    that.setData({
+                      isAllTrue: false,
+                    })
                   }
                 }
               })
-              that.setData({
-                isAllTrue: false,
-              })
             }
+            console.log(num)
+          
           } else {
             wx.showToast({
               title: '请选择要删除的记录',
@@ -139,19 +154,7 @@ Page({
     })
   },
   deleteById(id) {
-    wx.request({
-      url: app.globalData.publicUrl + '/wxinfo/delete',
-      method: "GET",
-      header: {
-        appletsId: wx.getStorageSync('openId')
-      },
-      data: {
-        id: id
-      },
-      success: (res) => {
-        console.log(res, "000");
-      }
-    })
+
   },
   //全选与反全选
   selectall: function (e) {
@@ -281,12 +284,12 @@ Page({
   computeScrollViewHeight() {
     let that = this
     let query = wx.createSelectorQuery().in(this)
-    console.log(query,"111111111111111");
+    console.log(query, "111111111111111");
     query.select('.zizi').boundingClientRect()
     query.select('.delete-box').boundingClientRect()
     query.exec(res => {
-      console.log(res,"000000000000000000000");
-       
+      console.log(res, "000000000000000000000");
+
       let searchHeight = res[0].height
       let titleHeight = res[1].height
       let windowHeight = wx.getSystemInfoSync().windowHeight
@@ -302,7 +305,7 @@ Page({
     query.select('.zizi').boundingClientRect()
     query.exec(res => {
       console.log(res);
-      
+
       let searchHeight = res[0].height
       let windowHeight = wx.getSystemInfoSync().windowHeight
       let scrollHeight = windowHeight - searchHeight - 30 - 5 - 50
@@ -322,7 +325,7 @@ Page({
       wx.showModal({
         showCancel: false,
         content: '当前您未登录,请登录',
-        success (res) {
+        success(res) {
           if (res.confirm) {
             wx.redirectTo({
               url: '/pages/login/login',
@@ -341,8 +344,7 @@ Page({
         select_all: false,
         isTrue: true,
       })
-      if(this.data.isTrue){
-        console.log("看我锕锕锕锕锕锕锕啊 ");
+      if (this.data.isTrue) {
         this.computeScrollViewHeight();
         this.computeScrollViewHeight1();
       }
@@ -387,7 +389,7 @@ Page({
   onHide() {
     this.setData({
       show: false,
-      listData :[]
+      listData: []
     })
   }
 })