chenkainan 5 months ago
parent
commit
5b39144416
  1. 8
      manifest.json
  2. 2
      pages/index/index.vue
  3. 60
      subPackages/webPage/webPage.vue

8
manifest.json

@ -43,7 +43,13 @@
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {}
"sdkConfigs" : {
"geolocation" : {
"system" : {
"__platform__" : [ "ios", "android" ]
}
}
}
}
},
/* */

2
pages/index/index.vue

@ -173,7 +173,7 @@
{
title: '电影购票',
img: 'https://static.ticket.sz-trip.com/changshu/images/index/dygp.png',
// url: 'https://m.cloud.sz-trip.com/MoviesChangShu',
url: 'https://m.cloud.sz-trip.com/MoviesChangShu',
},
{
title: '场馆预约',

60
subPackages/webPage/webPage.vue

@ -58,10 +58,34 @@ export default {
.map(([key, value]) => `${(key)}=${(value)}`)
.join('&');
const fullUrl = `${baseUrl}?${queryString}`;
console.log(fullUrl);
let location = uni.getStorageSync('location')
if (location) {
queryString+=`&lon=${location.lon}&lat=${location.lat}`
let fullUrl = `${baseUrl}?${queryString}`;
console.log(fullUrl);
this.url = fullUrl
} else {
uni.getLocation({
success: data => {
uni.setStorageSync('location', {
lat: data.latitude,
lon: data.longitude
});
queryString+=`&lon=${data.longitude}&lat=${data.latitude}`
let fullUrl = `${baseUrl}?${queryString}`;
console.log(fullUrl);
this.url = fullUrl
},
fail: res=> {
let fullUrl = `${baseUrl}?${queryString}`;
console.log(fullUrl, '获取定位失败', res);
this.url = fullUrl
}
})
}
this.url = fullUrl
}
})
}
@ -79,10 +103,34 @@ export default {
let queryString = Object.entries(param).filter(v=>v[0]!='tempUrl')
.map(([key, value]) => `${(key)}=${(value)}`)
.join('&');
let location = uni.getStorageSync('location')
if (location) {
queryString+=`&lon=${location.lon}&lat=${location.lat}`
let fullUrl = `${baseUrl}?${queryString}`;
console.log(fullUrl);
this.url = fullUrl
} else {
uni.getLocation({
success: data => {
uni.setStorageSync('location', {
lat: data.latitude,
lon: data.longitude
});
queryString+=`&lon=${data.longitude}&lat=${data.latitude}`
let fullUrl = `${baseUrl}?${queryString}`;
console.log(fullUrl);
this.url = fullUrl
},
fail: res=> {
let fullUrl = `${baseUrl}?${queryString}`;
console.log(fullUrl, '获取定位失败', res);
this.url = fullUrl
}
})
}
const fullUrl = `${baseUrl}?${queryString}`;
console.log(fullUrl);
this.url = fullUrl
}
}).finally(()=>{
this.saveUrl = url

Loading…
Cancel
Save