wangfukang 3 weeks ago
parent
commit
90e62ef229
  1. 275
      package1/buyFood/buyFood.vue

275
package1/buyFood/buyFood.vue

@ -1,14 +1,32 @@
<template> <template>
<!-- 代买饭页 --> <!-- 代买饭页 -->
<view class="page1"> <view class="page1" :class="{'store-group-checkout': isStoreGroupOrder}">
<view class="title"> <view class="title">
<view class="title-sreach"> <view class="title-sreach">
<view class="back-btn" @tap="back" :style="{'top': menuButtonInfo.top +'px'}"> <view class="back-btn" @tap="back" :style="{'top': menuButtonInfo.top +'px'}">
<uni-icons type="left" size="28"></uni-icons> <uni-icons type="left" size="28"></uni-icons>
</view> </view>
</view> </view>
<view class="store-hero-effect" v-if="isStoreGroupOrder">
<view class="store-orb orb-a"></view>
<view class="store-orb orb-b"></view>
<view class="store-hero-copy">
<view class="store-hero-badge">团购到店</view>
<view class="store-hero-title">约上同学一起省</view>
<view class="store-hero-sub">支付后到店核销拼成更划算</view>
</view>
<view class="store-verify-card">
<view class="verify-icon"></view>
<view>
<view class="verify-title">到店核销</view>
<view class="verify-sub">无需配送</view>
</view>
</view>
<view class="store-float-tag tag-a">拼团价</view>
<view class="store-float-tag tag-b">同校热拼</view>
</view>
</view> </view>
<view class="tab-wrap"> <view class="tab-wrap" v-if="!isStoreGroupOrder">
<view class="tab1" v-if="isPaotui"> <view class="tab1" v-if="isPaotui">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6b3a4d4c61ee42feb29e69d6fcfd2c1e.png" alt="" <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6b3a4d4c61ee42feb29e69d6fcfd2c1e.png" alt=""
class="tab-bg" /> class="tab-bg" />
@ -31,12 +49,12 @@
</view> </view>
<view class="ziqu-box" v-if="isPaotui==false"> <view class="ziqu-box" v-if="isPaotui==false">
<view class="ziqu-xuanfu"> <view class="ziqu-xuanfu">
取餐信息 {{isStoreGroupOrder ? '到店信息' : '取餐信息'}}
</view> </view>
<view class="ziqu-address"> <view class="ziqu-address">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/e13c675ffd4547d0b271900902ffea66.png" alt="" /> <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/e13c675ffd4547d0b271900902ffea66.png" alt="" />
<view class="ziqu-text"> <view class="ziqu-text">
地址{{shopItem.shopAddress || ''}} {{isStoreGroupOrder ? '到店地址' : '地址'}}{{shopItem.shopAddress || ''}}
</view> </view>
</view> </view>
</view> </view>
@ -229,7 +247,7 @@
{{deliveryFeeCalc.toFixed(2)}} {{deliveryFeeCalc.toFixed(2)}}
</view> </view>
</view> </view>
<view class="fee-row" v-if="isPaotui ==false"> <view class="fee-row" v-if="isPaotui ==false && !isStoreGroupOrder">
<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>
@ -239,7 +257,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="fee-row" v-if="isPaotui == false"> <view class="fee-row" v-if="isPaotui == false && !isStoreGroupOrder">
<view class="fee-label"> <view class="fee-label">
用餐方式 用餐方式
</view> </view>
@ -295,7 +313,7 @@
<view class="buy-bottom"> <view class="buy-bottom">
<view class="bottom-btn" @tap="submitPay"> <view class="bottom-btn" @tap="submitPay">
<image class="pay-btn-gif" src="/static/images/img/loading.gif" mode="aspectFit"></image> <image class="pay-btn-gif" src="/static/images/img/loading.gif" mode="aspectFit"></image>
<text>立即支付{{nowMake && isPaotui == false ? '-即刻出餐' : ''}}</text> <text>{{isStoreGroupOrder ? '立即支付-到店核销' : ('立即支付' + (nowMake && isPaotui == false ? '-即刻出餐' : ''))}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -478,6 +496,7 @@
data() { data() {
return { return {
warnPopup: 'shdz', warnPopup: 'shdz',
orderScene: '',
isPaotui: true, isPaotui: true,
menuButtonInfo: {}, menuButtonInfo: {},
formData: { formData: {
@ -527,6 +546,7 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.orderScene = option.orderScene || '';
if (option.shopItem) { if (option.shopItem) {
this.shopItem = JSON.parse(decodeURIComponent(option.shopItem)); this.shopItem = JSON.parse(decodeURIComponent(option.shopItem));
} }
@ -539,10 +559,17 @@
console.log("1111111",this.groupItem) console.log("1111111",this.groupItem)
this.isGroupBuy = this.groupItem.orderType === 2; this.isGroupBuy = this.groupItem.orderType === 2;
this.isFaceToFace = this.groupItem.isFaceToFace || false; this.isFaceToFace = this.groupItem.isFaceToFace || false;
this.orderScene = this.groupItem.orderScene || this.orderScene;
} }
if (option.packageFee) { if (option.packageFee) {
this.totalPackageFee = parseFloat(option.packageFee) || 0; this.totalPackageFee = parseFloat(option.packageFee) || 0;
} }
if (this.isStoreGroupOrder) {
this.isPaotui = false;
this.nowMake = false;
this.isPack = 0;
this.totalPackageFee = 0;
}
}, },
computed: { computed: {
goodsAmountCalc() { goodsAmountCalc() {
@ -560,6 +587,9 @@
return this.cartItems.reduce((acc, curr) => acc + (curr.quantity * parseFloat(curr.price)), 0); return this.cartItems.reduce((acc, curr) => acc + (curr.quantity * parseFloat(curr.price)), 0);
} }
}, },
isStoreGroupOrder() {
return this.orderScene === 'storeGroup' || (this.groupItem && this.groupItem.orderScene === 'storeGroup') || this.shopItem.merchantType == 2;
},
highFloorFeeCalc() { highFloorFeeCalc() {
if (this.selected === 'zhiding' && this.assignedWorker) { if (this.selected === 'zhiding' && this.assignedWorker) {
let hFee = parseFloat(this.assignedWorker.highFloorFee || 0); let hFee = parseFloat(this.assignedWorker.highFloorFee || 0);
@ -659,7 +689,8 @@
let shopItemStr = encodeURIComponent(JSON.stringify(this.shopItem)); let shopItemStr = encodeURIComponent(JSON.stringify(this.shopItem));
let isFTF = this.isFaceToFace ? 1 : 0; let isFTF = this.isFaceToFace ? 1 : 0;
console.log(shopItemStr) console.log(shopItemStr)
let path = `/package2/group/groupBuySingle?type=shop&item=${shopItemStr}&groupId=${groupId}&targetMembers=${targetMembers}&isFaceToFace=${isFTF}`; let sceneQuery = this.isStoreGroupOrder ? '&orderScene=storeGroup' : '';
let path = `/package2/group/groupBuySingle?type=shop&item=${shopItemStr}&groupId=${groupId}&targetMembers=${targetMembers}&isFaceToFace=${isFTF}${sceneQuery}`;
return { return {
title: '我发起了一个拼团,快来一起拼单吧!', title: '我发起了一个拼团,快来一起拼单吧!',
@ -769,7 +800,7 @@
regionId:JSON.parse(uni.getStorageSync('area')).id, regionId:JSON.parse(uni.getStorageSync('area')).id,
applyScene: 1, applyScene: 1,
amount: amount, amount: amount,
merchantId: this.shopItem.shopId || '0' merchantId: this.shopItem.id || this.shopItem.shopId || '0'
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200 && res.result) { if (res.code == 200 && res.result) {
this.availableCoupons = res.result; this.availableCoupons = res.result;
@ -983,13 +1014,13 @@
} }
} }
let deliveryType = this.isPaotui ? 1 : 2; let deliveryType = this.isStoreGroupOrder ? 2 : (this.isPaotui ? 1 : 2);
let payload = { let payload = {
userId: uni.getStorageSync('id') || 'test-user123', userId: uni.getStorageSync('id') || 'test-user123',
shopId: this.shopItem.id, shopId: this.shopItem.id,
deliveryType: deliveryType, deliveryType: deliveryType,
isPack: this.isPaotui ? 1 : this.isPack, isPack: this.isStoreGroupOrder ? 0 : (this.isPaotui ? 1 : this.isPack),
packageFee: this.isPaotui ? this.packageFee : 0, packageFee: this.isPaotui && !this.isStoreGroupOrder ? this.packageFee : 0,
remark: this.remark, remark: this.remark,
items: items, items: items,
receiverName: this.formData.address ? this.formData.address.receiverName : '', receiverName: this.formData.address ? this.formData.address.receiverName : '',
@ -1044,7 +1075,7 @@
uni.showLoading({ uni.showLoading({
title: '创建订单中...' title: '创建订单中...'
}); });
if(this.nowMake && deliveryType == 2){ if(this.nowMake && deliveryType == 2 && !this.isStoreGroupOrder){
payload.userRequireMake = 1 payload.userRequireMake = 1
} }
payload.regionId = JSON.parse(uni.getStorageSync('area')).id payload.regionId = JSON.parse(uni.getStorageSync('area')).id
@ -2326,4 +2357,222 @@
0%, 100% { transform: scale(0.6); opacity: 0.35; } 0%, 100% { transform: scale(0.6); opacity: 0.35; }
50% { transform: scale(1.45); opacity: 1; } 50% { transform: scale(1.45); opacity: 1; }
} }
.store-group-checkout {
background:
radial-gradient(circle at 84% 110rpx, rgba(255, 229, 190, 0.74), transparent 270rpx),
linear-gradient(180deg, #fff0df 0%, #fff8f0 420rpx, #fffaf6 100%);
color: #3f2618;
}
.store-group-checkout .title {
background:
radial-gradient(circle at 78% 22%, rgba(255, 246, 221, 0.72), transparent 240rpx),
linear-gradient(135deg, #ff8a5c 0%, #ffbd70 58%, #ffe2bf 100%);
position: relative;
overflow: hidden;
}
.store-group-checkout .box1,
.store-group-checkout .ziqu-box,
.store-group-checkout .goods-card,
.store-group-checkout .coupon-row {
border-color: rgba(255, 218, 183, 0.82);
box-shadow: 0 16rpx 38rpx rgba(178, 102, 48, 0.12);
}
.store-group-checkout .ziqu-xuanfu,
.store-group-checkout .bottom-btn,
.store-group-checkout .btn,
.store-group-checkout .coupon-clear-btn {
background: linear-gradient(90deg, #ff7444, #ffb35e);
color: #fff;
box-shadow: 0 16rpx 30rpx rgba(255, 126, 39, 0.22);
}
.store-group-checkout .shop-title,
.store-group-checkout .goods-name,
.store-group-checkout .total-label {
color: #3f2618;
}
.store-group-checkout .fee-label,
.store-group-checkout .goods-content-center,
.store-group-checkout .goods-content-bottom,
.store-group-checkout .ziqu-text {
color: #8f684c;
}
.store-group-checkout .total-price,
.store-group-checkout .coupon-discount,
.store-group-checkout .pintuan-left-price {
color: #f0441f;
}
.store-hero-effect {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
pointer-events: none;
}
.store-orb {
position: absolute;
border-radius: 50%;
filter: blur(1rpx);
animation: storeOrbFloat 4.2s ease-in-out infinite;
}
.orb-a {
width: 260rpx;
height: 260rpx;
right: -78rpx;
top: 78rpx;
background: rgba(255, 247, 218, 0.5);
}
.orb-b {
width: 160rpx;
height: 160rpx;
left: 64rpx;
bottom: 24rpx;
background: rgba(255, 118, 73, 0.18);
animation-delay: 0.8s;
}
.store-hero-copy {
position: absolute;
left: 92rpx;
top: 132rpx;
color: #fff;
text-shadow: 0 8rpx 18rpx rgba(170, 77, 24, 0.22);
}
.store-hero-badge {
display: inline-block;
height: 42rpx;
line-height: 42rpx;
padding: 0 18rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.42);
color: #9b4d28;
font-size: 21rpx;
font-weight: 900;
box-shadow: 0 10rpx 24rpx rgba(170, 77, 24, 0.1);
}
.store-hero-title {
margin-top: 14rpx;
font-size: 46rpx;
font-weight: 900;
line-height: 56rpx;
letter-spacing: 2rpx;
}
.store-hero-sub {
margin-top: 6rpx;
color: rgba(111, 61, 35, 0.78);
font-size: 24rpx;
font-weight: 800;
line-height: 34rpx;
text-shadow: none;
}
.store-verify-card {
position: absolute;
right: 30rpx;
bottom: 34rpx;
display: flex;
align-items: center;
width: 210rpx;
padding: 16rpx 18rpx;
border-radius: 30rpx;
background: rgba(255, 255, 255, 0.52);
border: 1rpx solid rgba(255, 255, 255, 0.68);
box-shadow: 0 18rpx 36rpx rgba(170, 77, 24, 0.12);
backdrop-filter: blur(10rpx);
animation: storeCardFloat 3.2s ease-in-out infinite;
}
.verify-icon {
width: 58rpx;
height: 58rpx;
margin-right: 12rpx;
border-radius: 22rpx;
background: linear-gradient(135deg, #ff7444, #ffb35e);
color: #fff;
font-size: 28rpx;
font-weight: 900;
line-height: 58rpx;
text-align: center;
}
.verify-title {
color: #3f2618;
font-size: 24rpx;
font-weight: 900;
line-height: 30rpx;
}
.verify-sub {
margin-top: 4rpx;
color: #9b6a4c;
font-size: 20rpx;
font-weight: 800;
}
.store-float-tag {
position: absolute;
padding: 8rpx 16rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.54);
color: #e96632;
font-size: 20rpx;
font-weight: 900;
box-shadow: 0 10rpx 22rpx rgba(170, 77, 24, 0.1);
animation: storeTagFloat 3.6s ease-in-out infinite;
}
.tag-a {
right: 196rpx;
top: 86rpx;
transform: rotate(6deg);
}
.tag-b {
left: 330rpx;
bottom: 92rpx;
transform: rotate(-5deg);
animation-delay: 0.7s;
}
@keyframes storeOrbFloat {
0%, 100% {
transform: translateY(0) scale(1);
}
50% {
transform: translateY(-18rpx) scale(1.06);
}
}
@keyframes storeCardFloat {
0%, 100% {
transform: translateY(0) rotate(0deg);
}
50% {
transform: translateY(-10rpx) rotate(1deg);
}
}
@keyframes storeTagFloat {
0%, 100% {
transform: translateY(0) rotate(-4deg);
}
50% {
transform: translateY(-10rpx) rotate(4deg);
}
}
</style> </style>
Loading…
Cancel
Save