diff --git a/packageIntegral/productAddition/index.vue b/packageIntegral/productAddition/index.vue index 320c023..bab6ca5 100644 --- a/packageIntegral/productAddition/index.vue +++ b/packageIntegral/productAddition/index.vue @@ -6,7 +6,7 @@ - + {{item.attributeName}}: - - + + - + 批量填充:批量填充填入信息后,可以批量将内容填写到SKU 信息里 - {{item.label}} + {{item.label}} 确定 - + * 规格: @@ -163,6 +163,7 @@ currentBoxId: 'chooseType', //当前显示的view的id isBoxShow: false, productDate:{ + productStatus:'1', images:[] }, productList:[], @@ -175,9 +176,9 @@ checked: false }], rules:{ - name:{rules:[{required: true,errorMessage: '请选择商品分类'}]}, + demandRegion:{rules:[{required: true,errorMessage: '请选择商品分类'}]}, productName:{rules:[{required: true,errorMessage: '请输入商品名称'}]}, - brandId:{rules:[{required: true,errorMessage: '请输入商品品牌'}]}, + brandId:{rules:[{required: true,errorMessage: '请选择商品品牌'}]}, price:{rules:[{required: true,errorMessage: '请输入商品售价'}]}, }, attributesTypeList:[], @@ -190,7 +191,8 @@ ], radioAttributes:'', checkboxAttributes:[], - stockList:[] + stockList:[], + checkedList:[] } }, @@ -205,6 +207,11 @@ this.productDate.categoryOneId = val.split(',')[0] this.productDate.categoryTwoId = val.split(',')[1] } + }, + 'productDate.attributesTypeId'(val){ + if(!val){ + this.stockList = [] + } } }, methods: { @@ -257,20 +264,40 @@ }, changeBox(e){ let currentFlag = e.currentTarget.id; - switch(currentFlag){ - case 'next': - this.currentBoxId = 'instruction' - break; - case 'previous': - this.currentBoxId = 'chooseType' - break; - default: - this.currentBoxId = 'viewInstruction' - break; - } if(currentFlag == 'next'){ - this.getAttributesType() + this.$refs.productForm.validate().then(res=>{ + console.log('表单数据信息:', res); + switch(currentFlag){ + case 'next': + this.currentBoxId = 'instruction' + break; + case 'previous': + this.currentBoxId = 'chooseType' + break; + default: + this.currentBoxId = 'viewInstruction' + break; + } + if(currentFlag == 'next'){ + this.getAttributesType() + } + }).catch(err =>{ + console.log('表单错误信息:', err); + }) + }else{ + switch(currentFlag){ + case 'next': + this.currentBoxId = 'instruction' + break; + case 'previous': + this.currentBoxId = 'chooseType' + break; + default: + this.currentBoxId = 'viewInstruction' + break; + } } + }, getAttributesType(){ this.attributesTypeList = [] @@ -304,6 +331,25 @@ } }, + changeRadio(item,index){ + if(JSON.stringify(this.checkedList) == '[]'){ + this.checkedList.push({attributeId:item.id,checked:item.attributeName}) + }else{ + this.checkedList[index].checked = item.attributeName + } + }, + changeCheckBox(item,index){ + if(this.checkedList.length{ + checked.push(tab) + }) + this.checkedList[index].checked = checked.join(',') + this.checkedList.checked + } + }, deleteCheckAll(i){ if(this.checkboxAttributes.length>1){ this.checkboxAttributes.splice(i,1) @@ -358,7 +404,6 @@ sourceType: ['album'], //从相册选择 success: function(res) { console.log(res) - console.log('进入1') const JSESSIONID = utils.uuid() uni.uploadFile({ url: 'http://uat.xingoil.com/adminapi/oil-oss/obejct/uploadFile', @@ -379,14 +424,11 @@ 'token': utils.md5Salt(JSESSIONID) }, success(e) { - console.log('进入2') - console.log(e) let obj = JSON.parse(e.data), imageUrl = obj.data.publicUrl _that.getImage(imageUrl) }, fail(err) { - console.log(err) } }) },fail() { @@ -440,9 +482,15 @@ }else{ this.productDate.recommend == '2' } + this.productDate.checkedList = this.checkedList this.productDate.stockList = this.stockList serve.saveProduct(this.productDate).then(res=>{ console.log(res) + uni.showToast({ + title: res.msg, + icon: 'none' + }) + this.closed() }) } } @@ -524,6 +572,10 @@ line-height: 72rpx; } } + .content{ + padding-bottom: 20rpx; + border-bottom: 1rpx solid #F6F6F6; + } .tagButton{ display: inline-block; width: 133rpx; diff --git a/packageIntegral/productList/index.vue b/packageIntegral/productList/index.vue index e98ebdb..6a7a5dd 100644 --- a/packageIntegral/productList/index.vue +++ b/packageIntegral/productList/index.vue @@ -17,12 +17,12 @@ - + {{item.productStatus =='1'?'已上架':'未上架'}} - + {{item.productName}} 规格:默认 @@ -192,11 +192,11 @@ }, '') return text }, - toDetails(item) { - uni.navigateTo({ - url: `../orderDetails/index?orderId=${item.id}` - }) - }, + // toDetails(item) { + // uni.navigateTo({ + // url: `../orderDetails/index?orderId=${item.id}` + // }) + // }, getTopInfo(){ serve.getTopInfo(this.paramter).then(res => { if (res.code === 20000) { @@ -246,7 +246,7 @@ uni.navigateTo({ url: `../productUpdate/index?id=${item.id}` }) - + }, upDownFrame(item) { this.productData = item @@ -260,7 +260,7 @@ }else if(this.productData.productStatus ==2){ data.productStatus = 1 } - + serve.productStatus(data).then(res=>{ uni.showToast({ title: res.msg, @@ -489,7 +489,7 @@ width: 160rpx; } } - + .header{ font-size: 32rpx; color: #000; diff --git a/packageIntegral/productUpdate/index.vue b/packageIntegral/productUpdate/index.vue index 5d9665e..0f9f715 100644 --- a/packageIntegral/productUpdate/index.vue +++ b/packageIntegral/productUpdate/index.vue @@ -6,14 +6,14 @@ - + 下一步 - - + + @@ -74,20 +74,20 @@ {{item.attributeName}}: - - + + - + - + 批量填充:批量填充填入信息后,可以批量将内容填写到SKU 信息里 {{item.label}} 确定 - + * 规格: @@ -131,7 +131,7 @@ - +