From 1d63aad673cdc4270087229f1146e9fdbb10a75f Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Thu, 16 May 2024 11:34:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E6=89=AB=E7=A0=81=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E6=B7=BB=E5=8A=A0=E6=9D=A1=E5=BD=A2=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 32 +++++++++++-------- pages/nongKe/gather/select_warehouse.vue | 22 ------------- pages/product/addGoodDetail/addGoodDetail.vue | 20 +----------- pages/product/addGoodDetail/goodsPrice.vue | 14 ++++++-- 4 files changed, 30 insertions(+), 58 deletions(-) diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 582561b..4ccd172 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -1,16 +1,20 @@ -{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ - // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 - "version": "0.0", - "configurations": [{ - "app-plus" : - { - "launchtype" : "local" - }, - "default" : - { - "launchtype" : "local" - }, - "type" : "uniCloud" - } +{ + // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version" : "0.0", + "configurations" : [ + { + "app-plus" : { + "launchtype" : "local" + }, + "default" : { + "launchtype" : "local" + }, + "type" : "uniCloud" + }, + { + "playground" : "custom", + "type" : "uni-app:app-android" + } ] } diff --git a/pages/nongKe/gather/select_warehouse.vue b/pages/nongKe/gather/select_warehouse.vue index c4b9e34..c401025 100644 --- a/pages/nongKe/gather/select_warehouse.vue +++ b/pages/nongKe/gather/select_warehouse.vue @@ -322,32 +322,10 @@ }, addGoods(item = {}) { item = (JSON.stringify(item)); - console.log(item) uni.navigateTo({ url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${this.mer_id}&&goodsInfo=${item}` }) return - // if(this.isNullImage(item.image)|| - // ( this.isNullImage(item.slider_image[0]) && this.isNullImage(item.slider_image[1]) && this.isNullImage(item.slider_image[2]) )){ - // return Toast('请先上传商品图片后再加入店铺'); - // } - // if(item.update) return Toast('请保存修改后再添加'); - this.putGoods.id = item.id; - this.putGoods.price = ''; - this.putGoods.stock = ''; - this.putGoods.store_name = item.store_name; - Object.keys(this.showPutGoodsInput).forEach((key) => { - if (item[key] == null || item[key] == undefined || item[key] == '') { - this.showPutGoodsInput[key] = true; - this.putGoods[key] = ''; - } else { - this.showPutGoodsInput[key] = false; - this.putGoods[key] = item[key]; - } - }) - this.initShop(item); - // this.addGoodsShow = true - // this.item = item }, initShop(item) { if (item.spec == '' || item.spec == undefined || item.spec == null) { diff --git a/pages/product/addGoodDetail/addGoodDetail.vue b/pages/product/addGoodDetail/addGoodDetail.vue index 15b85b3..0bfeffc 100644 --- a/pages/product/addGoodDetail/addGoodDetail.vue +++ b/pages/product/addGoodDetail/addGoodDetail.vue @@ -540,7 +540,6 @@ } }, choseMedia(e) { - console.log(e.value) this.show = false if (e.value[0] == '图片') { this.handleChooseImage() @@ -640,12 +639,7 @@ this.sets = true } }) - - - }, - - sexSelect(e) { this.model1.userInfo.sex = e.name this.$refs.uForm.validateField('userInfo.sex') @@ -656,16 +650,12 @@ }) }, back() { - // console.log('show') this.go = false uni.navigateBack() }, showlayFn() { uni.navigateBack() }, - // submit() { - // console.log(this.formData) - // }, getAttr(object) { this.formData.product_attribute = object }, @@ -722,11 +712,9 @@ }) }, submit() { - console.log(this.formData) this.$refs.formData.validate().then(res => { this.handAdd() }).catch(errors => { - // console.log(errors) uni.$u.toast(errors[0].message) }) @@ -756,14 +744,13 @@ console.log(goods) this.formData.store_name = goods.store_name this.formData.imageList = [goods.image, ...goods.slider_image] - console.log(this.formData) + this.formData.attrValue[0].bar_code = goods.bar_code } } }, onLoad(option) { - // let that = this this.initFormData(option) this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet this.isSet2() @@ -773,7 +760,6 @@ return item.value == this.formData.delivery_free[0] }) } - if (option.product_id) { this.formData.product_id = option.product_id this.mode = 'edit' @@ -792,13 +778,9 @@ return item.value == this.formData.delivery_free[0] }) } - console.log(this.formData, 'formDATA') }) } - - console.log(JSON.parse(option.formData)) - }, onBackPress: function(e) { this.showlay = true diff --git a/pages/product/addGoodDetail/goodsPrice.vue b/pages/product/addGoodDetail/goodsPrice.vue index f8cfe69..dc33bd1 100644 --- a/pages/product/addGoodDetail/goodsPrice.vue +++ b/pages/product/addGoodDetail/goodsPrice.vue @@ -58,8 +58,7 @@ - + 删除 @@ -176,6 +175,16 @@ } }, methods: { + delFn(index) { + if (this.attrValue.length == 1) { + return this.$util.Tips({ + title: "最少保留一个规格" + }) + } + this.attrValue.splice(index, 1) + this.formData.attr.splice(index, 1) + }, + choseAttr(name) { this.isWhose ? this.attrValue[this.unitIndex].wholesale_unit_name = name : @@ -268,7 +277,6 @@ item.is_use = item.is_use ? '0' : '1' }) let that = this - console.log(this.formData.attrValue) this.formData.spec_type = this.formData.attrValue.length > 1 ? '1' : '0' uni.redirectTo({ url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`