|
|
@@ -4,11 +4,11 @@
|
|
|
<view class="text-center text-red" v-if="isTrue && orderType == 2">超出配送距离</view>
|
|
|
<view class="food">
|
|
|
<view class="flex bg justify-between padding-lr-xl">
|
|
|
- <view @click="switchTab(2)" :class="orderType == 2 ? 'select' : ''" class="tabBtn" v-if="XCXIsSelect == '是'">
|
|
|
+ <view @click="switchTab(2)" :class="orderType == 2 ? 'select' : ''" class="tabBtn" v-if="XCXIsSelect == '是' && showReach != 1 && shopTypeName != '三大运营商'">
|
|
|
<view class="title">外卖配送</view>
|
|
|
<view :class="orderType == 2 ? 'active' : ''"></view>
|
|
|
</view>
|
|
|
- <view @click="switchTab(1)" :class="orderType == 1 ? 'select' : ''" class="tabBtn">
|
|
|
+ <view @click="switchTab(1)" :class="orderType == 1 ? 'select' : ''" class="tabBtn" v-if="showReach != 2">
|
|
|
<view class="title">到店自取</view>
|
|
|
<view :class="orderType == 1 ? 'active' : ''"></view>
|
|
|
</view>
|
|
|
@@ -29,6 +29,15 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="flex margin-top" style="align-items: center">
|
|
|
+ <view style="font-size: 32rpx;color: #333333;font-weight: bold;">是否店内就餐?</view>
|
|
|
+ <view style="margin-left: 140px;transform: scale(0.8); "><switch :checked="ispackType" @change="handleSwitchChange" color="#4cd964"/></view>
|
|
|
+ </view>
|
|
|
+ <view style="color: #ea0018;">(店内就餐减免打包费)</view>
|
|
|
+ <view class="flex margin-top" style="align-items: center" v-if="shopTypeName == '三大运营商'">
|
|
|
+ <view>请填写身份证号:</view>
|
|
|
+ <input type="idcard" v-model="idcard1" style="border: 1px solid" />
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="" v-if="orderType == 2">
|
|
|
<view class="goods_address" v-if="JSON.stringify(address) == '{}'" @click="goAddress">
|
|
|
@@ -86,7 +95,7 @@
|
|
|
<view v-if="item.skuMessage">{{ item.skuMessage }}</view>
|
|
|
<view>x{{ item.goodsNum }}</view>
|
|
|
</view>
|
|
|
- <view class="flex justify-between align-center text-gray margin-tb-sm" v-if="item.goodsPack">
|
|
|
+ <view class="flex justify-between align-center text-gray margin-tb-sm" v-if="item.goodsPack&&packType==1">
|
|
|
<view>打包费</view>
|
|
|
<view class="">¥{{ item.goodsPack }} / 份</view>
|
|
|
</view>
|
|
|
@@ -380,6 +389,7 @@ export default {
|
|
|
ifPaotui: 0, //是否满减
|
|
|
reservationOpenFlag: 0, //1预约,0不预约
|
|
|
shopId: '',
|
|
|
+ showReach: null,
|
|
|
// 基础实付满多少
|
|
|
ruleAmount1: 0,
|
|
|
// 基础实付满多少送的积分
|
|
|
@@ -395,18 +405,30 @@ export default {
|
|
|
// 可获得积分
|
|
|
intergral: 0,
|
|
|
// 是否显示积分模块
|
|
|
- isIntegral: false
|
|
|
+ isIntegral: false,
|
|
|
+ shopTypeName: '', //店铺类型
|
|
|
+ idcard1: '', //身份证号
|
|
|
+ packType:1,//堂食0,到店外卖打包1
|
|
|
+ ispackType:false,
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
+ this.shopTypeName = option.shopTypeName
|
|
|
+ if (option.showReach) {
|
|
|
+ this.showReach = option.showReach
|
|
|
+ }
|
|
|
// #ifdef MP-WEIXIN
|
|
|
this.XCXIsSelect = this.$queue.getData('XCXIsSelect') ? this.$queue.getData('XCXIsSelect') : '是'
|
|
|
// #endif
|
|
|
|
|
|
- this.orderId = option.orderId
|
|
|
- this.orderType = option.orderType
|
|
|
- if (option.shopId) {
|
|
|
- this.shopId = option.shopId
|
|
|
+ this.shopId = option.shopId
|
|
|
+ if (option.shopTypeName == '三大运营商') {
|
|
|
+ this.orderType = 1
|
|
|
+ } else {
|
|
|
+ this.orderType = option.orderType
|
|
|
+ }
|
|
|
+ if (option.orderId) {
|
|
|
+ this.orderId = option.orderId
|
|
|
}
|
|
|
|
|
|
uni.showLoading({
|
|
|
@@ -459,6 +481,35 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 开关状态变化时触发
|
|
|
+ handleSwitchChange(e) {
|
|
|
+ this.ispackType = e.detail.value; // 更新状态
|
|
|
+ console.log("开关状态:", this.ispackType);
|
|
|
+ // 可在此处添加业务逻辑(如保存状态到缓存、调用接口等)
|
|
|
+ if (this.ispackType) {
|
|
|
+ this.packType=0
|
|
|
+ } else {
|
|
|
+ this.packType=1
|
|
|
+ }
|
|
|
+ console.log("堂食或:packType", this.packType);
|
|
|
+ if (this.orderType == 2) {
|
|
|
+ this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
|
|
|
+ } else {
|
|
|
+ if(this.packType==1){
|
|
|
+ this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
|
|
|
+ }else{
|
|
|
+ this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
|
|
|
+
|
|
|
+ if (totalMoney <= 0) {
|
|
|
+ this.totalPrice1 = 0.01
|
|
|
+ } else {
|
|
|
+ this.totalPrice1 = totalMoney
|
|
|
+ }
|
|
|
+ },
|
|
|
//获取会员立减金额
|
|
|
getvipMoney() {
|
|
|
var shopId =this.shopId
|
|
|
@@ -790,17 +841,33 @@ export default {
|
|
|
if (this.orderType == 2) {
|
|
|
this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
|
|
|
} else {
|
|
|
- this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
|
|
|
+ if(this.packType==1){
|
|
|
+ this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
|
|
|
+ }else{
|
|
|
+ this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let totalMoney = parseFloat(
|
|
|
+ this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0).toFixed(2)
|
|
|
+ ).toFixed(2)
|
|
|
+ if (totalMoney <= 0) {
|
|
|
+ this.totalPrice1 = 0.01
|
|
|
+ } else {
|
|
|
+ this.totalPrice1 = totalMoney
|
|
|
}
|
|
|
if (this.coupon) {
|
|
|
if (this.orderType == 2) {
|
|
|
this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
|
|
|
} else {
|
|
|
- this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
|
|
|
+ if(this.packType==1){
|
|
|
+ this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
|
|
|
+ }else{
|
|
|
+ this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
|
|
|
+ }
|
|
|
}
|
|
|
let totalMoney = parseFloat(
|
|
|
this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0).toFixed(2)
|
|
|
- )
|
|
|
+ ).toFixed(2)
|
|
|
if (totalMoney <= 0) {
|
|
|
this.totalPrice1 = 0.01
|
|
|
} else {
|
|
|
@@ -812,11 +879,15 @@ export default {
|
|
|
if (this.orderType == 2) {
|
|
|
this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
|
|
|
} else {
|
|
|
- this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
|
|
|
+ if(this.packType==1){
|
|
|
+ this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
|
|
|
+ }else{
|
|
|
+ this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
|
|
|
+ }
|
|
|
}
|
|
|
let totalMoney = parseFloat(
|
|
|
this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0).toFixed(2)
|
|
|
- )
|
|
|
+ ).toFixed(2)
|
|
|
if (totalMoney <= 0) {
|
|
|
this.totalPrice1 = 0.01
|
|
|
} else {
|
|
|
@@ -826,11 +897,15 @@ export default {
|
|
|
if (this.orderType == 2) {
|
|
|
this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
|
|
|
} else {
|
|
|
- this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
|
|
|
+ if(this.packType==1){
|
|
|
+ this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
|
|
|
+ }else{
|
|
|
+ this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
|
|
|
+ }
|
|
|
}
|
|
|
let totalMoney = parseFloat(
|
|
|
this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0).toFixed(2)
|
|
|
- )
|
|
|
+ ).toFixed(2)
|
|
|
if (totalMoney <= 0) {
|
|
|
this.totalPrice1 = 0.01
|
|
|
} else {
|
|
|
@@ -854,7 +929,11 @@ export default {
|
|
|
if (this.orderType == 2) {
|
|
|
this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
|
|
|
} else {
|
|
|
- this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
|
|
|
+ if(this.packType==1){
|
|
|
+ this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
|
|
|
+ }else{
|
|
|
+ this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
|
|
|
+ }
|
|
|
}
|
|
|
let totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
|
|
|
|
|
|
@@ -883,7 +962,11 @@ export default {
|
|
|
if (this.orderType == 2) {
|
|
|
this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
|
|
|
} else {
|
|
|
- this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
|
|
|
+ if(this.packType==1){
|
|
|
+ this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
|
|
|
+ }else{
|
|
|
+ this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
let totalMoney = parseFloat(this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
|
|
|
@@ -916,7 +999,11 @@ export default {
|
|
|
if (this.orderType == 2) {
|
|
|
this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
|
|
|
} else {
|
|
|
- this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
|
|
|
+ if(this.packType==1){
|
|
|
+ this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
|
|
|
+ }else{
|
|
|
+ this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
let totalMoney = parseFloat(
|
|
|
@@ -960,7 +1047,11 @@ export default {
|
|
|
if (this.orderType == 2) {
|
|
|
this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
|
|
|
} else {
|
|
|
- this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
|
|
|
+ if(this.packType==1){
|
|
|
+ this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
|
|
|
+ }else{
|
|
|
+ this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
let totalMoney = parseFloat(
|
|
|
@@ -1040,7 +1131,11 @@ export default {
|
|
|
if (this.orderType == 2) {
|
|
|
this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
|
|
|
} else {
|
|
|
- this.totalPrice1 = this.totalPrice + this.dabaoMoney
|
|
|
+ if(this.packType==1){
|
|
|
+ this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
|
|
|
+ }else{
|
|
|
+ this.totalPrice1 = parseFloat(this.totalPrice).toFixed(2)
|
|
|
+ }
|
|
|
}
|
|
|
let totalMoney = parseFloat(
|
|
|
this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
|
|
|
@@ -1176,7 +1271,9 @@ export default {
|
|
|
couponId: this.coupon ? this.coupon.id : '',
|
|
|
addressId: this.address.addressId ? this.address.addressId : '',
|
|
|
orderType: this.orderType,
|
|
|
- type: res.enable ? 1 : 3
|
|
|
+ type: res.enable ? 1 : 3,
|
|
|
+ idCard: this.idcard1,
|
|
|
+ packType:this.packType
|
|
|
}
|
|
|
|
|
|
console.log(data)
|