Commit 9a39156a977aa084a5ac516dab971b389330aa86

Authored by wangming
1 parent 38329136

修改

Showing 1 changed file with 68 additions and 83 deletions
pages/PayMoney/PayMoney.vue
... ... @@ -88,21 +88,28 @@
88 88 icon: 'none'
89 89 })
90 90 } else {
91   - this.modelmoney.oldmoney=this.balance*100
92   - this.modelmoney.money=this.moneys*100
93   - this.modelmoney.nowmoney=this.modelmoney.oldmoney-this.modelmoney.money
94   - let bool=this.AddMoney()
95   - if(bool){
  91 + this.modelmoney.oldmoney = this.balance * 100
  92 + this.modelmoney.money = this.moneys * 100
  93 + if (this.modelmoney.oldmoney < this.modelmoney.money) {
  94 + uni.showToast({
  95 + title: '余额不足,无法进行提现',
  96 + icon: 'none'
  97 + })
  98 + } else {
  99 + this.modelmoney.nowmoney = this.modelmoney.oldmoney - this.modelmoney.money
  100 + let bool = this.AddMoney()
  101 + if (bool) {
96 102 uni.showToast({
97   - title:'已提交审核提现',
98   - icon:'success'
  103 + title: '已提交审核提现',
  104 + icon: 'success'
99 105 })
100   - }else{
  106 + } else {
101 107 uni.showToast({
102   - title:'提现失败',
103   - icon:'none'
  108 + title: '提现失败',
  109 + icon: 'none'
104 110 })
105 111 }
  112 + }
106 113 }
107 114 },
108 115 // 确认提现
... ... @@ -110,7 +117,7 @@
110 117 let regs = /^\d+(\.\d{0,2})?$/;
111 118 let storage = uni.getStorageSync('userinfo')
112 119 this.model.openid = storage.data.openid
113   - this.modelmoney.oldmoney=this.balance*100
  120 + this.modelmoney.oldmoney = this.balance * 100
