|
|
|
@ -147,7 +147,7 @@ |
|
|
|
</view> |
|
|
|
<view class="catalog-goods"> |
|
|
|
<view class="goods-member goods-card" :id="'category-' + item.categoryId" |
|
|
|
v-for="(item,index) in productItem" :key="index" @tap="openGoodsDetail(item)"> |
|
|
|
v-for="(item,index) in productItem" :key="index" @tap="openGoodsDetailByIndex(index)"> |
|
|
|
<view class="goods-card-shine"></view> |
|
|
|
<view @tap.stop="buyingye" v-if="item.status == 1" |
|
|
|
style="width: 100%;height:100%;position: absolute;top: 0;background: rgba(0, 0, 0, 0.1);z-index: 999;border-radius: 20rpx;"> |
|
|
|
@ -180,13 +180,13 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="shop-tag1"> |
|
|
|
<view class="goods-tag" @tap.stop="openOrderWait(item)" |
|
|
|
<view class="goods-tag" @tap.stop="openOrderWaitByIndex(index)" |
|
|
|
v-if="item.orderListWait != undefined && item.orderListWait.length > 0"> |
|
|
|
<view class="pintuan-right-img"> |
|
|
|
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/f7227759d693497a8beab87ff437a875.png" alt="" /> |
|
|
|
<view class="weipincheng">+</view> |
|
|
|
</view> |
|
|
|
<view class="pintuan-right-cha" @tap.stop="openOrderWait(item)"> |
|
|
|
<view class="pintuan-right-cha" @tap.stop="openOrderWaitByIndex(index)"> |
|
|
|
差<text style="color: red;">{{getMissingGroupMembers(item)}}人</text>成团 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -197,7 +197,7 @@ |
|
|
|
|
|
|
|
<view v-if="isProductGroupBuyAvailable(item)" |
|
|
|
class="goods-btn group-buy-btn" style="margin-left: 6%;" |
|
|
|
:style="{'float':groupId != ''?'right':''}" @tap.stop="openPopup('xiadan','pintuan',item)"> |
|
|
|
:style="{'float':groupId != ''?'right':''}" @tap.stop="openProductPopup('pintuan', index)"> |
|
|
|
<view class="btn-spark"> |
|
|
|
<view class="spark-dot spark-dot-1"></view> |
|
|
|
<view class="spark-dot spark-dot-2"></view> |
|
|
|
@ -205,7 +205,7 @@ |
|
|
|
</view> |
|
|
|
<text>拼团购买¥{{ getGroupPrice(item) }}</text> |
|
|
|
</view> |
|
|
|
<view class="goods-btn solo-buy-btn" v-if="!groupId" @tap.stop="openPopup('xiadan','dandu',item)" |
|
|
|
<view class="goods-btn solo-buy-btn" v-if="!groupId" @tap.stop="openProductPopup('dandu', index)" |
|
|
|
style="background: rgba(166, 255, 234, 0.3);border: 1px solid rgba(166, 255, 234, 0.5);height:68rpx;"> |
|
|
|
直接购买¥{{item.attributeListPrice | sliceMsg}} |
|
|
|
</view> |
|
|
|
@ -399,7 +399,7 @@ |
|
|
|
</view> |
|
|
|
<view class="goods-content-center"> |
|
|
|
<view class="goods-deal1"> |
|
|
|
月售 <text> 100+</text> |
|
|
|
<rich-text :nodes="getProductIntro(currentItem)"></rich-text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="goods-content-bottom"> |
|
|
|
@ -672,9 +672,27 @@ |
|
|
|
<text style="font-size: 30rpx;font-weight: 700;">立即出餐</text> |
|
|
|
</view> |
|
|
|
<view style="color: #777;width: 500rpx;"> |
|
|
|
拼团成功后立即出餐 |
|
|
|
{{nowMake === false ? '选择用餐时间,系统会在用餐前30分钟通知商家并打印小票' : '拼团成功后立即出餐'}} |
|
|
|
</view> |
|
|
|
<view class="pack-options" v-if="nowMake"> |
|
|
|
<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="12"></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="12"></uni-icons> |
|
|
|
</view> |
|
|
|
否 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="pickup-time-row" v-if="nowMake === false" @tap="openPickupTimePicker"> |
|
|
|
<text>用餐时间</text> |
|
|
|
<text :class="{'pickup-time-placeholder': !pickupTime}">{{pickupTime || '选择时间 >'}}</text> |
|
|
|
</view> |
|
|
|
<view class="pack-options"> |
|
|
|
<view class="pack-option" @tap="isPack = 0"> |
|
|
|
<view :class="isPack === 0 ? 'radio-check' : 'radio-no-check'"> |
|
|
|
<uni-icons v-if="isPack === 0" type="checkmarkempty" size="12"></uni-icons> |
|
|
|
@ -689,11 +707,6 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="width: 36rpx;padding-top: 20rpx;"> |
|
|
|
<view :class="nowMake ? 'radio-check' : 'radio-no-check'" @tap="nowMakeMethod"> |
|
|
|
<uni-icons v-if="nowMake" type="checkmarkempty" size="12"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="box1 pay-option-card" style="display: flex;"> |
|
|
|
<view style="flex: 1;"> |
|
|
|
@ -712,11 +725,27 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="btn pay-confirm-btn" @tap="wxPayment"> |
|
|
|
确认付款{{nowMake && groupdeliveryType == 2 && !isStoreGroupOrder ? '-即刻出餐' : ''}} |
|
|
|
确认付款{{nowMake === true && groupdeliveryType == 2 && !isStoreGroupOrder ? '-即刻出餐' : ''}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<delivery-time-op @timeCallback="pickupTimeCallback" :dodge="false" ref="pickupTimeModel" |
|
|
|
:content="pickupTimeContent" :barHidth="600" title="选择用餐时间"> |
|
|
|
</delivery-time-op> |
|
|
|
<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"> |
|
|
|
选择“否”后需要预约用餐时间,系统会在用餐前30分钟通知商家并打印小票 |
|
|
|
</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="tishiPopup" background-color="transparent" @change="onTishiPopupChange"> |
|
|
|
<view v-if="!isPindan && isStoreGroupOrder" class="group-face-tip-popup" @tap.stop> |
|
|
|
@ -872,8 +901,10 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import deliveryTimeOp from '@/package2/components/delivery-time-op/delivery-time-op.vue' |
|
|
|
import { requireLoginToCurrentPage } from '@/utils/authRedirect.js' |
|
|
|
import { rememberInviteParams } from '@/utils/sharePath.js' |
|
|
|
import { resolveCampusTextEnabled, shouldUseSocialText } from '@/utils/areaTextMode.js' |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
@ -894,7 +925,9 @@ |
|
|
|
storeConsumeOnly: 0, |
|
|
|
}, |
|
|
|
productId: '', |
|
|
|
nowMake: true, |
|
|
|
nowMake: null, |
|
|
|
pickupTime: '', |
|
|
|
pickupTimeContent: [], |
|
|
|
isPack: 0, |
|
|
|
productItem: [], |
|
|
|
tuanzhangOrder: {}, |
|
|
|
@ -907,6 +940,7 @@ |
|
|
|
checkMoreBuyIndex: '', |
|
|
|
parsedSpecs: [], |
|
|
|
specExpandedMap: [], |
|
|
|
allMoreBuyList: [], |
|
|
|
moreBuyList: [], |
|
|
|
selectedGroupRule: {}, |
|
|
|
pageNum: 1, |
|
|
|
@ -960,6 +994,7 @@ |
|
|
|
autoWaitRuleKnown: false, |
|
|
|
hasAutoOpenedWaitPopup: false, |
|
|
|
areaKind: 1, |
|
|
|
campusTextEnabled: 0, |
|
|
|
sharePosterLoading: false, |
|
|
|
sharePosterImage: '', |
|
|
|
shareQrcodeUrl: '', |
|
|
|
@ -973,12 +1008,15 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
|
|
|
|
deliveryTimeOp |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
isSocialArea() { |
|
|
|
return Number(this.areaKind) === 2 |
|
|
|
}, |
|
|
|
useSocialText() { |
|
|
|
return shouldUseSocialText(this.areaKind, this.campusTextEnabled) |
|
|
|
}, |
|
|
|
isStoreGroupOrder() { |
|
|
|
return this.orderScene === 'storeGroup' || this.shopItem.merchantType == 2; |
|
|
|
}, |
|
|
|
@ -990,11 +1028,11 @@ |
|
|
|
}, |
|
|
|
shopSubtitle() { |
|
|
|
if (this.isStoreGroupOrder) { |
|
|
|
return this.isSocialArea |
|
|
|
return this.useSocialText |
|
|
|
? '到店核销,任选商品即可参团' |
|
|
|
: '到店核销,任选商品即可参团' |
|
|
|
} |
|
|
|
return this.isSocialArea |
|
|
|
return this.useSocialText |
|
|
|
? '约上好友一起拼,任选商品即可参团' |
|
|
|
: '约上室友同学一起拼,任选商品即可参团' |
|
|
|
}, |
|
|
|
@ -1005,25 +1043,25 @@ |
|
|
|
return ''; |
|
|
|
}, |
|
|
|
liveSlogan() { |
|
|
|
return this.isSocialArea |
|
|
|
return this.useSocialText |
|
|
|
? '你知道吗?拼团和柴米油盐一样重要!' |
|
|
|
: '你知道吗?拼团和期末不挂科一样重要!' |
|
|
|
}, |
|
|
|
popupRallyMain() { |
|
|
|
if (this.isStoreGroupOrder) { |
|
|
|
return this.isSocialArea |
|
|
|
return this.useSocialText |
|
|
|
? '到店团购搭子哪里找-同城好友一起省!' |
|
|
|
: '到店团购搭子哪里找-同校同学一起省!' |
|
|
|
} |
|
|
|
return this.isSocialArea |
|
|
|
return this.useSocialText |
|
|
|
? '拼团搭子哪里找-同城好友全是宝!' |
|
|
|
: '拼团搭子哪里找-隔壁宿舍全是宝!' |
|
|
|
}, |
|
|
|
regionSelectToast() { |
|
|
|
return this.isSocialArea ? '请先选择区域' : '请先选择校区' |
|
|
|
return this.useSocialText ? '请先选择区域' : '请先选择校区' |
|
|
|
}, |
|
|
|
regionMismatchContent() { |
|
|
|
return this.isSocialArea |
|
|
|
return this.useSocialText |
|
|
|
? '当前商家不在本区域范围,请切换区域后下单' |
|
|
|
: '当前商家不在本校区范围,请切换校区后下单' |
|
|
|
}, |
|
|
|
@ -1254,6 +1292,7 @@ |
|
|
|
} |
|
|
|
const kind = area ? Number(area.areaKind) : 1 |
|
|
|
this.areaKind = kind === 2 ? 2 : 1 |
|
|
|
this.campusTextEnabled = resolveCampusTextEnabled(area) |
|
|
|
}, |
|
|
|
normalizeRegionId(value) { |
|
|
|
return value === undefined || value === null ? '' : String(value).trim(); |
|
|
|
@ -1320,6 +1359,7 @@ |
|
|
|
checked: true |
|
|
|
}]; |
|
|
|
this.productItem = []; |
|
|
|
this.allMoreBuyList = []; |
|
|
|
this.moreBuyList = []; |
|
|
|
}, |
|
|
|
loadShopContent() { |
|
|
|
@ -1482,8 +1522,109 @@ |
|
|
|
this.goPayOrderDetail(); |
|
|
|
} |
|
|
|
}, |
|
|
|
nowMakeMethod() { |
|
|
|
this.nowMake = !this.nowMake |
|
|
|
checkNowMake(value) { |
|
|
|
this.nowMake = value; |
|
|
|
if (value === false) { |
|
|
|
this.openPickupTimePicker(); |
|
|
|
} |
|
|
|
}, |
|
|
|
openNowMakePopup() { |
|
|
|
this.$refs.nowMakePopup.open('center'); |
|
|
|
}, |
|
|
|
confirmNowMake(value) { |
|
|
|
this.nowMake = value; |
|
|
|
this.$refs.nowMakePopup.close(); |
|
|
|
this.$nextTick(() => { |
|
|
|
if (value === false) { |
|
|
|
this.openPickupTimePicker(); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.wxPayment(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
needsPickupAppointment() { |
|
|
|
return this.groupdeliveryType == 2 && !this.isStoreGroupOrder && this.nowMake === false; |
|
|
|
}, |
|
|
|
openPickupTimePicker() { |
|
|
|
this.generatePickupTimes(); |
|
|
|
this.$refs.pickupTimeModel.open(); |
|
|
|
}, |
|
|
|
pickupTimeCallback(val) { |
|
|
|
this.pickupTime = val.timestr; |
|
|
|
this.$refs.pickupTimeModel.close(); |
|
|
|
}, |
|
|
|
getPickupLeadMinutes() { |
|
|
|
const cookingTime = Number(this.shopItem.shopTakeaway && this.shopItem.shopTakeaway.cookingTime ? this.shopItem.shopTakeaway.cookingTime : 0); |
|
|
|
return !isNaN(cookingTime) && cookingTime > 0 ? cookingTime : 30; |
|
|
|
}, |
|
|
|
getNextPickupSlot(date) { |
|
|
|
const interval = 20; |
|
|
|
const slot = new Date(date); |
|
|
|
slot.setSeconds(0, 0); |
|
|
|
const remainder = slot.getMinutes() % interval; |
|
|
|
if (remainder !== 0) { |
|
|
|
slot.setMinutes(slot.getMinutes() + interval - remainder); |
|
|
|
} else { |
|
|
|
slot.setMinutes(slot.getMinutes() + interval); |
|
|
|
} |
|
|
|
return slot; |
|
|
|
}, |
|
|
|
formatClockTime(date) { |
|
|
|
return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`; |
|
|
|
}, |
|
|
|
formatDateTimeValue(date) { |
|
|
|
const year = date.getFullYear(); |
|
|
|
const month = String(date.getMonth() + 1).padStart(2, '0'); |
|
|
|
const day = String(date.getDate()).padStart(2, '0'); |
|
|
|
const hours = String(date.getHours()).padStart(2, '0'); |
|
|
|
const minutes = String(date.getMinutes()).padStart(2, '0'); |
|
|
|
const seconds = String(date.getSeconds()).padStart(2, '0'); |
|
|
|
return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`; |
|
|
|
}, |
|
|
|
getPickupAppointmentEndTime(date) { |
|
|
|
const endTime = new Date(date); |
|
|
|
const fallbackEndTime = new Date(date); |
|
|
|
fallbackEndTime.setHours(23, 0, 0, 0); |
|
|
|
const endStr = this.shopItem.shopTakeaway && this.shopItem.shopTakeaway.businessHourEnd; |
|
|
|
const parts = String(endStr || '').split(':').map(Number); |
|
|
|
if (parts.length < 2 || isNaN(parts[0]) || isNaN(parts[1])) { |
|
|
|
return fallbackEndTime; |
|
|
|
} |
|
|
|
endTime.setHours(parts[0], parts[1], 0, 0); |
|
|
|
endTime.setMinutes(endTime.getMinutes() + 20); |
|
|
|
return endTime > fallbackEndTime ? fallbackEndTime : endTime; |
|
|
|
}, |
|
|
|
generatePickupTimes() { |
|
|
|
const now = new Date(); |
|
|
|
const today = new Date(now); |
|
|
|
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; |
|
|
|
const earliestTime = new Date(now); |
|
|
|
earliestTime.setMinutes(earliestTime.getMinutes() + this.getPickupLeadMinutes()); |
|
|
|
const todayStartTime = this.getNextPickupSlot(earliestTime); |
|
|
|
const todayEndTime = this.getPickupAppointmentEndTime(today); |
|
|
|
const timelist = []; |
|
|
|
const cursor = new Date(todayStartTime); |
|
|
|
while (cursor <= todayEndTime) { |
|
|
|
timelist.push({ timestr: this.formatClockTime(cursor) }); |
|
|
|
cursor.setMinutes(cursor.getMinutes() + 20); |
|
|
|
} |
|
|
|
this.pickupTimeContent = [{ |
|
|
|
id: 'today', |
|
|
|
timezh: `今天 (${weekdays[today.getDay()]})`, |
|
|
|
timelist: timelist |
|
|
|
}]; |
|
|
|
}, |
|
|
|
getPickupMakeTime() { |
|
|
|
if (!this.pickupTime) return null; |
|
|
|
let [h, m] = this.pickupTime.split(':'); |
|
|
|
let targetHour = parseInt(h); |
|
|
|
let targetMinute = parseInt(m); |
|
|
|
let d = new Date(); |
|
|
|
if (targetHour < d.getHours() || (targetHour === d.getHours() && targetMinute <= d.getMinutes())) { |
|
|
|
d.setDate(d.getDate() + 1); |
|
|
|
} |
|
|
|
d.setHours(targetHour, targetMinute, 0, 0); |
|
|
|
return this.formatDateTimeValue(d); |
|
|
|
}, |
|
|
|
toNumber(value) { |
|
|
|
let amount = parseFloat(value); |
|
|
|
@ -1515,6 +1656,12 @@ |
|
|
|
}, |
|
|
|
getMoreBuyAmount() { |
|
|
|
let list = this.currentItem && this.currentItem.moreBuyData ? this.currentItem.moreBuyData : this.moreBuyData; |
|
|
|
const allowedIds = this.parseMoreBuyProductIds(this.currentItem && this.currentItem.moreBuyProductIds); |
|
|
|
if (allowedIds.length === 0) { |
|
|
|
list = []; |
|
|
|
} else { |
|
|
|
list = (list || []).filter(item => allowedIds.indexOf(String(item.id)) !== -1); |
|
|
|
} |
|
|
|
let amount = 0; |
|
|
|
for (let i = 0; i < list.length; i++) { |
|
|
|
if (list[i].quantity > 0) { |
|
|
|
@ -1562,10 +1709,42 @@ |
|
|
|
} |
|
|
|
this.selectedGroupRule.groupPriceAndMore = amount > 0 ? amount : 0.01; |
|
|
|
}, |
|
|
|
parseMoreBuyProductIds(value) { |
|
|
|
if (Array.isArray(value)) { |
|
|
|
return value.filter(item => item !== '' && item !== null && item !== undefined).map(String); |
|
|
|
} |
|
|
|
if (value === '' || value === null || value === undefined) { |
|
|
|
return []; |
|
|
|
} |
|
|
|
return String(value).split(',').map(item => item.trim()).filter(item => item); |
|
|
|
}, |
|
|
|
getCurrentMoreBuyList(item) { |
|
|
|
const allowedIds = this.parseMoreBuyProductIds(item && item.moreBuyProductIds); |
|
|
|
if (allowedIds.length === 0) { |
|
|
|
return []; |
|
|
|
} |
|
|
|
return this.allMoreBuyList.filter(product => allowedIds.indexOf(String(product.id)) !== -1); |
|
|
|
}, |
|
|
|
applyCurrentMoreBuyList(item) { |
|
|
|
const selectedData = Array.isArray(this.moreBuyData) ? this.moreBuyData : []; |
|
|
|
this.moreBuyList = this.getCurrentMoreBuyList(item).map(product => { |
|
|
|
const selected = selectedData.find(data => data.id == product.id); |
|
|
|
return Object.assign({}, product, { |
|
|
|
isChecked: !!(selected && selected.quantity > 0), |
|
|
|
quantity: selected && selected.quantity ? selected.quantity : 0 |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.vModelValue = 0; |
|
|
|
this.checkMoreBuyIndex = ''; |
|
|
|
}, |
|
|
|
syncCurrentItemMoreBuyData() { |
|
|
|
this.currentItem.moreBuyData = []; |
|
|
|
const allowedIds = this.parseMoreBuyProductIds(this.currentItem && this.currentItem.moreBuyProductIds); |
|
|
|
if (allowedIds.length === 0) { |
|
|
|
return; |
|
|
|
} |
|
|
|
for (let i = 0; i < this.moreBuyData.length; i++) { |
|
|
|
if (this.moreBuyData[i].quantity != undefined && this.moreBuyData[i].quantity > 0) { |
|
|
|
if (allowedIds.indexOf(String(this.moreBuyData[i].id)) !== -1 && this.moreBuyData[i].quantity != undefined && this.moreBuyData[i].quantity > 0) { |
|
|
|
this.currentItem.moreBuyData.push(this.moreBuyData[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1681,6 +1860,7 @@ |
|
|
|
let tuijianList = [] |
|
|
|
let putongList = [] |
|
|
|
that.moreBuyList = [] |
|
|
|
that.allMoreBuyList = [] |
|
|
|
for (let i = 0; i < that.productItem.length; i++) { |
|
|
|
if (this.productItem[i].sellBeginTime != '' && this.productItem[i].sellEndTime != '') { |
|
|
|
let isEndTime = this.isWithinBusinessHours(this.productItem[i].sellBeginTime, this |
|
|
|
@ -1691,7 +1871,7 @@ |
|
|
|
if (that.productItem[i].isMoreBuy == 1) { |
|
|
|
//搭配的小料商品 |
|
|
|
that.productItem[i].isChecked = false |
|
|
|
that.moreBuyList.push(that.productItem[i]) |
|
|
|
that.allMoreBuyList.push(that.productItem[i]) |
|
|
|
} |
|
|
|
if (that.productItem[i].isPush == 1) { |
|
|
|
that.productItem[i].categoryId = 'tuijian' |
|
|
|
@ -1775,6 +1955,28 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getProductByIndex(index) { |
|
|
|
const product = this.productItem && this.productItem[index]; |
|
|
|
return product || null; |
|
|
|
}, |
|
|
|
openGoodsDetailByIndex(index) { |
|
|
|
const product = this.getProductByIndex(index); |
|
|
|
if (product) { |
|
|
|
this.openGoodsDetail(product); |
|
|
|
} |
|
|
|
}, |
|
|
|
openOrderWaitByIndex(index) { |
|
|
|
const product = this.getProductByIndex(index); |
|
|
|
if (product) { |
|
|
|
this.openOrderWait(product); |
|
|
|
} |
|
|
|
}, |
|
|
|
openProductPopup(type, index) { |
|
|
|
const product = this.getProductByIndex(index); |
|
|
|
if (product) { |
|
|
|
this.openPopup('xiadan', type, product); |
|
|
|
} |
|
|
|
}, |
|
|
|
openOrderWait(item) { |
|
|
|
const waitList = item && item != '' ? item.orderListWait : this.orderListWait; |
|
|
|
if (!Array.isArray(waitList) || waitList.length == 0) { |
|
|
|
@ -1786,6 +1988,7 @@ |
|
|
|
this.orderListWait = waitList |
|
|
|
|
|
|
|
this.currentItem = item; |
|
|
|
this.applyCurrentMoreBuyList(item); |
|
|
|
// Parse specifications |
|
|
|
this.parsedSpecs = []; |
|
|
|
if (item.attributeList && item.attributeList !== '{}') { |
|
|
|
@ -1932,6 +2135,7 @@ |
|
|
|
this.$refs.carPopup.open('bottom') |
|
|
|
} else if (type == 'xiadan') { |
|
|
|
this.currentItem = item; |
|
|
|
this.applyCurrentMoreBuyList(item); |
|
|
|
// Parse specifications |
|
|
|
this.parsedSpecs = []; |
|
|
|
if (item.attributeList && item.attributeList !== '{}') { |
|
|
|
@ -2179,7 +2383,7 @@ |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
let payload = { |
|
|
|
userId: uni.getStorageSync('id'), |
|
|
|
shopId: this.shopItem.id, |
|
|
|
deliveryType: this.tuanzhangOrder.deliveryType, |
|
|
|
@ -2196,9 +2400,27 @@ |
|
|
|
userCouponId: this.selectedCoupon ? this.selectedCoupon.id : null, |
|
|
|
regionId: regionId |
|
|
|
}; |
|
|
|
if (payload.deliveryType == 2 && !this.isStoreGroupOrder) { |
|
|
|
payload.isPack = this.isPack; |
|
|
|
if (this.nowMake === true) { |
|
|
|
payload.userRequireMake = 1; |
|
|
|
} else if (this.nowMake === false) { |
|
|
|
payload.userRequireMakeTime = this.getPickupMakeTime(); |
|
|
|
} |
|
|
|
} |
|
|
|
return payload; |
|
|
|
}, |
|
|
|
createFTFJoinOrder(specChoices, autoPay) { |
|
|
|
if (this.isCreatingOrder) return; |
|
|
|
if (this.groupdeliveryType == 2 && !this.isStoreGroupOrder && this.nowMake === null) { |
|
|
|
this.openNowMakePopup(); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (this.needsPickupAppointment() && !this.pickupTime) { |
|
|
|
this.tui.toast('请选择用餐时间'); |
|
|
|
this.openPickupTimePicker(); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.isCreatingOrder = true; |
|
|
|
this.syncCurrentItemMoreBuyData(); |
|
|
|
let payload = this.buildFTFJoinPayload(specChoices); |
|
|
|
@ -2619,6 +2841,10 @@ |
|
|
|
wxPayment() { |
|
|
|
if (!requireLoginToCurrentPage()) return; |
|
|
|
let that = this; |
|
|
|
if (this.groupdeliveryType == 2 && !this.isStoreGroupOrder && this.nowMake === null) { |
|
|
|
this.openNowMakePopup(); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!this.currentOrderId || !this.backendTotalAmount) { |
|
|
|
if (this.pendingPaySpecChoices) { |
|
|
|
this.createFTFJoinOrder(this.pendingPaySpecChoices, true); |
|
|
|
@ -2628,7 +2854,7 @@ |
|
|
|
|
|
|
|
let amountInCents = Math.round(this.backendTotalAmount * 100); |
|
|
|
let userRequireMake = 0 |
|
|
|
if (this.nowMake && this.groupdeliveryType == 2 && !this.isStoreGroupOrder) { |
|
|
|
if (this.nowMake === true && this.groupdeliveryType == 2 && !this.isStoreGroupOrder) { |
|
|
|
userRequireMake = 1 |
|
|
|
} |
|
|
|
|
|
|
|
@ -2855,7 +3081,7 @@ |
|
|
|
ctx.fillText('拼团更省钱', uni.upx2px(54), uni.upx2px(184)); |
|
|
|
ctx.setFillStyle('#6a7a75'); |
|
|
|
ctx.setFontSize(uni.upx2px(26)); |
|
|
|
ctx.fillText(this.isSocialArea ? '同城好友一起拼,优惠一起拿' : '约上同学室友一起拼,越拼越划算', uni.upx2px(58), uni.upx2px(236)); |
|
|
|
ctx.fillText(this.useSocialText ? '同城好友一起拼,优惠一起拿' : '约上同学室友一起拼,越拼越划算', uni.upx2px(58), uni.upx2px(236)); |
|
|
|
|
|
|
|
const iconX = uni.upx2px(58); |
|
|
|
const iconY = uni.upx2px(288); |
|
|
|
@ -3140,6 +3366,102 @@ |
|
|
|
margin-right: 40rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.now-make-options { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
margin-top: 18rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.now-make-option { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
color: #00231C; |
|
|
|
font-size: 28rpx; |
|
|
|
font-weight: 800; |
|
|
|
margin-right: 40rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.pickup-time-row { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
width: 500rpx; |
|
|
|
min-height: 56rpx; |
|
|
|
margin-top: 18rpx; |
|
|
|
padding: 0 18rpx; |
|
|
|
border-radius: 16rpx; |
|
|
|
background: #f6faf8; |
|
|
|
color: #00231C; |
|
|
|
font-size: 24rpx; |
|
|
|
font-weight: 800; |
|
|
|
box-sizing: border-box; |
|
|
|
} |
|
|
|
|
|
|
|
.pickup-time-placeholder { |
|
|
|
color: #8b9993; |
|
|
|
font-weight: normal; |
|
|
|
} |
|
|
|
|
|
|
|
.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: #00231C; |
|
|
|
font-size: 34rpx; |
|
|
|
font-weight: 900; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
.now-make-popup-desc { |
|
|
|
margin-top: 12rpx; |
|
|
|
color: #6f7f79; |
|
|
|
font-size: 24rpx; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
.now-make-popup-tip { |
|
|
|
margin-top: 18rpx; |
|
|
|
padding: 14rpx 18rpx; |
|
|
|
border-radius: 18rpx; |
|
|
|
background: #fff8ef; |
|
|
|
color: #ff7043; |
|
|
|
font-size: 22rpx; |
|
|
|
line-height: 34rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.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; |
|
|
|
text-align: center; |
|
|
|
line-height: 76rpx; |
|
|
|
font-size: 28rpx; |
|
|
|
font-weight: 800; |
|
|
|
} |
|
|
|
|
|
|
|
.now-make-popup-cancel { |
|
|
|
background: #f3f6f4; |
|
|
|
color: #6f7f79; |
|
|
|
} |
|
|
|
|
|
|
|
.now-make-popup-confirm { |
|
|
|
background: linear-gradient(135deg, #0b9b73, #20d6a4); |
|
|
|
color: #fff; |
|
|
|
} |
|
|
|
|
|
|
|
.title-search { |
|
|
|
display: flex; |
|
|
|
flex: 1; |
|
|
|
@ -3571,7 +3893,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
.goods-deal1 { |
|
|
|
width: 60%; |
|
|
|
width: 98%; |
|
|
|
} |
|
|
|
|
|
|
|
.goods-tag { |
|
|
|
|