From 9f419480e2b9dfb10fcda84503451663e834b7f5 Mon Sep 17 00:00:00 2001 From: fan <1209452658@qq.com> Date: Tue, 13 Jul 2021 16:49:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/balance/balance.vue | 13 +- components/cont/cont.vue | 2 +- main.js | 2 +- pages/login/index.vue | 14 +- pages/menu/My/index.vue | 63 ++-- pages/menu/aplan/index.vue | 7 +- pages/menu/color/index.vue | 5 +- pages/menu/index/index.vue | 30 +- pages/menu/promotion/index.vue | 17 +- pages/menu/recharge/index.css | 13 +- pages/menu/recharge/index.vue | 41 +-- pages/menu/rule/inviteRule/index.vue | 6 +- pages/menu/withdrawl/index.vue | 477 ++++++++++++++------------- utils/axios.js | 20 +- 14 files changed, 388 insertions(+), 322 deletions(-) diff --git a/components/balance/balance.vue b/components/balance/balance.vue index 35fec13..0955394 100644 --- a/components/balance/balance.vue +++ b/components/balance/balance.vue @@ -6,7 +6,7 @@ - 387400.50 + {{currencySymbol}} {{currentBalance}} Recharge @@ -15,12 +15,11 @@ - diff --git a/pages/menu/withdrawl/index.vue b/pages/menu/withdrawl/index.vue index e7bd138..9293e3d 100644 --- a/pages/menu/withdrawl/index.vue +++ b/pages/menu/withdrawl/index.vue @@ -1,36 +1,41 @@ @@ -105,24 +108,27 @@ import utils from '@/utils' import cont from "@/components/navigation/navigation.vue" import md5 from 'js-md5' - export default{ - data(){ - return{ - withdrawConfig:[], - show: false, - content: '', - password:'', - tranAmt:'', - mobile:'', - fee:'', - trueMoney:'', - btncol:0, - invMore:false, - } - }, - + export default { + data() { + return { + currentBalance: '', + currencySymbol: '', + withdrawConfig: [], + show: false, + content: '', + password: '', + tranAmt: '', + mobile: '', + fee: '', + trueMoney: '', + btncol: 0, + invMore: false, + } + }, + onLoad() { - this.mobile=uni.getStorageSync('loginMobile'); + this.currentBalance = uni.getStorageSync('currentBalance'); + this.mobile = uni.getStorageSync('loginMobile'); uni.request({ url: '/start/api/withdraw/withdrawConfig', data: { @@ -132,171 +138,182 @@ 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 }, method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - this.withdrawConfig=res.data.data; - this.content=this.withdrawConfig.tips; - console.log(res.data,8880); - console.log(this.withdrawConfig,9990); - this.show=true; + success: (res) => { + this.withdrawConfig = res.data.data; + this.content = this.withdrawConfig.tips; + console.log(res.data, 8880); + console.log(this.withdrawConfig, 9990); + this.show = true; }, fail: (res) => { console.log(res.data); } }); - - + + }, - methods:{ - gow(){ + methods: { + gow() { uni.reLaunch({ - url:'../index' + url: '../index' }) }, - goBouns(){ + goBouns() { uni.reLaunch({ - url:'./transactions/index' + url: './transactions/index' }) }, - goProRe(){ + goProRe() { uni.reLaunch({ - url:'./withdrawlRecord/index' + url: './withdrawlRecord/index' }) }, - calulate(){ - this.fee=this.tranAmt*0.1; - this.trueMoney=this.tranAmt-this.fee; - this.btncol=1; - if(this.tranAmt==''){ - this.btncol=0; + calulate() { + this.fee = this.tranAmt * 0.1; + this.trueMoney = this.tranAmt - this.fee; + this.btncol = 1; + if (this.tranAmt == '') { + this.btncol = 0; } }, - open(){ - this.show=true; - }, - widthDrawl(){ - if(this.mobile==''){ - uni.showToast({ - title: 'Please input mobile phone number', - icon: 'none', - duration: 1500 - }) - return; - } - var a= /^[0-9]{4,14}$/; - if(!a.test(this.mobile)){ - uni.showToast({ - title: 'Wrong format of mobile phone number', - icon: 'none', - duration: 1500 - }) - return; - } - // if (this.password == '') { - // uni.showToast({ - // title: 'password is empty', - // icon: 'none', - // duration: 1500 - // }) - // return; - // } - // var a= /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{5,19}$/; - // if(!a.test(this.password)){ - // uni.showToast({ - // title: 'Incorrect password format,a password requires a combination of numbers and letters', - // icon: 'none', - // duration: 1500 - // }) - // return; - // } - - // if(this.tranAmt { - if(res.data.success==true){ + open() { + this.show = true; + }, + widthDrawl() { + // if(this.mobile==''){ + // uni.showToast({ + // title: 'Please input mobile phone number', + // icon: 'none', + // duration: 1500 + // }) + // return; + // } + // var a= /^[0-9]{4,14}$/; + // if(!a.test(this.mobile)){ + // uni.showToast({ + // title: 'Wrong format of mobile phone number', + // icon: 'none', + // duration: 1500 + // }) + // return; + // } + // if (this.password == '') { + // uni.showToast({ + // title: 'password is empty', + // icon: 'none', + // duration: 1500 + // }) + // return; + // } + // var a= /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{5,19}$/; + // if(!a.test(this.password)){ + // uni.showToast({ + // title: 'Incorrect password format,a password requires a combination of numbers and letters', + // icon: 'none', + // duration: 1500 + // }) + // return; + // } + + // if(this.tranAmt { + + if (res.data.success == true) { + uni.showToast({ + title: res.data.errMsg, + icon: 'none', + duration: 1500 + }) + uni.request({ + url: '/start/api/withdraw/withdrawServiceCharge', + data: { + "ticket": uni.getStorageSync('logInfo').data, + // 'password': md5(this.password), + "tranAmt": this.tranAmt, + "ticket": uni.getStorageSync('MyInfo').data, + }, + header: { + 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 + }, + method: 'POST', //请求方式 或GET,必须为大写 + success: (res) => { + + console.log(res.data, '45464654646446'); + }, + fail: (res) => { + uni.showToast({ + title: res.data.errMsg, + icon: 'none', + duration: 1500 + }) + } + }); + } else { + uni.showToast({ + title: 'Withdrawal failed', + icon: 'none', + duration: 1500 + }) + } + console.log(res.data); + }, + fail: (res) => { + uni.showToast({ title: res.data.errMsg, - icon: 'none', - duration: 1500 - }) - uni.request({ - url: '/start/api/withdraw/withdrawServiceCharge', - data: { - "ticket": uni.getStorageSync('logInfo').data, - // 'password': md5(this.password), - "tranAmt":this.tranAmt, - "ticket":uni.getStorageSync('MyInfo').data, - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' //自定义请求头信息 - }, - method: 'POST', //请求方式 或GET,必须为大写 - success: (res) => { - - console.log(res.data,'45464654646446'); - }, - fail: (res) => { - uni.showToast({ - title: res.data.errMsg, - icon: 'none', - duration: 1500 - }) - } - }); - }else{ - uni.showToast({ - title: 'Withdrawal failed', - icon: 'none', + icon: 'none', duration: 1500 }) } - console.log(res.data); - }, - fail: (res) => { - uni.showToast({ - title: res.data.errMsg, - icon: 'none', - duration: 1500 - }) - } - }); - } - + }); + } + }, - + } diff --git a/utils/axios.js b/utils/axios.js index dff55b6..6f75e14 100644 --- a/utils/axios.js +++ b/utils/axios.js @@ -20,8 +20,8 @@ const service = axios.create({ }) // request拦截器,在请求之前做一些处理 -service.interceptors.request.use( - config => { +// service.interceptors.request.use( +// config => { // console.log('showDialog' + Vue.prototype.$showDialog) // if (Vue.prototype.$showDialog) { // uni.showLoading({ @@ -91,14 +91,14 @@ service.interceptors.request.use( // config.url = config.url + '&sign=' + sign // } // } - console.log(config) - return config; - }, - error => { - console.log(error); // for debug - return Promise.reject(error); - } -); + // console.log(config) + // return config; + // }, + // error => { + // console.log(error); // for debug + // return Promise.reject(error); + // } +// ); //配置成功后的拦截器 service.interceptors.response.use(res => {