From 3e0b1593c5dded14e49f08d419b049ab3863c756 Mon Sep 17 00:00:00 2001 From: donqi Date: Mon, 27 Jun 2022 17:30:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/data.js | 130 +++++++++++++------------- common/js/request.js | 4 +- components/default-toast/bg-toast.vue | 2 +- pages/index/home.vue | 57 +++++++---- pages/index/my-home.vue | 12 +-- pages/my/my-cart.vue | 8 +- pages/order/order-detail.vue | 12 ++- pages/order/pay-result.vue | 6 +- pages/product/product-detail.vue | 10 +- pages/product/product-pick.vue | 3 +- pages/product/shop-detail.vue | 3 +- pages/publish/publish-task.vue | 6 +- 12 files changed, 141 insertions(+), 112 deletions(-) diff --git a/common/js/data.js b/common/js/data.js index b3655d9..9264e16 100644 --- a/common/js/data.js +++ b/common/js/data.js @@ -48,13 +48,13 @@ const subCategories = [{ cuIcon: 'shopfill', color: 'red', name: '空调清洗', - badge: '69洗' + badge: '' }, { id: 2, cuIcon: 'shopfill', color: 'orange', name: '家庭维修', - badge: '新品' + badge: '' }, { id: 3, cuIcon: 'shopfill', @@ -111,25 +111,25 @@ const subCategories = [{ badge: '' }, { id: 12, - cuIcon: 'deliver', + cuIcon: 'shopfill', color: 'green', name: '手机维修', badge: '' }, { id: 13, - cuIcon: 'deliver', + cuIcon: 'shopfill', color: 'pink', name: '洗衣洗鞋', badge: '' }, { id: 14, - cuIcon: 'deliver', + cuIcon: 'shopfill', color: 'pink', name: '上门安装', badge: '' }, { id: 15, - cuIcon: 'deliver', + cuIcon: 'shopfill', color: 'pink', name: '奢品养护', badge: '' @@ -744,21 +744,21 @@ const myInfo = { isVip: false, level: 'V3' }, - balance: '162.83', + balance: 0, integrate: 0, - cartNum: 3, + cartNum: 0, servCircle: { id: 1, name: '保利云景', - news: [{ + newBuy: [{ id: 1, - avatarUrl: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big33000.jpg', + avatarUrl: '', userName: 'tsda9', action: '购买了家政/修理/门窗/滑轮更换服务', type: 0 // 0表示立即下单,1表示学家政 }, { id: 2, - avatarUrl: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big33001.jpg', + avatarUrl: '', userName: '心da8', action: '发布了清洗/空调/挂机清洗服务 高温蒸清全拆', type: 1 // 0表示立即下单,1表示学家政 @@ -1605,83 +1605,83 @@ const servCategory = [{ }] const categoryList = [{ - id: 1, - name: '家电清洗', - children: [{ + goodsCategoryId: 1, + goodsCategoryName: '家电清洗', + child: [{ pId: 1, - id: 2, - name: '空调', - children: [{ - id: 3, - name: '单台清洗' + goodsCategoryId: 2, + goodsCategoryName: '空调', + child: [{ + goodsCategoryId: 3, + goodsCategoryName: '单台清洗' }, { - id: 4, - name: '套餐清洗' + goodsCategoryId: 4, + goodsCategoryName: '套餐清洗' }, { - id: 5, - name: '空调加氧' + goodsCategoryId: 5, + goodsCategoryName: '空调加氧' }] }, { pId: 1, - id: 6, - name: '烟灶', - children: [{ - id: 7, - name: '单台清洗' + goodsCategoryId: 6, + goodsCategoryName: '烟灶', + child: [{ + goodsCategoryId: 7, + goodsCategoryName: '单台清洗' }, { - id: 8, - name: '套餐清洗' + goodsCategoryId: 8, + goodsCategoryName: '套餐清洗' }] }] }, { - id: 9, - name: '衣物洗护', - children: [{ + goodsCategoryId: 9, + goodsCategoryName: '衣物洗护', + child: [{ pId: 9, - id: 10, - name: '丝绸服装', - children: [{ - id: 11, - name: '单件清洗' + goodsCategoryId: 10, + goodsCategoryName: '丝绸服装', + child: [{ + goodsCategoryId: 11, + goodsCategoryName: '单件清洗' }, { - id: 12, - name: '套餐清洗' + goodsCategoryId: 12, + goodsCategoryName: '套餐清洗' }] }, { pId: 9, - id: 14, - name: '呢绒服装', - children: [{ - id: 15, - name: '单件清洗' + goodsCategoryId: 14, + goodsCategoryName: '呢绒服装', + child: [{ + goodsCategoryId: 15, + goodsCategoryName: '单件清洗' }] }] }, { - id: 16, - name: 'Tab3', - children: [{ - id: 17, - name: 'Tab3-0', - children: [{ - id: 18, - name: 'Tab3-0-0' + goodsCategoryId: 16, + goodsCategoryName: 'Tab3', + child: [{ + goodsCategoryId: 17, + goodsCategoryName: 'Tab3-0', + child: [{ + goodsCategoryId: 18, + goodsCategoryName: 'Tab3-0-0' }, { - id: 19, - name: 'Tab3-0-1' + goodsCategoryId: 19, + goodsCategoryName: 'Tab3-0-1' }] }] }, { - id: 20, - name: 'Tab4', - children: [{ - id: 21, - name: 'Tab4-0', - children: [{ - id: 22, - name: 'Tab4-0-0' + goodsCategoryId: 20, + goodsCategoryName: 'Tab4', + child: [{ + goodsCategoryId: 21, + goodsCategoryName: 'Tab4-0', + child: [{ + goodsCategoryId: 22, + goodsCategoryName: 'Tab4-0-0' }, { - id: 23, - name: 'Tab4-0-1' + goodsCategoryId: 23, + goodsCategoryName: 'Tab4-0-1' }] }] }] diff --git a/common/js/request.js b/common/js/request.js index dfdcf54..07636e2 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -10,9 +10,9 @@ export default { title: '加载中' }) // request 触发前拼接 url - // args.url = 'https://www.opsoul.com' + args.url; + args.url = 'https://www.opsoul.com' + args.url; // args.url = 'http://192.168.2.42:80' + args.url; - args.url = 'http://127.0.0.1:80' + args.url; + // args.url = 'http://127.0.0.1:80' + args.url; if (args.data) { args.data.deptId = globalData.deptId; args.data.from = globalData.from; diff --git a/components/default-toast/bg-toast.vue b/components/default-toast/bg-toast.vue index d33685c..10b3546 100644 --- a/components/default-toast/bg-toast.vue +++ b/components/default-toast/bg-toast.vue @@ -2,7 +2,7 @@ - 开发中,敬请期待 + 功能开发中,暂无法使用 diff --git a/pages/index/home.vue b/pages/index/home.vue index 4d66647..946acdd 100644 --- a/pages/index/home.vue +++ b/pages/index/home.vue @@ -33,13 +33,11 @@ - - - - - {{item.name}} - + + + + {{item.goodsCategoryName}} @@ -53,7 +51,7 @@ {{item.badge}} - {{item.name}} + {{item.goodsCategoryName}} @@ -65,7 +63,7 @@ {{item.badge}} - {{item.name}} + {{item.goodsCategoryName}} @@ -118,7 +116,8 @@ verticalGoodsCard }, data() { - return { + return { + scrollLeft: 0, dotStyle: true, swiperList: [], tabCur: 0, @@ -170,11 +169,13 @@ pageNum: 0, pageSize: 50 }); - this.hotGoods = hotGoodsRes.rows; + this.hotGoods = hotGoodsRes.rows; + // 加载品类 + this.loadCategoryList(); this.swiperList = await this.$api.data('swiperList'); - this.categories = await this.$api.data('categories'); - this.subCategories = await this.$api.data('subCategories'); + // this.categories = await this.$api.data('categories'); + // this.subCategories = await this.$api.data('subCategories'); this.moduleBarInfos = await this.$api.data('moduleBarInfos'); // this.hotGoods = await this.$api.data('hotGoods'); // this.discountGoods = await this.$api.data('discountGoods'); @@ -184,6 +185,16 @@ }, offBindEvent() { uni.$off('index_showProductDetail'); + }, + async loadCategoryList() { + let typeList = await this.$request.listByStep(); + typeList = typeList.data; + let subTypeList = await this.$request.listByStep({ + goodsCategoryId: typeList[0].goodsCategoryId + }); + subTypeList = subTypeList.data; + this.categories = subTypeList; + this.tabSelect(null, this.categories[0]); }, async loadRegionList() { let regionList = await this.$request.areaListByStep(); @@ -247,13 +258,19 @@ this.areaMultiIndex = [this.areaMultiIndex[0], colObj.value, 0]; } }, - async tabSelect(e) { - this.tabCur = e.currentTarget.dataset.id; - // 获取大类信息 - let categoryId = this.categories[this.tabCur].id; - console.log("切换细类, 大类id=" + categoryId); - let allSubCategories = await this.$api.data('subCategories'); - this.subCategories = allSubCategories.slice(0, (4 - categoryId) * 5); + async tabSelect(e, item) { + this.tabCur = e == null ? 0 : e.currentTarget.dataset.index; + this.scrollLeft = (this.tabCur - 1) * 60; + let subSubTypeList = await this.$request.listByStep({ + goodsCategoryId: item.goodsCategoryId + }); + subSubTypeList = subSubTypeList.data; + let subCategoryOpt = await this.$api.data('subCategories'); + for(let i = 0; i < subSubTypeList.length; i++) { + subSubTypeList[i]['cuIcon'] = subCategoryOpt[i].cuIcon; + subSubTypeList[i]['color'] = subCategoryOpt[i].color; + } + this.subCategories = subSubTypeList; }, chooseCategory(item) { this.searchInfo.category = item; diff --git a/pages/index/my-home.vue b/pages/index/my-home.vue index e768fc9..b94f973 100644 --- a/pages/index/my-home.vue +++ b/pages/index/my-home.vue @@ -46,7 +46,7 @@ - + @@ -287,19 +287,19 @@ }], servOrderType: 0, productOrderTabList: [{ - type: 'pdOrdersWait2Pay', + // type: -1, name: '待付款' }, { - type: 'pdOrdersBought', + type: -1, name: '买到的' }, { - type: 'pdOrdersSaled', + type: -1, name: '卖出的' }, { - type: 'pdOrdersAfterServ', + type: -1, name: '售后中' }, { - type: 'pdOrdersFinish', + type: -1, name: '已完成' }], productOrderType: 1 diff --git a/pages/my/my-cart.vue b/pages/my/my-cart.vue index 4c9e526..6536d81 100644 --- a/pages/my/my-cart.vue +++ b/pages/my/my-cart.vue @@ -79,7 +79,7 @@ }, methods: { async loadData() { - this.pickedProductList = await this.$api.data('pickedProductList'); + // this.pickedProductList = await this.$api.data('pickedProductList'); }, bindEvent() { uni.$on('changePickedNum', this.changePickedNum); @@ -140,9 +140,9 @@ this.allChecked = !this.allChecked; }, submit() { - uni.navigateTo({ - url: '/pages/order/order-detail' - }) + // uni.navigateTo({ + // url: '/pages/order/order-detail' + // }) } } } diff --git a/pages/order/order-detail.vue b/pages/order/order-detail.vue index 99f8316..002d675 100644 --- a/pages/order/order-detail.vue +++ b/pages/order/order-detail.vue @@ -64,7 +64,7 @@ - {{item.shopName}} + {{item.name}} @@ -176,12 +176,18 @@ this.offBindEvent(); }, methods: { - async loadData(params) { - console.log(params) + async loadData(params) { // this.pickedProductList = await this.$api.data('pickedProductList'); this.pickedProductList = params.pickedProductList; + this.loadTotalPrice(); this.timeRangeList = this.$globalData.timeRangeList; this.timeRange = this.timeRangeList[0]; + }, + loadTotalPrice() { + // 计算totalprice + this.pickedProductList.forEach((obj) => { + this.totalPrice += Number(obj.totalMoney) + }) }, bindEvent() { uni.$on(this.$globalFun.CHOOSE_ADDRESS, this.chooseAddress); diff --git a/pages/order/pay-result.vue b/pages/order/pay-result.vue index e831394..8b3ca87 100644 --- a/pages/order/pay-result.vue +++ b/pages/order/pay-result.vue @@ -1,9 +1,9 @@