This commit is contained in:
whitechiina 2025-03-31 16:49:54 +08:00
parent 85e3f519f9
commit c7c2f0d172
24 changed files with 144 additions and 22 deletions

View File

@ -1,2 +1,2 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>消费补贴卡</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><script src="https://h5.dhcc.wang/api/apilink-native.min.js?v=20200701"></script><link rel=stylesheet href=/privilege/static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/privilege/static/js/chunk-vendors.2a9d3084.js></script><script src=/privilege/static/js/index.b7ab9214.js></script></body></html>
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><script src="https://h5.dhcc.wang/api/apilink-native.min.js?v=20200701"></script><link rel=stylesheet href=/privilege/static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/privilege/static/js/chunk-vendors.2a9d3084.js></script><script src=/privilege/static/js/index.102af1d2.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,124 @@ import {
} from '@/request/pay/index.js';
class Payment {
static order_sn = 0
/**
* @param {String} pay_price 支付金额
* @param {String} order_sn 订单号
* @param {String} type 支付类型
* @param {String} return_url 支付时H5内部跳转路径
* @param {String} redirect 是否关闭调起支付的页面
* 该方法没有支付失败和成功回调函数必须由微信支付完成之后跳转至指定页面去查询订单状态然后根据订单状态再跳转值业务页面
*/
H5TOWX_Payment(data) {
uni.showLoading({
title: '支付中...'
});
const {
datas,
return_url,
redirect=false,
PAY_TYPE='1',
success = () => {},
file = () => {}
} = data;
// if (!pay_price) throw new Error('缺少支付金额');
// if (!order_sn) throw new Error('缺少订单号');
// if (!type) throw new Error('缺少支付类型');
// 下单信息
const OrderData = datas;
// 判断是微信支付还是支付宝支付
if(PAY_TYPE == '1'){
// 微信内嵌WEBVIEW方式进入H5页面
if(getApp()['globalData']['parameters']?.isWechat){
OrderData['WechatRetreat'] = true;
// 先跳转至微信支付页面
try{
// wx.miniProgram.navigateTo({
// url: `/pages/wxpay/h5pay/h5pay?data=${encodeURIComponent(JSON.stringify(OrderData))}`
// });
wx.miniProgram.navigateTo({
url: `/pages/extension/shop/wxPay/wxPay?data=${encodeURIComponent(JSON.stringify(OrderData))}`
}); // Jin
// 延迟两秒后H5内部跳转
setTimeout(()=>{
uni.hideLoading();
if(return_url){
// 是否需要关闭调起支付的页面
if(redirect){
uni.redirectTo({
url:return_url
});
}else{
uni.navigateTo({
url:return_url
})
}
}
},2000)
}catch(e){
uni.hideLoading();
//TODO handle the exception
uni.showToast({
title:'支付错误',
icon:'none'
})
}
}else{
OrderData['WechatRetreat'] = false;
openMiniProgram({
path: `pages/wxpay/h5pay/h5pay?data=${encodeURIComponent(JSON.stringify(OrderData))}`,
id: 'gh_faaea9b90759',
// type: 'release',
type: 'preview'
})
// 其他方式进入H5页面(APP)
// 反之使用跳转连接进入
// makeMinUrlAPI({
// path :'/pages/wxpay/h5pay/h5pay',
// query:`data=${encodeURIComponent(JSON.stringify(OrderData))}`,
// // uu_id:17551,
// // release 正式版
// // trial 测试版
// // develop 开发板
// env_version:'develop',
// }).then(res=>{
// // console.log(res);
// console.log(res['data']['openlink'],'openlink');
// // return
// location.href = res['data']['openlink'];
// // 延迟两秒后H5内部跳转
setTimeout(()=>{
uni.hideLoading();
if(return_url){
// 是否需要关闭调起支付的页面
if(redirect){
uni.redirectTo({
url:return_url
});
}else{
uni.navigateTo({
url:return_url
})
}
}
},2000)
// })
}
}else{
OrderData['WechatRetreat'] = true;
window.location.href=`https://ds.alipay.com/?scheme=${encodeURIComponent(`alipays://platformapi/startapp?appId=2021003130603407&page=pages/wxpay/h5pay/h5pay?data=${encodeURIComponent(JSON.stringify(OrderData))}`)}`
// window.location.href = `https://ds.alipay.com/?scheme=alipays://platformapi/startapp?appId=2021003130603407&page=pages/wxpay/h5pay/h5pay?data=${encodeURIComponent(JSON.stringify(OrderData))}`;
// 支付宝支付
// this.WX_Pay(data);
}
}
/**
* @param {String} pay_price 支付金额
* @param {String} order_sn 订单号

View File

@ -10,7 +10,7 @@ import {
WXpayH5API
} from '@/request/recharge/index.js';
import {
createOrderNewAPI,
// createOrderNewAPI,
agOrderPayAPI,
} from '@/request/restaurant/index.js';
// 获取配置文件

View File

@ -12,7 +12,7 @@ import {
} from 'vuex';
// 请求
import {
createOrderNewAPI,
// createOrderNewAPI,
agOrderPayAPI,
computedOfflineOrder
} from '@/request/restaurant/index.js';
@ -311,8 +311,12 @@ const restaurantmixins = {
// 佣金计算
computedOfflineOrder(this.FormInfor).then(res => {
this.computedTotal = res.data;
}).catch(res => {
this.computedTotal = res.data;
if (!res.data.used_broker) {
this.use_broker = false
};
if (!res.data.used_coin) {
this.use_coin = false
}
})
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long