>1.主订单数据 $order = ImsCjdcOrderMain::getOrderData($this->order_id); if ($order) { $search = array(" ", " ", "\n", "\r", "\t"); $replace = array("", "", "", "", ""); $order['address'] = str_replace($search, $replace, $order['address']); //>>2.获取子订单 $result = ImsCjdcOrder::getOrdersData($order['global_order_id'], $order['id']); $orders = json_encode($result['orders']); $showRefund = json_encode($result['show_refund']); $path = "order?" . $this->last_url; Admin::script( << { that = this; $.ajax({ url: "order_goods_refund", type: "get", contentType: "text/html; charset=utf-8", dataType: "json", data: { user_id:that.user_id, note:that.total_refund_note, global_order_id:that.global_order_id, order_child_id:that.order_child_id, order_goods_id:that.order_goods_id }, success: function (res) { if (res.code==0){ that.\$message({ message: '退款成功', type: 'success' }) that.show_refund[that.order_goods_id].show_refund_2=false that.show_refund[that.order_goods_id].show_refund_3=true }else { that.\$message.error('退款失败'); } that.dialogFormVisible = false; }, error: function (xhr, err) { console.log("错误", err) } }); }).catch(() => { }); }, showMap() { this.is_show=true; if (!this.show_map){ this.show_map = true; this.close_map =false; this.initMap() } }, closeMap() { this.is_show=false; this.show_map = false; this.close_map =true; }, change2D() { this.map.setViewMode('2D'); }, change3D() { this.map.setViewMode('3D'); this.map.setPitch(70); }, initMap() { var center = new TMap.LatLng(this.market_lat, this.market_lng); //初始化地图 this.map = new TMap.Map("container", {rotation: 20,//设置地图旋转角度 pitch:30, //设置俯仰角度(0~45) zoom:14,//设置地图缩放级别 center: center//设置地图中心点坐标 }); that = this; $.ajax({ url: "map_route", type: "get", contentType: "text/html; charset=utf-8", dataType: "json", data: { m_lat:that.market_lat, m_lng:that.market_lng, u_lat:that.user_lat, u_lng:that.user_lng, type:"bicycling" }, success: function (res) { if (res.status==0){ that.cb(res); } }, error: function (xhr, err) { console.log("错误", err) } }); }, //定义请求回调函数,在此拿到计算得到的路线,并进行绘制 cb(ret) { var coords = ret.result.routes[0].polyline, pl = []; //坐标解压(返回的点串坐标,通过前向差分进行压缩) var kr = 1000000; for (var i = 2; i < coords.length; i++) { coords[i] = Number(coords[i - 2]) + Number(coords[i]) / kr; } //将解压后的坐标放入点串数组pl中 for (var i = 0; i < coords.length; i += 2) { pl.push(new TMap.LatLng(coords[i], coords[i+1])); } this.display_polyline(pl)//显示路线 //标记起终点marker var marker = new TMap.MultiMarker({ id: 'marker-layer', map: this.map, styles: { "start": new TMap.MarkerStyle({ "width": 25, "height": 35, "anchor": { x: 16, y: 32 }, "src": 'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/start.png' }), "end": new TMap.MarkerStyle({ "width": 25, "height": 35, "anchor": { x: 16, y: 32 }, "src": 'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/end.png' }), "marker": new TMap.MarkerStyle({ "width": 45, "height": 52, "anchor": { x: 16, y: 32 }, "src": "../uploads/map/561.png" }) }, geometries: [{ "id": 'start', "styleId": 'start', "position": new TMap.LatLng(that.market_lat,that.market_lng) }, { "id": 'end', "styleId": 'end', "position": new TMap.LatLng(that.user_lat,that.user_lng) },{ //点标注数据数组 "id": "horseman", "styleId": "marker", "position": new TMap.LatLng(22.805566,108.412079), "properties": { "title": "marker" } }] }); }, display_polyline(pl){ //创建 MultiPolyline显示折线 var polylineLayer = new TMap.MultiPolyline({ id: 'polyline-layer', //图层唯一标识 map: this.map,//绘制到目标地图 //折线样式定义 styles: { 'style_blue': new TMap.PolylineStyle({ 'color': '#3777FF', //线填充色 'width': 8, //折线宽度 'borderWidth': 5, //边线宽度 'borderColor': '#FFF', //边线颜色 'lineCap': 'round', //线端头方式 }) }, //折线数据定义 geometries: [ { 'id': 'pl_1',//折线唯一标识,删除时使用 'styleId': 'style_blue',//绑定样式名 'paths': pl } ] }); }, mounted: function () { } } }); JS ); } return view('orderdetail'); } }