fix: 修改部分参数

This commit is contained in:
whitechiina 2025-04-02 17:21:02 +08:00
parent 59dac8d2a0
commit ea0e446938
4 changed files with 165 additions and 71 deletions

View File

@ -251,16 +251,15 @@
}catch(e){ }catch(e){
//TODO handle the exception //TODO handle the exception
} }
console.log(this['Infos'])
let price = +this['Infos']['pay_price'] + skupay; let price = +this['Infos']['price'] + skupay;
// //
// this['skuinfor']['add_price'] = skupay; // this['skuinfor']['add_price'] = skupay;
// //
// this['skuinfor']['adj_pay'] = price; // this['skuinfor']['adj_pay'] = price;
// //
// this.$set(this['skuinfor'], 'adj_pay', price); this.$set(this['skuinfor'], 'adj_pay', price);
this.$set(this['skuinfor'], 'adj_pay', product_price);
// //
this.$set(this['skuinfor'], 'add_price', skupay); this.$set(this['skuinfor'], 'add_price', skupay);
// //
@ -378,6 +377,8 @@
// //
this.$set(this['skuinfor'],'sku',`${this['Infos']['sku']}/${this['Infos']['accessories']}`); this.$set(this['skuinfor'],'sku',`${this['Infos']['sku']}/${this['Infos']['accessories']}`);
this.$set(this['skuinfor'],'sku_code',`${this['Infos']['code']}|${_ACCCODE}`); this.$set(this['skuinfor'],'sku_code',`${this['Infos']['code']}|${_ACCCODE}`);
console.log('111111111')
}, },
} }
} }

View File

@ -37,7 +37,7 @@
{{item['pay_price']}} {{item['pay_price']}}
</view> </view>
<view class="num" v-else-if="!item['original_price'] && (BrandInfor['brand_id'] == 13 || BrandInfor['brand_id'] == 1)"> <view class="num" v-else-if="!item['original_price'] && (BrandInfor['brand_id'] == 13 || BrandInfor['brand_id'] == 1)">
<text class="now">{{item['user_price'] * (item['num']?item['num']:item['amount'])}}</text> <text class="now">{{item['bt_price'] * (item['num']?item['num']:item['amount'])}}</text>
<text class="last">{{item['pay_price'] * (item['num']?item['num']:item['amount'])}}</text> <text class="last">{{item['pay_price'] * (item['num']?item['num']:item['amount'])}}</text>
</view> </view>
<view class="num" v-else-if="!item['original_price'] && BrandInfor['brand_id'] == 10"> <view class="num" v-else-if="!item['original_price'] && BrandInfor['brand_id'] == 10">

View File

