514 lines
11 KiB
Vue
Raw Normal View History

2023-08-09 09:11:05 +08:00
<template>
2023-08-14 18:21:45 +08:00
<view>
<view>
<view class="order">
<p class="tit" v-if="goodsInfo.status==0" style="background-color: #0122C7;">
商户姓名:&nbsp;&nbsp;{{goodsInfo.shop_name}}
</p>
<p class="tit" v-if="goodsInfo.status==1" style="background-color: #FF7C32;">
2023-08-16 09:27:10 +08:00
收货人姓名:&nbsp;&nbsp;{{ fuzzyName(goodsInfo.receiver_name) }}</p>
2023-08-14 18:21:45 +08:00
<p class="tit" v-if="goodsInfo.status==2" style="background-color: #47BE62;">
2023-08-16 09:27:10 +08:00
收货人姓名:&nbsp;&nbsp;{{fuzzyName(goodsInfo.receiver_name)}}</p>
2023-08-23 18:34:37 +08:00
<p class="tit" v-if="goodsInfo.status==3" style="background-color: red;display: flex;justify-content: space-between;">
<text>收货人姓名:&nbsp;&nbsp;{{fuzzyName(goodsInfo.receiver_name)}}</text>
<text>已取消</text>
</p>
2023-08-14 18:21:45 +08:00
<view class="contents">
<!-- 已取货 -->
<view class="left" v-if='goodsInfo.status==0'>
<view style="margin: 0;padding: 0;" @click="goDetil">
<view class="list">
<text>
店主姓名
</text>
<view>
2023-08-16 16:51:41 +08:00
{{goodsInfo.shop_user ||'暂无'}}
2023-08-14 18:21:45 +08:00
</view>
</view>
<view class="list">
<text>
联系方式
</text>
<view @click.stop="callFn(goodsInfo.shop_phone)">
<u-icon style="display: inline-block;margin-left: 5rpx;" name="phone"
2023-08-21 17:25:01 +08:00
color="#2979ff" size="22"></u-icon>
<text class="phone_num"> {{goodsInfo.shop_phone}}</text>
2023-08-14 18:21:45 +08:00
</view>
</view>
<view class="list">
<text>
商家地址
</text>
<view>
<view class="address">
{{goodsInfo.shop_address}}
</view>
</view>
</view>
<view class="list">
<text>
订单编号
</text>
<view>
<view class="address">
{{goodsInfo.order_sn}}
</view>
</view>
</view>
<view class="hr">
</view>
<view class="pro_list">
<text style="color: #999;width: 15vw;">
商品信息
</text>
<view>
<view class="goods_tit" v-for="(item,index) in goodsInfo.products">
<text class="goods_detil">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text>
</view>
</view>
</view>
</view>
<view class="total">
共计{{goodsInfo.product_count}}件商品
</view>
2023-08-21 13:47:26 +08:00
<u-button v-if="!is_captain" type="primary" @click="qrqodeFn" class="custom-style"
2023-08-14 18:21:45 +08:00
style="background-color: #0122C7;border: 0;">
<u-icon name="scan" color="white" size="25" style="margin-right: 10rpx;"></u-icon>
扫码取货</u-button>
2023-08-21 13:47:26 +08:00
<u-button v-else type="primary" @click="goDetil" class="custom-style"
style="background-color: #0122C7;border: 0;">
2023-08-21 17:25:01 +08:00
2023-08-21 13:47:26 +08:00
查看详情</u-button>
2023-08-14 18:21:45 +08:00
2023-08-11 16:00:08 +08:00
</view>
2023-08-14 18:21:45 +08:00
<!-- 已送达 -->
<view v-if="goodsInfo.status==1" class="left">
<view style="margin: 0;padding:0" @click="goDetil">
<view class="list">
<text>
收货地址
</text>
<view>
<view class="address">
2023-08-16 09:27:10 +08:00
{{goodsInfo.receiver_address}}
2023-08-14 18:21:45 +08:00
</view>
</view>
</view>
<view class="list">
<text>
订单编号
</text>
<view>
{{goodsInfo.order_sn}}
</view>
</view>
<view class="hr">
</view>
<view class="pro_list">
<text style="color: #999;width: 15vw;">
商品信息
</text>
<view>
<view class="goods_tit" v-for="(item,index) in goodsInfo.products">
<text class="goods_detil">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text>
</view>
</view>
</view>
</view>
<view class="list">
<text>
联系电话
</text>
2023-08-16 09:27:10 +08:00
<view @click.stop="callFn(goodsInfo.receiver_phone)">
2023-08-14 18:21:45 +08:00
<u-icon style="display: inline-block;margin-left: 5rpx;" name="phone" color="#FF7C32"
2023-08-16 09:27:10 +08:00
size="22"></u-icon> {{goodsInfo.receiver_phone}}
2023-08-14 18:21:45 +08:00
</view>
</view>
<view class="total">
共计{{goodsInfo.product_count}}件商品
</view>
2023-08-21 13:47:26 +08:00
<u-button v-if="!is_captain" type="primary" @click="showPop = true"
2023-08-14 18:21:45 +08:00
style="background-color: #FF7C32; border: 0;"><u-icon name="car-fill" color="white"
size="25" style="margin-right: 10rpx;"></u-icon> 货物送达</u-button>
2023-08-21 13:47:26 +08:00
<u-button v-else type="primary" @click="goDetil" class="custom-style"
style="background-color: #FF7C32;border: 0;">
<u-icon name="scan" color="white" size="25" style="margin-right: 10rpx;"></u-icon>
查看详情</u-button>
2023-08-14 18:21:45 +08:00
2023-08-11 16:00:08 +08:00
</view>
2023-08-14 18:21:45 +08:00
<!-- 详情 -->
<view class="left" @click="goDetil" v-if='goodsInfo.status==2'>
<view style="margin: 0;padding:0">
<view class="list">
<text>
联系电话
</text>
2023-08-16 09:27:10 +08:00
<view @click.stop="callFn(goodsInfo.receiver_phone)">
2023-08-14 18:21:45 +08:00
<u-icon style="display: inline-block;margin-left: 5rpx;" name="phone"
2023-08-16 09:27:10 +08:00
color="#47BE62" size="22"></u-icon> {{goodsInfo.receiver_phone}}
2023-08-14 18:21:45 +08:00
</view>
</view>
<view class="list">
<text>
用户地址
</text>
<view>
<view class="address">
2023-08-16 09:27:10 +08:00
{{goodsInfo.receiver_address}}
2023-08-14 18:21:45 +08:00
</view>
</view>
</view>
<view class="list">
<text>
取货时间
</text>
<view>
{{goodsInfo.qh_time}}
</view>
</view>
<view class="list">
<text>
送达时间
</text>
<view>
{{goodsInfo.ps_time}}
</view>
</view>
<view class="hr">
</view>
<!-- ' <view class="pro_list">
<text style="color: #999;width: 15vw;">
商品信息
</text>
<view>
<view class="goods_tit" v-for="(item,index) in goodsInfo.products">
<text class="goods_detil">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text>
</view>
</view>
</view>
' -->
2023-08-09 09:11:05 +08:00
</view>
2023-08-14 18:21:45 +08:00
<view class="total">
共计{{goodsInfo.product_count}}件商品
</view>
<u-button type="primary" class="custom-style" style="background-color: #47BE62;border: 0;">
<u-icon name="eye-fill" color="white" size="25" style="margin-right: 10rpx;"></u-icon>
查看详情</u-button>
2023-08-09 09:11:05 +08:00
</view>
2023-08-11 16:00:08 +08:00
2023-08-18 09:00:40 +08:00
<!-- 已取消 -->
<view class="left" @click="goDetil" v-if='goodsInfo.status==3'>
<view style="margin: 0;padding:0">
<view class="list">
<text>
联系电话
</text>
<view @click.stop="callFn(goodsInfo.receiver_phone)">
<u-icon style="display: inline-block;margin-left: 5rpx;" name="phone"
color="#47BE62" size="22"></u-icon> {{goodsInfo.receiver_phone}}
</view>
</view>
<view class="list">
<text>
用户地址
</text>
<view>
<view class="address">
{{goodsInfo.receiver_address}}
</view>
</view>
</view>
<view class="hr">
</view>
<view class="pro_list">
<text style="color: #999;width: 15vw;">
商品信息
</text>
<view>
<view class="goods_tit" v-for="(item,index) in goodsInfo.products">
<text class="goods_detil">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text>
</view>
</view>
</view>
</view>
<view class="total">
共计{{goodsInfo.product_count}}件商品
</view>
<u-button type="primary" class="custom-style" style="background-color: red;border: 0;">
<u-icon name="eye-fill" color="white" size="25" style="margin-right: 10rpx;"></u-icon>
查看详情</u-button>
</view>
2023-08-09 09:11:05 +08:00
</view>
2023-08-11 16:00:08 +08:00
2023-08-09 09:11:05 +08:00
</view>
2023-08-11 16:00:08 +08:00
2023-08-09 09:11:05 +08:00
</view>
2023-08-14 18:21:45 +08:00
2023-08-10 17:32:12 +08:00
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" title="请输入收件码" :closeOnClickOverlay="true">
<view class="slot-content">
2023-08-14 18:21:45 +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-14 18:21:45 +08:00
2023-08-09 09:11:05 +08:00
</view>
</template>
<script scoped>
import {
takeGoods,
doneDelivery
} from "@/api/logistics.js"
export default {
props: ['goodsInfo'],
data() {
return {
2023-08-21 13:47:26 +08:00
is_captain: 0,
2023-08-09 09:11:05 +08:00
list: [],
flag: undefined,
showPop: false,
2023-08-10 17:32:12 +08:00
take_code: "",
2023-08-14 18:21:45 +08:00
2023-08-09 09:11:05 +08:00
}
},
2023-08-21 17:25:01 +08:00
mounted() {
2023-08-21 13:47:26 +08:00
this.is_captain = JSON.parse(uni.getStorageSync("USER_INFO")).is_captain
2023-08-21 17:25:01 +08:00
// console.log(this.is_captain + '5656565656s')
2023-08-21 13:47:26 +08:00
},
2023-08-09 09:11:05 +08:00
methods: {
2023-08-14 18:21:45 +08:00
fuzzyName(name) {
let length = name.length;
let fuzzyChars = "*".repeat(length - 1);
return name[0] + fuzzyChars;
2023-08-11 16:00:08 +08:00
},
2023-08-09 09:11:05 +08:00
goDetil() {
let status = this.goodsInfo.status
uni.navigateTo({
url: `/pages/logistics/${status==0?"deliveryDetil":"logisticDetil"}?id=${this.goodsInfo.id}`
})
},
2023-08-14 18:21:45 +08:00
callFn(num) {
uni.makePhoneCall({
phoneNumber: num
});
// console.log(9999)
},
2023-08-09 17:26:01 +08:00
2023-08-10 17:32:12 +08:00
// 扫码
qrqodeFn() {
let that = this
uni.scanCode({
onlyFromCamera: true,
success: function(res) {
that.takeGood(res.result)
}
});
2023-08-09 17:26:01 +08:00
},
// 取货{}
2023-08-10 17:32:12 +08:00
takeGood(sn) {
2023-08-09 09:11:05 +08:00
takeGoods({
2023-08-10 17:32:12 +08:00
logistics_id: this.goodsInfo.id,
order_id: this.goodsInfo.order_id,
order_sn: sn
2023-08-09 17:26:01 +08:00
}).then(res => {
this.$emit('showTost')
this.$emit('getlist')
2023-08-09 09:11:05 +08:00
})
},
2023-08-10 17:32:12 +08:00
confirm() {
2023-08-11 16:00:08 +08:00
if (!this.take_code) {
return
}
2023-08-10 17:32:12 +08:00
this.doneGood()
2023-08-09 09:11:05 +08:00
this.showPop = false
2023-08-09 17:26:01 +08:00
this.showMore()
2023-08-09 09:11:05 +08:00
},
// 送达
doneGood() {
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.goodsInfo.id
2023-08-09 17:26:01 +08:00
}).then(res => {
this.$emit('showTost')
this.$emit('getlist')
2023-08-09 09:11:05 +08:00
})
},
2023-08-14 18:21:45 +08:00
2023-08-09 09:11:05 +08:00
},
}
</script>
<style lang='scss' scoped>
.order {
position: relative;
background-color: white;
border-radius: 15rpx;
height: auto;
box-sizing: border-box;
2023-08-14 18:21:45 +08:00
overflow: hidden;
margin: 2vh 2vw;
2023-08-09 09:11:05 +08:00
2023-08-21 11:35:12 +08:00
/* box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); */
2023-08-14 18:21:45 +08:00
/* padding: 2vh 2vw; */
2023-08-09 17:26:01 +08:00
2023-08-14 18:21:45 +08:00
.tit {
/* padding: 2vh 2vw; */
2023-08-09 09:11:05 +08:00
font-size: 32rpx;
font-weight: bold;
2023-08-14 18:21:45 +08:00
background-color: #FF7C32;
color: white;
padding: 30rpx 20rpx;
2023-08-09 09:11:05 +08:00
}
2023-08-21 17:25:01 +08:00
2023-08-14 18:21:45 +08:00
.contents {
background-color: #fff;
padding: 30rpx 20rpx;
2023-08-09 09:11:05 +08:00
2023-08-14 18:21:45 +08:00
.list {
2023-08-11 16:00:08 +08:00
margin: 10rpx 0;
2023-08-09 09:11:05 +08:00
}
2023-08-11 16:00:08 +08:00
2023-08-14 18:21:45 +08:00
.hr {
border-bottom: 1px dashed #0122C7;
margin: 20rpx 0;
}
}
2023-08-09 09:11:05 +08:00
2023-08-11 16:00:08 +08:00
2023-08-14 18:21:45 +08:00
.left {
.list {
display: flex;
2023-08-11 16:00:08 +08:00
2023-08-14 18:21:45 +08:00
.norow {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
2023-08-11 16:00:08 +08:00
2023-08-21 17:25:01 +08:00
/* .phone_num {
color: red;
line-height: 22px;
display: inline-block;
} */
2023-08-14 18:21:45 +08:00
view {
flex: 8;
2023-08-09 09:11:05 +08:00
2023-08-14 18:21:45 +08:00
view {
margin-bottom: 10rpx;
}
2023-08-09 09:11:05 +08:00
}
2023-08-14 18:21:45 +08:00
text {
flex: 2;
}
2023-08-09 09:11:05 +08:00
}
}
2023-08-14 18:21:45 +08:00
.pro_list {
display: flex;
2023-08-11 16:00:08 +08:00
2023-08-14 18:21:45 +08:00
text {
margin-right: 20rpx;
}
2023-08-09 09:11:05 +08:00
}
.total {
2023-08-14 18:21:45 +08:00
margin: 20rpx 0;
2023-08-09 09:11:05 +08:00
color: #3274F9;
font-weight: bold;
font-size: 32rpx;
2023-08-14 18:21:45 +08:00
text-align: right;
2023-08-09 09:11:05 +08:00
}
2023-08-14 18:21:45 +08:00
.goods_tit {
display: flex;
justify-content: space-between;
.goods_detil {
width: 55vw;
margin: 0;
padding: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
2023-08-09 09:11:05 +08:00
}
2023-08-14 18:21:45 +08:00
.tost_tit {
text-align: center;
}
}
.address {
width: 65vw;
2023-08-16 09:27:10 +08:00
2023-08-09 09:11:05 +08:00
}
.finishOrder {
text {
display: inline-block;
margin-right: 30rpx
}
}
</style>