main
fanfan 9 months ago
parent c4afe65700
commit 5b4fbb4916
  1. 2
      pages/goods/detail.vue
  2. 74
      pages/sureOrder/index.vue

@ -569,7 +569,7 @@
data
} = await GoodsApi.getGoodsStock(params);
if (status == 200) {
this.stockValue = data.stock
this.stockValue = data[0].state
}
},
async getProvinceAll() {

@ -124,28 +124,34 @@
<image :src="$picUrl+'/static/order/left.png'" mode="" class="leftIcon"></image>
</view>
<view class="goods" v-for="(item, index) in order.goodsList" :key="index">
<view class="goodsImg">
<image :src="item.goods_image" mode=""></image>
</view>
<view class="goodsInfo">
<view class="goodsName">
{{ item.goods_name }}
<view class="goodsBox" :style="{'opacity': item.stockValue=='有货'?1:0.6 }">
<view class="goodsImg">
<image :src="item.goods_image" mode=""></image>
</view>
<!-- 商品规格 -->
<view class="goods-props">
<view class="goods-props-item" v-for="(props, idx) in item.skuInfo.goods_props" :key="idx">
<text class="group-name">{{ props.group.name }}: </text>
<text>{{ props.value.name }}</text>
<view class="goodsInfo">
<view class="goodsName">
{{ item.goods_name }}
</view>
<!-- 商品规格 -->
<view class="goods-props">
<view class="goods-props-item" v-for="(props, idx) in item.skuInfo.goods_props" :key="idx">
<text class="group-name">{{ props.group.name }}: </text>
<text>{{ props.value.name }}</text>
</view>
</view>
<view class="goodsPrice">
<text>{{item.goods_price_min?Number(item.goods_price_min):item.goods_price_min}}</text>
</view>
</view>
<view class="goodsPrice">
<text>{{item.goods_price_min?Number(item.goods_price_min):item.goods_price_min}}</text>
<view class="goodsNum">
x{{ item.total_num }}
</view>
</view>
<view class="goodsNum">
x{{ item.total_num }}
<view style="color: red;font-size: 24rpx;margin-left: 182rpx;" v-if="item.stockValue=='无货'">
该商品暂时无货
</view>
</view>
</view>
<view class="timer">
<view class="youTime" style="width: 60rpx;">
@ -246,11 +252,11 @@
<text class="type"></text>
<text class="price">{{order.orderPayPrice?Number(order.orderPayPrice):order.orderPayPrice}}</text>
</view>
<view class="btn" @click="onSubmitOrder()" v-if="stockValue=='有货'">
<view class="btn" @click="onSubmitOrder()" v-if="stockValue==true">
提交订单
</view>
<view class="btn" style="background: #cecece;" v-else>
无货
提交订单
</view>
</view>
<!-- 优惠券弹出框 -->
@ -441,7 +447,7 @@
setting: {},
timer: "",
distance_unit: "",
stockValue: '有货',
stockValue: true,
addressResult: {
province: '江苏省',
city: '南京市',
@ -485,8 +491,8 @@
methods: {
async getGoodsStockInfor(order) {
console.log(order)
let that = this
let step = 0
let list = [];
order.goodsList.forEach(item => {
list.push({
@ -494,11 +500,11 @@
num: item.total_num
})
});
if(that.curDelivery == DeliveryTypeEnum.EXTRACT.value){
if (that.curDelivery == DeliveryTypeEnum.EXTRACT.value) {
that.addressResult.province = order.extractShop ? order.extractShop.region.province : '江苏省'
that.addressResult.city = order.extractShop ? order.extractShop.region.city : '南京市'
that.addressResult.district = order.extractShop ? order.extractShop.region.region : '玄武区'
}else{
} else {
that.addressResult.province = order.address ? order.address.region.province : '江苏省'
that.addressResult.city = order.address ? order.address.region.city : '南京市'
that.addressResult.district = order.address ? order.address.region.region : '玄武区'
@ -515,7 +521,22 @@
data
} = await GoodsApi.getGoodsStock(params);
if (status == 200) {
this.stockValue = data.stock
order.goodsList.forEach(item_1 => {
item_1.stockValue = '有货'
data.forEach(item_2 => {
if (item_1.goods_id == item_2.goods_id) {
item_1.stockValue = item_2.state
}
if (item_2.state == '无货') {
step++
}
});
});
if(step>0){
this.showToast('部分商品无货')
}
that.order = order
this.stockValue = step > 0 ? false : true
}
},
toStore() {
@ -1316,10 +1337,13 @@
}
.goods {
display: flex;
align-items: center;
margin-top: 28rpx;
justify-content: space-between;
.goodsBox {
display: flex;
align-items: center;
justify-content: space-between;
}
.goodsImg {
width: 162rpx;

Loading…
Cancel
Save