diff --git a/common/js/api.js b/common/js/api.js index e066182..2840f13 100644 --- a/common/js/api.js +++ b/common/js/api.js @@ -32,9 +32,16 @@ export default { orderorderList(data) { //订单列表 return uni.api.get("/order/orderList", data); }, + // 团购订单列表 + groupOrderInfo(data) { //订单列表 + return uni.api.get("/groupOrderInfo/list", data); + }, orderorderInfo(data) { //订单回显 return uni.api.get("/order/orderInfo", data); }, + groupOrderInfoDetail(data) { //订单回显 + return uni.api.get("/groupOrderInfo/get", data); + }, loginwxuserInfo(data) { //用户详情 return uni.api.get("/login/userInfo", data); }, diff --git a/pages.json b/pages.json index 04ee92a..839ec9e 100644 --- a/pages.json +++ b/pages.json @@ -200,6 +200,12 @@ "navigationBarTitleText": "确认订单", "navigationBarTextStyle": "black" } + }, + { + "path" : "pages/order/order_groupdetail", + "style": { + "navigationBarTitleText": "订单详情" + } } ], "globalStyle": { diff --git a/pages/order/order.vue b/pages/order/order.vue index 383d391..af62660 100644 --- a/pages/order/order.vue +++ b/pages/order/order.vue @@ -88,8 +88,25 @@ - - + + + + + {{item.proName.length>10?item.proName.substring(0,10)+'...':item.proName}} + + {{item.status|statusFirter}} + + + + + + 数量:{{item.number}}份 + 实付:¥{{item.payAmount}} + + + + @@ -131,6 +148,7 @@ } ], list: [], + groupList:[ ], is_end: false, swiperCurrent: '', form: { @@ -153,6 +171,20 @@ }, onReachBottom() { this.orderorderList() + // 获取团购订单 + this.getorderList() + }, + filters:{ + statusFirter(e){ + // 状态: unpaid-待付款;unused-待使用;closed-已完成;refunding-退款中;refund-已退款;cancelled-已取消; + if(e=='closed') return'已完成' + else if(e=='unpaid') return'待付款' + else if(e=='unused') return'待使用' + else if(e=='refunding') return'退款中' + else if(e=='refund') return'已退款' + else if(e=='cancelled') return'已取消' + else return "1" + } }, methods: { // 切换导航栏 @@ -173,12 +205,20 @@ orderId: e.id }) }, + orderinfoTo(e){ + uni.pro.navigateTo('order/order_groupdetail', { + orderId: e.id + }) + }, init_fn() { this.list = [] + this.groupList = [] this.is_end = false this.form.page = 1 this.form.status = 'loadmore' this.orderorderList() + // 获取团购订单 + this.getorderList() }, orderswitch(e, a) { this.active = a @@ -214,6 +254,32 @@ }, 500) } }, + async getorderList(){ + let res = await this.api.groupOrderInfo({ + page: this.form.page, + size: this.form.size, + userId: uni.cache.get('userInfo').id, //userId + status: this.swiperCurrent + }) + if(res.data.list.length ==0){ + this.is_end = true + this.form.status = 'nomore' + return false; + }else{ + this.form.status = 'loading'; + this.form.page = ++this.form.page; + setTimeout(() => { + this.groupList = [...this.groupList, ...res.data.list]; + if (res.data.list.length == 10) { + this.form.status = 'loading'; + } else { + this.is_end = true; + this.form.status = 'nomore'; + } + }, 500) + // console.log(res,'返回的数据') + } + } } }; @@ -410,4 +476,44 @@ } } } + .orderList{ + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + .listBox{ + padding: 16rpx 18rpx; + margin-top: 48rpx;font-size: 32rpx; + width: 694rpx; + height: 248rpx; + background: #FFFFFF; + border-radius: 24rpx 24rpx 24rpx 24rpx; + position: relative; + .buttonStyle{ + position: absolute; + right: 20rpx; + bottom: 50rpx; + width: 170rpx; + height: 64rpx; + background: #FFD100; + border-radius: 32rpx 32rpx 32rpx 32rpx; + border: none; + } + .state{ + color: #FF4C11; + } + .state2{ + color: #999; + } + .fontStyle{ + font-size: 28rpx;font-weight: 400;color: #666666; + } + } + + } +.df{ display: flex; align-items: center; justify-content: space-between; } + +.ml-20{ + margin-left: 20rpx; +} \ No newline at end of file diff --git a/pages/order/order_groupdetail.vue b/pages/order/order_groupdetail.vue new file mode 100644 index 0000000..bbe57a4 --- /dev/null +++ b/pages/order/order_groupdetail.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/第一次测试推送.txt b/第一次测试推送.txt deleted file mode 100644 index e69de29..0000000