wangfukang 3 weeks ago
parent
commit
b9302c9728
  1. 153
      package1/buyFood/buyFood.vue

153
package1/buyFood/buyFood.vue

@ -296,12 +296,24 @@
<view class="fee-label" style="color: #ff5722;font-size: 24rpx;padding: 14rpx 0 18rpx;">
立即出餐-(拼团单,拼团成功后立即出餐)
</view>
<view class="fee-value" @tap="nowMakeMethod">
<view :class="nowMake ? 'radio-check' : 'radio-no-check'">
<uni-icons type="checkmarkempty" size="14"></uni-icons>
<view class="now-make-options">
<view class="now-make-option" @tap="checkNowMake(true)">
<view :class="nowMake === true ? 'radio-check' : 'radio-no-check'">
<uni-icons v-if="nowMake === true" type="checkmarkempty" size="14"></uni-icons>
</view>
是
</view>
<view class="now-make-option" @tap="checkNowMake(false)">
<view :class="nowMake === false ? 'radio-check' : 'radio-no-check'">
<uni-icons v-if="nowMake === false" type="checkmarkempty" size="14"></uni-icons>
</view>
否
</view>
</view>
</view>
<view class="now-make-inline-tip" v-if="isPaotui ==false && !isStoreGroupOrder">
如果选择“否”,后续可在订单详情页面再次点击“立即出餐”提示商家出餐
</view>
<view class="fee-row" v-if="isPaotui == false && !isStoreGroupOrder">
<view class="fee-label">
用餐方式
@ -392,6 +404,19 @@
</view>
</view>
</uni-popup>
<uni-popup ref="nowMakePopup" type="center" background-color="transparent">
<view class="now-make-popup">
<view class="now-make-popup-title">是否立即出餐</view>
<view class="now-make-popup-desc">请选择是否需要商家立即出餐。</view>
<view class="now-make-popup-tip">
如果选择“否”,后续可在订单详情页面再次点击“立即出餐”提示商家出餐
</view>
<view class="now-make-popup-actions">
<view class="now-make-popup-cancel" @tap="confirmNowMake(false)">否</view>
<view class="now-make-popup-confirm" @tap="confirmNowMake(true)">是</view>
</view>
</view>
</uni-popup>
<!-- 警告弹出层 -->
<uni-popup ref="warnPopup" background-color="#fff">
<view class="warnImg">
@ -574,7 +599,6 @@
import addressList from '@/package1/address/addressList.vue'
import { requireLoginToCurrentPage } from '@/utils/authRedirect.js'
import { buildGroupHomeSharePath } from '@/utils/sharePath.js'
const NOW_MAKE_GUIDE_CACHE_KEY = 'buyFoodNowMakeGuideShown'
export default {
data() {
return {
@ -588,8 +612,7 @@
deliveryTime: '',
peisongyuan: ''
},
nowMake:true,
nowMakeGuideShownInPage: false,
nowMake:null,
pageToastText: '',
pageToastTimer: null,
content: [],
@ -707,8 +730,8 @@
isStoreConsumeOnly() {
return this.shopItem && this.shopItem.storeConsumeOnly == 1;
},
shouldShowNowMakeGuide() {
return Number(this.shopItem.merchantType) === 1 && this.isPaotui == false && !this.isStoreGroupOrder && this.nowMake;
shouldChooseNowMake() {
return this.isPaotui == false && !this.isStoreGroupOrder;
},
highFloorFeeCalc() {
if (this.selected === 'shopDelivery') return 0;
@ -913,19 +936,17 @@
}
},
methods: {
nowMakeMethod(){
this.nowMake = !this.nowMake
},
maybeShowNowMakeGuide() {
if (this.nowMakeGuideShownInPage || !this.shouldShowNowMakeGuide) return;
if (uni.getStorageSync(NOW_MAKE_GUIDE_CACHE_KEY) === '1') return;
this.nowMakeGuideShownInPage = true;
uni.setStorageSync(NOW_MAKE_GUIDE_CACHE_KEY, '1');
uni.showModal({
title: '温馨提示',
content: '如不需要商家立即出餐,可取消勾选“立即出餐”。',
showCancel: false,
confirmText: '知道了'
checkNowMake(value){
this.nowMake = value;
},
openNowMakePopup() {
this.$refs.nowMakePopup.open('center');
},
confirmNowMake(value) {
this.nowMake = value;
this.$refs.nowMakePopup.close();
this.$nextTick(() => {
this.submitOrderToBackend();
});
},
checkPack(type) {
@ -1181,9 +1202,6 @@
},
switchToStoreMode() {
this.isPaotui = false;
this.$nextTick(() => {
this.maybeShowNowMakeGuide();
});
this.fetchCoupons(true);
},
onPayPopupChange(e) {
@ -1420,6 +1438,10 @@
})
return;
}
if (this.shouldChooseNowMake && this.nowMake === null) {
this.openNowMakePopup();
return;
}
this.submitOrderToBackend();
},
goDetail() {
@ -2591,7 +2613,8 @@
justify-content: flex-end;
}
.pack-option {
.pack-option,
.now-make-option {
display: flex;
align-items: center;
color: $primary;
@ -2599,6 +2622,22 @@
margin-left: 30rpx;
}
.now-make-options {
display: flex;
align-items: center;
justify-content: flex-end;
}
.now-make-inline-tip {
margin: -6rpx 0 16rpx;
border-radius: 18rpx;
background: #fff8ef;
color: #ff7043;
font-size: 22rpx;
font-weight: 700;
line-height: 34rpx;
}
.remark-box {
flex: 1;
@ -2700,6 +2739,70 @@
box-shadow: 0 12rpx 26rpx rgba(11, 155, 115, 0.2);
}
.now-make-popup {
width: 620rpx;
padding: 44rpx 36rpx 34rpx;
box-sizing: border-box;
border-radius: 32rpx;
background: #fff;
box-shadow: 0 28rpx 70rpx rgba(0, 35, 28, 0.18);
}
.now-make-popup-title {
color: $primary;
font-size: 34rpx;
font-weight: 900;
text-align: center;
}
.now-make-popup-desc {
margin-top: 12rpx;
color: $muted;
font-size: 24rpx;
line-height: 36rpx;
text-align: center;
}
.now-make-popup-tip {
margin-top: 18rpx;
padding: 14rpx 18rpx;
border-radius: 18rpx;
background: #fff8ef;
color: #ff7043;
font-size: 22rpx;
font-weight: 700;
line-height: 34rpx;
text-align: left;
}
.now-make-popup-actions {
display: flex;
margin-top: 34rpx;
gap: 18rpx;
}
.now-make-popup-cancel,
.now-make-popup-confirm {
flex: 1;
height: 76rpx;
border-radius: 999rpx;
font-size: 28rpx;
font-weight: 800;
line-height: 76rpx;
text-align: center;
}
.now-make-popup-cancel {
background: #f3f6f4;
color: $muted;
}
.now-make-popup-confirm {
background: linear-gradient(135deg, #0b9b73, #20d6a4);
color: #fff;
box-shadow: 0 12rpx 26rpx rgba(11, 155, 115, 0.2);
}
.coupon-row {
border-top: 1rpx solid #f0f3f2;
font-size: 28rpx;

Loading…
Cancel
Save