功能完善
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user