添加无货

main
fanfan 8 months ago
parent 9b658bd294
commit 6d90d8e1bc
  1. 2
      api/goods/index.js
  2. 2686
      components/goods-sku-popup/index.vue
  3. 12
      pages/goods/components/SkuPopup.vue
  4. 31
      pages/goods/detail.vue
  5. 1307
      pages/sureOrder/index.vue

@ -92,5 +92,5 @@ export const editGoodsSeckillPrice = param => {
} }
// 是否有货 // 是否有货
export const getGoodsStock = param => { export const getGoodsStock = param => {
return request.get('goods/getGoodsStock', param) return request.post('goods/getGoodsStock', param)
} }

File diff suppressed because it is too large Load Diff

@ -184,9 +184,17 @@
}, },
selectedOld(e) { selectedOld(e) {
this.selectSku = e this.selectSku = e
this.$emit('getSku', {
selectSku: this.selectSku,
shopNum: this.shopNum
})
}, },
numChange(e) { numChange(e) {
this.shopNum = e this.shopNum = e
this.$emit('getSku', {
selectSku: this.selectSku,
shopNum: this.shopNum
})
}, },
// sku ----------------------------------------------------------- // sku -----------------------------------------------------------
openSkuPopup() { openSkuPopup() {
@ -194,10 +202,6 @@
}, },
closeSkuPopup() { closeSkuPopup() {
this.$emit('getSku', {
selectSku: this.selectSku,
shopNum: this.shopNum
})
// console.log(" - sku") // console.log(" - sku")
}, },

@ -117,17 +117,17 @@
</view> </view>
</view> </view>
<view class="orderInfo"> <view class="orderInfo">
<view class="chosed" v-if="goods.spec_type == 20" @click="choseSku(3)"> <view class="chosed" v-if="goods.spec_type == 20" @click="stockValue=='有货'?choseSku(3):''">
<view class="title">已选</view> <view class="title">已选</view>
<view class="info" style="justify-content: flex-start;" v-if="goods.skuList.length>0"> <view class="info" style="justify-content: flex-start;" v-if="goods.skuList.length>0">
<text <text
style="margin-right: 10rpx;">{{selectSku.title.name}}-{{selectSku.value.name}}</text>{{selectShop}} style="margin-right: 10rpx;">{{selectSku.title.name}}-{{selectSku.value.name}}</text>{{selectShop}}
</view> </view>
<u-icon name="arrow-right" color="#B7B7B7"></u-icon> <u-icon name="arrow-right" color="#B7B7B7" v-if="stockValue=='有货'"></u-icon>
</view> </view>
<view class="chosed" v-else @click="choseSku(3)"> <view class="chosed" v-else @click="stockValue=='有货'?choseSku(3):''">
<view class="title">已选</view> <view class="title">已选</view>
<view class="info">{{selectShop}}</view> <view class="info">{{selectNum}}</view>
<u-icon name="arrow-right" color="#B7B7B7"></u-icon> <u-icon name="arrow-right" color="#B7B7B7"></u-icon>
</view> </view>
<view class="chosed" v-if="goods.skuList && goods.skuList.length > 0 && goods.skuList[0].stock_num > 0"> <view class="chosed" v-if="goods.skuList && goods.skuList.length > 0 && goods.skuList[0].stock_num > 0">
@ -284,12 +284,15 @@
<template v-if="isSeckill"> <template v-if="isSeckill">
<template v-if="isBuy"> <template v-if="isBuy">
<template v-if="seckillText=='距离'"> <template v-if="seckillText=='距离'">
<view class="addCar" @click="choseSku(2)"> <view class="addCar" @click="choseSku(2)" v-if="stockValue=='有货'">
加入购物车 加入购物车
</view> </view>
<view class="buyNow" @click="choseSku(3)"> <view class="buyNow" @click="choseSku(3)" v-if="stockValue=='有货'">
立即购买 立即购买
</view> </view>
<view class="btn-bg" v-if="stockValue=='无货'">
无货
</view>
</template> </template>
<template v-else> <template v-else>
<view class="btn-bg"> <view class="btn-bg">
@ -304,12 +307,15 @@
</template> </template>
</template> </template>
<template v-else> <template v-else>
<view class="addCar" @click="choseSku(2)"> <view class="addCar" @click="choseSku(2)" v-if="stockValue=='有货'">
加入购物车 加入购物车
</view> </view>
<view class="buyNow" @click="choseSku(3)"> <view class="buyNow" @click="choseSku(3)" v-if="stockValue=='有货'">
立即购买 立即购买
</view> </view>
<view class="btn-bg" v-if="stockValue=='无货'">
无货
</view>
</template> </template>
</template> </template>
<template v-if="isPre"> <template v-if="isPre">
@ -484,11 +490,11 @@
name: '运损换新' name: '运损换新'
}], }],
selectSku: '', selectSku: '',
selectShop: 1, selectNum: 1,
multiIndex: [0, 0, 0], multiIndex: [0, 0, 0],
multiArray: [], multiArray: [],
multiData: [], multiData: [],
stockValue: '南京市', stockValue: '有货',
addressResult: { addressResult: {
province: '江苏省', province: '江苏省',
city: '南京市', city: '南京市',
@ -552,7 +558,7 @@
methods: { methods: {
async getGoodsStockInfor() { async getGoodsStockInfor() {
let params = { let params = {
goods_id: this.goodsId, list:[{goods_id:this.goodsId,num:this.selectNum}],
province: this.addressResult ? this.addressResult.province : '江苏省', province: this.addressResult ? this.addressResult.province : '江苏省',
city: this.addressResult ? this.addressResult.city : '南京市', city: this.addressResult ? this.addressResult.city : '南京市',
district: this.addressResult ? this.addressResult.district : '玄武区' district: this.addressResult ? this.addressResult.district : '玄武区'
@ -836,8 +842,9 @@
}) })
}, },
onGetSku(e) { onGetSku(e) {
console.log(e)
this.selectSku = e.selectSku this.selectSku = e.selectSku
this.selectShop = e.shopNum this.selectNum = e.shopNum
}, },
// //
onAddCart(total) { onAddCart(total) {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save