新增瑞幸

This commit is contained in:
whitechiina 2025-04-03 22:48:39 +08:00
parent 4bd4c7778f
commit 02fb87bb48
40 changed files with 128 additions and 154 deletions

View File

@ -16,7 +16,6 @@
</view>
</template>
</u-modal>
</view>
</template>

View File

@ -165,15 +165,15 @@
<view class="item flex">
<text>抵用券抵扣</text>
<text class="blod">
<text v-if="computedTotal.used_broker">-</text>
<text>{{computedTotal.used_broker}}</text>
<text v-if="computedTotal.used_coin">-</text>
<text>{{computedTotal.used_coin}}</text>
</text>
</view>
<view class="item flex">
<text>余额抵扣</text>
<text class="blod">
<text v-if="computedTotal.used_coin">-</text>
<text>{{computedTotal.used_coin}}</text>
<text v-if="computedTotal.used_broker">-</text>
<text>{{computedTotal.used_broker}}</text>
</text>
</view>
<view class="know">
@ -203,6 +203,8 @@
</view>
</template>
</u-modal>
<view class="loading" v-show="loading"></view>
</view>
</template>
@ -218,6 +220,9 @@
getPhoneAPI,
createFoodOrder
} from '@/request/restaurant/index.js';
import {
mapGetters,
} from 'vuex';
//
import bRxCommodityItem from '@/components/b-rx-commodity-item/b-rx-commodity-item.vue'
let self;
@ -228,6 +233,7 @@
},
data() {
return {
loading: true,
show: false,
zeroshow: false,
FormInfor: {
@ -290,6 +296,14 @@
onShow() {
this.init();
},
computed: {
...mapGetters({
//
GetShopInfor: 'shopping/GetShopInfor',
// Id
BrandInfor: 'shopping/BrandInfor',
}),
},
methods: {
init() {
let newobj = JSON.parse(JSON.stringify(this['GetCartList2']));
@ -442,6 +456,13 @@
uni.showLoading({ title: '支付成功, 跳转订单页' });
this.$Payment.H5TOWX_Payment({
datas: res['data'],
GetShopInfor: {
name: this.GetShopInfor.restaurant_name,
shop: this.BrandInfor.brand_name,
id: this.BrandInfor.brand_id,
},
payData: from,
HeadersData: this.GetShopInfor,
shopInfo: from.products,
return_url:`/pages/restaurant/order/order-details/details?order_sn=${res.data.order_sn}`
});
@ -1039,4 +1060,17 @@
font-weight: bold;
}
}
.loading {
width: 100%;
height: 100%;
background-color: #000;
opacity: .5;
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 999;
}
</style>

View File

@ -4,6 +4,9 @@ import {
makeMinUrlAPI,
getPayParamsAPI
} from '@/request/pay/index.js';
import store from '@/store/index';
import state from '@/store/index';
class Payment {
static order_sn = 0
/**
@ -15,6 +18,7 @@ class Payment {
* 该方法没有支付失败和成功回调函数必须由微信支付完成之后跳转至指定页面去查询订单状态然后根据订单状态再跳转值业务页面
*/
H5TOWX_Payment(data) {
console.log(data, '111111')
uni.showLoading({
title: '支付中...'
});
@ -22,33 +26,35 @@ class Payment {
const {
datas,
shopInfo,
computedTotal,
GetShopInfor,
return_url,
payData,
HeadersData,
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;
const ShopInfo = shopInfo;
// 判断是微信支付还是支付宝支付
console.log(store.getters.GetToken)
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))}`
// });
// 地区码
data.HeadersData.adcode = state['getters']['GetcityInfor']['adcode']
console.log(data.HeadersData)
console.log(data.payData, '00000000000')
wx.miniProgram.navigateTo({
url: `/pages/extension/shop/wxPay/wxPay?data=${encodeURIComponent(JSON.stringify(OrderData))}&shopInfo=${encodeURIComponent(JSON.stringify(shopInfo))}`
url: `/pages/extension/shop/wxPay/wxPay?data=${encodeURIComponent(JSON.stringify(OrderData))}&shopInfo=${encodeURIComponent(JSON.stringify(shopInfo))}&GetShopInfor=${encodeURIComponent(JSON.stringify(GetShopInfor))}&token=${JSON.stringify(store.getters.GetToken)}&payData=${encodeURIComponent(JSON.stringify(data.payData))}&HeadersData=${encodeURIComponent(JSON.stringify(data.HeadersData))}`
});
// 延迟两秒后H5内部跳转
setTimeout(()=>{
@ -76,49 +82,6 @@ class Payment {
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)
// })
uni.hideLoading();
}
}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))}`)}`

View File

@ -310,6 +310,7 @@ const restaurantmixins = {
computedOrder() {
// 佣金计算
computedOfflineOrder(this.FormInfor).then(res => {
this.loading = false;
this.computedTotal = res.data;
if (!res.data.used_broker) {
this.use_broker = false
@ -317,6 +318,12 @@ const restaurantmixins = {
if (!res.data.used_coin) {
this.use_coin = false
}
}).catch(res => {
this.loading = false;
uni.showToast({
title:res,
icon:'none'
})
})
},

Binary file not shown.

Binary file not shown.

Binary file not shown.

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.71fe66c1.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.e3f766fd.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

@ -4,6 +4,9 @@ import {
makeMinUrlAPI,
getPayParamsAPI
} from '@/request/pay/index.js';
import store from '@/store/index';
import state from '@/store/index';
class Payment {
static order_sn = 0
/**
@ -15,6 +18,7 @@ class Payment {
* 该方法没有支付失败和成功回调函数必须由微信支付完成之后跳转至指定页面去查询订单状态然后根据订单状态再跳转值业务页面
*/
H5TOWX_Payment(data) {
console.log(data, '111111')
uni.showLoading({
title: '支付中...'
});
@ -22,51 +26,53 @@ class Payment {
const {
datas,
shopInfo,
computedTotal,
GetShopInfor,
return_url,
payData,
HeadersData,
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;
const ShopInfo = shopInfo;
// 判断是微信支付还是支付宝支付
console.log(store.getters.GetToken)
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))}&shopInfo=${encodeURIComponent(JSON.stringify(shopInfo))}`
});
// 地区码
data.HeadersData.adcode = state['getters']['GetcityInfor']['adcode']
console.log(data.HeadersData)
console.log(data.payData, '00000000000')
wx.miniProgram.navigateTo({
url: `/pages/extension/shop/wxPay/wxPay?data=${encodeURIComponent(JSON.stringify(OrderData))}&shopInfo=${encodeURIComponent(JSON.stringify(shopInfo))}&GetShopInfor=${encodeURIComponent(JSON.stringify(GetShopInfor))}&token=${JSON.stringify(store.getters.GetToken)}&payData=${encodeURIComponent(JSON.stringify(data.payData))}&HeadersData=${encodeURIComponent(JSON.stringify(data.HeadersData))}`
});
// 延迟两秒后H5内部跳转
// setTimeout(()=>{
// uni.hideLoading();
// if(return_url){
// // 是否需要关闭调起支付的页面
// if(redirect){
// uni.redirectTo({
// url:return_url
// });
// }else{
// uni.navigateTo({
// url:return_url
// })
// }
// }
// },2000)
setTimeout(()=>{
uni.hideLoading();
// if(return_url){
// // 是否需要关闭调起支付的页面
// if(redirect){
// uni.redirectTo({
// url:return_url
// });
// }else{
// uni.navigateTo({
// url:return_url
// })
// }
// }
uni.hideLoading();
},2000)
}catch(e){
console.log(e)
uni.hideLoading();
@ -76,48 +82,6 @@ class Payment {
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))}`)}`

View File

@ -310,6 +310,7 @@ const restaurantmixins = {
computedOrder() {
// 佣金计算
computedOfflineOrder(this.FormInfor).then(res => {
this.loading = false;
this.computedTotal = res.data;
if (!res.data.used_broker) {
this.use_broker = false
@ -317,6 +318,12 @@ const restaurantmixins = {
if (!res.data.used_coin) {
this.use_coin = false
}
}).catch(res => {
this.loading = false;
uni.showToast({
title:res,
icon:'none'
})
})
},

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

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

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