From 21006da7b20179a0d2cd10ac6739cae5ec631b2e Mon Sep 17 00:00:00 2001 From: Enzo <1284707383@qq.com> Date: Wed, 23 Jun 2021 09:21:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E8=AE=A2=E5=8D=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api.js | 5 ++++- pages/order/index.vue | 23 +++++++++++++++++++---- pages/order/order-details.vue | 2 +- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/common/api.js b/common/api.js index c8b362d..8c3c39d 100644 --- a/common/api.js +++ b/common/api.js @@ -5,4 +5,7 @@ export const DEVURL = 'http://192.168.3.8:8000'; // 测试服请求地址 export const PRODURL = ''; // 正式服请求地址 /* 首页相关接口 */ -export const API_GOODS_LIST = '/api/goods/list'; // 首页-分类下商品列表 \ No newline at end of file +export const API_GOODS_LIST = '/api/goods/list'; // 首页-分类下商品列表 + +// 用户订单 +export const API_USERORDER = '/api/order/list'; diff --git a/pages/order/index.vue b/pages/order/index.vue index a69ebb7..198f9de 100644 --- a/pages/order/index.vue +++ b/pages/order/index.vue @@ -27,27 +27,39 @@ type: 'all' }, { name: '待付款', - type: 'delivered' + type: 'unpaid' }, { name: '已付款', - type: 'receiving' + type: 'paid' }, { name: '已完成', type: 'complete' - }], + }, + { + name:'售后', + type: 'after_sales' + } + ], tabIndex: 0, // 当前tab的下标 assetsType: '' //账户类型 } }, onLoad(e) { this.assetsType = e.type - this.tabIndex = this.assetsType === 'all' ? 0 : this.assetsType === 'delivered' ? 1 : this.assetsType === 'receiving' ? 2 : 0 + this.tabIndex = this.assetsType === 'all' ? 0 : this.assetsType === 'unpaid' ? 1 : this.assetsType === 'paid' ? 2 : 0 + + // 需要固定swiper的高度 this.height = (uni.getSystemInfoSync().windowHeight) + 'px' }, methods: { + getUserOrder() { + this.$http(this.API.API_USERORDER, {state: this.tabs[this.tabIndex].type,page: 1,per_page: 20}).then(res => { + console.log(res); + }).catch(err => err); + }, // 轮播菜单 swiperChange(e) { this.tabIndex = e.detail.current @@ -76,6 +88,9 @@ // #endif } } + }, + created() { + this.getUserOrder() } } diff --git a/pages/order/order-details.vue b/pages/order/order-details.vue index 00abf79..de3768f 100644 --- a/pages/order/order-details.vue +++ b/pages/order/order-details.vue @@ -21,7 +21,7 @@ - +