Browse Source

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

- 在用户信息页面添加手机号绑定功能
- 修改提现页面,姓名改为选填并添加提现说明
- 优化流水记录页面显示提现金额和状态
- 新增提现成功接口调用
- 将环境配置从生产环境改为开发环境
- 更新API接口路径和配置获取逻辑
master
前端-胡立永 4 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
// },
getConfig : {url : '/api/getConfig', method : 'GET', limit : 500},
getConfig : {url : '/login/getConfigInfo', method : 'GET', limit : 500},
// 微信登录接口
@ -37,6 +37,13 @@ const config = {
auth: true,
limit : 500,
},
// 绑定手机号码
bindPhone: {
url: '/login/bindPhone',
method: 'GET',
auth: true,
limit : 500,
},
//隐私政策
getPrivacyPolicy: {
url: '/login/getPrivacyPolicy',
@ -363,6 +370,13 @@ const config = {
url: '/token/myShop',
method: 'GET',
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>
</view>
</uv-popup>
<tabber select="0" />
</view>
@ -331,8 +332,7 @@
// }else if(!this.userInfo.idCardOpen){
// this.$refs.certificationPopup.open()
// }else{
this.$refs.sharePopup.open();
this.$refs.sharePopup.open();
// }
},


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

@ -84,6 +84,29 @@
{{ form.address || '请选择居住地址'}}
</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
ref="datetimePicker"
v-model="form.yearDate"
@ -116,6 +139,7 @@
sex : '男',
yearDate : this.$dayjs().add(-18, 'y').valueOf(),//18
address : '',
phone : '',
},
maxDate : this.$dayjs().valueOf(),
minDate : this.$dayjs().add(-100, 'y').valueOf(),
@ -154,6 +178,23 @@
},
computed: {},
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) {
let self = this
self.$Oss.ossUpload(res.target.avatarUrl)
@ -187,6 +228,8 @@
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.$dayjs(res.result.yearDate + '-01-01').valueOf() || this.form.yearDate
@ -210,6 +253,7 @@
headImage: '请选择头像',
nickName: '请填写昵称',
address: '请选择居住地址',
phone: '请获取手机号',
})) {
return
}
@ -293,6 +337,34 @@
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{
background-color: #f7f7f7;
width: 600rpx;


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

@ -13,7 +13,7 @@
<input placeholder="请输入提现金额" v-model="form.price"/>
</view>
<view class="from-line">
<input placeholder="请输入姓名" v-model="form.name"/>
<input placeholder="请输入姓名(选填)" v-model="form.name"/>
</view>
<!-- <view class="from-line">
<input placeholder="请输入开户行" />
@ -26,8 +26,10 @@
style="line-height: 45rpx; font-size: 24rpx;color: #666666;"
v-html="notice">
</view> -->
<!-- <p>1本次提现必须通过银行卡提现暂不支持其他途径</p>
<p>2如若遇到24小时提现未到账请联系客服</p> -->
</view>
<view style="padding: 30rpx;">
<uv-parse :content="configList.withdraw_money"></uv-parse>
</view>
@ -36,14 +38,19 @@
@click="submit">提交</view>
</view>
<!-- 加入我们 -->
<certificationPopup ref="certificationPopup" />
</view>
</template>
<script>
import userShopCommission from '@/components/userShop/userShopCommission.vue'
import certificationPopup from '@/components/user/certificationPopup.vue'
export default {
components: {
userShopCommission,
certificationPopup,
},
data() {
return {
@ -56,9 +63,21 @@
},
methods: {
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, {
price: '请输入提现金额',
name: '请输入姓名',
// name: '',
})) {
return
}
@ -93,7 +112,7 @@
text-align: left;
color: #333333;
line-height: 40px;
padding-bottom: 160rpx;
padding-bottom: 60rpx;
.from-line {
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"
:label="item.createTime">
<!-- <text
style="font-size: 22rpx;"
v-if="item.getPrice">到账{{ item.getPrice }}</text> -->
<template #value>
<view class="info">
<view class="price">
{{ x[item.type] + item.price }}
{{ x[item.type] + (item.price || item.intger) }}
</view>
<view class="uni-color-btn"
@click="requestMerchantTransfer(item)"
v-if="item.type == 0 && item.state == 1"
>
领取
领取 <text v-if="item.getPrice">{{ item.getPrice }}</text>
</view>
<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>
</template>
@ -113,9 +117,13 @@
appId: wx.getAccountInfoSync().miniProgram.appId,
package: item.packageInfo,
success: (res) => {
// res.err_msgok
// res.err_msgok
console.log('success:', res);
this.getData()
this.$api('requestMerchantTransfer', {
id : item.id,
})
},
fail: (res) => {
console.log('fail:', res);
@ -133,11 +141,23 @@
background: #F5F5F5;
margin: 0 auto;
min-height: 100vh;
.info{
text-align: right;
.status{
font-size: 22rpx;
}
}
.tab-box{
margin: 20rpx;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
}
.uni-color-btn{
margin: 0;
border-radius: 10rpx;
padding: 6px;
font-size: 22rpx;
}
}
</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']
config.forEach(k => {
api(k, res => {
@ -73,7 +82,7 @@ const store = new Vuex.Store({
state.userInfo = res.result.userInfo
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({
url: '/pages_order/auth/wxUserInfo'
})
@ -89,7 +98,7 @@ const store = new Vuex.Store({
if(res.code == 200){
state.userInfo = res.result
if(!state.userInfo.nickName || !state.userInfo.headImage){
if(!state.userInfo.nickName || !state.userInfo.headImage || !state.userInfo.phone){
uni.navigateTo({
url: '/pages_order/auth/wxUserInfo'
})


Loading…
Cancel
Save