小程序充值默认选中微信支付

This commit is contained in:
lxy 2025-05-12 18:43:05 +08:00
parent 6b0308e070
commit b505e9db4b
2 changed files with 20 additions and 4 deletions

View File

@ -30,11 +30,19 @@ export default OakComponent({
},
lifetimes: {
ready() {
const { depositMinCent } = this.props;
const { depositMinCent, channel, onSetChannel } = this.props;
if (depositMinCent) {
this.onPriceChange(ToYuan(depositMinCent), true);
}
}
if (!channel && process.env.OAK_PLATFORM === 'wechatMp') {
//小程序环境下默认选择微信支付
const { payChannels } = this.state;
const wpProduct = payChannels?.find((ele) => ele.entity === 'wpProduct');
if (wpProduct) {
onSetChannel && onSetChannel(wpProduct);
}
}
},
},
listeners: {
price() {

View File

@ -33,11 +33,19 @@ export default OakComponent({
},
lifetimes: {
ready() {
const { depositMinCent } = this.props;
const { depositMinCent, channel, onSetChannel } = this.props;
if (depositMinCent) {
this.onPriceChange(ToYuan(depositMinCent), true);
}
}
if (!channel && process.env.OAK_PLATFORM === 'wechatMp') {
//小程序环境下默认选择微信支付
const { payChannels } = this.state;
const wpProduct = payChannels?.find((ele: PayChannel) => ele.entity === 'wpProduct');
if (wpProduct) {
onSetChannel && onSetChannel(wpProduct);
}
}
},
},
listeners: {
price() {