|
@@ -84,9 +84,9 @@
|
|
<!-- <view>shareID:{{shareID}}</view> -->
|
|
<!-- <view>shareID:{{shareID}}</view> -->
|
|
<!-- 优惠券中心 -->
|
|
<!-- 优惠券中心 -->
|
|
|
|
|
|
- <view class="quanImg">
|
|
|
|
|
|
+ <view class="quanImg" v-if="bannerArr.length>0">
|
|
<swiper class="swiper" :circular="true" :indicator-dots="true" indicator-active-color="#FF4F00"
|
|
<swiper class="swiper" :circular="true" :indicator-dots="true" indicator-active-color="#FF4F00"
|
|
- v-if="bannerArr.length>0">
|
|
|
|
|
|
+ >
|
|
<swiper-item v-for="(item,index) in bannerArr">
|
|
<swiper-item v-for="(item,index) in bannerArr">
|
|
|
|
|
|
<image :src="item" mode="" class="swpImg" @click="goImg(index)"></image>
|
|
<image :src="item" mode="" class="swpImg" @click="goImg(index)"></image>
|
|
@@ -281,7 +281,7 @@
|
|
|
|
|
|
const that = this
|
|
const that = this
|
|
uni.getLocation({
|
|
uni.getLocation({
|
|
- type: 'gcj02',
|
|
|
|
|
|
+ type: 'wgs84',
|
|
success: function(res) {
|
|
success: function(res) {
|
|
console.log('定位', res)
|
|
console.log('定位', res)
|
|
that.locationCity.lng = res.longitude
|
|
that.locationCity.lng = res.longitude
|
|
@@ -301,9 +301,9 @@
|
|
// 根据经纬度 逆城市地理编码 获取城市信息
|
|
// 根据经纬度 逆城市地理编码 获取城市信息
|
|
var location = this.locationCity.lng + ',' + this.locationCity.lat
|
|
var location = this.locationCity.lng + ',' + this.locationCity.lat
|
|
uni.request({
|
|
uni.request({
|
|
- url: 'https://restapi.amap.com/v3/place/around',
|
|
|
|
|
|
+ url: 'https://restapi.amap.com/v3/geocode/regeo',
|
|
data: {
|
|
data: {
|
|
- key: '064b6a4a8ade55656edcde2f528876de',
|
|
|
|
|
|
+ key: '389a059efa3f499d9145eb84b1c3248d',
|
|
location: location,
|
|
location: location,
|
|
types: "190000",
|
|
types: "190000",
|
|
extensions: "all",
|
|
extensions: "all",
|
|
@@ -312,23 +312,30 @@
|
|
dataType: "json",
|
|
dataType: "json",
|
|
success: (res) => {
|
|
success: (res) => {
|
|
console.log('定位城市', res);
|
|
console.log('定位城市', res);
|
|
- let cityname = res.data.pois[0].cityname;
|
|
|
|
- var cityCode = res.data.pois[0].adcode
|
|
|
|
- cityCode = cityCode.slice(0, -2)
|
|
|
|
- cityCode = cityCode + '00'
|
|
|
|
- this.locationCity.cityName = cityname
|
|
|
|
- this.locationCity.cityCode = cityCode
|
|
|
|
-
|
|
|
|
- uni.setStorage({
|
|
|
|
- key: 'locationCity',
|
|
|
|
- data: this.locationCity,
|
|
|
|
- success: function() {
|
|
|
|
- console.log('定位城市,保存成功');
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- this.cityName = this.locationCity.cityName
|
|
|
|
- this.cityCode = this.locationCity.cityCode
|
|
|
|
|
|
+ if(res.data.regeocode){
|
|
|
|
+ //console.log("城市名称"+res.data.pois[0].cityname)
|
|
|
|
+ let cityname = res.data.regeocode.addressComponent.city;
|
|
|
|
+ var cityCode = res.data.regeocode.addressComponent.adcode
|
|
|
|
+ cityCode = cityCode.slice(0, -2)
|
|
|
|
+ cityCode = cityCode + '00'
|
|
|
|
+ this.locationCity.cityName = cityname
|
|
|
|
+ this.locationCity.cityCode = cityCode
|
|
|
|
+
|
|
|
|
+ uni.setStorage({
|
|
|
|
+ key: 'locationCity',
|
|
|
|
+ data: this.locationCity,
|
|
|
|
+ success: function() {
|
|
|
|
+ console.log('定位城市,保存成功');
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ this.cityName = this.locationCity.cityName
|
|
|
|
+ this.cityCode = this.locationCity.cityCode
|
|
|
|
+ }else{
|
|
|
|
+ this.cityName=''
|
|
|
|
+ this.cityCode=''
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -386,9 +393,13 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
showCity() {
|
|
showCity() {
|
|
|
|
+ if (!this.uid) {
|
|
|
|
+ this.goLonIn();
|
|
|
|
+ }
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '../chooseCity/chooseCity'
|
|
url: '../chooseCity/chooseCity'
|
|
})
|
|
})
|
|
|
|
+
|
|
},
|
|
},
|
|
getItemData() {
|
|
getItemData() {
|
|
uni.showLoading({
|
|
uni.showLoading({
|