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 class="fee-label" style="color: #ff5722;font-size: 24rpx;padding: 14rpx 0 18rpx;">
立即出餐-(拼团单,拼团成功后立即出餐) 立即出餐-(拼团单,拼团成功后立即出餐)
</view> </view>
<view class="fee-value" @tap="nowMakeMethod"> <view class="now-make-options">
<view :class="nowMake ? 'radio-check' : 'radio-no-check'"> <view class="now-make-option" @tap="checkNowMake(true)">
<uni-icons type="checkmarkempty" size="14"></uni-icons> <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>
</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-row" v-if="isPaotui == false && !isStoreGroupOrder">
<view class="fee-label"> <view class="fee-label">
用餐方式 用餐方式
@ -392,6 +404,19 @@
</view> </view>
</view> </view>
</uni-popup> </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"> <uni-popup ref="warnPopup" background-color="#fff">
<view class="warnImg"> <view class="warnImg">
@ -574,7 +599,6 @@
import addressList from '@/package1/address/addressList.vue' import addressList from '@/package1/address/addressList.vue'
import { requireLoginToCurrentPage } from '@/utils/authRedirect.js' import { requireLoginToCurrentPage } from '@/utils/authRedirect.js'
import { buildGroupHomeSharePath } from '@/utils/sharePath.js' import { buildGroupHomeSharePath } from '@/utils/sharePath.js'
const NOW_MAKE_GUIDE_CACHE_KEY = 'buyFoodNowMakeGuideShown'
export default { export default {
data() { data() {
return { return {
@ -588,8 +612,7 @@
deliveryTime: '', deliveryTime: '',
peisongyuan: '' peisongyuan: ''
}, },
nowMake:true, nowMake:null,
nowMakeGuideShownInPage: false,
pageToastText: '', pageToastText: '',
pageToastTimer: null, pageToastTimer: null,
content: [], content: [],
@ -707,8 +730,8 @@
isStoreConsumeOnly() { isStoreConsumeOnly() {
return this.shopItem && this.shopItem.storeConsumeOnly == 1; return this.shopItem && this.shopItem.storeConsumeOnly == 1;
}, },
shouldShowNowMakeGuide() { shouldChooseNowMake() {
return Number(this.shopItem.merchantType) === 1 && this.isPaotui == false && !this.isStoreGroupOrder && this.nowMake; return this.isPaotui == false && !this.isStoreGroupOrder;
}, },
highFloorFeeCalc() { highFloorFeeCalc() {
if (this.selected === 'shopDelivery') return 0; if (this.selected === 'shopDelivery') return 0;
@ -913,19 +936,17 @@
} }
}, },
methods: { methods: {
nowMakeMethod(){ checkNowMake(value){
this.nowMake = !this.nowMake this.nowMake = value;
}, },
maybeShowNowMakeGuide() { openNowMakePopup() {
if (this.nowMakeGuideShownInPage || !this.shouldShowNowMakeGuide) return; this.$refs.nowMakePopup.open('center');
if (uni.getStorageSync(NOW_MAKE_GUIDE_CACHE_KEY) === '1') return; },
this.nowMakeGuideShownInPage = true; confirmNowMake(value) {
uni.setStorageSync(NOW_MAKE_GUIDE_CACHE_KEY, '1'); this.nowMake = value;
uni.showModal({ this.$refs.nowMakePopup.close();
title: '温馨提示', this.$nextTick(() => {
content: '如不需要商家立即出餐,可取消勾选“立即出餐”。', this.submitOrderToBackend();
showCancel: false,
confirmText: '知道了'
}); });
}, },
checkPack(type) { checkPack(type) {
@ -1181,9 +1202,6 @@
}, },
switchToStoreMode() { switchToStoreMode() {
this.isPaotui = false; this.isPaotui = false;
this.$nextTick(() => {
this.maybeShowNowMakeGuide();
});
this.fetchCoupons(true); this.fetchCoupons(true);
}, },
onPayPopupChange(e) { onPayPopupChange(e) {
@ -1420,6 +1438,10 @@
}) })
return; return;
} }
if (this.shouldChooseNowMake && this.nowMake === null) {
this.openNowMakePopup();
return;
}
this.submitOrderToBackend(); this.submitOrderToBackend();
}, },
goDetail() { goDetail() {
@ -2591,7 +2613,8 @@
justify-content: flex-end; justify-content: flex-end;
} }
.pack-option { .pack-option,
.now-make-option {
display: flex; display: flex;
align-items: center; align-items: center;
color: $primary; color: $primary;
@ -2599,6 +2622,22 @@
margin-left: 30rpx; 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 { .remark-box {
flex: 1; flex: 1;
@ -2700,6 +2739,70 @@
box-shadow: 0 12rpx 26rpx rgba(11, 155, 115, 0.2); 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 { .coupon-row {
border-top: 1rpx solid #f0f3f2; border-top: 1rpx solid #f0f3f2;
font-size: 28rpx; font-size: 28rpx;

Loading…
Cancel
Save