浏览代码

静态页面

xcx 4 年前
父节点
当前提交
fc33948948

+ 3
- 5
src/pages/WoDe/ChongZhiZhuangTai/index.vue 查看文件

@@ -50,12 +50,10 @@ export default {
50 50
       if (this.$route.query.orderId !== undefined) {
51 51
         this.GetAliPayStatus({ urlData: { id: this.$route.query.orderId } }).then((res) => {
52 52
           this.OrderStatus = res.data.data === 1 ? 'Success' : 'Error'
53
-          if (res.data.data === 1) {
54
-            this.GetCurrentUserInfo().then((res) => {
55
-              this.UpdateUserInfo(res.data.data)
56
-            })
57
-          }
53
+          this.GetCurrentUserInfo()
58 54
         })
55
+      } else {
56
+        this.GetCurrentUserInfo()
59 57
       }
60 58
     }
61 59
   }

+ 16
- 3
src/pages/index/DaLeTouDingDan/index.vue 查看文件

@@ -52,7 +52,7 @@
52 52
             <span><em>{{TotalCount}}</em>注</span>
53 53
             <span>金额:<em>{{TotalPrize * Multiple}}</em>牛币</span>
54 54
           </div>
55
-          <a @click="ToPostBetting" :class="{'active': CurrentStoreId !== null && DaLeTouCart.length}">立即购买</a>
55
+          <a @click="ConfirmBetting" :class="{'active': CurrentStoreId !== null && DaLeTouCart.length}">立即购买</a>
56 56
         </div>
57 57
 
58 58
         <div class="Layer" v-if="ShowStore">
@@ -130,6 +130,7 @@ export default {
130 130
   },
131 131
   computed: {
132 132
     ...mapUserState({
133
+      UserInfo: x => x.UserInfo, // 用户信息
133 134
       DaLeTouCart: x => x.DaLeTouCart // 大乐透购物车
134 135
     })
135 136
   },
@@ -173,7 +174,8 @@ export default {
173 174
     ...mapUserActions([
174 175
       'PostBetting',
175 176
       'GetStoreList',
176
-      'CreateAliPayOrder'
177
+      'CreateAliPayOrder',
178
+      'GetCurrentUserInfo'
177 179
     ]),
178 180
     SelectStore (item) { // 选择店铺
179 181
       if (this.DataLock) return
@@ -189,6 +191,15 @@ export default {
189 191
       })
190 192
       return arr
191 193
     },
