feat : 商城页添加当日达标签
This commit is contained in:
parent
18cf687324
commit
690c2d1833
@ -179,7 +179,7 @@ export default {
|
|||||||
NavgateTo("../vendor/index");
|
NavgateTo("../vendor/index");
|
||||||
},
|
},
|
||||||
selectMaster() {
|
selectMaster() {
|
||||||
NavgateTo("../chooseMaster/index");
|
NavgateTo("../searchInfo/index");
|
||||||
},
|
},
|
||||||
lookImage(item, index) {
|
lookImage(item, index) {
|
||||||
// 提取所有图片URL
|
// 提取所有图片URL
|
||||||
|
|||||||
@ -158,6 +158,7 @@ page {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
margin-bottom: 150rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CateInfo_tit {
|
.CateInfo_tit {
|
||||||
@ -197,7 +198,28 @@ page {
|
|||||||
height: 140rpx;
|
height: 140rpx;
|
||||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-right: 3rpx;
|
margin-right: 15rpx;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
background-color: #ff7d00;
|
||||||
|
color: white;
|
||||||
|
font-size: 22rpx;
|
||||||
|
padding: 5rpx 10rpx;
|
||||||
|
border-radius: 20rpx 0 20rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-img {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-text {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,8 +507,12 @@ page {
|
|||||||
.GGItem_Image {
|
.GGItem_Image {
|
||||||
width: 120rpx;
|
width: 120rpx;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
margin: 0 20rpx 20rpx 0;
|
||||||
margin-right: 20rpx;
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.GGItem_Image image{
|
||||||
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.GGItem_Con_Tit {
|
.GGItem_Con_Tit {
|
||||||
@ -528,16 +554,16 @@ page {
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shadowBox1{
|
.shadowBox1 {
|
||||||
height: 250rpx;
|
height: 250rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shop_car{
|
.shop_car {
|
||||||
width: 140rpx;
|
width: 140rpx;
|
||||||
height: 140rpx;
|
height: 140rpx;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@ -545,7 +571,8 @@ page {
|
|||||||
bottom: 180rpx;
|
bottom: 180rpx;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
.shop_car image{
|
|
||||||
|
.shop_car image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,7 +139,7 @@
|
|||||||
<!-- 右下阴影 -->
|
<!-- 右下阴影 -->
|
||||||
<div class="boxshadow2" v-if="cateListShow"></div>
|
<div class="boxshadow2" v-if="cateListShow"></div>
|
||||||
|
|
||||||
<div class="CateInfo" v-for="(item, index) in tagList" :key="item.id">
|
<div class="CateInfo" v-for="item in tagList" :key="item.id">
|
||||||
<div class="CateInfo_tit">
|
<div class="CateInfo_tit">
|
||||||
{{ item.tag_name }}
|
{{ item.tag_name }}
|
||||||
</div>
|
</div>
|
||||||
@ -150,6 +150,14 @@
|
|||||||
>
|
>
|
||||||
<div class="CateInfo_Item_Box">
|
<div class="CateInfo_Item_Box">
|
||||||
<div class="CateInfo_Item_left" @click="goods(items)">
|
<div class="CateInfo_Item_left" @click="goods(items)">
|
||||||
|
<view
|
||||||
|
class="tag tag-img"
|
||||||
|
v-if="
|
||||||
|
!items.commodity_goods_info_list[1] &&
|
||||||
|
items.commodity_goods_info_list[0].is_same_day
|
||||||
|
"
|
||||||
|
>当日达</view
|
||||||
|
>
|
||||||
<image
|
<image
|
||||||
:src="picUrl + items.commodity_pic"
|
:src="picUrl + items.commodity_pic"
|
||||||
mode="aspectFill"
|
mode="aspectFill"
|
||||||
@ -157,18 +165,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="CateInfo_Item_right" :class="GGshow ? 'noneBor' : ''">
|
<div class="CateInfo_Item_right" :class="GGshow ? 'noneBor' : ''">
|
||||||
<div class="CateInfo_Item_right_Tit" @click="goods(items)">
|
<div class="CateInfo_Item_right_Tit" @click="goods(items)">
|
||||||
|
<view
|
||||||
|
class="tag tag-text"
|
||||||
|
v-if="
|
||||||
|
!items.commodity_goods_info_list[1] &&
|
||||||
|
items.commodity_goods_info_list[0].is_same_day
|
||||||
|
"
|
||||||
|
>当日达</view
|
||||||
|
>
|
||||||
{{ items.commodity_name }}
|
{{ items.commodity_name }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="CateInfo_Item_right_subtit" @click="goods(items)">
|
||||||
class="CateInfo_Item_right_subtit"
|
|
||||||
@click="goods(items)"
|
|
||||||
>
|
|
||||||
{{ items.commodity_intro }}
|
{{ items.commodity_intro }}
|
||||||
</div>
|
</div>
|
||||||
<div class="CateInfo_Item_Money">
|
<div class="CateInfo_Item_Money">
|
||||||
<div class="CateInfo_Item_Money_left">
|
<div class="CateInfo_Item_Money_left">
|
||||||
<span>¥</span
|
{{ getPriceRange(items.commodity_goods_info_list) }}
|
||||||
>{{ items.commodity_goods_info_list[0].sales_price }}
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="CateInfo_Item_Money_right"
|
class="CateInfo_Item_Money_right"
|
||||||
@ -231,16 +243,23 @@
|
|||||||
<div
|
<div
|
||||||
class="GGItem"
|
class="GGItem"
|
||||||
v-for="ite in items.commodity_goods_info_list"
|
v-for="ite in items.commodity_goods_info_list"
|
||||||
|
:key="ite.id"
|
||||||
@click="goods(items)"
|
@click="goods(items)"
|
||||||
>
|
>
|
||||||
<div class="GGItem_Image">
|
<div class="GGItem_Image">
|
||||||
|
<view class="tag tag-img" v-if="ite.is_same_day">当日达</view>
|
||||||
<image
|
<image
|
||||||
:src="picUrl + ite.commodity_pic"
|
:src="picUrl + ite.commodity_pic"
|
||||||
mode="aspectFill"
|
mode="aspectFill"
|
||||||
></image>
|
></image>
|
||||||
</div>
|
</div>
|
||||||
<div class="GGItem_Con">
|
<div class="GGItem_Con">
|
||||||
<div class="GGItem_Con_Tit">{{ ite.goods_name }}</div>
|
<div class="GGItem_Con_Tit">
|
||||||
|
<view class="tag tag-text" v-if="ite.is_same_day"
|
||||||
|
>当日达</view
|
||||||
|
>
|
||||||
|
{{ ite.goods_name }}
|
||||||
|
</div>
|
||||||
<div class="GGItem_Con_Msg">
|
<div class="GGItem_Con_Msg">
|
||||||
<div class="GGItem_Con_Msg_left">
|
<div class="GGItem_Con_Msg_left">
|
||||||
<span>¥</span>{{ ite.sales_price }}
|
<span>¥</span>{{ ite.sales_price }}
|
||||||
@ -376,6 +395,8 @@ export default {
|
|||||||
carNum: "",
|
carNum: "",
|
||||||
|
|
||||||
goodsDetail: [],
|
goodsDetail: [],
|
||||||
|
|
||||||
|
showTag: false, //当日达标签
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -459,7 +480,6 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.tagList = res.commodity_list;
|
this.tagList = res.commodity_list;
|
||||||
console.log("🚀 ~ getGoodsList ~ this.tagList:", this.tagList)
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -467,7 +487,9 @@ export default {
|
|||||||
request(apiArr.getCar, "POST").then((res) => {
|
request(apiArr.getCar, "POST").then((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.carNum = res.total;
|
this.carNum = res.total;
|
||||||
this.goodsDetail = res.commodity_cart_list;
|
// 合并当日达和普通商品数据
|
||||||
|
this.goodsDetail = [].concat(res.same_day_cart_list, res.normal_cart_list)
|
||||||
|
.flatMap(supplier => supplier.commodity_cart_and_goods_model);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -504,6 +526,13 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getPriceRange(goodsList) {
|
||||||
|
if (!goodsList || goodsList.length === 0) return '¥0';
|
||||||
|
const prices = goodsList.map(item => Number(item.sales_price));
|
||||||
|
const minPrice = Math.min(...prices);
|
||||||
|
const maxPrice = Math.max(...prices);
|
||||||
|
return minPrice === maxPrice ? `¥${minPrice}` : `¥${minPrice} ~ ¥${maxPrice}`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const meun = menuButtonInfo();
|
const meun = menuButtonInfo();
|
||||||
|
|||||||
@ -29,11 +29,11 @@
|
|||||||
<div class="goodsItem_left" @click="changeChecked(item, index)">
|
<div class="goodsItem_left" @click="changeChecked(item, index)">
|
||||||
<image
|
<image
|
||||||
v-if="!item.checked"
|
v-if="!item.checked"
|
||||||
src="http://192.168.0.172:5500/7.15/shop_checked1.png"
|
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check1.png"
|
||||||
></image>
|
></image>
|
||||||
<image
|
<image
|
||||||
v-if="item.checked"
|
v-if="item.checked"
|
||||||
src="http://192.168.0.172:5500/7.15/shop_checked2.png"
|
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_check2.png"
|
||||||
></image>
|
></image>
|
||||||
</div>
|
</div>
|
||||||
<div class="goodsItem_right">
|
<div class="goodsItem_right">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user