物流初步完成
This commit is contained in:
parent
9b3a0bf7fe
commit
684fe485e2
@ -9,42 +9,34 @@
|
|||||||
<p v-else>{{goodsInfo.user_name}}</p>
|
<p v-else>{{goodsInfo.user_name}}</p>
|
||||||
<view class='phone' v-if="goodsInfo.status==0">联系方式 :{{goodsInfo.shop_phone}} </view>
|
<view class='phone' v-if="goodsInfo.status==0">联系方式 :{{goodsInfo.shop_phone}} </view>
|
||||||
<view class='phone' v-else>联系方式 :{{goodsInfo.user_phone}} </view>
|
<view class='phone' v-else>联系方式 :{{goodsInfo.user_phone}} </view>
|
||||||
|
|
||||||
|
<!-- 代取货 -->
|
||||||
<view class="content_box">
|
<view class="content_box">
|
||||||
<view class="left">
|
<view v-if="goodsInfo.status==0">
|
||||||
<view v-if="goodsInfo.status==0">
|
<text style="flex:2;">商家地址</text>
|
||||||
商家地址
|
<text style="flex:8;">{{goodsInfo.shop_address}}</text>
|
||||||
</view>
|
|
||||||
<view v-if="goodsInfo.status==1">
|
|
||||||
用户地址
|
|
||||||
</view>
|
|
||||||
<view style="margin: 20rpx 0;">
|
|
||||||
订单编号
|
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
采购商品
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view v-if=" goodsInfo.status==1">
|
||||||
<view class="goods_tit" v-if="goodsInfo.status==0">
|
<text style="flex:2;">用户地址</text>
|
||||||
{{goodsInfo.shop_address}}
|
<text style="flex:8;">{{goodsInfo.user_address}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="goods_tit" v-else>
|
<view>
|
||||||
{{goodsInfo.user_address}}
|
<text style="flex:2;">订单编号</text>
|
||||||
</view>
|
<text style="flex:8;">{{goodsInfo.order_sn}}</text>
|
||||||
<view style="margin: 20rpx 0;">
|
</view>
|
||||||
{{goodsInfo.order_sn}}
|
<view class="products">
|
||||||
</view>
|
<view class="tit">采购商品</view>
|
||||||
<view class='product' v-for="(item,index) in goodsInfo.products" :key="index">
|
<view class='product' v-for="(item,index) in goodsInfo.products" :key="index">
|
||||||
<text class="goods_tit">{{item.goods_name}}</text>
|
<text class="left">{{item.goods_name}}</text>
|
||||||
<text>X{{item.product_num}}{{item.goods_unit}}</text>
|
<text class="right">X{{item.product_num}}{{item.goods_unit}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="icon" @click='getMore' v-if="flag">
|
|
||||||
<image style="width: 70rpx;height: 70rpx;text-align: center;" src="@/static/img/logistics/more.png"
|
|
||||||
alt="">
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view v-else class='finishOrder' @click="goDetil">
|
<view v-else class='finishOrder' @click="goDetil">
|
||||||
<view>
|
<view>
|
||||||
@ -53,11 +45,9 @@
|
|||||||
<view class="phone">
|
<view class="phone">
|
||||||
<text style="color:#999">联系方式</text> {{goodsInfo.user_phone}}
|
<text style="color:#999">联系方式</text> {{goodsInfo.user_phone}}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view style="margin: 20rpx 0;">
|
<view style="margin: 20rpx 0;">
|
||||||
<text style="color:#999">收货时间</text> {{goodsInfo.xd_time||"暂未收货"}}
|
<text style="color:#999">送达时间</text> {{goodsInfo.ps_time||"暂未送达"}}
|
||||||
</view>
|
|
||||||
<view style="margin: 20rpx 0;">
|
|
||||||
<text style="color:#999">送达时间</text> {{pst_time||"暂未送达"}}
|
|
||||||
</view>
|
</view>
|
||||||
<view style="margin: 20rpx 0;">
|
<view style="margin: 20rpx 0;">
|
||||||
<text style="color:#999">取货时间</text> {{goodsInfo.qh_time||"暂未取货"}}
|
<text style="color:#999">取货时间</text> {{goodsInfo.qh_time||"暂未取货"}}
|
||||||
@ -74,16 +64,17 @@
|
|||||||
:closeOnClickOverlay="true"></u-modal> -->
|
:closeOnClickOverlay="true"></u-modal> -->
|
||||||
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" title="请输入收件码" :closeOnClickOverlay="true">
|
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" title="请输入收件码" :closeOnClickOverlay="true">
|
||||||
<view class="slot-content">
|
<view class="slot-content">
|
||||||
<u--input placeholder="请输入收件码" border="surround" v-model="take_code"></u--input>
|
<u--input placeholder="请输入收件码" type="number" @click="showKeybord=true" border="surround"
|
||||||
|
v-model="take_code"></u--input>
|
||||||
</view>
|
</view>
|
||||||
</u-modal>
|
</u-modal>
|
||||||
|
|
||||||
<!-- <u-button type="primary" @click="showPop = true" v-if='goodsInfo.status==0'>扫码取货</u-button> -->
|
<!-- <u-button type="primary" @click="showPop = true" v-if='goodsInfo.status==0'>扫码取货</u-button> -->
|
||||||
<u-button type="primary" @click="qrqodeFn" v-if='goodsInfo.status==0'>扫码取货</u-button>
|
<u-button type="primary" @click="qrqodeFn" v-if='goodsInfo.status==0'>扫码取货</u-button>
|
||||||
<u-button type="primary" @click="showPop = true" style="background-color: #34A853;border: none;"
|
<u-button type="primary" @click="showPop = true" style="background-color: #34A853;border: none;"
|
||||||
v-if='goodsInfo.status==1'>已送达</u-button>
|
v-if='goodsInfo.status==1'>已送达</u-button>
|
||||||
<u-button type="primary" @click="goDetil" style="background-color: red;border:none"
|
<u-button type="primary" @click="goDetil" style="background-color: red;border:none"
|
||||||
v-if='goodsInfo.status==2'>查看详情</u-button>
|
v-if='goodsInfo.status==2'>查看详情</u-button>
|
||||||
|
<u-keyboard ref="uKeyboard" mode="number" :show="showKeybord"></u-keyboard>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
@ -103,6 +94,7 @@
|
|||||||
flag: undefined,
|
flag: undefined,
|
||||||
showPop: false,
|
showPop: false,
|
||||||
take_code: "",
|
take_code: "",
|
||||||
|
showKeybord: false,
|
||||||
// popContent: ["请确认已经收到货", "请确认已送达"]
|
// popContent: ["请确认已经收到货", "请确认已送达"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -122,6 +114,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
test() {
|
||||||
|
// console.log(666)
|
||||||
|
uni.hideKeyboard()
|
||||||
|
},
|
||||||
goDetil() {
|
goDetil() {
|
||||||
let status = this.goodsInfo.status
|
let status = this.goodsInfo.status
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -153,6 +149,9 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
|
if (!this.take_code) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.doneGood()
|
this.doneGood()
|
||||||
this.showPop = false
|
this.showPop = false
|
||||||
this.showMore()
|
this.showMore()
|
||||||
@ -218,14 +217,7 @@
|
|||||||
border-radius: 0 7px 0 7px;
|
border-radius: 0 7px 0 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods_tit {
|
|
||||||
width: 60vw;
|
|
||||||
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
word-break: break-all;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-family: "PingFang SC-Medium";
|
font-family: "PingFang SC-Medium";
|
||||||
@ -240,35 +232,53 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.content_box {
|
.content_box {
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: 15rpx 0;
|
margin: 15rpx 0;
|
||||||
|
|
||||||
.left {
|
view {
|
||||||
flex: 1;
|
display: flex;
|
||||||
color: #999999;
|
margin: 10rpx 0;
|
||||||
|
|
||||||
|
text:first-child {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.products {
|
||||||
flex: 4;
|
display: block;
|
||||||
|
|
||||||
|
.tit {
|
||||||
|
color: #999;
|
||||||
|
|
||||||
|
float: left;
|
||||||
|
margin: 0
|
||||||
|
}
|
||||||
|
|
||||||
.product {
|
.product {
|
||||||
margin: 10rpx 0;
|
width: 65vw;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
margin-left: 18vw;
|
||||||
|
|
||||||
|
|
||||||
|
.left {
|
||||||
|
color: black;
|
||||||
|
width: 55vw;
|
||||||
|
margin: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.icon_a {
|
|
||||||
/* transform: translateX(180deg); */
|
|
||||||
transform: rotate(90deg);
|
|
||||||
display: inline-block;
|
|
||||||
/* font-family: ; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.cil_left {
|
.cil_left {
|
||||||
width: 30rpx;
|
width: 30rpx;
|
||||||
height: 30rpx;
|
height: 30rpx;
|
||||||
|
@ -5,18 +5,25 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
<u-toast ref="uToast"></u-toast>
|
<u-toast ref="uToast"></u-toast>
|
||||||
|
|
||||||
<view class="map">
|
<view class="map">
|
||||||
<map id="map" @click="mapFun" :markers='markers' :scale="scale" :enable-zoom="true"
|
<map id="map" @markertap='mapFun' :markers='markers' :scale="scale" :enable-zoom="true"
|
||||||
style="width:100%;height: 100%;" :latitude="goodsDetil.logistics.shop_lat" :enable-scroll="false"
|
style="width:100%;height: 100%;" :latitude="goodsDetil.logistics.shop_lat" :enable-scroll="false"
|
||||||
:longitude="goodsDetil.logistics.shop_long">
|
:longitude="goodsDetil.logistics.shop_long">
|
||||||
|
<cover-image class="map_btn" @tap="test" src="../../static/img/logistics/DH.png">
|
||||||
|
</cover-image>
|
||||||
</map>
|
</map>
|
||||||
</view>
|
</view>
|
||||||
<view class="order_info">
|
<view class="order_info">
|
||||||
|
|
||||||
|
|
||||||
<p class='tit'>订单号: {{goodsDetil.logistics.order_sn}}</p>
|
<p class='tit'>订单号: {{goodsDetil.logistics.order_sn}}</p>
|
||||||
<view class="store_name">
|
<view class="store_name">
|
||||||
商户名称 {{goodsDetil.logistics.shop_name}}
|
商户名称 {{goodsDetil.logistics.shop_name}}
|
||||||
</view>
|
</view>
|
||||||
|
<view class="store_name">
|
||||||
|
联系电话 {{goodsDetil.logistics.shop_phone}}
|
||||||
|
</view>
|
||||||
<view class="store_time">
|
<view class="store_time">
|
||||||
{{goodsDetil.logistics.shop_address}}
|
{{goodsDetil.logistics.shop_address}}
|
||||||
</view>
|
</view>
|
||||||
@ -75,20 +82,45 @@
|
|||||||
latitude: undefined,
|
latitude: undefined,
|
||||||
longitude: undefined,
|
longitude: undefined,
|
||||||
markers: [{
|
markers: [{
|
||||||
|
id: 1,
|
||||||
latitude: undefined,
|
latitude: undefined,
|
||||||
longitude: undefined,
|
longitude: undefined,
|
||||||
iconPath: '@/static/images/daoru.png', //显示的图标
|
iconPath: '../../static/tabs-icon/home-a.png', //显示的图标
|
||||||
width: 40, //宽
|
|
||||||
height: 40, //高
|
|
||||||
title: '商家位置', //标注点名
|
|
||||||
alpha: 0.5, //透明度
|
|
||||||
|
|
||||||
}],
|
}],
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 唤起高德
|
||||||
|
test() {
|
||||||
|
var packageName = 'com.autonavi.minimap';
|
||||||
|
var main = plus.android.runtimeMainActivity();
|
||||||
|
var packageManager = main.getPackageManager();
|
||||||
|
var PackageManager = plus.android.importClass(packageManager)
|
||||||
|
var packageInfo = packageManager.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
|
||||||
|
if (packageInfo) {
|
||||||
|
var Uri = plus.android.importClass("android.net.Uri");
|
||||||
|
var url =
|
||||||
|
`amapuri://route/plan?sourceApplication=maxuslife+
|
||||||
|
&sid=A&slat=36.702558&slon=116.876678&sname=我的位置&did=B&dlat=${this.markers[0].latitude}&dlon=${this.markers[0].longitude}&dname=${this.goodsDetil.logistics.shop_name}&dev=0&t=0`;
|
||||||
|
var Intent = plus.android.importClass('android.content.Intent');
|
||||||
|
var intent = new Intent();
|
||||||
|
intent.setAction(Intent.ACTION_VIEW);
|
||||||
|
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||||
|
var uri = Uri.parse(url);
|
||||||
|
//将功能Scheme以URI的方式传入data
|
||||||
|
intent.setData(uri);
|
||||||
|
intent.setPackage("com.autonavi.minimap");
|
||||||
|
var main = plus.android.runtimeMainActivity();
|
||||||
|
main.startActivity(intent);
|
||||||
|
} else {
|
||||||
|
// alert('未安装' + packageName + '')
|
||||||
|
uni.showToast({
|
||||||
|
title: `只支持高德地图`,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log("唤醒高德线路规划")
|
||||||
|
},
|
||||||
showToast() {
|
showToast() {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@ -107,7 +139,6 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
showToast() {
|
showToast() {
|
||||||
// 6
|
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
title: '成功主题(带图标)',
|
title: '成功主题(带图标)',
|
||||||
@ -120,7 +151,6 @@
|
|||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
console.log("扫码类容" + res.result)
|
|
||||||
that.takeGood(res.result)
|
that.takeGood(res.result)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -141,19 +171,19 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
// 取货{}
|
|
||||||
// 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')
|
|
||||||
// })
|
|
||||||
|
|
||||||
// },
|
getLocation() {
|
||||||
// 地图结束
|
uni.getLocation({
|
||||||
|
type: 'wgs84',
|
||||||
|
success: function(res) {
|
||||||
|
console.log('当前位置的经度:' + res.longitude);
|
||||||
|
console.log('当前位置的纬度:' + res.latitude);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
getDetil({
|
getDetil({
|
||||||
@ -168,7 +198,14 @@
|
|||||||
this.showLoading = false
|
this.showLoading = false
|
||||||
}, 500)
|
}, 500)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -176,9 +213,20 @@
|
|||||||
.map {
|
.map {
|
||||||
height: 40vh;
|
height: 40vh;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.map_btn {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0px;
|
||||||
|
right: 0;
|
||||||
|
z-index: 9999999;
|
||||||
|
}
|
||||||
|
|
||||||
.custom-style {
|
.custom-style {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -196,6 +244,7 @@
|
|||||||
transform: translateY(-5vh);
|
transform: translateY(-5vh);
|
||||||
padding: 5vh 3vw;
|
padding: 5vh 3vw;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
.tit {
|
.tit {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
|
|
||||||
<u-search placeholder="搜索你的订单" @search="getOrderList" :show-action='false' bg-color='white'
|
<u-search placeholder="搜索你的订单" @search="getOrderList" :show-action='false' bg-color='white'
|
||||||
v-model="keywords"></u-search>
|
v-model="keywords"></u-search>
|
||||||
<view style="margin: 10rpx 0 0 0;">
|
<view style="margin: 10rpx 0 0 0;">
|
||||||
@ -14,7 +13,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
<logistiCard ref="logistiCards" v-for='(item,index) in orderlist' @getlist="getOrderList"
|
<logistiCard ref="logistiCards" v-for='(item,index) in orderlist' @getlist="getOrderList"
|
||||||
@showTost='showToast' :goodsInfo="item" :key="index">
|
@showTost='showToast' @showToast2="showToast2" :goodsInfo="item" :key="index">
|
||||||
</logistiCard>
|
</logistiCard>
|
||||||
</view>
|
</view>
|
||||||
<u-toast ref="uToast"></u-toast>
|
<u-toast ref="uToast"></u-toast>
|
||||||
@ -58,6 +57,15 @@
|
|||||||
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
|
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
showToast2() {
|
||||||
|
// 6
|
||||||
|
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
type: 'error',
|
||||||
|
message: "取件码不能为空",
|
||||||
|
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
|
||||||
|
}, )
|
||||||
|
},
|
||||||
getOrderList() {
|
getOrderList() {
|
||||||
console.log("列表更新")
|
console.log("列表更新")
|
||||||
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
|
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
<view class="order">
|
<view class="order">
|
||||||
<p>订单号:{{goodsDetil.logistics.order_sn}}</p>
|
<p>订单号:{{goodsDetil.logistics.order_sn}}</p>
|
||||||
<view class='phone'> </view>
|
<view class='phone'> </view>
|
||||||
|
|
||||||
<!-- 已送达 -->
|
<!-- 已送达 -->
|
||||||
<view class="left" v-if="goodsDetil.logistics.status==2">
|
<view class="left" v-if="goodsDetil.logistics.status==2">
|
||||||
<view class="list">
|
<view class="list">
|
||||||
@ -90,6 +89,14 @@
|
|||||||
{{goodsDetil.logistics.user_name}}
|
{{goodsDetil.logistics.user_name}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="list">
|
||||||
|
<text>
|
||||||
|
联系方式
|
||||||
|
</text>
|
||||||
|
<view>
|
||||||
|
{{goodsDetil.logistics.user_phone}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="list" style="margin: 10rpx 0;">
|
<view class="list" style="margin: 10rpx 0;">
|
||||||
<text style="width: 16vw;">
|
<text style="width: 16vw;">
|
||||||
收货地址
|
收货地址
|
||||||
@ -149,7 +156,7 @@
|
|||||||
<u-modal :show="showPop" @close="showPop=false" title="请输入收件码" @confirm="confirm"
|
<u-modal :show="showPop" @close="showPop=false" title="请输入收件码" @confirm="confirm"
|
||||||
:closeOnClickOverlay="true">
|
:closeOnClickOverlay="true">
|
||||||
<view class="slot-content">
|
<view class="slot-content">
|
||||||
<u--input placeholder="请输入收件码" border="surround" v-model="take_code"></u--input>
|
<u--input placeholder="请输入收件码" type="number" border="surround" v-model="take_code"></u--input>
|
||||||
</view>
|
</view>
|
||||||
</u-modal>
|
</u-modal>
|
||||||
|
|
||||||
@ -191,6 +198,7 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
confirm() {
|
confirm() {
|
||||||
|
if (!this.take_code) return
|
||||||
doneDelivery({
|
doneDelivery({
|
||||||
take_code: this.take_code,
|
take_code: this.take_code,
|
||||||
logistics_id: this.goodsDetil.logistics.id
|
logistics_id: this.goodsDetil.logistics.id
|
||||||
|
@ -90,163 +90,179 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
confirm() {
|
confirm() {
|
||||||
takeGoods({
|
// takeGoods({
|
||||||
order_id: "",
|
// order_id: "",
|
||||||
order_sn: "",
|
// order_sn: "",
|
||||||
logistics_id: this.goodsDetil.logistics.id
|
// logistics_id: this.goodsDetil.logistics.id
|
||||||
}).then(res => {
|
// }).then(res => {
|
||||||
this.showToast()
|
// this.showToast()
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
uni.navigateBack()
|
// uni.navigateBack()
|
||||||
}, 2000)
|
// }, 2000)
|
||||||
})
|
// })
|
||||||
this.showPop = false
|
// this.showPop = false
|
||||||
|
var packageName = 'com.autonavi.minimap';
|
||||||
|
var main = plus.android.runtimeMainActivity();
|
||||||
|
var packageManager = main.getPackageManager();
|
||||||
|
var PackageManager = plus.android.importClass(packageManager) var packageInfo = packageManager
|
||||||
|
.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
|
||||||
|
if (packageInfo) {
|
||||||
|
var Uri = plus.android.importClass("android.net.Uri");
|
||||||
|
var url = "amapuri://route/plan?sourceApplication=maxuslife" +
|
||||||
|
"&sid=A&slat=36.702558&slon=116.876678&sname=起始地点" +
|
||||||
|
"&did=B&dlat=36.649415&dlon=117.122497&dname=结束地点&dev=0&t=0";
|
||||||
|
var Intent = plus.android.importClass('android.content.Intent');
|
||||||
|
var intent = new Intent();
|
||||||
|
intent.setAction(Intent.ACTION_VIEW);
|
||||||
|
intent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||||
|
var uri = Uri.parse(url);
|
||||||
|
//将功能Scheme以URI的方式传入data intent.setData(uri);intent.setPackage("com.autonavi.minimap");var main = plus.android.runtimeMainActivity();main.startActivity(intent);} else {// alert('未安装' + packageName + '')uni.showToast({title: `目前导航暂只支持${packageName}`})}
|
||||||
|
|
||||||
},
|
},
|
||||||
showToast() {
|
showToast() {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
title: '成功主题(带图标)',
|
title: '成功主题(带图标)',
|
||||||
message: "操作成功",
|
message: "操作成功",
|
||||||
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
|
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
地图相关
|
地图相关
|
||||||
*/
|
*/
|
||||||
// 路线规划
|
// 路线规划
|
||||||
getDriverLine() {
|
getDriverLine() {
|
||||||
const that = this;
|
const that = this;
|
||||||
const key = "997c9a3d88154fa78f4d28bebc1dd84f";
|
const key = "997c9a3d88154fa78f4d28bebc1dd84f";
|
||||||
//起点坐标
|
//起点坐标
|
||||||
const origin = "28.908854,105.43639400000002,";
|
const origin = "28.908854,105.43639400000002,";
|
||||||
//给起点坐标一个图标
|
//给起点坐标一个图标
|
||||||
this.startingPoint()
|
this.startingPoint()
|
||||||
//给终点坐标一个图标
|
//给终点坐标一个图标
|
||||||
this.endPoint()
|
this.endPoint()
|
||||||
//终点坐标
|
//终点坐标
|
||||||
const destination = "28.908447,105.439304,";
|
const destination = "28.908447,105.439304,";
|
||||||
uni.request({
|
uni.request({
|
||||||
// url: `https://restapi.amap.com/v3/direction/walking?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`,
|
// url: `https://restapi.amap.com/v3/direction/walking?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`,
|
||||||
url: `https:restapi.amap.com/v4/direction/bicycling?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`,
|
url: `https:restapi.amap.com/v4/direction/bicycling?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
const data = res.data.data;
|
const data = res.data.data;
|
||||||
var points = [];
|
var points = [];
|
||||||
if (data.paths && data.paths[0] && data.paths[0].steps) {
|
if (data.paths && data.paths[0] && data.paths[0].steps) {
|
||||||
var steps = data.paths[0].steps;
|
var steps = data.paths[0].steps;
|
||||||
for (var i = 0; i < steps.length; i++) {
|
for (var i = 0; i < steps.length; i++) {
|
||||||
//将每一步的数据放到points数组中
|
//将每一步的数据放到points数组中
|
||||||
var poLen = steps[i].polyline.split(";");
|
var poLen = steps[i].polyline.split(";");
|
||||||
for (var j = 0; j < poLen.length; j++) {
|
for (var j = 0; j < poLen.length; j++) {
|
||||||
points.push({
|
points.push({
|
||||||
longitude: parseFloat(poLen[j].split(",")[0]),
|
longitude: parseFloat(poLen[j].split(",")[0]),
|
||||||
latitude: parseFloat(poLen[j].split(",")[1]),
|
latitude: parseFloat(poLen[j].split(",")[1]),
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(data.paths[0].steps[0].instruction)
|
||||||
|
that.runningRoute = data.paths[0].steps[0].instruction;
|
||||||
|
console.log('行驶路线-----------', that.runningRoute)
|
||||||
}
|
}
|
||||||
}
|
that.polyline = [{
|
||||||
console.log(data.paths[0].steps[0].instruction)
|
points: points,
|
||||||
that.runningRoute = data.paths[0].steps[0].instruction;
|
color: "#0091ff",
|
||||||
console.log('行驶路线-----------', that.runningRoute)
|
dottedLine: true,
|
||||||
}
|
width: 15,
|
||||||
that.polyline = [{
|
arrowLine: true,
|
||||||
points: points,
|
colorList: true,
|
||||||
color: "#0091ff",
|
}, ];
|
||||||
dottedLine: true,
|
},
|
||||||
width: 15,
|
fail: function(res) {
|
||||||
arrowLine: true,
|
console.log("获取路线失败", res);
|
||||||
colorList: true,
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 规划路线的时候给起点一个marker,
|
||||||
|
startingPoint() {
|
||||||
|
let point = [{
|
||||||
|
id: 1,
|
||||||
|
width: 40,
|
||||||
|
height: 40,
|
||||||
|
latitude: 28.908854,
|
||||||
|
longitude: 105.43639400000002,
|
||||||
|
iconPath: "https://p4.itc.cn/images03/20200518/90137c12bbac485dbc5bb0fe9d8cf4bd.jpeg",
|
||||||
|
anchor: {
|
||||||
|
x: 0.5,
|
||||||
|
y: 1,
|
||||||
|
},
|
||||||
}, ];
|
}, ];
|
||||||
|
this.markers = this.markers.concat(point);
|
||||||
},
|
},
|
||||||
fail: function(res) {
|
// 规划路线的时候给终点一个marker,
|
||||||
console.log("获取路线失败", res);
|
endPoint() {
|
||||||
|
let point = [{
|
||||||
|
id: 2,
|
||||||
|
width: 40,
|
||||||
|
height: 40,
|
||||||
|
latitude: 28.908447, //纬度
|
||||||
|
longitude: 105.439304,
|
||||||
|
//经度
|
||||||
|
iconPath: 'https://t9.baidu.com/it/u=414099140,1072313909&fm=193',
|
||||||
|
anchor: {
|
||||||
|
x: 0.5,
|
||||||
|
y: 1,
|
||||||
|
},
|
||||||
|
}, ];
|
||||||
|
this.markers = this.markers.concat(point);
|
||||||
},
|
},
|
||||||
});
|
|
||||||
},
|
mapFun() {
|
||||||
// 规划路线的时候给起点一个marker,
|
uni.openLocation({
|
||||||
startingPoint() {
|
latitude: Number(this.goodsDetil.logistics.shop_lat),
|
||||||
let point = [{
|
longitude: Number(this.goodsDetil.logistics.shop_long),
|
||||||
id: 1,
|
address: this.goodsDetil.logistics.shop_address,
|
||||||
width: 40,
|
name: this.goodsDetil.logistics.shop_name,
|
||||||
height: 40,
|
scale: 15,
|
||||||
latitude: 28.908854,
|
});
|
||||||
longitude: 105.43639400000002,
|
|
||||||
iconPath: "https://p4.itc.cn/images03/20200518/90137c12bbac485dbc5bb0fe9d8cf4bd.jpeg",
|
|
||||||
anchor: {
|
|
||||||
x: 0.5,
|
|
||||||
y: 1,
|
|
||||||
},
|
},
|
||||||
}, ];
|
|
||||||
this.markers = this.markers.concat(point);
|
|
||||||
},
|
qrqodeFn() {
|
||||||
// 规划路线的时候给终点一个marker,
|
uni.scanCode({
|
||||||
endPoint() {
|
onlyFromCamera: true,
|
||||||
let point = [{
|
success: function(res) {
|
||||||
id: 2,
|
// console.log('条码类型:' + res.scanType);
|
||||||
width: 40,
|
console.log('条码内容:' + res.result);
|
||||||
height: 40,
|
}
|
||||||
latitude: 28.908447, //纬度
|
});
|
||||||
longitude: 105.439304,
|
|
||||||
//经度
|
|
||||||
iconPath: 'https://t9.baidu.com/it/u=414099140,1072313909&fm=193',
|
|
||||||
anchor: {
|
|
||||||
x: 0.5,
|
|
||||||
y: 1,
|
|
||||||
},
|
},
|
||||||
}, ];
|
|
||||||
this.markers = this.markers.concat(point);
|
// 地图结束
|
||||||
},
|
},
|
||||||
|
onLoad(options) {
|
||||||
mapFun() {
|
getDetil({
|
||||||
uni.openLocation({
|
logistics_id: options.id
|
||||||
latitude: Number(this.goodsDetil.logistics.shop_lat),
|
}).then(res => {
|
||||||
longitude: Number(this.goodsDetil.logistics.shop_long),
|
this.goodsDetil = res.data
|
||||||
address: this.goodsDetil.logistics.shop_address,
|
this.latitude = res.data.logistics.shop_lat
|
||||||
name: this.goodsDetil.logistics.shop_name,
|
this.longitude = res.data.logistics.shop_long
|
||||||
scale: 15,
|
this.markers[0].latitude = res.data.logistics.shop_lat
|
||||||
});
|
this.markers[0].longitude = res.data.logistics.shop_long
|
||||||
|
setTimeout(() => {
|
||||||
|
this.showLoading = false
|
||||||
|
}, 500)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
// onShow() {
|
||||||
|
// let that = this
|
||||||
|
// // uni.getLocation({
|
||||||
|
// // type: 'wgs84',
|
||||||
|
// // success: function(res) {
|
||||||
|
// // that.mark[0].latitude = res.latitude
|
||||||
|
// // that.mark[0].longitude = res.longitude
|
||||||
|
// // console.log(that.mark[0])
|
||||||
|
// // console.log(res)
|
||||||
|
|
||||||
|
// // }
|
||||||
qrqodeFn() {
|
// // });
|
||||||
uni.scanCode({
|
// }
|
||||||
onlyFromCamera: true,
|
}
|
||||||
success: function(res) {
|
|
||||||
// console.log('条码类型:' + res.scanType);
|
|
||||||
console.log('条码内容:' + res.result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 地图结束
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
getDetil({
|
|
||||||
logistics_id: options.id
|
|
||||||
}).then(res => {
|
|
||||||
this.goodsDetil = res.data
|
|
||||||
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)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// onShow() {
|
|
||||||
// let that = this
|
|
||||||
// // uni.getLocation({
|
|
||||||
// // type: 'wgs84',
|
|
||||||
// // success: function(res) {
|
|
||||||
// // that.mark[0].latitude = res.latitude
|
|
||||||
// // that.mark[0].longitude = res.longitude
|
|
||||||
// // console.log(that.mark[0])
|
|
||||||
// // console.log(res)
|
|
||||||
|
|
||||||
// // }
|
|
||||||
// // });
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang='scss' scoped>
|
<style lang='scss' scoped>
|
||||||
|
BIN
static/img/logistics/DH.png
Normal file
BIN
static/img/logistics/DH.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Loading…
x
Reference in New Issue
Block a user