194
+    ConfirmBetting () {
195
+      if (this.DataLock || !this.DaLeTouCart.length || this.CurrentStoreId === null) return
196
+      this.Dialog.confirm({
197
+        title: '确认投注',
198
+        message: `您将花费${this.TotalPrize * this.Multiple}牛币进行投注,目前账户余额${this.UserInfo.account.amount}牛币`
199
+      }).then(() => {
200
+        this.ToPostBetting()
201
+      })
202
+    },
192 203
     ToPostBetting () { // 去下注
193 204
       if (this.DataLock || !this.DaLeTouCart.length || this.CurrentStoreId === null) return
194 205
       this.DataLock = true
@@ -233,7 +244,9 @@ export default {
233 244
         this.TotalPrize = 0
234 245
         this.Multiple = 1
235 246
         this.DataLock = false
236
-        this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'DaLeTou' } })
247
+        this.GetCurrentUserInfo().then(() => {
248
+          this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'DaLeTou' } })
249
+        })
237 250
       }).catch((res) => {
238 251
         this.Toast(res.data.message)
239 252
         this.DataLock = false

+ 15
- 3
src/pages/index/LanQiuDingDan/index.vue 查看文件

@@ -53,7 +53,7 @@
53 53
             <span>金额:<em>{{TotalPrice}}</em>牛币</span>
54 54
             <span>预计奖金:<em>{{(MinPrice * Multiple).toFixed(0)}} ~ {{(MaxPrice * Multiple).toFixed(0)}}</em>牛币</span>
55 55
           </div>
56
-          <a :class="{'active': CurrentStoreId !== null && LanQiuCart.length}" @click="ToPostBetting">立即购买</a>
56
+          <a :class="{'active': CurrentStoreId !== null && LanQiuCart.length}" @click="ConfirmBetting">立即购买</a>
57 57
         </div>
58 58
 
59 59
         <div class="Layer" v-if="ShowPassWay">
@@ -183,7 +183,8 @@ export default {
183 183
     ]),
184 184
     ...mapUserActions([
185 185
       'PostBetting',
186
-      'GetStoreList'
186
+      'GetStoreList',
187
+      'GetCurrentUserInfo'
187 188
     ]),
188 189
     Init () { // 初始化
189 190
       this.PageList = [...this.LanQiuCart] // 赋值页面数据
@@ -193,6 +194,15 @@ export default {
193 194
         this.ToGetAllParts() // 枚举投注
194 195
       }
195 196
     },
197
+    ConfirmBetting () {
198
+      if (this.DataLock || !this.LanQiuCart.length || this.CurrentStoreId === null || this.CurrentPassCode === null) return
199
+      this.Dialog.confirm({
200
+        title: '确认投注',
201
+        message: `您将花费${this.TotalPrice}牛币进行投注,目前账户余额${this.UserInfo.account.amount}牛币`
202
+      }).then(() => {
203
+        this.ToPostBetting()
204
+      })
205
+    },
196 206
     ToPostBetting () { // 去下注
197 207
       if (this.DataLock || !this.LanQiuCart.length || this.CurrentStoreId === null || this.CurrentPassCode === null) return
198 208
       this.DataLock = true
@@ -233,7 +243,9 @@ export default {
233 243
         this.TotalPrice = 0
234 244
         this.Multiple = 1
235 245
         this.DataLock = false
236
-        this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'LanQiu' } })
246
+        this.GetCurrentUserInfo().then(() => {
247
+          this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'LanQiu' } })
248
+        })
237 249
       }).catch((res) => {
238 250
         this.Toast(res.data.message)
239 251
         this.DataLock = false

+ 15
- 3
src/pages/index/PaiLie3DingDan/index.vue 查看文件

@@ -97,7 +97,7 @@
97 97
           <div class="flex-h">
98 98
             <a @click="$router.go(-1)">自选号码</a>
99 99
             <a @click="CutRandomCount(1)">机选一注</a>
100
-            <a class="flex-item" @click="ToPostBetting" :class="{'active': CurrentStoreId !== null && PaiLie3Cart.length}">确认投注</a>
100
+            <a class="flex-item" @click="ConfirmBetting" :class="{'active': CurrentStoreId !== null && PaiLie3Cart.length}">确认投注</a>
101 101
           </div>
102 102
         </div>
103 103
 
@@ -194,7 +194,8 @@ export default {
194 194
     ]),
195 195
     ...mapUserActions([
196 196
       'PostBetting',
197
-      'GetStoreList'
197
+      'GetStoreList',
198
+      'GetCurrentUserInfo'
198 199
     ]),
199 200
     Init () {
200 201
       this.PageList = [...this.PaiLie3Cart]
@@ -255,6 +256,15 @@ export default {
255 256
       this.CurrentStoreId = item.shopId === this.CurrentStoreId ? null : item.shopId
256 257
       this.DataLock = false
257 258
     },
259
+    ConfirmBetting () {
260
+      if (this.DataLock || !this.PaiLie3Cart.length || this.CurrentStoreId === null) return
261
+      this.Dialog.confirm({
262
+        title: '确认投注',
263
+        message: `您将花费${this.TotalCount * 200 * this.Multiple}牛币进行投注,目前账户余额${this.UserInfo.account.amount}牛币`
264
+      }).then(() => {
265
+        this.ToPostBetting()
266
+      })
267
+    },
258 268
     ToPostBetting () { // 去下注
259 269
       if (this.DataLock || !this.PaiLie3Cart.length || this.CurrentStoreId === null) return
260 270
       this.DataLock = true
@@ -288,7 +298,9 @@ export default {
288 298
         this.TotalCount = 0
289 299
         this.Multiple = 1
290 300
         this.DataLock = false
291
-        this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'PaiLie3' } })
301
+        this.GetCurrentUserInfo().then(() => {
302
+          this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'PaiLie3' } })
303
+        })
292 304
       }).catch((res) => {
293 305
         this.Toast(res.data.message)
294 306
         this.DataLock = false

+ 15
- 3
src/pages/index/PaiLie5DingDan/index.vue 查看文件

@@ -88,7 +88,7 @@
88 88
           <div class="flex-h">
89 89
             <a @click="$router.go(-1)">自选号码</a>
90 90
             <a @click="CutRandomCount(1)">机选一注</a>
91
-            <a class="flex-item" @click="ToPostBetting" :class="{'active': CurrentStoreId !== null && PaiLie5Cart.length}">确认投注</a>
91
+            <a class="flex-item" @click="ConfirmBetting" :class="{'active': CurrentStoreId !== null && PaiLie5Cart.length}">确认投注</a>
92 92
           </div>
93 93
         </div>
94 94
 
@@ -192,7 +192,8 @@ export default {
192 192
     ]),
193 193
     ...mapUserActions([
194 194
       'PostBetting',
195
-      'GetStoreList'
195
+      'GetStoreList',
196
+      'GetCurrentUserInfo'
196 197
     ]),
197 198
     Init () { // 初始化
198 199
       this.PageList = [...this.PaiLie5Cart]
@@ -220,6 +221,15 @@ export default {
220 221
         }
221 222
       })
