fix: 修改部分参数
This commit is contained in:
parent
59dac8d2a0
commit
ea0e446938
|
|
@ -251,16 +251,15 @@
|
|||
}catch(e){
|
||||
//TODO handle the exception
|
||||
}
|
||||
|
||||
let price = +this['Infos']['pay_price'] + skupay;
|
||||
console.log(this['Infos'])
|
||||
let price = +this['Infos']['price'] + skupay;
|
||||
|
||||
// 加价价格
|
||||
// this['skuinfor']['add_price'] = skupay;
|
||||
// 实际价格
|
||||
// this['skuinfor']['adj_pay'] = price;
|
||||
// 加价价格
|
||||
// this.$set(this['skuinfor'], 'adj_pay', price);
|
||||
this.$set(this['skuinfor'], 'adj_pay', product_price);
|
||||
this.$set(this['skuinfor'], 'adj_pay', price);
|
||||
// 实际价格
|
||||
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_code',`${this['Infos']['code']}|${_ACCCODE}`);
|
||||
|
||||
console.log('111111111')
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
¥{{item['pay_price']}}
|
||||
</view>
|
||||
<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>
|
||||
</view>
|
||||
<view class="num" v-else-if="!item['original_price'] && BrandInfor['brand_id'] == 10">
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
<view class="Commodity-Item" @tap="ischoiceDiscount(item,index)">
|
||||
<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>
|
||||
<view class="Deduction-amount">
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
<view class="Insufficient" v-if="item['Discountarrcondition']">
|
||||
您余额不足,实际可抵扣¥{{_amount(item['already_deduction_amount'])}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
|
@ -78,19 +78,19 @@
|
|||
<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>
|
||||
<text lines="1" class="quantity">抵用券</text>
|
||||
<text lines="1" class="amount">( 余额:¥{{ computedTotal.broker_balance }} )</text>
|
||||
<text lines="1" class="quantity">余额:</text>
|
||||
<text lines="1" class="amount">(¥{{ computedTotal.broker_balance }} )</text>
|
||||
</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 class="Commodity Commodity-Item" @click="isCoin()">
|
||||
<view class="discount" style="width: 100%; display: flex; justify-content: space-between">
|
||||
<view>
|
||||
<text lines="1" class="quantity">余额</text>
|
||||
<text lines="1" class="amount">( 余额:¥{{ computedTotal.coin_balance }} )</text>
|
||||
<text lines="1" class="quantity">抵用券</text>
|
||||
<text lines="1" class="amount">(¥{{ computedTotal.coin_balance }} )</text>
|
||||
</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>
|
||||
|
||||
|
|
@ -124,7 +124,6 @@
|
|||
</button>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 确认门店信息 -->
|
||||
<u-modal :show="show" title="请确认自取门店" closeOnClickOverlay @close="show = false">
|
||||
<template v-slot:default>
|
||||
|
|
@ -165,11 +164,11 @@
|
|||
<view class="zero-content">
|
||||
<view class="item flex">
|
||||
<text>抵用券</text>
|
||||
<text class="blod">{{computedTotal.broker_balance}}</text>
|
||||
<text class="blod">{{computedTotal.used_broker}}</text>
|
||||
</view>
|
||||
<view class="item flex">
|
||||
<text>余额</text>
|
||||
<text class="blod">{{computedTotal.coin_balance}}</text>
|
||||
<text class="blod">{{computedTotal.used_coin}}</text>
|
||||
</view>
|
||||
<view class="know">
|
||||
<view class="left">
|
||||
|
|
@ -269,8 +268,8 @@
|
|||
shoptotalnum: 0,
|
||||
|
||||
computedTotal: {},
|
||||
use_coin: 0,
|
||||
use_broker: 0,
|
||||
use_coin: false,
|
||||
use_broker: false,
|
||||
|
||||
};
|
||||
},
|
||||
|
|
@ -362,11 +361,13 @@
|
|||
// 是否使用券
|
||||
isCoin() {
|
||||
this.use_coin = !this.use_coin;
|
||||
if (this.use_broker) this.use_broker = false;
|
||||
this.getCart()
|
||||
},
|
||||
|
||||
isBroker() {
|
||||
this.use_broker = !this.use_broker;
|
||||
if (this.use_coin) this.use_coin = false;
|
||||
this.getCart()
|
||||
},
|
||||
|
||||
|
|
@ -752,7 +753,7 @@
|
|||
|
||||
// 商品样式
|
||||
.Commodity-Item {
|
||||
margin-bottom: 20rpx;
|
||||
// margin-bottom: 20rpx;
|
||||
padding: 32rpx 0;
|
||||
|
||||
// 抵扣区域样式
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<!-- 商品列表 -->
|
||||
<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']">
|
||||
<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>
|
||||
</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']">
|
||||
</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']">
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="text-group_2" v-if="index == FormInfor['products']['length']-1">
|
||||
<!-- <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="discount" style="width: 100%; display: flex; justify-content: space-between">
|
||||
<view>
|
||||
<text lines="1" class="quantity">抵用券</text>
|
||||
<text lines="1" class="amount">( 余额:¥{{ computedTotal.broker_balance }} )</text>
|
||||
<text lines="1" class="quantity">余额:</text>
|
||||
<text lines="1" class="amount">(¥{{ computedTotal.broker_balance }} )</text>
|
||||
</view>
|
||||
<view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox': use_broker? true : false}"></view>
|
||||
</view>
|
||||
|
|
@ -102,8 +102,8 @@
|
|||
<view class="Commodity Commodity-Item" @click="isCoin()">
|
||||
<view class="discount" style="width: 100%; display: flex; justify-content: space-between">
|
||||
<view>
|
||||
<text lines="1" class="quantity">余额</text>
|
||||
<text lines="1" class="amount">( 余额:¥{{ computedTotal.coin_balance }} )</text>
|
||||
<text lines="1" class="quantity">抵用券</text>
|
||||
<text lines="1" class="amount">(¥{{ computedTotal.coin_balance }} )</text>
|
||||
</view>
|
||||
<view class="Checkbox" :style="{'--aftercolor':Brand()['ThemeColor']}" :class="{'active-Checkbox': use_coin? true : false}"></view>
|
||||
</view>
|
||||
|
|
@ -131,6 +131,47 @@
|
|||
<text lines="1" class="text_29">结算</text>
|
||||
</button>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
|
|
@ -153,6 +194,7 @@
|
|||
data() {
|
||||
return {
|
||||
show: true,
|
||||
zeroshow: false,
|
||||
FormInfor: {
|
||||
// 品牌id
|
||||
brand_id: 0,
|
||||
|
|
@ -304,46 +346,45 @@
|
|||
})
|
||||
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') {
|
||||
FormInfor['products'] = JSON.stringify(FormInfor['products'])
|
||||
}
|
||||
uni.showLoading({
|
||||
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.products = JSON.parse(FormInfor.products)
|
||||
|
||||
createFoodOrder(FormInfor).then(res => {
|
||||
uni.hideLoading();
|
||||
this.$Payment.H5TOWX_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']}`
|
||||
});
|
||||
let redirect_url = '/pages/restaurant/order/order-details/details';
|
||||
uni.hideLoading();
|
||||
|
||||
if (res.data.is_zero_pay) {
|
||||
uni.showLoading({ title: '支付成功, 跳转订单页' });
|
||||
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) {
|
||||
let current = this['FormInfor']['products'][index];
|
||||
// let current = this['FormInfor']['products'][index];
|
||||
// 当前余额为0并且用户准备勾选补贴选项则直接打断
|
||||
// JIN
|
||||
// if (this['amount'] == 0 && !current['is_deduction']) {
|
||||
|
|
@ -362,7 +403,7 @@
|
|||
// return
|
||||
// }
|
||||
// 状态取反
|
||||
current['is_deduction'] = current['is_deduction'] ? 0 : 1;
|
||||
// current['is_deduction'] = current['is_deduction'] ? 0 : 1;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -933,4 +974,55 @@
|
|||
background-color: #ffffff;
|
||||
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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue