diff --git a/App.vue b/App.vue index c7091916..22b8c0ad 100644 --- a/App.vue +++ b/App.vue @@ -1,74 +1,179 @@ - - diff --git a/components/couponListWindow/index.vue b/components/couponListWindow/index.vue index a7fa2cf7..9df55d8f 100644 --- a/components/couponListWindow/index.vue +++ b/components/couponListWindow/index.vue @@ -1,110 +1,235 @@ diff --git a/components/emptyPage.vue b/components/emptyPage.vue index 17814c3e..0d737d77 100644 --- a/components/emptyPage.vue +++ b/components/emptyPage.vue @@ -24,6 +24,7 @@ justify-content: center; align-items: center; margin-top: 200rpx; + padding-bottom: 60rpx; image{ width: 414rpx; height: 240rpx; diff --git a/components/home/index.vue b/components/home/index.vue index 665f452b..f1b92622 100644 --- a/components/home/index.vue +++ b/components/home/index.vue @@ -73,7 +73,7 @@ border-radius: 50rpx; opacity: 0; height: 0; - color: #e93323; + color: $theme-color; width: 0; } diff --git a/components/login_mobile/index.vue b/components/login_mobile/index.vue index b78d26a6..33a9c4f0 100644 --- a/components/login_mobile/index.vue +++ b/components/login_mobile/index.vue @@ -1,7 +1,7 @@ @@ -18,6 +18,7 @@ const app = getApp(); import sendVerifyCode from "@/mixins/SendVerifyCode"; import Routine from '@/libs/routine'; + import {mapGetters} from "vuex"; import { loginMobile, registerVerify, @@ -26,32 +27,59 @@ phoneSilenceAuth, phoneWxSilenceAuth } from "@/api/user"; - import { bindingPhone } from '@/api/api.js' - import { getUserPhone } from '@/api/public'; - export default{ - name:'login_mobile', - props:{ - isUp:{ - type:Boolean, - default:false, + import { + bindingPhone + } from '@/api/api.js' + import { + getUserPhone, + iosBinding + } from '@/api/public'; + const BACK_URL = "login_back_url"; + export default { + name: 'login_mobile', + computed: mapGetters(['userInfo','isLogin']), + props: { + isUp: { + type: Boolean, + default: false, }, - authKey:{ - type:String, - default:'', + authKey: { + type: String, + default: '', + }, + isShow: { + type: Boolean, + default: true + }, + isPos: { + type: Boolean, + default: true + }, + appleShow: { + type: String, + default: '' + }, + platform: { + type: String, + default: '', } }, - data(){ + data() { return { - keyCode:'', - account:'', - codeNum:'' + keyCode: '', + account: '', + codeNum: '', + isApp: 0 } }, mixins: [sendVerifyCode], mounted() { //this.getCode(); }, - methods:{ + onLoad() { + + }, + methods: { // 获取验证码 async code() { let that = this; @@ -61,12 +89,14 @@ if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({ title: '请输入正确的手机号码' }); - await registerVerify(that.account).then(res=>{ - that.$util.Tips({title:res.msg}); + await registerVerify(that.account).then(res => { + that.$util.Tips({ + title: res.msg + }); that.sendCode(); - }).catch(err=>{ + }).catch(err => { return that.$util.Tips({ - title:err + title: err }) }) }, @@ -81,11 +111,11 @@ }); }); }, - close(){ - this.$emit('close',false) + close() { + this.$emit('close', false) }, // 登录 - loginBtn(){ + loginBtn() { let that = this if (!that.account) return that.$util.Tips({ title: '请填写手机号码' @@ -99,47 +129,66 @@ if (!/^[\w\d]+$/i.test(that.codeNum)) return that.$util.Tips({ title: '请输入正确的验证码' }); - uni.showLoading({ title: '正在登录中' }); - getUserPhone({ - captcha: that.codeNum, - phone: that.account, - spid: app.globalData.spid, - spread: app.globalData.code, - type: 'public', - key: this.authKey - }).then(res=>{ - let time = res.data.expires_time - this.$Cache.time(); - this.$store.commit('LOGIN', { - token: res.data.token, - time: time - }); - this.getUserInfo(); - }).catch(error=>{ - uni.hideLoading() - this.$util.Tips({ - title:error + uni.showLoading({ + title: !this.userInfo.phone && this.isLogin?'正在绑定中':'正在登录中' + }); + if (!this.userInfo.phone && this.isLogin) { + iosBinding({ + captcha: that.codeNum, + phone: that.account + }).then(res => { + that.$util.Tips({ + title: '绑定手机号成功', + icon: 'success' + }, { + tab: 3 + }) + that.isApp = 1; + that.getUserInfo(); + }).catch(error => { + uni.hideLoading() + that.$util.Tips({ + title: error + }) }) - }) + } else { + getUserPhone({ + captcha: that.codeNum, + phone: that.account, + // #ifdef H5 + type: 'public', + // #endif + key: that.authKey + }).then(res => { + that.$store.commit('LOGIN', { + token: res.data.token + }); + that.$store.commit("SETUID", res.data.uid); + that.getUserInfo(); + }).catch(error => { + uni.hideLoading() + that.$util.Tips({ + title: error + }) + }) + } }, // #ifdef MP - phoneSilenceAuth(code){ + phoneSilenceAuth(code) { let self = this phoneSilenceAuth({ - code:code, + code: code, spid: app.globalData.spid, spread: app.globalData.code, - phone:this.account, - captcha:this.codeNum - }).then(res=>{ - let time = res.data.expires_time - this.$Cache.time(); - this.$store.commit('LOGIN', { - token: res.data.token, - time: time - }); + phone: this.account, + captcha: this.codeNum + }).then(res => { + this.$store.commit('LOGIN', res.data.token); + this.$store.commit("SETUID", res.data.uid); this.getUserInfo(); - }).catch(error=>{ + }).catch(error => { self.$util.Tips({ - title:error + title: error }) }) }, @@ -151,52 +200,56 @@ let that = this; getUserInfo().then(res => { uni.hideLoading(); - that.userInfo = res.data - that.$store.commit("SETUID", res.data.uid); that.$store.commit("UPDATE_USERINFO", res.data); - // #ifdef MP + // #ifdef MP that.$util.Tips({ - title:'登录成功', - icon:'success' - },{ - tab:3 + title: '登录成功', + icon: 'success' + }, { + tab: 3 }) that.close() // #endif // #ifdef H5 - that.$emit('wechatPhone',true) + that.$emit('wechatPhone', true) // #endif }); }, } } - - diff --git a/components/login_mobile/routine_phone.vue b/components/login_mobile/routine_phone.vue index 4d5b8800..f4082628 100644 --- a/components/login_mobile/routine_phone.vue +++ b/components/login_mobile/routine_phone.vue @@ -20,7 +20,7 @@ getCodeApi, getUserInfo } from "@/api/user"; - import { getLogo, silenceAuth, getUserPhone } from '@/api/public'; + import { getLogo, getUserPhone } from '@/api/public'; export default{ name:'routine_phone', props:{ @@ -51,7 +51,6 @@ // #ifdef MP // 小程序获取手机号码 getphonenumber(e){ - console.log(e) uni.showLoading({ title: '加载中' }); Routine.getCode() .then(code => { @@ -67,22 +66,21 @@ encryptedData: encryptedData, iv: iv, code: code, - spid: app.globalData.spid, - spread: app.globalData.code, key:this.authKey, type: 'routine' }) .then(res => { - let time = res.data.expires_time - this.$Cache.time(); this.$store.commit('LOGIN', { - token: res.data.token, - time: time + token: res.data.token }); + this.$store.commit("SETUID", res.data.uid); this.getUserInfo(); }) .catch(res => { - console.log(res); uni.hideLoading(); + this.$util.Tips({ + title: res + }); }); }, /** @@ -93,7 +91,6 @@ getUserInfo().then(res => { uni.hideLoading(); that.userInfo = res.data - that.$store.commit("SETUID", res.data.uid); that.$store.commit("UPDATE_USERINFO", res.data); that.isStatus = true this.close() @@ -150,7 +147,7 @@ height: 86rpx; line-height: 86rpx; margin-top: 60rpx; - background: #E93323; + background: $theme-color; border-radius: 43rpx; color: #fff; font-size: 28rpx; diff --git a/components/orderGoods/index.vue b/components/orderGoods/index.vue index ad5fb318..db27710b 100644 --- a/components/orderGoods/index.vue +++ b/components/orderGoods/index.vue @@ -1,26 +1,27 @@ diff --git a/components/productWindow/index.vue b/components/productWindow/index.vue index 1aaa9367..2beaa8d5 100644 --- a/components/productWindow/index.vue +++ b/components/productWindow/index.vue @@ -1,6 +1,7 @@ @@ -111,29 +115,60 @@ }, selfLocation() { let self = this - uni.getLocation({ - type: 'wgs84', - success: function(res) { - try { - uni.setStorageSync('user_latitude', res.latitude); - uni.setStorageSync('user_longitude', res.longitude); - } catch {} + // #ifdef H5 + if (self.$wechat.isWeixin()) { + self.$wechat.location().then(res => { + this.user_latitude = res.latitude; + this.user_longitude = res.longitude; + uni.setStorageSync('user_latitude', res.latitude); + uni.setStorageSync('user_longitude', res.longitude); self.getList(); - }, - complete:function() { - self.getList(); - } - }); + }) + } else { + // #endif + uni.getLocation({ + type: 'wgs84', + success: (res) => { + try { + this.user_latitude = res.latitude; + this.user_longitude = res.longitude; + uni.setStorageSync('user_latitude', res.latitude); + uni.setStorageSync('user_longitude', res.longitude); + } catch {} + self.getList(); + }, + complete: function() { + self.getList(); + } + }); + // #ifdef H5 + } + // #endif }, showMaoLocation(e) { - uni.openLocation({ - latitude: Number(e.latitude), - longitude: Number(e.longitude), - success: function() { + let self = this; + // #ifdef H5 + if (self.$wechat.isWeixin()) { + self.$wechat.seeLocation({ + latitude: Number(e.latitude), + longitude: Number(e.longitude) + }).then(res => { console.log('success'); - Number - } - }); + }) + } else { + // #endif + uni.openLocation({ + latitude: Number(e.latitude), + longitude: Number(e.longitude), + name: e.name, + address: `${e.address}-${e.detailedAddress}`, + success: function() { + console.log('success'); + } + }); + // #ifdef H5 + } + // #endif }, // 选中门店 checked(e) { @@ -241,9 +276,10 @@ border-radius: 50%; display: block; text-align: center; - line-height: 50rpx; + line-height: 48rpx; background-color: #e83323; margin-bottom: 22rpx; + text-decoration: none; } .store-distance { diff --git a/pages/users/goods_logistics/index.vue b/pages/users/goods_logistics/index.vue index 957f8328..7155ddd1 100644 --- a/pages/users/goods_logistics/index.vue +++ b/pages/users/goods_logistics/index.vue @@ -3,13 +3,13 @@ - + - {{product.productInfo.storeName}} + {{product.productName}} - ¥{{product.truePrice}} - x{{product.cartNum}} + ¥{{product.price}} + x{{product.payNum}} @@ -40,7 +40,7 @@ - + @@ -106,13 +106,7 @@ this.getExpress(); this.get_host_product(); } else { - // #ifdef H5 || APP-PLUS toLogin(); - // #endif - // #ifdef MP - this.isAuto = true; - this.$set(this, 'isShowAuth', true); - // #endif } }, onReady: function() { @@ -142,30 +136,11 @@ let that=this; express(that.orderId).then(function(res){ let result = res.data.express|| {}; - that.$set(that,'product',res.data.order.cartInfo[0] || {}); + that.$set(that,'product',res.data.order.info[0] || {}); that.$set(that,'orderInfo',res.data.order); that.$set(that,'expressList',result.list || []); }); }, - /** - * 获取我的推荐 - */ - // getGroomList(onloadH) { - // this.loading = true - // if (!this.goodScroll) return - // if (onloadH) { - // this.iSshowH = true - // } - // getGroomList(type, this.params).then(({ - // data - // }) => { - // this.iSshowH = false - // this.loading = false - // this.goodScroll = data.list.length >= this.params.limit - // this.params.page++ - // this.tempArr = this.tempArr.concat(data.list) - // }) - // } get_host_product: function () { this.loading = true if (!this.goodScroll) return @@ -176,7 +151,6 @@ that.goodScroll = res.data.list.length >= that.params.limit that.params.page++ that.hostProduct = that.hostProduct.concat(res.data.list) - // that.$set(that,'hostProduct',res.data.list); }); }, }, @@ -271,7 +245,7 @@ height: 40rpx; text-align: center; line-height: 40rpx; - border-radius: 3rpx; + border-radius: 20rpx; border: 1rpx solid #999; } @@ -291,15 +265,15 @@ } .logistics .logisticsCon .item .circular.on { - background-color: #e93323; + background-color: $theme-color; } .logistics .logisticsCon .item .text.on-font { - color: #e93323; + color: $theme-color; } .logistics .logisticsCon .item .text .data.on-font { - color: #e93323; + color: $theme-color; } .logistics .logisticsCon .item .text { diff --git a/pages/users/goods_return/index.vue b/pages/users/goods_return/index.vue index 1f9c6579..a09e1ee2 100644 --- a/pages/users/goods_return/index.vue +++ b/pages/users/goods_return/index.vue @@ -2,21 +2,17 @@
- - + + - {{item.info.productInfo.storeName}} - - ¥{{item.info.productInfo.attrInfo.price}} - x{{item.info.cartNum}} - - - ¥{{item.info.productInfo.price}} - x{{item.info.cartNum}} + {{item.storeName}} + + ¥{{item.price}} + x{{item.cartNum}} - + 退货件数 {{orderInfo.totalNum}} @@ -38,7 +34,7 @@ 备注说明 - + 上传凭证 ( 最多可上传3张 ) @@ -54,17 +50,17 @@ + - - + diff --git a/pages/users/kefu/index.vue b/pages/users/kefu/index.vue new file mode 100644 index 00000000..1c539f96 --- /dev/null +++ b/pages/users/kefu/index.vue @@ -0,0 +1,34 @@ + + + diff --git a/pages/users/login/index.vue b/pages/users/login/index.vue index ecd413ad..7b2753eb 100644 --- a/pages/users/login/index.vue +++ b/pages/users/login/index.vue @@ -1,47 +1,37 @@ @@ -126,7 +76,7 @@ validatorDefaultCatch } from "@/utils/dialog"; import { - getLogo + getLogo, appAuth, appleLogin } from "@/api/public"; import { VUE_APP_API_URL @@ -140,7 +90,7 @@ data: function() { return { navList: ["快速登录", "账号登录"], - current: 0, + current: 1, account: "", password: "", captcha: "", @@ -150,7 +100,13 @@ keyCode: "", codeUrl: "", codeVal: "", - isShowCode: false + isShowCode: false, + platform: '', + appLoginStatus: false, // 微信登录强制绑定手机号码状态 + appUserInfo: null, // 微信登录保存的用户信息 + appleLoginStatus: false, // 苹果登录强制绑定手机号码状态 + appleUserInfo: null, + appleShow: false // 苹果登录版本必须要求ios13以上的 }; }, watch:{ @@ -166,7 +122,143 @@ this.getCode(); this.getLogoImage(); }, + onLoad() { + let self = this + uni.getSystemInfo({ + success: function(res) { + if (res.platform.toLowerCase() == 'ios' && res.system.split(' ')[1] >= 13) { + self.appleShow = true + } + } + }); + }, methods: { + // 苹果登录 + appleLogin() { + let self = this + this.account = '' + this.captcha = '' + uni.showLoading({ + title: '登录中' + }) + uni.login({ + provider: 'apple', + timeout: 10000, + success(loginRes) { + uni.getUserInfo({ + provider: 'apple', + success: function(infoRes) { + self.appleUserInfo = infoRes.userInfo + self.appleLoginApi() + }, + fail() { + uni.hideLoading() + uni.showToast({ + title: '获取用户信息失败', + icon: 'none', + duration: 2000 + }) + }, + complete() { + uni.hideLoading() + } + }); + }, + fail(error) { + uni.hideLoading() + console.log(error) + } + }) + }, + // 苹果登录Api + appleLoginApi() { + let self = this + appleLogin({ + openId: self.appleUserInfo.openId, + email: self.appleUserInfo.email == undefined ? '' :self.appleUserInfo.email, + identityToken: self.appleUserInfo.identityToken || '' + }).then((res) => { + this.$store.commit("LOGIN", { + 'token': res.data.token + }); + this.getUserInfo(res.data); + }).catch(error => { + uni.hideLoading(); + uni.showModal({ + title: '提示', + content: `错误信息${error}`, + success: function(res) { + if (res.confirm) { + console.log('用户点击确定'); + } else if (res.cancel) { + console.log('用户点击取消'); + } + } + }); + }) + }, + // App微信登录 + wxLogin() { + let self = this + this.account = '' + this.captcha = '' + uni.showLoading({ + title: '登录中' + }) + uni.login({ + provider: 'weixin', + success: function(loginRes) { + // 获取用户信息 + uni.getUserInfo({ + provider: 'weixin', + success: function(infoRes) { + uni.hideLoading(); + self.appUserInfo = infoRes.userInfo + self.appUserInfo.type = self.platform === 'ios' ? 'iosWx' : 'androidWx' + self.wxLoginGo(self.appUserInfo) + }, + fail() { + uni.hideLoading(); + uni.showToast({ + title: '获取用户信息失败', + icon: 'none', + duration: 2000 + }) + }, + complete() { + uni.hideLoading() + } + }); + }, + fail() { + uni.hideLoading() + uni.showToast({ + title: '登录失败', + icon: 'none', + duration: 2000 + }) + } + }); + }, + wxLoginGo(userInfo) { + appAuth(userInfo).then(res => { + if (res.data.type === 'register') { + uni.navigateTo({ + url: '/pages/users/app_login/index?authKey='+res.data.key + }) + } + if (res.data.type === 'login') { + this.$store.commit("LOGIN", { + 'token': res.data.token + }); + this.getUserInfo(res.data); + } + }).catch(res => { + that.$util.Tips({ + title: res + }); + }); + }, again() { this.codeUrl = VUE_APP_API_URL + @@ -177,20 +269,11 @@ }, getCode() { let that = this - // getCodeApi() - // .then(res => { - // that.keyCode = res.data.key; - // }) - // .catch(res => { - // that.$util.Tips({ - // title: res - // }); - // }); }, async getLogoImage() { let that = this; getLogo().then(res => { - that.logoUrl = res.data.logoUrl; + that.logoUrl = res.data.logoUrl?res.data.logoUrl:'/static/images/logo2.png'; }); }, async loginMobile() { @@ -208,34 +291,17 @@ title: '请输入正确的验证码' }); loginMobile({ - account: that.account, + phone: that.account, captcha: that.captcha, - spread: that.$Cache.get("spread") + spread_spid: that.$Cache.get("spread") }) .then(res => { let data = res.data; let newTime = Math.round(new Date() / 1000); - that.$store.commit("LOGIN", { - 'token': data.token - // 'time': dayjs(data.expiresTime) - newTime + this.$store.commit("LOGIN", { + 'token': res.data.token }); - const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; - that.$Cache.clear(BACK_URL); - // getUserInfo().then(res => { - that.$store.commit("SETUID", res.data.user.uid); - if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl === - '/pages/user/index') { - - uni.switchTab({ - url: backUrl - }); - - } else { - uni.switchTab({ - url: '/pages/index/index' - }); - } - // }) + that.getUserInfo(data); }) .catch(res => { that.$util.Tips({ @@ -290,21 +356,15 @@ title: '请输入正确的手机号码' }); if (that.formItem == 2) that.type = "register"; - // phone: that.account - // type: that.type, - // key: that.keyCode, - // code: that.codeVal await registerVerify(that.account) .then(res => { that.$util.Tips({title:res.message}); that.sendCode(); }) - .catch(res => { - // if (res.data.status === 402) { - // that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`; - // that.isShowCode = true; - // } - that.$util.Tips({title:res.message}); + .catch(err => { + return that.$util.Tips({ + title: err + }); }); }, navTap: function(index) { @@ -329,44 +389,210 @@ .then(({ data }) => { - // let newTime = Math.round(new Date() / 1000); - that.$store.commit("LOGIN", { + this.$store.commit("LOGIN", { 'token': data.token - // 'time': dayjs(data.expiresTime) - newTime }); - const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index"; - that.$Cache.clear(BACK_URL); - getUserInfo().then(res => { - that.$store.commit("SETUID", res.data.uid); - if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ==='/pages/user/index') { - uni.switchTab({ - url: backUrl - }); - } else { - uni.switchTab({ - url: '/pages/index/index' - }); - } - }) + that.getUserInfo(data); }) .catch(e => { that.$util.Tips({ title: e }); }); + }, + getUserInfo(data){ + this.$store.commit("SETUID", data.uid); + getUserInfo().then(res => { + this.$store.commit("UPDATE_USERINFO", res.data); + let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index"; + if (backUrl.indexOf('/pages/users/login/index') !== -1) { + backUrl = '/pages/index/index'; + } + uni.reLaunch({ + url: backUrl + }); + }) } } }; - \ No newline at end of file + + .login-wrapper { + padding: 30rpx; + + .shading { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + + /* #ifdef APP-VUE */ + margin-top: 50rpx; + /* #endif */ + /* #ifndef APP-VUE */ + + margin-top: 200rpx; + /* #endif */ + + + image { + width: 180rpx; + height: 180rpx; + } + } + + .whiteBg { + margin-top: 100rpx; + + .list { + border-radius: 16rpx; + overflow: hidden; + + .item { + border-bottom: 1px solid #F0F0F0; + background: #fff; + + .row-middle { + position: relative; + padding: 16rpx 45rpx; + + .texts{ + flex: 1; + font-size: 28rpx; + height: 80rpx; + line-height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + } + + input { + flex: 1; + font-size: 28rpx; + height: 80rpx; + line-height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + } + + .code { + position: absolute; + right: 30rpx; + top: 50%; + color: $theme-color; + font-size: 26rpx; + transform: translateY(-50%); + } + } + } + } + + .logon { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 86rpx; + margin-top: 80rpx; + background-color: $theme-color; + border-radius: 120rpx; + color: #FFFFFF; + font-size: 30rpx; + } + + .tips { + margin: 30rpx; + text-align: center; + color: #999; + } + } + } + diff --git a/pages/users/order_confirm/index.vue b/pages/users/order_confirm/index.vue index 2af35f46..33043e6a 100644 --- a/pages/users/order_confirm/index.vue +++ b/pages/users/order_confirm/index.vue @@ -1,17 +1,23 @@ diff --git a/pages/users/promoter-list/index.vue b/pages/users/promoter-list/index.vue index 13eeff3f..7399028b 100644 --- a/pages/users/promoter-list/index.vue +++ b/pages/users/promoter-list/index.vue @@ -2,74 +2,84 @@ - + 推广人数 - {{teamCount}} + {{peopleData.count}} - - 一级({{total}}) - 二级({{totalLevel}}) - - - - - - - - 团队排序 - - - 团队排序 - - - 团队排序 - - - 金额排序 - - - 金额排序 - - - 金额排序 - - - 订单排序 - - - 订单排序 - - - 订单排序 - + + + 一级({{peopleData.total}}) + 二级({{peopleData.totalLevel}}) - - - - - - - - {{item.nickname}} - 加入时间: {{item.time}} - + + + + + + + 团队排序 + - - {{item.childCount ? item.childCount : 0}} - {{item.orderCount ? item.orderCount : 0}} - {{item.numberCount ? item.numberCount : 0}} + 团队排序 + + + 团队排序 + + + + 金额排序 + + + 金额排序 + + + 金额排序 + + + 订单排序 + + + 订单排序 + + + 订单排序 + - + + + + + + + + {{item.nickname}} + 加入时间: {{item.time.split(' ')[0]}} + + + + {{item.childCount ? item.childCount : 0}}人 + + {{item.orderCount ? item.orderCount : 0}} + {{item.numberCount ? item.numberCount : 0}} + + + + + + + + - + @@ -77,7 +87,8 @@ diff --git a/pages/users/user_address_list/index.vue b/pages/users/user_address_list/index.vue index e7753d25..2b78887a 100644 --- a/pages/users/user_address_list/index.vue +++ b/pages/users/user_address_list/index.vue @@ -1,11 +1,11 @@ @@ -117,8 +117,7 @@ import { extractCash, extractBank, - getUserInfo, - brokerageCommission + extractUser } from '@/api/user.js'; import { toLogin @@ -169,8 +168,8 @@ isLogin:{ handler:function(newV,oldV){ if(newV){ - this.getUserInfo(); this.getUserExtractBank(); + this.getExtractUser(); } }, deep:true @@ -178,17 +177,10 @@ }, onLoad() { if (this.isLogin) { - this.getUserInfo(); this.getUserExtractBank(); - //this.getBrokerageCommission(); + this.getExtractUser(); } else { - // #ifdef H5 || APP-PLUS toLogin(); - // #endif - // #ifdef MP - this.isAuto = true; - this.$set(this, 'isShowAuth', true); - // #endif } }, methods: { @@ -218,13 +210,12 @@ this.qrcodeUrlZ = ""; }, onLoadFun: function() { - this.getUserInfo(); this.getUserExtractBank(); - // this.getBrokerageCommission(); }, - getBrokerageCommission: function(){ - brokerageCommission().then(res=>{ + getExtractUser(){ + extractUser().then(res=>{ this.commission = res.data; + this.minPrice = res.data.minPrice; }) }, // 授权关闭 @@ -234,20 +225,9 @@ getUserExtractBank: function() { let that = this; extractBank().then(res => { - let array = res.data.extractBank; + let array = res.data; array.unshift("请选择银行"); that.$set(that, 'array', array); - that.minPrice = res.data.minPrice; - that.commission = res.data; - }); - }, - /** - * 获取个人用户信息 - */ - getUserInfo: function() { - let that = this; - getUserInfo().then(res => { - that.userInfo = res.data; }); }, swichNav: function(current) { @@ -256,6 +236,15 @@ bindPickerChange: function(e) { this.index = e.detail.value; }, + moneyInput(e) { + //正则表达试 + e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null + //重新赋值给input + this.$nextTick(() => { + this.money= e.target.value + }) + + }, subCash: function(e) { let that = this, value = e.detail.value; @@ -289,13 +278,15 @@ if (value.money.length == 0) return this.$util.Tips({ title: '请填写提现金额' }); + if (!(/^(\d?)+(\.\d{0,2})?$/.test(value.money))) return this.$util.Tips({ + title: '提现金额保留2位小数' + }); if (value.money < that.minPrice) return this.$util.Tips({ title: '提现金额不能低于' + that.minPrice }); if(this.isCommitted==false){ this.isCommitted=true; extractCash(value).then(res => { - that.getUserInfo(); return this.$util.Tips({ title: "提现成功", icon: 'success' @@ -337,7 +328,7 @@ width: 40rpx; height: 40rpx; border-radius: 50%; - border: 2rpx solid #e93323; + border: 2rpx solid $theme-color; text-align: center; line-height: 37rpx; margin: 0 auto 6rpx auto; @@ -346,9 +337,9 @@ } .cash-withdrawal .nav .item .iconfont.on { - background-color: #e93323; + background-color: $theme-color; color: #fff; - border-color: #e93323; + border-color: $theme-color; } .cash-withdrawal .nav .item .line { diff --git a/pages/users/user_coupon/index.vue b/pages/users/user_coupon/index.vue index 776c8a4a..662e4368 100644 --- a/pages/users/user_coupon/index.vue +++ b/pages/users/user_coupon/index.vue @@ -1,5 +1,9 @@