@ -51,7 +51,7 @@
<view class="Commodity-Item" @tap="ischoiceDiscount(item,index)"> <view class="Commodity-Item" @tap="ischoiceDiscount(item,index)">
<b-rx-commodity-item :item="item" :key='index'></b-rx-commodity-item> <b-rx-commodity-item :item="item" :key='index'></b-rx-commodity-item>
<!-- 优惠 --> <!-- 优惠 -->
<view class="discount" v-if="item['max_deduction'] && item['max_deduction'] > 0"> <!-- <view class="discount" v-if="item['max_deduction'] && item['max_deduction'] > 0">
<view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox':item['is_deduction']?true:false}"></view> <view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox':item['is_deduction']?true:false}"></view>
<view> <view>
<view class="Deduction-amount"> <view class="Deduction-amount">
@ -60,7 +60,7 @@
<view class="Insufficient" v-if="item['Discountarrcondition']"> <view class="Insufficient" v-if="item['Discountarrcondition']">
您余额不足实际可抵扣{{_amount(item['already_deduction_amount'])}}</view> 您余额不足实际可抵扣{{_amount(item['already_deduction_amount'])}}</view>
</view> </view>
</view> </view> -->
</view> </view>
</template> </template>
</view> </view>
@ -78,19 +78,19 @@
<view class="Commodity Commodity-Item" style="margin-bottom: 0rpx; padding-bottom: 0rpx; padding-top: 0rpx" @click="isBroker()"> <view class="Commodity Commodity-Item" style="margin-bottom: 0rpx; padding-bottom: 0rpx; padding-top: 0rpx" @click="isBroker()">
<view class="discount" style="width: 100%; display: flex; justify-content: space-between"> <view class="discount" style="width: 100%; display: flex; justify-content: space-between">
<view> <view>
<text lines="1" class="quantity">抵用券</text> <text lines="1" class="quantity">余额</text>
<text lines="1" class="amount">( 余额{{ computedTotal.broker_balance }} )</text> <text lines="1" class="amount">({{ computedTotal.broker_balance }} )</text>
</view> </view>
<view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox': use_coin? true : false}"></view> <view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox': use_broker? true : false}"></view>
</view> </view>
</view> </view>
<view class="Commodity Commodity-Item" @click="isCoin()"> <view class="Commodity Commodity-Item" @click="isCoin()">
<view class="discount" style="width: 100%; display: flex; justify-content: space-between"> <view class="discount" style="width: 100%; display: flex; justify-content: space-between">
<view> <view>
<text lines="1" class="quantity">余额</text> <text lines="1" class="quantity">抵用券</text>
<text lines="1" class="amount">( 余额{{ computedTotal.coin_balance }} )</text> <text lines="1" class="amount">({{ computedTotal.coin_balance }} )</text>
</view> </view>
<view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox': use_broker? true : false}"></view> <view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox': use_coin? true : false}"></view>
</view> </view>
</view> </view>
@ -124,7 +124,6 @@
</button> </button>
</view> </view>
<!-- 确认门店信息 --> <!-- 确认门店信息 -->
<u-modal :show="show" title="请确认自取门店" closeOnClickOverlay @close="show = false"> <u-modal :show="show" title="请确认自取门店" closeOnClickOverlay @close="show = false">
<template v-slot:default> <template v-slot:default>
@ -165,11 +164,11 @@
<view class="zero-content"> <view class="zero-content">
<view class="item flex"> <view class="item flex">
<text>抵用券</text> <text>抵用券</text>
<text class="blod">{{computedTotal.broker_balance}}</text> <text class="blod">{{computedTotal.used_broker}}</text>
</view> </view>
<view class="item flex"> <view class="item flex">
<text>余额</text> <text>余额</text>
<text class="blod">{{computedTotal.coin_balance}}</text> <text class="blod">{{computedTotal.used_coin}}</text>
</view> </view>
<view class="know"> <view class="know">
<view class="left"> <view class="left">
@ -269,8 +268,8 @@
shoptotalnum: 0, shoptotalnum: 0,
computedTotal: {}, computedTotal: {},
use_coin: 0, use_coin: false,
use_broker: 0, use_broker: false,
}; };
}, },
@ -362,11 +361,13 @@
// 使 // 使
isCoin() { isCoin() {
this.use_coin = !this.use_coin; this.use_coin = !this.use_coin;
if (this.use_broker) this.use_broker = false;
this.getCart() this.getCart()
}, },
isBroker() { isBroker() {
this.use_broker = !this.use_broker; this.use_broker = !this.use_broker;
if (this.use_coin) this.use_coin = false;
this.getCart() this.getCart()
}, },
@ -752,7 +753,7 @@
// //
.Commodity-Item { .Commodity-Item {
margin-bottom: 20rpx; // margin-bottom: 20rpx;
padding: 32rpx 0; padding: 32rpx 0;
// //

View File

@ -13,7 +13,7 @@
<!-- 商品列表 --> <!-- 商品列表 -->
<view class="box_3"> <view class="box_3">
<text lines="1" class="text_5">餐品详情.</text> <text lines="1" class="text_5">餐品详情</text>
<template v-for="(item,index) in FormInfor['products']"> <template v-for="(item,index) in FormInfor['products']">
<view class="commodity-item" :key="index" @tap="ischoiceDiscount(index)"> <view class="commodity-item" :key="index" @tap="ischoiceDiscount(index)">
<!-- 商品 --> <!-- 商品 -->
@ -33,13 +33,13 @@
<text lines="1" class="text_15" v-if="item['Discountarrcondition']" :class="`themeColor-${BrandInfor['brand_id']}`">您余额不足实际可抵扣{{_amount(item['already_deduction_amount'])}}</text> <text lines="1" class="text_15" v-if="item['Discountarrcondition']" :class="`themeColor-${BrandInfor['brand_id']}`">您余额不足实际可抵扣{{_amount(item['already_deduction_amount'])}}</text>
</view> --> </view> -->
<!-- 肯德基 --> <!-- 肯德基 -->
<view class="triangle" v-if="BrandInfor['brand_id'] == 1" :style="{'--color':'#C63836'}" <!-- <view class="triangle" v-if="BrandInfor['brand_id'] == 1" :style="{'--color':'#C63836'}"
v-show="item['is_deduction']"> v-show="item['is_deduction']">
</view> </view> -->
<!-- 麦当劳 --> <!-- 麦当劳 -->
<view class="triangle" v-if="BrandInfor['brand_id'] == 5" :style="{'--color':'#FFBC0D'}" <!-- <view class="triangle" v-if="BrandInfor['brand_id'] == 5" :style="{'--color':'#FFBC0D'}"
v-show="item['is_deduction']"> v-show="item['is_deduction']">
</view> </view> -->
</view> </view>
<view class="text-group_2" v-if="index == FormInfor['products']['length']-1"> <view class="text-group_2" v-if="index == FormInfor['products']['length']-1">
<!-- <text lines="1" class="text_16">余额{{ _amount(amount)}}</text> --> <!-- <text lines="1" class="text_16">余额{{ _amount(amount)}}</text> -->
@ -93,8 +93,8 @@
<view class="Commodity Commodity-Item" style="margin-bottom: 0rpx; padding-bottom: 0rpx; padding-top: 0rpx" @click="isBroker()"> <view class="Commodity Commodity-Item" style="margin-bottom: 0rpx; padding-bottom: 0rpx; padding-top: 0rpx" @click="isBroker()">
<view class="discount" style="width: 100%; display: flex; justify-content: space-between"> <view class="discount" style="width: 100%; display: flex; justify-content: space-between">
<view> <view>
<text lines="1" class="quantity">抵用券</text> <text lines="1" class="quantity">余额</text>
<text lines="1" class="amount">( 余额{{ computedTotal.broker_balance }} )</text> <text lines="1" class="amount">({{ computedTotal.broker_balance }} )</text>
</view> </view>
<view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox': use_broker? true : false}"></view> <view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox': use_broker? true : false}"></view>
</view> </view>
@ -102,8 +102,8 @@
<view class="Commodity Commodity-Item" @click="isCoin()"> <view class="Commodity Commodity-Item" @click="isCoin()">
<view class="discount" style="width: 100%; display: flex; justify-content: space-between"> <view class="discount" style="width: 100%; display: flex; justify-content: space-between">
<view> <view>
<text lines="1" class="quantity">余额</text> <text lines="1" class="quantity">抵用券</text>
<text lines="1" class="amount">( 余额{{ computedTotal.coin_balance }} )</text> <text lines="1" class="amount">({{ computedTotal.coin_balance }} )</text>
</view> </view>
<view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox': use_coin? true : false}"></view> <view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox': use_coin? true : false}"></view>
</view> </view>
@ -131,6 +131,47 @@
<text lines="1" class="text_29">结算</text> <text lines="1" class="text_29">结算</text>
</button> </button>
</view> </view>
<!-- 0元购提示信息 -->
<u-modal :show="zeroshow" title="确认订单" closeOnClickOverlay @close="zeroshow = false">
<template v-slot:default>
<view>
<view class="zero-content">
<view class="item flex">
<text>抵用券</text>
<text class="blod">{{computedTotal.used_broker}}</text>
</view>
<view class="item flex">
<text>余额</text>
<text class="blod">{{computedTotal.used_coin}}</text>
</view>
<view class="know">
<view class="left">
<view class="blod">
实付
</view>
<view class="point" v-if="computedTotal.integral > 0">
获得{{computedTotal.integral}} 积分
</view>
</view>
<view class="right blod">
{{computedTotal.real_pay_price}}
</view>
</view>
</view>
</view>
</template>
<template v-slot:confirmButton>
<view class="confirmButton">
<view class="btn replace" @tap="zeroshow = false" :style="{border:`1rpx solid ${Brand()['ThemeColor']}`}">
取消
</view>
<view class="btn confirm" @tap="surePay" :style="Brand()['customStyle']['BtnStyle'][0]">
确定
</view>
</view>
</template>
</u-modal>
</view> </view>
</template> </template>
@ -153,6 +194,7 @@
data() { data() {
return { return {
show: true, show: true,
zeroshow: false,
FormInfor: { FormInfor: {
// id // id
brand_id: 0, brand_id: 0,
@ -304,46 +346,45 @@
}) })
return return
}; };
console.log(FormInfor['products'], 'products');
// 0
if (this.computedTotal.real_pay_price == 0) {
this['zeroshow'] = true
} else {
this.confirmClick();
}
},
confirmClick() {
let FormInfor = JSON.parse(JSON.stringify(self['FormInfor']))
if (typeof FormInfor['products'] == 'object') { if (typeof FormInfor['products'] == 'object') {
FormInfor['products'] = JSON.stringify(FormInfor['products']) FormInfor['products'] = JSON.stringify(FormInfor['products'])
} }
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}); });
console.log(FormInfor, 'FormInfor');
// return
// createOrderNewAPI(FormInfor).then(res => {
// uni.hideLoading();
// this.$Payment.H5_Payment({
// pay_price: res['data']['pay_price'],
// order_sn: res['data']['order_sn'],
// type: res['data']['type'],
// openid: res['data']['openid'],
// return_url: `/pages/restaurant/order/order-status/order-status?order_sn=${res['data']['order_sn']}`
// });
// //
// // this.payment({
// // order_sn:res['data']['order_sn'],
// // type:res['data']['type'],
// // //
// // money:res['data']['money'],
// // redirect_url:`/pages/restaurant/order/order-status/order-status`
// // });
// })
FormInfor.phone = FormInfor.phone_number; FormInfor.phone = FormInfor.phone_number;
FormInfor.products = JSON.parse(FormInfor.products) FormInfor.products = JSON.parse(FormInfor.products)
createFoodOrder(FormInfor).then(res => { createFoodOrder(FormInfor).then(res => {
uni.hideLoading(); uni.hideLoading();
this.$Payment.H5TOWX_Payment({ let redirect_url = '/pages/restaurant/order/order-details/details';
pay_price: res['data']['pay_price'], uni.hideLoading();
order_sn: res['data']['order_sn'],
type: res['data']['type'], if (res.data.is_zero_pay) {
openid: res['data']['openid'], uni.showLoading({ title: '支付成功, 跳转订单页' });
return_url: `/pages/restaurant/order/order-status/order-status?order_sn=${res['data']['order_sn']}` setTimeout(() => {
}); wx.miniProgram.navigateTo({
url: `/pages/goods/order_list/index`
});
}, 1000)
} else {
this.$Payment.H5TOWX_Payment({
datas: res['data'],
shopInfo: FormInfor.products,
return_url:`/pages/restaurant/order/order-details/details?order_sn=${res.data.order_sn}`
});
}
}) })
}, },
@ -351,7 +392,7 @@
* @商品是否优惠 * @商品是否优惠
* */ * */
ischoiceDiscount(index) { ischoiceDiscount(index) {
let current = this['FormInfor']['products'][index]; // let current = this['FormInfor']['products'][index];
// 0 // 0
// JIN // JIN
// if (this['amount'] == 0 && !current['is_deduction']) { // if (this['amount'] == 0 && !current['is_deduction']) {
@ -362,7 +403,7 @@
// return // return
// } // }
// //
current['is_deduction'] = current['is_deduction'] ? 0 : 1; // current['is_deduction'] = current['is_deduction'] ? 0 : 1;
}, },
} }
} }
@ -933,4 +974,55 @@
background-color: #ffffff; background-color: #ffffff;
padding: 32rpx; padding: 32rpx;
} }
.confirmButton {
display: flex;
justify-content: space-between;
align-items: center;
.replace {
border: 1rpx solid #000;
color: #000;
}
.confirm {
background: #00AF66;
color: #ffffff;
}
.btn {
width: 230rpx;
height: 86rpx;
font-size: 30rpx;
line-height: 86rpx;
text-align: center;
border-radius: 43rpx;
}
}
.zero-content {
display: flex;
flex-direction: column;
width: 500rpx;
font-size: 28rpx;
.item {
width: 500rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30rpx;
}
.know {
border-top: 1rpx solid gray;
padding-top: 40rpx;
width: 500rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.blod {
font-size: 32rpx;
font-weight: bold;
}
}
</style> </style>