|
@@ -92,56 +92,59 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
beforeMount() {},
|
|
|
- created() {
|
|
|
- // window.vm = this
|
|
|
- this.handleUrl()
|
|
|
- // 路径无参数,不执行后续逻辑
|
|
|
- if(!this.urlFlag){
|
|
|
- // this.loadComplete = true
|
|
|
- return
|
|
|
- }
|
|
|
- // store.commit('SETSSOTOKEN', 'admin:liujiandong')
|
|
|
- // console.log(window.location.href)
|
|
|
- this.SETHAVEFENGMAP(false)
|
|
|
- // 判断 安卓,ios
|
|
|
- const { os } = osInfo()
|
|
|
- if (os === 'iOS') {
|
|
|
- this.isIOS = true
|
|
|
- } else {
|
|
|
- this.isIOS = false
|
|
|
- }
|
|
|
- // 获取楼层列表
|
|
|
- this.getFloorList()
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- // 路径无参数,不执行后续逻辑
|
|
|
- if(!this.urlFlag){
|
|
|
- // this.loadComplete = true
|
|
|
- return
|
|
|
- }
|
|
|
- // console.log('环境变量', process.env.VUE_APP_RealEnv)
|
|
|
- if (this.plazaId) {
|
|
|
- this.getFengMap()
|
|
|
- store.dispatch('getBrand')
|
|
|
- } else {
|
|
|
- window.fengmapData = null
|
|
|
- this.loadComplete = true
|
|
|
- }
|
|
|
+ created(){
|
|
|
+ window.vmh5 = this
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(['plazaId', 'fmapID']),
|
|
|
+ ...mapGetters(['plazaId', 'fmapID', 'url']),
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['getfmapID', 'getFloors']),
|
|
|
- ...mapMutations(['SETHAVEFENGMAP', 'SETCATEGORYID', 'SETSMSXT', 'SETSSOTOKEN', 'SETPLAZAID']),
|
|
|
+ ...mapMutations(['SETHAVEFENGMAP', 'SETCATEGORYID', 'SETSMSXT', 'SETSSOTOKEN', 'SETPLAZAID', 'SETURL']),
|
|
|
+ createdFn() {
|
|
|
+ // window.vm = this
|
|
|
+ this.handleUrl()
|
|
|
+ // 路径无参数,不执行后续逻辑
|
|
|
+ if(!this.urlFlag){
|
|
|
+ // this.loadComplete = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // store.commit('SETSSOTOKEN', 'admin:liujiandong')
|
|
|
+ // console.log(window.location.href)
|
|
|
+ this.SETHAVEFENGMAP(false)
|
|
|
+ // 判断 安卓,ios
|
|
|
+ const { os } = osInfo()
|
|
|
+ if (os === 'iOS') {
|
|
|
+ this.isIOS = true
|
|
|
+ } else {
|
|
|
+ this.isIOS = false
|
|
|
+ }
|
|
|
+ // 获取楼层列表
|
|
|
+ this.getFloorList()
|
|
|
+ },
|
|
|
+ mountedFn() {
|
|
|
+ // 路径无参数,不执行后续逻辑
|
|
|
+ if(!this.urlFlag){
|
|
|
+ // this.loadComplete = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // console.log('环境变量', process.env.VUE_APP_RealEnv)
|
|
|
+ if (this.plazaId) {
|
|
|
+ this.getFengMap()
|
|
|
+ store.dispatch('getBrand')
|
|
|
+ } else {
|
|
|
+ window.fengmapData = null
|
|
|
+ this.loadComplete = true
|
|
|
+ }
|
|
|
+ },
|
|
|
getFengMap() {
|
|
|
this.getfmapID().then(() => {
|
|
|
this.getMap()
|
|
|
})
|
|
|
},
|
|
|
getMap() {
|
|
|
- console.log('%c时间:', 'color:blue;background:#fff')
|
|
|
- console.time('蜂鸟下载,解析')
|
|
|
+ // console.log('%c时间:', 'color:blue;background:#fff')
|
|
|
+ // console.time('蜂鸟下载,解析')
|
|
|
window.fengmapData = new SFengParser(
|
|
|
'fengMap',
|
|
|
`${this.mapServerURL}/fmap/${this.fmapID}`,
|
|
@@ -162,7 +165,7 @@ export default {
|
|
|
window.fengmapData.loadTheme(`${this.mapServerURL}/webtheme/${this.fmapID}/${this.fmapID}.theme`).then((res) => {
|
|
|
this.SETHAVEFENGMAP(1)
|
|
|
})
|
|
|
- console.timeEnd('蜂鸟下载,解析')
|
|
|
+ // console.timeEnd('蜂鸟下载,解析')
|
|
|
this.loadComplete = true
|
|
|
// 缓存楼层数据
|
|
|
if (dataArr.length) {
|
|
@@ -196,7 +199,8 @@ export default {
|
|
|
* 处理url参数
|
|
|
*/
|
|
|
handleUrl() {
|
|
|
- let href = window.location.href.split('?')[1]
|
|
|
+ // let href = window.location.href.split('?')[1]
|
|
|
+ let href = this.url
|
|
|
if(!href){
|
|
|
this.urlFlag = false
|
|
|
return
|
|
@@ -234,6 +238,7 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
plazaId(plazaId) {
|
|
|
+ // console.log('watch plazaId',plazaId)
|
|
|
// console.log('项目id', plazaId)
|
|
|
window.fengmapData = null
|
|
|
// 当获取到到项目id,请求底图
|
|
@@ -248,6 +253,16 @@ export default {
|
|
|
$route(to, from) {
|
|
|
// console.log(to, from)
|
|
|
},
|
|
|
+ url: {
|
|
|
+ // 监听url,有url时再进行接口查询
|
|
|
+ handler(newV){
|
|
|
+ if(newV){
|
|
|
+ this.createdFn()
|
|
|
+ this.mountedFn()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate:true
|
|
|
+ }
|
|
|
},
|
|
|
}
|
|
|
</script>
|