- 添加确认订单

- 添加查看物流
This commit is contained in:
sin 2019-04-12 23:00:12 +08:00
parent df021b9ebe
commit 209725a25b
3 changed files with 67 additions and 39 deletions

View File

@ -11,12 +11,12 @@ export function getOrderPage(params) {
});
}
export function cancelOrder(id) {
export function confirmReceiving(orderId) {
return request({
url: '/product-api/users/spu/info',
method: 'get',
url: '/order-api/users/order/confirm_receiving',
method: 'post',
params: {
id,
orderId,
}
});
}
@ -66,3 +66,15 @@ export function countCart() {
}
});
}
// 物流信息
export function getLogisticsInfo(params) {
return request({
url: '/order-api/users/order_logistics/logistics_info',
method: 'get',
params: {
...params,
}
});
}

View File

@ -34,8 +34,10 @@
</div>
<div slot="footer" class="footer">
<span class="total">总价{{item.payAmount / 100}} </span>
<van-button v-if="[3,4,5].indexOf(item.status) != -1" size="small">查看物流</van-button>
<van-button v-if="item.status === 3 " size="small">确认收货</van-button>
<router-link :to="'/user/order/logistics/'+item.orderid">
<van-button v-if="[3,4,5].indexOf(item.status) != -1" size="small">查看物流</van-button>
</router-link>
<van-button v-if="item.status === 3 " size="small" v-on:click="clickConfirmReceiving(item)">确认收货</van-button>
<van-button v-if="item.status === 1 " size="small" type="danger">支付</van-button>
</div>
</van-panel>
@ -46,7 +48,7 @@
<script>
import {getOrderPage} from '../../../api/order';
import {getOrderPage, confirmReceiving} from '../../../api/order';
export default {
components: {},
@ -54,12 +56,11 @@
return {
active: 0,
list: [],
row: {},
}
},
methods: {
onTabChange(index) {
console.log('onTabChange', index)
// status tab index
const statusArray = [null, 1, 3, 4, 5];
// if (index === 0) {
@ -81,7 +82,8 @@
},
queryOrderPage(params) {
const statusArray = ['', '代付款', '待发货', '待收货', '已完成', '已关闭']
this.queryParams = params;
const statusArray = ['', '待付款', '待发货', '待收货', '已完成', '已关闭']
getOrderPage({
pageNo: 0,
pageSize: 10,
@ -114,6 +116,11 @@
// console.log('list', list)
});
},
clickConfirmReceiving({ orderid }) {
confirmReceiving(orderid).then(res => {
this.queryOrderPage(this.queryParams)
})
},
},
mounted() {
this.queryOrderPage()

View File

@ -1,42 +1,51 @@
<template>
<div style="background: #f7f7f7;">
<headerNav title="订单追踪"/>
<div style="background: #f7f7f7;">
<headerNav title="订单追踪"/>
<van-cell-group>
<van-cell title="订单编号" value="18081609422771742"/>
</van-cell-group>
<van-tabs>
<van-tab v-for="(item, index) in logistics" :key="index" :title="'包裹' + (index + 1)">
<van-cell-group>
<van-cell title="订单编号" value="18081609422771742" />
</van-cell-group>
<van-tabs >
<van-tab title="包裹1">
<van-cell-group>
<van-cell title="快递方式" value="顺丰快递" />
<van-cell title="快递单号" value="51234548875645645" />
<van-cell title="快递方式" :value="item.logistics + 'TODO 字典值'"/>
<van-cell title="快递单号" :value="item.logisticsNo"/>
</van-cell-group>
<van-steps direction="vertical" :active="0" active-color="#f60" style="margin-top: 15px;">
<van-step>
<h3>城市物流状态1</h3>
<p>2016-07-12 12:40</p>
</van-step>
<van-step>
<h3>城市物流状态2</h3>
<p>2016-07-11 10:00</p>
</van-step>
<van-step>
<h3>快件已发货</h3>
<p>2016-07-10 09:30</p>
</van-step>
<van-step v-for="(detail, detailIndex) in item.details" :key="detailIndex">
<h3>{{detail.logisticsInformation}}</h3>
<p>{{detail.logisticsTimeText}}</p>
</van-step>
</van-steps>
</van-tab>
<van-tab title="包裹2">内容 3</van-tab>
</van-tab>
</van-tabs>
</div>
</div>
</template>
<script>
export default {
import { getLogisticsInfo } from '../../../api/order';
}
export default {
data() {
return {
orderId: '',
orderNo: '',
logistics: [],
}
},
mounted() {
const { id } = this.$route.params;
getLogisticsInfo({
orderId: id,
}).then(res => {
const { orderId, orderNo, logistics } = res;
this.orderId = orderId;
this.orderNo = orderNo;
this.logistics = logistics;
})
},
}
</script>
<style>