Browse Source

新增标签

dev_des
1054425342@qq.com 1 month ago
parent
commit
a5f6bf336e
  1. 3
      subPackages/order/gwcOrder.vue
  2. 4
      subPackages/techan/detail.vue
  3. 50
      subPackages/user/gwc.vue

3
subPackages/order/gwcOrder.vue

@ -149,15 +149,12 @@ export default {
}, },
onLoad() { onLoad() {
this.info = this.$store.state.user.sshoppingCart this.info = this.$store.state.user.sshoppingCart
console.log('info',this.info);
this.info.forEach(item => { this.info.forEach(item => {
this.getDiscount(item) this.getDiscount(item)
}) })
if (!this.info) { if (!this.info) {
uni.navigateBack(); uni.navigateBack();
} }
console.log('----***info***------',this.info);
}, },
onShow() { onShow() {
this.getContacts(); this.getContacts();

4
subPackages/techan/detail.vue

@ -31,8 +31,8 @@
<!-- <view class="old-price">{{info.price / 100}}</view> --> <!-- <view class="old-price">{{info.price / 100}}</view> -->
</view> </view>
</view> </view>
<view class="tag no-scrollbar" v-if="info.goods_new_tag"> <view class="tag no-scrollbar" v-if="info.labels">
<view class="tag-item" v-for="(item, index) in info.goods_new_tag.split(',')" :key="index"> <view class="tag-item" v-for="(item, index) in info.labels.split(',')" :key="index">
{{ item }} {{ item }}
</view> </view>
</view> </view>

50
subPackages/user/gwc.vue

@ -48,12 +48,14 @@
<view class="title flex-between">失效商品<span @click="delLoseGood('', 1)">清空失效商品</span></view> <view class="title flex-between">失效商品<span @click="delLoseGood('', 1)">清空失效商品</span></view>
<view class="goodItem" v-for="(goodItem, goodIndex) in loseList" :key="goodIndex"> <view class="goodItem" v-for="(goodItem, goodIndex) in loseList" :key="goodIndex">
<view class="noSelect"></view> <view class="noSelect"></view>
<image :src="showImg(goodItem.specifications_image)" mode="aspectFill"></image> <image :src="showImg(goodItem.specUrl)" mode="aspectFill"></image>
<view class="contentBox"> <view class="contentBox">
<view class="title text-overflow">{{ goodItem.good_name }}</view> <view class="title text-overflow">{{ goodItem.goodsName }}</view>
<view class="subTitle text-overflow">{{ <view class="subTitle text-overflow">{{
goodItem.Specifications_name goodItem.specValueOne
}}</view> }}-{{
goodItem.specValueTwo
}}</view>
<view class="priceBox flex-between"> <view class="priceBox flex-between">
<view class="price">{{ goodItem.salePrice }}</view> <view class="price">{{ goodItem.salePrice }}</view>
<view class="btn" @click="delLoseGood(goodItem.id, 0)">删除</view> <view class="btn" @click="delLoseGood(goodItem.id, 0)">删除</view>
@ -106,11 +108,14 @@
"/framework/cart/list", "DES" "/framework/cart/list", "DES"
) )
.then((res) => { .then((res) => {
this.list = res.data || []; const list = res.data || [];
this.loseList = []; this.loseList = [];
this.list.forEach((item) => { this.list = [];
list.forEach((item) => {
if (item.effectStatus == 1) { if (item.effectStatus == 1) {
this.loseList.push(item); this.loseList.push(item);
} else {
this.list.push(item)
} }
}); });
console.log("购物车数据更新:", this.list); console.log("购物车数据更新:", this.list);
@ -359,10 +364,35 @@
}); });
return; return;
} }
console.log("list参数", list); this.Post({
this.$store.commit("changeOrderSCart", list); bos: list,
// this.gotoPath('/subPackages/order/eCartOrder') method: 'post'
this.gotoPath("/subPackages/order/gwcOrder"); },
`/framework/cart/check-cart-items`,
"DES"
)
.then((res) => {
if (res.data.canOrder) {
this.$store.commit("changeOrderSCart", list);
this.gotoPath("/subPackages/order/gwcOrder");
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
this.getShoppingList()
}
}).catch((res) => {
uni.showToast({
title: '部分商品无法下单,请重新加载购物车',
icon: 'none'
})
setTimeout(() =>{
this.getShoppingList()
},800)
})
// this.gotoPath('/subPackages/goods/goodsOrder') // this.gotoPath('/subPackages/goods/goodsOrder')
}, },
}, },

Loading…
Cancel
Save