This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-03-22 17:42:25 +08:00
parent 51448c0cf6
commit 8405461850
9 changed files with 397 additions and 297 deletions

View File

@ -1,4 +1,5 @@
<template> <template>
<view>
<uni-popup ref="payModal" type="center" safeArea :animation="true"> <uni-popup ref="payModal" type="center" safeArea :animation="true">
<view class="payModal"> <view class="payModal">
<view class="payModal-title">{{code == 101?'未设置密码':'支付密码错误'}}</view> <view class="payModal-title">{{code == 101?'未设置密码':'支付密码错误'}}</view>
@ -14,6 +15,7 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
</view>
</template> </template>
<script> <script>
@ -24,7 +26,6 @@
} }
}, },
methods: { methods: {
// //
handleOpen(code) { handleOpen(code) {
this.code = code; this.code = code;

View File

@ -0,0 +1,247 @@
<template>
<view>
<uni-popup ref="popup" type="bottom" :mask-background-color="isPay?'rgba(0,0,0,.8)':'transparent'" safeArea
backgroundColor="transparent" :animation="true" @maskClick="maskClick">
<view class="popup-wrap" :style="{'border-radius':isPay?'': 0}">
<view class="paybox" v-if="isPay">
<view class="paybox-title">
<view class="paybox-title-left"></view>
<view class="paybox-title-middle">请输入支付密码</view>
<view class="paybox-titler-right" @click="handleClose">
<u-icon name="close" size="18" color="#666" />
</view>
</view>
<view class="paybox-input">
<u-code-input v-model="value" mode="box" dot readonly></u-code-input>
</view>
</view>
<view class="keyboard">
<view class="keyboard-left" :style="{width:isPay?'100%':''}">
<block v-for="(item,indx) in keys" :key="indx">
<view class="keyboard-left-item active del" v-if="item=='del'" @click="handleClick(item)">
<image style="width: 48rpx;height: 48rpx;" src="@/static/del.webp" />
</view>
<view class="keyboard-left-item word active"
:style="{width:isPay?'0%':'',border:isPay?'0':''}" v-else-if="item == '.'"
@click="handleClick(item)">
{{isPay?'':item}}
</view>
<view class="keyboard-left-item word active"
:style="{width:(isPay && item == '0')?'66.66%':''}" v-else @click="handleClick(item)">
{{item}}
</view>
</block>
</view>
<view class="keyboard-right" :style="{width:isPay?'0%':''}">
<view class="keyboard-right-clear word active" @click="handleClear">清空</view>
<view class="keyboard-right-pay word active-pay" @click="handlePay">{{txt}}</view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
name: "popups",
props: {
txt: {
type: String,
default: '付款'
},
isPay: { //
type: Boolean,
default: false
}
},
data() {
return {
keys: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, '.', 'del'],
value: '',
}
},
watch: {
value(newVal, oldVal) {
//
if (newVal.length == 6 && this.isPay) {
this.handlePay();
}
}
},
methods: {
//
handleClick(item) {
if (this.value.length >= 10) return;
if (item == ".") {
if (!this.value) {
this.value = '0.';
} else {
if (this.value.indexOf('.') > -1) return;
this.value = this.value + item;
}
} else if (item == 'del') {
if (this.value == "0.")
this.value = this.value.substring(0, 0);
else
this.value = this.value.substring(0, this.value.length - 1);
} else if (item == 0) {
if (this.isPay) {
this.value = this.value + item;
} else {
if (this.value) {
if (this.value.lastIndexOf('.') != -1 && this.value.length - this.value.lastIndexOf('.') == 3)
return;
this.value = this.value + item;
} else {
this.value = this.value + item;
}
}
} else {
if (this.value.lastIndexOf('.') != -1 && this.value.length - this.value.lastIndexOf('.') == 3) return;
this.value = this.value + item;
}
this.$emit('change', this.value);
},
//
handleClear() {
this.value = '';
this.$emit('clear');
},
//
handlePay() {
// .
if (this.value && this.value.endsWith('.')) {
this.value = this.value.replace('.', '');
}
this.$emit('confirm', this.value);
this.handleClose();
},
//
handleOpen() {
this.value = '';
this.$refs.popup.open();
},
//
handleClose() {
this.$refs.popup.close();
},
maskClick() {
// .
if (this.value && this.value.endsWith('.')) {
this.value = this.value.replace('.', '');
}
this.$emit('change', this.value);
}
}
}
</script>
<style lang="scss" scoped>
.popup-wrap {
background-color: #fff;
border-radius: 30rpx 30rpx 0 0;
.paybox {
.paybox-title {
display: flex;
justify-content: space-between;
padding: 40rpx;
.paybox-title-left {}
.paybox-title-middle {
font-size: 30rpx;
font-weight: bold;
color: #333;
}
.paybox-titler-right {}
}
.paybox-input {
display: flex;
justify-content: center;
margin-bottom: 40rpx;
/deep/.u-code-input__item {
background-color: #E6E6E6;
border-radius: 8rpx;
border: 0 !important;
}
}
}
}
.keyboard {
display: flex;
padding-bottom: 20rpx;
border-top: 2rpx solid #E6E6E6;
.keyboard-left {
width: 75%;
display: flex;
flex-wrap: wrap;
.keyboard-left-item {
width: 33.3%;
height: 120rpx;
line-height: 102rpx;
border-bottom: 2rpx solid #E6E6E6;
border-right: 2rpx solid #E6E6E6;
}
.del {
display: flex;
justify-content: center;
align-items: center;
}
}
.keyboard-right {
width: 25%;
.keyboard-right-clear {
width: 100%;
height: 240rpx;
line-height: 226rpx;
}
.keyboard-right-pay {
width: 100%;
height: 240rpx;
line-height: 226rpx;
text-align: center;
background-color: #40AE36;
color: #fff !important;
}
}
.word {
font-weight: 600;
font-size: 34rpx;
color: #000000;
text-align: center;
}
.active:active {
background-color: rgba(232, 232, 232, 0.5);
}
.active-pay:active {
opacity: .9;
}
}
</style>

View File

@ -134,7 +134,6 @@
// //
handleOpen() { handleOpen() {
this.value = ''; this.value = '';
console.log('123:' + this.value);
this.$refs.popup.open(); this.$refs.popup.open();
}, },

View File

@ -1,167 +0,0 @@
<template>
<uni-popup ref="popup" type="bottom" mask-background-color="rgba(0,0,0,0)" safeArea backgroundColor="#fff"
:animation="true" @maskClick="maskClick">
<view style="padding:40rpx;display: flex;justify-content: center;align-items: center;">
<u-code-input v-model="value" mode="box" dot readonly></u-code-input>
</view>
<view class="keyboard">
<view class="keyboard-left">
<block v-for="(item,indx) in keys" :key="indx">
<view class="keyboard-left-item word active" v-if="item != 'del'" @click="handleClick(item)">
{{item}}
</view>
<view class="keyboard-left-item active del" v-else @click="handleClick(item)">
<image style="width: 48rpx;height: 48rpx;" src="@/static/del.webp" />
</view>
</block>
</view>
<view class="keyboard-right">
<view class="keyboard-right-clear word active" @click="handleClear">清空</view>
<view class="keyboard-right-pay word active-pay" @click="handlePay">付款</view>
</view>
</view>
</uni-popup>
</template>
<script>
export default {
name: "popups",
data() {
return {
keys: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, '.', 'del'],
value: ''
}
},
methods: {
//
handleClick(item) {
if (this.value.length >= 10) return;
if (item == ".") {
if (!this.value) {
this.value = '0.';
} else {
if (this.value.indexOf('.') > -1) return;
this.value = this.value + item;
}
} else if (item == 'del') {
if (this.value == "0.")
this.value = this.value.substring(0, 0);
else
this.value = this.value.substring(0, this.value.length - 1);
} else if (item == 0) {
if (this.value) {
if (this.value.lastIndexOf('.') != -1 && this.value.length - this.value.lastIndexOf('.') == 3)
return;
this.value = this.value + item;
}
} else {
if (this.value.lastIndexOf('.') != -1 && this.value.length - this.value.lastIndexOf('.') == 3) return;
this.value = this.value + item;
}
this.$emit('change', this.value);
},
//
handleClear() {
this.value = '';
this.$emit('clear');
},
//
handlePay() {
// .
if (this.value && this.value.endsWith('.')) {
this.value = this.value.replace('.', '');
}
this.$emit('confirm', this.value);
this.handleClose();
},
//
handleOpen() {
this.$refs.popup.open();
},
//
handleClose() {
this.$refs.popup.close();
},
maskClick() {
// .
if (this.value && this.value.endsWith('.')) {
this.value = this.value.replace('.', '');
}
this.$emit('change', this.value);
}
}
}
</script>
<style lang="scss">
.keyboard {
display: flex;
padding-bottom: 20rpx;
.keyboard-left {
width: 75%;
display: flex;
flex-wrap: wrap;
.keyboard-left-item {
width: 33.3%;
height: 120rpx;
line-height: 102rpx;
border-bottom: 2rpx solid #E6E6E6;
border-right: 2rpx solid #E6E6E6;
}
.del {
display: flex;
justify-content: center;
align-items: center;
}
}
.keyboard-right {
width: 25%;
.keyboard-right-clear {
width: 100%;
height: 240rpx;
line-height: 226rpx;
}
.keyboard-right-pay {
width: 100%;
height: 240rpx;
line-height: 226rpx;
text-align: center;
background-color: #40AE36;
color: #fff !important;
}
}
.word {
font-weight: 600;
font-size: 34rpx;
color: #000000;
text-align: center;
}
.active:active {
background-color: rgba(232, 232, 232, 0.5);
}
.active-pay:active {
opacity: .9;
}
}
</style>

View File

@ -395,7 +395,6 @@
payment: function(data) { payment: function(data) {
let that = this; let that = this;
createOrder(data).then(res => { createOrder(data).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,
@ -404,7 +403,6 @@
'&product_type=' + that.payForm.product_type + '&source=' + that.payForm.source, '&product_type=' + that.payForm.product_type + '&source=' + that.payForm.source,
goPagesOrder = '/pages/order_details/stay?order_id=' + orderId + goPagesOrder = '/pages/order_details/stay?order_id=' + orderId +
'&credit_buy=1&product_type=' + that.payForm.product_type; '&credit_buy=1&product_type=' + that.payForm.product_type;
that.orderPay = true; that.orderPay = true;
uni.hideLoading(); uni.hideLoading();
switch (status) { switch (status) {
@ -580,7 +578,7 @@
}); });
}, },
SubOrder: function() { SubOrder: async function() {
let that = this, let that = this,
data = {}; data = {};
if (!that.payType) return that.$util.Tips({ if (!that.payType) return that.$util.Tips({
@ -596,6 +594,17 @@
// //
if (that.payType == 'balance' || that.payType == 'merBalance') { if (that.payType == 'balance' || that.payType == 'merBalance') {
//
const result = await this.$util.checkPassword();
if (result.data.code == 101) { //
return this.$util.Tips({
title: "您暂未设置支付密码,请前往设置!"
}, () => {
uni.navigateTo({
url: "/pages/users/user_modify_pwd/index?type=payPwd"
});
})
}
this.$refs.popups.handleOpen(); this.$refs.popups.handleOpen();
} else { } else {
uni.showLoading({ uni.showLoading({
@ -606,29 +615,20 @@
} }
}, },
// //
handleConfirm(e) { async handleConfirm(e) {
// const result = await this.$util.checkPassword(e);
verifyPwd({ //
withdrawal_pwd: e if (result.data.code == 100) {
}).then(res => {
//
const code = res.data.code;
this.$set(this.payForm, 'withdrawal_pwd', e); this.$set(this.payForm, 'withdrawal_pwd', e);
if (code == 100) { //
uni.showLoading({ uni.showLoading({
title: '订单支付中', title: '订单支付中',
mask: true mask: true
}); });
this.truePayOrder(this.payForm); this.truePayOrder(this.payForm);
} else { } else {
this.$refs.payPwd.handleOpen(code); this.$refs.payPwd.handleOpen(result.data.code);
} }
}).catch(err => {
console.log(err)
})
}, },
// 101 102 // 101 102

View File

@ -81,7 +81,7 @@
}) })
shopTypeChange({ shopTypeChange({
type: 3, type: this.selected == 1 ? 3 : 4,
mer_id: this.mer_id mer_id: this.mer_id
}).then(res => { }).then(res => {
if (res.status == 200) { if (res.status == 200) {

View File

@ -13,7 +13,6 @@
<block v-for="(item,indx) in list" :key="indx"> <block v-for="(item,indx) in list" :key="indx">
<view class="shop-type-list-item"> <view class="shop-type-list-item">
<view class="shop-type-list-item-title" @click='hanldeTo(item)'> <view class="shop-type-list-item-title" @click='hanldeTo(item)'>
<!-- #40AE36 审核通过 #F55726 审核未通过 #666666 审核中-->
<view class="shop-type-list-item-title-status" <view class="shop-type-list-item-title-status"
:style="{'color':item.status==0?'#666':item.status==1?'#40AE36':'#F55726'}"> :style="{'color':item.status==0?'#666':item.status==1?'#40AE36':'#F55726'}">
{{item.status == 0?'审核中':item.status==1?'审核通过':'审核未通过'}} {{item.status == 0?'审核中':item.status==1?'审核通过':'审核未通过'}}
@ -47,7 +46,8 @@
<view class="shop-type-list-item-con-item" v-if="item.status == 2"> <view class="shop-type-list-item-con-item" v-if="item.status == 2">
<view class="shop-type-list-item-con-key">备注</view> <view class="shop-type-list-item-con-key">备注</view>
<view class="shop-type-list-item-con-val" style="word-break: break-all;"> <view class="shop-type-list-item-con-val" style="word-break: break-all;">
{{item.update_time || ''}}</view> {{item.update_time || ''}}
</view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -435,6 +435,8 @@
that.$set(that, 'pics', that.pics); that.$set(that, 'pics', that.pics);
}, },
subCash: async function(e) { subCash: async function(e) {
let that = this, let that = this,
value = e.detail.value; value = e.detail.value;
value.source = this.source value.source = this.source
@ -504,6 +506,17 @@
} }
this.modes = mode; this.modes = mode;
//
const result = await this.$util.checkPassword();
if (result.data.code == 101) { //
return this.$util.Tips({
title: "您暂未设置支付密码,请前往设置!"
}, () => {
uni.navigateTo({
url: "/pages/users/user_modify_pwd/index?type=payPwd"
});
})
}
this.$refs.popups.handleOpen(); this.$refs.popups.handleOpen();
}, },
@ -528,27 +541,19 @@
}, },
// //
handleConfirm(e) { async handleConfirm(e) {
// const result = await this.$util.checkPassword(e);
verifyPwd({ //
withdrawal_pwd: e if (result.data.code == 100) {
}).then(res => {
//
const code = res.data.code;
this.$set(this.modes, 'withdrawal_pwd', e); this.$set(this.modes, 'withdrawal_pwd', e);
if (code == 100) { //
uni.showLoading({ uni.showLoading({
title: '订单支付中', title: '订单支付中',
mask: true mask: true
}); });
this.trueWithdraw(); this.trueWithdraw();
} else { } else {
this.$refs.payPwd.handleOpen(code); this.$refs.payPwd.handleOpen(result.data.code);
} }
}).catch(err => {
console.log(err)
})
}, },
// 101 102 // 101 102
@ -570,8 +575,9 @@
}, },
handleClear() {}, handleClear() {},
handleChange() {}, handleChange() {
this.load = false;
},
async postCreate(price) { async postCreate(price) {
const data = { const data = {

View File

@ -15,10 +15,20 @@ import store from '../store';
import { import {
pathToBase64 pathToBase64
} from '@/plugin/image-tools/index.js'; } from '@/plugin/image-tools/index.js';
import {
verifyPwd
} from '@/api/order.js';
// #ifdef APP-PLUS // #ifdef APP-PLUS
import permision from "./permission.js" import permision from "./permission.js"
// #endif // #endif
export default { export default {
// 是否设置密码
checkPassword: async function(e) {
e = e ? e : '';
return await verifyPwd({
withdrawal_pwd: e
});
},
/** /**
* 字符串截取 * 字符串截取
* @obj 传入的数据 * @obj 传入的数据
@ -220,7 +230,8 @@ export default {
ctx.drawImage(arr2[2], cx, cy, d, d); ctx.drawImage(arr2[2], cx, cy, d, d);
ctx.restore(); ctx.restore();
const CONTENT_ROW_LENGTH = 40; const CONTENT_ROW_LENGTH = 40;
let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name, CONTENT_ROW_LENGTH); let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name,
CONTENT_ROW_LENGTH);
if (contentRows > 2) { if (contentRows > 2) {
contentRows = 2; contentRows = 2;
let textArray = contentArray.slice(0, 2); let textArray = contentArray.slice(0, 2);
@ -304,11 +315,13 @@ export default {
ctx.setFillStyle('#282828'); ctx.setFillStyle('#282828');
ctx.fillText(site_name, r, 62); ctx.fillText(site_name, r, 62);
const CONTENT_ROW_LENGTH = 26; const CONTENT_ROW_LENGTH = 26;
let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name, CONTENT_ROW_LENGTH); let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name,
CONTENT_ROW_LENGTH);
if (contentRows > 2) { if (contentRows > 2) {
contentRows = 2; contentRows = 2;
let textArray = contentArray.slice(0, 2); let textArray = contentArray.slice(0, 2);
textArray[textArray.length - 1] = textArray[textArray.length - 1].slice(0,textArray[textArray.length - 1].length-1) textArray[textArray.length - 1] = textArray[textArray.length - 1].slice(0,
textArray[textArray.length - 1].length - 1)
textArray[textArray.length - 1] += '…'; textArray[textArray.length - 1] += '…';
contentArray = textArray; contentArray = textArray;
} }
@ -408,7 +421,8 @@ export default {
ctx.setFontSize(28); ctx.setFontSize(28);
ctx.setFillStyle('#282828'); ctx.setFillStyle('#282828');
const CONTENT_ROW_LENGTH = 25; const CONTENT_ROW_LENGTH = 25;
let [contentLeng, contentArray, contentRows] = that.textByteLength(content, CONTENT_ROW_LENGTH); let [contentLeng, contentArray, contentRows] = that.textByteLength(content,
CONTENT_ROW_LENGTH);
if (contentRows > 2) { if (contentRows > 2) {
contentRows = 2; contentRows = 2;
let textArray = contentArray.slice(0, 2); let textArray = contentArray.slice(0, 2);