This commit is contained in:
weipengfei 2024-03-22 16:02:41 +08:00
parent 57b2bc9b59
commit dd2396275a
6 changed files with 256 additions and 115 deletions

View File

@ -206,6 +206,13 @@ export function modifyPhone(data) {
export function modifyPassword(data) { export function modifyPassword(data) {
return request.post('user/change/password', data); return request.post('user/change/password', data);
} }
/** 设置支付密码 */
export function setPayPwd(data) {
return request.post('User/set/withdrawal_pwd', data);
}
/** 退出登錄 */ /** 退出登錄 */
export function logout() { export function logout() {
return request.get('logout'); return request.get('logout');

View File

@ -5,7 +5,7 @@
选择付款方式<text class="iconfont icon-guanbi" @click='close'></text> 选择付款方式<text class="iconfont icon-guanbi" @click='close'></text>
</view> </view>
<view class="item acea-row row-between-wrapper" @click='goPay(item.number || 0 , item.value)' <view class="item acea-row row-between-wrapper" @click='goPay(item.number || 0 , item.value)'
v-for="(item,index) in payMode" :key="index" v-if="item.payStatus == 1"> v-for="(item,index) in payMode" v-if="item.payStatus==1" :key="index">
<view class="left acea-row row-between-wrapper"> <view class="left acea-row row-between-wrapper">
<view class="iconfont" :class="item.icon"></view> <view class="iconfont" :class="item.icon"></view>
<view class="text"> <view class="text">
@ -20,6 +20,12 @@
</view> </view>
</view> </view>
<view class="mask" ref="close" @click='close' v-if="pay_close"></view> <view class="mask" ref="close" @click='close' v-if="pay_close"></view>
<!-- 支付密码 键盘 -->
<popups ref="popups" :isPay="true" @confirm="handleConfirm" @clear="handleClear" @change="handleChange" />
<!-- 密码错误事件处理 -->
<payPwd ref="payPwd" @left="handleLeft" @right="handleRight"></payPwd>
</view> </view>
</template> </template>
@ -27,7 +33,7 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | CRMEB [ CRMEB ] // | CRMEB [ CRMEB ]
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB // | Licensed CRMEBCRMEB
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
@ -35,9 +41,17 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { import {
orderPay, orderPay,
presellOrderPay integralOrderPay,
presellOrderPay,
verifyPwd
} from '@/api/order.js'; } from '@/api/order.js';
import payPwd from "@/components/payPwd/index.vue";
import popups from "@/components/popups/index.vue";
export default { export default {
components: {
payPwd,
popups
},
props: { props: {
payMode: { payMode: {
type: Array, type: Array,
@ -64,13 +78,18 @@
isCall: { isCall: {
type: Boolean, type: Boolean,
default: false default: false
},
returnUrl: {
type: String,
default: ''
} }
}, },
data() { data() {
return { return {
type: ''
}; };
}, },
methods: { methods: {
close: function() { close: function() {
this.$emit('onChangeFun', { this.$emit('onChangeFun', {
@ -78,7 +97,6 @@
}); });
}, },
goPay: function(number, paytype) { goPay: function(number, paytype) {
if (this.isCall) { if (this.isCall) {
return this.$emit('onChangeFun', { return this.$emit('onChangeFun', {
action: 'payCheck', action: 'payCheck',
@ -99,7 +117,6 @@
// #endif // #endif
} else if (paytype == 'balance') { } else if (paytype == 'balance') {
type = 'balance'; type = 'balance';
console.log('123');
} else if (paytype == 'alipay') { } else if (paytype == 'alipay') {
// #ifndef MP // #ifndef MP
type = 'alipay'; type = 'alipay';
@ -107,9 +124,8 @@
// #ifdef MP // #ifdef MP
type = 'alipayQr'; type = 'alipayQr';
// #endif // #endif
} else if (paytype == 'creditBuy') { } else if (paytype == 'public') {
console.log('123123'); type = 'public';
type = 'creditBuy'
} }
if (!that.order_id) return that.$util.Tips({ if (!that.order_id) return that.$util.Tips({
title: '请选择要支付的订单' title: '请选择要支付的订单'
@ -117,29 +133,79 @@
if (paytype == 'balance' && parseFloat(number) < parseFloat(that.totalPrice)) return that.$util.Tips({ if (paytype == 'balance' && parseFloat(number) < parseFloat(that.totalPrice)) return that.$util.Tips({
title: '余额不足!' title: '余额不足!'
}); });
uni.showLoading({
title: '支付中' this.type = type;
if (paytype == 'balance' || paytype == 'merBalance') {
this.$refs.popups.handleOpen();
} else {
uni.showLoading({
title: '订单支付中'
});
this.trueOrderPay();
}
},
//
handleConfirm(e) {
//
verifyPwd({
withdrawal_pwd: e
}).then(res => {
//
const code = res.data.code;
if (code == 100) { //
uni.showLoading({
title: '订单支付中',
mask: true
});
this.trueOrderPay();
} else {
this.$refs.payPwd.handleOpen(code);
}
}).catch(err => {
console.log(err)
})
},
handleClear() {},
handleChange() {},
// 101 102
handleLeft(code) {
uni.navigateTo({
url: "/pages/users/user_modify_pwd/index?type=payPwd"
}); });
let orderApi = that.order_type === 1 ? presellOrderPay : orderPay this.$refs.payPwd.handleClose();
},
//
handleRight(code) {
if (code == 101) { //
this.$refs.payPwd.handleClose(code);
} else {
this.$refs.payPwd.handleClose();
this.$refs.popups.handleOpen();
}
},
trueOrderPay() {
let that = this;
let orderApi = that.order_type === 1 ? presellOrderPay : that.order_type === 2 ? integralOrderPay :
orderPay
orderApi(that.order_id, { orderApi(that.order_id, {
type: type, type: that.type,
// #ifdef H5 // #ifdef H5
return_url: that.returnUrl !== '' ? 'http://' + window.location.host + that.returnUrl :
return_url: this.order_type == 98 ? 'http://' + window.location.host + 'http://' + window.location.host + '/pages/users/order_list/index',
'/pages/users/order_list/indexCopy' : 'http://' + window.location.host +
'/pages/users/order_list/index',
// #endif // #endif
}).then(res => { }).then(res => {
let status = res.data.status, let status = res.data.status,
orderId = res.data.result.order_id, orderId = res.data.result.order_id,
jsConfig = res.data.result.config, jsConfig = res.data.result.config,
callback_key = res.data.result.pay_key, callback_key = res.data.result.pay_key,
goPages = that.returnUrl ? that.returnUrl : '/pages/users/order_list/index';
goPages = this.order_type == 98 ? '/pages/users/order_list/indexCopy' :
'/pages/users/order_list/index'
switch (status) { switch (status) {
case 'ORDER_EXIST': case 'ORDER_EXIST':
case 'EXTEND_ORDER': case 'EXTEND_ORDER':
@ -163,7 +229,7 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + '?status=2' url: goPages + '?status=1'
}); });
break; break;
case 'alipay': case 'alipay':
@ -185,7 +251,7 @@
jsConfig.timeStamp = jsConfig.timestamp; jsConfig.timeStamp = jsConfig.timestamp;
// #ifndef APP-PLUS // #ifndef APP-PLUS
that.$wechat.pay(jsConfig).then(res => { that.$wechat.pay(jsConfig).then(res => {
// console.log('success'+res.data) console.log('测试支付数据无效的success' + res.data)
this.$emit('onChangeFun', { this.$emit('onChangeFun', {
action: 'payClose' action: 'payClose'
}); });
@ -195,10 +261,10 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + 'status=2' url: goPages + 'status=1'
}); });
}).catch(res => { }).catch(res => {
// console.log('catch'+res.data) console.log('测试支付数据无效的catch' + res.data)
if (res.errMsg == 'chooseWXPay:cancel') { if (res.errMsg == 'chooseWXPay:cancel') {
if (that.isCall) { if (that.isCall) {
return that.$util.Tips({ return that.$util.Tips({
@ -209,7 +275,7 @@
title: '取消支付' title: '取消支付'
}, { }, {
tab: 5, tab: 5,
url: goPages + '?status=1' url: goPages + '?status=0'
}); });
} }
} }
@ -222,7 +288,6 @@
} else { } else {
mp_pay_name = 'requestPayment' mp_pay_name = 'requestPayment'
} }
console.log(mp_pay_name, jsConfig)
uni[mp_pay_name]({ uni[mp_pay_name]({
provider: 'wxpay', provider: 'wxpay',
orderInfo: jsConfig, orderInfo: jsConfig,
@ -235,11 +300,10 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + 'status=2' url: goPages + 'status=1'
}); });
}, },
fail: (e) => { fail: (e) => {
console.log(e)
if (that.isCall) { if (that.isCall) {
return that.$util.Tips({ return that.$util.Tips({
title: '取消支付' title: '取消支付'
@ -249,7 +313,7 @@
title: '取消支付' title: '取消支付'
}, { }, {
tab: 5, tab: 5,
url: goPages + '?status=1' url: goPages + '?status=0'
}); });
} }
}, },
@ -284,7 +348,7 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + '?status=2' url: goPages + '?status=1'
}); });
return that.$util.Tips({ return that.$util.Tips({
@ -292,7 +356,7 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + '?status=2' url: goPages + '?status=1'
}); });
}, },
fail: function(e) { fail: function(e) {
@ -307,10 +371,9 @@
complete: function(e) { complete: function(e) {
uni.hideLoading(); uni.hideLoading();
// //
if (res.errMsg == 'requestPayment:cancel') return that.$util if (res.errMsg == 'requestPayment:cancel') return that.$util.Tips({
.Tips({ title: '取消支付'
title: '取消支付' });
});
that.$emit('onChangeFun', { that.$emit('onChangeFun', {
action: 'payClose' action: 'payClose'
}); });
@ -329,6 +392,16 @@
}); });
break; break;
// #ifdef H5 // #ifdef H5
case "public":
uni.hideLoading();
that.$emit('onChangeFun', {
action: 'payClose'
});
//
return that.$util.Tips({
title: "下单成功,请上传付款凭证!"
});
break;
case 'h5': case 'h5':
let host = window.location.protocol + "//" + window.location.host; let host = window.location.protocol + "//" + window.location.host;
let url = `${host}/pages/order_pay_status/index?order_id=${orderId}` let url = `${host}/pages/order_pay_status/index?order_id=${orderId}`
@ -355,7 +428,7 @@
icon: 'success' icon: 'success'
}, { }, {
tab: 5, tab: 5,
url: goPages + 'status=2' url: goPages + 'status=1'
}); });
}, },
@ -392,7 +465,7 @@
border-radius: 16rpx 16rpx 0 0; border-radius: 16rpx 16rpx 0 0;
background-color: #fff; background-color: #fff;
padding-bottom: 60rpx; padding-bottom: 60rpx;
z-index: 99999; z-index: 99;
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9); transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0);
} }

View File

@ -6,7 +6,7 @@
<view class="paybox" v-if="isPay"> <view class="paybox" v-if="isPay">
<view class="paybox-title"> <view class="paybox-title">
<view class="paybox-title-left"></view> <view class="paybox-title-left"></view>
<view class="paybox-title-middle">请输入支付密码</view> <view class="paybox-title-middle">{{title}}</view>
<view class="paybox-titler-right" @click="handleClose"> <view class="paybox-titler-right" @click="handleClose">
<u-icon name="close" size="18" color="#666" /> <u-icon name="close" size="18" color="#666" />
</view> </view>
@ -56,7 +56,11 @@
isPay: { // isPay: { //
type: Boolean, type: Boolean,
default: false default: false
} },
title: {
type: String,
default: '请输入支付密码'
}
}, },
data() { data() {
return { return {

View File

@ -620,7 +620,7 @@
}, { }, {
name: '商户类型', name: '商户类型',
type: 23, type: 23,
image: require('@/static/images/index14.png') image: require('@/static/images/index26.png')
}, },
@ -702,7 +702,7 @@
}, { }, {
name: '商户类型', name: '商户类型',
type: 23, type: 23,
image: require('@/static/images/index14.png') image: require('@/static/images/index26.png')
}, },
// { // {
// name: '', // name: '',
@ -752,7 +752,7 @@
}, { }, {
name: '商户类型', name: '商户类型',
type: 23, type: 23,
image: require('@/static/images/index14.png') image: require('@/static/images/index26.png')
}, },
{ {
name: '扫码付款', name: '扫码付款',

View File

@ -7,29 +7,43 @@
<view class="item"> <view class="item">
<text class="phone">{{userInfo.phone}}</text> <text class="phone">{{userInfo.phone}}</text>
</view> </view>
<view class="item acea-row row-between-wrapper codeVal"> <view class="item acea-row row-between-wrapper codeVal">
<input type='number' placeholder='验证码' placeholder-class='placeholder' class="codeIput" v-model="captcha"></input> <input type='number' maxlength="4" placeholder='验证码' placeholder-class='placeholder' class="codeIput"
<button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="handleVerify"> v-model="captcha"></input>
<button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled'
@click="handleVerify">
{{ text }} {{ text }}
</button> </button>
</view> </view>
<view class="border"></view> <view class="border"></view>
<block v-if="type == 'payPwd'">
<view class="item"> <view class="item" @click="showPopup(1)">
<input type='password' placeholder='新密码' placeholder-class='placeholder' v-model="password" autocomplete="off"></input> <input style="pointer-events: none;" type='password' placeholder="请设置支付密码"
</view> placeholder-class='placeholder' v-model="password" autocomplete="off"></input>
<view class="item"> </view>
<input type='password' placeholder='确认新密码' placeholder-class='placeholder' v-model="repassword" autocomplete="off"></input> <view class="item" @click="showPopup(2)">
</view> <input style="pointer-events: none;" type='password' placeholder="请再次设置支付密码"
placeholder-class='placeholder' v-model="repassword" autocomplete="off"></input>
</view>
</block>
<block v-else>
<view class="item">
<input type='password' placeholder="请设置密码"
placeholder-class='placeholder' v-model="password" autocomplete="off"></input>
</view>
<view class="item">
<input type='password' placeholder="请再次设置密码"
placeholder-class='placeholder' v-model="repassword" autocomplete="off"></input>
</view>
</block>
</view> </view>
</view> </view>
<button form-type="submit" @click="confirmSubmit" class="confirmBnt">确认</button> <button form-type="submit" @click="confirmSubmit" class="confirmBnt">确认</button>
</view> </view>
</form> </form>
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> <Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify> ref="verify"></Verify>
<popups ref="popups" isPay title="请设置支付密码" @confirm="handleConfirm" @clear="handleClear" @change="handleChange"></popups>
</view> </view>
</template> </template>
@ -37,70 +51,75 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | CRMEB [ CRMEB ] // | CRMEB [ CRMEB ]
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB // | Licensed CRMEBCRMEB
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import sendVerifyCode from "@/mixins/SendVerifyCode"; import sendVerifyCode from "@/mixins/SendVerifyCode";
import { modifyPassword, verifyCode, appletsDecrypt } from '@/api/api.js'; import {
import { getUserInfo } from '@/api/user.js'; modifyPassword,
import { registerVerify } from '@/api/user.js' verifyCode,
appletsDecrypt,
setPayPwd
} from '@/api/api.js';
import {
getUserInfo
} from '@/api/user.js';
import {
registerVerify
} from '@/api/user.js'
import { import {
mapGetters mapGetters
} from "vuex"; } from "vuex";
import authorize from '@/components/Authorize'; import {
import Verify from '@/components/verify/verify.vue'; toLogin
} from '@/libs/login.js';
import Verify from '@/components/verify/verify.vue';
import popups from "@/components/popups/index.vue";
export default { export default {
mixins: [sendVerifyCode], mixins: [sendVerifyCode],
components: { components: {
authorize, Verify,
Verify popups
}, },
data() { data() {
return { return {
userInfo: {}, userInfo: {},
phone:'', phone: '',
repassword: '', repassword: '',
password: '', password: '',
captcha:'', captcha: '',
isAuto: false, //
isShowAuth: false, //
key: '', key: '',
codeVal: '', codeVal: '',
disabled: false, disabled: false,
type: '',
set_type: '',
}; };
}, },
computed: mapGetters(['isLogin', 'viewColor']), computed: mapGetters(['isLogin', 'viewColor']),
onLoad() { onLoad(opt) {
let that = this let that = this
this.type = opt.type;
if (this.isLogin) { if (this.isLogin) {
this.getUserInfo() this.getUserInfo()
} else { } else {
this.isAuto = true; toLogin()
this.isShowAuth = true
} }
// #ifdef MP // #ifdef MP
wx.login({ wx.login({
success (res) { success(res) {
if (res.code) { if (res.code) {
that.codeVal = res.code that.codeVal = res.code
} else { } else {
// console.log('' + res.errMsg) console.log('登录失败!' + res.errMsg)
} }
} }
}) })
// #endif // #endif
}, },
methods: { methods: {
onLoadFun:function(){
this.isShowAuth = false;
},
//
authColse: function(e) {
this.isShowAuth = e
},
/** /**
* 获取个人用户信息 * 获取个人用户信息
*/ */
@ -110,6 +129,19 @@
that.userInfo = res.data that.userInfo = res.data
}); });
}, },
showPopup(type){
this.set_type = type;
this.$refs.popups.handleOpen();
},
//
handleConfirm(e) {
if(this.set_type==1)this.password = e;
else this.repassword = e;
},
handleClear() {},
handleChange() {},
confirmSubmit: function() { confirmSubmit: function() {
let that = this; let that = this;
if (!that.password) return that.$util.Tips({ if (!that.password) return that.$util.Tips({
@ -124,23 +156,40 @@
if (!that.captcha) return that.$util.Tips({ if (!that.captcha) return that.$util.Tips({
title: '请填写验证码' title: '请填写验证码'
}); });
modifyPassword({
password: that.password, if (this.type == 'payPwd') { //
repassword: that.repassword, setPayPwd({
sms_code: that.captcha password: that.password,
}).then(res => { repassword: that.repassword,
return that.$util.Tips({ sms_code: that.captcha
title: '修改成功!', }).then(res => {
icon: 'success' that.$util.Tips({
}, { title: '修改成功!',
tab: 5, icon: 'success'
url: '/pages/users/user_info/index' })
}); this.$nextTick((res=>{
}).catch(err => { uni.navigateBack();
return that.$util.Tips({ }))
title: err })
}); } else { //
}) modifyPassword({
password: that.password,
repassword: that.repassword,
sms_code: that.captcha
}).then(res => {
return that.$util.Tips({
title: '修改成功!',
icon: 'success'
}, {
tab: 5,
url: '/pages/users/user_info/index'
});
}).catch(err => {
return that.$util.Tips({
title: err
});
})
}
}, },
/** /**
* 发送验证码 * 发送验证码
@ -153,10 +202,10 @@
// }); // });
this.disabled = true this.disabled = true
await registerVerify({ await registerVerify({
phone:that.userInfo.phone, phone: that.userInfo.phone,
code:that.captcha, code: that.captcha,
type: 'change_pwd', type: 'change_pwd',
captchaType: 'blockPuzzle', captchaType: 'blockPuzzle',
captchaVerification: data.captchaVerification captchaVerification: data.captchaVerification
}).then(res => { }).then(res => {
this.disabled = false this.disabled = false
@ -171,7 +220,7 @@
}); });
}); });
}, },
success(data) { success(data) {
this.$refs.verify.hide(); this.$refs.verify.hide();
this.code(data); this.code(data);
}, },
@ -183,10 +232,11 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.ChangePassword{ .ChangePassword {
background: #fff; background: #fff;
padding-top: 53rpx; padding-top: 53rpx;
} }
.ChangePassword .phone { .ChangePassword .phone {
font-size: 32rpx; font-size: 32rpx;
} }
@ -205,7 +255,8 @@
font-size: 32rpx; font-size: 32rpx;
} }
/deep/.uni-input-input{
/deep/.uni-input-input {
// box-shadow: inset 0 0 0 0 #fff; // box-shadow: inset 0 0 0 0 #fff;
} }
@ -222,7 +273,8 @@
position: relative; position: relative;
padding-left: 26rpx; padding-left: 26rpx;
color: var(--view-theme); color: var(--view-theme);
&::before{
&::before {
content: ""; content: "";
width: 1rpx; width: 1rpx;
height: 30rpx; height: 30rpx;
@ -233,14 +285,17 @@
display: inline-block; display: inline-block;
} }
} }
.ChangePassword .list .item .code.on { .ChangePassword .list .item .code.on {
color: #b9b9bc !important; color: #b9b9bc !important;
} }
.ChangePassword .list .border{
.ChangePassword .list .border {
width: 100%; width: 100%;
height: 21rpx; height: 21rpx;
background: #F5F5F5; background: #F5F5F5;
} }
.confirmBnt { .confirmBnt {
font-size: 32rpx; font-size: 32rpx;
width: 580rpx; width: 580rpx;
@ -252,7 +307,8 @@
line-height: 90rpx; line-height: 90rpx;
background-color: var(--view-theme); background-color: var(--view-theme);
} }
.getPhoneBtn{
.getPhoneBtn {
font-size: 32rpx; font-size: 32rpx;
width: 580rpx; width: 580rpx;
height: 90rpx; height: 90rpx;
@ -262,7 +318,8 @@
margin: 40rpx auto 0 auto; margin: 40rpx auto 0 auto;
text-align: center; text-align: center;
line-height: 90rpx; line-height: 90rpx;
.iconfont{
.iconfont {
font-size: 32rpx; font-size: 32rpx;
margin-right: 12rpx; margin-right: 12rpx;
} }

BIN
static/images/index26.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB