|
@@ -1,6 +1,6 @@
|
|
|
<style lang="less">
|
|
|
.homeIndex {
|
|
|
- padding: 68px 0px 30px;
|
|
|
+ padding: 68px 0px 130px;
|
|
|
position: relative;
|
|
|
background-color: #ebf5fa;
|
|
|
background-repeat: no-repeat;
|
|
@@ -60,7 +60,8 @@
|
|
|
display: inline-block;
|
|
|
width: 280px;
|
|
|
height: 350px;
|
|
|
- background: red;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: contain;
|
|
|
border-radius: 24px;
|
|
|
margin-right: 12px;
|
|
|
.itemCont {
|
|
@@ -234,18 +235,18 @@
|
|
|
</style>
|
|
|
<template>
|
|
|
<div class="homeIndex" :style="{'background-image': 'url('+h5StaticPath+'homeBack.jpg)'}">
|
|
|
- <div class="projectTitle" @click="showProject"><span class="name">{{nowCompanyName}}</span><van-icon name="arrow-down" size="20"/></div>
|
|
|
+ <div class="projectTitle" @click="showProject"><span class="name">{{nowCompanyName}}</span><van-icon name="arrow-down" size="20" v-if="companyList.length>1"/></div>
|
|
|
<div class="projectInfo">成为一家牛的让员工幸福的企业</div>
|
|
|
<div class="weather"><image class="image" :src="h5StaticPath+weather.imgname"/><span class="value">{{weather.temperature}}℃</span><span class="text">{{weather.text}}</span></div>
|
|
|
<scroll-view scroll-x="{{true}}" show-scrollbar="{{false}}" class="scroll-view" enhanced>
|
|
|
- <view class="scroll-view-item">
|
|
|
- <div class="itemCont" v-if="reSpaceId" @click="goEnv('homeShowEnv')">
|
|
|
+ <view class="scroll-view-item" @click="goEnvCard()" :style="{'background-image':'url('+ h5StaticPath + (reSpaceId?'publicZone.jpg':'setResident.jpg')+')'}">
|
|
|
+ <div class="itemCont" v-if="reSpaceId">
|
|
|
<div class="spaceName"><div class="name">{{ reSpaceName }}</div><span class="resident">常驻工区</span></div>
|
|
|
<div class="environment"><span class="param">{{spaceParam.temperature||'--'}}℃</span><span class="param">{{spaceParam.co2||'--'}}ppm</span><span class="param">{{spaceParam.pm25||'--'}}μg/m³</span></div>
|
|
|
</div>
|
|
|
- <div class="itemCont" v-if="!reSpaceId" @click="goEnv('homeSetSpace')">去设置<br>您的常驻工区<van-icon name="arrow" size="20"/></div>
|
|
|
+ <div class="itemCont" v-if="!reSpaceId">去设置<br>您的常驻工区<van-icon name="arrow" size="20"/></div>
|
|
|
</view>
|
|
|
- <view class="scroll-view-item"><div class="itemCont envirItem" @click="goToIntroduce('environment')">环境健康小知识<van-icon name="arrow" size="20"/></div></view>
|
|
|
+ <view class="scroll-view-item" @click="goToIntroduce('environment')" :style="{'background-image': 'url('+h5StaticPath+'enviromentInfo.jpg)'}"><div class="itemCont envirItem">环境健康小知识<van-icon name="arrow" size="20"/></div></view>
|
|
|
</scroll-view>
|
|
|
<scroll-view scroll-x="{{true}}" class="scroll-view2" show-scrollbar="{{false}}" enhanced>
|
|
|
<view class="scroll-view-item2" v-if="showCard.openLight" @click="goEnv('openLamp')"><div class="title">开启照明</div><div class="info">快速启动</div><div class="imageDiv">
|
|
@@ -277,12 +278,19 @@
|
|
|
<div class="menuItem" @click="goAdministration"><div class="menuImg"><image class="image" :src="h5StaticPath+'control.png'"/></div><div class="menuTitle">行政端管理</div></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+<footer v-show="hasCustomePhone" @callPhone="openPhonePanel" @custome-phone-show="customePhoneShow"></footer>
|
|
|
+<custome-service-panel
|
|
|
+ :show="visiblePhone"
|
|
|
+ :phone="phone"
|
|
|
+ @custome-service-close="closePhonePanel"
|
|
|
+>
|
|
|
+</custome-service-panel>
|
|
|
<van-popup :show="show" position="bottom" @close="hideProject" round>
|
|
|
<div class="projectPop">
|
|
|
<div class="projectWrap" style="max-height:{{screenHeight-200}}px">
|
|
|
<div class="projectItem" :class="{'sel':item.id==userInfo.companyId}" v-for="(item, index) in companyList" :key="index" @click="projectClick(item)">{{ item.name }}</div>
|
|
|
</div>
|
|
|
- <div class="button">取消</div>
|
|
|
+ <div class="button" @click="hideProject">取消</div>
|
|
|
</div>
|
|
|
</van-popup>
|
|
|
</div>
|
|
@@ -312,6 +320,9 @@ wepy.page({
|
|
|
store,
|
|
|
config: {},
|
|
|
data: {
|
|
|
+ hasCustomePhone: null,
|
|
|
+ visiblePhone: false,
|
|
|
+ phone: '',
|
|
|
show: false,
|
|
|
h5StaticPath: config.h5StaticPath + '/page-home/',
|
|
|
screenHeight: 560,
|
|
@@ -322,7 +333,6 @@ wepy.page({
|
|
|
showCard: {},
|
|
|
spaceParam: {},
|
|
|
weather: {},
|
|
|
- iii: 1,
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState({
|
|
@@ -367,7 +377,6 @@ wepy.page({
|
|
|
companyId: this.userInfo.companyId,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- //console.log('querySpaceFunctionCard', res);
|
|
|
if (res.message == '该用户没有常驻空间') {
|
|
|
this.reSpaceId = '';
|
|
|
this.reSpaceName = '';
|
|
@@ -377,7 +386,6 @@ wepy.page({
|
|
|
this.reSpaceId = res.spaceId || ''; //有常驻空间
|
|
|
this.reSpaceName = res.spaceName || '';
|
|
|
this.showCard = res || {};
|
|
|
- //console.log('showCardshowCard', this.showCard);
|
|
|
|
|
|
//常驻空间参数属性
|
|
|
this.reSpaceId &&
|
|
@@ -412,8 +420,16 @@ wepy.page({
|
|
|
this.show = false;
|
|
|
},
|
|
|
showProject: function() {
|
|
|
+ if (this.companyList.length < 2) return;
|
|
|
this.show = true;
|
|
|
},
|
|
|
+ goEnvCard() {
|
|
|
+ if (this.reSpaceId) {
|
|
|
+ this.goEnv('homeShowEnv');
|
|
|
+ } else {
|
|
|
+ this.goEnv('homeSetSpace');
|
|
|
+ }
|
|
|
+ },
|
|
|
goEnv(param) {
|
|
|
if (this.controlSpaces.length == 0) {
|
|
|
wx.showToast({
|
|
@@ -423,18 +439,6 @@ wepy.page({
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- // switch (param) {
|
|
|
- // case 'homeShowEnv':
|
|
|
- // break;
|
|
|
-
|
|
|
- // case 'homeSetSpace':
|
|
|
- // break;
|
|
|
-
|
|
|
- // case '':
|
|
|
- // break;
|
|
|
-
|
|
|
- // default:
|
|
|
- // }
|
|
|
|
|
|
wx.navigateTo({
|
|
|
url: `/packagesEnv/pages/officehome/index?from=${param}`,
|
|
@@ -467,9 +471,20 @@ wepy.page({
|
|
|
url: `/packagesEnv/pages/administration/index`,
|
|
|
});
|
|
|
},
|
|
|
+ // 是否有客服
|
|
|
+ customePhoneShow(val) {
|
|
|
+ this.hasCustomePhone = val;
|
|
|
+ },
|
|
|
+ openPhonePanel(val) {
|
|
|
+ this.phone = val;
|
|
|
+ this.visiblePhone = true;
|
|
|
+ },
|
|
|
+ closePhonePanel(val) {
|
|
|
+ this.visiblePhone = val;
|
|
|
+ },
|
|
|
},
|
|
|
onLoad() {
|
|
|
- console.log("home----onLoad");
|
|
|
+ console.log('home----onLoad');
|
|
|
checkLoginNew()
|
|
|
.then(() => {
|
|
|
checkHasUserInfo();
|
|
@@ -482,7 +497,7 @@ wepy.page({
|
|
|
getWeather(this.userInfo.projectId)
|
|
|
.then((res) => {
|
|
|
this.weather = res.content || {}; //{ temperature: 30, text: '云' };
|
|
|
- var text = '云';
|
|
|
+ var text = this.weather.text;
|
|
|
var imgname = 'sunny.png';
|
|
|
if (text.indexOf('晴') > -1) {
|
|
|
imgname = 'sunny.png';
|
|
@@ -511,9 +526,8 @@ wepy.page({
|
|
|
this.screenHeight = systemInfo.screenHeight;
|
|
|
},
|
|
|
onShow() {
|
|
|
- console.log("home----onShow");
|
|
|
+ console.log('home----onShow');
|
|
|
this.loadData();
|
|
|
-
|
|
|
},
|
|
|
});
|
|
|
</script>
|
|
@@ -522,7 +536,9 @@ wepy.page({
|
|
|
"navigationStyle":"custom",
|
|
|
usingComponents: {
|
|
|
"van-icon": "module:@vant/weapp/dist/icon",
|
|
|
- "van-popup": "module:@vant/weapp/dist/popup"
|
|
|
+ "van-popup": "module:@vant/weapp/dist/popup",
|
|
|
+ 'custome-service-panel': '~@/components/coustome/custome-service-panel',
|
|
|
+ 'footer':'~@/components/coustome/footer'
|
|
|
}
|
|
|
}
|
|
|
</config>
|