OfficeApp/pages/logistics/logisticDetil.vue

335 lines
6.8 KiB
Vue
Raw Normal View History

2023-08-09 09:11:05 +08:00
<template>
<view class="content">
<view v-if='showLoading'>
<u-loading-page :loading="showLoading"></u-loading-page>
</view>
<view v-else>
<view class="order">
<p>订单号:{{goodsDetil.logistics.order_sn}}</p>
2023-08-10 17:32:12 +08:00
<view class='phone'> </view>
2023-08-09 09:11:05 +08:00
<!-- 已送达 -->
2023-08-10 17:32:12 +08:00
<view class="left" v-if="goodsDetil.logistics.status==2">
2023-08-09 09:11:05 +08:00
<view class="list">
<text>
收货时间
</text>
<view>
2023-08-10 17:32:12 +08:00
{{goodsDetil.record[2].create_time}}
2023-08-09 09:11:05 +08:00
</view>
</view>
<view class="list">
<text>
收获详情
</text>
<view>
<view>
{{goodsDetil.logistics.user_address}}
</view>
<view>
2023-08-10 17:32:12 +08:00
{{goodsDetil.logistics.user_name||"顾客电话"}} :{{goodsDetil.logistics.user_phone||"顾客电话"}}
2023-08-09 09:11:05 +08:00
</view>
<view>
2023-08-10 17:32:12 +08:00
{{goodsDetil.record[2].create_time}}
2023-08-09 09:11:05 +08:00
</view>
</view>
</view>
<view class="list">
<text>
取货详情
</text>
<view>
<view>
{{goodsDetil.logistics.shop_address||"商家地址"}}
</view>
<view>
2023-08-10 17:32:12 +08:00
{{goodsDetil.logistics.shop_name||"商家电话"}} :{{goodsDetil.logistics.shop_phone||"商家电话"}}
2023-08-09 09:11:05 +08:00
</view>
<view>
{{goodsDetil.record[1].create_time}}
</view>
</view>
</view>
<view class="list">
<text>
订单详情
</text>
<view>
2023-08-10 17:32:12 +08:00
<u-steps :current="record.length" direction="column">
<u-steps-item :title="item.content" :desc="item.create_time"
v-for="(item,index) in goodsDetil.record">
</u-steps-item>
<!-- <u-steps-item title="已出库" desc="10:35">
</u-steps-item>
<u-steps-item title="运输中" desc="11:40">
</u-steps-item> -->
</u-steps>
2023-08-09 09:11:05 +08:00
</view>
</view>
<view class="pro_list">
<text style="color: #999;width: 15vw;">
商品信息
</text>
<view>
<view class="goods_tit" v-for="(item,index) in goodsDetil.product">
<text style="width: 60vw;margin: 0;padding: 0;">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text>
</view>
</view>
</view>
</view>
<!-- 已取货 -->
<view class="left" v-else>
<view class="list">
<text>
用户名称
</text>
<view>
{{goodsDetil.logistics.user_name}}
</view>
</view>
2023-08-11 16:00:08 +08:00
<view class="list">
<text>
联系方式
</text>
<view>
{{goodsDetil.logistics.user_phone}}
</view>
</view>
2023-08-09 09:11:05 +08:00
<view class="list" style="margin: 10rpx 0;">
<text style="width: 16vw;">
收货地址
</text>
<view>
<view>
{{goodsDetil.logistics.user_address}}
</view>
</view>
</view>
<view class="list">
<text>
物流信息
</text>
2023-08-10 17:32:12 +08:00
<!-- <view>
2023-08-09 09:11:05 +08:00
<view v-for="(item,index) in goodsDetil.record">
{{item.content}}
<view>
{{item.create_time}}
</view>
</view>
2023-08-10 17:32:12 +08:00
</view> -->
<u-steps :current="record.length-1" direction="column">
<u-steps-item :title="item.content" :desc="item.create_time"
v-for="(item,index) in (record)">
</u-steps-item>
</u-steps>
2023-08-09 09:11:05 +08:00
</view>
<view class="pro_list">
<text style="color: #999;width: 15vw;">
商品信息
</text>
<view>
<view class="goods_tit" v-for="(item,index) in goodsDetil.product">
<text style="width: 60vw;margin: 0;padding: 0;">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text>
</view>
</view>
</view>
</view>
<view class="total">
<text>共计{{goodsDetil.product_count}}件商品 </text>
</view>
<u-button v-if='goodsDetil.logistics.status==1' @click="showPop=true" type="primary"
style="background-color: #34A853;border: none;">已送达</u-button>
</view>
<view class="cil_left">
</view>
<view class="cil_right">
</view>
2023-08-10 17:32:12 +08:00
<!-- <u-modal :show="showPop" @confirm="confirm" content="请确认货物已送达" @close="showPop=false"
:closeOnClickOverlay="true"></u-modal> -->
<u-modal :show="showPop" @close="showPop=false" title="请输入收件码" @confirm="confirm"
:closeOnClickOverlay="true">
<view class="slot-content">
2023-08-11 16:00:08 +08:00
<u--input placeholder="请输入收件码" type="number" border="surround" v-model="take_code"></u--input>
2023-08-10 17:32:12 +08:00
</view>
</u-modal>
2023-08-09 17:26:01 +08:00
<u-toast ref="uToast"></u-toast>
2023-08-09 09:11:05 +08:00
</view>
</view>
</view>
</template>
<script>
import {
doneDelivery
} from "@/api/logistics.js"
import {
getDetil
} from "@/api/logistics.js"
export default {
data() {
return {
showPop: false,
showLoading: true,
goodsDetil: undefined,
flag: 0,
2023-08-10 17:32:12 +08:00
take_code: ""
}
},
computed: {
// rereverse()
record() {
return this.goodsDetil.record.reverse()
2023-08-09 09:11:05 +08:00
}
},
methods: {
confirm() {
2023-08-11 16:00:08 +08:00
if (!this.take_code) return
2023-08-09 09:11:05 +08:00
doneDelivery({
2023-08-10 17:32:12 +08:00
take_code: this.take_code,
2023-08-09 09:11:05 +08:00
logistics_id: this.goodsDetil.logistics.id
2023-08-09 17:26:01 +08:00
}).then(res => {
this.showToast()
setTimeout(() => {
uni.navigateBack()
}, 2000)
2023-08-09 09:11:05 +08:00
})
this.showPop = false
2023-08-09 17:26:01 +08:00
},
showToast() {
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "操作成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
2023-08-09 09:11:05 +08:00
},
},
onLoad(options) {
2023-08-10 17:32:12 +08:00
2023-08-09 09:11:05 +08:00
getDetil({
logistics_id: options.id
}).then(res => {
this.showLoading = false
this.goodsDetil = res.data
console.log(this.goodsDetil)
})
},
}
</script>
<style lang='scss' scoped>
.content {
background-color: #F5F5F5;
padding: 2vh 2vw;
}
.order {
position: relative;
background-color: white;
margin: 20rpx 0;
border-radius: 15rpx;
height: auto;
padding: 2vh 3vw;
box-sizing: border-box;
p {
font-family: "PingFang SC-Medium";
font-size: 32rpx;
font-weight: bold;
}
.phone {
color: #999999;
padding: 10rpx 0;
border-bottom: 1px dashed blue;
font-size: 20rpx;
}
.left {
.list {
display: flex;
view {
flex: 8;
view {
margin-bottom: 10rpx;
}
}
text {
flex: 2;
}
}
}
.pro_list {
display: flex;
text {
margin-right: 20rpx;
}
}
.total {
/* font-family: "宋体"; */
margin: 20rpx 0;
color: #3274F9;
font-weight: bold;
font-size: 32rpx;
text-align: right;
}
.cil_left {
width: 30rpx;
height: 30rpx;
background-color: #F5F5F5;
border-radius: 30rpx;
position: absolute;
top: 110rpx;
left: -15rpx;
}
.cil_right {
width: 30rpx;
height: 30rpx;
background-color: #F5F5F5;
border-radius: 30rpx;
position: absolute;
top: 110rpx;
right: -15rpx;
}
.goods_tit {
display: flex;
justify-content: space-between;
}
2023-08-10 17:32:12 +08:00
.tost_tit {
text-align: center;
}
2023-08-09 09:11:05 +08:00
}
</style>