加入家政入口

This commit is contained in:
java110 2021-06-05 18:02:10 +08:00
parent 4fa2d9e9ca
commit eb0d7a6dc2
2 changed files with 75 additions and 2 deletions

View File

@ -530,6 +530,16 @@
}
}
,{
"path" : "pages/homemaking/homemaking",
"style" :
{
"navigationBarTitleText": "家政服务",
"enablePullDownRefresh": false,
"navigationStyle":"custom"
}
}
],
"tabBar": {
"color": "#272636",
@ -543,8 +553,8 @@
"selectedIconPath": "static/images/home-selected.png"
},
{
"pagePath": "pages/rentHouse/rentHouse",
"text": "房源",
"pagePath": "pages/homemaking/homemaking",
"text": "家政",
"iconPath": "static/images/rent.png",
"selectedIconPath": "static/images/rent-selected.png"
},

View File

@ -0,0 +1,63 @@
<template>
<view class="h5-html">
 <web-view ref="webview"  :src="url"  @onPostMessage="onReciveMessage"></web-view>
</view>
</template>
<script>
import conf from '../../conf/config.js'
import {
reciveMessage,getHcCode
} from '../../api/webView/webViewApi.js'
export default {
data() {
return {
url: '',
communityId: ''
}
},
mounted() {
// #ifdef H5
window.addEventListener("message", this.onReciveMessage);
// #endif
},
onLoad(options) {
let _that = this;
let _url = options.url;
//hcCode
this.vc.getCurCommunity()
.then(function(_communityInfo) {
_that.communityId = _communityInfo.communityId;
})
.then(function() {
_that._getHcCode(_url);
})
},
methods: {
_getHcCode: function(_url) {
let _that =this;
if (_url) {
this.url = conf.mallUrl + _url;
} else {
getHcCode().then(_data => {
_that.url = conf.mallUrl+"#/pages/homemaking/index?mallFrom=HC&hcCommunityId="+_that.communityId+"&hcCode="+_data.hcCode;
});
}
},
onReciveMessage: function(event) {
reciveMessage(event);
}
}
}
</script>
<style>
.h5-html {
width: 100%;
height: 100%;
}
</style>