[修改联通活动]
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
<view class="pack-center pages-hint showActive" v-if="showDt">
|
||||
<image src="/static/img/null_icon.png"></image>
|
||||
<view>查看附近营业厅,需要获取您的地理位置</view>
|
||||
<!-- <button class="location-btn" size="mini" open-type="openSetting">
|
||||
<!-- <button class="showActive-go" size="mini" open-type="openSetting">
|
||||
开启定位服务
|
||||
</button> -->
|
||||
<view class="showActive-go" @tap="showTap">获取</view>
|
||||
<view class="showActive-go" @tap="openSetting">获取</view>
|
||||
</view>
|
||||
<view class="showDt" v-else>
|
||||
<view class="top">
|
||||
<view class="top-left nowrap">{{locationData.address}}</view>
|
||||
<view class="top-left nowrap">{{locatResaa}}</view>
|
||||
<view class="top-picker">
|
||||
<picker @change="screenOrders" :value="ordersIndex" :range-key="'name'" :range="ordersWay">
|
||||
{{ ordersWay[ordersIndex].name }}
|
||||
@@ -23,8 +23,11 @@
|
||||
<image :src="item.cover" mode="aspectFill" class="item-logo"></image>
|
||||
<view class="item-cont">
|
||||
<view class="item-name nowrap">{{item.title}}</view>
|
||||
<view class="item-address nowrap">{{item.address}}</view>
|
||||
<view class="item-distance nowrap">
|
||||
<view class="item-address">
|
||||
<view class="item-address-tel">{{item.address}}</view>
|
||||
<image @tap="tel(item.mobile)" src="/static/icon/tel.png"></image>
|
||||
</view>
|
||||
<view class="item-distance">
|
||||
<view class="item-distance-left">{{item.distance}}</view>
|
||||
<view class="item-distance-go" @tap="siteMap(item.latitude, item.longitude)">去导航</view>
|
||||
</view>
|
||||
@@ -41,13 +44,18 @@
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
||||
<script>
|
||||
import { hallsIndex } from '@/apis/interfaces/index'
|
||||
import { cjsubscribeUrl } from '@/apis/interfaces/rights'
|
||||
import wx from 'weixin-js-sdk'
|
||||
import QQMapWX from '@/utils/qqmap-wx-jssdk.min.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
locatResaa : '',
|
||||
showDt : false,
|
||||
latitude : '',
|
||||
longitude : '',
|
||||
@@ -72,32 +80,57 @@
|
||||
if(this.latitude == '') {
|
||||
this.showDt = true
|
||||
}
|
||||
|
||||
},
|
||||
onShow() {},
|
||||
onShow() {
|
||||
// 获取营业厅列表
|
||||
this.regilist();
|
||||
},
|
||||
methods:{
|
||||
showTap() {
|
||||
this.showDt = false
|
||||
openSetting() {
|
||||
// 获取定位 - 使用腾讯地图sdk
|
||||
uni.getLocation({
|
||||
success: res => {
|
||||
// 调用接口
|
||||
this.qqMap.reverseGeocoder({
|
||||
location: {
|
||||
latitude: res.latitude,
|
||||
longitude: res.longitude
|
||||
},
|
||||
success: locatRes => {
|
||||
this.latitude = locatRes.result.location.lat
|
||||
this.longitude = locatRes.result.location.lng
|
||||
|
||||
cjsubscribeUrl({
|
||||
url: location.href.split('#')[0]
|
||||
}).then(wechatConfig => {
|
||||
let wxConfig = JSON.parse(wechatConfig)
|
||||
console.log(wxConfig)
|
||||
wx.config({
|
||||
appId: wxConfig.appId,
|
||||
jsApiList : ['scanQRCode','closeWindow','chooseWXPay','getLocation'],
|
||||
debug: false,
|
||||
signature: wxConfig.signature,
|
||||
nonceStr: wxConfig.nonceStr,
|
||||
timestamp: wxConfig.timestamp,
|
||||
openTagList : wxConfig.openTagList
|
||||
})
|
||||
wx.ready(() => {
|
||||
wx.getLocation({
|
||||
type: 'gcj02', //返回可以用于wx.openLocation的经纬度
|
||||
success: res=> {
|
||||
// 调用接口
|
||||
this.qqMap.reverseGeocoder({
|
||||
location: {
|
||||
latitude: res.latitude,
|
||||
longitude: res.longitude
|
||||
},
|
||||
success: locatRes => {
|
||||
this.locatResaa= locatRes.result.formatted_addresses.recommend
|
||||
this.latitude = locatRes.result.location.lat
|
||||
this.longitude = locatRes.result.location.lng
|
||||
|
||||
this.showDt = false
|
||||
// 获取营业厅列表
|
||||
this.regilist();
|
||||
},
|
||||
fail: res => {},
|
||||
complete: res => {}
|
||||
});
|
||||
},
|
||||
cancel: res=> {
|
||||
// 获取营业厅列表
|
||||
this.regilist(this.latitude, this.longitude);
|
||||
},
|
||||
fail: res => {},
|
||||
complete: res => {}
|
||||
});
|
||||
}
|
||||
this.regilist();
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@@ -129,6 +162,7 @@
|
||||
this.page = res.halls.page
|
||||
this.lodingStats = false
|
||||
uni.stopPullDownRefresh()
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
@@ -165,7 +199,21 @@
|
||||
|
||||
window.location.href = "http://uri.amap.com/marker?position="+ longitude +","+latitude +"&name="+ name +"&coordinate=gaode&callnative=1";
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
// 拨打电话
|
||||
tel(e) {
|
||||
uni.showActionSheet({
|
||||
itemList : ['呼叫商家电话'],
|
||||
success : res =>{
|
||||
if(res.tapIndex==0){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: e
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -231,7 +279,7 @@
|
||||
box-sizing: border-box;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 30rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
}
|
||||
.item-logo {
|
||||
width: 180rpx;
|
||||
@@ -239,11 +287,8 @@
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.item-cont {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding: 30rpx 30rpx 30rpx 240rpx;
|
||||
width: calc(100% - 180rpx);
|
||||
padding-left: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -253,6 +298,15 @@
|
||||
}
|
||||
.item-address {
|
||||
margin: 10rpx 0 30rpx;
|
||||
display: flex;
|
||||
}
|
||||
.item-address image {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.item-address-tel {
|
||||
width: calc(100% - 64rpx);
|
||||
}
|
||||
.item-distance {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user