gemercheung 3 gadi atpakaļ
vecāks
revīzija
b14f4380b3
1 mainītis faili ar 18 papildinājumiem un 18 dzēšanām
  1. 18 18
      pages/roomManger/roomManger.js

+ 18 - 18
pages/roomManger/roomManger.js

@@ -42,28 +42,28 @@ Page({
     })
   },
   async handleDelete(e) {
-    const that = this;
-      wx.showModal({
-        title: '温馨提示',
-        content: '关闭房间后,房间内的所有人都会退出房间,是否继续关闭?',
-        success: function (res) {
-          console.log('requestDelet',res)
-            if (res.confirm) {
-                // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
-                that.requestDelet(e)
-            }
+    wx.showModal({
+      title: '温馨提示',
+      content: '关闭房间后,房间内的所有人都会退出房间,是否继续关闭?',
+      success: (res) => {
+        console.log('requestDelete', res)
+        if (res.confirm) {
+          // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+          this.requestDelete(e);
         }
+      }
     })
   },
-  requestDelet(e){
-    const businessId = e.target.dataset && e.target.dataset.id
-    const apiUrl = this.data.fetcherData.state == 102 ?api.deleteRoom:api.exitRoom
+  async requestDelete(e) {
+    const businessId = e.target.dataset && e.target.dataset.id;
+    const apiUrl = this.data.fetcherData.state == 102 ? api.deleteRoom : api.exitRoom;
+    const res = await util.request(apiUrl, {
+      businessId
+    }, 'POST', 'application/json')
     const {
       data,
       code
-    } = await util.request(apiUrl, {
-      businessId
-    }, 'POST', 'application/json')
+    } = res
     if (code !== 200) return
     let roomList = this.data.roomList.filter(ele => ele.businessId !== businessId)
     this.setData({
@@ -296,9 +296,9 @@ Page({
       hasData: true,
       'fetcherData': {
         ...that.data.fetcherData,
-        page:1,
+        page: 1,
       },
-      "roomList":[],
+      "roomList": [],
     }, () => {
       that.getRoomList()
       wx.stopPullDownRefresh()