diff --git a/api/api.js b/api/api.js index 17cf5dc..3daf575 100644 --- a/api/api.js +++ b/api/api.js @@ -26,8 +26,8 @@ export function seachBarCodeAPI(data) { * 获取里海云仓商品 * */ -export function getProductSpuAPI(id) { - return request.get(`product/spu/cloud_merchant/${id}`, {}, { noAuth: true }); +export function getProductSpuAPI(id, param) { + return request.get(`product/spu/cloud_merchant/${id}`, param, { noAuth: true }); } //获取云仓库店铺id export function get_cloud_shop(street_code) { diff --git a/pages.json b/pages.json index d24dda6..1fe2067 100644 --- a/pages.json +++ b/pages.json @@ -652,6 +652,7 @@ "path": "index", "style": { "navigationStyle": "custom", + "enablePullDownRefresh": true, "navigationBarTitleText": "店铺diy首页" // #ifdef MP , @@ -662,9 +663,10 @@ "path": "home/index", "style": { "navigationStyle": "custom", - "navigationBarTitleText": "店铺首页" + "navigationBarTitleText": "店铺首页", + "enablePullDownRefresh": true // #ifdef MP - , + , "navigationBarTextStyle": "#FFFFFF" // #endif } @@ -672,6 +674,7 @@ { "path": "detail/index", "style": { + "enablePullDownRefresh": true, "navigationBarTitleText": "店铺详情" } }, diff --git a/pages/nongKe/gather/select_warehouse.vue b/pages/nongKe/gather/select_warehouse.vue index 7e250cd..d57ad8d 100644 --- a/pages/nongKe/gather/select_warehouse.vue +++ b/pages/nongKe/gather/select_warehouse.vue @@ -107,7 +107,6 @@ onLoad(e) { this.mer_id = e.mer_id this.stype = e.stype - console.log(this.stype); if (this.stype == 1) { return this.goodsData[0].name = '商品添加' } @@ -126,7 +125,6 @@ addGoodsopen() { if (this.item) { post_product_import(this.item.product_id).then(e => { - console.log(e) if (e.status == 200) { Toast(e.data.msg) this.addGoodsShow = false @@ -140,7 +138,6 @@ Toast('已经导入过该商品了') this.addGoodsShow = false } - console.log(err); }) } this.item = [] @@ -186,14 +183,30 @@ } }, navigato(type) { - type === 1 ? this.searchGoodsShow = true : this.scanCode(); + if (type === 1) { + if (this.stype == 1) { + uni.navigateTo({ + url: '/pages/product/addGoods/index' + }); + return; + } + this.searchGoodsShow = true + } else { + this.scanCode(); + } }, scanCode() { const self = this uni.scanCode({ scanType: ["qrCode", "barCode", "datamatrix", "pdf417"], success(res) { - self.seachBarCode(res.result) + if (self.stype == 1) { + uni.navigateTo({ + url: `/pages/product/addGoods/index?mer_id=${self.mer_id}&code=${res.result}` + }) + } else { + self.seachBarCode(res.result) + } }, fail(res) { @@ -202,7 +215,6 @@ }) }, async seachBarCode(code) { - console.log(code); const { data } = await seachBarCodeAPI({ @@ -215,25 +227,7 @@ }) return } - console.log(data.list[0]); - post_product_import(data.list[0].product_id).then(e => { - console.log(e) - if (e.status == 200) { - Toast(e.data.msg) - this.addGoodsShow = false - if (e.status == 400) { - Toast(e.message) - this.addGoodsShow = false - } - } - }).catch(err => { - if (err == "已经导入过该商品了") { - Toast('已经导入过该商品了') - this.addGoodsShow = false - } - console.log(err); - }) - // this.goods = data.list + this.goods = data.list }, }, onPullDownRefresh() { diff --git a/pages/product/addGoods/index.vue b/pages/product/addGoods/index.vue index 8cf2bc2..5351da5 100644 --- a/pages/product/addGoods/index.vue +++ b/pages/product/addGoods/index.vue @@ -411,6 +411,7 @@ if (this.step == 2) { this.secoundModel = !this.secoundModel; } + this.initClasiffy(); }, watch: { @@ -431,6 +432,10 @@ }, methods: { // 获取数据 + async initClasiffy() { + //获取商户分类 + this.merchantClassification = (await storeClassifyLst(this.merId)).data; + }, async initData() { if (getStorage('addGoodsFormData')) { this.setFormData = getStorage('addGoodsFormData'); @@ -438,9 +443,6 @@ } // 获取品牌 this.brand = (await categoryBrandlist(this.merId)).data; - // 获取商户分类 - this.merchantClassification = (await storeClassifyLst(this.merId)).data; - console.log( this.merchantClassification = (await storeClassifyLst(this.merId)).data); // 获取平台分类 this.platformClassificationData = (await categoryList(this.merId)).data; // 数据回显 @@ -610,8 +612,7 @@ // 获取已选择得店铺数据 handleGetSelectStore(item) { - this.setFormData.mer_cate_id = item.map(val => val.value); - console.log(item); + this.setFormData.mer_cate_id = item.map(val => val.store_category_id); this.setFormData.mer_cate_name = item.map(val => val.cate_name).join(','); this.$refs.select_store.close(); }, @@ -772,6 +773,7 @@ // 开始下一步 handleNextStep() { + console.log(this.setFormData.setSpecificaValue) let canJumpFlag = true; let requireData = { image: '请选择主图', diff --git a/pages/product/addGoods/singleSpecification.vue b/pages/product/addGoods/singleSpecification.vue index 3ffe109..a9c26ce 100644 --- a/pages/product/addGoods/singleSpecification.vue +++ b/pages/product/addGoods/singleSpecification.vue @@ -39,28 +39,28 @@ { id: 1, label: '售价', - type: 'input', + type: 'digit', model: 'price', holder: '请填写售价' }, { id: 2, label: '成本价', - type: 'input', + type: 'digit', holder: '请填写成本价', model: 'cost' }, { id: 3, label: '原价', - type: 'input', + type: 'digit', holder: '请填写原价', model: 'ot_price' }, { id: 4, label: '库存', - type: 'input', + type: 'number', holder: '请填写库存', model: 'stock' } @@ -76,28 +76,28 @@ { id: 6, label: '重量', - type: 'input', + type: 'digit', holder: '请输入重量', model: 'weight' }, { id: 7, label: '体积', - type: 'input', + type: 'digit', holder: '请输入体积', model: 'volume' }, { id: 8, label: '佣金(一级)', - type: 'input', + type: 'digit', holder: '请输入一级佣金', model: 'extension_one' }, { id: 8, label: '佣金(二级)', - type: 'input', + type: 'digit', holder: '请输入二级佣金', model: 'extension_two' } diff --git a/pages/product/components/selectForm.vue b/pages/product/components/selectForm.vue index 35521bd..ffd8bae 100644 --- a/pages/product/components/selectForm.vue +++ b/pages/product/components/selectForm.vue @@ -1,7 +1,7 @@