Browse Source

feat: 添加手机号绑定功能并优化提现流程

- 在用户信息页面添加手机号绑定功能
- 修改提现页面,姓名改为选填并添加提现说明
- 优化流水记录页面显示提现金额和状态
- 新增提现成功接口调用
- 将环境配置从生产环境改为开发环境
- 更新API接口路径和配置获取逻辑
master
前端-胡立永 6 days ago
parent
commit
e3c6f4052a
6 changed files with 149 additions and 15 deletions
  1. +15
    -1
      api/api.js
  2. +2
    -2
      pages/index/index.vue
  3. +72
    -0
      pages_order/auth/wxUserInfo.vue
  4. +24
    -5
      pages_order/mine/purse.vue
  5. +25
    -5
      pages_order/mine/runningWater.vue
  6. +11
    -2
      store/store.js

+ 15
- 1
api/api.js View File

@ -12,7 +12,7 @@ const config = {
// limit : 1000 // limit : 1000
// }, // },
getConfig : {url : '/api/getConfig', method : 'GET', limit : 500},
getConfig : {url : '/login/getConfigInfo', method : 'GET', limit : 500},
// 微信登录接口 // 微信登录接口
@ -37,6 +37,13 @@ const config = {
auth: true, auth: true,
limit : 500, limit : 500,
}, },
// 绑定手机号码
bindPhone: {
url: '/login/bindPhone',
method: 'GET',
auth: true,
limit : 500,
},
//隐私政策 //隐私政策
getPrivacyPolicy: { getPrivacyPolicy: {
url: '/login/getPrivacyPolicy', url: '/login/getPrivacyPolicy',
@ -363,6 +370,13 @@ const config = {
url: '/token/myShop', url: '/token/myShop',
method: 'GET', method: 'GET',
auth : true, auth : true,
},
// 领取提现成功
requestMerchantTransfer : {
url: '/cashout/getMoney',
method: 'GET',
auth : true,
} }
} }


+ 2
- 2
pages/index/index.vue View File

@ -146,6 +146,7 @@
<uv-parse :content="headInfo.integralDetails"></uv-parse> <uv-parse :content="headInfo.integralDetails"></uv-parse>
</view> </view>
</uv-popup> </uv-popup>
<tabber select="0" /> <tabber select="0" />
</view> </view>
@ -331,8 +332,7 @@
// }else if(!this.userInfo.idCardOpen){ // }else if(!this.userInfo.idCardOpen){
// this.$refs.certificationPopup.open() // this.$refs.certificationPopup.open()
// }else{ // }else{
this.$refs.sharePopup.open();
this.$refs.sharePopup.open();
// } // }
}, },


+ 72
- 0
pages_order/auth/wxUserInfo.vue View File

