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