no message

This commit is contained in:
2025-09-09 12:02:33 +08:00
parent e12623d607
commit 01f1726d04
4 changed files with 173 additions and 18 deletions
+156 -10
View File
@@ -172,7 +172,42 @@
</view>
</view>
</up-popup>
<u-modal :show="tipsShow"
title="提示"
showCancelButton
@cancel="onCancel"
@confirm="onConfirm"
:cancelText="type == 1 ? '取消' : '忘记密码'"
:confirmText="type == 1 ? '去设置' : '重试'"
confirmColor="#7934F6"
:content='content'></u-modal>
<u-keyboard ref="uKeyboard" mode="number"
:show="show"
@change="onChange"
@backspace="onBackspace"
:dotDisabled="true"
:tooltip="false"
>
<view style="background-color: #fff;">
<view class="money">
<text>{{orderInfo.amount}}</text>
<text class="text-40 " style="margin-left:20rpx"></text>
<view class="text-28 close" data-flag="false" @tap="showPop(false)">
<u-icon name="close" color="#333333" size="20"></u-icon>
</view>
</view>
<view class="mid-tips">
<u-code-input v-model="password"
:dot="true"
:maxlength="6"
@finish="finish"
></u-code-input>
</view>
<view class="tips text-28">请输入支付密码</view>
</view>
</u-keyboard>
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
@@ -186,8 +221,10 @@ import { getSupportPay } from '@/api/order.js';
import { feedback } from '@/api/payment.js';
import { assembleAddress } from '@/utils/index.js'
import Header from '@/components/header.vue';
import { getUserInfo } from '@/api/auth.js';
import { appWxpayFun, zfbPayFun, jumpWayOk, jumpWayError } from '@/utils/payUtils.js'
import CryptoJS from 'crypto-js';
export default {
computed: {
@@ -201,6 +238,10 @@ export default {
},
data() {
return {
password:'',
payPwd:0,
show:false,
isShow:false,
ids: 0,
orderInfo: {
// coupon:2,//优惠卷
@@ -219,7 +260,11 @@ export default {
isShowBalance: false,
ji: 0,
sed: null,
curPay: null
curPay: null,
user:null,
tipsShow:false,
content:'您未设置支付密码,请先去设置支付密码',
type:'1'
};
},
onLoad(option) {
@@ -245,6 +290,7 @@ export default {
this.getWayOption();
this.wayShow = payOpen;
}
this.getUserInfo();
},
mounted() {
@@ -252,6 +298,58 @@ export default {
methods: {
getValue,
assembleAddress,
onBackspace(e){
if(this.password.length>0){
this.password = this.password.substring(0,this.password.length-1);
}
},
showPop(flag = true){
this.password = '';
this.show = flag;
},
finish(){
console.log(11111)
},
onChange(val){
if(this.password.length<6){
this.password += val;
}
if(this.password.length>=6){
this.show = false;
this.payPwd = this.password;
this.password = '';
setTimeout(()=>{
this.passPay();
},300)
// this.checkPayPwd();
}
},
onCancel(){
if(this.type == '2'){
uni.redirectTo({
url:'/pages/rwa_package/setting/forgot-pass?type=1'
})
}
this.tipsShow = false;
},
onConfirm(){
if(this.type == '1'){
uni.redirectTo({
url:'/pages/rwa_package/setting/forgot-pass?type=1'
})
}else{
this.tipsShow = false;
this.passShow = true;
}
},
async getUserInfo() {
const result = await getUserInfo();
if (result && result.bizcode === 100) {
const data = result.data;
this.user = result.data || {};
}
},
// 增加收货地址
addAdress() {
const ids = this.ids;
@@ -274,7 +372,6 @@ export default {
} else {
parmas['types'] = '1,2,3';
}
console.log('this.ji', parmas)
const result = await getSupportPay(parmas);
if (result && result.bizcode === 100) {
const data = result.data || [];
@@ -406,7 +503,7 @@ export default {
this.$refs.uToastRef.show({
type: 'error',
message: "不能再减拉,不能小于最低购买数量~",
}); x3
});
} else {
currentQuantity = currentQuantity - 1;
currentAmount = currentAmount - data.unitPrice;
@@ -494,27 +591,49 @@ export default {
});
return;
}
if(!this.user.tradePassword){
return this.tipsShow = true;
}
if (arr.length) {
if (arr[0].type == 'balance' || arr[0].type == 'redpacket') {
this.show = true;
}else{
this.passPay()
}
}else{
this.passPay()
}
},
async passPay(){
const params = {
addrId: orderInfo.address.id,// 收货地址ID
addrId: this.orderInfo.address.id,// 收货地址ID
//结算的购物车ID,多个以逗号分割,ALL表示全选
payway: way,// 支付方式:1-微信,2-支付宝
payway: this.orderInfo.paymentMethod,// 支付方式:1-微信,2-支付宝
remark: JSON.stringify(this.getRemark()),//备注信息'[{"sid":"店铺ID","rmk":"备注内容"},{"sid":"店铺ID","rmk":"备注内容"}]'
}
let resp = null;
if (this.sed) {
if(this.orderInfo.paymentMethod == 'balance' || this.orderInfo.paymentMethod == 'redpacket'){
params['password'] = CryptoJS.MD5(this.payPwd).toString();
}
params['goodsId'] = this.sed.id;
params['specsId'] = this.sed.specsId.id;
params['goodsNum'] = this.orderInfo.shops[0].addrTimes[0].goods[0].num;
resp = await settlementOrder(params);
} else {
params['cartIds'] = this.ids;
if(this.orderInfo.paymentMethod == 'balance' || this.orderInfo.paymentMethod == 'redpacket'){
params['password'] = CryptoJS.MD5(this.payPwd).toString();
}
resp = await settle(params);
}
console.log('getWayOption', resp)
// 提交订单成功,就唤起支付
if (resp && resp.bizcode === 100) {
const item = resp.data;
@@ -604,6 +723,33 @@ export default {
</script>
<style lang="scss" scoped>
.money{
text-align: center;
font-size: 80rpx;
color: #ff9918;
position: relative;
background-color: #fff;
.close{
position: absolute;
top: 20rpx;
right: 20rpx;
line-height: 28rpx;
font-size: 28rpx;
}
}
.mid-tips{
width:100%;
display: flex;
align-items: center;
justify-content: center;
}
.tips{
color:$u-tips-color;
margin:20rpx 0;
text-align: center;
background-color: #fff;
}
.order_submit_warp {
background-color: $app-bj;
height: calc(100vh - 200rpx);