master
linyongLynn 2 days ago
parent da8324adc8
commit 2acfb9e405

@ -1,268 +1,269 @@
{ {
"easycom": { "easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}, },
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "中共苏州独立支部旧址", "navigationBarTitleText": "中共苏州独立支部旧址",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{ },{
"path": "pages/vr/vrpage", "path": "pages/vr/vrpage",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, { }, {
"path": "pages/guide/index", "path": "pages/guide/index",
"style": { "style": {
"navigationBarTitleText": "参观指南", "navigationBarTitleText": "参观指南",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, { }, {
"path": "pages/mine/index", "path": "pages/mine/index",
"style": { "style": {
"navigationBarTitleText": "个人中心", "navigationBarTitleText": "个人中心",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, { }, {
"path": "pages/map/map", "path": "pages/map/map",
"style": { "style": {
"navigationBarTitleText": "展馆导航", "navigationBarTitleText": "展馆导航",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
} "navigationStyle": "custom"
}
}, {
"path": "pages/visit/index", }, {
"style": { "path": "pages/visit/index",
"navigationBarTitleText": "参观预约", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "参观预约",
} "enablePullDownRefresh": false
}
}, {
"path": "pages/activity/index", }, {
"style": { "path": "pages/activity/index",
"navigationBarTitleText": "活动列表", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "活动列表",
} "enablePullDownRefresh": false
}
}, {
"path": "pages/visit/book", }, {
"style": { "path": "pages/visit/book",
"navigationBarTitleText": "个人预约", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "个人预约",
} "enablePullDownRefresh": false
}
}, {
"path": "pages/visit/teambook", }, {
"style": { "path": "pages/visit/teambook",
"navigationBarTitleText": "团体预约", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "团体预约",
} "enablePullDownRefresh": false
}
}, {
"path": "pages/activity/info", }, {
"style": { "path": "pages/activity/info",
"navigationBarTitleText": "活动详情", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "活动详情",
} "enablePullDownRefresh": false
}
}, {
"path": "pages/activity/book", }, {
"style": { "path": "pages/activity/book",
"navigationBarTitleText": "活动预约", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "活动预约",
} "enablePullDownRefresh": false
}
}, {
"path": "pages/order/visitorder", }, {
"style": { "path": "pages/order/visitorder",
"navigationBarTitleText": "参观预约订单", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "参观预约订单",
} "enablePullDownRefresh": false
}
}, {
"path": "pages/order/parkorder", }, {
"style": { "path": "pages/order/parkorder",
"navigationBarTitleText": "车位预约", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "车位预约",
} "enablePullDownRefresh": false
}
}, {
"path": "pages/park/index", }, {
"style": { "path": "pages/park/index",
"navigationBarTitleText": "停车场预约", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "停车场预约",
} "enablePullDownRefresh": false
}
}, {
"path": "pages/order/visitorderinfo", }, {
"style": { "path": "pages/order/visitorderinfo",
"navigationBarTitleText": "参观预约详情", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "参观预约详情",
} "enablePullDownRefresh": false
}
}, {
"path": "pages/park/book", }, {
"style": { "path": "pages/park/book",
"navigationBarTitleText": "停车场预约", "style": {
"enablePullDownRefresh": false "navigationBarTitleText": "停车场预约",
} "enablePullDownRefresh": false
}
}
,{ }
"path" : "pages/success/success", ,{
"path" : "pages/success/success",
"style" : "style" :
{ {
"navigationBarTitleText": "预约成功", "navigationBarTitleText": "预约成功",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
,{ ,{
"path" : "pages/order/parkorderinfo", "path" : "pages/order/parkorderinfo",
"style" : "style" :
{ {
"navigationBarTitleText": "停车场预约", "navigationBarTitleText": "停车场预约",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
,{ ,{
"path" : "pages/order/activityorder", "path" : "pages/order/activityorder",
"style" : "style" :
{ {
"navigationBarTitleText": "活动预约", "navigationBarTitleText": "活动预约",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
,{ ,{
"path" : "pages/order/activityorderinfo", "path" : "pages/order/activityorderinfo",
"style" : "style" :
{ {
"navigationBarTitleText": "活动预约详情", "navigationBarTitleText": "活动预约详情",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
,{ ,{
"path" : "pages/guide/list", "path" : "pages/guide/list",
"style" : "style" :
{ {
"navigationBarTitleText": "参观指南", "navigationBarTitleText": "参观指南",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
,{ ,{
"path" : "pages/guide/info", "path" : "pages/guide/info",
"style" : "style" :
{ {
"navigationBarTitleText": "参观指南", "navigationBarTitleText": "参观指南",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
,{ ,{
"path" : "pages/mine/recommend", "path" : "pages/mine/recommend",
"style" : "style" :
{ {
"navigationBarTitleText": "分享预约小程序", "navigationBarTitleText": "分享预约小程序",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
,{ ,{
"path" : "pages/guide/feedback", "path" : "pages/guide/feedback",
"style" : "style" :
{ {
"navigationBarTitleText": "投诉建议", "navigationBarTitleText": "投诉建议",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
,{ ,{
"path" : "pages/guide/contact", "path" : "pages/guide/contact",
"style" : "style" :
{ {
"navigationBarTitleText": "联系我们", "navigationBarTitleText": "联系我们",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
,{ ,{
"path" : "pages/order/shareQR", "path" : "pages/order/shareQR",
"style" : "style" :
{ {
"navigationBarTitleText": "分享二维码", "navigationBarTitleText": "分享二维码",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
// { // {
// "path" : "pages/vr/vrpagegm", // "path" : "pages/vr/vrpagegm",
// "style" : // "style" :
// { // {
// "navigationBarTitleText": "", // "navigationBarTitleText": "",
// "enablePullDownRefresh": false // "enablePullDownRefresh": false
// } // }
// } // }
{ {
"path" : "pages/guide/feedbackinfo", "path" : "pages/guide/feedbackinfo",
"style" : "style" :
{ {
"navigationBarTitleText": "意见建议详情", "navigationBarTitleText": "意见建议详情",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "中共苏州独立支部旧址", "navigationBarTitleText": "中共苏州独立支部旧址",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
}, },
"tabBar": { "tabBar": {
"color": "#351C1B", "color": "#351C1B",
"selectedColor": "#351C1B", "selectedColor": "#351C1B",
"backgroundColor": "#fdf9f5", "backgroundColor": "#fdf9f5",
"list": [{ "list": [{
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"text": "首页", "text": "首页",
"iconPath": "/static/img/icon_nav_home.png", "iconPath": "/static/img/icon_nav_home.png",
"selectedIconPath": "/static/img/icon_nav_home_on.png" "selectedIconPath": "/static/img/icon_nav_home_on.png"
}, },
{ {
"pagePath": "pages/guide/index", "pagePath": "pages/guide/index",
"text": "参观指南", "text": "参观指南",
"iconPath": "/static/img/icon_nav_guide.png", "iconPath": "/static/img/icon_nav_guide.png",
"selectedIconPath": "/static/img/icon_nav_guide_on.png" "selectedIconPath": "/static/img/icon_nav_guide_on.png"
}, },
{ {
"pagePath": "pages/map/map", "pagePath": "pages/map/map",
"text": "展馆导航", "text": "展馆导航",
"iconPath": "/static/img/icon_nav_map.png", "iconPath": "/static/img/icon_nav_map.png",
"selectedIconPath": "/static/img/icon_nav_map_on.png" "selectedIconPath": "/static/img/icon_nav_map_on.png"
}, },
{ {
"pagePath": "pages/mine/index", "pagePath": "pages/mine/index",
"text": "个人中心", "text": "个人中心",
"iconPath": "/static/img/icon_nav_user.png", "iconPath": "/static/img/icon_nav_user.png",
"selectedIconPath": "/static/img/icon_nav_user_on.png" "selectedIconPath": "/static/img/icon_nav_user_on.png"
} }
] ]
} }
} }

@ -1,128 +1,152 @@
<template> <template>
<view> <view>
<!-- H5环境嵌入iframe地图 --> <!-- H5环境嵌入iframe地图 -->
<view v-if="isH5" class="h5-map-container"> <view v-if="isH5" class="page-body">
<iframe <view class="page-section page-section-gap">
:src="getMapUrl()" <view class="h5-map-container">
width="100%" <iframe
height="100vh" :src="getMapUrl()"
frameborder="0" width="100%"
class="h5-map-iframe"> height="100vh"
</iframe> frameborder="0"
</view> class="h5-map-iframe">
</iframe>
<!-- 小程序环境使用uni-app地图组件 --> </view>
<map v-else style="width: 100%; height: 100vh;position: relative;" @markertap="markertap" :latitude="info.latitude" </view>
:longitude="info.longitude" :markers="covers"></map> </view>
</view>
</template> <!-- 小程序环境使用uni-app地图组件 -->
<map v-else style="width: 100%; height: 100vh;position: relative;" @markertap="markertap" :latitude="info.latitude"
<script> :longitude="info.longitude" :markers="covers"></map>
export default { </view>
data() { </template>
return {
info: {}, <script>
covers: [], export default {
isH5: false // H5 data() {
} return {
}, info: {
onLoad() { latitude: 31.299893,
// longitude: 120.626022,
this.isH5 = typeof window !== 'undefined' && window.location name: '苏州革命博物馆',
address: '苏州市姑苏区'
this.loadInfo(); },
}, covers: [],
onShareAppMessage() { isH5: false // H5
return this.util.shareInfo }
}, },
methods: { onLoad() {
// H5URL //
getMapUrl() { this.isH5 = typeof window !== 'undefined' && window.location
if (this.info.latitude && this.info.longitude) {
// 使 this.loadInfo();
const url = `https://apis.map.qq.com/uri/v1/marker?marker=coord:${this.info.latitude},${this.info.longitude};title:${encodeURIComponent(this.info.name || '展馆')};addr:${encodeURIComponent(this.info.address || '')}&referer=myapp`; },
return url; onShareAppMessage() {
} return this.util.shareInfo
// 使 },
return 'https://apis.map.qq.com/uri/v1/marker?marker=coord:31.299893,120.626022;title:苏州革命博物馆;addr:苏州市姑苏区&referer=myapp'; methods: {
}, // H5URL
markertap() { getMapUrl() {
this.openlocation(); if (this.info.latitude && this.info.longitude) {
}, // 使
openlocation() { const url = `https://apis.map.qq.com/uri/v1/marker?marker=coord:${this.info.latitude},${this.info.longitude};title:${encodeURIComponent(this.info.name || '展馆')};addr:${encodeURIComponent(this.info.address || '')}&referer=myapp`;
if (this.isH5) { return url;
// H5使JS-SDK }
if (typeof wx !== 'undefined' && wx.openLocation) { // 使
// JS-SDK return 'https://apis.map.qq.com/uri/v1/marker?marker=coord:31.299893,120.626022;title:苏州革命博物馆;addr:苏州市姑苏区&referer=myapp';
wx.openLocation({ },
latitude: this.info.latitude, markertap() {
longitude: this.info.longitude, this.openlocation();
name: this.info.name, },
address: this.info.address, openlocation() {
scale: 14 if (this.isH5) {
}); // H5使JS-SDK
} else { if (typeof wx !== 'undefined' && wx.openLocation) {
// 使 // JS-SDK
const mapUrl = `https://apis.map.qq.com/uri/v1/marker?marker=coord:${this.info.latitude},${this.info.longitude};title:${encodeURIComponent(this.info.name)};addr:${encodeURIComponent(this.info.address)}&referer=myapp`; wx.openLocation({
window.open(mapUrl, '_blank'); latitude: this.info.latitude,
} longitude: this.info.longitude,
} else { name: this.info.name,
// 使uni.openLocation address: this.info.address,
uni.openLocation({ scale: 14
latitude: this.info.latitude, });
longitude: this.info.longitude, } else {
name: this.info.name, // 使
address: this.info.address const mapUrl = `https://apis.map.qq.com/uri/v1/marker?marker=coord:${this.info.latitude},${this.info.longitude};title:${encodeURIComponent(this.info.name)};addr:${encodeURIComponent(this.info.address)}&referer=myapp`;
}); window.open(mapUrl, '_blank');
} }
}, } else {
loadInfo(cb) { // 使uni.openLocation
var that = this; uni.openLocation({
this.util.request({ latitude: this.info.latitude,
api: '/api/mobile/visit/introduce', longitude: this.info.longitude,
utilSuccess: function(res) { name: this.info.name,
res.latitude = parseFloat(res.latitude); address: this.info.address
res.longitude = parseFloat(res.longitude); });
that.info = res; }
},
// loadInfo(cb) {
if (!that.isH5) { var that = this;
that.covers.push({ this.util.request({
latitude: res.latitude, api: '/api/mobile/visit/introduce',
longitude: res.longitude, utilSuccess: function(res) {
width: 70, res.latitude = parseFloat(res.latitude);
height: 70, res.longitude = parseFloat(res.longitude);
iconPath: '/static/img/location.png' that.info = res;
});
} //
if (!that.isH5) {
// that.covers.push({
if (cb) { latitude: res.latitude,
cb(res); longitude: res.longitude,
} width: 70,
}, height: 70,
utilFail: function(res) { iconPath: '/static/img/location.png'
});
} }
})
}, //
} if (cb) {
} cb(res);
</script> }
},
<style> utilFail: function(res) {
/* H5地图iframe容器样式 */
.h5-map-container { }
width: 100%; })
height: 100vh; },
position: relative; }
background: #f5f5f5; }
} </script>
.h5-map-iframe { <style>
width: 100%; /* H5地图iframe容器样式 */
height: 100%; .h5-map-container {
border: none; width: 100%;
display: block; height: 100vh;
} position: relative;
</style> background: #f5f5f5;
}
.h5-map-iframe {
width: 100%;
height: 100%;
border: none;
display: block;
}
.page-body {
width: 100%;
height: 100vh;
position: relative;
}
.page-section {
width: 100%;
height: 100%;
}
.page-section-gap {
padding: 0;
}
</style>

@ -11,7 +11,7 @@
</view> </view>
<view class="mine-box"> <view class="mine-box">
<view class="mine-box-user"> <view class="mine-box-user">
<view class="user_avator"> <view class="user_avator" @click="showEditForm">
<u-avatar :src="info.headimgurl" size="61"></u-avatar> <u-avatar :src="info.headimgurl" size="61"></u-avatar>
</view> </view>
<view class="user_info"> <view class="user_info">
@ -60,7 +60,7 @@
<view class="list-item" @click="toPage(4)"> <view class="list-item" @click="toPage(4)">
<view class="list-item-left"> <view class="list-item-left">
<text class="iconfont icon-fenxiang"></text> <text class="iconfont icon-fenxiang"></text>
<text class="list-item-lefttxt">推荐预约管理系统</text> <text class="list-item-lefttxt">系统</text>
</view> </view>
<view class="list-item-right"> <view class="list-item-right">
<u-icon name="arrow-right" color="#ccc"></u-icon> <u-icon name="arrow-right" color="#ccc"></u-icon>
@ -162,6 +162,25 @@
}); });
}, },
methods: { methods: {
//
showEditForm() {
//
const isH5 = typeof window !== 'undefined' && window.location
if (isH5) {
// H5
this.showAuthorization = true;
//
this.form.name = this.info.nickname || '';
this.form.avatar = this.info.headimgurl || '';
} else {
//
this.showform = true;
//
this.form.name = this.info.nickname || '';
this.form.avatar = this.info.headimgurl || '';
}
},
closeInfo() { closeInfo() {
this.showAuthorization = false; this.showAuthorization = false;
}, },
@ -337,6 +356,16 @@
} }
.user_avator {
cursor: pointer;
position: relative;
transition: transform 0.2s;
}
.user_avator:active {
transform: scale(0.95);
}
.user_info { .user_info {
margin-left: 33rpx; margin-left: 33rpx;
} }

@ -120,7 +120,7 @@ const wxH5AuthLogin = (cb) => {
}) })
} else { } else {
// 未获取授权码,跳转到微信授权页面 // 未获取授权码,跳转到微信授权页面
const appId = 'wxbf4862e929ab85b0' const appId = 'wx90acb6e2aa676977'
const currentUrl = window.location.href const currentUrl = window.location.href
const redirectUri = encodeURIComponent(currentUrl.replace(/#\//, "")); const redirectUri = encodeURIComponent(currentUrl.replace(/#\//, ""));
const scope = 'snsapi_userinfo' const scope = 'snsapi_userinfo'

Loading…
Cancel
Save