添加订单详情

master
wayn 3 years ago
parent 73d6f1ddad
commit a411281d12

@ -2,4 +2,4 @@
ENV = 'production' ENV = 'production'
# base api # base api
VUE_APP_BASE_API = 'https://mall.wayn.ltd/mobile-api' VUE_APP_BASE_API = '/mobile-api'

@ -15,11 +15,10 @@ export function statusCount() {
}) })
} }
export function orderDetail(data) { export function orderDetail(orderSn) {
return request({ return request({
url: '/order/info', url: `/order/detail/${orderSn}`,
method: 'post', method: 'get'
data
}) })
} }
@ -80,3 +79,4 @@ export function orderConfirm(orderId) {
method: 'post' method: 'post'
}) })
} }

@ -247,7 +247,7 @@ const routes = [
}, },
// 订单详情 // 订单详情
{ {
path: '/order/detail/:goodsId', path: '/order/detail/:orderSn',
name: 'OrderDetail', name: 'OrderDetail',
props: true, props: true,
component: () => import('@/views/order/detail'), component: () => import('@/views/order/detail'),

@ -1,11 +1,40 @@
<template> <template>
<div>order detail</div> <div class="order_detail">
<nav-bar :title="$route.meta.title">
<span style="color: #333">
<svg-icon icon-class="share" :width="15" :height="15" />
</span>
</nav-bar>
<div>
<div>orderSn: {{ orderInfo.orderSn }}</div>
</div>
</div>
</template> </template>
<script> <script>
import { orderDetail } from '@/api/order'
export default { export default {
props: {
orderSn: {
type: String,
default: ''
}
},
data() { data() {
return { return {
orderInfo: []
}
},
mounted() {
console.log(this.orderSn)
this.orderDetail()
},
methods: {
orderDetail() {
orderDetail(this.orderSn).then(res => {
debugger
this.orderInfo = res.map.order
})
} }
} }
} }

@ -34,7 +34,12 @@
v-if="orderListEmptyShow" v-if="orderListEmptyShow"
description="您还没有相关订单" description="您还没有相关订单"
/> />
<div v-for="(el, i) in orderList" :key="i" class="order-item"> <div
v-for="(el, i) in orderList"
:key="i"
class="order-item"
@click="toOrderDetail(el.orderSn)"
>
<div class="order-title"> <div class="order-title">
<div class="order-sn">订单编号: {{ el.orderSn }}</div> <div class="order-sn">订单编号: {{ el.orderSn }}</div>
<div class="order-staus">{{ el.orderStatusText }}</div> <div class="order-staus">{{ el.orderStatusText }}</div>
@ -84,20 +89,20 @@
round round
size="small" size="small"
type="danger" type="danger"
plain
@click.stop="toPay(el.orderSn, el.actualPrice)" @click.stop="toPay(el.orderSn, el.actualPrice)"
>去支付</van-button> >去支付</van-button>
<van-button <van-button
v-if="el.handleOption.refund" v-if="el.handleOption.refund"
round round
size="small" size="small"
type="danger"
@click.stop="refundOrder(el.id)" @click.stop="refundOrder(el.id)"
>退款</van-button> >退款/售后</van-button>
<van-button <van-button
v-if="el.handleOption.confirm" v-if="el.handleOption.confirm"
round round
plain
size="small" size="small"
type="danger"
@click.stop="confirmOrder(el.id)" @click.stop="confirmOrder(el.id)"
>确认收货</van-button> >确认收货</van-button>
<van-button <van-button
@ -159,7 +164,7 @@ export default {
// //
onRefresh() { onRefresh() {
this.refreshing = true this.refreshing = true
this.pageNum = 1 this.page = 0
this.getOrderList(true) this.getOrderList(true)
}, },
getOrderList(init) { getOrderList(init) {
@ -240,9 +245,10 @@ export default {
this.orderList = [] this.orderList = []
this.getOrderList(true) this.getOrderList(true)
}, },
toOrderDetail(id) { toOrderDetail(orderSn) {
debugger
this.$router.push({ this.$router.push({
path: `/detail/${id}` path: `/order/detail/${orderSn}`
}) })
} }
} }
@ -270,7 +276,7 @@ export default {
.order-title { .order-title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 15px 10px; padding: 25px 20px;
.order-sn { .order-sn {
text-align: left; text-align: left;
} }
@ -292,6 +298,7 @@ export default {
padding: 10px; padding: 10px;
.van-button { .van-button {
margin-left: 10px; margin-left: 10px;
min-width: 70px;
} }
} }
} }

@ -10,7 +10,7 @@ function resolve(dir) {
// All configuration item explanations can be find in https://cli.vuejs.org/config/ // All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = { module.exports = {
publicPath: '/', publicPath: '/mall',
outputDir: 'dist', outputDir: 'dist',
assetsDir: 'static', assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development', lintOnSave: process.env.NODE_ENV === 'development',

Loading…
Cancel
Save