| | |
| | | // const apiHost = 'http://39.108.148.228:80/user'; |
| | | // const apiHost = 'https://okyueche.com:443/user' |
| | | // const apiHost = 'http://120.220.4.138:9591/user' |
| | | // const apiHost = 'https://xn95128.cn/user' |
| | | const apiHost = 'https://xn95128.cn/user' |
| | | // const apiHost = 'http://192.168.110.34:7777/user' |
| | | const apiHost = 'http://221.182.45.100:7777/user' |
| | | // const apiHost = 'http://221.182.45.100:7777/user' |
| | | |
| | | |
| | | |
| | |
| | | initSocket() { |
| | | let that = this; |
| | | that.globalData.localSocket = wx.connectSocket({ |
| | | // url: "ws://192.168.110.34:7777/websocket", |
| | | url: "ws://221.182.45.100:9978", |
| | | url: "ws://192.168.110.34:9978", |
| | | // url: "ws://221.182.45.100:9978", |
| | | |
| | | // url: "ws://221.182.45.100:900", |
| | | // url: "wss://xn95128.cn/websocket", |
| | | url: "wss://xn95128.cn:9978", |
| | | |
| | | }); |
| | | console.log('shuju//////////////////',this.globalData.localSocket); |
| | |
| | | userLatitude:wx.getStorageSync('latitude')||'', |
| | | userLongitude:wx.getStorageSync('longitude')||'', |
| | | // Url:'http://192.168.110.34:7777/user', |
| | | Url:'http://221.182.45.100:7777/user', |
| | | // Url:'http://221.182.45.100:7777/user', |
| | | // Url:'http://39.108.148.228:80/user', |
| | | // Url:'https://okyueche.com:443/user', |
| | | // Url:'http://120.220.4.138:9591/user', |
| | | // Url:'https://xn95128.cn/user', |
| | | Url:'https://xn95128.cn/user', |
| | | |
| | | localSocket: {}, |
| | | callback: function() {}, |
| | |
| | | showPop:false, |
| | | couponId:"", |
| | | payStyle: [ |
| | | { name: "充值余额", checked: false ,money:'0元'}, |
| | | // { name: "充值余额", checked: false ,money:'0元'}, |
| | | { name: "微信支付", checked: true }, |
| | | ], |
| | | |
| | |
| | | // let newmoney = res.data.data.balance |
| | | this.setData({ |
| | | queryBalance:res.data.data, |
| | | [money]:newmoney |
| | | // [money]:newmoney |
| | | }) |
| | | }else{ |
| | | app.showToastSuccess(res.data.msg,null,"none",1500) |
| | |
| | | let lat = self.location.lat |
| | | let lng = self.location.lng |
| | | let data = this.data |
| | | wx.request({ |
| | | url: `https://api.map.baidu.com/geoconv/v2/?coords=${lng},${lat}&model=5&ak=3mHKIXMArjgIkgADzOlTYp4XssNSNkwr`, |
| | | success: (resp) => { |
| | | prevPage.setData({ |
| | | startLat: lat, |
| | | startLon: lng, |
| | | startLat: resp.data.result[0].y, |
| | | startLon: resp.data.result[0].x, |
| | | cityNameStart: self.name, |
| | | changeStartName: self.name, |
| | | showFrist: false, |
| | | formLocation: false |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | if (this.data.where !== "advoad") { |
| | | if (this.data.where == "") { |
| | | console.log("11", lat, lng) |
| | | console.log("11000000000000000000", lat, lng) |
| | | prevPage.getLocal(lat, lng) |
| | | } |
| | | prevPage.openCity(self.adcode) |
| | |
| | | let index = e.currentTarget.dataset.index |
| | | var historyStart = wx.getStorageSync('historyStart') |
| | | let data = this.data |
| | | |
| | | if (data.advoadLocation) { |
| | | if (data.advoadLocation == 'startLocation') { |
| | | this.advoadLocationAddress('startLocation', self) |
| | |
| | | let prevPage = pages[pages.length - 2]; |
| | | let lat = self.location.lat |
| | | let lng = self.location.lng |
| | | wx.request({ |
| | | url: `https://api.map.baidu.com/geoconv/v2/?coords=${lng},${lat}&model=5&ak=3mHKIXMArjgIkgADzOlTYp4XssNSNkwr`, |
| | | success: (resp) => { |
| | | lat =resp.data.result[0].y |
| | | lng =resp.data.result[0].x |
| | | } |
| | | }) |
| | | prevPage.setData({ |
| | | startLat: lat, |
| | | startLon: lng, |
| | |
| | | showFrist: false, |
| | | formLocation: false |
| | | }) |
| | | console.log('22222222222222',this.data); |
| | | if (this.data.where !== "advoad") { |
| | | if (this.data.where == "") { |
| | | console.log("11") |
| | |
| | | } |
| | | prevPage.openCity(self.adcode) |
| | | console.log("1") |
| | | wx.setStorageSync('latitude', lat) |
| | | wx.setStorageSync('longitude', lng) |
| | | // wx.setStorageSync('latitude', lat) |
| | | // wx.setStorageSync('longitude', lng) |
| | | wx.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | |
| | | longitude: this.transformFromGCJToBaidu(res.latitude, res.longitude).longitude, |
| | | }) |
| | | that.getLocal(res.latitude, res.longitude) |
| | | console.log('2222222222222222222222222222222222'); |
| | | that.getCarNum(res.latitude, res.longitude, that.data.busId) |
| | | } |
| | | }) |
| | |
| | | mapCtx.moveToLocation({ |
| | | success: (res) => { |
| | | console.log('adsadsad', res); |
| | | this.getLocal(wx.getStorageSync('latitude'), wx.getStorageSync('longitude')) |
| | | // this.getLocal(wx.getStorageSync('latitude'), wx.getStorageSync('longitude'),true) |
| | | this.getLocationApi() |
| | | |
| | | this.setData({ |
| | | newCityName: "", |
| | |
| | | // longitude: res.originalData.result.location.lng, |
| | | adcode: res.originalData.result.addressComponent.adcode, |
| | | cityNameStart: res.originalData.result.formatted_address, |
| | | changeStartName:res.originalData.result.formatted_address, |
| | | district: res.originalData.result.addressComponent.district, |
| | | province: res.originalData.result.addressComponent.province, |
| | | formatted_address: res.originalData.result.formatted_address |
| | |
| | | latitude: res.latitude, |
| | | longitude: res.longitude, |
| | | }) |
| | | that.getLocal(res.latitude, res.longitude) |
| | | that.getLocal(res.latitude, res.longitude, true) |
| | | that.getCarNum(res.latitude, res.longitude, that.data.busId) |
| | | } |
| | | }) |
| | |
| | | } |
| | | }, |
| | | // 获取当前地理位置 |
| | | getLocal: function (latitude, longitude) { |
| | | getLocal: function (latitude, longitude, move) { |
| | | var bmap = new BaiduMap.BMapWX({ |
| | | ak: 'fi3HGJjW153NCNsaTb9FekxeX1Lj3auo' // 必填,您的key |
| | | }) |
| | | let that = this; |
| | | wx.request({ |
| | | url: `https://api.map.baidu.com/geoconv/v2/?coords=${longitude},${latitude}&model=1&ak=3mHKIXMArjgIkgADzOlTYp4XssNSNkwr`, |
| | | success: (res) => { |
| | | url: `https://api.map.baidu.com/geoconv/v2/?coords=${longitude},${latitude}&model=5&ak=3mHKIXMArjgIkgADzOlTYp4XssNSNkwr`, |
| | | success: (resp) => { |
| | | console.log('获取当前地理位置 获取当前地理位置', resp, 'longitude', longitude, 'latitude', latitude, 'move move move', move) |
| | | bmap.regeocoding({ |
| | | location: res.data.result[0].y + ',' + res.data.result[0].x, |
| | | success: function (res) { |
| | | location:move?(latitude+ ',' +longitude):(resp.data.result[0].y + ',' + resp.data.result[0].x), |
| | | // location:latitude+ ',' +longitude, |
| | | // location: '30.657469'+','+'104.06669', |
| | | success: (res)=> { |
| | | //这里的res参数里有具体的城市数据 |
| | | console.log('这里的res参数里有具体的城市数据', res) |
| | | var name = res.originalData.result.addressComponent |
| | | that.setData({ |
| | | changeStartName: res.originalData.result.formatted_address, |
| | | startLat: '', |
| | | startLon: '', |
| | | startLat: move?'':resp.data.result[0].y, |
| | | startLon: move?'':resp.data.result[0].x, |
| | | cityNameStart: res.originalData.result.formatted_address, |
| | | adcode: res.originalData.result.addressComponent.adcode, |
| | | latitude, |
| | | longitude |
| | | latitude:move?latitude:resp.data.result[0].y, |
| | | longitude:move?longitude:resp.data.result[0].x |
| | | // latitude:'30.657469', |
| | | // longitude:"104.06669" |
| | | }) |
| | | that.queryBusiness(name.city, name.district, name.province) |
| | | that.openCity(res.originalData.result.addressComponent.adcode) |
| | |
| | | let startLon = that.data.startLon || that.data.longitude |
| | | wx.request({ |
| | | url: `https://api.map.baidu.com/geoconv/v2/?coords=${startLon},${startLat};${that.data.nextLongitude},${that.data.nextLatitude}&model=1&ak=3mHKIXMArjgIkgADzOlTYp4XssNSNkwr`, |
| | | success: (res) => { |
| | | success: (resp) => { |
| | | console.log('that.data.nextLongitud,that.data.nextLongitudee', that.data.nextLongitude) |
| | | // wx.request({ |
| | | // url: `https://api.map.baidu.com/directionlite/v1/driving?origin=${resp.data.result[0].y},${resp.data.result[0].x}&destination=${that.data.nextLatitude},${that.data.nextLongitude}&ak=WQhfsluNzEeUHUxoH4jc4JiCQOXw4Mnx&ret_coordtype=gcj02`, |
| | | // success: (res) => { |
| | | // var coors = res.data.result.routes[0].steps |
| | | // var polyline = []; |
| | | // coors.forEach(function (step, index) { |
| | | // // if (index == 0) { |
| | | // // polyline.push({ |
| | | // // latitude: step.end_location.lat, |
| | | // // longitude: step.end_location.lng |
| | | // // }); |
| | | // // } else { |
| | | // // polyline.push({ |
| | | // // latitude: step.start_location.lat, |
| | | // // longitude: step.start_location.lng |
| | | // // }); |
| | | // // } |
| | | // // return |
| | | // let list = step.path.split(';') |
| | | // if (index == 0) { |
| | | // polyline.push({ |
| | | // latitude: step.start_location.lat, |
| | | // longitude: step.start_location.lng |
| | | // }); |
| | | // } |
| | | // list.forEach(function (item, ind) { |
| | | // if (item) { |
| | | // let lng = item.split(',')[0] |
| | | // let lat = item.split(',')[1] |
| | | // polyline.push({ |
| | | // latitude: lat, |
| | | // longitude: lng |
| | | // }); |
| | | // } |
| | | // }) |
| | | // // } |
| | | // if (coors.length == index + 1) { |
| | | // unit.post(app.globalData.Url + '/base/taxi/queryExpectedTime', { |
| | | // // slat:that.data.latitude, |
| | | // // slon:that.data.longitude, |
| | | // slat: that.data.startLat || that.data.latitude, |
| | | // slon: that.data.startLon || that.data.longitude, |
| | | // elat: that.data.nextLatitude, |
| | | // elon: that.data.nextLongitude |
| | | // }) |
| | | // .then((res) => { |
| | | // if (res.data.code == 200) { |
| | | // // let markers1 = that.data.markers[0] |
| | | // // let markers2 = |
| | | // // that.data.markers[1]+ that.data.markers[1][callout] |
| | | |
| | | // // this.setData({ |
| | | // // markers:[markers1,markers2] |
| | | // // }) |
| | | // console.log(list, '2222222222222222222222'); |
| | | |
| | | // var markers = [{ |
| | | // iconPath: "../../img/start_icon.png", |
| | | // id: 1, |
| | | // latitude: that.data.startLat || that.data.latitude, |
| | | // longitude: that.data.startLon || that.data.longitude, |
| | | // width: 26, |
| | | // height: 34, |
| | | // }, |
| | | // { |
| | | // iconPath: "../../img/end_icon.png", |
| | | // id: 2, |
| | | // latitude: list[list.length - 2].split(',')[1], |
| | | // longitude: list[list.length - 2].split(',')[0], |
| | | // width: 26, |
| | | // height: 34, |
| | | // callout: { |
| | | // content: '大约行驶' + res.data.data.minute + '分钟', |
| | | // color: '#333333', |
| | | // fontSize: 13, |
| | | // borderRadius: 1, |
| | | // display: 'ALWAYS', |
| | | // borderRadius: 13, |
| | | // padding: 10, |
| | | // textAlign: 'center' |
| | | // } |
| | | // }, |
| | | // ] |
| | | // that.setData({ |
| | | // markers, |
| | | // points |
| | | // }) |
| | | // } |
| | | // }) |
| | | // } |
| | | // }); |
| | | // that.setData({ |
| | | // polyline: [{ |
| | | // points: polyline, |
| | | // arrowLine: true, |
| | | // color: '#00C47A', |
| | | // width: 4, |
| | | // borderWidth: 1, |
| | | // borderColor: '#00C47A' |
| | | // }], |
| | | // }); |
| | | |
| | | // } |
| | | // }) |
| | | // return |
| | | unit.post(app.globalData.Url + '/base/loadLine', { |
| | | startLat: res.data.result[0].y, |
| | | startLon: res.data.result[0].x, |
| | | nextLatitude: res.data.result[1]?.y, |
| | | nextLongitude: res.data.result[1]?.x, |
| | | startLat: resp.data.result[0].y, |
| | | startLon: resp.data.result[0].x, |
| | | nextLatitude: that.data.nextLatitude, |
| | | nextLongitude: that.data.nextLongitude, |
| | | }) |
| | | .then((res) => { |
| | | var coors = res.data.data |
| | | var polyline = []; |
| | | coors.forEach(function (step, index) { |
| | | // if (index == 0) { |
| | | // polyline.push({ |
| | | // latitude: step.end_location.lat, |
| | | // longitude: step.end_location.lng |
| | | // }); |
| | | // } else { |
| | | // polyline.push({ |
| | | // latitude: step.start_location.lat, |
| | | // longitude: step.start_location.lng |
| | | // }); |
| | | // } |
| | | // return |
| | | let list = step.path.split(';') |
| | | if (index == 0) { |
| | | polyline.push({ |
| | | latitude: step.start_location.lat, |
| | | longitude: step.start_location.lng |
| | | }); |
| | | } else { |
| | | polyline.push({ |
| | | latitude: step.end_location.lat, |
| | | longitude: step.end_location.lng |
| | | }); |
| | | } |
| | | list.forEach(function (item, ind) { |
| | | if (item) { |
| | | let lng = item.split(',')[0] |
| | | let lat = item.split(',')[1] |
| | | polyline.push({ |
| | | latitude: lat, |
| | | longitude: lng |
| | | }); |
| | | |
| | | if (coors.length == index + 1 && list.length==ind+1) { |
| | | unit.post(app.globalData.Url + '/base/taxi/queryExpectedTime', { |
| | | // slat:that.data.latitude, |
| | | // slon:that.data.longitude, |
| | | slat: that.data.startLat || that.data.latitude, |
| | | slon: that.data.startLon || that.data.longitude, |
| | | elat: that.data.nextLatitude, |
| | | elon: that.data.nextLongitude |
| | | }) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | // let markers1 = that.data.markers[0] |
| | | // let markers2 = |
| | | // that.data.markers[1]+ that.data.markers[1][callout] |
| | | |
| | | // this.setData({ |
| | | // markers:[markers1,markers2] |
| | | // }) |
| | | console.log(list, '2222222222222222222222'); |
| | | |
| | | var markers = [{ |
| | | iconPath: "../../img/start_icon.png", |
| | | id: 1, |
| | | latitude: that.data.startLat || that.data.latitude, |
| | | longitude: that.data.startLon || that.data.longitude, |
| | | width: 26, |
| | | height: 34, |
| | | }, |
| | | { |
| | | iconPath: "../../img/end_icon.png", |
| | | id: 2, |
| | | latitude: lat, |
| | | longitude: lng, |
| | | width: 26, |
| | | height: 34, |
| | | callout: { |
| | | content: '大约行驶' + res.data.data.minute + '分钟', |
| | | color: '#333333', |
| | | fontSize: 13, |
| | | borderRadius: 1, |
| | | display: 'ALWAYS', |
| | | borderRadius: 13, |
| | | padding: 10, |
| | | textAlign: 'center' |
| | | } |
| | | }, |
| | | ] |
| | | that.setData({ |
| | | markers, |
| | | points |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | // } |
| | | |
| | | }); |
| | | that.setData({ |
| | |
| | | // app.showToastSuccess('路线规划失败', null, "none", 1500) |
| | | // } |
| | | // }) |
| | | |
| | | |
| | | |
| | | |
| | | // wx.request({ |
| | | // url: `https://api.map.baidu.com/directionlite/v1/driving?origin=${startLat},${startLon}&destination=${ that.data.nextLatitude},${that.data.nextLongitude}&ak=WQhfsluNzEeUHUxoH4jc4JiCQOXw4Mnx`, |
| | | // success: function (res) { |
| | |
| | | // app.showToastSuccess('路线规划失败', null, "none", 1500) |
| | | // } |
| | | // }) |
| | | unit.post(app.globalData.Url + '/base/taxi/queryExpectedTime', { |
| | | // slat:that.data.latitude, |
| | | // slon:that.data.longitude, |
| | | slat: that.data.startLat || that.data.latitude, |
| | | slon: that.data.startLon || that.data.longitude, |
| | | elat: that.data.nextLatitude, |
| | | elon: that.data.nextLongitude |
| | | }) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | // let markers1 = that.data.markers[0] |
| | | // let markers2 = |
| | | // that.data.markers[1]+ that.data.markers[1][callout] |
| | | |
| | | // this.setData({ |
| | | // markers:[markers1,markers2] |
| | | // }) |
| | | |
| | | var markers = [{ |
| | | iconPath: "../../img/start_icon.png", |
| | | id: 1, |
| | | latitude: that.data.startLat || that.data.latitude, |
| | | longitude: that.data.startLon || that.data.longitude, |
| | | width: 26, |
| | | height: 34, |
| | | }, |
| | | { |
| | | iconPath: "../../img/end_icon.png", |
| | | id: 2, |
| | | latitude: that.data.nextLatitude, |
| | | longitude: that.data.nextLongitude, |
| | | width: 26, |
| | | height: 34, |
| | | callout: { |
| | | content: '大约行驶' + res.data.data.minute + '分钟', |
| | | color: '#333333', |
| | | fontSize: 13, |
| | | borderRadius: 1, |
| | | display: 'ALWAYS', |
| | | borderRadius: 13, |
| | | padding: 10, |
| | | textAlign: 'center' |
| | | } |
| | | }, |
| | | ] |
| | | that.setData({ |
| | | markers, |
| | | points |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | |
| | | // var polyline =[{ |
| | |
| | | pageNum: 1, |
| | | Data: [], |
| | | showPayVan: false, //支付弹窗 |
| | | payStyle: [{ |
| | | payStyle: [ |
| | | { |
| | | name: "充值余额", |
| | | checked: false, |
| | | money: '0元' |
| | |
| | | couponId: '', |
| | | isIncok: false, |
| | | showIpay: false, |
| | | payStyle: [{ |
| | | name: "充值余额", |
| | | checked: false, |
| | | money: '0元' |
| | | }, |
| | | payStyle: [ |
| | | // { |
| | | // name: "充值余额", |
| | | // checked: false, |
| | | // money: '0元' |
| | | // }, |
| | | { |
| | | name: "微信支付", |
| | | checked: true |
| | |
| | | let newmoney = "(" + res.data.data.balance + '可用' + ")" |
| | | this.setData({ |
| | | queryBalance: res.data.data, |
| | | [money]: newmoney |
| | | // [money]: newmoney //不要余额支付 |
| | | }) |
| | | } else { |
| | | |
| | |
| | | {
|
| | | "appid": "wx4d36488fa2cd2718",
|
| | | "compileType": "miniprogram",
|
| | | "libVersion": "3.7.2",
|
| | | "packOptions": {
|
| | | "ignore": [],
|
| | | "include": []
|
| | | },
|
| | | "setting": {
|
| | | "coverView": true,
|
| | | "es6": true,
|
| | |
| | | "disablePlugins": [],
|
| | | "outputPath": ""
|
| | | },
|
| | | "condition": false
|
| | | "condition": false,
|
| | | "ignoreUploadUnusedFiles": true
|
| | | },
|
| | | "condition": {},
|
| | | "editorSetting": {
|
| | | "tabIndent": "insertSpaces",
|
| | | "tabSize": 2
|
| | | }
|
| | | },
|
| | | "libVersion": "3.7.2",
|
| | | "packOptions": {
|
| | | "ignore": [],
|
| | | "include": []
|
| | | },
|
| | | "appid": "wx4d36488fa2cd2718"
|
| | | } |
| | |
| | | "query": "", |
| | | "launchMode": "default", |
| | | "scene": null |
| | | }, |
| | | { |
| | | "name": "", |
| | | "pathName": "pages/waiting/waiting", |
| | | "query": "startAddress=%E5%9B%9B%E5%B7%9D%E7%9C%81%E6%88%90%E9%83%BD%E5%B8%82%E6%AD%A6%E4%BE%AF%E5%8C%BA%E6%AD%A6%E4%BE%AF%E7%A5%A0%E5%A4%A7%E8%A1%97264&startLat=30.64242&startLon=104.04311&endAddress=%E5%A4%A9%E5%BA%9C%E6%96%B0%E8%B0%B7-10%E5%8F%B7%E6%A5%BC&endLat=30.58595808489&endLon=104.05665899626&time=2025-02-05%2014%3A57%3A26&orderType=2&onekey=0", |
| | | "launchMode": "default", |
| | | "scene": null |
| | | }, |
| | | { |
| | | "name": "", |
| | | "pathName": "pages/carDown/carDown", |
| | | "query": "id=4338&orderType=2&onekey=0", |
| | | "launchMode": "default", |
| | | "scene": null |
| | | } |
| | | ] |
| | | } |
| | |
| | | const ajax = new Ajax({ |
| | | // baseURL: 'http://192.168.0.49:81/api', |
| | | // baseURL:"http://192.168.110.34:7777/user" |
| | | baseURL:"http://221.182.45.100:7777/user" |
| | | // baseURL:"http://221.182.45.100:7777/user" |
| | | |
| | | // baseURL:"http://39.108.148.228:80/user" |
| | | // baseURL: 'http://120.220.4.138:9591/user', |
| | | // baseURL: 'https://xn95128.cn/user', |
| | | baseURL: 'https://xn95128.cn/user', |
| | | |
| | | }) |
| | | |