|
|
|
@ -181,7 +181,7 @@ |
|
|
|
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/f7227759d693497a8beab87ff437a875.png" alt="" /> |
|
|
|
<view class="weipincheng">+</view> |
|
|
|
</view> |
|
|
|
<view class="pintuan-right-cha"> |
|
|
|
<view class="pintuan-right-cha" @tap.stop="openOrderWait(item)"> |
|
|
|
差<text style="color: red;">{{item.minGroupCount}}人</text>拼成 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -487,7 +487,10 @@ |
|
|
|
<template v-if="!groupId"> |
|
|
|
<view class="pintuan2 group-face-btn" @tap.stop="submitPintuan(true)"> |
|
|
|
<uni-icons type="help" size="20" @tap.stop="openMianRemark"></uni-icons> |
|
|
|
<view class="group-face-copy"> |
|
|
|
<text class="group-face-text">面对面团</text> |
|
|
|
<text class="group-face-sub">只能分享好友成团</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="pintuan2 group-submit-btn" @tap.stop="submitPintuan(false)"> |
|
|
|
{{isStoreGroupOrder ? '发起到店团' : '发起拼团'}}¥{{selectedGroupRule && selectedGroupRule.groupPrice ? parseFloat(selectedGroupRule.groupPriceAndMore).toFixed(2) : '0.00'}} |
|
|
|
@ -516,7 +519,7 @@ |
|
|
|
<view class="join-popup-main">快来加入拼团吧!</view> |
|
|
|
<view class="join-popup-sub">选一支快成团的队伍,马上省</view> |
|
|
|
</view> |
|
|
|
<scroll-view scroll-y style="max-height: 50vh;"> |
|
|
|
<scroll-view class="join-team-scroll" scroll-y :show-scrollbar="false"> |
|
|
|
<template> |
|
|
|
<!-- 占位假数据展示 --> |
|
|
|
<view class=""> |
|
|
|
@ -543,8 +546,15 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<view style="width: 100%;height: 160rpx;"></view> |
|
|
|
</scroll-view> |
|
|
|
<view class="join-popup-footer"> |
|
|
|
<view class="join-rule-check" @tap.stop="toggleWaitRuleKnown"> |
|
|
|
<view :class="autoWaitRuleKnown ? 'radio-check join-rule-icon' : 'radio-no-check join-rule-icon'"> |
|
|
|
<uni-icons v-if="autoWaitRuleKnown" type="checkmarkempty" size="12"></uni-icons> |
|
|
|
</view> |
|
|
|
<text>我已知晓参团规则,后续不再自动弹出</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
|
|
|
|
@ -840,6 +850,7 @@ |
|
|
|
productItem: [], |
|
|
|
tuanzhangOrder: {}, |
|
|
|
cartItems: [], |
|
|
|
regionMismatchRedirecting: false, |
|
|
|
moreBuyData: [], |
|
|
|
vModelValue: 0, |
|
|
|
currentItem: {}, |
|
|
|
@ -894,7 +905,9 @@ |
|
|
|
freeOrderAmount: '0.00', |
|
|
|
pendingFreeOrderAutoPay: false, |
|
|
|
popupPageStyle: '', |
|
|
|
bottomPopupOpenCount: 0 |
|
|
|
bottomPopupOpenCount: 0, |
|
|
|
autoWaitRuleKnown: false, |
|
|
|
hasAutoOpenedWaitPopup: false |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
@ -971,6 +984,7 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
this.initWaitRuleKnown(); |
|
|
|
this.type = option.type; |
|
|
|
this.orderScene = option.orderScene || ''; |
|
|
|
this.rememberShareTarget(option || {}); |
|
|
|
@ -1006,6 +1020,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.shopItem && this.shopItem.id) { |
|
|
|
if (!this.ensureShopInCurrentRegion(this.shopItem)) return; |
|
|
|
this.getCategory(this.shopItem.id); |
|
|
|
this.getProduct(''); |
|
|
|
} else if (option.shopId) { |
|
|
|
@ -1015,6 +1030,7 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
if (this.regionMismatchRedirecting) return; |
|
|
|
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect(); |
|
|
|
this.fetchCoupons(); |
|
|
|
// 通过胶囊按钮(menuButton)真实坐标计算自定义导航栏高度, |
|
|
|
@ -1060,7 +1076,32 @@ |
|
|
|
targetPath += '&orderScene=' + encodeURIComponent(option.orderScene); |
|
|
|
} |
|
|
|
uni.setStorageSync('authPendingTargetPath', targetPath); |
|
|
|
uni.setStorageSync('pendingShareTargetPath', targetPath); |
|
|
|
uni.removeStorageSync('pendingShareTargetPath'); |
|
|
|
}, |
|
|
|
getWaitRuleKnownKey() { |
|
|
|
return 'groupBuySingleWaitRuleKnown'; |
|
|
|
}, |
|
|
|
initWaitRuleKnown() { |
|
|
|
this.autoWaitRuleKnown = uni.getStorageSync(this.getWaitRuleKnownKey()) == 1; |
|
|
|
}, |
|
|
|
toggleWaitRuleKnown() { |
|
|
|
this.autoWaitRuleKnown = !this.autoWaitRuleKnown; |
|
|
|
if (this.autoWaitRuleKnown) { |
|
|
|
uni.setStorageSync(this.getWaitRuleKnownKey(), 1); |
|
|
|
} else { |
|
|
|
uni.removeStorageSync(this.getWaitRuleKnownKey()); |
|
|
|
} |
|
|
|
}, |
|
|
|
tryAutoOpenOrderWait() { |
|
|
|
if (this.groupId || this.hasAutoOpenedWaitPopup || this.autoWaitRuleKnown) return; |
|
|
|
if (!Array.isArray(this.orderListWait) || this.orderListWait.length == 0) return; |
|
|
|
this.chooseWaitType = false; |
|
|
|
this.hasAutoOpenedWaitPopup = true; |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs.pintuanGroupPopup) { |
|
|
|
this.$refs.pintuanGroupPopup.open('bottom'); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
getCurrentRegionId() { |
|
|
|
let area = uni.getStorageSync('area'); |
|
|
|
@ -1072,6 +1113,45 @@ |
|
|
|
return ''; |
|
|
|
} |
|
|
|
}, |
|
|
|
normalizeRegionId(value) { |
|
|
|
return value === undefined || value === null ? '' : String(value).trim(); |
|
|
|
}, |
|
|
|
getShopRegionId(shopItem) { |
|
|
|
if (!shopItem) return ''; |
|
|
|
return this.normalizeRegionId(shopItem.regionId || shopItem.shopRegionId || shopItem.region); |
|
|
|
}, |
|
|
|
ensureShopInCurrentRegion(shopItem) { |
|
|
|
const currentRegionId = this.normalizeRegionId(this.getCurrentRegionId()); |
|
|
|
const shopRegionId = this.getShopRegionId(shopItem); |
|
|
|
if (!currentRegionId || !shopRegionId || currentRegionId === shopRegionId) return true; |
|
|
|
this.regionMismatchRedirecting = true; |
|
|
|
this.clearShareRedirectCache(); |
|
|
|
uni.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '当前商家不在本校区范围,请切换校区后下单', |
|
|
|
showCancel: false, |
|
|
|
confirmText: '我知道了', |
|
|
|
success: () => { |
|
|
|
this.backHome(); |
|
|
|
}, |
|
|
|
fail: () => { |
|
|
|
this.backHome(); |
|
|
|
} |
|
|
|
}); |
|
|
|
return false; |
|
|
|
}, |
|
|
|
clearShareRedirectCache() { |
|
|
|
uni.removeStorageSync('authPendingTargetPath'); |
|
|
|
uni.removeStorageSync('pendingShareTargetPath'); |
|
|
|
}, |
|
|
|
backHome() { |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/index/index', |
|
|
|
fail: () => { |
|
|
|
uni.reLaunch({ url: '/pages/index/index' }); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
parseRouteItem(item) { |
|
|
|
if (item == null || item === '') return null; |
|
|
|
try { |
|
|
|
@ -1153,6 +1233,7 @@ |
|
|
|
return; |
|
|
|
} |
|
|
|
this.shopItem = this.normalizeShopDeliveryFields(shopRes.result); |
|
|
|
if (!this.ensureShopInCurrentRegion(this.shopItem)) return; |
|
|
|
if (this.shopItem.products) { |
|
|
|
this.shopRecommend = this.shopItem.products; |
|
|
|
for (let i = 0; i < this.shopRecommend.length; i++) { |
|
|
|
@ -1472,13 +1553,14 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
openOrderWait(item) { |
|
|
|
if(this.orderListWait != null && this.orderListWait.length == 0){ |
|
|
|
const waitList = item && item != '' ? item.orderListWait : this.orderListWait; |
|
|
|
if (!Array.isArray(waitList) || waitList.length == 0) { |
|
|
|
return; |
|
|
|
} |
|
|
|
this.chooseWaitType = false |
|
|
|
if (item != '') { |
|
|
|
this.chooseWaitType = true |
|
|
|
this.orderListWait = item.orderListWait |
|
|
|
this.orderListWait = waitList |
|
|
|
|
|
|
|
this.currentItem = item; |
|
|
|
// Parse specifications |
|
|
|
@ -1572,7 +1654,7 @@ |
|
|
|
}, false, false).then((res) => { |
|
|
|
that.loadStatus = 'nomore'; |
|
|
|
if (res.code == 200) { |
|
|
|
that.orderListWait = res.result; |
|
|
|
that.orderListWait = Array.isArray(res.result) ? res.result : []; |
|
|
|
for (let i = 0; i < that.productItem.length; i++) { |
|
|
|
that.productItem[i].orderListWait = [] |
|
|
|
if (that.orderListWait != null && that.orderListWait.length > 0) { |
|
|
|
@ -1592,6 +1674,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
that.$forceUpdate(); |
|
|
|
that.tryAutoOpenOrderWait(); |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message); |
|
|
|
return; |
|
|
|
@ -1757,6 +1840,7 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
submitAddToCart() { |
|
|
|
if (!requireLoginToCurrentPage()) return; |
|
|
|
let specChoices = {}; |
|
|
|
for (let spec of this.parsedSpecs) { |
|
|
|
specChoices[spec.name] = spec.canbuy === 1 ? spec.selected[0] : spec.selected; |
|
|
|
@ -2354,9 +2438,7 @@ |
|
|
|
if (pages.length > 1) { |
|
|
|
uni.navigateBack(); |
|
|
|
} else { |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/index/index' |
|
|
|
}); |
|
|
|
this.backHome(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -3933,6 +4015,21 @@ |
|
|
|
line-height: 1; |
|
|
|
} |
|
|
|
|
|
|
|
.group-face-copy { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
gap: 6rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.group-face-sub { |
|
|
|
color: rgba(21, 58, 53, 0.72); |
|
|
|
font-size: 20rpx; |
|
|
|
font-weight: 700; |
|
|
|
line-height: 1; |
|
|
|
} |
|
|
|
|
|
|
|
@keyframes checkoutTextShine { |
|
|
|
|
|
|
|
0%, |
|
|
|
@ -4138,6 +4235,46 @@ |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
|
|
|
|
.join-team-popup { |
|
|
|
height: 820rpx; |
|
|
|
max-height: 82vh; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
overflow: hidden; |
|
|
|
padding-bottom: 0; |
|
|
|
box-sizing: border-box; |
|
|
|
} |
|
|
|
|
|
|
|
.join-team-scroll { |
|
|
|
flex: 1; |
|
|
|
min-height: 0; |
|
|
|
padding: 0 0 16rpx; |
|
|
|
box-sizing: border-box; |
|
|
|
} |
|
|
|
|
|
|
|
.join-popup-footer { |
|
|
|
flex-shrink: 0; |
|
|
|
padding: 18rpx 20rpx 22rpx; |
|
|
|
margin: 4rpx -20rpx 0; |
|
|
|
background: rgba(246, 255, 251, 0.96); |
|
|
|
border-top: 1rpx solid rgba(166, 255, 234, 0.45); |
|
|
|
} |
|
|
|
|
|
|
|
.join-rule-check { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
color: #52615d; |
|
|
|
font-size: 24rpx; |
|
|
|
font-weight: 700; |
|
|
|
line-height: 34rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.join-rule-icon { |
|
|
|
flex-shrink: 0; |
|
|
|
margin-right: 12rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.group-order-popup .popup-product-card { |
|
|
|
padding: 14rpx 18rpx; |
|
|
|
margin-bottom: 10rpx; |
|
|
|
|