114 121 if (this.moneys == 0) {
115 122 uni.showToast({
116 123 title: '请输入金额',
... ... @@ -128,47 +135,54 @@
128 135 })
129 136 } else {
130 137 this.model.amount = this.moneys * 100
131   - this.API.GetPay(this.model).then(res => {
132   - console.log('res支付', res)
133   - if (res.data.code == 200) {
134   - this.API.UpdBlanceByUser({
135   - userid: storage.data.id,
136   - amount: this.model.amount
137   - }).then(res => {
138   - console.log('res更改金额')
139   - if (res.data.code == 200) {
140   - storage = res.data
141   - uni.setStorageSync('userinfo', storage)
142   - uni.showToast({
143   - title: '提现成功',
144   - icon: 'success',
145   - duration: 1000
146   - })
147   - this.modelmoney.status = 0
148   - setTimeout(() => {
149   - uni.switchTab({
150   - url: '../my/my'
  138 + if (this.balance < this.moneys) {
  139 + uni.showToast({
  140 + title: '余额不足,无法进行提现',
  141 + icon: 'none'
  142 + })
  143 + }else{
  144 + this.API.GetPay(this.model).then(res => {
  145 + console.log('res支付', res)
  146 + if (res.data.code == 200) {
  147 + this.API.UpdBlanceByUser({
  148 + userid: storage.data.id,
  149 + amount: this.model.amount
  150 + }).then(res => {
  151 + console.log('res更改金额')
  152 + if (res.data.code == 200) {
  153 + storage = res.data
  154 + uni.setStorageSync('userinfo', storage)
  155 + uni.showToast({
  156 + title: '提现成功',
  157 + icon: 'success',
  158 + duration: 1000
151 159 })
152   - }, 1000)
153   - } else {
154   - uni.showToast({
155   - title: '提现失败',
156   - icon: 'none'
157   - })
158   - this.modelmoney.status = -99
159   - }
160   - this.modelmoney.money = this.model.amount
161   - this.modelmoney.nowmoney = this.modelmoney.oldmoney - this.modelmoney.money
162   - this.AddMoney()
163   - })
164   -
165   - } else {
166   - uni.showToast({
167   - title: res.message,
168   - icon: 'none'
169   - })
170   - }
171   - })
  160 + this.modelmoney.status = 0
  161 + setTimeout(() => {
  162 + uni.switchTab({
  163 + url: '../my/my'
  164 + })
  165 + }, 1000)
  166 + } else {
  167 + uni.showToast({
  168 + title: '提现失败',
  169 + icon: 'none'
  170 + })
  171 + this.modelmoney.status = -99
  172 + }
  173 + this.modelmoney.money = this.model.amount
  174 + this.modelmoney.nowmoney = this.modelmoney.oldmoney - this.modelmoney.money
  175 + this.AddMoney()
  176 + })
  177 +
  178 + } else {
  179 + uni.showToast({
  180 + title: res.message,
  181 + icon: 'none'
  182 + })
  183 + }
  184 + })
  185 + }
172 186 }
173 187  
174 188  
... ... @@ -177,11 +191,11 @@
177 191 AddMoney() {
178 192 let jsonstorage = uni.getStorageSync('userinfo').data
179 193 this.modelmoney.username = jsonstorage.username
180   - this.modelmoney.openid=jsonstorage.openid
181   - this.modelmoney.remark="提现"
  194 + this.modelmoney.openid = jsonstorage.openid
  195 + this.modelmoney.remark = "提现"
182 196 this.modelmoney.userid = jsonstorage.id
183 197 // this.modelmoney.oldmoney = jsonstorage.balance
184   - this.model.status=0
  198 + this.model.status = 0
185 199 this.API.AddOrUpdMoney(this.modelmoney).then(res => {
186 200 console.log('添加记录', res)
187 201 if (res.code == 200) {
... ... @@ -222,51 +236,41 @@
222 236 height: 100%;
223 237 width: 100%;
224 238 }
225   -
226 239 .YmContent {
227 240 height: 100%;
228 241 width: 100%;
229 242 }
230   -
231 243 uni-page-body,
232 244 #app {
233 245 height: 100%;
234 246 }
235   -
236 247 button::after {
237 248 border: none;
238 249 width: auto;
239 250 }
240   -
241 251 input {
242 252 outline: none;
243 253 border: none;
244 254 list-style: none;
245 255 width: auto;
246 256 }
247   -
248 257 .list_item {
249 258 float: left;
250 259 }
251   -
252 260 .ym_hide {
253 261 display: none;
254 262 }
255   -
256 263 .ym_show {
257 264 display: block;
258 265 }
259   -
260 266 .slide-image {
261 267 width: 100%;
262 268 height: 100%;
263 269 }
264   -
265 270 .list_horizontal {
266 271 width: auto;
267 272 display: inline-block;
268 273 }
269   -
270 274 .application_for_withdrawal_71 {
271 275 white-space: normal;
272 276 width: 749upx;
... ... @@ -278,7 +282,6 @@
278 282 border-radius: 0upx;
279 283 font-size: 8upx;
280 284 }
281   -
282 285 .application_for_withdrawal_71 .application_for_withdrawal_74 {
283 286 white-space: normal;
284 287 width: 181upx;
... ... @@ -293,7 +296,6 @@
293 296 font-size: 32upx;
294 297 line-height: 34upx;
295 298 }
296   -
297 299 .application_for_withdrawal_71 .application_for_withdrawal_75 {
298 300 white-space: normal;
299 301 width: 647upx;
... ... @@ -307,7 +309,6 @@
307 309 font-size: 43upx;
308 310 line-height: 44upx;
309 311 }
310   -
311 312 .application_for_withdrawal_71 .application_for_withdrawal_75 .application_for_withdrawal_76 {
312 313 white-space: normal;
313 314 width: auto;
... ... @@ -321,7 +322,6 @@
321 322 font-size: 43upx;
322 323 line-height: 44upx;
323 324 }
324   -
325 325 .application_for_withdrawal_71 .application_for_withdrawal_75 .application_for_withdrawal_77 {
326 326 white-space: normal;
327 327 width: auto;
... ... @@ -336,7 +336,6 @@
336 336 font-size: 43upx;
337 337 line-height: 43upx;
338 338 }
339   -
340 339 .application_for_withdrawal_71 .application_for_withdrawal_81 {
341 340 white-space: normal;
342 341 width: 704upx;
... ... @@ -350,7 +349,6 @@
350 349 font-size: 29upx;
351 350 line-height: 36upx;
352 351 }
353   -
354 352 .application_for_withdrawal_71 .application_for_withdrawal_81 .application_for_withdrawal_82 {
355 353 white-space: normal;
356 354 width: 377upx;
... ... @@ -364,7 +362,6 @@
364 362 font-size: 29upx;
365 363 line-height: 36upx;
366 364 }
367   -
368 365 .application_for_withdrawal_71 .application_for_withdrawal_81 .application_for_withdrawal_83 {
369 366 white-space: normal;
370 367 width: 128upx;
... ... @@ -378,7 +375,6 @@
378 375 font-size: 29upx;
379 376 line-height: 36upx;
380 377 }
381   -
382 378 .application_for_withdrawal_71 .payType {
383 379 white-space: normal;
384 380 width: 683upx;
... ... @@ -392,7 +388,6 @@
392 388 font-size: 49upx;
393 389 line-height: 50upx;
394 390 }
395   -
396 391 .application_for_withdrawal_71 .payType .application_for_withdrawal_85 {
397 392 white-space: normal;
398 393 width: 46upx;
... ... @@ -405,7 +400,6 @@
405 400 font-size: 48upx;
406 401 line-height: 47upx;
407 402 }
408   -
409 403 .application_for_withdrawal_71 .payType .application_for_withdrawal_86 {
410 404 white-space: normal;
411 405 width: 61upx;
... ... @@ -419,7 +413,6 @@
419 413 font-size: 27upx;
420 414 line-height: 28upx;
421 415 }
422   -
423 416 .application_for_withdrawal_71 .payType .application_for_withdrawal_87 {
424 417 white-space: normal;
425 418 width: 43upx;
... ... @@ -432,7 +425,6 @@
432 425 font-size: 43upx;
433 426 line-height: 44upx;
434 427 }
435   -
436 428 .application_for_withdrawal_71 .payType .application_for_withdrawal_88 {
437 429 white-space: normal;
438 430 width: 47upx;
... ... @@ -445,7 +437,6 @@
445 437 font-size: 49upx;
446 438 line-height: 47upx;
447 439 }
448   -
449 440 .application_for_withdrawal_71 .payType .application_for_withdrawal_89 {
450 441 white-space: normal;
451 442 width: 81upx;
... ... @@ -459,7 +450,6 @@
459 450 font-size: 27upx;
460 451 line-height: 29upx;
461 452 }
462   -
463 453 .application_for_withdrawal_71 .payType .application_for_withdrawal_90 {
464 454 white-space: normal;
465 455 width: 43upx;
... ... @@ -472,7 +462,6 @@
472 462 font-size: 42upx;
473 463 line-height: 43upx;
474 464 }
475   -
476 465 .application_for_withdrawal_71 .btSubmit {
477 466 white-space: normal;
478 467 width: 679upx;
... ... @@ -491,11 +480,9 @@
491 480 font-size: 27upx;
492 481 line-height: 92upx;
493 482 }
494   -
495 483 .application_for_withdrawal_71 .btSubmit_label {
496 484 float: left;
497 485 }
498   -
499 486 .application_for_withdrawal_71 .btSubmit_button {
500 487 float: left;
501 488 color: #000000;
... ... @@ -509,7 +496,6 @@
509 496 padding: 10rpx;
510 497 margin: 15rpx;
511 498 }
512   -
513 499 .application_for_withdrawal_71 .btSubmit_button_select {
514 500 float: left;
515 501 color: #ff8000;
... ... @@ -523,7 +509,6 @@
523 509 padding: 10rpx;
524 510 margin: 15rpx;
525 511 }
526   -
527 512 .application_for_withdrawal_71 .btSubmit_title {
528 513 float: left;
529 514 }
... ...