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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -177,7 +177,10 @@ export default {
}) })
}, },
getShopdetail() { 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.carNum = res.total;
// //
this.goodsDetail = [].concat(res.same_day_cart_list, res.normal_cart_list) 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)}`) NavgateTo(`/packages/shop/groupPurchaseDetail/index?item=${JSON.stringify(item)}`)
}, },
// //
@ -295,7 +302,10 @@ export default {
}, },
// //
shopCar() { shopCar() {
NavgateTo("../shopCar/index"); const item = {
is_group_buy: 1,
}
NavgateTo("../shopCar/index?item=" + JSON.stringify(item));
}, },
// //
getEndTheCountdown(endTime) { getEndTheCountdown(endTime) {

View File

@ -328,6 +328,7 @@ export default {
boxshadow1: false, boxshadow1: false,
boxshadow2: false, boxshadow2: false,
id: "", id: "",
groupById: "",
info: "", info: "",
currentIndex: "1", // currentIndex: "1", //
@ -568,9 +569,11 @@ export default {
}, },
// //
getGoodsInfo() { getGoodsInfo() {
request(apiArr.getGoodsInfo, "POST", { const params = {
id: this.id, 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) => { res.commodity_goods_info_list.forEach((item) => {
item.goods_detail_pic = item.goods_detail_pic ? item.goods_detail_pic.split(",") : []; 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 // group_buy_activity_info
if (res.commodity_goods_info_list && Array.isArray(res.commodity_goods_info_list)) { 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 => { 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() { 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) this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list)
.flatMap(supplier => supplier.commodity_cart_and_goods_model); .flatMap(supplier => supplier.commodity_cart_and_goods_model);
@ -809,6 +819,7 @@ export default {
this.top = meun.top; this.top = meun.top;
this.localHeight = meun.height; this.localHeight = meun.height;
this.id = this.itemObj.commodity_id ? this.itemObj.commodity_id : this.itemObj.id; this.id = this.itemObj.commodity_id ? this.itemObj.commodity_id : this.itemObj.id;
this.groupById = this.itemObj.groupById
if (this.itemObj.commodity_id) { if (this.itemObj.commodity_id) {
this.endTime = this.itemObj.group_buy_activity_info.end_time this.endTime = this.itemObj.group_buy_activity_info.end_time
} else { } else {

View File

@ -168,8 +168,8 @@
</view> </view>
</view> </view>
<!-- 运费 --> <!-- 运费 -->
<view class="goods-desc" style="margin-top: 10rpx;">运费 {{ <!-- <view class="goods-desc" style="margin-top: 10rpx;">运费 {{
item.commodity_goods_info.freight }}</view> item.commodity_goods_info.freight }}</view> -->
</view> </view>
<view class="quantity-control"> <view class="quantity-control">
<view class="decrease-btn" @tap.stop="decreaseQuantity(item)">-</view> <view class="decrease-btn" @tap.stop="decreaseQuantity(item)">-</view>
@ -420,14 +420,24 @@ export default {
} }
}, },
increaseQuantity(item) { increaseQuantity(item) {
console.log("🚀 ~ increaseQuantity ~ item:", item)
const currentTime = new Date().getTime(); const currentTime = new Date().getTime();
const startTime = new Date(item.commodity_goods_info.group_buy_activity_info?.start_time).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(); 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 (currentTime >= startTime && currentTime <= endTime) {
if (item.count == 0) { if (item.count == 0) {
item.count += item.commodity_goods_info.min_order_quantity item.count += item.commodity_goods_info.min_order_quantity
} else { } else {
if (item.count == item.commodity_goods_info.total_stock) { if (item.count >= item.commodity_goods_info.stock_quantity) {
uni.showToast({ uni.showToast({
title: '库存不足', title: '库存不足',
icon: 'none' icon: 'none'
@ -474,9 +484,11 @@ export default {
const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime(); 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(); const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (currentTime >= startTime && currentTime <= endTime) { 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 { } 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 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(); const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (currentTime >= startTime && currentTime <= endTime) { 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 { } 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; overflow: hidden;
/* position: relative; */ /* position: relative; */
position: fixed; position: fixed;
z-index: 999; z-index: 15;
padding: 20rpx 10rpx; padding: 20rpx 10rpx;
background-color: #ffffff; background-color: #ffffff;
} }
@ -404,7 +404,7 @@ page {
position: absolute; position: absolute;
left: 0; left: 0;
top: 160rpx; top: 160rpx;
z-index: 11; z-index: 20;
} }
.header2 .slide .slide_con .slide_conBox:nth-child(5n) { .header2 .slide .slide_con .slide_conBox:nth-child(5n) {

View File

@ -33,17 +33,6 @@
<!-- 整体展开的顶部 --> <!-- 整体展开的顶部 -->
<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_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">
<view class="slide_con"> <view class="slide_con">
<view v-for="(item, index) in CateList" :key="index" class="slide_conBox" @click="changeCate(item.id)"> <view v-for="(item, index) in CateList" :key="index" class="slide_conBox" @click="changeCate(item.id)">
@ -95,7 +84,7 @@
</view> </view>
</view> </view>
<!-- 右下阴影 --> <!-- 右下阴影 -->
<view class="boxshadow2" v-if="cateListShow"></view> <view class="boxshadow2" v-if="cateListShow" @click="changeCateListShow"></view>
<view class="CateIte"> <view class="CateIte">
<view class="CateInfo" <view class="CateInfo"
@ -312,9 +301,8 @@ export default {
NavgateTo('1') NavgateTo('1')
}, },
changeCate(id) { changeCate(id) {
this.checkItem(0)
// ID // ID
this.currentCategoryId = id; this.currentCategoryId = id;
// id // id
@ -322,6 +310,7 @@ export default {
if (category) { if (category) {
// leftCateListnull // leftCateListnull
this.leftCateList = category.level_two_category || []; this.leftCateList = category.level_two_category || [];
this.tagList1 = category.level_three_category || [];
if (this.leftCateList.length > 0) { if (this.leftCateList.length > 0) {
this.currentLeftCateId = this.leftCateList[0].id; this.currentLeftCateId = this.leftCateList[0].id;
this.secondId = this.leftCateList[0].id; this.secondId = this.leftCateList[0].id;
@ -342,7 +331,7 @@ export default {
this.cateListShow = false this.cateListShow = false
this.rightTopActive = index; this.rightTopActive = index;
// ID // ID
this.selectedTagId = this.tagList[index].id; this.selectedTagId = this.tagList[index]?.id;
}, },
// //
topOpen() { topOpen() {
@ -448,26 +437,42 @@ export default {
}, },
// //
handleQuantityChange(val, item) { handleQuantityChange(val, item) {
//
// valvalue
//
const quantity = typeof val === 'object' && val !== null && 'value' in val ? val.value : val; 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 // items.commodity_goods_info_list[0].quantity
if ( if (
item.commodity_goods_info_list && item.commodity_goods_info_list &&
item.commodity_goods_info_list.length item.commodity_goods_info_list.length
) { ) {
this.goodsId = item.commodity_goods_info_list[0].id; this.goodsId = item.commodity_goods_info_list[0].id;
// 使$set currentQuantity = item.commodity_goods_info_list[0].quantity || 0;
this.$set(item.commodity_goods_info_list[0], 'quantity', quantity); stockQuantity = item.commodity_goods_info_list[0].stock_quantity || 0;
goodsToUpdate = item.commodity_goods_info_list[0];
} }
// ite.quantity // ite.quantity
else { else {
this.goodsId = item.id; this.goodsId = item.id;
// 使$set currentQuantity = item.quantity || 0;
this.$set(item, 'quantity', quantity); 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 = { const params = {
user_id: uni.getStorageSync("userId"), user_id: uni.getStorageSync("userId"),

View File

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