Compare commits

...

11 Commits

Author SHA1 Message Date
赵毅
ad58591164 修改购物车数量显示不一致问题 2025-09-05 16:11:40 +08:00
赵毅
14826e746d 易购添加库存不足提示 2025-09-05 15:57:03 +08:00
赵毅
389951eeb6 车牌颜色 蓝色 等改为 蓝牌 2025-09-05 15:56:46 +08:00
赵毅
03ef856fd3 修复团购列表页面和详情页规格 数据不一致问题 2025-09-05 14:35:38 +08:00
赵毅
15afc855fc 区分团购和易购的购物车数据 2025-09-05 14:27:47 +08:00
赵毅
f2983a3de5 添加规格选择的popup 2025-09-05 11:34:04 +08:00
赵毅
0c7b906afd 修改易购页面显示undefined的bug 2025-09-05 10:54:11 +08:00
赵毅
5218893ae7 修改易购点击分类的页面显示问题 2025-09-05 10:41:40 +08:00
赵毅
5d77e6f407 修改易购页面显示undefined的bug 2025-09-05 10:40:38 +08:00
赵毅
e7108f6182 Merge branch 'feature-yjs' of https://git.hshuishang.com/maguodong/uniapp-ZHSQ into feature/yi 2025-09-05 08:43:29 +08:00
kikyoe
4036939b9c 售后 2025-09-04 09:35:35 +08:00
13 changed files with 140 additions and 72 deletions

View File

@ -5,6 +5,7 @@
:class="['tabItem', selectedTab === index ? 'active2' : '']" @click="selectTab(index, item)">
{{ item.category_name }}
</view>
</view>
<view class="content">

View File

@ -51,7 +51,7 @@ export default {
color: '请选择',
show: false,
//
colorOptions: ['蓝色', '黄色', '黑色', '白色', '绿色', '渐变绿底黑字', '黄绿双拼底黑字'],
colorOptions: ['蓝牌', '黄牌', '黑牌', '白牌', '绿牌', '渐变绿底黑字', '黄绿双拼底黑字'],
//
selectedColorIndex: -1
};

View File

@ -32,7 +32,7 @@ page {
/* 车牌类型标签样式 */
.plate-type-box{
padding: 11rpx 2rpx;
border: 1rpx solid #1890ff;
/* border: 1rpx solid #1890ff; */
border-radius: 8rpx;
}

View File

@ -7,11 +7,11 @@
<view class="license-plate">
<view class="plate-type-box">
<text class="plate-type" :class="{
'plate-color-blue': item.car_number_color === '蓝',
'plate-color-yellow': item.car_number_color === '黄',
'plate-color-black': item.car_number_color === '黑',
'plate-color-white': item.car_number_color === '白',
'plate-color-green': item.car_number_color === '绿',
'plate-color-blue': item.car_number_color === '蓝',
'plate-color-yellow': item.car_number_color === '黄',
'plate-color-black': item.car_number_color === '黑',
'plate-color-white': item.car_number_color === '白',
'plate-color-green': item.car_number_color === '绿',
'plate-color-gradient-green': item.car_number_color === '渐变绿底黑字',
'plate-color-yellow-green': item.car_number_color === '黄绿双拼底黑字'
}">{{ item.car_number_color }}</text>

View File

