Browse Source

fix:已支付订单限制操作修改

seamwang 2 years ago
parent
commit
03f29e387c
2 changed files with 9 additions and 5 deletions
  1. 2 3
      .gitignore
  2. 7 2
      src/pages/order/index.vue

+ 2 - 3
.gitignore

@@ -1,9 +1,8 @@
1
 node_modules
1
 node_modules
2
 dist/
2
 dist/
3
-.history/
4
-.env.development
3
+/.env.development
5
 .idea/anpaismall.iml
4
 .idea/anpaismall.iml
6
 .idea/misc.xml
5
 .idea/misc.xml
7
 .idea/modules.xml
6
 .idea/modules.xml
8
 .idea/vcs.xml
7
 .idea/vcs.xml
9
-.idea/workspace.xml
8
+.idea/workspace.xml

+ 7 - 2
src/pages/order/index.vue

@@ -74,7 +74,8 @@
74
               <view>
74
               <view>
75
                 <text class="text-price text-red">{{ item.sum_money }}</text>
75
                 <text class="text-price text-red">{{ item.sum_money }}</text>
76
               </view>
76
               </view>
77
-              <view>
77
+              <!-- 限制已支付后台数据没及时刷新 -->
78
+              <view v-show="!payIds.includes(item.order_id)">
78
                 <button @tap="pay(item.order_id)" class="cu-btn round bg-student text-white margin-right-sm" v-if="item.status === 0">立即付款</button>
79
                 <button @tap="pay(item.order_id)" class="cu-btn round bg-student text-white margin-right-sm" v-if="item.status === 0">立即付款</button>
79
                 <button @tap="cancel(item.order_id)" class="cu-btn round bg-gray" v-if="item.status === 0 && !isPaying">取消</button>
80
                 <button @tap="cancel(item.order_id)" class="cu-btn round bg-gray" v-if="item.status === 0 && !isPaying">取消</button>
80
               </view>
81
               </view>
@@ -163,7 +164,8 @@ export default {
163
       params: {
164
       params: {
164
         type: 5,
165
         type: 5,
165
         page: 1
166
         page: 1
166
-      }
167
+      },
168
+      payIds: [] //已支付订单ids
167
     }
169
     }
168
   },
170
   },
169
   filters: {
171
   filters: {
@@ -300,11 +302,13 @@ export default {
300
                 return false
302
                 return false
301
               }
303
               }
302
               if (res.code === 200) {
304
               if (res.code === 200) {
305
+                _self.isPaying = false
303
                 uni.showToast({ title: res.msg, icon: 'success', duration: 2000 })
306
                 uni.showToast({ title: res.msg, icon: 'success', duration: 2000 })
304
                 _self.changeTab(2)
307
                 _self.changeTab(2)
305
                 return true
308
                 return true
306
               }
309
               }
307
               if (res.code === 301) {
310
               if (res.code === 301) {
311
+                _self.isPaying = false
308
                 _self.showForm = true
312
                 _self.showForm = true
309
                 _self.payurl = res.data
313
                 _self.payurl = res.data
310
                 return true
314
                 return true
@@ -317,6 +321,7 @@ export default {
317
                 signType: res.data.signType,
321
                 signType: res.data.signType,
318
                 paySign: res.data.paySign,
322
                 paySign: res.data.paySign,
319
                 success: function (res) {
323
                 success: function (res) {
324
+                  _self.payIds.push(id)
320
                   _self.isPaying = false
325
                   _self.isPaying = false
321
                   _self.changeTab(0)
326
                   _self.changeTab(0)
322
                 },
327
                 },