From 9b3a0bf7fef5c2a5d1bd7aac1a8e9373fa495e25 Mon Sep 17 00:00:00 2001 From: THK3121 Date: Thu, 10 Aug 2023 17:32:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=B5=81=E6=9D=BF=E5=9D=97=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logistiCard/logistiCard.vue | 67 ++-- pages.json | 9 - pages/logistics/deliveryDetil.vue | 335 ++++++------------ pages/logistics/index.vue | 19 +- pages/logistics/logisticDetil.vue | 82 +++-- pages/logistics/{t.vue => te.vue} | 215 ++++++----- pages/oaHome/oaHome.vue | 2 +- 7 files changed, 343 insertions(+), 386 deletions(-) rename pages/logistics/{t.vue => te.vue} (53%) diff --git a/components/logistiComptent/logistiCard/logistiCard.vue b/components/logistiComptent/logistiCard/logistiCard.vue index a3eb5f1..bd85982 100644 --- a/components/logistiComptent/logistiCard/logistiCard.vue +++ b/components/logistiComptent/logistiCard/logistiCard.vue @@ -46,7 +46,6 @@ alt=""> --> - 订单编号 {{goodsInfo.order_sn}} @@ -58,12 +57,11 @@ 收货时间 {{goodsInfo.xd_time||"暂未收货"}} - 送达时间 {{goodsInfo.pc_time||"暂未送达"}} + 送达时间 {{pst_time||"暂未送达"}} 取货时间 {{goodsInfo.qh_time||"暂未取货"}} - 共计{{goodsInfo.product_count}}件商品 @@ -72,9 +70,16 @@ - - 已取货 + + + + + + + + + 扫码取货 已送达 { this.$emit('showTost') this.$emit('getlist') }) }, - async confirm() { - await this.goodsInfo.status == 0 ? this.takeGood() : this.doneGood() + confirm() { + this.doneGood() this.showPop = false this.showMore() @@ -133,8 +161,7 @@ // 送达 doneGood() { doneDelivery({ - user_id: this.goodsInfo.courier_id, - // user_id: 167, + take_code: this.take_code, logistics_id: this.goodsInfo.id }).then(res => { this.$emit('showTost') @@ -162,8 +189,8 @@ }, mounted() { - // this.showMore() - console.log(this.goodsInfo) + this.showMore() + // console.log(this.goodsInfo) // console.log(this.goodsInfo) // conso diff --git a/pages.json b/pages.json index 188b20b..332e2ba 100644 --- a/pages.json +++ b/pages.json @@ -98,15 +98,6 @@ "navigationBarTextStyle": "white" } - }, { - "path": "pages/logistics/t", - "style": { - "navigationBarTitleText": "订单详情", - "enablePullDownRefresh": false, - "navigationBarBackgroundColor": "#3175f9", - "navigationBarTextStyle": "white" - } - }, { "path": "pages/logistics/deliveryDetil", "style": { diff --git a/pages/logistics/deliveryDetil.vue b/pages/logistics/deliveryDetil.vue index a918790..b019e81 100644 --- a/pages/logistics/deliveryDetil.vue +++ b/pages/logistics/deliveryDetil.vue @@ -1,53 +1,60 @@ @@ -61,100 +68,27 @@ export default { data() { return { + showLoading: true, showPop: false, goodsDetil: undefined, scale: 17, - latitude: 28.908854, - longitude: 105.43639400000002, - markers: [], - polyline: [], - // https://p4.itc.cn/images03/20200518/90137c12bbac485dbc5bb0fe9d8cf4bd.jpeg - // https://t9.baidu.com/it/u=414099140,1072313909&fm=193 - // mark: [{ - // id: 0, - // latitude: 28.908854, - // longitude: 105.43639400000002, - // iconPath: 'https://img2.baidu.com/it/u=3116155797,2219949885&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500', //显示的图标 + latitude: undefined, + longitude: undefined, + markers: [{ + latitude: undefined, + longitude: undefined, + iconPath: '@/static/images/daoru.png', //显示的图标 + width: 40, //宽 + height: 40, //高 + title: '商家位置', //标注点名 + alpha: 0.5, //透明度 - // width: 40, //宽 - // height: 40, //高 - // title: '我在这里', //标注点名 - // alpha: 0.5, //透明度 - // callout: { //自定义标记点上方的气泡窗口 点击有效 - // content: '我的位置', //文本 - // color: '#ffffff', //文字颜色 - // fontSize: 14, //文本大小 - // borderRadius: 15, //边框圆角 - // borderWidth: '10', - // bgColor: '#3274F9', //背景颜色 - // display: 'ALWAYS', //常显 - // }, - // }, - // { - // id: 2, - - // latitude: 28.908447, //纬度 - // longitude: 105.439304, - // //经度 - // iconPath: '../../static/img/contract/company.png', //显示的图标 - // rotate: 0, // 旋转度数 - // width: 20, //宽 - // height: 30, //高 - // alpha: 0.5, //透明度 - // callout: { //自定义标记点上方的气泡窗口 点击有效 - // content: '商家', //文本 - // color: 'white', //文字颜色 - // fontSize: 14, //文本大小 - // borderRadius: 15, //边框圆角 - // borderWidth: '10', - // bgColor: '#3274F9', //背景颜色 - // display: 'ALWAYS', //常显 - // }, - // }, - - - - // ], - - // polyline: [{ - // points: [{ - // latitude: 28.908854, - // longitude: 105.43639400000002, - // }, { - // latitude: 28.908447, //纬度 - // longitude: 105.439304, - // }], - // color: "#0091ff", - // // dottedLine: true, - // // colorList: true, - // // dottedLine: true, - // width: 15, - // // arrowLine: true, - // // colorList: true, - // // colorList: true - - // } - - // ] + }], } }, methods: { - confirm() { - let id = JSON.parse(uni.getStorageSync('USER_INFO')).id - takeGoods({ - user_id: id, - logistics_id: this.goodsDetil.logistics.id - }).then(res => { - this.showToast() - setTimeout(() => { - uni.navigateBack() - }, 2000) - }) - this.showPop = false - - }, showToast() { this.$refs.uToast.show({ type: 'success', @@ -163,118 +97,78 @@ 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) - } - that.polyline = [{ - points: points, - color: "#0091ff", - dottedLine: true, - width: 15, - arrowLine: true, - colorList: true, - }, ]; - }, - fail: function(res) { - console.log("获取路线失败", res); - }, + 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, }); }, - // 规划路线的时候给起点一个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); + showToast() { + // 6 + this.$refs.uToast.show({ + type: 'success', + title: '成功主题(带图标)', + message: "操作成功", + iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png' + }) }, - // 规划路线的时候给终点一个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); + qrqodeFn() { + let that = this + uni.scanCode({ + onlyFromCamera: true, + success: function(res) { + console.log("扫码类容" + res.result) + that.takeGood(res.result) + } + }); }, + // 取货{} + 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) + }) + }, + // 取货{} + // 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') + // }) + + // }, // 地图结束 - - - - }, onLoad(options) { getDetil({ logistics_id: options.id }).then(res => { this.goodsDetil = res.data - console.log(this.goodsDetil) + 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) - - // // } - // // }); - // } } @@ -285,6 +179,7 @@ } + .custom-style { width: 100%; background-color: #3C9CFF; diff --git a/pages/logistics/index.vue b/pages/logistics/index.vue index 85ccd7c..14429ff 100644 --- a/pages/logistics/index.vue +++ b/pages/logistics/index.vue @@ -1,5 +1,6 @@