Compare commits

..

No commits in common. "ad58591164a846c3884954fa2649c5f494ba5bac" and "916e41e42438c3c949e6939c3790cd27bd5827fe" have entirely different histories.

13 changed files with 72 additions and 140 deletions

View File

@ -5,7 +5,6 @@
: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,17 +598,15 @@ 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 {
@ -616,14 +614,15 @@ 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" @click="showSizePopup">
<view class="GG_rigth">
{{ 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="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 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>
</u-popup>
</view>
@ -459,7 +459,7 @@ export default {
console.log("this.currentGG", this.currentGG);
this.currentGGIndex = 0;
this.changeImg = picUrl + this.currentGG.commodity_pic[0]
this.changeImg = 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 = picUrl + item.commodity_pic[0]
this.changeImg = item.commodity_pic[0]
this.changeName = item.goods_alias
this.changePrice = item.sales_price
this.getComment(item.goods_id)
@ -515,35 +515,20 @@ 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: currentQuantity + 1,
count: 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,10 +177,7 @@ export default {
})
},
getShopdetail() {
const params = {
is_group_buy: 1,
}
return request(shopApi.getCar, "POST", params).then((res) => {
return request(shopApi.getCar, "POST").then((res) => {
this.carNum = res.total;
//
this.goodsDetail = [].concat(res.same_day_cart_list, res.normal_cart_list)
@ -209,11 +206,7 @@ export default {
});
});
},
toDetail(itemObj) {
const item = {
...itemObj,
groupById: itemObj.group_buy_activity_info.id
};
toDetail(item) {
NavgateTo(`/packages/shop/groupPurchaseDetail/index?item=${JSON.stringify(item)}`)
},
//
@ -302,10 +295,7 @@ export default {
},
//
shopCar() {
const item = {
is_group_buy: 1,
}
NavgateTo("../shopCar/index?item=" + JSON.stringify(item));
NavgateTo("../shopCar/index");
},
//
getEndTheCountdown(endTime) {

View File

@ -328,7 +328,6 @@ export default {
boxshadow1: false,
boxshadow2: false,
id: "",
groupById: "",
info: "",
currentIndex: "1", //
@ -569,11 +568,9 @@ export default {
},
//
getGoodsInfo() {
const params = {
request(apiArr.getGoodsInfo, "POST", {
id: this.id,
group_buy_activity_id: this.groupById
}
request(apiArr.getGoodsInfo, "POST", params).then((res) => {
}).then((res) => {
//
res.commodity_goods_info_list.forEach((item) => {
item.goods_detail_pic = item.goods_detail_pic ? item.goods_detail_pic.split(",") : [];
@ -593,14 +590,10 @@ 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 => {
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
return item.group_buy_activity_info !== null
});
}
@ -677,10 +670,7 @@ export default {
},
getShopCarList() {
const params = {
is_group_buy: 1,
}
return request(apiArr.getCar, "POST", params).then((res) => {
return request(apiArr.getCar, "POST", {}).then((res) => {
//
this.carOrderList = [].concat(res.same_day_cart_list, res.normal_cart_list)
.flatMap(supplier => supplier.commodity_cart_and_goods_model);
@ -819,7 +809,6 @@ 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,24 +420,14 @@ 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.stock_quantity) {
if (item.count == item.commodity_goods_info.total_stock) {
uni.showToast({
title: '库存不足',
icon: 'none'
@ -484,11 +474,9 @@ 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;
total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
} else {
// total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.sales_price * goods.count;
total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
}
});
//
@ -500,11 +488,9 @@ 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;
total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
} else {
// total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.sales_price * goods.count;
total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
}
});
//

View File

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

View File

@ -33,6 +33,17 @@
<!-- 整体展开的顶部 -->
<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)">
@ -84,7 +95,7 @@
</view>
</view>
<!-- 右下阴影 -->
<view class="boxshadow2" v-if="cateListShow" @click="changeCateListShow"></view>
<view class="boxshadow2" v-if="cateListShow"></view>
<view class="CateIte">
<view class="CateInfo"
@ -301,8 +312,9 @@ export default {
NavgateTo('1')
},
changeCate(id) {
this.checkItem(0)
// ID
this.currentCategoryId = id;
// id
@ -310,7 +322,6 @@ 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;
@ -331,7 +342,7 @@ export default {
this.cateListShow = false
this.rightTopActive = index;
// ID
this.selectedTagId = this.tagList[index]?.id;
this.selectedTagId = this.tagList[index].id;
},
//
topOpen() {
@ -437,42 +448,26 @@ 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;
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];
// 使$set
this.$set(item.commodity_goods_info_list[0], 'quantity', quantity);
}
// ite.quantity
else {
this.goodsId = item.id;
currentQuantity = item.quantity || 0;
stockQuantity = item.stock_quantity || 0;
goodsToUpdate = item;
// 使$set
this.$set(item, 'quantity', quantity);
}
//
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,10 +303,7 @@ export default {
//
getShopCar() {
const params = {
is_group_buy: this.is_group_buy
}
request(apiArr.getCar, "POST", params).then((res) => {
request(apiArr.getCar, "POST", {}).then((res) => {
if (res.normal_cart_list.length > 0) {
res.normal_cart_list.forEach((item) => {
item.checked = false;
@ -617,13 +614,6 @@ export default {
this.shopCarTotal++;
}
} else {
if (carItem.count >= carItem.commodity_goods_info.stock_quantity) {
uni.showToast({
title: '库存不足',
icon: 'none'
});
return
}
carItem.count++;
this.shopCarTotal++;
}
@ -727,7 +717,6 @@ 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() {