222 223
     },
224
+    ConfirmBetting () {
225
+      if (this.DataLock || !this.PaiLie5Cart.length || this.CurrentStoreId === null) return
226
+      this.Dialog.confirm({
227
+        title: '确认投注',
228
+        message: `您将花费${this.TotalCount * 200 * this.Multiple}牛币进行投注,目前账户余额${this.UserInfo.account.amount}牛币`
229
+      }).then(() => {
230
+        this.ToPostBetting()
231
+      })
232
+    },
223 233
     ToPostBetting () { // 去下注
224 234
       if (this.DataLock || !this.PaiLie5Cart.length || this.CurrentStoreId === null) return
225 235
       this.DataLock = true
@@ -266,7 +276,9 @@ export default {
266 276
         this.TotalCount = 0
267 277
         this.Multiple = 1
268 278
         this.DataLock = false
269
-        this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'PaiLie5' } })
279
+        this.GetCurrentUserInfo().then(() => {
280
+          this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'PaiLie5' } })
281
+        })
270 282
       }).catch((res) => {
271 283
         this.Toast(res.data.message)
272 284
         this.DataLock = false

+ 15
- 3
src/pages/index/ShuangSeQiuDingDan/index.vue 查看文件

@@ -51,7 +51,7 @@
51 51
             <span><em>{{TotalCount}}</em>注</span>
52 52
             <span>金额:<em>{{TotalPrize}}</em>牛币</span>
53 53
           </div>
54
-          <a @click="ToPostBetting" :class="{'active': CurrentStoreId !== null && ShuangSeQiuCart.length}">立即购买</a>
54
+          <a @click="ConfirmBetting" :class="{'active': CurrentStoreId !== null && ShuangSeQiuCart.length}">立即购买</a>
55 55
         </div>
56 56
 
57 57
         <div class="Layer" v-if="ShowStore">
@@ -171,7 +171,8 @@ export default {
171 171
     ]),
172 172
     ...mapUserActions([
173 173
       'PostBetting',
174
-      'GetStoreList'
174
+      'GetStoreList',
175
+      'GetCurrentUserInfo'
175 176
     ]),
176 177
     ResToString (target) {
177 178
       let arr = []
@@ -180,6 +181,15 @@ export default {
180 181
       })
181 182
       return arr
182 183
     },
