luban-mall/pagesB/about/about.vue

109 lines
2.6 KiB
Vue
Raw Normal View History

2022-07-08 08:15:29 +00:00
<template>
<view>
<status-nav :ifReturn="true" navBarTitle="关于我们" :marginBottom="0"></status-nav>
<view class="about-bg" :style="{'min-height':aboutHeight}">
<!-- 地图 -->
<view class="about-map">
<map style="width: 100%; height: 390rpx;" :latitude="latitude" :longitude="longitude" :markers="markers"></map>
</view>
<!-- 导航 -->
<view class="navigation-btn" @tap="goThere"></view>
<!-- 内容 -->
<view class="about">
2022-07-12 10:07:08 +00:00
<view class="about-title">关于我们</view>
2022-07-08 08:15:29 +00:00
<view class="about-txt">
<rich-text :nodes="aboutData"></rich-text>
</view>
</view>
</view>
</view>
</template>
<script>
import statusNav from '@/components/status-navs/status-nav';
2022-07-25 03:18:38 +00:00
import {userInfoEv} from '@/jsFile/public-api.js';
2022-07-08 08:15:29 +00:00
export default {
components:{
statusNav
},
data() {
return {
aboutHeight: `calc(100vh - ${uni.getSystemInfoSync().statusBarHeight + 50}px)`,
latitude: 39.909,
longitude: 116.39742,
address:'',
markers: [{
width : 30,
height: 32,
latitude: 39.909,
longitude: 116.39742,
iconPath: '/static/public/icon-addr.png'
}],
aboutData:'',
2022-07-15 03:05:54 +00:00
cacheBusinessId:-1, //商户id
2022-07-08 08:15:29 +00:00
}
},
2022-07-12 10:07:08 +00:00
onLoad(op) {
if(op.business_id){
2022-07-15 03:05:54 +00:00
this.cacheBusinessId = op.business_id;
}
},
onShow() {
if(this.cacheBusinessId !== -1){
this.$requst.post('/api/index/change-business',{business_id:this.cacheBusinessId}).then(res=>{
2022-07-12 10:07:08 +00:00
if(res.code == 0){
this.getAboutData();
2022-07-13 08:04:38 +00:00
userInfoEv();
2022-07-12 10:07:08 +00:00
}
})
}else{
this.getAboutData();
2022-07-13 08:04:38 +00:00
userInfoEv();
2022-07-12 10:07:08 +00:00
}
2022-07-08 08:15:29 +00:00
},
// 分享到微信
onShareAppMessage() {
2022-07-11 10:35:14 +00:00
let path = uni.getStorageSync('page-path-options')+'?business_id='+uni.getStorageSync('business_id');
return {
path:path
}
2022-07-08 08:15:29 +00:00
},
// 分享到朋友圈
2022-07-11 10:35:14 +00:00
onShareTimeline(res){
let path = uni.getStorageSync('page-path-options')+'?business_id='+uni.getStorageSync('business_id');
return {
path:path
}
2022-07-08 08:15:29 +00:00
},
methods: {
// 查询关于我们
getAboutData(){
2022-07-14 02:00:23 +00:00
uni.showLoading({
title: '加载中'
});
2022-07-08 08:15:29 +00:00
this.$requst.get('/api/index/about').then(res=>{
if(res.code==0){
this.aboutData = this.$toolAll.tools.escape2Html(res.data.content);
this.latitude = res.data.lat;
this.longitude = res.data.lon;
this.address = res.data.address;
this.markers[0].latitude = res.data.lat;
this.markers[0].longitude = res.data.lon;
} else {
this.$toolAll.tools.showToast(res.msg);
}
uni.hideLoading();
})
},
// 导航
goThere() {
this.$toolAll.tools.goThere(this.lat,this.lng,this.address);
}
}
}
</script>
<style>
</style>