支付回调链接encodeURIComponent一下
This commit is contained in:
parent
2213052b05
commit
4d0d1af253
|
@ -47,6 +47,8 @@
|
|||
}
|
||||
emits('pay-event', props.detail);
|
||||
}
|
||||
|
||||
|
||||
function goDetail(e){
|
||||
emits('detail-event', props.detail);
|
||||
}
|
||||
|
@ -106,10 +108,11 @@
|
|||
}
|
||||
.amount{
|
||||
color: #333333;
|
||||
font-weight: 400;
|
||||
font-weight: bold;
|
||||
font-size:24rpx;
|
||||
text:nth-child(1){
|
||||
font-size:20rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
text:nth-child(2){
|
||||
font-size:22rpx;
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
<view class="brand">{{ config[detail.brandFlag].name}}</view>
|
||||
<view class="name">{{ detail.voucherTitle }}</view>
|
||||
<view class="flex flex-justify-between flex-items-end">
|
||||
<view class="price">{{ detail.voucherOriginalPrice }}<text>元</text>
|
||||
<view class="price">{{ detail.voucherAmount }}<text>元</text>
|
||||
</view>
|
||||
<view class="ori">{{ detail.voucherAmount }}</view>
|
||||
<view class="ori">{{ detail.voucherOriginalPrice }}</view>
|
||||
</view>
|
||||
<view class="btn flex flex-justify-center flex-items-center">
|
||||
<view class="btn-content flex flex-justify-center flex-items-center" @click="goBuy">点击购买</view>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import md5 from 'js-md5';
|
||||
export default function useCode(){
|
||||
return new Promise((resolve,reject) => {
|
||||
window.authCallback = (params) => {
|
||||
const authCallback = (params) => {
|
||||
console.log('authCallback-use',params);
|
||||
const {code} = params
|
||||
resolve(code)
|
||||
|
@ -23,6 +23,7 @@ export default function useCode(){
|
|||
console.log('auth-param157-use',param);
|
||||
Fw.device.api.getNewAuthorization(param)
|
||||
};
|
||||
window.authCallback = authCallback;
|
||||
getNewAuthorization()
|
||||
})
|
||||
}
|
|
@ -17,7 +17,8 @@ export default function usePay(){
|
|||
MercUrl:notify_url,
|
||||
TranAmt:Number(voucherAmount).toFixed(2),
|
||||
TermSsn:order_no,
|
||||
BackLink:`${window.location.origin}/#/pages/ycnc/orderDetail?order_no=${order_no}`,
|
||||
// BackLink:`${window.location.origin}/#/pages/ycnc/orderDetail?order_no=${order_no}`,
|
||||
BackLink:encodeURIComponent(`${window.location.origin}/#/pages/ycnc/orderDetail?order_no=${order_no}`),
|
||||
psbcmcc:'LSXD',
|
||||
TxnDt:dayjs(Date.now()).format('YYYY-MM-DD'),
|
||||
MercCode:'100610100019029'
|
||||
|
|
|
@ -66,44 +66,17 @@
|
|||
})
|
||||
};
|
||||
|
||||
// window.authCallback = (params) => {
|
||||
// console.log('authCallback-index',params);
|
||||
// const {code} = params
|
||||
// login({params:{code:code}}).then(res=>{
|
||||
// uni.setStorageSync('token',res.token)
|
||||
// })
|
||||
// }
|
||||
|
||||
// const getNewAuthorization = () => {
|
||||
// let appId = import.meta.env.VITE_YCNC_APPID;
|
||||
// let time = Date.now().toString();
|
||||
// let secret = import.meta.env.VITE_YCNC_SECRET;
|
||||
// let signBefore = appId + time + secret;
|
||||
// let sign = md5(signBefore);//普通md5
|
||||
// let param = {
|
||||
// appId: appId,
|
||||
// sign: sign,
|
||||
// time: time,
|
||||
// tran_code: "157",
|
||||
// fn: "authCallback",
|
||||
// needBind: ""
|
||||
// };
|
||||
// console.log('auth-param157-index',param);
|
||||
// Fw.device.api.getNewAuthorization(param)
|
||||
// };
|
||||
|
||||
onMounted(async ()=>{
|
||||
queryProducts();
|
||||
// let testToken = import.meta.env.VITE_TEST_TOKEN
|
||||
// uni.setStorageSync('token',testToken)
|
||||
const token = uni.getStorageSync('token') || '';
|
||||
console.log('是否有token',!!token);
|
||||
if(!token){
|
||||
console.log('进入登录过程');
|
||||
const code = await useCode();
|
||||
authCode.value = code
|
||||
const {token} = await login({params:{code:unref(authCode)}});
|
||||
uni.setStorageSync('token',token);
|
||||
// getNewAuthorization()
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
}
|
||||
|
||||
function pay(orderData){
|
||||
console.log(orderData);
|
||||
const {order_no,notify_url,price} = orderData;
|
||||
const {payFunc} = usePay();
|
||||
payFunc({order_no,notify_url,price})
|
||||
|
|
|
@ -53,6 +53,8 @@
|
|||
const orderDetail = reactive({});
|
||||
|
||||
onLoad((options) => {
|
||||
console.log('href',window.location.href);
|
||||
console.log('options',options);
|
||||
const {order_id,order_no} = options;
|
||||
id.value = order_id
|
||||
orderNo.value = order_no
|
||||
|
|
|
@ -47,12 +47,12 @@ export default defineConfig(({ command, mode }) => {
|
|||
uni(),
|
||||
UnoCSS(),
|
||||
// copyFile(),
|
||||
// zipPack({
|
||||
// inDir: `dist/build/${UNI_PLATFORM}`, // 输入的文件夹,就是要打包的文件夹
|
||||
// outDir: `dist/build`, // 打包好的 zip 文件放到哪个文件夹下
|
||||
// outFileName: `${UNI_PLATFORM}-${timeStringNow}.zip`, //文件名不能包含\/:*?"<>|
|
||||
// pathPrefix: ''
|
||||
// }),
|
||||
zipPack({
|
||||
inDir: `dist/build/${UNI_PLATFORM}`, // 输入的文件夹,就是要打包的文件夹
|
||||
outDir: `dist/build`, // 打包好的 zip 文件放到哪个文件夹下
|
||||
outFileName: `${UNI_PLATFORM}-${timeStringNow}.zip`, //文件名不能包含\/:*?"<>|
|
||||
pathPrefix: ''
|
||||
}),
|
||||
]
|
||||
}
|
||||
})
|
Loading…
Reference in New Issue