|
|
|
@ -71,7 +71,8 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="pintuan group-live-card" style="padding: 0;margin-top:20rpx;display: flex;" v-if="orderListWait.length > 0" @tap="openOrderWait('')"> |
|
|
|
<view class="pintuan group-live-card" style="padding: 0;margin-top:20rpx;display: flex;" |
|
|
|
v-if="orderListWait.length > 0" @tap="openOrderWait('')"> |
|
|
|
<view class="live-card-header"> |
|
|
|
<view> |
|
|
|
<view class="live-title">加入队伍,马上省一笔</view> |
|
|
|
@ -113,16 +114,19 @@ |
|
|
|
<!-- 占位元素:当container吸顶时保持页面高度不塌缩 --> |
|
|
|
<view v-if="isContainerSticky" :style="'height:' + containerHeight + 'px;margin-top:20rpx;'"></view> |
|
|
|
<view class="container goods-panel" :style="containerStyle"> |
|
|
|
<scroll-view scroll-y id="menuList" class="menu-scroll" style="border-right: 1px solid #eee;font-weight: 700;font-size: 28rpx;height: 100%;width: 160rpx;"> |
|
|
|
<scroll-view scroll-y id="menuList" class="menu-scroll" |
|
|
|
style="border-right: 1px solid #eee;font-weight: 700;font-size: 28rpx;height: 100%;width: 160rpx;"> |
|
|
|
<view class="menu1" @tap="checkTab(index)" v-for="(item,index) in menuList" :key="index" |
|
|
|
:style="{'border-top-right-radius':item.checked?'20rpx':'','border-bottom-right-radius':item.checked?'20rpx':'','color':item.checked?'rgba(0, 35, 28, 1)':'#777','background':item.checked?'#fff':''}"> |
|
|
|
<view class="menu-active-dot" v-if="item.checked"></view> |
|
|
|
<view style="width: 160rpx;">{{item.categoryName}}</view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
<scroll-view class="goods-list" scroll-y :scroll-into-view="scrollIntoViewId" :scroll-top="goodsListScrollTop" @scroll="onGoodsListScroll" @scrolltoupper="onGoodsListScrollToTop" :scroll-with-animation="true"> |
|
|
|
<view class="goods-member goods-card" :id="'category-' + item.categoryId" v-for="(item,index) in productItem" :key="index" |
|
|
|
@tap="goDetail('product',item)"> |
|
|
|
<scroll-view class="goods-list" scroll-y :scroll-into-view="scrollIntoViewId" |
|
|
|
:scroll-top="goodsListScrollTop" @scroll="onGoodsListScroll" @scrolltoupper="onGoodsListScrollToTop" |
|
|
|
:scroll-with-animation="true"> |
|
|
|
<view class="goods-member goods-card" :id="'category-' + item.categoryId" |
|
|
|
v-for="(item,index) in productItem" :key="index" @tap="goDetail('product',item)"> |
|
|
|
<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;"> |
|
|
|
@ -149,7 +153,8 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="shop-tag1"> |
|
|
|
<view class="goods-tag" @tap.stop="openOrderWait(item)" v-if="item.orderListWait != undefined && item.orderListWait.length > 0"> |
|
|
|
<view class="goods-tag" @tap.stop="openOrderWait(item)" |
|
|
|
v-if="item.orderListWait != undefined && item.orderListWait.length > 0"> |
|
|
|
<view class="pintuan-right-img"> |
|
|
|
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/94f91382e76c4f289d53fbf858e8732b.png" |
|
|
|
alt="" /> |
|
|
|
@ -164,7 +169,9 @@ |
|
|
|
</view> |
|
|
|
<view class="goods-bottom"> |
|
|
|
|
|
|
|
<view v-if="item.productGroupBuyPrices != null && item.isMoreBuy != 1" class="goods-btn group-buy-btn" style="margin-left: 6%;" :style="{'float':groupId != ''?'right':''}" @tap="openPopup('xiadan','pintuan',item)"> |
|
|
|
<view v-if="item.productGroupBuyPrices != null && item.isMoreBuy != 1" |
|
|
|
class="goods-btn group-buy-btn" style="margin-left: 6%;" |
|
|
|
:style="{'float':groupId != ''?'right':''}" @tap="openPopup('xiadan','pintuan',item)"> |
|
|
|
<view class="btn-spark"> |
|
|
|
<view class="spark-dot spark-dot-1"></view> |
|
|
|
<view class="spark-dot spark-dot-2"></view> |
|
|
|
@ -307,7 +314,8 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="goods-content-bottom"> |
|
|
|
<view class="popup-origin-price" style="font-size: 28rpx;line-height: 54rpx;margin-right: 20rpx;"> |
|
|
|
<view class="popup-origin-price" |
|
|
|
style="font-size: 28rpx;line-height: 54rpx;margin-right: 20rpx;"> |
|
|
|
¥{{currentItem.attributeListPrice | sliceMsg}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -347,7 +355,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<view class="spec11" v-if="moreBuyList.length > 0 && isPintuan" style="display: flex;"> |
|
|
|
<view class="spec11" v-if="moreBuyList.length > 0 && isPintuan" style="display: flex;"> |
|
|
|
<view style="flex: 1;"> |
|
|
|
搭配小食 |
|
|
|
</view> |
|
|
|
@ -368,11 +376,11 @@ |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="goods-team" v-if="moreBuyList.length > 0 && isPintuan" style="min-height: 280rpx;"> |
|
|
|
<view :class="spec.isChecked ? 'team-check1' : 'team2'" |
|
|
|
v-for="(spec, sIndex) in moreBuyList" :key="sIndex" |
|
|
|
@tap="selectMoreBuy(spec,sIndex)"> |
|
|
|
<view :class="spec.isChecked ? 'team-check1' : 'team2'" v-for="(spec, sIndex) in moreBuyList" |
|
|
|
:key="sIndex" @tap="selectMoreBuy(spec,sIndex)"> |
|
|
|
<view> |
|
|
|
<img :src="spec.productPicture" alt="" style="width: 70px;height: 70px;background-size: 100%;"> |
|
|
|
<img :src="spec.productPicture" alt="" |
|
|
|
style="width: 70px;height: 70px;background-size: 100%;border-radius: 10px;"> |
|
|
|
</view> |
|
|
|
<view class="team11" style="margin-top:10rpx;"> |
|
|
|
¥{{spec.attributeListPrice | sliceMsg}} |
|
|
|
@ -386,7 +394,9 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 优惠券选择 --> |
|
|
|
<view v-if="isPintuan" class="coupon-row" style="display: flex;height: 80rpx;line-height: 80rpx;border-top: 1px solid #eee;font-size: 28rpx;font-weight: 700; align-items:center; margin-top: 20rpx;" @tap="openCouponPopup"> |
|
|
|
<view v-if="isPintuan" class="coupon-row" |
|
|
|
style="display: flex;height: 80rpx;line-height: 80rpx;border-top: 1px solid #eee;font-size: 28rpx;font-weight: 700; align-items:center; margin-top: 20rpx;" |
|
|
|
@tap="openCouponPopup"> |
|
|
|
<view style="flex: 1; color: #777;"> |
|
|
|
优惠券 |
|
|
|
</view> |
|
|
|
@ -406,7 +416,8 @@ |
|
|
|
<view class="bottom popup-bottom-bar" style="padding-bottom: 40rpx;height: 160rpx;z-index: 10;"> |
|
|
|
<view v-if="isPintuan" class="pintuan1"> |
|
|
|
<template v-if="!groupId"> |
|
|
|
<view class="pintuan2" style="border-bottom-left-radius: 100rpx;border-top-left-radius: 100rpx;" |
|
|
|
<view class="pintuan2" |
|
|
|
style="border-bottom-left-radius: 100rpx;border-top-left-radius: 100rpx;" |
|
|
|
@tap.stop="submitPintuan(true)"> |
|
|
|
面对面团 |
|
|
|
</view> |
|
|
|
@ -417,8 +428,7 @@ |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<view class="pintuan2" |
|
|
|
style="width: 100%; border-radius: 100rpx;" |
|
|
|
<view class="pintuan2" style="width: 100%; border-radius: 100rpx;" |
|
|
|
@tap.stop="submitPintuan(false)"> |
|
|
|
参与拼团¥{{selectedGroupRule && selectedGroupRule.groupPriceAndMore ? parseFloat(selectedGroupRule.groupPriceAndMore).toFixed(2) : '0.00'}} |
|
|
|
</view> |
|
|
|
@ -444,7 +454,8 @@ |
|
|
|
<template> |
|
|
|
<!-- 占位假数据展示 --> |
|
|
|
<view class=""> |
|
|
|
<view class="goods-center team-wait-card" v-for="(item, index) in orderListWait" :key="index"> |
|
|
|
<view class="goods-center team-wait-card" v-for="(item, index) in orderListWait" |
|
|
|
:key="index"> |
|
|
|
<view class="list-right"> |
|
|
|
<view class="list-right-img"> |
|
|
|
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/94f91382e76c4f289d53fbf858e8732b.png" |
|
|
|
@ -456,7 +467,8 @@ |
|
|
|
{{item.targetMembers}}人拼 |
|
|
|
</view> |
|
|
|
<view style="line-height: 40rpx;padding-left: 10rpx;"> |
|
|
|
差<text class="missing-count">{{item.targetMembers - item.currentMembers}}人</text>拼成 |
|
|
|
差<text |
|
|
|
class="missing-count">{{item.targetMembers - item.currentMembers}}人</text>拼成 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -473,7 +485,8 @@ |
|
|
|
|
|
|
|
<!-- 支付弹出层 --> |
|
|
|
<uni-popup ref="payPopup" background-color="#fff"> |
|
|
|
<view class="pay-popup" style="height: 580rpx;background: #fff;border-radius: 40rpx 40rpx 0 0;padding-top: 40rpx;"> |
|
|
|
<view class="pay-popup" |
|
|
|
style="height: 580rpx;background: #fff;border-radius: 40rpx 40rpx 0 0;padding-top: 40rpx;"> |
|
|
|
<view class="content" style="height: 100%;margin-top:0"> |
|
|
|
<view class="box1"> |
|
|
|
<view style="display: flex;align-items: center;justify-content: center;height: 70rpx;"> |
|
|
|
@ -484,9 +497,10 @@ |
|
|
|
¥<text |
|
|
|
style="font-size: 60rpx;">{{backendTotalAmount ? backendTotalAmount.toFixed(2) : '0.00'}}</text> |
|
|
|
</view> |
|
|
|
<view style="height: 40rpx;text-align: center;color: #777;"> |
|
|
|
<view style="height: 40rpx;text-align: center;color: #777;"> |
|
|
|
|
|
|
|
<text v-if="groupId != '' && isFaceToFaceGroup">配送费(均摊) {{tuanzhangOrder.deliveryFee}} 元 </text> |
|
|
|
<text v-if="groupId != '' && isFaceToFaceGroup">配送费(均摊) {{tuanzhangOrder.deliveryFee}} 元 |
|
|
|
</text> |
|
|
|
|
|
|
|
<text v-if="groupdeliveryType == 1"> 打包费 {{currentItem.lunchBox}} 元</text> |
|
|
|
</view> |
|
|
|
@ -513,7 +527,9 @@ |
|
|
|
alt="" style="width: 36rpx;height: 36rpx;" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="btn" style="background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));width: 90%;height: 100rpx;border-radius: 100rpx;text-align: center;font-size: 28rpx;font-weight: 700;line-height: 100rpx;margin: 40rpx auto;" @tap="wxPayment"> |
|
|
|
<view class="btn" |
|
|
|
style="background: linear-gradient(90deg, rgba(227, 255, 150, 1), rgba(166, 255, 234, 1));width: 90%;height: 100rpx;border-radius: 100rpx;text-align: center;font-size: 28rpx;font-weight: 700;line-height: 100rpx;margin: 40rpx auto;" |
|
|
|
@tap="wxPayment"> |
|
|
|
确认付款 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -522,12 +538,15 @@ |
|
|
|
|
|
|
|
<!-- 参团成功提示弹出层 --> |
|
|
|
<uni-popup ref="joinSuccessPopup" background-color="#fff" @change="onJoinSuccessPopupChange"> |
|
|
|
<view class="pintuan-popup" style="position: relative;height: 1200rpx;width: 100%;border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;padding: 20rpx;"> |
|
|
|
<view class="pintuan-popup" |
|
|
|
style="position: relative;height: 1200rpx;width: 100%;border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;padding: 20rpx;"> |
|
|
|
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/ecd00dab1c9c44198d765bc08bc1bd71.png" alt="" |
|
|
|
style="position: absolute;top: 0;right: 0;width: 240rpx;height: 180rpx;" @tap="$refs.joinSuccessPopup.close()"> |
|
|
|
style="position: absolute;top: 0;right: 0;width: 240rpx;height: 180rpx;" |
|
|
|
@tap="$refs.joinSuccessPopup.close()"> |
|
|
|
<view style="position: absolute;bottom: 0;width: 100%;height: 760rpx;"> |
|
|
|
<view class="kaituan1"> |
|
|
|
<view class="kaituan1-title" style="margin-top: 100rpx;text-align: center;font-size: 40rpx;font-weight: bold;"> |
|
|
|
<view class="kaituan1-title" |
|
|
|
style="margin-top: 100rpx;text-align: center;font-size: 40rpx;font-weight: bold;"> |
|
|
|
参团成功! |
|
|
|
</view> |
|
|
|
<view class="kaituan1-title1" style="text-align: center;margin-top: 20rpx;color: #777;"> |
|
|
|
@ -548,9 +567,11 @@ |
|
|
|
<!-- 优惠券选择弹出层 --> |
|
|
|
<uni-popup ref="couponPopup" type="bottom" background-color="#F5F8F5"> |
|
|
|
<view style="width: 100%; height: 800rpx; display: flex; flex-direction: column;"> |
|
|
|
<view style="height: 100rpx; line-height: 100rpx; text-align: center; font-size: 32rpx; font-weight: bold; border-bottom: 1px solid #eee; position: relative; background: #fff;"> |
|
|
|
<view |
|
|
|
style="height: 100rpx; line-height: 100rpx; text-align: center; font-size: 32rpx; font-weight: bold; border-bottom: 1px solid #eee; position: relative; background: #fff;"> |
|
|
|
选择优惠券 |
|
|
|
<uni-icons type="closeempty" size="24" @tap="$refs.couponPopup.close()" style="position: absolute; right: 30rpx; top: 0;"></uni-icons> |
|
|
|
<uni-icons type="closeempty" size="24" @tap="$refs.couponPopup.close()" |
|
|
|
style="position: absolute; right: 30rpx; top: 0;"></uni-icons> |
|
|
|
</view> |
|
|
|
<scroll-view scroll-y style="flex: 1; padding: 20rpx; box-sizing: border-box;"> |
|
|
|
<view v-for="(item, index) in availableCoupons" :key="index" @tap="selectCoupon(item)" |
|
|
|
@ -559,22 +580,29 @@ |
|
|
|
<view style="color: #ff5722; font-size: 40rpx; font-weight: bold; width: 140rpx;"> |
|
|
|
<text style="font-size: 24rpx;">¥</text>{{item.discountAmount}} |
|
|
|
</view> |
|
|
|
<view style="flex: 1; display: flex; flex-direction: column; justify-content: center; margin-left: 20rpx;"> |
|
|
|
<view style="font-size: 28rpx; font-weight: bold; color: #333; margin-bottom: 6rpx;">{{item.couponName}}</view> |
|
|
|
<view style="font-size: 22rpx; color: #999;" v-if="item.minAmount > 0">满{{item.minAmount}}可用</view> |
|
|
|
<view |
|
|
|
style="flex: 1; display: flex; flex-direction: column; justify-content: center; margin-left: 20rpx;"> |
|
|
|
<view style="font-size: 28rpx; font-weight: bold; color: #333; margin-bottom: 6rpx;"> |
|
|
|
{{item.couponName}}</view> |
|
|
|
<view style="font-size: 22rpx; color: #999;" v-if="item.minAmount > 0"> |
|
|
|
满{{item.minAmount}}可用</view> |
|
|
|
<view style="font-size: 22rpx; color: #999;" v-else>无门槛使用</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<uni-icons v-if="selectedCoupon && selectedCoupon.id === item.id" type="checkmarkempty" size="20" color="#0b9b73"></uni-icons> |
|
|
|
<view v-else style="width: 40rpx; height: 40rpx; border-radius: 50%; border: 1px solid #ddd;"></view> |
|
|
|
<uni-icons v-if="selectedCoupon && selectedCoupon.id === item.id" type="checkmarkempty" |
|
|
|
size="20" color="#0b9b73"></uni-icons> |
|
|
|
<view v-else style="width: 40rpx; height: 40rpx; border-radius: 50%; border: 1px solid #ddd;"> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="availableCoupons.length===0" style="text-align:center; padding-top: 100rpx; color: #999;"> |
|
|
|
<view v-if="availableCoupons.length===0" |
|
|
|
style="text-align:center; padding-top: 100rpx; color: #999;"> |
|
|
|
暂无可用优惠券 |
|
|
|
</view> |
|
|
|
<view style="height:40rpx;"></view> |
|
|
|
</scroll-view> |
|
|
|
<view style="padding: 20rpx 40rpx; background: #fff;" v-if="availableCoupons.length>0"> |
|
|
|
<view @tap="selectCoupon(null)" style="width: 100%; height: 80rpx; background: linear-gradient(90deg, #e3ff96, #a6ffea); font-size: 30rpx; font-weight: 700; line-height: 80rpx; text-align: center; border-radius: 100rpx;"> |
|
|
|
<view @tap="selectCoupon(null)" |
|
|
|
style="width: 100%; height: 80rpx; background: linear-gradient(90deg, #e3ff96, #a6ffea); font-size: 30rpx; font-weight: 700; line-height: 80rpx; text-align: center; border-radius: 100rpx;"> |
|
|
|
不使用优惠券 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -591,30 +619,30 @@ |
|
|
|
type: '', |
|
|
|
shopId: '', |
|
|
|
shopItem: { |
|
|
|
shopIcon:'', |
|
|
|
shopName:'', |
|
|
|
shopScore:'', |
|
|
|
shopTypeTitle:'', |
|
|
|
saleCount:'', |
|
|
|
remark:'', |
|
|
|
shopIcon: '', |
|
|
|
shopName: '', |
|
|
|
shopScore: '', |
|
|
|
shopTypeTitle: '', |
|
|
|
saleCount: '', |
|
|
|
remark: '', |
|
|
|
}, |
|
|
|
productId: '', |
|
|
|
productItem: [], |
|
|
|
tuanzhangOrder:{}, |
|
|
|
tuanzhangOrder: {}, |
|
|
|
cartItems: [], |
|
|
|
moreBuyData:[], |
|
|
|
vModelValue:0, |
|
|
|
moreBuyData: [], |
|
|
|
vModelValue: 0, |
|
|
|
currentItem: {}, |
|
|
|
checkMoreBuyIndex:'', |
|
|
|
checkMoreBuyIndex: '', |
|
|
|
parsedSpecs: [], |
|
|
|
moreBuyList:[], |
|
|
|
moreBuyList: [], |
|
|
|
selectedGroupRule: {}, |
|
|
|
pageNum: 1, |
|
|
|
total: 1, |
|
|
|
chooseWaitType:false, |
|
|
|
chooseWaitType: false, |
|
|
|
// 导航栏高度(用于sticky top偏移) |
|
|
|
navBarHeight: 0, |
|
|
|
orderListWait:[], |
|
|
|
orderListWait: [], |
|
|
|
// 分类栏距离页面顶部的距离(用于上滑检测) |
|
|
|
menuListOffsetTop: 0, |
|
|
|
lastScrollTop: 0, |
|
|
|
@ -635,21 +663,21 @@ |
|
|
|
categoryId: '' |
|
|
|
}, |
|
|
|
menuButtonInfo: {}, |
|
|
|
groupdeliveryType:'', |
|
|
|
groupdeliveryType: '', |
|
|
|
isPintuan: true, |
|
|
|
groupId: null, |
|
|
|
isFaceToFaceGroup: false, |
|
|
|
targetMembers: 2, |
|
|
|
backendTotalAmount: 0, |
|
|
|
currentOrderId: '', |
|
|
|
onlineWorkerInterval:2500, |
|
|
|
onlineWorkerDuration:500, |
|
|
|
onlineWorkerInterval: 2500, |
|
|
|
onlineWorkerDuration: 500, |
|
|
|
menuList: [{ |
|
|
|
categoryName: '推荐', |
|
|
|
id: 'tuijian', |
|
|
|
checked: true |
|
|
|
}], |
|
|
|
shopRecommend:[], |
|
|
|
shopRecommend: [], |
|
|
|
availableCoupons: [], |
|
|
|
selectedCoupon: null |
|
|
|
} |
|
|
|
@ -670,7 +698,8 @@ |
|
|
|
const sysInfo = uni.getSystemInfoSync(); |
|
|
|
const bottomBarPx = Math.round(80 * sysInfo.windowWidth / 375); |
|
|
|
const h = sysInfo.windowHeight - this.navBarHeight - bottomBarPx; |
|
|
|
return 'display:flex;position:fixed;left:0;top:' + this.navBarHeight + 'px;margin:0 auto;right:0;height:' + h + 'px;z-index:50;background:#F5F8F5;box-sizing:border-box;'; |
|
|
|
return 'display:flex;position:fixed;left:0;top:' + this.navBarHeight + |
|
|
|
'px;margin:0 auto;right:0;height:' + h + 'px;z-index:50;background:#F5F8F5;box-sizing:border-box;'; |
|
|
|
} else { |
|
|
|
return 'display:flex;height:72%;margin-top:20rpx;'; |
|
|
|
} |
|
|
|
@ -707,12 +736,13 @@ |
|
|
|
} |
|
|
|
if (option.isFaceToFace) { |
|
|
|
this.isFaceToFaceGroup = option.isFaceToFace === '1' || option.isFaceToFace === 'true'; |
|
|
|
if(this.isFaceToFaceGroup){ |
|
|
|
this.tui.request("/mall/order/selectMallOrderByGroupId/"+this.groupId, "GET", {}, false, true).then((res) => { |
|
|
|
if (this.isFaceToFaceGroup) { |
|
|
|
this.tui.request("/mall/order/selectMallOrderByGroupId/" + this.groupId, "GET", {}, false, true).then(( |
|
|
|
res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.tuanzhangOrder = res.result; |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message,1000) |
|
|
|
that.tui.toast(res.message, 1000) |
|
|
|
return |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
@ -727,12 +757,12 @@ |
|
|
|
if (this.type == 'shop') { |
|
|
|
try { |
|
|
|
this.shopItem = JSON.parse(decodeURIComponent(option.item)); |
|
|
|
} catch(e) { |
|
|
|
} catch (e) { |
|
|
|
this.shopItem = JSON.parse(option.item); |
|
|
|
} |
|
|
|
if(this.shopItem.products){ |
|
|
|
if (this.shopItem.products) { |
|
|
|
this.shopRecommend = this.shopItem.products |
|
|
|
for(let i=0;i<this.shopRecommend.length;i++){ |
|
|
|
for (let i = 0; i < this.shopRecommend.length; i++) { |
|
|
|
this.shopRecommend[i].categoryId = '1' |
|
|
|
this.shopRecommend[i].isChecked = false |
|
|
|
} |
|
|
|
@ -740,7 +770,7 @@ |
|
|
|
} else { |
|
|
|
try { |
|
|
|
this.productItem = JSON.parse(decodeURIComponent(option.item)); |
|
|
|
} catch(e) { |
|
|
|
} catch (e) { |
|
|
|
this.productItem = JSON.parse(option.item); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -871,28 +901,29 @@ |
|
|
|
let hasTuijian = false |
|
|
|
let tuijianList = [] |
|
|
|
let putongList = [] |
|
|
|
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.productItem[i].sellEndTime) |
|
|
|
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 |
|
|
|
.productItem[i].sellEndTime) |
|
|
|
console.log(isEndTime) |
|
|
|
this.productItem[i].status = isEndTime ? 0 : 1 |
|
|
|
} |
|
|
|
if(that.productItem[i].isMoreBuy == 1){ |
|
|
|
if (that.productItem[i].isMoreBuy == 1) { |
|
|
|
//搭配的小料商品 |
|
|
|
that.productItem[i].isChecked = false |
|
|
|
that.moreBuyList.push(that.productItem[i]) |
|
|
|
} |
|
|
|
if(that.productItem[i].isPush == 1){ |
|
|
|
if (that.productItem[i].isPush == 1) { |
|
|
|
that.productItem[i].categoryId = 'tuijian' |
|
|
|
hasTuijian = true |
|
|
|
tuijianList.push(that.productItem[i]) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
putongList.push(that.productItem[i]) |
|
|
|
} |
|
|
|
} |
|
|
|
if(hasTuijian == false){ |
|
|
|
that.menuList.splice(0,1) |
|
|
|
}else{ |
|
|
|
if (hasTuijian == false) { |
|
|
|
that.menuList.splice(0, 1) |
|
|
|
} else { |
|
|
|
that.productItem = [...tuijianList, ...putongList]; |
|
|
|
} |
|
|
|
//获取当前店铺待成团列表 |
|
|
|
@ -902,7 +933,7 @@ |
|
|
|
that.pageNum = that.searchForm.pageNum; |
|
|
|
that.$forceUpdate(); |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message,1000); |
|
|
|
that.tui.toast(res.message, 1000); |
|
|
|
return; |
|
|
|
} |
|
|
|
uni.hideLoading(); |
|
|
|
@ -922,7 +953,7 @@ |
|
|
|
} |
|
|
|
that.$forceUpdate() |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message,1000) |
|
|
|
that.tui.toast(res.message, 1000) |
|
|
|
return |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
@ -941,7 +972,9 @@ |
|
|
|
this.$nextTick(() => { |
|
|
|
this.goodsListScrollTop = 0; |
|
|
|
}); |
|
|
|
setTimeout(() => { this.isSwitching = false; }, 300); |
|
|
|
setTimeout(() => { |
|
|
|
this.isSwitching = false; |
|
|
|
}, 300); |
|
|
|
this.$forceUpdate(); |
|
|
|
return; |
|
|
|
} |
|
|
|
@ -977,9 +1010,9 @@ |
|
|
|
} |
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
|
openOrderWait(item){ |
|
|
|
openOrderWait(item) { |
|
|
|
this.chooseWaitType = false |
|
|
|
if(item != ''){ |
|
|
|
if (item != '') { |
|
|
|
this.chooseWaitType = true |
|
|
|
this.orderListWait = item.orderListWait |
|
|
|
|
|
|
|
@ -1012,20 +1045,22 @@ |
|
|
|
let prices = item.productGroupBuyPrices || []; |
|
|
|
let validPrices = prices.filter(p => p.groupCount <= this.targetMembers); |
|
|
|
if (validPrices.length > 0) { |
|
|
|
this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? obj : max)); |
|
|
|
this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? |
|
|
|
obj : max)); |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
if (this.selectedCoupon) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
if (this.selectedGroupRule.groupPriceAndMore <= 0) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (prices.length > 0) { |
|
|
|
this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ? prev : curr)); |
|
|
|
this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ? |
|
|
|
prev : curr)); |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
if (this.selectedCoupon) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
if (this.selectedGroupRule.groupPriceAndMore <= 0) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1037,9 +1072,9 @@ |
|
|
|
if (item.productGroupBuyPrices && item.productGroupBuyPrices.length > 0) { |
|
|
|
this.selectedGroupRule = item.productGroupBuyPrices[0]; |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
if (this.selectedCoupon) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
if (this.selectedGroupRule.groupPriceAndMore <= 0) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1049,40 +1084,44 @@ |
|
|
|
} |
|
|
|
|
|
|
|
let moreBuyPrice = 0 |
|
|
|
for(let i = 0;i<this.moreBuyList.length;i++){ |
|
|
|
if(this.moreBuyList[i].quantity > 0){ |
|
|
|
moreBuyPrice += Number((Number(this.moreBuyList[i].quantity) * Number(this.sliceMsg2(this.moreBuyList[i].attributeListPrice))).toFixed(2)) |
|
|
|
for (let i = 0; i < this.moreBuyList.length; i++) { |
|
|
|
if (this.moreBuyList[i].quantity > 0) { |
|
|
|
moreBuyPrice += Number((Number(this.moreBuyList[i].quantity) * Number(this.sliceMsg2(this |
|
|
|
.moreBuyList[i].attributeListPrice))).toFixed(2)) |
|
|
|
} |
|
|
|
} |
|
|
|
this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
if (this.selectedCoupon) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
if (this.selectedGroupRule.groupPriceAndMore <= 0) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs.pintuanGroupPopup.open('bottom') |
|
|
|
}, |
|
|
|
getOrderWait(){ |
|
|
|
getOrderWait() { |
|
|
|
let that = this |
|
|
|
|
|
|
|
this.tui.request("/mall/order/getMallOrderGroupByShopId", "POST", { |
|
|
|
shopId:this.shopItem.id, |
|
|
|
status:0, |
|
|
|
isFace:0, |
|
|
|
shopId: this.shopItem.id, |
|
|
|
status: 0, |
|
|
|
isFace: 0, |
|
|
|
}, false, false).then((res) => { |
|
|
|
that.loadStatus = 'nomore'; |
|
|
|
if (res.code == 200) { |
|
|
|
that.orderListWait = res.result; |
|
|
|
for(let i = 0;i<that.productItem.length;i++){ |
|
|
|
for (let i = 0; i < that.productItem.length; i++) { |
|
|
|
that.productItem[i].orderListWait = [] |
|
|
|
if(that.orderListWait !=null){ |
|
|
|
that.productItem[i].minGroupCount = that.orderListWait[0].targetMembers - that.orderListWait[0].currentMembers |
|
|
|
for(let y = 0;y<that.orderListWait.length;y++){ |
|
|
|
if(that.productItem[i].id == that.orderListWait[y].productId){ |
|
|
|
if(that.productItem[i].minGroupCount > (that.orderListWait[y].targetMembers - that.orderListWait[y].currentMembers)){ |
|
|
|
that.productItem[i].minGroupCount = that.orderListWait[y].targetMembers - that.orderListWait[y].currentMembers |
|
|
|
if (that.orderListWait != null) { |
|
|
|
that.productItem[i].minGroupCount = that.orderListWait[0].targetMembers - that |
|
|
|
.orderListWait[0].currentMembers |
|
|
|
for (let y = 0; y < that.orderListWait.length; y++) { |
|
|
|
if (that.productItem[i].id == that.orderListWait[y].productId) { |
|
|
|
if (that.productItem[i].minGroupCount > (that.orderListWait[y] |
|
|
|
.targetMembers - that.orderListWait[y].currentMembers)) { |
|
|
|
that.productItem[i].minGroupCount = that.orderListWait[y] |
|
|
|
.targetMembers - that.orderListWait[y].currentMembers |
|
|
|
} |
|
|
|
that.productItem[i].orderListWait.push(that.orderListWait[y]) |
|
|
|
} |
|
|
|
@ -1092,18 +1131,18 @@ |
|
|
|
|
|
|
|
that.$forceUpdate(); |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message,1000); |
|
|
|
that.tui.toast(res.message, 1000); |
|
|
|
return; |
|
|
|
} |
|
|
|
uni.hideLoading(); |
|
|
|
}).catch((res) => {}); |
|
|
|
}, |
|
|
|
chooseOrderWait(item){ |
|
|
|
chooseOrderWait(item) { |
|
|
|
this.$refs.pintuanGroupPopup.close(); |
|
|
|
this.groupId = item.id; |
|
|
|
this.targetMembers = parseInt(item.targetMembers); |
|
|
|
this.selectedCoupon = null; |
|
|
|
if(this.chooseWaitType){ |
|
|
|
if (this.chooseWaitType) { |
|
|
|
this.fetchCoupons(); |
|
|
|
this.$refs.pintuanPopup.open('bottom'); |
|
|
|
} |
|
|
|
@ -1144,20 +1183,24 @@ |
|
|
|
let prices = item.productGroupBuyPrices || []; |
|
|
|
let validPrices = prices.filter(p => p.groupCount <= this.targetMembers); |
|
|
|
if (validPrices.length > 0) { |
|
|
|
this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? obj : max)); |
|
|
|
this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max |
|
|
|
.groupCount ? obj : max)); |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
if (this.selectedCoupon) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon |
|
|
|
.discountAmount); |
|
|
|
if (this.selectedGroupRule.groupPriceAndMore <= 0) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (prices.length > 0) { |
|
|
|
this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ? prev : curr)); |
|
|
|
this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ? |
|
|
|
prev : curr)); |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
if (this.selectedCoupon) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon |
|
|
|
.discountAmount); |
|
|
|
if (this.selectedGroupRule.groupPriceAndMore <= 0) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1177,9 +1220,10 @@ |
|
|
|
if (item.productGroupBuyPrices && item.productGroupBuyPrices.length > 0) { |
|
|
|
this.selectedGroupRule = item.productGroupBuyPrices[0]; |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
if (this.selectedCoupon) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon |
|
|
|
.discountAmount); |
|
|
|
if (this.selectedGroupRule.groupPriceAndMore <= 0) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1189,9 +1233,10 @@ |
|
|
|
} |
|
|
|
|
|
|
|
let moreBuyPrice = 0 |
|
|
|
for(let i = 0;i<this.moreBuyList.length;i++){ |
|
|
|
if(this.moreBuyList[i].quantity > 0){ |
|
|
|
moreBuyPrice += Number((Number(this.moreBuyList[i].quantity) * Number(this.sliceMsg2(this.moreBuyList[i].attributeListPrice))).toFixed(2)) |
|
|
|
for (let i = 0; i < this.moreBuyList.length; i++) { |
|
|
|
if (this.moreBuyList[i].quantity > 0) { |
|
|
|
moreBuyPrice += Number((Number(this.moreBuyList[i].quantity) * Number(this.sliceMsg2(this |
|
|
|
.moreBuyList[i].attributeListPrice))).toFixed(2)) |
|
|
|
} |
|
|
|
} |
|
|
|
this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice |
|
|
|
@ -1243,9 +1288,9 @@ |
|
|
|
selectGroupRule(rule) { |
|
|
|
this.selectedGroupRule = rule; |
|
|
|
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
if (this.selectedCoupon) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
if (this.selectedGroupRule.groupPriceAndMore <= 0) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1270,8 +1315,8 @@ |
|
|
|
let packageFee = parseFloat(this.currentItem.lunchBox || 0); |
|
|
|
|
|
|
|
this.currentItem.moreBuyData = [] |
|
|
|
for(let i = 0;i<this.moreBuyData.length;i++){ |
|
|
|
if(this.moreBuyData[i].quantity != undefined && this.moreBuyData[i].quantity > 0){ |
|
|
|
for (let i = 0; i < this.moreBuyData.length; i++) { |
|
|
|
if (this.moreBuyData[i].quantity != undefined && this.moreBuyData[i].quantity > 0) { |
|
|
|
this.currentItem.moreBuyData.push(this.moreBuyData[i]) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1302,15 +1347,17 @@ |
|
|
|
let items = [{ |
|
|
|
productId: this.currentItem.id, |
|
|
|
specs: JSON.stringify(specChoices || {}), |
|
|
|
price: parseFloat(this.selectedGroupRule && this.selectedGroupRule.groupPrice ? this.selectedGroupRule.groupPrice : 0), |
|
|
|
price: parseFloat(this.selectedGroupRule && this.selectedGroupRule.groupPrice ? this |
|
|
|
.selectedGroupRule.groupPrice : 0), |
|
|
|
quantity: 1 |
|
|
|
}]; |
|
|
|
if(this.currentItem.moreBuyData){ |
|
|
|
for(let a = 0;a<this.currentItem.moreBuyData.length;a++){ |
|
|
|
if (this.currentItem.moreBuyData) { |
|
|
|
for (let a = 0; a < this.currentItem.moreBuyData.length; a++) { |
|
|
|
items.push({ |
|
|
|
productId: this.currentItem.moreBuyData[a].id, |
|
|
|
specs: '', |
|
|
|
price: parseFloat(this.sliceMsg2(this.currentItem.moreBuyData[a].attributeListPrice)).toFixed(2), |
|
|
|
price: parseFloat(this.sliceMsg2(this.currentItem.moreBuyData[a].attributeListPrice)) |
|
|
|
.toFixed(2), |
|
|
|
quantity: this.currentItem.moreBuyData[a].quantity |
|
|
|
}); |
|
|
|
} |
|
|
|
@ -1335,14 +1382,16 @@ |
|
|
|
userCouponId: this.selectedCoupon ? this.selectedCoupon.id : null |
|
|
|
}; |
|
|
|
payload.regionId = JSON.parse(uni.getStorageSync('area')).id |
|
|
|
uni.showLoading({ title: '创建订单中...' }); |
|
|
|
uni.showLoading({ |
|
|
|
title: '创建订单中...' |
|
|
|
}); |
|
|
|
this.tui.request("/mall/order/create", "POST", payload, false, false).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (res.success && res.result) { |
|
|
|
this.currentOrderId = res.result.id; |
|
|
|
this.groupdeliveryType = res.result.deliveryType; |
|
|
|
this.backendTotalAmount = res.result.totalAmount; |
|
|
|
if(res.result.isFreeOrder == 1){ |
|
|
|
if (res.result.isFreeOrder == 1) { |
|
|
|
uni.showToast({ |
|
|
|
title: '锦鲤附身啦 免单' + res.result.freeAmount + '元', |
|
|
|
icon: 'none' |
|
|
|
@ -1351,7 +1400,10 @@ |
|
|
|
this.$refs.payPopup.open('bottom'); |
|
|
|
if (this.$refs.pintuanPopup) this.$refs.pintuanPopup.close(); |
|
|
|
} else { |
|
|
|
uni.showToast({ title: res.message || '下单失败', icon: 'none' }); |
|
|
|
uni.showToast({ |
|
|
|
title: res.message || '下单失败', |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
uni.hideLoading(); |
|
|
|
@ -1402,7 +1454,7 @@ |
|
|
|
|
|
|
|
const startMinutes = parseTime(begin); |
|
|
|
const endMinutes = parseTime(end); |
|
|
|
console.log(currentMinutes +','+startMinutes +','+endMinutes) |
|
|
|
console.log(currentMinutes + ',' + startMinutes + ',' + endMinutes) |
|
|
|
|
|
|
|
// 判断是否在区间内(包含端点) |
|
|
|
return currentMinutes >= startMinutes && currentMinutes <= endMinutes; |
|
|
|
@ -1483,47 +1535,48 @@ |
|
|
|
let bestRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? obj : max)); |
|
|
|
return parseFloat(bestRule.groupPrice).toFixed(2); |
|
|
|
}, |
|
|
|
selectMoreBuy(item,index){ |
|
|
|
selectMoreBuy(item, index) { |
|
|
|
this.checkMoreBuyIndex = item.id |
|
|
|
this.moreBuyList[index].isChecked = !this.moreBuyList[index].isChecked; |
|
|
|
let isHas = false |
|
|
|
let index1 = '' |
|
|
|
for(let i = 0;i<this.moreBuyList.length;i++){ |
|
|
|
if(this.moreBuyList[i].id != item.id && this.moreBuyList[index].isChecked){ |
|
|
|
for (let i = 0; i < this.moreBuyList.length; i++) { |
|
|
|
if (this.moreBuyList[i].id != item.id && this.moreBuyList[index].isChecked) { |
|
|
|
this.moreBuyList[i].isChecked = false |
|
|
|
} |
|
|
|
} |
|
|
|
for(let i = 0;i<this.moreBuyData.length;i++){ |
|
|
|
if(this.moreBuyData[i].id == this.moreBuyList[index].id){ |
|
|
|
for (let i = 0; i < this.moreBuyData.length; i++) { |
|
|
|
if (this.moreBuyData[i].id == this.moreBuyList[index].id) { |
|
|
|
isHas = true |
|
|
|
index1 = i |
|
|
|
this.vModelValue = this.moreBuyData[i].quantity ? this.moreBuyData[i].quantity : 0 |
|
|
|
this.moreBuyList[index].quantity = this.moreBuyData[i].quantity ? this.moreBuyData[i].quantity : 0 |
|
|
|
} |
|
|
|
} |
|
|
|
if(!isHas){ |
|
|
|
if (!isHas) { |
|
|
|
this.vModelValue = 0 |
|
|
|
} |
|
|
|
|
|
|
|
if(this.moreBuyList[index].isChecked && !isHas){ |
|
|
|
if (this.moreBuyList[index].isChecked && !isHas) { |
|
|
|
item.quantity = 0 |
|
|
|
this.moreBuyData.push(item) |
|
|
|
} |
|
|
|
if(!this.moreBuyList[index].isChecked && isHas){ |
|
|
|
this.moreBuyData.splice(index1,1) |
|
|
|
if (!this.moreBuyList[index].isChecked && isHas) { |
|
|
|
this.moreBuyData.splice(index1, 1) |
|
|
|
this.moreBuyList[index].quantity = 0 |
|
|
|
} |
|
|
|
|
|
|
|
let moreBuyPrice = 0 |
|
|
|
for(let i = 0;i<this.moreBuyData.length;i++){ |
|
|
|
if(this.moreBuyData[i].quantity > 0){ |
|
|
|
moreBuyPrice += Number((Number(this.moreBuyData[i].quantity) * Number(this.sliceMsg2(this.moreBuyData[i].attributeListPrice))).toFixed(2)) |
|
|
|
for (let i = 0; i < this.moreBuyData.length; i++) { |
|
|
|
if (this.moreBuyData[i].quantity > 0) { |
|
|
|
moreBuyPrice += Number((Number(this.moreBuyData[i].quantity) * Number(this.sliceMsg2(this |
|
|
|
.moreBuyData[i].attributeListPrice))).toFixed(2)) |
|
|
|
} |
|
|
|
} |
|
|
|
this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
if (this.selectedCoupon) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
if (this.selectedGroupRule.groupPriceAndMore <= 0) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1539,29 +1592,30 @@ |
|
|
|
return name; |
|
|
|
}, |
|
|
|
changeValue(type) { |
|
|
|
if(type == 'plus'){ |
|
|
|
if (type == 'plus') { |
|
|
|
this.vModelValue += 1 |
|
|
|
}else{ |
|
|
|
this.vModelValue = this.vModelValue > 0 ?this.vModelValue -= 1:0 |
|
|
|
} else { |
|
|
|
this.vModelValue = this.vModelValue > 0 ? this.vModelValue -= 1 : 0 |
|
|
|
} |
|
|
|
let moreBuyPrice = 0 |
|
|
|
for(let i = 0;i<this.moreBuyList.length;i++){ |
|
|
|
if(this.moreBuyList[i].id == this.checkMoreBuyIndex){ |
|
|
|
for (let i = 0; i < this.moreBuyList.length; i++) { |
|
|
|
if (this.moreBuyList[i].id == this.checkMoreBuyIndex) { |
|
|
|
this.moreBuyList[i].quantity = this.vModelValue |
|
|
|
} |
|
|
|
if(this.moreBuyList[i].quantity > 0){ |
|
|
|
moreBuyPrice += Number((Number(this.moreBuyList[i].quantity) * Number(this.sliceMsg2(this.moreBuyList[i].attributeListPrice))).toFixed(2)) |
|
|
|
if (this.moreBuyList[i].quantity > 0) { |
|
|
|
moreBuyPrice += Number((Number(this.moreBuyList[i].quantity) * Number(this.sliceMsg2(this |
|
|
|
.moreBuyList[i].attributeListPrice))).toFixed(2)) |
|
|
|
} |
|
|
|
} |
|
|
|
this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice |
|
|
|
if(this.selectedCoupon){ |
|
|
|
if (this.selectedCoupon) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
if (this.selectedGroupRule.groupPriceAndMore <= 0) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
} |
|
|
|
for(let i = 0;i<this.moreBuyData.length;i++){ |
|
|
|
if(this.moreBuyData[i].id == this.checkMoreBuyIndex){ |
|
|
|
for (let i = 0; i < this.moreBuyData.length; i++) { |
|
|
|
if (this.moreBuyData[i].id == this.checkMoreBuyIndex) { |
|
|
|
this.moreBuyData[i].quantity = this.vModelValue |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1588,24 +1642,26 @@ |
|
|
|
signType: res.signType, |
|
|
|
paySign: res.paySign, |
|
|
|
success: function(res2) { |
|
|
|
/* uni.showToast({ title: '支付成功', icon: 'success' }); |
|
|
|
that.tui.request("/api/wechat/pay/paySuccess", "POST", { |
|
|
|
outTradeNo: that.currentOrderId |
|
|
|
}, false, false).then((res3) => { |
|
|
|
if(res3.code == 200){ |
|
|
|
uni.redirectTo({ |
|
|
|
url: '/package1/order/orderConfirm?id=' + that.currentOrderId + '&groupId=' + that.groupId + '&amount=' + this.backendTotalAmount |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
that.tui.toast("订单创建失败,请联系客服处理"); |
|
|
|
} |
|
|
|
}) */ |
|
|
|
/* uni.showToast({ title: '支付成功', icon: 'success' }); |
|
|
|
that.tui.request("/api/wechat/pay/paySuccess", "POST", { |
|
|
|
outTradeNo: that.currentOrderId |
|
|
|
}, false, false).then((res3) => { |
|
|
|
if(res3.code == 200){ |
|
|
|
uni.redirectTo({ |
|
|
|
url: '/package1/order/orderConfirm?id=' + that.currentOrderId + '&groupId=' + that.groupId + '&amount=' + this.backendTotalAmount |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
that.tui.toast("订单创建失败,请联系客服处理"); |
|
|
|
} |
|
|
|
}) */ |
|
|
|
uni.redirectTo({ |
|
|
|
url: '/package1/order/orderConfirm?id=' + that.currentOrderId + '&groupId=' + that.groupId + '&amount=' + that.backendTotalAmount |
|
|
|
url: '/package1/order/orderConfirm?id=' + that |
|
|
|
.currentOrderId + '&groupId=' + that.groupId + |
|
|
|
'&amount=' + that.backendTotalAmount |
|
|
|
}); |
|
|
|
}, |
|
|
|
fail: function(err) { |
|
|
|
that.tui.toast("支付失败或取消",1000); |
|
|
|
that.tui.toast("支付失败或取消", 1000); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
@ -1615,11 +1671,16 @@ |
|
|
|
`/hiver/order/payMallOrderSuccess?orderId=${that.currentOrderId}&workerId=`, |
|
|
|
"POST", {}, false, false).then(res2 => { |
|
|
|
that.$refs.payPopup.close(); |
|
|
|
uni.showToast({ title: '支付成功(模拟)', icon: 'none' }); |
|
|
|
setTimeout(() => { that.$refs.joinSuccessPopup.open('bottom'); }, 1500); |
|
|
|
uni.showToast({ |
|
|
|
title: '支付成功(模拟)', |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
setTimeout(() => { |
|
|
|
that.$refs.joinSuccessPopup.open('bottom'); |
|
|
|
}, 1500); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message,1000); |
|
|
|
that.tui.toast(res.message, 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -1634,11 +1695,12 @@ |
|
|
|
fetchCoupons() { |
|
|
|
let userId = uni.getStorageSync('id'); |
|
|
|
if (!userId) return; |
|
|
|
let amount = this.selectedGroupRule && this.selectedGroupRule.groupPriceAndMore ? this.selectedGroupRule.groupPriceAndMore : 0; |
|
|
|
let amount = this.selectedGroupRule && this.selectedGroupRule.groupPriceAndMore ? this.selectedGroupRule |
|
|
|
.groupPriceAndMore : 0; |
|
|
|
this.tui.request('/mall/coupon/available', 'GET', { |
|
|
|
userId: userId, |
|
|
|
applyScene: 1, |
|
|
|
regionId:JSON.parse(uni.getStorageSync('area')).id, |
|
|
|
regionId: JSON.parse(uni.getStorageSync('area')).id, |
|
|
|
amount: amount, |
|
|
|
merchantId: this.shopItem.id || '0' |
|
|
|
}, false, true).then((res) => { |
|
|
|
@ -1654,7 +1716,7 @@ |
|
|
|
selectCoupon(item) { |
|
|
|
this.selectedCoupon = item; |
|
|
|
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount); |
|
|
|
if(this.selectedGroupRule.groupPriceAndMore <= 0){ |
|
|
|
if (this.selectedGroupRule.groupPriceAndMore <= 0) { |
|
|
|
this.selectedGroupRule.groupPriceAndMore = 0.01 |
|
|
|
} |
|
|
|
this.$refs.couponPopup.close(); |
|
|
|
@ -2001,7 +2063,7 @@ |
|
|
|
font-size: 28rpx; |
|
|
|
font-weight: 700; |
|
|
|
border-radius: 20rpx; |
|
|
|
float:right; |
|
|
|
float: right; |
|
|
|
} |
|
|
|
|
|
|
|
.bottom { |
|
|
|
@ -2149,6 +2211,7 @@ |
|
|
|
font-size: 28rpx; |
|
|
|
font-weight: 700; |
|
|
|
} |
|
|
|
|
|
|
|
.spec22 { |
|
|
|
display: flex; |
|
|
|
white-space: nowrap; |
|
|
|
@ -2188,9 +2251,10 @@ |
|
|
|
float: left; |
|
|
|
margin-right: 40rpx; |
|
|
|
font-weight: 700; |
|
|
|
padding: 10px; |
|
|
|
padding: 10px; |
|
|
|
} |
|
|
|
.team2{ |
|
|
|
|
|
|
|
.team2 { |
|
|
|
width: 190rpx; |
|
|
|
height: 270rpx; |
|
|
|
background: rgba(247, 248, 248, 0.6); |
|
|
|
@ -2198,22 +2262,25 @@ |
|
|
|
float: left; |
|
|
|
text-align: center; |
|
|
|
margin-right: 20px; |
|
|
|
padding: 10px 10px 0; |
|
|
|
padding: 10px 10px 0; |
|
|
|
} |
|
|
|
|
|
|
|
.team-check1 { |
|
|
|
width: 190rpx; |
|
|
|
height: 280rpx; |
|
|
|
height: 270rpx; |
|
|
|
background: rgba(166, 255, 234, 1); |
|
|
|
border-radius: 20rpx; |
|
|
|
font-size: 26rpx; |
|
|
|
text-align: center; |
|
|
|
line-height: 40rpx; |
|
|
|
line-height: 30rpx; |
|
|
|
float: left; |
|
|
|
margin-right: 40rpx; |
|
|
|
position: relative; |
|
|
|
padding: 10px 10px 0; |
|
|
|
font-weight: 700; |
|
|
|
font-weight: 700; |
|
|
|
margin-top: 10px; |
|
|
|
} |
|
|
|
|
|
|
|
.team-check { |
|
|
|
width: 154rpx; |
|
|
|
height: auto; |
|
|
|
@ -2227,11 +2294,13 @@ |
|
|
|
position: relative; |
|
|
|
padding: 10px; |
|
|
|
} |
|
|
|
.zaixian-swiper{ |
|
|
|
|
|
|
|
.zaixian-swiper { |
|
|
|
flex: 1; |
|
|
|
height: 126rpx; |
|
|
|
} |
|
|
|
.zaixian-item{ |
|
|
|
|
|
|
|
.zaixian-item { |
|
|
|
height: 126rpx; |
|
|
|
line-height: 126rpx; |
|
|
|
font-size: 24rpx; |
|
|
|
@ -2259,7 +2328,8 @@ |
|
|
|
padding: 30rpx 0 30rpx 30rpx; |
|
|
|
flex: 1; |
|
|
|
} |
|
|
|
.jiaobiao{ |
|
|
|
|
|
|
|
.jiaobiao { |
|
|
|
position: absolute; |
|
|
|
top: -16rpx; |
|
|
|
right: -12rpx; |
|
|
|
@ -2272,6 +2342,7 @@ |
|
|
|
line-height: 40rpx; |
|
|
|
font-size: 20rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.list-right-img { |
|
|
|
height: 80rpx; |
|
|
|
display: flex; |
|
|
|
@ -2876,6 +2947,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
@keyframes sparkFloat { |
|
|
|
|
|
|
|
0%, |
|
|
|
100% { |
|
|
|
opacity: 0.5; |
|
|
|
@ -2906,6 +2978,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
@keyframes ctaBreath { |
|
|
|
|
|
|
|
0%, |
|
|
|
100% { |
|
|
|
transform: scale(1); |
|
|
|
@ -2919,6 +2992,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
@keyframes pricePop { |
|
|
|
|
|
|
|
0%, |
|
|
|
100% { |
|
|
|
transform: scale(1); |
|
|
|
@ -2930,6 +3004,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
@keyframes flamePulse { |
|
|
|
|
|
|
|
0%, |
|
|
|
100% { |
|
|
|
opacity: 0.92; |
|
|
|
@ -2943,6 +3018,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
@keyframes sparkBurst { |
|
|
|
|
|
|
|
0%, |
|
|
|
100% { |
|
|
|
opacity: 0.35; |
|
|
|
@ -2956,6 +3032,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
@keyframes bagBounce { |
|
|
|
|
|
|
|
0%, |
|
|
|
100% { |
|
|
|
transform: translateY(0); |
|
|
|
@ -2979,6 +3056,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
@keyframes cardPulse { |
|
|
|
|
|
|
|
0%, |
|
|
|
100% { |
|
|
|
transform: scale(1); |
|
|
|
|