OfficeApp/pages/logistics/deliveryDetil.vue

261 lines
5.5 KiB
Vue
Raw Normal View History

2023-08-09 09:11:05 +08:00
<template>
<view class="content">
2023-08-10 17:32:12 +08:00
<view v-if='showLoading'>
<u-loading-page :loading="showLoading"></u-loading-page>
2023-08-09 09:11:05 +08:00
</view>
2023-08-10 17:32:12 +08:00
<view v-else>
<u-toast ref="uToast"></u-toast>
<view class="map">
<map id="map" @click="mapFun" :markers='markers' :scale="scale" :enable-zoom="true"
style="width:100%;height: 100%;" :latitude="goodsDetil.logistics.shop_lat" :enable-scroll="false"
:longitude="goodsDetil.logistics.shop_long">
</map>
2023-08-09 09:11:05 +08:00
</view>
2023-08-10 17:32:12 +08:00
<view class="order_info">
<p class='tit'>订单号: {{goodsDetil.logistics.order_sn}}</p>
<view class="store_name">
商户名称 {{goodsDetil.logistics.shop_name}}
2023-08-09 09:11:05 +08:00
</view>
2023-08-10 17:32:12 +08:00
<view class="store_time">
{{goodsDetil.logistics.shop_address}}
2023-08-09 09:11:05 +08:00
</view>
2023-08-10 17:32:12 +08:00
<view class="tit_a">
<text>物流信息</text>
2023-08-09 09:11:05 +08:00
</view>
2023-08-10 17:32:12 +08:00
<view class="info" v-for="(item,index) in goodsDetil.record">
<view style="margin: 20rpx 0;">
{{item.content }}
</view>
<view style="margin: 20rpx 0;">
{{item.create_time }}
2023-08-09 09:11:05 +08:00
</view>
</view>
2023-08-10 17:32:12 +08:00
<view class="pro_info">
<view style="color: #999; flex:1">
商品信息
</view>
<view style="flex:4">
<view v-for="(item,index) in goodsDetil.product" class="goods_tit">
<text style="width: 60vw;">{{item.goods_name}}</text>
<text style="float: right;">X{{item.product_num}}{{item.goods_unit}}</text>
</view>
2023-08-09 09:11:05 +08:00
2023-08-10 17:32:12 +08:00
</view>
</view>
2023-08-09 09:11:05 +08:00
2023-08-10 17:32:12 +08:00
<view class="total">
共计{{goodsDetil.product_count}}件商品
</view>
<u-button type="primary" v-if='goodsDetil.logistics.status==0' @click="qrqodeFn"
class="custom-style">扫码取货</u-button>
<!-- <u-button type="primary" v-if='goodsDetil.logistics.status==0' @click="takeGood"
class="custom-style">扫码取货</u-button> -->
2023-08-09 09:11:05 +08:00
</view>
</view>
2023-08-10 17:32:12 +08:00
2023-08-09 09:11:05 +08:00
</view>
</template>
<script>
import {
getDetil
} from "@/api/logistics.js"
import {
takeGoods
} from "@/api/logistics.js"
export default {
data() {
return {
2023-08-10 17:32:12 +08:00
showLoading: true,
2023-08-09 09:11:05 +08:00
showPop: false,
goodsDetil: undefined,
scale: 17,
2023-08-10 17:32:12 +08:00
latitude: undefined,
longitude: undefined,
markers: [{
latitude: undefined,
longitude: undefined,
iconPath: '@/static/images/daoru.png', //显示的图标
width: 40, //宽
height: 40, //高
title: '商家位置', //标注点名
alpha: 0.5, //透明度
2023-08-09 09:11:05 +08:00
2023-08-10 17:32:12 +08:00
}],
2023-08-09 09:11:05 +08:00
}
},
methods: {
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
},
2023-08-10 17:32:12 +08:00
mapFun() {
uni.openLocation({
latitude: Number(this.goodsDetil.logistics.shop_lat),
longitude: Number(this.goodsDetil.logistics.shop_long),
address: this.goodsDetil.logistics.shop_address,
name: this.goodsDetil.logistics.shop_name,
scale: 15,
2023-08-09 09:11:05 +08:00
});
},
2023-08-10 17:32:12 +08:00
showToast() {
// 6
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
},
2023-08-10 17:32:12 +08:00
qrqodeFn() {
let that = this
uni.scanCode({
onlyFromCamera: true,
success: function(res) {
console.log("扫码类容" + res.result)
that.takeGood(res.result)
}
});
2023-08-09 09:11:05 +08:00
},
2023-08-10 17:32:12 +08:00
// 取货{}
takeGood(sn) {
takeGoods({
logistics_id: this.goodsDetil.logistics.id,
order_id: this.goodsDetil.logistics.order_id,
order_sn: sn
}).then(res => {
console.log("取货成功")
// this.$emit('showTost')
this.showToast()
setTimeout(() => {
uni.navigateBack()
}, 1000)
})
2023-08-09 09:11:05 +08:00
2023-08-10 17:32:12 +08:00
},
// 取货{}
// takeGood() {
// takeGoods({
// logistics_id: this.goodsDetil.logistics.id,
// order_id: this.goodsDetil.logistics.order_id,
// order_sn: 'wxo1691655309361543421'
// }).then(res => {
// this.$emit('showTost')
// this.$emit('getlist')
// })
// },
2023-08-09 09:11:05 +08:00
// 地图结束
},
onLoad(options) {
getDetil({
logistics_id: options.id
}).then(res => {
this.goodsDetil = res.data
2023-08-10 17:32:12 +08:00
this.latitude = res.data.logistics.shop_lat
this.longitude = res.data.logistics.shop_long
this.markers[0].latitude = res.data.logistics.shop_lat
this.markers[0].longitude = res.data.logistics.shop_long
setTimeout(() => {
this.showLoading = false
}, 500)
2023-08-09 09:11:05 +08:00
})
},
}
</script>
<style lang='scss' scoped>
.map {
height: 40vh;
width: 100vw;
}
2023-08-10 17:32:12 +08:00
2023-08-09 09:11:05 +08:00
.custom-style {
width: 100%;
2023-08-09 17:26:01 +08:00
background-color: #3C9CFF;
2023-08-09 09:11:05 +08:00
border: none;
color: white;
height: 90rpx;
line-height: 90rpx;
}
.order_info {
height: auto;
background-color: white;
border-radius: 6vw 6vw 0 0;
transform: translateY(-5vh);
padding: 5vh 3vw;
box-sizing: border-box;
.tit {
font-weight: bold;
font-size: 35rpx
}
.tit_a {
display: flex;
justify-content: space-between;
font-weight: bold;
font-size: 35rpx
}
.total {
text-align: right;
color: #3274F9;
font-weight: bold;
font-size: 32rpx;
margin: 20rpx 0;
}
.store_name {
color: #999999;
margin: 18rpx 0;
}
.store_time {
color: #999999;
padding: 0 0 20rpx 0;
border-bottom: 1px solid #999999;
margin-bottom: 20rpx;
}
.info {
margin: 10rpx 0;
}
.pro_info {
display: flex;
justify-content: space-between;
}
}
.goods_tit {
display: flex;
justify-content: space-between;
}
.icon {
text-align: center;
font-size: 50rpx;
text {
display: block;
transform: rotate(90deg);
}
}
</style>