From 85e2d3b54ef6bea544c1b2ee2df500437b39f197 Mon Sep 17 00:00:00 2001 From: donqi Date: Mon, 16 May 2022 22:52:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E6=9E=B6=E6=9C=8D=E5=8A=A1-=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=93=81=E7=B1=BB=20=E5=90=8E=E5=8F=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/globalData.js | 2 +- common/js/request.js | 13 +- pages.json | 10 +- pages/demand-center/accept-demand-center.vue | 449 ++++++++++--------- pages/my/goods-manage.vue | 13 +- pages/my/new-serv.vue | 53 ++- 6 files changed, 325 insertions(+), 215 deletions(-) diff --git a/common/js/globalData.js b/common/js/globalData.js index b134ea7..96de592 100644 --- a/common/js/globalData.js +++ b/common/js/globalData.js @@ -1,5 +1,5 @@ export default { - deptId: 1, + deptId: 101, initPageNum: 1, initPageSize: 5 } \ No newline at end of file diff --git a/common/js/request.js b/common/js/request.js index 7d93f30..2d8dd10 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -1,14 +1,15 @@ import globalData from '@/common/js/globalData.js'; export default { - address: 'http://127.0.0.1:80', + address: 'https://www.opsoul.com', // 异步接口拦截 addInterceptor() { uni.addInterceptor('request', { invoke(args) { // request 触发前拼接 url // args.url = 'http://www.opsoul.com' + args.url; - args.url = this.address + args.url; + args.url = 'https://www.opsoul.com' + args.url; + args.data.deptId = globalData.deptId // console.log("停止触发"); // return false; }, @@ -129,5 +130,13 @@ export default { resObj = JSON.parse(resStr); } return resObj; + }, + async listByStep(params = {goodsCategoryId : null}) { + let res = await uni.request({ + url: '/goods/deptcategory/listByStep', + method: 'POST', + data: params + }) + return res[1].data; } } diff --git a/pages.json b/pages.json index 55ef2b3..d8f57e2 100644 --- a/pages.json +++ b/pages.json @@ -1,7 +1,6 @@ { "pages": [{ - // "path": "pages/index/index" - "path": "pages/my/new-serv" + "path": "pages/index/index" }], "subPackages": [{ "root": "pages/area-proxy/", @@ -26,6 +25,13 @@ }, { "path": "finish-order" }] + }, { + "root": "pages/my/", + "pages": [{ + "path": "new-serv" + }, { + "path": "goods-manage" + }] }], "globalStyle": { "navigationStyle": "custom", diff --git a/pages/demand-center/accept-demand-center.vue b/pages/demand-center/accept-demand-center.vue index dcdb9f1..ffaaea9 100644 --- a/pages/demand-center/accept-demand-center.vue +++ b/pages/demand-center/accept-demand-center.vue @@ -10,150 +10,164 @@ - - + - - - - {{item.title}} - - - - - {{item.title}} - - - - {{item.title}} - - + + + + {{item.title}} + + + + + {{item.title}} + + + + {{item.title}} + + - - - + + + - - - - - - {{task.title}} - - {{task.price}} - - 加急:{{task.expeditedPrice}} - - - - - {{tagContent}} - - - - {{task.address}} - - - - {{task.doorTime}} - - - - - - - - - - - - - - - - 加价申请 - - - - - - - 加价金额: - - - - - - - - - 取消 - 立即提交 - - - - - - - - 推荐奖励 - - - - - - 推荐转发有奖励,按每个奖励链接计算累计200单每单一元合计200元进行持续奖励: - 推荐本单另行奖励的金额如下 - - 奖励金额: - - - - - - 取消 - 立即推荐 - - - - - - - - - 您还未进行认证 - - - 以后认证 - 立即认证 - - - - - - - - - 接单成功 - 请在30分钟内联系客户,预约好上门时间,并在订单中操作排单时间,超时6倍将受平台处罚管理;该订单佣金在完成任务24小时内计入您的账户 - - - 联系客户 - 继续接单 - - + + + + + + {{task.title}} + + {{task.price}} + + 加急:{{task.expeditedPrice}} + + + + + {{tagContent}} + + + + {{task.address}} + + + + {{task.doorTime}} + + + + + + + + + + + + + + + + 加价申请 + + + + + + + 加价金额: + + + + + + + + + 取消 + + 立即提交 + + + + + + + + 推荐奖励 + + + + + + 推荐转发有奖励,按每个奖励链接计算累计200单每单一元合计200元进行持续奖励: + 推荐本单另行奖励的金额如下 + + 奖励金额: + + + + + + 取消 + + 立即推荐 + + + + + + + + + 您还未进行认证 + + + 以后认证 + 立即认证 + + + + + + + + + 接单成功 + 请在30分钟内联系客户,预约好上门时间,并在订单中操作排单时间,超时6倍将受平台处罚管理;该订单佣金在完成任务24小时内计入您的账户 + + + 联系客户 + 继续接单 + + @@ -161,21 +175,43 @@ - diff --git a/pages/my/goods-manage.vue b/pages/my/goods-manage.vue index bb7c90b..6e6ff95 100644 --- a/pages/my/goods-manage.vue +++ b/pages/my/goods-manage.vue @@ -44,7 +44,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -172,6 +172,15 @@ }, comfirmCommunity() { + }, + addEditGood(servItem) { + let params = ''; + if (servItem != null) { + params = '?goodId=' + servItem.id + } + uni.navigateTo({ + url: '/pages/my/new-serv' + params + }) } }, } diff --git a/pages/my/new-serv.vue b/pages/my/new-serv.vue index cb01f7d..3fac867 100644 --- a/pages/my/new-serv.vue +++ b/pages/my/new-serv.vue @@ -18,8 +18,8 @@ 选择类目 - - + @@ -202,14 +202,33 @@ }] } }, - onLoad() { - this.loadData(); + onLoad(options) { + let goodId = null; + if (options && options.goodId) { + goodId = options.goodId; + } + this.loadData(goodId); }, methods: { - async loadData() { - this.categoryList = await this.$api.data('categoryList'); + async loadData(goodId) { + this.loadCategoryList(); + // TODO 如果存在goodId说明是修改,需要查询good信息进行回显 + // this.categoryList = await this.$api.data('categoryList'); this.regionList = await this.$api.data('regionList'); }, + async loadCategoryList(idArr) { + let typeList = await this.$request.listByStep(); + typeList = typeList.data; + let col1Id = idArr ? idArr[0] : typeList[0].goodsCategoryId; + let subTypeList = await this.$request.listByStep({ goodsCategoryId: col1Id }); + subTypeList = subTypeList.data; + let col2Id = idArr ? idArr[1] : subTypeList[0].goodsCategoryId; + let subSubTypeList = await this.$request.listByStep({ goodsCategoryId: col2Id }); + subSubTypeList = subSubTypeList.data; + this.categoryList.push(typeList); + this.categoryList.push(subTypeList); + this.categoryList.push(subSubTypeList); + }, async categoryChange(e) { this.categoryMultiIndex = e.detail.value; let chosenCategory = []; @@ -220,6 +239,28 @@ this.formData.specsList = await this.$api.data('specsList'); }, + async categoryColChange(e) { + let colObj = e.detail; + if (colObj.column == 0) { + // 通过一级查询二级,通过二级查三级 + let subTypeList = await this.$request.listByStep({goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId}); + subTypeList = subTypeList.data; + let subSubTypeList = await this.$request.listByStep({ goodsCategoryId: subTypeList[0].goodsCategoryId }); + subSubTypeList = subSubTypeList.data; + this.categoryList.pop(); + this.categoryList.pop(); + this.categoryList.push(subTypeList); + this.categoryList.push(subSubTypeList); + this.categoryMultiIndex = [colObj.value, 0, 0]; + } else if (colObj.column == 1) { + // 通过二级查三级 + let subSubTypeList = await this.$request.listByStep({ goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId }); + subSubTypeList = subSubTypeList.data; + this.categoryList.pop(); + this.categoryList.push(subSubTypeList); + this.categoryMultiIndex = [this.categoryMultiIndex[0], colObj.value, 0]; + } + }, async regionChange(e) { this.regionMultiIndex = e.detail.value; let chosenRegion = [];