功能完善
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
:merchant_name='buildSqbParams.merchant_name'
|
||||
:notify_url='buildSqbParams.notify_url'
|
||||
:sign='buildSqbParams.sign'>
|
||||
<button class='primary-button' @click='goRecharge'>充值</button>
|
||||
<button class='primary-button'>充值</button>
|
||||
</sqb-pay>
|
||||
<!-- </payment-button>-->
|
||||
</view>
|
||||
@@ -68,7 +68,7 @@ const preRechargeOrderId = ref();
|
||||
onLoad(async () => {
|
||||
const { ruleitems } = await getRechargeList();
|
||||
rechargeItems.value = ruleitems;
|
||||
change(0);
|
||||
await change(0);
|
||||
});
|
||||
|
||||
const change = async (index: number) => {
|
||||
@@ -96,10 +96,17 @@ const buildSqbParams = computed(() => {
|
||||
});
|
||||
|
||||
const navigateTo = (e: any) => {
|
||||
console.log('--------------_>>>>>>navigateTo ', e);
|
||||
handlePayResult(preRechargeOrderId.value, e, {
|
||||
onSuccess: () => {
|
||||
onSuccess: async () => {
|
||||
console.log('---------->>> recharge success ');
|
||||
await goRecharge();
|
||||
await userState.setUserInfo({
|
||||
...userInfo.value,
|
||||
balance: Number(userInfo.value.balance) + Number(rechargeItems.value[currentIndex.value].rechargeamount) + Number(rechargeItems.value[currentIndex.value]?.rewardamount)
|
||||
});
|
||||
},
|
||||
onFailure: () => {
|
||||
console.log('---------->>> recharge failure ');
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -109,7 +116,7 @@ const goRecharge = async () => {
|
||||
const result = await recharge({
|
||||
itemid: rechargeItems.value[currentIndex.value].itemid
|
||||
});
|
||||
console.log('---------->>> recharge result ', result);
|
||||
console.log('platform recharge result ', result);
|
||||
|
||||
await rechargeVerify({
|
||||
payid: preRechargeOrderId.value
|
||||
|
Reference in New Issue
Block a user