uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改

This commit is contained in:
2025-10-21 10:44:31 +08:00
parent 5d98b7efc2
commit 5f3a307fec
395 changed files with 31264 additions and 2477 deletions

View File

@@ -4,7 +4,7 @@
<view class="paymentMethod_content">
<view class="paymentMethod_title">支付方式</view>
<up-radio-group
v-model="radiovalue"
v-model="radiovalue.type"
iconPlacement="right"
@change="groupChanges"
:size="28"
@@ -146,11 +146,37 @@ const paymentMethodName = ref([
},
]);
const radiovalue = ref(2); // 支付方式
// const radiovalue = ref(2); // 支付方式
const radiovalue = defineModel({
type: Object,
default: () => {
return {
name: "微信支付",
type: 2,
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
payType: "wechatPay",
};
},
});
const ispws = ref(false); // 输入支付密码
watch(
() => props.disablePayType,
(newval) => {
console.log('禁止支付方式', newval);
const storeInfo = ref({});
const canUsePayType = paymentMethodList.value.filter((item) => {
return !newval.includes(item.name);
});
console.log('可用支付方式', canUsePayType);
if (canUsePayType.find((v) => v.type == radiovalue.value.type)) {
return;
}
radiovalue.value = canUsePayType[0];
},
{
immediate: true,
}
);
// * 监听支付方式切换
const groupChanges = (type) => {
@@ -158,8 +184,6 @@ const groupChanges = (type) => {
return;
}
const item = paymentMethodList.value.find((v) => v.type == type);
console.log("groupChanges", item);
console.log("props.disablePayType", props.disablePayType);
if (item && returnDisabled(item)) {
uni.showToast({
@@ -171,9 +195,7 @@ const groupChanges = (type) => {
// if (props.payAmount <= 0 && type != 1) {
// return;
// }
radiovalue.value = type;
let name = paymentMethodName.value[type - 1].name;
console.log('emit:groupChange',paymentMethodName.value[type - 1]);
radiovalue.value = item;
emits("groupChange", paymentMethodName.value[type - 1]);
};
@@ -182,15 +204,18 @@ const goRecharge = () => {
if (props.disablePayType.includes("余额支付")) {
return;
}
if (orderVIP.value.isVip) {
uni.navigateTo({
url: "/pages/user/member/czzx?shopId=" + orderVIP.value.shopId,
});
return;
}
uni.navigateTo({
url: "/user/vip/buy-vip?shopId=" + orderVIP.value.shopId,
url: "/pages/user/member/czzx?shopId=" + orderVIP.value.shopId,
});
// if (orderVIP.value.isVip) {
// uni.navigateTo({
// url: "/pages/user/member/czzx?shopId=" + orderVIP.value.shopId,
// });
// return;
// }
// uni.navigateTo({
// url: "/user/vip/buy-vip?shopId=" + orderVIP.value.shopId,
// });
// uni.pro.navigateTo('user/member/index', {
// shopId: orderVIP.value.shopId