uni-app-applet/pagesB/aboutUs/aboutUs.vue

100 lines
2.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view>
<!-- 状态栏 -->
<status-nav :navBarTitle="'关于我们'"></status-nav>
<!-- 容器 -->
<container-subgroup>
<view slot="content">
<!-- 地图 -->
<view class="radius30" style="overflow: hidden;border: 2rpx solid #8c8c9b;">
<map :latitude="lat" :longitude="lng" :enable-scroll="enableScroll" :enable-zoom="enableZoom" scale="11" style="height: 390rpx;width: 100%;"></map>
</view>
<!-- 导航按钮 -->
<view @tap="goThere" class="navigate-to-where mar-s30 radius30 bac0 colf fon36 tcenter">导航至佩丽</view>
<!-- 关于佩丽 -->
<view class="fon48 col0 mar-sx50">关于佩丽</view>
<rich-text :nodes="richText" class="fon30 colpeili line-h50"></rich-text>
</view>
</container-subgroup>
</view>
</template>
<script>
export default {
components:{
},
data() {
return {
statusBarHeight:uni.getSystemInfoSync().statusBarHeight + 50,
publicColor:uni.getStorageSync('publicColor'),//主题颜色
lat:25.603183,
lng:100.211328,
enableZoom:true,//是否支持缩放
enableScroll:true,//是否支持拖动
richText:'',//富文本
address:'',//目的地
flag:true
}
},
onLoad(options) {
if(uni.getStorageSync('phone_active')){
this.$toolAll.tools.clearShare();
// 调取关于我们信息事件
this.checkAboutUs();
} else {
uni.setStorageSync('outside',2);
uni.setStorageSync('existCode',options.invite_code);
uni.setStorageSync('transientUrl',`/pagesB/aboutUs/aboutUs`);
uni.navigateTo({
url:'/pages/login/login'
})
}
},
methods: {
// 查询关于我们信息
checkAboutUs(){
this.$requst.post('/api/index/about').then(res=>{
if(res.code==0){
this.lat = res.data.lat;
this.lng = res.data.lon;
this.richText = this.$toolAll.tools.escape2Html(res.data.content);
this.address = res.data.address;
} else {
this.$toolAll.tools.showToast(res.msg);
}
}).catch(err=>{
this.$toolAll.tools.showToast(err.msg);
})
},
goThere(){//去这里
if(this.flag){
this.flag = false;
wx.getLocation({//获取当前经纬度
type: 'wgs84', //返回可以用于wx.openLocation的经纬度官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
success: (res)=> {
wx.openLocation({//​使用微信内置地图查看位置。
latitude: this.lat*1,//要去的纬度-地址
longitude: this.lng*1,//要去的经度-地址
name: this.address,
address: this.address,
fail:err=>{
this.$toolAll.tools.showToast('地址信息错误');
}
})
}
})
setTimeout(()=>{
this.flag = true;
},2000)
} else {
this.$toolAll.tools.showToast('请勿多次点击');
}
},
}
}
</script>
<style>
</style>