liudan 4 months ago
parent 63b03a777f
commit 7090c14ba3
  1. 8
      api/user.js
  2. 115
      components/psw.vue
  3. 43
      pages/goods/cashier/index.vue
  4. 62
      pages/users/mima/index.vue

@ -728,3 +728,11 @@ export function changeRemindStatus(status) {
export function spreadAgent(data) {
return request.post(`agent/spread`, data);
}
// 设置密码
export function setPsw(data) {
return request.post(`user/set_pay_password`, data);
}
// 密码校验
export function checkPsw(data) {
return request.post(`user/sure_pay_password`, data);
}

@ -0,0 +1,115 @@
<template>
<view>
<view class="address-window" :class="show==true?'on':''">
<view class="weikuan">
<view class="title">
请输入密码
</view>
<input style="border: 1px solid #333;padding: 20rpx;margin: 40rpx 20rpx;border-radius: 10rpx;" :placeholder='$t(`请输入密码`)' placeholder-class='placeholder' v-model="newPsd" type="password"
></input>
<view class="btnPay" @click="payHandle">
支付尾款
</view>
</view>
</view>
<view class='mask' catchtouchmove="true" :hidden='show==false' @tap='close'></view>
</view>
</template>
<script>
import {
HTTP_REQUEST_URL
} from '@/config/app';
export default {
props: {
show: {
type: Boolean,
default: true
},
info:{
type:Object,
default:()=>{
return {}
}
}
},
data() {
return {
newPsd:null,
};
},
methods: {
close: function() {
this.$emit("close")
},
payHandle(){
if(!this.newPsd){
uni.showToast({
title:"请输入密码",
icon: 'none',
duration: 2000
});
return;
}
this.$emit("psdPay",this.newPsd)
}
},
}
</script>
<style scoped lang="scss">
.address-window {
border-radius: 20rpx 20rpx 0 0;
background-color: #fff;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
z-index: 1000;
transform: translate3d(0, 100%, 0);
transition: all .3s cubic-bezier(.25, .5, .5, .9);
}
.address-window.on {
transform: translate3d(0, 0, 0);
}
.weikuan{
padding:30rpx 24rpx 53rpx 24rpx;
.title {
text-align: center;
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 34rpx;
color: #333333;
}
.btnPay{
margin-top:50rpx;
line-height: 98rpx;
height: 98rpx;
background: #A8D178;
border-radius: 49px;
border: 1px solid #A8D178;
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 30rpx;
color: #FFFFFF;
text-align: center;
}
}
</style>

@ -31,31 +31,43 @@
</view>
</view>
<view class="btn">
<view class="button acea-row row-center-wrapper" @click='goPay(number, paytype)'>{{$t(`确认支付`)}}</view>
<!-- @click='goPay(number, paytype)' -->
<view class="button acea-row row-center-wrapper" @click='goPayHandle(number, paytype)'>{{$t(`确认支付`)}}</view>
<view class="wait-pay" @click="waitPay">{{$t(`暂不支付`)}}</view>
</view>
<view v-show="false" v-html="formContent"></view>
<psw @close="psdShow=false"
ref="psw"
:show="psdShow"
@psdPay="psdPayHandle"></psw>
</view>
</view>
</template>
<script>
import countDown from '@/components/countDown';
import numberScroll from '@/components/numberScroll.vue'
import psw from '@/components/psw.vue'
import {
getCashierOrder,
orderPay
} from '@/api/order.js';
import {
checkPsw
} from "@/api/user.js";
import {
basicConfig
} from '@/api/public.js'
export default {
components: {
countDown,
numberScroll
numberScroll,
psw
},
data() {
return {
psdShow:false,
checked: false,
datatime: 1676344056,
//
@ -110,7 +122,9 @@
},
formContent: '',
oid: 0,
wei_status:0
wei_status:0,
number:null,
paytype:null,
}
},
watch: {
@ -262,6 +276,27 @@
'&status=2&totalPrice=' + this.payPriceShow
})
},
goPayHandle(number, paytype){
this.number = number;
this.paytype = paytype;
this.psdShow = true;
this.$refs.psw.newPsd = null;
},
psdPayHandle(newV){
checkPsw({password:newV}).then(res=>{
if(res.status!=200){
console.log(res)
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}else{
this.psdShow = false;
this.goPay(this.number,this.paytype)
}
})
},
goPay(number, paytype) {
let that = this;
if (!that.orderId) return that.$util.Tips({

@ -28,14 +28,14 @@
<view class="itemTitle">
新密码
</view>
<input :placeholder='$t(`请输入`)' placeholder-class='placeholder' v-model="newPsd"
<input :placeholder='$t(`请输入`)' placeholder-class='placeholder' v-model="newPsd" type="password"
></input>
</view>
<view class="item">
<view class="itemTitle">
确认密码
</view>
<input type='number' :placeholder='$t(`请输入`)' placeholder-class='placeholder' v-model="renewPsd"
<input :placeholder='$t(`请输入`)' placeholder-class='placeholder' v-model="renewPsd" type="password"
></input>
</view>
</view>
@ -80,7 +80,8 @@
loginMobile,
getCodeApi,
getUserInfo,
phoneSilenceAuth
phoneSilenceAuth,
setPsw
} from "@/api/user.js";
import {
phoneLogin,
@ -143,29 +144,30 @@
this.protocol = true
},
submitData() {
let that = this;
if (this.pageType == 0) {
this.isLogin()
return
}
if (!this.rules()) return
if (!this.authKey) {
let key = this.$Cache.get('snsapiKey');
this.phoneAuth(key)
} else {
this.phoneAuth(this.authKey)
let params={
phone:this.phone,
captcha:this.captcha,
password:this.newPsd,
confimpassword:this.renewPsd
}
setPsw(params).then(res=>{
if(res.status==200){
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
},
rules() {
let that = this;
if (!this.protocol && this.pageType == 0) {
uni.showToast({
title: this.$t('请先阅读并同意协议'),
icon: 'none',
duration: 2000
});
return false
}
if (!that.phone) {
that.$util.Tips({
title: that.$t(`请填写手机号码`)
@ -184,6 +186,24 @@
});
return false
}
if (!that.newPsd) {
return that.$util.Tips({
title: that.$t(`请输入新密码`)
});
return false
}
if (!that.renewPsd) {
return that.$util.Tips({
title: that.$t(`请再次输入新密码`)
});
return false
}
if (that.renewPsd!=that.newPsd) {
return that.$util.Tips({
title: that.$t(`两次输入密码不一致`)
});
return false
}
return true
},
isLogin() {

Loading…
Cancel
Save