修改易购部分bug
This commit is contained in:
parent
267bac2149
commit
916e41e424
@ -503,7 +503,7 @@ export default {
|
|||||||
submitPayment() {
|
submitPayment() {
|
||||||
// 检查所有供应商是否都选择了自提点
|
// 检查所有供应商是否都选择了自提点
|
||||||
const supplierIds = [...new Set(this.orderList2.map(item =>
|
const supplierIds = [...new Set(this.orderList2.map(item =>
|
||||||
item.commodity_goods_info.group_buy_activity_info?.supplier_id || 'default'
|
item.supplier_id || 'default'
|
||||||
))];
|
))];
|
||||||
|
|
||||||
const allHaveZTAddress = supplierIds.every(supplierId => {
|
const allHaveZTAddress = supplierIds.every(supplierId => {
|
||||||
@ -536,7 +536,7 @@ export default {
|
|||||||
const currentTime = new Date().getTime();
|
const currentTime = new Date().getTime();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
supplier_id: firstItem.commodity_goods_info.group_buy_activity_info.supplier_id,
|
supplier_id: firstItem.supplier_id,
|
||||||
supplier_name: firstItem.supplier_name || '',
|
supplier_name: firstItem.supplier_name || '',
|
||||||
is_same_day: firstItem.commodity_goods_info.is_same_day,
|
is_same_day: firstItem.commodity_goods_info.is_same_day,
|
||||||
receiving_name: ztAddress.name || '',
|
receiving_name: ztAddress.name || '',
|
||||||
@ -548,7 +548,7 @@ export default {
|
|||||||
const endTime = new Date(item.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
|
const endTime = new Date(item.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
|
||||||
const isGroupBuy = currentTime >= startTime && currentTime <= endTime;
|
const isGroupBuy = currentTime >= startTime && currentTime <= endTime;
|
||||||
return {
|
return {
|
||||||
goods_id: item.commodity_goods_info.goods_id,
|
goods_id: item.goods_id,
|
||||||
count: item.count,
|
count: item.count,
|
||||||
price: isGroupBuy ? item.commodity_goods_info.group_buy_price : item.commodity_goods_info.sales_price,
|
price: isGroupBuy ? item.commodity_goods_info.group_buy_price : item.commodity_goods_info.sales_price,
|
||||||
freight: item.commodity_goods_info.freight,
|
freight: item.commodity_goods_info.freight,
|
||||||
|
|||||||
@ -162,7 +162,7 @@ page {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
margin-bottom: 150rpx;
|
padding-bottom: 260rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CateInfo_tit {
|
.CateInfo_tit {
|
||||||
@ -403,7 +403,7 @@ page {
|
|||||||
padding-bottom: 30rpx;
|
padding-bottom: 30rpx;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 160rpx;
|
||||||
z-index: 11;
|
z-index: 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,7 +429,7 @@ page {
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
top: 0;
|
top: 160rpx;
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
@ -578,17 +578,10 @@ page {
|
|||||||
.shop_car {
|
.shop_car {
|
||||||
width: 140rpx;
|
width: 140rpx;
|
||||||
height: 140rpx;
|
height: 140rpx;
|
||||||
position: fixed;
|
position: absolute;
|
||||||
right: -95rpx;
|
bottom: 100rpx;
|
||||||
bottom: 180rpx;
|
right: 10rpx;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
transition: right 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shop_car:hover,
|
|
||||||
.shop_car.show {
|
|
||||||
right: 33rpx;
|
|
||||||
/* 鼠标悬停或滚动时完全显示 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.shop_car image {
|
.shop_car image {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<view class="container">
|
<view class="container">
|
||||||
<!-- 顶部展开后的阴影 -->
|
<!-- 顶部展开后的阴影 -->
|
||||||
<view class="boxshadow" v-if="topShow"></view>
|
<view class="boxshadow" v-if="topShow"></view>
|
||||||
<view class="header" :class="topShow ? 'op0' : ''">
|
<view class="header">
|
||||||
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
|
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
|
||||||
<view class="searchBox_left" @click="back">
|
<view class="searchBox_left" @click="back">
|
||||||
<u-icon name="arrow-left" size="20px" color="#000"></u-icon>
|
<u-icon name="arrow-left" size="20px" color="#000"></u-icon>
|
||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
<!-- 整体展开的顶部 -->
|
<!-- 整体展开的顶部 -->
|
||||||
<view class="header header2" v-if="topShow">
|
<view class="header header2" v-if="topShow">
|
||||||
<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
|
<!-- <view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
|
||||||
<view class="searchBox_left">
|
<view class="searchBox_left">
|
||||||
<u-icon name="arrow-left" size="20px" color="#000"></u-icon>
|
<u-icon name="arrow-left" size="20px" color="#000"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
@ -42,7 +42,7 @@
|
|||||||
mode="aspectFill"></image>
|
mode="aspectFill"></image>
|
||||||
<input type="text" placeholder="输入商品名称" />
|
<input type="text" placeholder="输入商品名称" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<view class="slide">
|
<view class="slide">
|
||||||
<view class="slide_con">
|
<view class="slide_con">
|
||||||
@ -312,28 +312,7 @@ export default {
|
|||||||
NavgateTo('1')
|
NavgateTo('1')
|
||||||
},
|
},
|
||||||
|
|
||||||
// 显示购物车图标
|
|
||||||
showShopCar() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
try {
|
|
||||||
const shopCar = document.querySelector('.shop_car');
|
|
||||||
if (shopCar) {
|
|
||||||
shopCar.classList.add('show');
|
|
||||||
|
|
||||||
// 2秒后自动隐藏
|
|
||||||
clearTimeout(this.hideShopCarTimer);
|
|
||||||
this.hideShopCarTimer = setTimeout(() => {
|
|
||||||
const carElement = document.querySelector('.shop_car');
|
|
||||||
if (carElement) {
|
|
||||||
carElement.classList.remove('show');
|
|
||||||
}
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
changeCate(id) {
|
changeCate(id) {
|
||||||
// 更新当前选中的顶级分类ID
|
// 更新当前选中的顶级分类ID
|
||||||
@ -360,6 +339,7 @@ export default {
|
|||||||
},
|
},
|
||||||
//选择右下角分类
|
//选择右下角分类
|
||||||
checkItem(index) {
|
checkItem(index) {
|
||||||
|
this.cateListShow = false
|
||||||
this.rightTopActive = index;
|
this.rightTopActive = index;
|
||||||
// 获取选中的标签ID
|
// 获取选中的标签ID
|
||||||
this.selectedTagId = this.tagList[index].id;
|
this.selectedTagId = this.tagList[index].id;
|
||||||
@ -548,39 +528,17 @@ export default {
|
|||||||
this.localHeight = meun.height;
|
this.localHeight = meun.height;
|
||||||
this.getCateList();
|
this.getCateList();
|
||||||
// this.getShopCarList();
|
// this.getShopCarList();
|
||||||
|
|
||||||
// 初始化定时器
|
|
||||||
this.hideShopCarTimer = null;
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getShopCarList();
|
this.getShopCarList();
|
||||||
this.getGoodsList();
|
this.getGoodsList();
|
||||||
|
|
||||||
// 添加滚动事件监听 - 使用nextTick确保DOM已渲染
|
|
||||||
this.$nextTick(() => {
|
|
||||||
try {
|
|
||||||
const conRight = document.querySelector('.Con_right');
|
|
||||||
if (conRight) {
|
|
||||||
this.conRightElement = conRight;
|
|
||||||
conRight.addEventListener('scroll', this.showShopCar);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onHide() {
|
onHide() {
|
||||||
// 移除滚动事件监听
|
// 移除滚动事件监听
|
||||||
if (this.conRightElement) {
|
if (this.conRightElement) {
|
||||||
this.conRightElement.removeEventListener('scroll', this.showShopCar);
|
|
||||||
this.conRightElement = null;
|
this.conRightElement = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清除定时器
|
|
||||||
if (this.hideShopCarTimer) {
|
|
||||||
clearTimeout(this.hideShopCarTimer);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.flag) {
|
if (this.flag) {
|
||||||
|
|||||||
@ -293,6 +293,10 @@ export default {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (arr.length == 0) {
|
||||||
|
this.$u.toast("请选择商品");
|
||||||
|
return;
|
||||||
|
}
|
||||||
// NavgateTo(`../submitOrder/index?shopCarList=${JSON.stringify(arr)}`);
|
// NavgateTo(`../submitOrder/index?shopCarList=${JSON.stringify(arr)}`);
|
||||||
NavgateTo(`../groupPurchaseSubmit/index?shopCarList=${JSON.stringify(arr)}`);
|
NavgateTo(`../groupPurchaseSubmit/index?shopCarList=${JSON.stringify(arr)}`);
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user