fix: 修改点餐部分问题

This commit is contained in:
whitechiina 2025-04-16 17:34:18 +08:00
parent 567b1e9d81
commit 6b835f5162
36 changed files with 175 additions and 56 deletions

View File

@ -59,13 +59,14 @@
</view>
</view>
</view>
<view style="height: 150rpx"></view>
<!-- 底部购物总计部分 -->
<view class="shoppingcart">
<view class="shoppingcart-left">
<view class="shoppingcart-left-price">
<text class="yang"></text>
<text class="amount">{{_amount(Selectedpay)}}</text>
<text class="amount">{{_amount(Selectedpay * 100)}}</text>
</view>
</view>
<view class="shoppingcart-right theme-Union-Class-5-1" @tap="Add">
@ -152,8 +153,12 @@
};
return 0
}).reduce((a, b) => a + b);
let price = (+this['InforData']['pay_price']) + _addpay;
// let price = (+this['InforData']['pay_price']) + _addpay;
let price = (+this['InforData']['product_price']) + _addpay;
console.log(price,'price');
// 使
// this['InforData']['adj_pay'] = (+this['InforData']['pay_price']);
this['InforData']['add_price'] = _addpay;

View File

@ -287,6 +287,7 @@
hasAssigned: false, //
YingPrice: 0 ,//
realPayment: 0, //
ZeroData: {}
};
},
onLoad() {

View File

@ -91,7 +91,7 @@
</view>
<!-- 新增计算抵扣逻辑 -->
<view class="Commodity Commodity-Item" style="margin-bottom: 0rpx; padding-bottom: 30rpx; padding-top: 0rpx" @click="isBroker()">
<view class="Commodity Commodity-Item" style="margin-bottom: 0rpx; padding-bottom: 30rpx; padding-top: 0rpx">
<view class="discount" style="width: 100%; display: flex; justify-content: space-between">
<text lines="1" class="quantity">应付</text>
<text lines="1" class="amount">{{ YingPrice }}</text>
@ -126,7 +126,7 @@
<view class="text-group_3">
<view class="text-wrapper_4 itemamount">
<text lines="1" class="text_24">实际付款</text>
<text lines="1" class="text_25" :style="{color:Brand()['ThemeColor']}">{{computedTotal.real_pay_price}}</text>
<text lines="1" class="text_25" :style="{color:Brand()['ThemeColor']}">{{realPayment}}</text>
</view>
<view class="text-wrapper_4 itemamount">
<text lines="1" class="text_24">积分</text>
@ -139,6 +139,39 @@
</button>
</view>
<!-- 确认门店信息 -->
<u-modal :show="show" title="请确认自取门店" closeOnClickOverlay @close="show = false">
<template v-slot:default>
<view class="default-content">
<view class="location-Img">
<image class="img" :src="qnyurl('map.png','xbk')" mode="aspectFit"></image>
</view>
<view class="shopInfor">
<view class="restaurant_name">
{{GetShopInfor['restaurant_name']}}
</view>
<view class="distance" :style="{color:Brand()['ThemeColor']}">
距离您{{GetShopInfor['distance']}}km
</view>
<view class="restaurant_address">
{{GetShopInfor['restaurant_address']}}
</view>
</view>
</view>
</template>
<template v-slot:confirmButton>
<view class="confirmButton">
<view class="btn replace" @tap="navigateBack(2, true, 0)"
:style="{border:`1rpx solid ${Brand()['ThemeColor']}`,color:Brand()['ThemeColor']}">
更换门店
</view>
<view class="btn confirm" @tap="confirmClick" :style="Brand()['customStyle']['BtnStyle'][0]">
就是这家
</view>
</view>
</template>
</u-modal>
<!-- 0元购提示信息 -->
<u-modal :show="zeroshow" title="确认订单" closeOnClickOverlay @close="zeroshow = false">
<template v-slot:default>
@ -147,15 +180,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="ZeroData.used_coin">-</text>
<text>{{ZeroData.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="ZeroData.used_broker">-</text>
<text>{{ZeroData.used_broker}}</text>
</text>
</view>
<view class="know">
@ -163,12 +196,12 @@
<view class="blod">
实付
</view>
<view class="point" v-if="computedTotal.integral > 0">
获得{{computedTotal.integral}} 积分
<view class="point" v-if="ZeroData.integral > 0">
获得{{ZeroData.integral}} 积分
</view>
</view>
<view class="right blod">
{{computedTotal.real_pay_price}}
{{realPayment}}
</view>
</view>
</view>
@ -209,7 +242,7 @@
data() {
return {
loading: true,
show: true,
show: false,
zeroshow: false,
FormInfor: {
// id
@ -255,7 +288,9 @@
use_coin: 0,
use_broker: 0,
hasAssigned: false, //
YingPrice: 0 //
YingPrice: 0, //
realPayment: 0, //
ZeroData: {}
};
},
onLoad() {
@ -367,20 +402,26 @@
};
// 0
if (this.computedTotal.real_pay_price == 0) {
if (this.realPayment == 0) {
this['zeroshow'] = true
} else {
this.confirmClick();
this['show'] = true;
}
},
// 0
surePay() {
this['zeroshow'] = false;
this['show'] = true;
},
confirmClick() {
let FormInfor = JSON.parse(JSON.stringify(self['FormInfor']))
if (typeof FormInfor['products'] == 'object') {
FormInfor['products'] = JSON.stringify(FormInfor['products'])
}
uni.showLoading({
title: '加载中...'
title: '支付中...'
});
FormInfor.phone = FormInfor.phone_number;
FormInfor.products = JSON.parse(FormInfor.products)
@ -406,6 +447,12 @@
shop: this.BrandInfor.brand_name,
id: this.BrandInfor.brand_id,
},
amountInfo: {
actualpayment: this.YingPrice, //
paymoney: this.realPayment, //
coin_balance: this.ZeroData.used_coin, //
broker_balance: this.ZeroData.used_broker //
},
payData: FormInfor,
HeadersData: this.GetShopInfor,
shopInfo: FormInfor.products,
@ -810,12 +857,12 @@
}
.text_22 {
width: 214rpx;
width: 300rpx;
height: auto;
color: rgba(153, 153, 153, 1);
font-size: 24rpx;
font-family: PingFang-SC-Medium;
text-align: left;
text-align: right;
white-space: nowrap;
line-height: 24rpx;
}
@ -1068,4 +1115,45 @@
top: 0;
z-index: 999;
}
.default-content {
display: flex;
.location-Img {
width: 70rpx;
height: 78rpx;
max-width: 70rpx;
max-height: 78rpx;
min-width: 70rpx;
min-height: 78rpx;
margin-right: 30rpx;
.img {
width: 100%;
height: 100%;
}
}
.shopInfor {
line-height: 40rpx;
.restaurant_name {
font-size: 32rpx;
color: #333333;
margin-bottom: 15rpx;
}
.distance {
font-size: 26rpx;
color: #00AF66;
margin-bottom: 15rpx;
}
.restaurant_address {
color: #999999;
font-size: 26rpx;
}
}
}
</style>

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.58ad7669.js></script></body></html>
<!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.48d1c479.js></script><script src=/privilege/static/js/index.45c60011.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

@ -28,6 +28,7 @@ class Payment {
shopInfo,
computedTotal,
GetShopInfor,
amountInfo,
return_url,
payData,
HeadersData,
@ -42,23 +43,41 @@ class Payment {
const ShopInfo = shopInfo;
// 判断是微信支付还是支付宝支付
console.log(store.getters.GetToken)
if(PAY_TYPE == '1'){
// 微信内嵌WEBVIEW方式进入H5页面
OrderData['WechatRetreat'] = true;
// 先跳转至微信支付页面
try{
// 地区码
data.HeadersData.adcode = state['getters']['GetcityInfor']['adcode']
// 地区码带入
if (data.HeadersData && state.getters?.GetcityInfor?.adcode) {
data.HeadersData.adcode = state.getters.GetcityInfor.adcode;
}
const navigateParams = {
data: OrderData,
shopInfo: shopInfo,
GetShopInfor: GetShopInfor,
amountInfo: amountInfo,
token: store.getters.GetToken,
payData: data.payData,
HeadersData: data.HeadersData
};
const queryString = Object.entries(navigateParams)
.map(([key, value]) => `${key}=${encodeURIComponent(JSON.stringify(value))}`)
.join('&');
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))}`
url: `/pages/extension/shop/wxPay/wxPay?${queryString}`
});
// 延迟两秒后H5内部跳转
setTimeout(()=>{
uni.hideLoading();
// 支付完成返回点餐首页
window.history.back();
// if(return_url){
// // 是否需要关闭调起支付的页面
// if(redirect){

View File

@ -311,13 +311,19 @@ const restaurantmixins = {
// 佣金计算
computedOfflineOrder(this.FormInfor).then(res => {
this.loading = false;
// 0元购弹窗数据
this.realPayment = res.data.real_pay_price;
this.ZeroData = res.data;
/*
* 仅赋值一次
*/
if (this.hasAssigned) return;
this.computedTotal = res.data;
if (!res.data.used_broker) {
this.use_broker = false
};
if (!res.data.used_coin) {
this.use_coin = false
}
this.YingPrice = res.data.real_pay_price;
this.hasAssigned = true;
}).catch(res => {
this.loading = false;
uni.showToast({

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

File diff suppressed because one or more lines are too long