@ -158,7 +158,7 @@ export default {
color: '请选择',
show: false,
//
colorOptions: ['蓝色', '黄色', '黑色', '白色', '绿色', '渐变绿底黑字', '黄绿双拼底黑字'],
colorOptions: ['蓝牌', '黄牌', '黑牌', '白牌', '绿牌', '渐变绿底黑字', '黄绿双拼底黑字'],
//
selectedColorIndex: -1,

View File

@ -24,15 +24,15 @@ image {
}
.isDay {
background-color: orangered;
height: 35rpx;
border-radius: 5rpx;
color: white;
font-size: 22rpx;
text-align: center;
justify-content: center;
padding: 5rpx 10rpx;
display: flex;
background-color: orangered;
height: 35rpx;
border-radius: 5rpx;
color: white;
font-size: 22rpx;
text-align: center;
justify-content: center;
padding: 5rpx 10rpx;
display: flex;
}
.tag {
@ -188,7 +188,7 @@ image {
margin: 0 20rpx;
margin-top: 20rpx;
font-weight: 700;
display: flex;
display: flex;
}
.Msg {
@ -598,15 +598,17 @@ image {
margin: 5rpx 5rpx 0 5rpx;
}
.itemSizeBox {
margin: 30rpx;
}
.itemSize {
width: 30%;
font-size: 26rpx;
color: #333;
background: #F6F7FB;
border-radius: 40rpx;
padding: 10rpx 15rpx;
white-space: nowrap;
margin:20rpx 30rpx;
}
.itemSize_active {
@ -614,15 +616,14 @@ image {
color: #fff;
}
.itemSize-img{
.itemSize-img {
width: 100rpx;
height: 100rpx;
margin-right: 30rpx;
border-radius: 20rpx;
border:1rpx solid red;
}
.itemSize_top{
.itemSize_top {
display: flex;
margin-left: 30rpx;
}

View File

@ -39,7 +39,7 @@
{{ item.goods_spec }} / {{ item.goods_unit }}
</view>
</view>
<view class="GG_rigth">
<view class="GG_rigth" @click="showSizePopup">
{{ info.commodity_goods_info_list.length }}<u-icon size="26rpx" name="arrow-right"></u-icon>
</view>
</view>
@ -297,9 +297,9 @@
<view class="itemSize_price">{{ changePrice }}/</view>
</view>
</view>
<view class="itemSize" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id"
@click="changeGG(item, index)" :class="index == currentGGIndex ? 'itemSize_active' : ''">
{{ item.goods_name }} {{ item.goods_spec }} / {{ item.goods_unit }}
<view class="itemSizeBox" v-for="(item, index) in info.commodity_goods_info_list" :key="item.id"
@click="changeGG(item, index)">
<text class="itemSize" :class="index == currentGGIndex ? 'itemSize_active' : ''">{{ item.goods_name }} {{ item.goods_spec }} / {{ item.goods_unit }}</text>
</view>
</u-popup>
</view>
@ -459,7 +459,7 @@ export default {
console.log("this.currentGG", this.currentGG);
this.currentGGIndex = 0;
this.changeImg = this.currentGG.commodity_pic[0]
this.changeImg = picUrl + this.currentGG.commodity_pic[0]
this.changeName = this.currentGG.goods_alias
this.changePrice = this.currentGG.sales_price
});
@ -490,7 +490,7 @@ export default {
count: 0
};
}
this.changeImg = item.commodity_pic[0]
this.changeImg = picUrl + item.commodity_pic[0]
this.changeName = item.goods_alias
this.changePrice = item.sales_price
this.getComment(item.goods_id)
@ -515,20 +515,35 @@ export default {
addCar() {
let that = this;
//
const currentGoods = this.info.commodity_goods_info_list[this.currentGGIndex];
//
const currentQuantity = currentGoods.cart_count ? currentGoods.cart_count.count : 0;
const stockQuantity = currentGoods.stock_quantity || 0;
//
if (currentQuantity >= stockQuantity) {
uni.showToast({
title: "库存不足",
icon: "none",
duration: 2000
});
return;
}
//
let goods_id_and_count = [];
this.info.commodity_goods_info_list[this.currentGGIndex].cart_count = {
count: 1,
count: currentQuantity + 1,
};
this.info.commodity_goods_info_list.forEach((item) => {
console.log(item.cart_count);
goods_id_and_count.push({
goods_id: item.id,
count: item.cart_count ? item.cart_count.count : 0,
});
});
console.log(goods_id_and_count);
// update
request(apiArr.updateCar, "POST", {
goods_id_and_count,

View File

@ -177,7 +177,10 @@ export default {
})
},
getShopdetail() {
return request(shopApi.getCar, "POST").then((res) => {
const params = {
is_group_buy: 1,
}
return request(shopApi.getCar, "POST", params).then((res) => {
this.carNum = res.total;
//
this.goodsDetail = [].concat(res.same_day_cart_list, res.normal_cart_list)
@ -206,7 +209,11 @@ export default {
});
});
},
toDetail(item) {
toDetail(itemObj) {
const item = {
...itemObj,
groupById: itemObj.group_buy_activity_info.id
};
NavgateTo(`/packages/shop/groupPurchaseDetail/index?item=${JSON.stringify(item)}`)
},
//
@ -295,7 +302,10 @@ export default {
},
//
shopCar() {
NavgateTo("../shopCar/index");
const item = {
is_group_buy: 1,
}
NavgateTo("../shopCar/index?item=" + JSON.stringify(item));
},
//
getEndTheCountdown(endTime) {

View File

@ -328,6 +328,7 @@ export default {
boxshadow1: false,
boxshadow2: false,
id: "",
groupById: "",
info: "",
currentIndex: "1", //
@ -568,9 +569,11 @@ export default {
},
//
getGoodsInfo() {
request(apiArr.getGoodsInfo, "POST", {
const params = {
id: this.id,
}).then((res) => {
group_buy_activity_id: this.groupById
}
request(apiArr.getGoodsInfo, "POST", params).then((res) => {
//
res.commodity_goods_info_list.forEach((item) => {
item.goods_detail_pic = item.goods_detail_pic ? item.goods_detail_pic.split(",") : [];
@ -590,10 +593,14 @@ export default {
});
}
const currentTime = new Date().getTime();
// group_buy_activity_info
if (res.commodity_goods_info_list && Array.isArray(res.commodity_goods_info_list)) {
res.commodity_goods_info_list = res.commodity_goods_info_list.filter(item => {
return item.group_buy_activity_info !== null
const startTime = new Date(item.group_buy_goods_activity.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(item.group_buy_goods_activity.group_buy_activity_info?.end_time).getTime();
return item.group_buy_activity_info !== null && currentTime >= startTime && currentTime <= endTime
});
}
@ -670,7 +677,10 @@ export default {
},
getShopCarList() {
return request(apiArr.getCar, "POST", {}).then((res) => {
const params = {
is_group_buy: 1,
}
return request(apiArr.getCar, "POST", params).then((res) => {
//
this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list)
.flatMap(supplier => supplier.commodity_cart_and_goods_model);
@ -809,6 +819,7 @@ export default {
this.top = meun.top;
this.localHeight = meun.height;
this.id = this.itemObj.commodity_id ? this.itemObj.commodity_id : this.itemObj.id;
this.groupById = this.itemObj.groupById
if (this.itemObj.commodity_id) {
this.endTime = this.itemObj.group_buy_activity_info.end_time
} else {

View File

@ -168,8 +168,8 @@
</view>
</view>
<!-- 运费 -->
<view class="goods-desc" style="margin-top: 10rpx;">运费 {{
item.commodity_goods_info.freight }}</view>
<!-- <view class="goods-desc" style="margin-top: 10rpx;">运费 {{
item.commodity_goods_info.freight }}</view> -->
</view>
<view class="quantity-control">
<view class="decrease-btn" @tap.stop="decreaseQuantity(item)">-</view>
@ -420,14 +420,24 @@ export default {
}
},
increaseQuantity(item) {
console.log("🚀 ~ increaseQuantity ~ item:", item)
const currentTime = new Date().getTime();
const startTime = new Date(item.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(item.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (item.count >= item.commodity_goods_info.stock_quantity) {
uni.showToast({
title: '库存不足',
icon: 'none'
});
return
}
if (currentTime >= startTime && currentTime <= endTime) {
if (item.count == 0) {
item.count += item.commodity_goods_info.min_order_quantity
} else {
if (item.count == item.commodity_goods_info.total_stock) {
if (item.count >= item.commodity_goods_info.stock_quantity) {
uni.showToast({
title: '库存不足',
icon: 'none'
@ -474,9 +484,11 @@ export default {
const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (currentTime >= startTime && currentTime <= endTime) {
total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
// total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.group_buy_price * goods.count;
} else {
total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
// total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.sales_price * goods.count;
}
});
//
@ -488,9 +500,11 @@ export default {
const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (currentTime >= startTime && currentTime <= endTime) {
total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
// total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.group_buy_price * goods.count;
} else {
total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
// total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.sales_price * goods.count;
}
});
//

View File

@ -320,7 +320,7 @@ page {
overflow: hidden;
/* position: relative; */
position: fixed;
z-index: 999;
z-index: 15;
padding: 20rpx 10rpx;
background-color: #ffffff;
}
@ -404,7 +404,7 @@ page {
position: absolute;
left: 0;
top: 160rpx;
z-index: 11;
z-index: 20;
}
.header2 .slide .slide_con .slide_conBox:nth-child(5n) {

View File

@ -33,17 +33,6 @@
<!-- 整体展开的顶部 -->
<view class="header header2" v-if="topShow">
<!-- <view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
<view class="searchBox_left">
<u-icon name="arrow-left" size="20px" color="#000"></u-icon>
</view>
<view class="searchBox_ipt">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"></image>
<input type="text" placeholder="输入商品名称" />
</view>
</view> -->
<view class="slide">
<view class="slide_con">
<view v-for="(item, index) in CateList" :key="index" class="slide_conBox" @click="changeCate(item.id)">
@ -95,7 +84,7 @@
</view>
</view>
<!-- 右下阴影 -->
<view class="boxshadow2" v-if="cateListShow"></view>
<view class="boxshadow2" v-if="cateListShow" @click="changeCateListShow"></view>
<view class="CateIte">
<view class="CateInfo"
@ -312,9 +301,8 @@ export default {
NavgateTo('1')
},
changeCate(id) {
this.checkItem(0)
// ID
this.currentCategoryId = id;
// id
@ -322,6 +310,7 @@ export default {
if (category) {
// leftCateListnull
this.leftCateList = category.level_two_category || [];
this.tagList1 = category.level_three_category || [];
if (this.leftCateList.length > 0) {
this.currentLeftCateId = this.leftCateList[0].id;
this.secondId = this.leftCateList[0].id;
@ -342,7 +331,7 @@ export default {
this.cateListShow = false
this.rightTopActive = index;
// ID
this.selectedTagId = this.tagList[index].id;
this.selectedTagId = this.tagList[index]?.id;
},
//
topOpen() {
@ -448,26 +437,42 @@ export default {
},
//
handleQuantityChange(val, item) {
//
// valvalue
//
const quantity = typeof val === 'object' && val !== null && 'value' in val ? val.value : val;
//
let currentQuantity = 0;
let stockQuantity = 0;
let goodsToUpdate = null;
// items.commodity_goods_info_list[0].quantity
if (
item.commodity_goods_info_list &&
item.commodity_goods_info_list.length
) {
this.goodsId = item.commodity_goods_info_list[0].id;
// 使$set
this.$set(item.commodity_goods_info_list[0], 'quantity', quantity);
currentQuantity = item.commodity_goods_info_list[0].quantity || 0;
stockQuantity = item.commodity_goods_info_list[0].stock_quantity || 0;
goodsToUpdate = item.commodity_goods_info_list[0];
}
// ite.quantity
else {
this.goodsId = item.id;
// 使$set
this.$set(item, 'quantity', quantity);
currentQuantity = item.quantity || 0;
stockQuantity = item.stock_quantity || 0;
goodsToUpdate = item;
}
//
if (quantity > currentQuantity && currentQuantity >= stockQuantity) {
uni.showToast({
title: "库存不足",
icon: 'none'
});
return;
}
// 使$set
this.$set(goodsToUpdate, 'quantity', quantity);
const params = {
user_id: uni.getStorageSync("userId"),

View File

@ -228,7 +228,7 @@ export default {
isDayshow: false,
isParcelPostchecked: false,
parcelPostshow: false,
is_group_buy: ''
};
},
// watch: {
@ -303,7 +303,10 @@ export default {
//
getShopCar() {
request(apiArr.getCar, "POST", {}).then((res) => {
const params = {
is_group_buy: this.is_group_buy
}
request(apiArr.getCar, "POST", params).then((res) => {
if (res.normal_cart_list.length > 0) {
res.normal_cart_list.forEach((item) => {
item.checked = false;
@ -614,6 +617,13 @@ export default {
this.shopCarTotal++;
}
} else {
if (carItem.count >= carItem.commodity_goods_info.stock_quantity) {
uni.showToast({
title: '库存不足',
icon: 'none'
});
return
}
carItem.count++;
this.shopCarTotal++;
}
@ -717,6 +727,7 @@ export default {
const meun = menuButtonInfo();
this.top = meun.top;
this.localHeight = meun.height;
this.is_group_buy = options.item ? JSON.parse(options.item).is_group_buy : ''
this.getShopCar();
},
onShow() {