Browse Source

我的订单接口

master
Enzo 5 years ago
parent
commit
21006da7b2
  1. 5
      common/api.js
  2. 23
      pages/order/index.vue
  3. 2
      pages/order/order-details.vue

5
common/api.js

@ -5,4 +5,7 @@ export const DEVURL = 'http://192.168.3.8:8000'; // 测试服请求地址
export const PRODURL = ''; // 正式服请求地址 export const PRODURL = ''; // 正式服请求地址
/* 首页相关接口 */ /* 首页相关接口 */
export const API_GOODS_LIST = '/api/goods/list'; // 首页-分类下商品列表
export const API_GOODS_LIST = '/api/goods/list'; // 首页-分类下商品列表
// 用户订单
export const API_USERORDER = '/api/order/list';

23
pages/order/index.vue

@ -27,27 +27,39 @@
type: 'all' type: 'all'
}, { }, {
name: '待付款', name: '待付款',
type: 'delivered'
type: 'unpaid'
}, { }, {
name: '已付款', name: '已付款',
type: 'receiving'
type: 'paid'
}, },
{ {
name: '已完成', name: '已完成',
type: 'complete' type: 'complete'
}],
},
{
name:'售后',
type: 'after_sales'
}
],
tabIndex: 0, // tab tabIndex: 0, // tab
assetsType: '' // assetsType: '' //
} }
}, },
onLoad(e) { onLoad(e) {
this.assetsType = e.type 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 // swiper
this.height = (uni.getSystemInfoSync().windowHeight) + 'px' this.height = (uni.getSystemInfoSync().windowHeight) + 'px'
}, },
methods: { 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) { swiperChange(e) {
this.tabIndex = e.detail.current this.tabIndex = e.detail.current
@ -76,6 +88,9 @@
// #endif // #endif
} }
} }
},
created() {
this.getUserOrder()
} }
} }
</script> </script>

2
pages/order/order-details.vue

@ -21,7 +21,7 @@
</view> </view>
<view> <view>
<button v-if="true" class="cu-btn line-orange round margin-left-sm text-sm" @tap="$routerGo('/pages/order/apply-refund')">申请退款</button> <button v-if="true" class="cu-btn line-orange round margin-left-sm text-sm" @tap="$routerGo('/pages/order/apply-refund')">申请退款</button>
<button v-else class="cu-btn line-gray bg-gray round margin-left-sm text-sm">退款中</button>
<button v-else class="cu-btn line-gray bg-white border round margin-left-sm text-sm">退款中</button>
</view> </view>
</view> </view>
</view> </view>

Loading…
Cancel
Save