dujingxian преди 4 години
родител
ревизия
775116c9fb
променени са 5 файла, в които са добавени 45 реда и са изтрити 21 реда
  1. 13 5
      src/pages/subPages/balance.vue
  2. 4 2
      src/pages/subPages/home.vue
  3. 11 5
      src/pages/subPages/message.vue
  4. 11 5
      src/pages/subPages/order.vue
  5. 6 4
      src/pages/subPages/view.vue

+ 13 - 5
src/pages/subPages/balance.vue

@@ -229,7 +229,9 @@ export default {
         async getVoucherList() {
             const res = await getVoucherList()
             console.log('充值', res);
-            this.tableData = res.datas.data
+            if (res && res.code == 200) {
+                this.tableData = res.datas.data
+            }
         },
         // 分页
         async onPageChange(page) {
@@ -241,7 +243,9 @@ export default {
                 this.endTime = this.dataRange[1]/1000 || ''
                 const res = await queryVoucherList(this.pageNumber,this.startTime, this.endTime)
                 console.log('查询动账', res);
-                this.tableData = res.datas.data
+                if (res && res.code == 200) {
+                    this.tableData = res.datas.data
+                }
             }
         },
         // 搜索
@@ -250,8 +254,10 @@ export default {
             this.endTime = this.dataRange[1]/1000 || ''
             const res = await queryVoucherList(this.pageNumber,this.startTime, this.endTime)
             console.log('查询动账', res);
-            this.tableData = res.datas.data
-            this.total = res.datas.total * this.pageSize
+            if (res && res.code == 200) {
+                this.tableData = res.datas.data
+                this.total = res.datas.total * this.pageSize
+            }
         },
         // 重置
         onReset() {
@@ -400,7 +406,9 @@ export default {
             console.log('fd', fd);
             const res = await updateVoucher(fd)     // 调用接口实现文件上传
             console.log('res', res);
-            this.file_path = res.datas.file_path
+            if (res && res.code == 200) {
+                this.file_path = res.datas.file_path
+            }
 
             // const res = await this.$axios.post('http://192.168.1.195/upfile.php', {
             //     name: fd

+ 4 - 2
src/pages/subPages/home.vue

@@ -35,8 +35,10 @@ export default {
     async getUserInfo() {
       const res = await getUserInfo()
       console.log('个人中心', res);
-      this.formData = res.datas
-      this.member = res.datas.member
+      if (res && res.code == 200) {
+        this.formData = res.datas
+        this.member = res.datas.member
+      }
       // this.available_predeposit = res.datas.member.available_predeposit
     }
   }

+ 11 - 5
src/pages/subPages/message.vue

@@ -99,8 +99,10 @@ export default {
         async getMovingAccount() {
             const res = await getMovingAccount(1)
             console.log('动账', res);
-            this.tableData = res.datas.data
-            this.total = res.datas.total * this.pageSize
+            if (res && res.code == 200) {
+                this.tableData = res.datas.data
+                this.total = res.datas.total * this.pageSize
+            }
         },
         // 页码
         async onPageChange(page) {
@@ -112,7 +114,9 @@ export default {
                 this.endTime = this.dataRange[1]/1000 || ''
                 const res = await queryMovingAccount(this.pageNumber,this.startTime, this.endTime, this.changeVal)
                 console.log('查询动账', res);
-                this.tableData = res.datas.data
+                if (res && res.code == 200) {
+                    this.tableData = res.datas.data
+                }
             }
         },
         // 查询
@@ -121,8 +125,10 @@ export default {
             this.endTime = this.dataRange[1]/1000 || ''
             const res = await queryMovingAccount(this.pageNumber,this.startTime, this.endTime, this.changeVal)
             console.log('查询动账', res);
-            this.tableData = res.datas.data
-            this.total = res.datas.total * this.pageSize
+            if (res && res.code == 200) {
+                this.tableData = res.datas.data
+                this.total = res.datas.total * this.pageSize
+            }
         },
         // 重置
         onReset() {

+ 11 - 5
src/pages/subPages/order.vue

@@ -106,8 +106,10 @@ export default {
         async getOrderList () {
             const res = await getOrderList(1)
             console.log('订单列表', res);
-            this.tableData = res.datas.data
-            this.total = res.datas.total * this.pageSize
+            if (res && res.code == 200) {
+                this.tableData = res.datas.data
+                this.total = res.datas.total * this.pageSize
+            }
             // const res = await getIp()
             // console.log('res', res);
         },
@@ -130,8 +132,10 @@ export default {
             const endTime = this.dataRange[1]
             const res = await queryList(this.pageNumber, startTime, endTime, this.RechargeType)
             console.log('查询订单', res);
-            this.tableData = res.datas.data
-            this.total = res.datas.total * this.pageSize
+            if (res && res.code == 200) {
+                this.tableData = res.datas.data
+                this.total = res.datas.total * this.pageSize
+            }
         },
         // 重置
         onReset() {
@@ -154,7 +158,9 @@ export default {
                 const endTime = this.dataRange[1]
                 const res = await queryList(this.pageNumber, startTime, endTime, this.RechargeType)
                 console.log('查询订单', res);
-                this.tableData = res.datas.data
+                if (res && res.code == 200) {
+                    this.tableData = res.datas.data
+                }
             }
         },
     },

+ 6 - 4
src/pages/subPages/view.vue

@@ -187,10 +187,12 @@ export default {
         async getUserInfo() {
             const res = await getUserInfo()
             console.log('个人中心', res);
-            this.merchantsCode = res.datas.mchid
-            this.merchantsName = res.datas.name
-            this.ipList = res.datas.ips
-            this.alarm_amount = res.datas.alarm_amount
+            if (res && res.code == 200) {
+                this.merchantsCode = res.datas.mchid
+                this.merchantsName = res.datas.name
+                this.ipList = res.datas.ips
+                this.alarm_amount = res.datas.alarm_amount
+            }
         },
         // 设置密钥
         async updateKey() {