| | |
| | | if (item.status == 'UP') { |
| | | |
| | | } else { |
| | | this.$message.showToast('已失效,无法查看详情') |
| | | this.$message.showToast('商品已下架,无法查看详情') |
| | | return |
| | | } |
| | | uni.navigateTo({ |
| | |
| | | //提交到购物车中 |
| | | // this.$message.showLoading() |
| | | const res = await this.$store.dispatch('submitShopping', dto); |
| | | console.log('res',res) |
| | | if (res&&res.code == 0){ |
| | | console.log('res', res) |
| | | if (res && res.code == 0) { |
| | | dto.shopnum = res.data || 0 |
| | | this.$forceUpdate() |
| | | } |
| | |
| | | var t = parseInt(res.content) |
| | | if (isNaN(t) || t < 0) { |
| | | this.$message.showToast('数目需要大于等于0') |
| | | |
| | | |
| | | } else { |
| | | if(!item.stock || t>item.stock){ |
| | | if (!item.stock || t > item.stock) { |
| | | this.$message.showToast('库存不足无法修改') |
| | | return |
| | | } |
| | | this.addnum(item, (t - item.shopnum)) |
| | | |
| | | |
| | | } |
| | | } else { |
| | | |
| | |
| | | if (!item.stock) { |
| | | item.stock = 0 |
| | | } |
| | | if (item.shopnum + addnum > item.stock) { |
| | | if (addnum > 0 & item.shopnum + addnum > item.stock) { |
| | | this.$message.showToast('库存不足,无法修改') |
| | | return |
| | | } |
| | |
| | | @cancel="order_show=false"></u-picker> |
| | | |
| | | <view class="trade-list-container"> |
| | | <view class="trade-info-container flex" v-for="(dto,index) of list" :key="index" |
| | | > |
| | | <view class="trade-info-container flex" :class="[dto.status]" |
| | | v-for="(dto,index) of list" :key="index"> |
| | | <image class="img img100 br-4 m-r-10" :src="dto.url||dto.cover" @click.stop="toDetail(dto)"></image> |
| | | <view class="flex1" > |
| | | <view class="flex1"> |
| | | <view class="flex" @click.stop="toDetail(dto)"> |
| | | <view class="title"> |
| | | <span class="m-r-5" style="display: inline-block;" |
| | |
| | | <view class="m-r-0 flex" v-if="dto.shopnum"> |
| | | <uni-icons v-if="dto.shopnum&&dto.shopnum>=1" type="minus" size="32" |
| | | @click.stop="addnum(dto,-1)"></uni-icons> |
| | | <view class="curnums" @click.stop="updateItemNum(dto)" v-if="dto.shopnum&&dto.shopnum>=1"> |
| | | <view class="curnums" @click.stop="updateItemNum(dto)" |
| | | v-if="dto.shopnum&&dto.shopnum>=1"> |
| | | {{ dto.shopnum }} |
| | | </view> |
| | | <uni-icons v-if="!dto.shopnum||dto.shopnum<=999" type="plus-filled" size="32" |
| | |
| | | |
| | | } |
| | | |
| | | .trade-info-container.UP { |
| | | .title { |
| | | color: #000000; |
| | | |
| | | } |
| | | } |
| | | |
| | | .trade-info-container { |
| | | background-color: #fff; |
| | | border-radius: 20rpx; |
| | |
| | | font-weight: 600; |
| | | font-size: 28rpx; |
| | | |
| | | color: #000000; |
| | | color: #333; |
| | | line-height: 40rpx; |
| | | |
| | | .level { |