From 86d765d6bae19cdb478e2643e8f733a832373a46 Mon Sep 17 00:00:00 2001 From: ghusermoon <2673031505@qq.com> Date: Wed, 19 Aug 2020 11:21:31 +0800 Subject: [PATCH] order number 8.19 --- common/api/user.js | 4 + pageE/tool/MineHistory.vue | 2 +- pageE/tool/WashOrder.vue | 10 +-- pageE/useCoupon/index.vue | 2 +- pages/mine/index.vue | 161 +++++++++++++++++++++---------------- 5 files changed, 99 insertions(+), 80 deletions(-) diff --git a/common/api/user.js b/common/api/user.js index e2706d2..e084b8a 100644 --- a/common/api/user.js +++ b/common/api/user.js @@ -242,6 +242,10 @@ export default { if(type > 0) Object.assign(params, {type: type}); return vm.$u.post('Order/orderList', params); }, + // 各种订单数量 + getOrderNumber() { + return vm.$u.post('order/orderNumber'); + }, // 售后列表 // getAfterSaleList({ page }) { // return vm.$u.post('order/afterSaleList', { page: page }); diff --git a/pageE/tool/MineHistory.vue b/pageE/tool/MineHistory.vue index da74a6f..6c333df 100644 --- a/pageE/tool/MineHistory.vue +++ b/pageE/tool/MineHistory.vue @@ -19,7 +19,7 @@ - + diff --git a/pageE/tool/WashOrder.vue b/pageE/tool/WashOrder.vue index 8f890a2..513c6f5 100644 --- a/pageE/tool/WashOrder.vue +++ b/pageE/tool/WashOrder.vue @@ -301,18 +301,10 @@ export default { }) }, async getOrderList({ load = 'reload' } = {}) { - // const res = await this.$u.api.getSendOrderList({ - // page: this.page, - // }) - const res = await this.$u.api.getOrderList({ + const res = await this.$u.api.getSendOrderList({ page: this.page, }) this.timer = true; - // if(res.errCode == 0) { - // if(load == 'reload') this.orderList = res.data.order_list; - // else this.orderList.push(...res.data.order_list); - // } - // return res.data.order_list.length; if(res.errCode == 0) { if(load == 'reload') this.orderList = res.data; else this.orderList.push(...res.data); diff --git a/pageE/useCoupon/index.vue b/pageE/useCoupon/index.vue index 979bc4d..4efcb29 100644 --- a/pageE/useCoupon/index.vue +++ b/pageE/useCoupon/index.vue @@ -106,7 +106,7 @@ export default { }, setViewHeight() { const res = uni.getSystemInfoSync(); - this.scrollHeight = res.windowHeight - (res.windowWidth / 750) * 90 + 'px'; + this.scrollHeight = res.windowHeight - (res.windowWidth / 750) * (90 + 30) + 'px'; }, toDetailsPage(id) { this.$u.route('/pageB/sdetails/index', { diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 4d29be5..1190874 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -4,17 +4,6 @@ - {{ userInfo.member_nickname }} {{ userInfo.member_mobile | phoneFormat }} @@ -62,9 +51,15 @@ - + + + {{ item.title }} + {{ item.number }} + + @@ -146,7 +141,51 @@ export default { }, data() { return { - userInfo: {}, + userInfo: {}, + orderList: [ + { + name: 'wait_pay', + title: '待支付', + img: '/static/image/mine/6.png', + link: '/order/Index?current=1', + number: '', + }, + { + name: 'already_pay', + title: '待发货', + img: '/static/image/mine/35.png', + link: '/order/Index?current=2', + number: '', + }, + { + name: 'wait_receipt', + title: '待收货', + img: '/static/image/mine/2.png', + link: '/order/Index?current=3', + number: '', + }, + { + name: 'pintuan', + title: '拼团中', + img: '/static/image/mine/37.png', + link: '/order/Index?current=5', + number: '', + }, + { + name: 'wait_evaluation', + title: '待评价', + img: '/static/image/mine/3.png', + link: '/order/Index?current=6', + number: '', + }, + { + name: 'refund', + title: '售后', + img: '/static/image/mine/9.png', + link: '/order/Index?current=7', + number: '', + }, + ] }; }, filters: { @@ -162,6 +201,7 @@ export default { }) } this.getUserInfo(); + this.getOrderNumber(); }, onNavigationBarButtonTap() { this.toOtherPage("/setting/Index"); @@ -176,6 +216,20 @@ export default { } }) }, + getOrderNumber() { + this.$u.api.getOrderNumber().then(res => { + const object = res.data; + for (const key in object) { + if (object.hasOwnProperty(key)) { + let element = object[key]; + const order = this.orderList.filter(item => item.name == key); + if(element > 99) element = "99+"; + this.$set(order[0], 'number', element); + } + } + // console.log(this.orderList); + }) + }, toOtherPage(url) { uni.navigateTo({ url: '/pageE' + url @@ -200,45 +254,6 @@ export default { .user-info { margin-left: 30rpx; // display: flex; - .info-left { - margin-right: 15rpx; - .user-nickname { - max-width: 200rpx; - font-size: 30rpx; - color: rgba(51,51,51,1); - margin-bottom: 19rpx; - } - .user-medal { - display: flex; - width: 110rpx; - // height: 25rpx; - background: linear-gradient(269deg,rgba(175,175,175,1) 0%,rgba(224,224,224,1) 100%); - border-radius: 13rpx; - align-items: center; - padding: 0 17rpx 0 10rpx; - > image { - margin-right: 9rpx; - width: 20rpx; - height: 22rpx; - flex-shrink: 0; - } - .rank-title { - font-size: 16rpx; - color: rgba(51,51,51,1); - } - } - } - .info-right { - .info-phone { - font-size: 24rpx; - color: rgba(51,51,51,1); - margin-bottom: 26rpx; - } - .user-rank { - font-size: 24rpx; - color: rgba(51,51,51,1); - } - } .info-top { height: 30rpx; display: flex; @@ -336,16 +351,6 @@ export default { font-size: 28rpx; color: #666; border-bottom: 1px solid #ececec; - // &::after { - // content: ""; - // position: absolute; - // width: 650rpx; - // height: 1rpx; - // background: rgba(234,234,234,1); - // bottom: 0; - // left: 50%; - // transform: translate(-50%,0); - // } } .title-text-more { font-size: 24rpx; @@ -397,24 +402,42 @@ export default { flex-direction: column; align-items: center; justify-content: space-between; + position: relative; + .order-num { + z-index: 9; + position: absolute; + top: -12rpx; + right: -16rpx; + border: 1rpx solid #FF7807; + height: 24rpx; + border-radius: 12rpx; + padding: 6rpx 8rpx; + display: flex; + align-items: center; + justify-content: center; + color: #FF7807; + background-color: #ffffff; + font-size: 18rpx; + color:rgba(255,120,15,1); + } } > view:nth-child(1){ - @include image-size($image-width: 36rpx, $image-height: 34rpx); + @include image-size($image-width: 33rpx, $image-height: 36rpx); } > view:nth-child(2){ - @include image-size($image-width: 38rpx, $image-height: 36rpx); + @include image-size($image-width: 38rpx, $image-height: 32rpx); } > view:nth-child(3){ - @include image-size($image-width: 40rpx, $image-height: 36rpx); + @include image-size($image-width: 41rpx, $image-height: 33rpx); } > view:nth-child(4){ - @include image-size($image-width: 38rpx, $image-height: 38rpx); + @include image-size($image-width: 35rpx, $image-height: 35rpx); } > view:nth-child(5){ - @include image-size($image-width: 36rpx, $image-height: 40rpx); + @include image-size($image-width: 37rpx, $image-height: 37rpx); } > view:nth-child(6){ - @include image-size($image-width: 36rpx, $image-height: 40rpx); + @include image-size($image-width: 33rpx, $image-height: 35rpx); } } } -- 2.45.2