|
|
@ -40,37 +40,6 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <view class="title2" @click="addSku">添加规格</view> --> |
|
|
|
|
|
|
|
<!-- <view class="add-sku-box"> |
|
|
|
|
|
|
|
<view class="sku-item" v-for="(item,index) in attrs" :key="index"> |
|
|
|
|
|
|
|
<view class="close-btn" @click="delSku(index)">×</view> |
|
|
|
|
|
|
|
<view class="sku img-sku acea-row row-middle row-between"> |
|
|
|
|
|
|
|
<text>图片</text> |
|
|
|
|
|
|
|
<image src="../../../static/images/upload.png" v-if="item.pic == ''" @tap="uploadSkuImg(index)"></image> |
|
|
|
|
|
|
|
<image :src="item.pic" v-else @tap="uploadSkuImg(index)" mode="aspectFill"></image> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="sku img-sku acea-row row-middle row-between"> |
|
|
|
|
|
|
|
<text>价格<text class="colR">*</text></text> |
|
|
|
|
|
|
|
<input type="number" v-model="item.price" placeholder="请输入售价(元)" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="sku img-sku acea-row row-middle row-between"> |
|
|
|
|
|
|
|
<text>市场价格</text> |
|
|
|
|
|
|
|
<input type="number" v-model="item.ot_orice" placeholder="请输入市场价格(元)" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="sku img-sku acea-row row-middle row-between"> |
|
|
|
|
|
|
|
<text>库存<text class="colR">*</text></text> |
|
|
|
|
|
|
|
<input type="number" v-model="item.stock" placeholder="请输入库存" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="sku img-sku acea-row row-middle row-between"> |
|
|
|
|
|
|
|
<text>重量</text> |
|
|
|
|
|
|
|
<input type="number" v-model="item.weight" placeholder="请输入重量kg" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="sku img-sku acea-row row-middle row-between"> |
|
|
|
|
|
|
|
<text>体积</text> |
|
|
|
|
|
|
|
<input type="number" v-model="item.volume" placeholder="请输入体积m³" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> --> |
|
|
|
|
|
|
|
<!-- //规格属性 --> |
|
|
|
<!-- //规格属性 --> |
|
|
|
<view class="set-title">规格设置</view> |
|
|
|
<view class="set-title">规格设置</view> |
|
|
|
<view class="setattr-box"> |
|
|
|
<view class="setattr-box"> |
|
|
@ -86,32 +55,29 @@ |
|
|
|
<view class="del-attr" @tap.stop="delAttr(index)">×</view> |
|
|
|
<view class="del-attr" @tap.stop="delAttr(index)">×</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 规格设置 --> |
|
|
|
|
|
|
|
<view class="add-sku-box"> |
|
|
|
|
|
|
|
<view class="sku-item"> |
|
|
|
|
|
|
|
<view class="sku img-sku acea-row row-middle row-between"> |
|
|
|
|
|
|
|
<text>价格<text class="colR">*</text></text> |
|
|
|
|
|
|
|
<input type="number" v-model="attrs[0].price" @input="changePrice" placeholder="请输入售价(元)" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="sku img-sku acea-row row-middle row-between"> |
|
|
|
|
|
|
|
<text>库存<text class="colR">*</text></text> |
|
|
|
|
|
|
|
<input type="number" v-model="attrs[0].stock" @input="changeStock" placeholder="请输入库存" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 批量操作 --> |
|
|
|
<!-- 批量操作 --> |
|
|
|
<view class="batch-set-box" v-if="batchData.titleStr != ''"> |
|
|
|
<view class="batch-set-box" v-if="batchData.titleStr != ''"> |
|
|
|
<view class="box-top acea-row row-between-wrapper"> |
|
|
|
<view class="box-top acea-row row-between-wrapper"> |
|
|
|
<view class="name">{{batchData.titleStr}}</view> |
|
|
|
<view class="name">{{batchData.titleStr}}</view> |
|
|
|
<view class="attr-name w15">库存</view> |
|
|
|
<view class="acea-row row-middle batch" @click="setAttrVal(0,1)"> |
|
|
|
<view class="attr-name w15">价格</view> |
|
|
|
<image src="../../../static/images/batch-icon.png"></image> |
|
|
|
|
|
|
|
<text>批量修改</text> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<block v-for="(i,idx) in batchData.priceArr" :key="idx"> |
|
|
|
<block v-for="(i,idx) in batchData.priceArr" :key="idx"> |
|
|
|
<view class="box-b acea-row row-between-wrapper"> |
|
|
|
<view class="box-b acea-row row-between-wrapper" @click="setAttrVal(idx,0)"> |
|
|
|
<!-- <view class="name line1">{{i.sku.replace(/,/, '/')}}</view> --> |
|
|
|
<view class="box-b-l acea-row row-middle "> |
|
|
|
<view class="name line1">{{i.sku.split(',').reverse().join('/')}}</view> |
|
|
|
<image src="../../../static/images/upload.png" class="attrImg" v-if="i.pic == ''" @tap.stop="uploadAttrImg(idx)"></image> |
|
|
|
<view class="inp-box w15"><input type="number" placeholder="0" v-model="i.stock"></view> |
|
|
|
<image :src="i.pic" class="attrImg" mode="aspectFill" v-else @tap.stop="uploadAttrImg(idx)"></image> |
|
|
|
<view class="inp-box w15"><input type="number" placeholder="0" v-model="i.price"></view> |
|
|
|
<view class="name line1">{{i.sku.split(',').reverse().join('/')}}</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="acea-row row-middle"> |
|
|
|
|
|
|
|
<view class="box-b-r"> |
|
|
|
|
|
|
|
<view>售价¥{{i.price}}</view> |
|
|
|
|
|
|
|
<view>库存{{i.stock}}</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<image class="arrow" src="../../../static/images/arror-r-s.png"></image> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</block> |
|
|
|
</block> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -128,10 +94,10 @@ |
|
|
|
<view class="acea-row row-middle"> |
|
|
|
<view class="acea-row row-middle"> |
|
|
|
<radio-group @change="radioChange"> |
|
|
|
<radio-group @change="radioChange"> |
|
|
|
<label> |
|
|
|
<label> |
|
|
|
<radio :value="0" :checked="state == 0" /><text>上架</text> |
|
|
|
<radio :value="1" :checked="isShow == 1" /><text>上架</text> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
<label> |
|
|
|
<label> |
|
|
|
<radio :value="1" :checked="state == 1" /><text>不上架</text> |
|
|
|
<radio :value="0" :checked="isShow == 0" /><text>不上架</text> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
</radio-group> |
|
|
|
</radio-group> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -139,6 +105,26 @@ |
|
|
|
<view class="btn-box"> |
|
|
|
<view class="btn-box"> |
|
|
|
<view class="btn" @tap="submit">提交</view> |
|
|
|
<view class="btn" @tap="submit">提交</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 设置单个属性弹框 --> |
|
|
|
|
|
|
|
<view class="set-attr-val" :class="showAttrVal ? 'isShow' : ''"> |
|
|
|
|
|
|
|
<view class="title">{{attrValTitle}}</view> |
|
|
|
|
|
|
|
<view class="inp-box"> |
|
|
|
|
|
|
|
<text>售价(¥)</text> |
|
|
|
|
|
|
|
<input type="number" placeholder="0" v-model="price"> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="inp-box"> |
|
|
|
|
|
|
|
<text>原价(¥)</text> |
|
|
|
|
|
|
|
<input type="number" placeholder="0" v-model="ot_price"> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="inp-box"> |
|
|
|
|
|
|
|
<text>库存</text> |
|
|
|
|
|
|
|
<input type="number" placeholder="0" v-model="stock"> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="btn-box"> |
|
|
|
|
|
|
|
<view class="cancel-btn" @click="cancelClick">取消</view> |
|
|
|
|
|
|
|
<view class="submit-btn" @click="submitClick">确定</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<!-- //添加规格弹框 --> |
|
|
|
<!-- //添加规格弹框 --> |
|
|
|
<view class="mask-box" v-if="maskShow == true"> |
|
|
|
<view class="mask-box" v-if="maskShow == true"> |
|
|
|
<view class="addattr-dialog" v-if="addOptionsDialog == true"> |
|
|
|
<view class="addattr-dialog" v-if="addOptionsDialog == true"> |
|
|
@ -182,21 +168,55 @@ |
|
|
|
{ |
|
|
|
{ |
|
|
|
pic: '', //"规格图片 --可选", |
|
|
|
pic: '', //"规格图片 --可选", |
|
|
|
price: '', //"价格 元", |
|
|
|
price: '', //"价格 元", |
|
|
|
ot_orice: '', //"市场价格 --可选", |
|
|
|
ot_price: '', //"市场价格 --可选", |
|
|
|
stock: '', //"库存", |
|
|
|
stock: '', //"库存", |
|
|
|
weight: '', //"重量 --可选", |
|
|
|
weight: '', //"重量 --可选", |
|
|
|
volume: '', //"体积 --可选" |
|
|
|
volume: '', //"体积 --可选" |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
price: '', |
|
|
|
|
|
|
|
ot_price: '', |
|
|
|
|
|
|
|
stock:'', |
|
|
|
|
|
|
|
isShow: 0, |
|
|
|
|
|
|
|
spec_type: 0, |
|
|
|
items: [], |
|
|
|
items: [], |
|
|
|
attrArr:[], |
|
|
|
attrArr:[{ |
|
|
|
|
|
|
|
value: '规格', |
|
|
|
|
|
|
|
detail:['默认'] |
|
|
|
|
|
|
|
}], |
|
|
|
attr:{}, |
|
|
|
attr:{}, |
|
|
|
state: 0, |
|
|
|
state: 0, |
|
|
|
maskShow: false, |
|
|
|
maskShow: false, |
|
|
|
addOptionsDialog: false, |
|
|
|
addOptionsDialog: false, |
|
|
|
infinite: false, |
|
|
|
infinite: false, |
|
|
|
batchData: {titleStr: '',priceArr: []}, |
|
|
|
batchData: { |
|
|
|
|
|
|
|
titleStr: '规格', |
|
|
|
|
|
|
|
priceArr: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
bar_code: "", |
|
|
|
|
|
|
|
brokerage: 0, |
|
|
|
|
|
|
|
brokerage_two: 0, |
|
|
|
|
|
|
|
cost: 0, |
|
|
|
|
|
|
|
integral: 0, |
|
|
|
|
|
|
|
ot_price: 0, |
|
|
|
|
|
|
|
pic: "", |
|
|
|
|
|
|
|
pink_price: 0, |
|
|
|
|
|
|
|
pink_stock: 0, |
|
|
|
|
|
|
|
price: 0, |
|
|
|
|
|
|
|
seckill_price: 0, |
|
|
|
|
|
|
|
seckill_stock: 0, |
|
|
|
|
|
|
|
sku: "默认", |
|
|
|
|
|
|
|
stock: 0, |
|
|
|
|
|
|
|
value1: "", |
|
|
|
|
|
|
|
volume: 0, |
|
|
|
|
|
|
|
weight: 0, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}, |
|
|
|
editattr: false, |
|
|
|
editattr: false, |
|
|
|
|
|
|
|
idx: null, |
|
|
|
|
|
|
|
showAttrVal: false, |
|
|
|
|
|
|
|
attrValTitle: '' |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -214,20 +234,16 @@ |
|
|
|
this.description = info.description |
|
|
|
this.description = info.description |
|
|
|
this.store_name = info.store_name |
|
|
|
this.store_name = info.store_name |
|
|
|
this.items = info.items |
|
|
|
this.items = info.items |
|
|
|
if(info.attrs){ |
|
|
|
this.attrArr = info.items |
|
|
|
this.$set(this.batchData,'priceArr',info.attrs) |
|
|
|
this.spec_type = 1 |
|
|
|
this.attrArr = info.items |
|
|
|
this.isShow = info.is_show |
|
|
|
let strArr = info.items.map(item=>{ |
|
|
|
let strArr = info.items.map(item=>{ |
|
|
|
return item.value |
|
|
|
return item.value |
|
|
|
}) |
|
|
|
}) |
|
|
|
console.log(strArr) |
|
|
|
this.getFormatAttr() |
|
|
|
this.$set(this.batchData,'titleStr',strArr.join('/')) |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
this.attrs[0].price = info.price |
|
|
|
|
|
|
|
this.attrs[0].stock = info.stock |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} else{ |
|
|
|
} else{ |
|
|
|
|
|
|
|
this.spec_type = 0 |
|
|
|
console.log('新增') |
|
|
|
console.log('新增') |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -236,8 +252,9 @@ |
|
|
|
var imgurls = [] |
|
|
|
var imgurls = [] |
|
|
|
chooseImages((imgs)=>{ |
|
|
|
chooseImages((imgs)=>{ |
|
|
|
imgurls.push(imgs) |
|
|
|
imgurls.push(imgs) |
|
|
|
|
|
|
|
this.slider_image = imgurls |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.slider_image = imgurls |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadImg(idx){ |
|
|
|
uploadImg(idx){ |
|
|
|
chooseImage((img)=>{ |
|
|
|
chooseImage((img)=>{ |
|
|
@ -248,11 +265,6 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadSkuImg(idx){ |
|
|
|
|
|
|
|
chooseImage((img)=>{ |
|
|
|
|
|
|
|
this.$set(this.attrs,idx,{pic: img}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
toGoodsDetails(){ |
|
|
|
toGoodsDetails(){ |
|
|
|
uni.navigateTo({ |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/life/goodsDetails/index?desc='+encodeURIComponent(this.description) |
|
|
|
url: '/pages/life/goodsDetails/index?desc='+encodeURIComponent(this.description) |
|
|
@ -265,10 +277,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
//添加属性按钮 |
|
|
|
//添加属性按钮 |
|
|
|
addAttr(){ |
|
|
|
addAttr(){ |
|
|
|
let j = { |
|
|
|
let j = { value: '', detail:[''] } |
|
|
|
value: '', |
|
|
|
|
|
|
|
detail:[''] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.attr = j |
|
|
|
this.attr = j |
|
|
|
this.editattr = false; //添加新属性时是否编辑attr切换成FALSE |
|
|
|
this.editattr = false; //添加新属性时是否编辑attr切换成FALSE |
|
|
|
this.maskShow = true; |
|
|
|
this.maskShow = true; |
|
|
@ -364,47 +373,69 @@ |
|
|
|
let allArr = cartesianProductOf(...tmp) |
|
|
|
let allArr = cartesianProductOf(...tmp) |
|
|
|
return allArr |
|
|
|
return allArr |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 批量设置价格库存 |
|
|
|
|
|
|
|
changePrice(e){ |
|
|
|
//上传规格图片 |
|
|
|
const price = e.detail.value |
|
|
|
uploadAttrImg(idx){ |
|
|
|
if(this.batchData.priceArr && this.batchData.priceArr.length > 0){ |
|
|
|
chooseImage((img)=>{ |
|
|
|
this.batchData.priceArr.forEach((item,i)=>{ |
|
|
|
this.batchData.priceArr[idx].pic= img |
|
|
|
item.price = price |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//设置规格属性值 |
|
|
|
|
|
|
|
setAttrVal(idx,type){ |
|
|
|
|
|
|
|
if(type == 0){ |
|
|
|
|
|
|
|
this.idx = idx |
|
|
|
|
|
|
|
this.price= this.batchData.priceArr[idx].price |
|
|
|
|
|
|
|
this.ot_price= this.batchData.priceArr[idx].ot_price |
|
|
|
|
|
|
|
this.stock= this.batchData.priceArr[idx].stock |
|
|
|
|
|
|
|
this.attrValTitle = this.batchData.priceArr[idx].sku.split(',').reverse().join('/') |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
this.attrValTitle = '批量修改规格' |
|
|
|
} |
|
|
|
} |
|
|
|
this.attrs[0].price = price |
|
|
|
|
|
|
|
// console.log(this.batchData.priceArr,'this.batchData.priceArr') |
|
|
|
this.showAttrVal= true |
|
|
|
}, |
|
|
|
}, |
|
|
|
changeStock(e){ |
|
|
|
cancelClick(){ |
|
|
|
const stock = e.detail.value |
|
|
|
this.idx = null |
|
|
|
if(this.batchData.priceArr && this.batchData.priceArr.length > 0){ |
|
|
|
this.showAttrVal= false |
|
|
|
this.batchData.priceArr.forEach((item,i)=>{ |
|
|
|
}, |
|
|
|
item.stock = stock |
|
|
|
submitClick(){ |
|
|
|
|
|
|
|
const idx = this.idx |
|
|
|
|
|
|
|
console.log(this.price,this.ot_price,this.stock) |
|
|
|
|
|
|
|
if(this.stock == 0){ |
|
|
|
|
|
|
|
return this.alertMessage('商品库存不能为0') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(this.attrValTitle == '批量修改规格'){ |
|
|
|
|
|
|
|
this.batchData.priceArr.forEach((item)=>{ |
|
|
|
|
|
|
|
item.price = this.price |
|
|
|
|
|
|
|
item.ot_price = this.ot_price |
|
|
|
|
|
|
|
item.stock = this.stock |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} else{ |
|
|
|
this.attrs[0].stock = stock |
|
|
|
this.$set(this.batchData.priceArr[idx],'price',this.price) |
|
|
|
|
|
|
|
this.$set(this.batchData.priceArr[idx],'ot_price',this.ot_price) |
|
|
|
|
|
|
|
this.$set(this.batchData.priceArr[idx],'stock',this.stock) |
|
|
|
|
|
|
|
// this.batchData.priceArr[idx].price= this.price |
|
|
|
|
|
|
|
// this.batchData.priceArr[idx].ot_price= this.ot_price |
|
|
|
|
|
|
|
// this.batchData.priceArr[idx].stock= this.stock |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.showAttrVal= false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
radioChange(e){ |
|
|
|
|
|
|
|
this.isShow= e.detail.value |
|
|
|
}, |
|
|
|
}, |
|
|
|
submit(){ |
|
|
|
submit(){ |
|
|
|
// console.log(this.batchData) |
|
|
|
// console.log(this.batchData) |
|
|
|
var arrtsArr = [] |
|
|
|
|
|
|
|
if(this.batchData.priceArr && this.batchData.priceArr[0].price != ''){ |
|
|
|
|
|
|
|
arrtsArr = this.batchData.priceArr |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
arrtsArr = this.attrs |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let form = { |
|
|
|
let form = { |
|
|
|
store_name: this.store_name, |
|
|
|
store_name: this.store_name, |
|
|
|
unit_name: this.unit_name, |
|
|
|
unit_name: this.unit_name, |
|
|
|
image: this.slider_image[0], //主图 |
|
|
|
image: this.slider_image[0], //主图 |
|
|
|
slider_image: this.slider_image , // 轮播图 |
|
|
|
slider_image: this.slider_image , // 轮播图 |
|
|
|
description: this.description, //商品详情富文本 |
|
|
|
description: this.description, //商品详情富文本 |
|
|
|
tempId: this.tempId, //运费方案 |
|
|
|
temp_id: this.tempId, //运费方案 |
|
|
|
attrs: arrtsArr, |
|
|
|
attrs: this.batchData.priceArr, |
|
|
|
state: this.state, |
|
|
|
isShow: this.isShow, |
|
|
|
items: this.items, |
|
|
|
items: this.items |
|
|
|
spec_type: arrtsArr.length > 1 ? 1 : 0 //单规格,多规格 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
console.log(form) |
|
|
|
|
|
|
|
if(form.store_name == ''){ |
|
|
|
if(form.store_name == ''){ |
|
|
|
this.alertMessage('请填写商品名称') |
|
|
|
this.alertMessage('请填写商品名称') |
|
|
|
return |
|
|
|
return |
|
|
@ -419,16 +450,18 @@ |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
form.attrs.forEach((item,index)=>{ |
|
|
|
form.attrs.forEach((item,index)=>{ |
|
|
|
if(item.price == ''){ |
|
|
|
if(item.price == '' || item.price == 0){ |
|
|
|
this.alertMessage('请商品规格价格') |
|
|
|
this.alertMessage('请商品规格价格') |
|
|
|
return |
|
|
|
return |
|
|
|
} else if(item.stock == ''){ |
|
|
|
} else if(item.stock == '' || item.stock == 0){ |
|
|
|
this.alertMessage('请商品规格库存') |
|
|
|
this.alertMessage('库存不能为0') |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if(this.id != ''){ |
|
|
|
if(this.id != ''){ |
|
|
|
form.id = this.id |
|
|
|
form.id = this.id |
|
|
|
|
|
|
|
form.spec_type = this.spec_type |
|
|
|
|
|
|
|
console.log(form) |
|
|
|
editProduct(form).then((res)=>{ |
|
|
|
editProduct(form).then((res)=>{ |
|
|
|
if(res.success){ |
|
|
|
if(res.success){ |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
@ -448,6 +481,8 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else{ |
|
|
|
} else{ |
|
|
|
|
|
|
|
form.spec_type = this.batchData.priceArr.length > 1 ? 1 : 0 |
|
|
|
|
|
|
|
console.log(form) |
|
|
|
addProduct(form).then((res)=>{ |
|
|
|
addProduct(form).then((res)=>{ |
|
|
|
if(res.success){ |
|
|
|
if(res.success){ |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
@ -603,6 +638,7 @@ |
|
|
|
padding: 32rpx; |
|
|
|
padding: 32rpx; |
|
|
|
font-size: 28rpx; |
|
|
|
font-size: 28rpx; |
|
|
|
font-weight: 500; |
|
|
|
font-weight: 500; |
|
|
|
|
|
|
|
margin-bottom: 12rpx; |
|
|
|
image{ |
|
|
|
image{ |
|
|
|
width: 24rpx; |
|
|
|
width: 24rpx; |
|
|
|
height: 24rpx; |
|
|
|
height: 24rpx; |
|
|
@ -682,14 +718,46 @@ |
|
|
|
width: 19%; |
|
|
|
width: 19%; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.batch{ |
|
|
|
|
|
|
|
font-size: 24rpx; |
|
|
|
|
|
|
|
color: #000; |
|
|
|
|
|
|
|
image{ |
|
|
|
|
|
|
|
width: 24rpx; |
|
|
|
|
|
|
|
height: 26rpx; |
|
|
|
|
|
|
|
margin-right: 10rpx; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.box-b{ |
|
|
|
.box-b{ |
|
|
|
margin-top: 6rpx; |
|
|
|
width: 100%; |
|
|
|
.name{ |
|
|
|
height: 100rpx; |
|
|
|
|
|
|
|
background: #FFFFFF; |
|
|
|
|
|
|
|
border: 2rpx solid #C0C0C0; |
|
|
|
|
|
|
|
border-radius: 8rpx; |
|
|
|
|
|
|
|
margin-top: 22rpx; |
|
|
|
|
|
|
|
padding: 0 20rpx; |
|
|
|
|
|
|
|
.box-b-l{ |
|
|
|
width: 60%; |
|
|
|
width: 60%; |
|
|
|
|
|
|
|
.name{ |
|
|
|
|
|
|
|
width: calc(100% - 90rpx); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.attrImg{ |
|
|
|
|
|
|
|
width: 70rpx; |
|
|
|
|
|
|
|
height: 70rpx; |
|
|
|
|
|
|
|
border-radius: 8rpx; |
|
|
|
|
|
|
|
margin-right: 16rpx; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.w15{ |
|
|
|
.box-b-r{ |
|
|
|
width: 19%; |
|
|
|
font-size: 24rpx; |
|
|
|
|
|
|
|
color: #FF0000; |
|
|
|
|
|
|
|
font-weight: 500; |
|
|
|
|
|
|
|
margin-right: 14rpx; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.arrow{ |
|
|
|
|
|
|
|
width: 24rpx; |
|
|
|
|
|
|
|
height: 24rpx; |
|
|
|
|
|
|
|
transform: rotate(90deg); |
|
|
|
} |
|
|
|
} |
|
|
|
.inp-box{ |
|
|
|
.inp-box{ |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
@ -703,6 +771,62 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.set-attr-val{ |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
padding: 0 40rpx 90rpx; |
|
|
|
|
|
|
|
border-radius: 60rpx 60rpx 0px 0px; |
|
|
|
|
|
|
|
background:#fff; |
|
|
|
|
|
|
|
box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.2); |
|
|
|
|
|
|
|
position: fixed; |
|
|
|
|
|
|
|
left: 0; |
|
|
|
|
|
|
|
bottom: -999rpx; |
|
|
|
|
|
|
|
transition: bottom .2s ease ; |
|
|
|
|
|
|
|
&.isShow{ |
|
|
|
|
|
|
|
bottom: 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.title{ |
|
|
|
|
|
|
|
font-size: 44rpx; |
|
|
|
|
|
|
|
color: #343434; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
padding: 44rpx 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.inp-box{ |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
height: 72rpx; |
|
|
|
|
|
|
|
background: #F1F1F1; |
|
|
|
|
|
|
|
border-radius: 8rpx; |
|
|
|
|
|
|
|
padding: 0 40rpx; |
|
|
|
|
|
|
|
font-size: 32rpx; |
|
|
|
|
|
|
|
color: #000; |
|
|
|
|
|
|
|
margin-bottom: 28rpx; |
|
|
|
|
|
|
|
text{ |
|
|
|
|
|
|
|
width: 200rpx; |
|
|
|
|
|
|
|
display: inline-block; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.btn-box{ |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
justify-content: space-around; |
|
|
|
|
|
|
|
view{ |
|
|
|
|
|
|
|
width: 230rpx; |
|
|
|
|
|
|
|
height: 80rpx; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
line-height: 80rpx; |
|
|
|
|
|
|
|
background: #E9E9E9; |
|
|
|
|
|
|
|
border-radius: 40rpx; |
|
|
|
|
|
|
|
font-size: 38rpx; |
|
|
|
|
|
|
|
color: #fff; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.cancel-btn{ |
|
|
|
|
|
|
|
bakcground:#E9E9E9 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.submit-btn{ |
|
|
|
|
|
|
|
background: linear-gradient(134deg, #FFA782 0%, #FF6D31 100%); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//弹出层 |
|
|
|
//弹出层 |
|
|
|
.mask-box{ |
|
|
|
.mask-box{ |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
@ -730,7 +854,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
.a-name{ |
|
|
|
.a-name{ |
|
|
|
width: 560rpx; |
|
|
|
width: 560rpx; |
|
|
|
height: 104rpx; |
|
|
|
// height: 104rpx; |
|
|
|
background: #F7F7F7; |
|
|
|
background: #F7F7F7; |
|
|
|
border-radius: 12rpx; |
|
|
|
border-radius: 12rpx; |
|
|
|
padding: 30rpx; |
|
|
|
padding: 30rpx; |
|
|
@ -745,7 +869,7 @@ |
|
|
|
width: 80%; |
|
|
|
width: 80%; |
|
|
|
} |
|
|
|
} |
|
|
|
.o-item-box{ |
|
|
|
.o-item-box{ |
|
|
|
height: 56rpx; |
|
|
|
height: 74rpx; |
|
|
|
padding-bottom: 10rpx; |
|
|
|
padding-bottom: 10rpx; |
|
|
|
margin-bottom: 10rpx; |
|
|
|
margin-bottom: 10rpx; |
|
|
|
border-bottom: 2rpx solid #ececec; |
|
|
|
border-bottom: 2rpx solid #ececec; |
|
|
|