-
@@ -14,7 +13,7 @@
+ @showTost='showToast' @showToast2="showToast2" :goodsInfo="item" :key="index">
@@ -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
diff --git a/pages/logistics/logisticDetil.vue b/pages/logistics/logisticDetil.vue
index 38a8a94..6b3c07b 100644
--- a/pages/logistics/logisticDetil.vue
+++ b/pages/logistics/logisticDetil.vue
@@ -7,7 +7,6 @@
订单号:{{goodsDetil.logistics.order_sn}}
-
@@ -90,6 +89,14 @@
{{goodsDetil.logistics.user_name}}
+
+
+ 联系方式
+
+
+ {{goodsDetil.logistics.user_phone}}
+
+
收货地址
@@ -149,7 +156,7 @@
-
+
@@ -191,6 +198,7 @@
},
methods: {
confirm() {
+ if (!this.take_code) return
doneDelivery({
take_code: this.take_code,
logistics_id: this.goodsDetil.logistics.id
diff --git a/pages/logistics/te.vue b/pages/logistics/te.vue
index 1a67832..880f730 100644
--- a/pages/logistics/te.vue
+++ b/pages/logistics/te.vue
@@ -90,163 +90,179 @@
},
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);
+ //将功能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() {
- this.$refs.uToast.show({
- type: 'success',
- title: '成功主题(带图标)',
- message: "操作成功",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
- })
- },
- /*
- 地图相关
- */
- // 路线规划
- getDriverLine() {
- const that = this;
- const key = "997c9a3d88154fa78f4d28bebc1dd84f";
- //起点坐标
- const origin = "28.908854,105.43639400000002,";
- //给起点坐标一个图标
- this.startingPoint()
- //给终点坐标一个图标
- this.endPoint()
- //终点坐标
- const destination = "28.908447,105.439304,";
- 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/v4/direction/bicycling?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`,
- success: (res) => {
- const data = res.data.data;
- var points = [];
- if (data.paths && data.paths[0] && data.paths[0].steps) {
- var steps = data.paths[0].steps;
- for (var i = 0; i < steps.length; i++) {
- //将每一步的数据放到points数组中
- var poLen = steps[i].polyline.split(";");
- for (var j = 0; j < poLen.length; j++) {
- points.push({
- longitude: parseFloat(poLen[j].split(",")[0]),
- latitude: parseFloat(poLen[j].split(",")[1]),
- });
+ },
+ showToast() {
+ this.$refs.uToast.show({
+ type: 'success',
+ title: '成功主题(带图标)',
+ message: "操作成功",
+ iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
+ })
+ },
+ /*
+ 地图相关
+ */
+ // 路线规划
+ getDriverLine() {
+ const that = this;
+ const key = "997c9a3d88154fa78f4d28bebc1dd84f";
+ //起点坐标
+ const origin = "28.908854,105.43639400000002,";
+ //给起点坐标一个图标
+ this.startingPoint()
+ //给终点坐标一个图标
+ this.endPoint()
+ //终点坐标
+ const destination = "28.908447,105.439304,";
+ 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/v4/direction/bicycling?key=${key}&origin=105.43639400000002,28.908854&destination=105.439304,28.908447`,
+ success: (res) => {
+ const data = res.data.data;
+ var points = [];
+ if (data.paths && data.paths[0] && data.paths[0].steps) {
+ var steps = data.paths[0].steps;
+ for (var i = 0; i < steps.length; i++) {
+ //将每一步的数据放到points数组中
+ var poLen = steps[i].polyline.split(";");
+ for (var j = 0; j < poLen.length; j++) {
+ points.push({
+ longitude: parseFloat(poLen[j].split(",")[0]),
+ 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)
}
- }
- console.log(data.paths[0].steps[0].instruction)
- that.runningRoute = data.paths[0].steps[0].instruction;
- console.log('行驶路线-----------', that.runningRoute)
- }
- that.polyline = [{
- points: points,
- color: "#0091ff",
- dottedLine: true,
- width: 15,
- arrowLine: true,
- colorList: true,
+ that.polyline = [{
+ points: points,
+ color: "#0091ff",
+ dottedLine: true,
+ width: 15,
+ arrowLine: true,
+ colorList: true,
+ }, ];
+ },
+ fail: function(res) {
+ console.log("获取路线失败", res);
+ },
+ });
+ },
+ // 规划路线的时候给起点一个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) {
- console.log("获取路线失败", res);
+ // 规划路线的时候给终点一个marker,
+ 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);
},
- });
- },
- // 规划路线的时候给起点一个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,
+
+ 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,
+ });
},
- }, ];
- this.markers = this.markers.concat(point);
- },
- // 规划路线的时候给终点一个marker,
- 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,
+
+
+ qrqodeFn() {
+ uni.scanCode({
+ onlyFromCamera: true,
+ success: function(res) {
+ // console.log('条码类型:' + res.scanType);
+ console.log('条码内容:' + res.result);
+ }
+ });
},
- }, ];
- this.markers = this.markers.concat(point);
+
+ // 地图结束
},
-
- 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,
- });
+ 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)
-
- 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)
-
- // // }
- // // });
- // }
- }
+ // // }
+ // // });
+ // }
+ }