|
|
@@ -27,24 +27,27 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-if="item.product.length > 0">
|
|
|
- <div class="goods_list" v-for="(item1, index1) in item.product" :key="index1" @click="navigatorToPage('GoodsDetail', item1.id)">
|
|
|
+ <div class="goods_list" v-for="(item1, index1) in item.product" :key="index1" @click="navigatorToPage('GoodsDetail', item1.pro.id, item1.pro.product_id)">
|
|
|
<van-image class="goods_list_img" radius="10" :src="item1.img_url" />
|
|
|
<div class="right">
|
|
|
<span class="ellipsis">{{ item1.name }}</span>
|
|
|
<div class="cen">
|
|
|
<span class="money"
|
|
|
- >{{ item1.price }}<span class="ssm">{{ $t('lang174') }}</span></span
|
|
|
+ >{{ item1.pro.price }}<span class="ssm">{{ $t('lang174') }}</span></span
|
|
|
>
|
|
|
- <div class="yel">
|
|
|
- <van-count-down class="count" :time="item1.end_time*1000 - new Date().getTime()" :format="`${$t('lang8')} DD ${$t('lang9')} HH ${$t('lang10')} mm ${$t('lang11')} ss ${$t('lang12')}`" />
|
|
|
+ <div class="yel" v-if="item1.pro.status == 1">
|
|
|
+ <van-count-down class="count" :time="item1.pro.end_time*1000 - new Date().getTime()" :format="`${$t('lang8')} DD ${$t('lang9')} HH ${$t('lang10')} mm ${$t('lang11')} ss ${$t('lang12')}`" />
|
|
|
</div>
|
|
|
+ <div class="yel" style="background-color: #f1f1f1;" v-else-if="item1.pro.status == 0">
|
|
|
+ <span class="count" style="color: #aaa;">{{ $t('lang72') }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="flex jsb flex_end">
|
|
|
<div>
|
|
|
- <span class="time_text">{{ $t('lang6') }} {{ item1.cost_price }}{{ $t('lang174') }}</span>
|
|
|
+ <span class="time_text">{{ $t('lang6') }} {{ item1.pro.cost_price }}{{ $t('lang174') }}</span>
|
|
|
<div class="progress">
|
|
|
- <van-progress :percentage="(item1.num / item1.stock) * 100 || 0" class="pro" color="#29b286" track-color="#9DDAC6" stroke-width="10" :show-pivot="false"> </van-progress>
|
|
|
- <span class="p_text">{{ $t('lang26') }}{{ (Math.floor((item1.num / item1.stock) * 100) * 100) / 100 || 0 }}%</span>
|
|
|
+ <van-progress :percentage="(item1.pro.num / item1.pro.stock) * 100 || 0" class="pro" color="#29b286" track-color="#9DDAC6" stroke-width="10" :show-pivot="false"> </van-progress>
|
|
|
+ <span class="p_text">{{ $t('lang26') }}{{ (Math.floor((item1.pro.num / item1.pro.stock) * 100) * 100) / 100 || 0 }}%</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="buy">
|
|
|
@@ -221,8 +224,8 @@ export default {
|
|
|
navigatorTo(name) {
|
|
|
this.$router.push({ name });
|
|
|
},
|
|
|
- navigatorToPage(name, id) {
|
|
|
- this.$router.push({ name, query: { id: id } });
|
|
|
+ navigatorToPage(name, id, product_id) {
|
|
|
+ this.$router.push({ name, query: { id: id, product_id: product_id } });
|
|
|
},
|
|
|
getIndexBaseInfo() {
|
|
|
homeApi.getIndexBaseInfo().then(res => {
|
|
|
@@ -240,21 +243,29 @@ export default {
|
|
|
this.showLoading = false;
|
|
|
this.goodsInfo = res.data;
|
|
|
this.goodsInfoExt = JSON.parse(JSON.stringify(res.data));
|
|
|
- this.goodsInfoExt.forEach((element, index) => {
|
|
|
- var idx = this.typeList.indexOf(element.type_id);
|
|
|
+ // this.goodsInfoExt.forEach((element, index) => {
|
|
|
+ // var idx = this.typeList.indexOf(element.type_id);
|
|
|
|
|
|
- // 收起
|
|
|
- this.typeList.splice(idx, 1);
|
|
|
- if (this.goodsInfo[index].product.length > 0) {
|
|
|
- let info = JSON.parse(JSON.stringify(this.goodsInfoExt[index]));
|
|
|
+ // // 收起
|
|
|
+ // this.typeList.splice(idx, 1);
|
|
|
+ // if (this.goodsInfo[index].product.length > 0) {
|
|
|
+ // let info = JSON.parse(JSON.stringify(this.goodsInfoExt[index]));
|
|
|
|
|
|
- if (info.product.length > 0) {
|
|
|
- info.product.length = 1;
|
|
|
- }
|
|
|
+ // if (info.product.length > 0) {
|
|
|
+ // info.product.length = 1;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // this.$set(this.goodsInfo, index, info);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ this.goodsInfoExt.forEach((element, index) => {
|
|
|
+ var idx = this.typeList.indexOf(element.type_id);
|
|
|
|
|
|
- this.$set(this.goodsInfo, index, info);
|
|
|
- }
|
|
|
+ // 展开
|
|
|
+ this.typeList.push(element.type_id);
|
|
|
+ this.$set(this.goodsInfo, index, JSON.parse(JSON.stringify(this.goodsInfoExt[index])));
|
|
|
});
|
|
|
+
|
|
|
} else {
|
|
|
this.showLoading = false;
|
|
|
}
|