This commit is contained in:
yangtao 2024-04-07 19:27:07 +08:00
parent aede8f9644
commit 24c3023046
14 changed files with 654 additions and 16 deletions

View File

@ -160,6 +160,10 @@ export function modifyPhone(data){
export function modifyPassword(data){
return request.post('user/change/password',data);
}
/** 修改支付密码 */
export function modifyPayPassword(data){
return request.post('user/change/pay_password',data);
}
/** 退出登錄 */
export function logout(){
return request.get('logout');

308
components/pay/index.vue Normal file
View File

@ -0,0 +1,308 @@
<template>
<view class="mark" :class="[show_key ? '' : 'hidden']">
<view class="kong"></view>
<!-- 信息框 -->
<view class="msg">
<!-- 关闭按钮 -->
<view class="img iconfont icon-guanbi" @tap="closeFuc">
</view>
<view class="title">
请输入支付密码
</view>
<view class="subTitle" v-show="show_subTitle">
付款{{price}}
</view>
<view class="pswBox">
<view v-for="(item,index) in 6" :key="index" class="content_item">{{password[index] ? '' : ''}}</view>
</view>
<view class="forget" @tap="forgetFuc">找回密码</view>
</view>
<!-- 数字键盘 -->
<view class="numeric">
<!-- 正常模式 -->
<view class="num" v-if="mix" v-for="(item,index) in num1" :key="index" :class="item == 10 ? 'amend1' : item == 12 ? 'amend3 haiyuefont haiyue-guanbi2' : ''" @tap="press({num:item})">
{{item == 10 ? '' : item == 11 ? '0' : item == 12 ? '': item}}
</view>
<!-- 混淆模式 -->
<view class="num" v-else v-for="(item,index) in num" :key="index" :class="item == 10 ? 'amend1' : item == 12 ? 'amend3 haiyuefont haiyue-guanbi2' : ''" @tap="press({num:item})">
{{item == 10 ? '' : item == 11 ? '0' : item == 12 ? '': item}}
</view>
</view>
</view>
</template>
<script>
export default {
props:{
show_key:Boolean,
price:String,
show_subTitle:{
default:true
},
mix:{
type: Boolean,
default: false
}
},
data () {
return {
num:[], //
num1:[1,2,3,4,5,6,7,8,9,10,11,12],//
password:"",
}
},
created() {
//
this.num = this.randomArray([1,2,3,4,5,6,7,8,9,11]);
this.num.splice(9, 0, 10);
this.num.splice(11, 0, 12);
console.log(this.num);
console.log(this.key_words);
},
methods:{
//
randomArray(arr){
return arr.sort(() => Math.random() -0.5);
},
press (obj) {
console.log(obj);
let num = obj.num
if (obj.num == 10) {
console.log('我是10我什么都不干')
} else if (obj.num == 12) {
this.password = this.password.slice(0,this.password.length-1);
} else if (obj.num == 11) {
num = '0'
this.password += num;
} else {
this.password += num;
}
if (this.password.length == 6) {
this.$emit('pay',{password:this.password})
this.password = "";
// uni.showModal({
// title:'',
// content:this.password,
// success: () => {
// this.password = "";
// }
// })
}
},
//
closeFuc () {
this.show_key=false;
console.log('关闭支付页面');
this.$emit("closeFuc",false)
},
//
forgetFuc () {
console.log('找回密码');
// uni.navigateTo({
// url:'/pages/mine/myWallet/changezfPwd/changezfPwd'
// })
}
}
}
</script>
<style lang="less" scoped>
.mark{
width: 750rpx;
background: rgba(0,0,0,0.7);
padding: 0 0 700rpx 0;
position: fixed;
top: 0rpx;
left: 0rpx;
z-index: 99;
}
.hidden{
display: none;
}
.kong{
width: 750rpx;
height: 250rpx;
}
.msg{
width: 550rpx;
height: 450rpx;
background: rgba(255,255,255,1);
border-radius: 20rpx;
margin: 0 auto;
animation: msgBox .2s linear;
}
@keyframes msgBox{
0%{
transform:translateY(50%);
opacity: 0;
}
50%{
transform:translateY(25%);
opacity: 0.5;
}
100%{
transform:translateY(0%);
opacity: 1;
}
}
@keyframes numBox{
0%{
transform:translateY(50%);
opacity: 0;
}
50%{
transform:translateY(25%);
opacity: 0.5;
}
100%{
transform:translateY(0%);
opacity: 1;
}
}
.msg>.img{
padding: 20rpx 0 0 20rpx;
font-size: 40rpx;
}
.msg>.title{
width: 100%;
height: 100rpx;
line-height: 100rpx;
font-weight: 500;
font-size: 36rpx;
text-align: center;
}
.msg>.subTitle{
width: 100%;
height: 50rpx;
line-height: 50rpx;
font-weight: 400;
font-size: 32rpx;
text-align: center;
}
.pswBox{
width: 80%;
height: 80rpx;
margin: 50rpx auto 0;
display: flex;
}
.content_item{
flex: 2;
text-align: center;
line-height: 80rpx;
border: 1rpx solid #D6D6D6;
border-right: 0rpx solid;
}
.content_item:nth-child(1){
border-radius: 10rpx 0 0 10rpx;
}
.content_item:nth-child(6){
border-right: 1rpx solid #D6D6D6;
border-radius: 0 10rpx 10rpx 0;
}
/* .numeric{
width: 750rpx;
height: 470rpx;
border: 1rpx solid;
display: flex;
position: fixed;
z-index: 98;
bottom: 0rpx;
background-color: #CCCFD6;
animation: msgBox .2s linear;
}
.num{
width: 225rpx;
height: 90rpx;
font-size: 42rpx;
font-weight: 500;
line-height: 90rpx;
text-align: center;
vertical-align: middle;
margin: 12rpx 12rpx 0 12rpx;
display: inline-block;
border: 1rpx solid #999999;
border-radius: 10rpx;
background-color: #FFFFFF;
position: relative;
z-index: 99;
} */
.numeric{
height: 480rpx;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background: #EBEBEB;
display: flex;
justify-content: center;
z-index: 2;
flex-wrap: wrap;
animation: msgBox .2s linear;
}
.num{
box-sizing: border-box;
width: 250rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: #fff;
font-size: 40rpx;
color: #333;
height: 120rpx;
border: 1rpx solid #F2F2F2;
border-top:none;
border-left:none;
}
.numColor{
background: #FF0000;
}
.forget{
font-size: 28rpx;
font-weight: 500;
color: #3D84EA;
text-align: center;
line-height: 80rpx;
}
.amend1{
border: 1rpx solid #CCCFD6;
background-color: #CCCFD6;
}
.amend3{
font-size: 40rpx;
border: 1rpx solid #CCCFD6;
background-color: #CCCFD6;
}
/* .amend11{
position: absolute;
top: 313rpx;
left: 0rpx;
background-color: #CCCFD6;
border: 1rpx solid #FF0000;
}
.amend1{
height: 100rpx !important;
position: absolute;
top: 306rpx;
left: 0rpx;
z-index: 99;
background-color: #CCCFD6;
border: 2rpx solid #CCCFD6;
}
.amend2{
position: absolute;
top: 306rpx;
left: 250rpx;
z-index: 99;
}
.amend3{
position: absolute;
top: 306rpx;
left: 500rpx;
z-index: 99;
font-size: 60rpx;
border: 0rpx;
background-color: #CCCFD6;
} */
</style>

View File

@ -352,6 +352,12 @@
"navigationBarTitleText": "修改密码"
}
},
{
"path": "user_pay_pwd/index",
"style": {
"navigationBarTitleText": "修改支付密码"
}
},
{
"path": "user_payment/index",
"style": {

View File

@ -145,7 +145,7 @@
refreshData(){
this.timer = setInterval(()=>{
this.getOrderPayInfo();
},1000)
},5000)
},
//
bindMore(){

View File

@ -450,6 +450,7 @@
<checkDelivery :deliveryName="deliveryName" :isShowBox="isShowBox" :activeObj="activeObj" :radioList="radioList" @close="boxClose" @confirmBtn="getData">
</checkDelivery>
</block>
<pay :show_key="payShow" :price="299" :show_subTitle="true" :mix="true" @payFunc="pay"></pay>
<!--优惠明细弹窗-->
<discountDetails :isShowDiscount="isShowDiscount" @close="closeDiscount" :couponData="couponData"></discountDetails>
<timeranges :isShow='isShow' :time='timeranges' @confrim="confrim" @cancel="cancels"></timeranges>
@ -495,6 +496,7 @@
import dayjs from "@/plugin/dayjs/dayjs.min.js";
import areaWindow from '@/components/areaWindow';
import timeranges from '@/components/timeranges';
import pay from '@/components/pay/index.vue';
export default {
components: {
couponListWindow,
@ -505,7 +507,8 @@
discountDetails,
"jyf-parser": parser,
areaWindow,
timeranges
timeranges,
pay
},
filters: {
filterDay(val) {
@ -671,6 +674,8 @@
addressInfoArea: [],
timeranges: [],
isShow:false,
payShow:false,
payInfo:{},
};
},
computed: {
@ -746,6 +751,12 @@
that.invoice.invoice = false
},
methods: {
pay(val){
let data1=this.payInfo;
data1.password=val.password;
console.log('val.password: ',val.password);
this.payment(data1);
},
/*预售协议*/
getPresellAgree: function() {
this.showProtocol = true
@ -1245,6 +1256,9 @@
},
payment: function(data) {
let that = this;
if(!data.password){
data.balance_vert=1;
}
createOrder(data).then(res => {
let status = res.data.status,
orderId = res.data.result.order_id,
@ -1252,7 +1266,9 @@
jsConfig = res.data.result.config,
goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + res.message;
that.orderPay = true;
uni.hideLoading();
console.log('status: ',status);
switch (status) {
case 'ORDER_EXIST':
case 'EXTEND_ORDER':
@ -1285,6 +1301,19 @@
// #ifndef MP
case "wechat":
case "weixin":
case "no_pay_password":
uni.showModal({
title: res.message,
content: res.msg,
confirmText: '绑定',
success(res) {
if (res.confirm) {
uni.navigateTo({
url:'/pages/users/user_info/index'
})
}
}
});
case "weixinApp":
jsConfig.timeStamp = jsConfig.timestamp;
// #ifndef APP-PLUS
@ -1384,6 +1413,7 @@
break;
// #endif
case "balance":
//
return that.$util.Tips({
title: res.message
@ -1641,6 +1671,8 @@
.Tips({
title: '余额不足!'
});
uni.showLoading({
title: '订单支付中',
mask: true
@ -1653,6 +1685,7 @@
// #ifndef MP
that.payment(data);
// #endif
},
//
openShowBox(item, index) {

View File

@ -60,6 +60,15 @@
<text v-else class='iconfont icon-suozi'></text>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>实名认证</view>
<navigator url="/pages/users/user_phone/index" hover-class="none" class="input" v-if="userInfo.phone">
点击实名认证<text class="iconfont icon-xiangyou"></text>
</navigator>
<view class='input acea-row row-between-wrapper' v-else>
<input type='text' value='已实名' disabled='true' class='id'></input>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>ID号</view>
<view class='input acea-row row-between-wrapper'>
@ -84,6 +93,13 @@
<text class='iconfont icon-you'></text>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>支付密码</view>
<view class='input acea-row row-between-wrapper' @click="changePlayPwd">
<text class='id'>修改支付密码</text>
<text class='iconfont icon-you'></text>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>地址管理</view>
<navigator url="/pages/users/user_address_list/index" hover-class="none" class='input acea-row row-between-wrapper'>
@ -321,6 +337,22 @@
});
}
},
/**
*修改支付密码
*/
changePlayPwd(){
let that = this;
if(that.userInfo.phone){
uni.navigateTo({
url: `/pages/users/user_pay_pwd/index`
})
}else{
that.$util.Tips({
title: '请先绑定手机号'
});
}
},
//
changeCancel(){
uni.navigateTo({

View File

@ -68,13 +68,13 @@
<view class='earn'>赚积分</view>
</view>
<!--#endif-->
<navigator class='item acea-row row-between-wrapper' hover-class='none' url='/pages/users/user_luckyDraw/index'>
<!-- <navigator class='item acea-row row-between-wrapper' hover-class='none' url='/pages/users/user_luckyDraw/index'>
<view class='pictrue'>
<image :src='`${domain}/static/images/score.png`'></image>
</view>
<view class='name'>轮盘抽奖可获得积分奖励</view>
<view class='earn'>去抽奖</view>
</navigator>
</navigator> -->
</view>
</view>
</view>

View File

@ -0,0 +1,232 @@
<template>
<view :style="viewColor">
<form report-submit='true'>
<view>
<view class="ChangePassword">
<view class="list">
<view class="item">
<text class="phone">{{userInfo.phone}}</text>
</view>
<view class="item acea-row row-between-wrapper codeVal">
<input type='number' placeholder='验证码' placeholder-class='placeholder' class="codeIput" v-model="captcha"></input>
<button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="handleVerify">
{{ text }}
</button>
</view>
<view class="border"></view>
<view class="item">
<input type='password' maxlength="6" placeholder='新支付密码' placeholder-class='placeholder' v-model="password" autocomplete="off"></input>
</view>
<view class="item">
<input type='password' maxlength="6" placeholder='确认新支付密码' placeholder-class='placeholder' v-model="repassword" autocomplete="off"></input>
</view>
</view>
</view>
<button form-type="submit" @click="confirmSubmit" class="confirmBnt">确认</button>
</view>
</form>
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify>
</view>
</template>
<script>
import sendVerifyCode from "@/mixins/SendVerifyCode";
import { modifyPayPassword,verifyCode } from '@/api/api.js';
import { getUserInfo } from '@/api/user.js';
import { registerVerify } from '@/api/user.js'
import { mapGetters } from "vuex";
import { toLogin } from '@/libs/login.js';
import Verify from '@/components/verify/verify.vue';
export default {
mixins: [sendVerifyCode],
components: {
Verify
},
data() {
return {
userInfo: {},
phone:'',
repassword: '',
password: '',
captcha:'',
key: '',
codeVal: '',
disabled: false,
};
},
computed: mapGetters(['isLogin', 'viewColor']),
onLoad() {
let that = this
if (this.isLogin) {
this.getUserInfo()
} else {
toLogin()
}
// #ifdef MP
wx.login({
success (res) {
if (res.code) {
that.codeVal = res.code
} else {
console.log('登录失败!' + res.errMsg)
}
}
})
// #endif
},
methods: {
/**
* 获取个人用户信息
*/
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
that.userInfo = res.data
});
},
verifyPwd(str){
let f=/^\d+$/.test(str);
return f;
},
confirmSubmit: function() {
let that = this;
if (that.password.length!=6||that.repassword.length!=6) return that.$util.Tips({
title: '支付密码须为6位数数字'
});
if (!this.verifyPwd(that.password)||!this.verifyPwd(that.repassword)) return that.$util.Tips({
title: '支付密码须为6位数数字'
});
if (!that.password) return that.$util.Tips({
title: '请填写支付密码!'
});
if (!that.repassword) return that.$util.Tips({
title: '请确认支付新密码!'
});
if (that.password !== that.repassword) return that.$util.Tips({
title: '两次支付密码不一致,请重新填写!'
});
if (!that.captcha) return that.$util.Tips({
title: '请填写验证码'
});
modifyPayPassword({
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
});
})
},
/**
* 发送验证码
*
*/
async code(data) {
let that = this;
// if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.userInfo.phone))) return that.$util.Tips({
// title: ''
// });
this.disabled = true
await registerVerify({
phone:that.userInfo.phone,
code:that.captcha,
type: 'change_pwd',
captchaType: 'blockPuzzle',
captchaVerification: data.captchaVerification
}).then(res => {
this.disabled = false
that.$util.Tips({
title: res.msg
});
that.sendCode();
}).catch(err => {
this.disabled = false
return that.$util.Tips({
title: err
});
});
},
success(data) {
this.$refs.verify.hide();
this.code(data);
},
handleVerify() {
this.$refs.verify.show();
}
}
}
</script>
<style lang="scss" scoped>
.ChangePassword{
background: #fff;
padding-top: 53rpx;
}
.ChangePassword .phone {
font-size: 32rpx;
}
.ChangePassword .list .item {
width: 580rpx;
margin: 0 auto;
height: 110rpx;
border-bottom: 2rpx solid #f0f0f0;
display: flex;
align-items: center;
}
.ChangePassword .list .item input {
width: 100%;
font-size: 32rpx;
}
.ChangePassword .list .item .placeholder {
color: #b9b9bc;
}
.ChangePassword .list .item input.codeIput {
width: 340rpx;
}
.ChangePassword .list .item .code {
font-size: 32rpx;
position: relative;
padding-left: 26rpx;
color: var(--view-theme);
&::before{
content: "";
width: 1rpx;
height: 30rpx;
position: absolute;
top: 10rpx;
left: 0;
background: #DDDDDD;
display: inline-block;
}
}
.ChangePassword .list .item .code.on {
color: #b9b9bc !important;
}
.ChangePassword .list .border{
width: 100%;
height: 21rpx;
background: #F5F5F5;
}
.confirmBnt {
font-size: 32rpx;
width: 580rpx;
height: 90rpx;
border-radius: 45rpx;
color: #fff;
margin: 70rpx auto 0 auto;
text-align: center;
line-height: 90rpx;
background-color: var(--view-theme);
}
</style>

View File

@ -27,6 +27,14 @@
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.haiyue-guanbi2:before {
content: "\e908";
}
.haiyue-guanbi:before {
content: "\e907";
}
.haiyue-zhuyi:before {
content: "\e904";
}
@ -43,6 +51,7 @@
content: "\e901";
}
.icon-huodong-renshu:before {
content: "\e869";
}

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,20 @@
"css_prefix_text": "haiyue",
"description": "",
"glyphs": [
{
"icon_id": "39835854",
"name": "关闭",
"font_class": "-guanbi2",
"unicode": "e908",
"unicode_decimal": 59656
},
{
"icon_id": "39835567",
"name": "关闭",
"font_class": "-guanbi",
"unicode": "e907",
"unicode_decimal": 59655
},
{
"icon_id": "39769738",
"name": "注意",

Binary file not shown.

Binary file not shown.

Binary file not shown.