184
+    ConfirmBetting () {
185
+      if (this.DataLock || !this.ShuangSeQiuCart.length || this.CurrentStoreId === null) return
186
+      this.Dialog.confirm({
187
+        title: '确认投注',
188
+        message: `您将花费${this.TotalPrize * this.Multiple}牛币进行投注,目前账户余额${this.UserInfo.account.amount}牛币`
189
+      }).then(() => {
190
+        this.ToPostBetting()
191
+      })
192
+    },
183 193
     ToPostBetting () { // 去下注
184 194
       if (this.DataLock || !this.ShuangSeQiuCart.length || this.CurrentStoreId === null) return
185 195
       this.DataLock = true
@@ -223,7 +233,9 @@ export default {
223 233
         this.TotalPrize = 0
224 234
         this.Multiple = 1
225 235
         this.DataLock = false
226
-        this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'ShuangSeQiu' } })
236
+        this.GetCurrentUserInfo().then(() => {
237
+          this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'ShuangSeQiu' } })
238
+        })
227 239
       }).catch((res) => {
228 240
         this.Toast(res.data.message)
229 241
         this.DataLock = false

+ 15
- 3
src/pages/index/ZuQiuDingDan/index.vue 查看文件

@@ -53,7 +53,7 @@
53 53
             <span>金额:<em>{{TotalPrice}}</em>牛币</span>
54 54
             <span>预计奖金:<em>{{(MinPrice * Multiple).toFixed(0)}} ~ {{(MaxPrice * Multiple).toFixed(0)}}</em>牛币</span>
55 55
           </div>
56
-          <a :class="{'active': CurrentStoreId !== null && ZuQiuCart.length}" @click="ToPostBetting">立即购买</a>
56
+          <a :class="{'active': CurrentStoreId !== null && ZuQiuCart.length}" @click="ConfirmBetting">立即购买</a>
57 57
         </div>
58 58
 
59 59
         <div class="Layer" v-if="ShowPassWay">
@@ -183,7 +183,8 @@ export default {
183 183
     ]),
184 184
     ...mapUserActions([
185 185
       'PostBetting',
186
-      'GetStoreList'
186
+      'GetStoreList',
187
+      'GetCurrentUserInfo'
187 188
     ]),
188 189
     Init () { // 初始化
189 190
       this.PageList = [...this.ZuQiuCart] // 赋值页面数据
@@ -194,6 +195,15 @@ export default {
194 195
         this.ToGetAllParts() // 枚举投注
195 196
       }
196 197
     },
198
+    ConfirmBetting () {
199
+      if (this.DataLock || !this.ZuQiuCart.length || this.CurrentStoreId === null || this.CurrentPassCode === null) return
200
+      this.Dialog.confirm({
201
+        title: '确认投注',
202
+        message: `您将花费${this.TotalPrice}牛币进行投注,目前账户余额${this.UserInfo.account.amount}牛币`
203
+      }).then(() => {
204
+        this.ToPostBetting()
205
+      })
206
+    },
197 207
     ToPostBetting () { // 去下注
198 208
       if (this.DataLock || !this.ZuQiuCart.length || this.CurrentStoreId === null || this.CurrentPassCode === null) return
199 209
       this.DataLock = true
@@ -234,7 +244,9 @@ export default {
234 244
         this.TotalPrice = 0
235 245
         this.Multiple = 1
236 246
         this.DataLock = false
237
-        this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'ZuQiu' } })
247
+        this.GetCurrentUserInfo().then(() => {
248
+          this.$router.push({ name: 'DingDanZhiFuZhuangTai', query: { orderId: res.data.data.orderId, bettingId: res.data.data.bettingId, routerName: 'ZuQiu' } })
249
+        })
238 250
       }).catch((res) => {
239 251
         this.Toast(res.data.message)
240 252
         this.DataLock = false

+ 1
- 1
src/store/user/index.js 查看文件

@@ -123,7 +123,7 @@ export default {
123 123
   actions: {
124 124
     GetCurrentUserInfo (context, payload) { // 获取当前用户信息
125 125
       return new Promise((resolve, reject) => {
126
-        ToolClass.Axios(resolve, reject, Api.GetCurrentUserInfo, context, payload, 1000)
126
+        ToolClass.Axios(resolve, reject, Api.GetCurrentUserInfo, context, payload, 1000, 'UpdateUserInfo')
127 127
       })
128 128
     },
129 129
     BindAliAccount (context, payload) { // 绑定支付宝