订单相关修改同步test

This commit is contained in:
GaoHao
2024-10-16 09:05:52 +08:00
parent 3288d1ed9b
commit 3ad4d7af68
16 changed files with 363 additions and 4678 deletions

View File

@@ -55,7 +55,7 @@
<view class="tableName">
<view>桌号</view>
<view class="name">{{ shopTableInfo.name }} </view>
<view class="num" v-if="dinersNum">{{ dinersNum }}</view>
<view class="num" v-if="shopTableInfo&&shopTableInfo.seatNum">{{ shopTableInfo.seatNum }}</view>
</view>
</view>
</view>
@@ -75,7 +75,14 @@
</view>
<view class="price"> {{ item.totalAmount || item.priceAmount || 0}} </view>
</view>
<view class="cell-item" v-if="shopTableInfo&&shopTableInfo.seatNum&&sendType=='table'">
<view class="label">餐位费</view>
<view class="val">
<view>X{{shopTableInfo.seatNum}}</view>
<view style="font-size: 28rpx;"></view>
<view>{{(shopTableInfo.seatNum*storeInfo.tableFee).toFixed(2)}}</view>
</view>
</view>
<!-- <view class="favorable" v-for="(item,index) in favorable" :key="index">
<view class="favorable_left">
<image class="icon" :src="item.url" mode="aspectFill"/>
@@ -221,7 +228,6 @@
shopId: null,
storeInfo: {},
tableCode: null,
dinersNum: null,
}
},
computed: {
@@ -245,12 +251,11 @@
onLoad(e) {
console.log(e)
this.storeInfo = JSON.parse(decodeURIComponent(e.storeInfo));
this.shopId =this.storeInfo.shopId;
this.shopId = this.storeInfo.id;
this.listinfo.name = this.storeInfo.shopName;
this.listinfo.details = JSON.parse(e.cartLists).data;
this.listinfo.payAmount = JSON.parse(e.cartLists).amount;
if ( e.tableCode ) { this.tableCode = e.tableCode;}
if ( e.dinersNum ) { this.dinersNum = e.dinersNum;}
if ( this.storeInfo.eatModel.indexOf("dine-in") != -1 ) {
this.eatModel = "dine-in";
@@ -308,6 +313,7 @@
lat: uni.cache.get('getLocationstorage').lat ? uni.cache.get('getLocationstorage').lat :
'',
}
console.log(this.shopId)
if (this.tableCode) {params.code = this.tableCode}
if (this.shopId) {params.shopId = this.shopId}
let res = await this.api.productqueryShop(params)
@@ -428,7 +434,7 @@
type: this.is_type,
}
if ( this.eatModel == "dine-in" && this.tableCode ) { params.tableId = this.tableCode; }
if ( this.dinersNum ) { params.num = this.dinersNum; }
if ( this.shopTableInfo && this.shopTableInfo.seatNum ) { params.num = this.shopTableInfo.seatNum; }
let res = await this.api.choseEatModel(params)
this.listinfo.details = res.data.info;
this.listinfo.payAmount = res.data.amount;
@@ -546,8 +552,14 @@
"remark": this.remark,
})
console.log(res)
this.listinfoid = res.data.id
this.showpopupclickdd();
this.listinfoid = res.data.id;
if ( this.storeInfo.registerType == 'restaurant') {
uni.redirectTo({
url: '/pagesOrder/order_detail/index?orderId=' + this.listinfoid
});
} else {
this.showpopupclickdd();
}
},
/**
@@ -594,11 +606,11 @@
},
/**
* 微信支付
* 微信/支付宝支付
*/
async showpopupclickdds() {
let res = await this.api.payorderPay({
let res = await this.api.orderPay({
orderId: this.listinfoid,
// #ifdef MP-WEIXIN
payType: 'wechatPay',
@@ -610,9 +622,9 @@
}) //判断是否支付成功
if (res.code == 0) {
// #ifdef MP-WEIXIN
// 微信支付还是余额支付
uni.requestPayment({
// #ifdef MP-WEIXIN
provider: 'wxpay', //支付类型-固定值
partnerid: res.data.appId, // 微信支付商户号
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
@@ -620,61 +632,49 @@
package: res.data.package, // 固定值
signType: res.data.signType, //固定值
paySign: res.data.paySign, //签名
// #endif
// #ifdef MP-ALIPAY
provider: 'alipay', //支付类型-固定值
orderInfo: res.data.tradeNo, // 微信支付商户号
// #endif
success: (res) => {
let _this = this
uni.showToast({
title: "支付成功"
})
// #ifdef MP-WEIXIN
uni.requestSubscribeMessage({
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
complete() {
uni.showToast({
title: "支付成功"
})
// uni.cache.set('shopUser', '') //删除shopUser
_this.paymodfiyOrderInfo()
uni.redirectTo({
url: '/pagesOrder/order_detail/index?orderId=' + _this
.listinfoid
url: '/pagesOrder/order_detail/index?orderId=' + _this.listinfoid
});
},
})
},
fail: () => {
uni.pro.navigateTo('/pagesOrder/order_detail/index', {
orderId: this.listinfoid
})
uni.hideLoading()
}
});
// #endif
// #ifdef MP-ALIPAY
uni.requestPayment({
provider: 'alipay', //支付类型-固定值
orderInfo: res.data.tradeNo, // 微信支付商户号
success: (res) => {
let _this = this
// uni.requestSubscribeMessage({
// tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
// complete() {
// uni.showToast({
// title: "支付成功"
// })
// // uni.cache.set('shopUser', '') //删除shopUser
// },
// })
// #endif
// #ifdef MP-ALIPAY
_this.paymodfiyOrderInfo()
uni.redirectTo({
url: '/pagesOrder/order_detail/index?orderId=' + _this.listinfoid
});
// #endif
},
fail: () => {
fail: async () => {
let res = await this.api.cancelOrderPay({
orderId: this.listinfoid,
}) //判断是否支付成功
uni.pro.navigateTo('/pagesOrder/order_detail/index', {
orderId: this.listinfoid
})
uni.hideLoading()
}
});
// #endif
uni.hideLoading()
}
},
@@ -1135,6 +1135,34 @@
}
}
.cell-item{
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx 34rpx 32rpx 34rpx;
.label{
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
.val{
display: flex;
align-items: flex-end;
view:nth-child(1){
font-weight: 400;
font-size: 24rpx;
color: #999999;
margin-right: 42rpx;
}
view:nth-child(2){
display: flex;
align-items: flex-end;
font-weight: bold;
font-size: 36rpx;
color: #333333;
}
}
}
.totalPrice{
padding: 32rpx 30rpx;
box-sizing: border-box;
@@ -1269,15 +1297,12 @@
}
}
.paymentBtnText{
width: 216rpx;
height: 76rpx;
line-height: 76rpx;
background: #E8AD7B;
border-radius: 36rpx 36rpx 36rpx 36rpx;
border-radius: 36rpx;
font-weight: 400;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
padding: 14rpx 44rpx;
}
}
.page-total{