diff --git a/api/common.js b/api/common.js new file mode 100644 index 0000000..398f46b --- /dev/null +++ b/api/common.js @@ -0,0 +1,34 @@ +// +---------------------------------------------------------------------- +// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] +// +---------------------------------------------------------------------- +// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved. +// +---------------------------------------------------------------------- +// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 +// +---------------------------------------------------------------------- +// | Author: CRMEB Team +// +---------------------------------------------------------------------- +import request from "@/utils/request.js"; + +/** + * 获取省份 + + */ +export function getProvince() { + return request.get("city/get_province"); +} + +/** + * 获取省份 + + */ +export function getCity(data) { + return request.get("city/get_city", data); +} + +/** + * 获取省份 + + */ +export function getArea(data) { + return request.get("city/get_area", data); +} \ No newline at end of file diff --git a/api/product.js b/api/product.js index 9e64319..6c403f2 100644 --- a/api/product.js +++ b/api/product.js @@ -160,12 +160,21 @@ export function categorySearch(merId, data) { 添加修改商品, 热门分类商品 */ -export function categoryHotcate(merId, data) { - return request.get(`server/${merId}/category/hotcate`, data, { +export function categorySearchHistory(merId, uid, data) { + return request.post(`server/${merId}/category/search_history/${uid}`, data, { login: true }) } +/* + 添加修改商品, 添加热门分类商品 +*/ + +export function categoryHotcate(merId, uid) { + return request.get(`server/${merId}/category/hotcate/${uid}`, { + login: true + }) +} /* 商品管理, 添加商品 diff --git a/pages/product/addGood/addGood.vue b/pages/product/addGood/addGood.vue index 0ab7d5d..437b873 100644 --- a/pages/product/addGood/addGood.vue +++ b/pages/product/addGood/addGood.vue @@ -7,7 +7,7 @@ {{value1.length}}/{{maxLength}} - @@ -146,9 +146,8 @@ ], selfAttr: "", formData: { - store_name: "", + // store_name: "", imageList: [], - attrValue: [], cate_name: "", cate_id: "", attrValue: [{ @@ -157,9 +156,12 @@ "wholesale_unit_name": "", "wholesale_price": '', "stock": "", + open: true, + spec_type: '单规格' }], - product_attribute: [], - spec_type: "0" + image: '', + slider_image: [], + // product_attribute: [], }, showPouple: false, fileList6: [], @@ -169,9 +171,6 @@ value4: "", maxLength: 30, showSex: false, - - - rules: { title: { type: 'string', @@ -264,9 +263,12 @@ }) }, async submit() { - // this.formData.imageList = this.formData.imageList.map(item => item.url) - // await this.$refs.formData.validate() - productCreate(this.mer_id, this.formData) + let data = uni.$u.deepClone(this.formData) + data.imageList = data.imageList.map(item => item.url) + data.image = data.imageList[0] + data.slider_image = data.imageList.splice(0, 1) + data.store_name = data.cate_name + productCreate(this.mer_id, data) .then(res => { hideLoading(); Modal('提交成功', '点击确定,前往商品列表页面').then(() => { @@ -292,12 +294,8 @@ if (option.data) { this.formData.cate_name = JSON.parse(option.data).label this.formData.cate_id = JSON.parse(option.data).value - console.log(option.data) } }, - - - }; \ No newline at end of file diff --git a/pages/product/addGoodDetail/goodsSearch.vue b/pages/product/addGoodDetail/goodsSearch.vue index 31f2a7e..2b5dea2 100644 --- a/pages/product/addGoodDetail/goodsSearch.vue +++ b/pages/product/addGoodDetail/goodsSearch.vue @@ -9,23 +9,8 @@ 常用分类 - - 地方大 - - - 地方撒 - - - 地方撒旦 - - - 地方撒大苏 - - - 地方 - - - 地方撒大苏 + + {{item.label}} @@ -37,8 +22,6 @@ {{item.label}} - - @@ -52,7 +35,6 @@ 暂无搜索结果,点击 手动选择 - @@ -61,7 +43,8 @@