物流初步完成

This commit is contained in:
THK3121 2023-08-11 16:00:08 +08:00
parent 9b3a0bf7fe
commit 684fe485e2
6 changed files with 321 additions and 230 deletions

View File

@ -9,42 +9,34 @@
<p v-else>{{goodsInfo.user_name}}</p>
<view class='phone' v-if="goodsInfo.status==0">联系方式 :{{goodsInfo.shop_phone}} </view>
<view class='phone' v-else>联系方式 :{{goodsInfo.user_phone}} </view>
<!-- 代取货 -->
<view class="content_box">
<view class="left">
<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">
用户地址
<text style="flex:2;">用户地址</text>
<text style="flex:8;">{{goodsInfo.user_address}}</text>
</view>
<view style="margin: 20rpx 0;">
订单编号
</view>
<view class="">
采购商品
</view>
</view>
<view class="right">
<view class="goods_tit" v-if="goodsInfo.status==0">
{{goodsInfo.shop_address}}
</view>
<view class="goods_tit" v-else>
{{goodsInfo.user_address}}
</view>
<view style="margin: 20rpx 0;">
{{goodsInfo.order_sn}}
<view>
<text style="flex:2;">订单编号</text>
<text style="flex:8;">{{goodsInfo.order_sn}}</text>
</view>
<view class="products">
<view class="tit">采购商品</view>
<view class='product' v-for="(item,index) in goodsInfo.products" :key="index">
<text class="goods_tit">{{item.goods_name}}</text>
<text>X{{item.product_num}}{{item.goods_unit}}</text>
<text class="left">{{item.goods_name}}</text>
<text class="right">X{{item.product_num}}{{item.goods_unit}}</text>
</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 v-else class='finishOrder' @click="goDetil">
<view>
@ -53,11 +45,9 @@
<view class="phone">
<text style="color:#999">联系方式</text> {{goodsInfo.user_phone}}
</view>
<view style="margin: 20rpx 0;">
<text style="color:#999">收货时间</text> {{goodsInfo.xd_time||"暂未收货"}}
</view>
<view style="margin: 20rpx 0;">
<text style="color:#999">送达时间</text> {{pst_time||"暂未送达"}}
<text style="color:#999">送达时间</text> {{goodsInfo.ps_time||"暂未送达"}}
</view>
<view style="margin: 20rpx 0;">
<text style="color:#999">取货时间</text> {{goodsInfo.qh_time||"暂未取货"}}
@ -74,16 +64,17 @@
:closeOnClickOverlay="true"></u-modal> -->
<u-modal :show="showPop" @close="showPop=false" @confirm="confirm" title="请输入收件码" :closeOnClickOverlay="true">
<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>
</u-modal>
<!-- <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="showPop = true" style="background-color: #34A853;border: none;"
v-if='goodsInfo.status==1'>已送达</u-button>
<u-button type="primary" @click="goDetil" style="background-color: red;border:none"
v-if='goodsInfo.status==2'>查看详情</u-button>
<u-keyboard ref="uKeyboard" mode="number" :show="showKeybord"></u-keyboard>
</view>
@ -103,6 +94,7 @@
flag: undefined,
showPop: false,
take_code: "",
showKeybord: false,
// popContent: ["", ""]
}
},
@ -122,6 +114,10 @@
}
},
methods: {
test() {
// console.log(666)
uni.hideKeyboard()
},
goDetil() {
let status = this.goodsInfo.status
uni.navigateTo({
@ -153,6 +149,9 @@
},
confirm() {
if (!this.take_code) {
return
}
this.doneGood()
this.showPop = false
this.showMore()
@ -218,14 +217,7 @@
border-radius: 0 7px 0 7px;
}
.goods_tit {
width: 60vw;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
white-space: nowrap;
}
p {
font-family: "PingFang SC-Medium";
@ -240,35 +232,53 @@
}
.content_box {
display: flex;
justify-content: space-between;
margin: 15rpx 0;
.left {
flex: 1;
color: #999999;
view {
display: flex;
margin: 10rpx 0;
text:first-child {
color: #999;
}
}
.right {
flex: 4;
.products {
display: block;
.tit {
color: #999;
float: left;
margin: 0
}
.product {
margin: 10rpx 0;
width: 65vw;
display: flex;
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 {
width: 30rpx;
height: 30rpx;

View File

@ -5,18 +5,25 @@
</view>
<view v-else>
<u-toast ref="uToast"></u-toast>
<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"
:longitude="goodsDetil.logistics.shop_long">
<cover-image class="map_btn" @tap="test" src="../../static/img/logistics/DH.png">
</cover-image>
</map>
</view>
<view class="order_info">
<p class='tit'>订单号: {{goodsDetil.logistics.order_sn}}</p>
<view class="store_name">
商户名称 {{goodsDetil.logistics.shop_name}}
</view>
<view class="store_name">
联系电话 {{goodsDetil.logistics.shop_phone}}
</view>
<view class="store_time">
{{goodsDetil.logistics.shop_address}}
</view>
@ -75,20 +82,45 @@
latitude: undefined,
longitude: undefined,
markers: [{
id: 1,
latitude: undefined,
longitude: undefined,
iconPath: '@/static/images/daoru.png', //
width: 40, //
height: 40, //
title: '商家位置', //
alpha: 0.5, //
iconPath: '../../static/tabs-icon/home-a.png', //
}],
}
},
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);
//SchemeURIdata
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() {
this.$refs.uToast.show({
type: 'success',
@ -107,7 +139,6 @@
});
},
showToast() {
// 6
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
@ -120,7 +151,6 @@
uni.scanCode({
onlyFromCamera: true,
success: function(res) {
console.log("扫码类容" + 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) {
getDetil({
@ -168,7 +198,14 @@
this.showLoading = false
}, 500)
})
},
}
</script>
@ -176,9 +213,20 @@
.map {
height: 40vh;
width: 100vw;
position: relative;
}
.map_btn {
width: 50px;
height: 50px;
position: absolute;
bottom: 0px;
right: 0;
z-index: 9999999;
}
.custom-style {
width: 100%;
@ -196,6 +244,7 @@
transform: translateY(-5vh);
padding: 5vh 3vw;
box-sizing: border-box;
position: relative;
.tit {
font-weight: bold;

View File

@ -1,6 +1,5 @@
<template>
<view class="content">
<u-search placeholder="搜索你的订单" @search="getOrderList" :show-action='false' bg-color='white'
v-model="keywords"></u-search>
<view style="margin: 10rpx 0 0 0;">
@ -14,7 +13,7 @@
</view>
<view v-else>
<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>
</view>
<u-toast ref="uToast"></u-toast>
@ -58,6 +57,15 @@
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() {
console.log("列表更新")
let id = JSON.parse(uni.getStorageSync('USER_INFO')).id

View File

@ -7,7 +7,6 @@
<view class="order">
<p>订单号:{{goodsDetil.logistics.order_sn}}</p>
<view class='phone'> </view>
<!-- 已送达 -->
<view class="left" v-if="goodsDetil.logistics.status==2">
<view class="list">
@ -90,6 +89,14 @@
{{goodsDetil.logistics.user_name}}
</view>
</view>
<view class="list">
<text>
联系方式
</text>
<view>
{{goodsDetil.logistics.user_phone}}
</view>
</view>
<view class="list" style="margin: 10rpx 0;">
<text style="width: 16vw;">
收货地址
@ -149,7 +156,7 @@
<u-modal :show="showPop" @close="showPop=false" title="请输入收件码" @confirm="confirm"
:closeOnClickOverlay="true">
<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>
</u-modal>
@ -191,6 +198,7 @@
},
methods: {
confirm() {
if (!this.take_code) return
doneDelivery({
take_code: this.take_code,
logistics_id: this.goodsDetil.logistics.id

View File

@ -90,17 +90,33 @@
},
methods: {
confirm() {
takeGoods({
order_id: "",
order_sn: "",
logistics_id: this.goodsDetil.logistics.id
}).then(res => {
this.showToast()
setTimeout(() => {
uni.navigateBack()
}, 2000)
})
this.showPop = false
// takeGoods({
// order_id: "",
// order_sn: "",
// logistics_id: this.goodsDetil.logistics.id
// }).then(res => {
// this.showToast()
// setTimeout(() => {
// uni.navigateBack()
// }, 2000)
// })
// 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);
//SchemeURIdata intent.setData(uri);intent.setPackage("com.autonavi.minimap");var main = plus.android.runtimeMainActivity();main.startActivity(intent);} else {// alert('' + packageName + '')uni.showToast({title: `${packageName}`})}
},
showToast() {

BIN
static/img/logistics/DH.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB