From 87779aa2eb38f07e266ecb536e8ecd30c3b994b5 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 28 四月 2026 18:55:33 +0800
Subject: [PATCH] 支付宝支付ddd
---
small-program/unpackage/dist/dev/mp-weixin/shop/pages/order-details/order-details.js | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 150 insertions(+), 1 deletions(-)
diff --git a/small-program/unpackage/dist/dev/mp-weixin/shop/pages/order-details/order-details.js b/small-program/unpackage/dist/dev/mp-weixin/shop/pages/order-details/order-details.js
index c69f97e..7f79306 100644
--- a/small-program/unpackage/dist/dev/mp-weixin/shop/pages/order-details/order-details.js
+++ b/small-program/unpackage/dist/dev/mp-weixin/shop/pages/order-details/order-details.js
@@ -242,6 +242,7 @@
var _weappQrcode = _interopRequireDefault(__webpack_require__(/*! weapp-qrcode */ 193));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
+var amapFile = __webpack_require__(/*! @/utils/amap-wx.130.js */ 38);
var _default = {
computed: _objectSpread({}, (0, _vuex.mapState)(['navHeight', 'statusbarHeight'])),
data: function data() {
@@ -249,7 +250,12 @@
id: null,
qrcodeImage: null,
showCancel: false,
- info: {}
+ info: {},
+ mapLat: 0,
+ mapLng: 0,
+ mapScale: 12,
+ markers: [],
+ polyline: []
};
},
onShow: function onShow() {
@@ -397,6 +403,9 @@
info: _this3.info,
delete: 0
});
+ if (_this3.info.type === 1 && _this3.info.status === 4) {
+ _this3.getRoutePlanning();
+ }
}
case 5:
case "end":
@@ -405,6 +414,146 @@
}
}, _callee3);
}))();
+ },
+ getRoutePlanning: function getRoutePlanning() {
+ var that = this;
+ var driverLat = this.info.driverLat;
+ var driverLng = this.info.driverLng;
+ var depositShopLat = this.info.depositShopLat;
+ var depositShopLng = this.info.depositShopLng;
+ console.log('getRoutePlanning called', driverLat, driverLng, depositShopLat, depositShopLng);
+ if (!driverLat || !driverLng || !depositShopLat || !depositShopLng) {
+ console.log('鍧愭爣缂哄け');
+ return;
+ }
+ this.mapLat = driverLat;
+ this.mapLng = driverLng;
+ var myAmapFun = new amapFile.AMapWX({
+ key: this.$gaodeMapKey
+ });
+ myAmapFun.getDrivingRoute({
+ origin: driverLng + ',' + driverLat,
+ destination: depositShopLng + ',' + depositShopLat,
+ success: function success(data) {
+ console.log('鑾峰彇璺緞瑙勫垝鎴愬姛 data:', data);
+ console.log('data keys:', Object.keys(data));
+ console.log('data.paths:', data.paths);
+ console.log('driverLng:', driverLng, 'driverLat:', driverLat, 'depositShopLng:', depositShopLng, 'depositShopLat:', depositShopLat);
+ var points = [];
+ if (data.paths && data.paths.length > 0) {
+ var path = data.paths[0];
+ console.log('path:', path);
+ console.log('path keys:', Object.keys(path));
+ var steps = path.steps || path.routs || path.roads || [];
+ if (steps.length === 0 && path.distance) {
+ steps = [path];
+ }
+ console.log('steps:', steps);
+ if (steps && steps.length > 0) {
+ for (var i = 0; i < steps.length; i++) {
+ var step = steps[i];
+ console.log('step:', step);
+ console.log('step keys:', step ? Object.keys(step) : 'null');
+ var polylineStr = step.polyline || step.Polyline || step.path || step.line || step.road || '';
+ console.log('polylineStr:', polylineStr);
+ if (!step || !polylineStr) continue;
+ var stepPoints = polylineStr.split(';');
+ if (!stepPoints || stepPoints.length === 0) continue;
+ for (var j = 0; j < stepPoints.length; j++) {
+ if (!stepPoints[j]) continue;
+ var point = stepPoints[j].split(',');
+ if (!point || point.length < 2) continue;
+ points.push({
+ latitude: parseFloat(point[1]),
+ longitude: parseFloat(point[0])
+ });
+ }
+ }
+ }
+ }
+ console.log('points:', points);
+ that.polyline = [{
+ points: points,
+ color: '#00c47c',
+ width: 10,
+ arrowLine: true
+ }];
+ console.log('polyline set:', that.polyline);
+ that.markers = [{
+ id: 1,
+ latitude: parseFloat(driverLat),
+ longitude: parseFloat(driverLng),
+ iconPath: '/static/icon/start.png',
+ width: 30,
+ height: 40,
+ anchor: {
+ x: 0.5,
+ y: 1
+ }
+ }, {
+ id: 2,
+ latitude: parseFloat(depositShopLat),
+ longitude: parseFloat(depositShopLng),
+ iconPath: '/static/icon/end.png',
+ width: 30,
+ height: 40,
+ anchor: {
+ x: 0.5,
+ y: 1
+ }
+ }, {
+ id: 3,
+ latitude: parseFloat(driverLat),
+ longitude: parseFloat(driverLng),
+ iconPath: '/static/icon/dizhi.png',
+ width: 24,
+ height: 30,
+ anchor: {
+ x: 0.5,
+ y: 0.5
+ },
+ callout: {
+ content: '棰勮鍒板簵鏃堕棿\n' + (that.info.expectedDepositTime || ''),
+ color: '#222222',
+ fontSize: 14,
+ borderRadius: 4,
+ padding: 8,
+ display: 'ALWAYS',
+ bgColor: 'rgba(255, 255, 255, 0.95)'
+ }
+ }];
+ if (points.length > 0) {
+ that.mapLat = points[Math.floor(points.length / 2)].latitude;
+ that.mapLng = points[Math.floor(points.length / 2)].longitude;
+ }
+ },
+ fail: function fail(err) {
+ console.error('鑾峰彇璺緞瑙勫垝澶辫触', err);
+ that.markers = [{
+ id: 1,
+ latitude: parseFloat(driverLat),
+ longitude: parseFloat(driverLng),
+ iconPath: '/static/icon/start.png',
+ width: 30,
+ height: 40,
+ anchor: {
+ x: 0.5,
+ y: 1
+ }
+ }, {
+ id: 2,
+ latitude: parseFloat(depositShopLat),
+ longitude: parseFloat(depositShopLng),
+ iconPath: '/static/icon/end.png',
+ width: 30,
+ height: 40,
+ anchor: {
+ x: 0.5,
+ y: 1
+ }
+ }];
+ }
+ });
}
}
};
--
Gitblit v1.9.3