Browse Source

yshop后台新增了物流快递查询

master
hupeng 5 years ago
parent
commit
e1b8cd894e
  1. 9
      src/api/yxStoreOrder.js
  2. 43
      src/views/shop/order/detail.vue
  3. 2
      src/views/shop/order/index.vue

9
src/api/yxStoreOrder.js

@ -62,3 +62,12 @@ export function get() {
method: 'get' method: 'get'
}) })
} }
export function express(data) {
return request({
url: 'api/yxStoreOrder/express',
method: 'post',
data
})
}

43
src/views/shop/order/detail.vue

@ -36,6 +36,24 @@
</div> </div>
<div class="text item">快递公司:{{ form.deliveryName }}</div> <div class="text item">快递公司:{{ form.deliveryName }}</div>
<div class="text item">快递单号:{{ form.deliveryId }}</div> <div class="text item">快递单号:{{ form.deliveryId }}</div>
<div><el-button :loading="loading" type="primary" @click="express">查看物流</el-button></div>
<div style="margin-top: 20px">
<el-timeline v-if="this.form.deliveryId && expressInfo.length > 0">
<el-timeline-item
v-for="(obj, index) in expressInfo"
:key="index"
:timestamp="obj.acceptTime"
>
{{obj.acceptStation}}
</el-timeline-item>
</el-timeline>
<el-timeline :reverse="false" v-else>
<el-timeline-item>
暂无物流信息
</el-timeline-item>
</el-timeline>
</div>
</el-card> </el-card>
<el-card> <el-card>
<div slot="header"> <div slot="header">
@ -47,7 +65,7 @@
</template> </template>
<script> <script>
import { add, edit } from '@/api/yxStoreOrder' import { add, edit, express } from '@/api/yxStoreOrder'
import { parseTime } from '@/utils/index' import { parseTime } from '@/utils/index'
export default { export default {
props: { props: {
@ -58,7 +76,7 @@ export default {
}, },
data() { data() {
return { return {
loading: false, dialog: false, loading: false, dialog: false, expressInfo: [],
form: { form: {
id: '', id: '',
orderId: '', orderId: '',
@ -89,6 +107,7 @@ export default {
refundReason: '', refundReason: '',
refundPrice: '', refundPrice: '',
deliveryName: '', deliveryName: '',
deliverySn: '',
deliveryType: '', deliveryType: '',
deliveryId: '', deliveryId: '',
gainIntegral: '', gainIntegral: '',
@ -122,7 +141,25 @@ export default {
methods: { methods: {
parseTime, parseTime,
cancel() { cancel() {
this.resetForm() this.dialog = false
},
express() {
let params ={
"orderCode": this.form.id,
"shipperCode": this.form.deliverySn,
"logisticCode": this.form.deliveryId
}
express(params).then(res=>{
console.log(res)
this.expressInfo = res.Traces
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
}, },
doSubmit() { doSubmit() {
this.loading = true this.loading = true

2
src/views/shop/order/index.vue

@ -307,6 +307,7 @@ export default {
refundReason: data.refundReason, refundReason: data.refundReason,
refundPrice: data.refundPrice, refundPrice: data.refundPrice,
deliveryName: data.deliveryName, deliveryName: data.deliveryName,
deliverySn: data.deliverySn,
deliveryType: data.deliveryType, deliveryType: data.deliveryType,
deliveryId: data.deliveryId, deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral, gainIntegral: data.gainIntegral,
@ -541,6 +542,7 @@ export default {
refundReason: data.refundReason, refundReason: data.refundReason,
refundPrice: data.refundPrice, refundPrice: data.refundPrice,
deliveryName: data.deliveryName, deliveryName: data.deliveryName,
deliverySn: data.deliverySn,
deliveryType: data.deliveryType, deliveryType: data.deliveryType,
deliveryId: data.deliveryId, deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral, gainIntegral: data.gainIntegral,

Loading…
Cancel
Save