功能完善

This commit is contained in:
2024-04-13 17:20:09 +08:00
parent be328f9243
commit 23af4c25e3
15 changed files with 253 additions and 90 deletions

View File

@@ -26,7 +26,7 @@
</view>
<view class='bottom-view c-flex-row'>
<sqb-pay @bindnavigateTo='navigateTo'
<sqb-pay @navigateTo='navigateTo'
:return_url='buildSqbParams.return_url'
:total_amount='buildSqbParams.total_amount'
:terminal_sn='buildSqbParams.terminal_sn'
@@ -49,6 +49,7 @@ import { OrderBean } from '@/api/order/types';
import { parseParameter, sortASCII } from '@/utils';
import { hexMD5 } from '@/utils/common/md5';
import { useUserStore } from '@/store';
import { handlePayResult } from '@/utils/order';
const userState = useUserStore();
const { terminalInfo } = storeToRefs(userState);
@@ -78,11 +79,12 @@ const buildSqbParams = computed(() => {
});
const navigateTo = (e: any) => {
uni.redirectTo({
url: e.detail.url,
fail(e) {
uni.showToast({
title: '支付失败'
console.log('----------->>>>>navigateTo ', e);
handlePayResult(orderBean.value?.id, e, {
onSuccess: () => {
pay({
'orderId': orderBean.value?.id,
'result': 'xxx'
});
}
});
@@ -95,14 +97,8 @@ const payment = () => {
'terminal_key': terminalInfo.value.terminalKey,
'terminal_sn': terminalInfo.value.terminalSn
};
progress(params);
pay({
'orderId': orderBean.value?.id,
'result': '{payResult:xxx}'
});
};
</script>
<style lang='scss' scoped>