|
|
@ -18,17 +18,17 @@ Page({ |
|
|
* 生命周期函数--监听页面加载 |
|
|
* 生命周期函数--监听页面加载 |
|
|
*/ |
|
|
*/ |
|
|
onLoad: function (options) { |
|
|
onLoad: function (options) { |
|
|
let weburl = 'https://m.cloud.sz-trip.com/aiPlay' |
|
|
let weburl = 'https://test.m.cloud.sz-trip.com/aiPlay?noShowHeaderBack=true' |
|
|
let token = wx.getStorageSync('jstrip_token') |
|
|
let token = wx.getStorageSync('jstrip_token') |
|
|
if (token) { |
|
|
if (token) { |
|
|
weburl += '?token='+token |
|
|
weburl += '&token='+token |
|
|
} |
|
|
} |
|
|
let _this = this |
|
|
let _this = this |
|
|
try { |
|
|
try { |
|
|
let lonAndLat = (wx.getStorageSync('lonAndLat')) |
|
|
let lonAndLat = (wx.getStorageSync('lonAndLat')) |
|
|
if (lonAndLat && JSON.parse(lonAndLat)) { |
|
|
if (lonAndLat && JSON.parse(lonAndLat)) { |
|
|
lonAndLat = JSON.parse(lonAndLat) |
|
|
lonAndLat = JSON.parse(lonAndLat) |
|
|
if (Object.keys(webParam).length>0 || token) { |
|
|
if (token) { |
|
|
weburl+=`&lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` |
|
|
weburl+=`&lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` |
|
|
} else { |
|
|
} else { |
|
|
weburl+=`?lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` |
|
|
weburl+=`?lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` |
|
|
@ -41,7 +41,7 @@ Page({ |
|
|
success: (res) => { |
|
|
success: (res) => { |
|
|
let lonAndLat = JSON.stringify({lat: res.latitude,lon: res.longitude}) |
|
|
let lonAndLat = JSON.stringify({lat: res.latitude,lon: res.longitude}) |
|
|
wx.setStorageSync('lonAndLat', lonAndLat) |
|
|
wx.setStorageSync('lonAndLat', lonAndLat) |
|
|
if (Object.keys(webParam).length>0 || token) { |
|
|
if (token) { |
|
|
weburl+=`&lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` |
|
|
weburl+=`&lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` |
|
|
} else { |
|
|
} else { |
|
|
weburl+=`?lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` |
|
|
weburl+=`?lon=${lonAndLat.lon}&lat=${lonAndLat.lat}` |
|
|
|