From de920312841ae1b21f1dc5df7a82066c80cae3d4 Mon Sep 17 00:00:00 2001 From: zhangyouji Date: Thu, 28 Mar 2024 09:43:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=95=86=E5=9F=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/packageIntegral/productList.js | 49 ++ packageIntegral/components/mulpicker.vue | 40 +- packageIntegral/productAddition/index.vue | 429 ++++++++++++-- .../productAddition/productAddStep2.vue | 122 +++- packageIntegral/productList/index.vue | 156 ++++-- packageIntegral/takeGoods/index.vue | 2 +- pages/stationDetail/ZYSite.vue | 2 +- uni_modules/uni-data-select/changelog.md | 37 ++ .../uni-data-select/uni-data-select.vue | 527 ++++++++++++++++++ uni_modules/uni-data-select/package.json | 85 +++ uni_modules/uni-data-select/readme.md | 8 + 11 files changed, 1301 insertions(+), 156 deletions(-) create mode 100644 api/packageIntegral/productList.js create mode 100644 uni_modules/uni-data-select/changelog.md create mode 100644 uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue create mode 100644 uni_modules/uni-data-select/package.json create mode 100644 uni_modules/uni-data-select/readme.md diff --git a/api/packageIntegral/productList.js b/api/packageIntegral/productList.js new file mode 100644 index 0000000..746fa8a --- /dev/null +++ b/api/packageIntegral/productList.js @@ -0,0 +1,49 @@ +import request from '@/utils/request' + +export default{ + productByPage(data) { // 商品分页查询 + return request({ + url: `/oil-mall/mobile/productByPage`, + method: 'post', + data + }) + }, + getTopInfo() { // 获取头部信息 + return request({ + url: `/oil-mall/mobile/getTopInfo`, + method: 'get', + }) + }, + productStatus(data) { // 上下架接口 + return request({ + url: `/oil-mall/mobile/productStatus`, + method: 'post', + data + }) + }, + productAuditHistory(data) { // 审核信息接口 + return request({ + url: `/oil-mall/mobile/productAuditHistory`, + method: 'post', + data + }) + }, + classification() { // 商品分类-树形接口 + return request({ + url: `/oil-mall/mobile/classification`, + method: 'get', + }) + }, + getProductBrands() { // 品牌信息接口 + return request({ + url: `/oil-mall/mobile/getProductBrands`, + method: 'get', + }) + }, + getAttributesType() { // 属性类型接口 + return request({ + url: `/oil-mall/mobile/getAttributesType`, + method: 'get', + }) + }, +} \ No newline at end of file diff --git a/packageIntegral/components/mulpicker.vue b/packageIntegral/components/mulpicker.vue index eb1b465..b180403 100644 --- a/packageIntegral/components/mulpicker.vue +++ b/packageIntegral/components/mulpicker.vue @@ -19,7 +19,7 @@ pidkey: { default: 'pid' }, // 对应父id取值 placeholder: { default: '请选择' }, emitPath: { default: false, type: Boolean }, // 是否子父级关联 ,是的时候返回的是逗号分隔的父子code - level: { default: 3, type: Number } // 列数 2或者3 + level: { default: 2, type: Number } // 列数 2或者3 }, data() { return { @@ -30,21 +30,20 @@ }, methods: { handleColumnChange(e) { - let columnindex = e.detail.value; // 拖动列索引 switch (e.detail.column) { case 0: //拖动第1列 - + // 第二级 let arr1 = this.multiArray[0]; this.multiArray[1] = arr1[columnindex][this.childkey]||[]; - + if(this.level === 3) { // 第三级 let arr2 = this.multiArray[1]; this.multiArray[2] = arr2[0][this.childkey]||[]; } - + this.multiIndex.splice(0, 1, columnindex) this.multiIndex.splice(1, 1, 0) this.multiIndex.splice(2, 1, 0) @@ -55,14 +54,14 @@ let arr3 = this.multiArray[1]; this.multiArray[2] = arr3[columnindex][this.childkey]||[]; } - + this.multiIndex.splice(1, 1, columnindex) this.multiIndex.splice(2, 1, 0) break } - + }, - // + // pickerChange(e) { let multiIndex = e.detail.value; if(this.emitPath) { @@ -75,21 +74,19 @@ } let code = codeArr.join(','); this.name = nameArr.join('/'); - console.log('code1',code); this.$emit('input', code) }else { - + let curArr = this.multiArray[2], code=''; if(curArr && curArr.length) { code = curArr[multiIndex[2]][this.code]; this.name = curArr[multiIndex[2]][this.rangekey]; - }else { + }else { curArr = this.multiArray[1] code = curArr[multiIndex[1]][this.code]; this.name = curArr[multiIndex[1]][this.rangekey]; } - - console.log('code2',code); + this.$emit('input', code) } }, @@ -104,7 +101,7 @@ // 第三级 let arr2 = this.multiArray[1]; this.multiArray.push(arr2[this.multiIndex[1]][this.childkey]||[]); - + } }, curDataFind (data, code) { @@ -151,16 +148,17 @@ list: { immediate: true, handler(val) { - console.log(val) - this.dataInit(); - this.initName(); + if(JSON.stringify(val) != '[]'){ + this.dataInit(); + this.initName(); + } + } }, value: { // immediate: true, handler(val) { - console.log(val) - this.initName(); + this.initName(); } }, } @@ -168,5 +166,5 @@ \ No newline at end of file + + diff --git a/packageIntegral/productAddition/index.vue b/packageIntegral/productAddition/index.vue index 04a0c16..61b3b60 100644 --- a/packageIntegral/productAddition/index.vue +++ b/packageIntegral/productAddition/index.vue @@ -5,39 +5,44 @@ 新增商品 - + - - + + - - + + - - + + + - - + + - - + + - + @@ -53,10 +58,78 @@ - + + + + + + + 商品类型: + + + + {{item.attributeName}}: + + + + + + + + + + + 批量填充:批量填充填入信息后,可以批量将内容填写到SKU 信息里 + {{item.label}} + 确定 + + + + * + 规格: + {{radioAttributes}}+{{items}} + + {{item.label}} + 删除 + + + + * + 规格: + {{radioAttributes}} + + {{item.label}} + 删除 + + + + * + 商品图片:最多可上传10张图片 + + 商品主图 + 设为主图 + + + + + + + + + + + 详情图片:最多可上传10张图片 + + + 上一步 - 完成 + 完成 @@ -67,7 +140,8 @@ @@ -41,15 +105,33 @@ .container{ .body{ padding: 30rpx; + width: 100%; } } .bodyContent{ - position: relative; - // padding-left:150rpx; - .bodyLabel{ - display: inline-block; - width: 150rpx; - } + width: 100%; + + } + .tagButton{ + display: inline-block; + width: 133rpx; + height: 58rpx; + background: #f5f5f5; + color: #666666; + border-radius: 10rpx; + line-height: 58rpx; + text-align: center; + margin: 10rpx; + } + .redButton{ + display: inline-block; + width: 84rpx; + height: 58rpx; + background: red; + color: #fff; + border-radius: 10rpx; + line-height: 58rpx; + text-align: center; } \ No newline at end of file diff --git a/packageIntegral/productList/index.vue b/packageIntegral/productList/index.vue index 54e62db..b02a0a1 100644 --- a/packageIntegral/productList/index.vue +++ b/packageIntegral/productList/index.vue @@ -9,29 +9,31 @@ {{item.text}}({{item.count}}) - - + + - 已上架 + {{item.productStatus =='1'?'已上架':'未上架'}} - + {{item.productName}} 规格:默认 - ¥{{item.marketPrice}} X{{item.orderNum}} - 库存:{{item.orderNum}} + 库存:{{item.totalStock}} - {{statusEnum[1].value}} + {{statusEnum[item.auditStatus].value}} 删除 编辑 - 上架 + {{item.productStatus =='1'?'上架':'下架'}} @@ -50,13 +52,13 @@ 审核时间 {{item.createTime}} - + 审核结果 - {{item.status}} + {{statusEnum[item.auditStatus].value}} 反馈详情 - {{item.dateil}} + {{item.remark}} @@ -77,10 +79,10 @@ - 是否上架/下架该商品? + 是否{{productData.productStatus =='1'?'下架':'上架'}}该商品? 取消 - 确认 + 确认 @@ -89,7 +91,7 @@ + + diff --git a/uni_modules/uni-data-select/package.json b/uni_modules/uni-data-select/package.json new file mode 100644 index 0000000..47afe60 --- /dev/null +++ b/uni_modules/uni-data-select/package.json @@ -0,0 +1,85 @@ +{ + "id": "uni-data-select", + "displayName": "uni-data-select 下拉框选择器", + "version": "1.0.7", + "description": "通过数据驱动的下拉框选择器", + "keywords": [ + "uni-ui", + "select", + "uni-data-select", + "下拉框", + "下拉选" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "^3.1.1" + }, + "directories": { + "example": "../../temps/example_temps" + }, +"dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": ["uni-load-more"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "u", + "app-nvue": "n" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "u", + "百度": "u", + "字节跳动": "u", + "QQ": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-data-select/readme.md b/uni_modules/uni-data-select/readme.md new file mode 100644 index 0000000..eb58de3 --- /dev/null +++ b/uni_modules/uni-data-select/readme.md @@ -0,0 +1,8 @@ +## DataSelect 下拉框选择器 +> **组件名:uni-data-select** +> 代码块: `uDataSelect` + +当选项过多时,使用下拉菜单展示并选择内容 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839