@ -84,6 +84,29 @@
{{ form.address || '请选择居住地址'}} {{ form.address || '请选择居住地址'}}
</view> </view>
<view class="line">
<view class="">
手机号
</view>
<view class=""
v-if="form.phone">
<input placeholder="请输入手机号" style="text-align: right;"
disabled
v-model="form.phone" />
</view>
<view class=""
v-else>
<button
class="getPhoneNumber"
open-type="getPhoneNumber"
@getphonenumber="getPhone">
获取电话号码
</button>
</view>
</view>
<uv-datetime-picker <uv-datetime-picker
ref="datetimePicker" ref="datetimePicker"
v-model="form.yearDate" v-model="form.yearDate"
@ -116,6 +139,7 @@
sex : '男', sex : '男',
yearDate : this.$dayjs().add(-18, 'y').valueOf(),//18 yearDate : this.$dayjs().add(-18, 'y').valueOf(),//18
address : '', address : '',
phone : '',
}, },
maxDate : this.$dayjs().valueOf(), maxDate : this.$dayjs().valueOf(),
minDate : this.$dayjs().add(-100, 'y').valueOf(), minDate : this.$dayjs().add(-100, 'y').valueOf(),
@ -154,6 +178,23 @@
}, },
computed: {}, computed: {},
methods: { methods: {
getPhone(e){
this.$api('bindPhone', {
phoneCode : e.detail.code
}, res => {
if(res.code == 200){
let phoneObj = JSON.parse(res.result)
if(phoneObj.errmsg == 'ok'){
this.form.phone = phoneObj.phone_info.phoneNumber
}else{
uni.showModal({
title: phoneObj.errmsg
})
}
console.log(phoneObj);
}
})
},
onChooseAvatar(res) { onChooseAvatar(res) {
let self = this let self = this
self.$Oss.ossUpload(res.target.avatarUrl) self.$Oss.ossUpload(res.target.avatarUrl)
@ -187,6 +228,8 @@
this.form.sex = res.result.sex || this.form.sex this.form.sex = res.result.sex || this.form.sex
this.form.phone = res.result.phone || this.form.phone
this.form.yearDate = res.result.yearDate && this.form.yearDate = res.result.yearDate &&
this.$dayjs(res.result.yearDate + '-01-01').valueOf() || this.form.yearDate this.$dayjs(res.result.yearDate + '-01-01').valueOf() || this.form.yearDate
@ -210,6 +253,7 @@
headImage: '请选择头像', headImage: '请选择头像',
nickName: '请填写昵称', nickName: '请填写昵称',
address: '请选择居住地址', address: '请选择居住地址',
phone: '请获取手机号',
})) { })) {
return return
} }
@ -293,6 +337,34 @@
margin-top: 30rpx; margin-top: 30rpx;
} }
.line {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #f7f7f7;
width: 600rpx;
height: 80rpx;
padding: 0 30rpx;
margin: 0 auto;
border-radius: 40rpx;
margin-top: 30rpx;
box-sizing: border-box;
.getPhoneNumber{
// all: unset;
display: flex;
justify-content: center;
align-items: center;
// background: $uni-linear-gradient-btn-color;
background: $uni-color;
color: #fff;
width: 200rpx;
height: 60rpx;
border-radius: 30rpx;
font-size: 24rpx;
}
}
.sexSelect{ .sexSelect{
background-color: #f7f7f7; background-color: #f7f7f7;
width: 600rpx; width: 600rpx;


+ 24
- 5
pages_order/mine/purse.vue View File

@ -13,7 +13,7 @@
<input placeholder="请输入提现金额" v-model="form.price"/> <input placeholder="请输入提现金额" v-model="form.price"/>
</view> </view>
<view class="from-line"> <view class="from-line">
<input placeholder="请输入姓名" v-model="form.name"/>
<input placeholder="请输入姓名(选填)" v-model="form.name"/>
</view> </view>
<!-- <view class="from-line"> <!-- <view class="from-line">
<input placeholder="请输入开户行" /> <input placeholder="请输入开户行" />
@ -26,8 +26,10 @@
style="line-height: 45rpx; font-size: 24rpx;color: #666666;" style="line-height: 45rpx; font-size: 24rpx;color: #666666;"
v-html="notice"> v-html="notice">
</view> --> </view> -->
<!-- <p>1本次提现必须通过银行卡提现暂不支持其他途径</p>
<p>2如若遇到24小时提现未到账请联系客服</p> -->
</view>
<view style="padding: 30rpx;">
<uv-parse :content="configList.withdraw_money"></uv-parse>
</view> </view>
@ -36,14 +38,19 @@
@click="submit">提交</view> @click="submit">提交</view>
</view> </view>
<!-- 加入我们 -->
<certificationPopup ref="certificationPopup" />
</view> </view>
</template> </template>
<script> <script>
import userShopCommission from '@/components/userShop/userShopCommission.vue' import userShopCommission from '@/components/userShop/userShopCommission.vue'
import certificationPopup from '@/components/user/certificationPopup.vue'
export default { export default {
components: { components: {
userShopCommission, userShopCommission,
certificationPopup,
}, },
data() { data() {
return { return {
@ -56,9 +63,21 @@
}, },
methods: { methods: {
submit() { submit() {
if(this.userInfo.idCardOpen == 0){
uni.showToast({
title: '认证审核中...',
icon:'none'
})
return
}else if(!this.userInfo.idCardOpen){
this.$refs.certificationPopup.open()
return
}
if (this.$utils.verificationAll(this.form, { if (this.$utils.verificationAll(this.form, {
price: '请输入提现金额', price: '请输入提现金额',
name: '请输入姓名',
// name: '',
})) { })) {
return return
} }
@ -93,7 +112,7 @@
text-align: left; text-align: left;
color: #333333; color: #333333;
line-height: 40px; line-height: 40px;
padding-bottom: 160rpx;
padding-bottom: 60rpx;
.from-line { .from-line {
margin-top: 40rpx; margin-top: 40rpx;


+ 25
- 5
pages_order/mine/runningWater.vue View File

@ -19,20 +19,24 @@
:title="item.title" v-for="(item, index) in list" :title="item.title" v-for="(item, index) in list"
:label="item.createTime"> :label="item.createTime">
<!-- <text
style="font-size: 22rpx;"
v-if="item.getPrice">到账{{ item.getPrice }}</text> -->
<template #value> <template #value>
<view class="info"> <view class="info">
<view class="price"> <view class="price">
{{ x[item.type] + item.price }}
{{ x[item.type] + (item.price || item.intger) }}
</view> </view>
<view class="uni-color-btn" <view class="uni-color-btn"
@click="requestMerchantTransfer(item)" @click="requestMerchantTransfer(item)"
v-if="item.type == 0 && item.state == 1" v-if="item.type == 0 && item.state == 1"
> >
领取
领取 <text v-if="item.getPrice">{{ item.getPrice }}</text>
</view> </view>
<view class="status" <view class="status"
v-else>
{{ item.state_dictText }}
v-else-if="item.state_dictText">
{{ item.state_dictText }}<text v-if="item.getPrice">到账 {{ item.getPrice }}</text>
</view> </view>
</view> </view>
</template> </template>
@ -113,9 +117,13 @@
appId: wx.getAccountInfoSync().miniProgram.appId, appId: wx.getAccountInfoSync().miniProgram.appId,
package: item.packageInfo, package: item.packageInfo,
success: (res) => { success: (res) => {
// res.err_msgok
// res.err_msgok
console.log('success:', res); console.log('success:', res);
this.getData() this.getData()
this.$api('requestMerchantTransfer', {
id : item.id,
})
}, },
fail: (res) => { fail: (res) => {
console.log('fail:', res); console.log('fail:', res);
@ -133,11 +141,23 @@
background: #F5F5F5; background: #F5F5F5;
margin: 0 auto; margin: 0 auto;
min-height: 100vh; min-height: 100vh;
.info{
text-align: right;
.status{
font-size: 22rpx;
}
}
.tab-box{ .tab-box{
margin: 20rpx; margin: 20rpx;
background-color: #fff; background-color: #fff;
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
} }
.uni-color-btn{
margin: 0;
border-radius: 10rpx;
padding: 6px;
font-size: 22rpx;
}
} }
</style> </style>

+ 11
- 2
store/store.js View File

@ -35,6 +35,15 @@ const store = new Vuex.Store({
} }
}) })
api('getConfig', res => {
if(res.code == 200){
res.result.forEach(n => {
state.configList[n.keyIcon] = n.keyContent || n.keyName || n.keyDetails || n.keyImage;
state.configList[n.keyIcon + '_keyValue'] = n.keyValue;
});
}
})
let config = ['getPrivacyPolicy', 'getUserAgreement'] let config = ['getPrivacyPolicy', 'getUserAgreement']
config.forEach(k => { config.forEach(k => {
api(k, res => { api(k, res => {
@ -73,7 +82,7 @@ const store = new Vuex.Store({
state.userInfo = res.result.userInfo state.userInfo = res.result.userInfo
uni.setStorageSync('token', res.result.token) uni.setStorageSync('token', res.result.token)
if(!state.userInfo.nickName || !state.userInfo.headImage){
if(!state.userInfo.nickName || !state.userInfo.headImage || !state.userInfo.phone){
uni.navigateTo({ uni.navigateTo({
url: '/pages_order/auth/wxUserInfo' url: '/pages_order/auth/wxUserInfo'
}) })
@ -89,7 +98,7 @@ const store = new Vuex.Store({
if(res.code == 200){ if(res.code == 200){
state.userInfo = res.result state.userInfo = res.result
if(!state.userInfo.nickName || !state.userInfo.headImage){
if(!state.userInfo.nickName || !state.userInfo.headImage || !state.userInfo.phone){
uni.navigateTo({ uni.navigateTo({
url: '/pages_order/auth/wxUserInfo' url: '/pages_order/auth/wxUserInfo'
}) })


Loading…
Cancel
Save