|
|
@@ -276,7 +276,11 @@ export default {
|
|
|
videoContext: '',
|
|
|
config: {},
|
|
|
pois: '',
|
|
|
- currentPoi: {}
|
|
|
+ currentPoi: {},
|
|
|
+
|
|
|
+ location: {},
|
|
|
+ poiIndex: -1,
|
|
|
+ poiList: [],
|
|
|
};
|
|
|
},
|
|
|
onLoad(opt) {
|
|
|
@@ -314,6 +318,16 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
this.getCommentList();
|
|
|
+
|
|
|
+ QQMapWX.initMap();
|
|
|
+ let location = {
|
|
|
+ latitude: req.getStorage('loctionAddressMap').location.lat,
|
|
|
+ longitude: req.getStorage('loctionAddressMap').location.lng
|
|
|
+ }
|
|
|
+ QQMapWX.reverseGeocoder(location, data => {
|
|
|
+ this.poiList = data.pois;
|
|
|
+ this.checkLocation(this.poiList[0],0)
|
|
|
+ });
|
|
|
},
|
|
|
onShow() {
|
|
|
this.config = JSON.parse(req.getStorage('configRes'))
|
|
|
@@ -341,6 +355,39 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ chooseLocation(){
|
|
|
+ let that = this;
|
|
|
+ uni.chooseLocation({//choosePoi不返回经纬度
|
|
|
+ success: function (res) {
|
|
|
+ console.log('位置名称:' , res);
|
|
|
+ that.location = {
|
|
|
+ poiName: res.name,
|
|
|
+ poiAddress: res.address,
|
|
|
+ poiLongitude: res.longitude,
|
|
|
+ poiLatitude: res.latitude
|
|
|
+ }
|
|
|
+ that.reverseGeocoder(res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ reverseGeocoder(location) {
|
|
|
+ QQMapWX.initMap();
|
|
|
+ QQMapWX.reverseGeocoder(location, data => {
|
|
|
+ this.location.poiRegionalism = data.ad_info.adcode.substring(0, 2) + "0000," + data.ad_info.adcode.substring(0, 4) +"00," + data.ad_info.adcode
|
|
|
+ console.log('解析后的地址地址数据:', data,this.location.poiRegionalism);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ checkLocation(item,index){
|
|
|
+ if(this.poiIndex == index) return false;
|
|
|
+ this.poiIndex = index;
|
|
|
+ this.location = {
|
|
|
+ poiName: item.title,
|
|
|
+ poiAddress: item.address,
|
|
|
+ poiLongitude: item.location.lng,
|
|
|
+ poiLatitude: item.location.lat,
|
|
|
+ poiRegionalism: item.ad_info.adcode.substring(0, 2) + "0000," + item.ad_info.adcode.substring(0, 4) +"00," + item.ad_info.adcode
|
|
|
+ }
|
|
|
+ },
|
|
|
removeHtml(content) {
|
|
|
return util.removeHtml(content);
|
|
|
},
|
|
|
@@ -464,7 +511,7 @@ export default {
|
|
|
if (this.isNews) {
|
|
|
this.getUpdateIsSee();
|
|
|
}
|
|
|
- req.saveBehaviorNew(item.id,this.detail.pollId?10:11,4)
|
|
|
+ req.saveBehaviorNew(this.detail.pollId,this.detail.pollId?10:11,4)
|
|
|
});
|
|
|
},
|
|
|
getUpdateIsSee() {
|
|
|
@@ -520,6 +567,14 @@ export default {
|
|
|
dataP.pid = pid;
|
|
|
}
|
|
|
dataP.momentsId = this.contentId;
|
|
|
+ // 位置
|
|
|
+ if(this.location&&this.location.poiName){
|
|
|
+ dataP.poiName = this.location.poiName;
|
|
|
+ dataP.poiAddress = this.location.poiAddress;
|
|
|
+ dataP.poiLongitude = this.location.poiLongitude;
|
|
|
+ dataP.poiLatitude = this.location.poiLatitude;
|
|
|
+ dataP.poiRegionalism = this.location.poiRegionalism
|
|
|
+ }
|
|
|
req.postRequestLoding('/api/v3/fabulous/save', dataP, data => {
|
|
|
if (type == 2) {
|
|
|
//点赞
|
|
|
@@ -582,6 +637,14 @@ export default {
|
|
|
}
|
|
|
dataP.momentsId = this.contentId;
|
|
|
this.isSubmit = true;
|
|
|
+ // 位置
|
|
|
+ if(this.location&&this.location.poiName){
|
|
|
+ dataP.poiName = this.location.poiName;
|
|
|
+ dataP.poiAddress = this.location.poiAddress;
|
|
|
+ dataP.poiLongitude = this.location.poiLongitude;
|
|
|
+ dataP.poiLatitude = this.location.poiLatitude;
|
|
|
+ dataP.poiRegionalism = this.location.poiRegionalism
|
|
|
+ }
|
|
|
// await requsetmessage.remindIntegral().then(res => {});
|
|
|
req.postRequestLoding('/api/v3/fabulous/save', dataP, data => {
|
|
|
this.detail.count.commentCount++;
|