anxiaoxia 1 년 전
부모
커밋
5ebb9c2f31

+ 18 - 5
src/packagesEnv/api/personalCenter.js

@@ -2,14 +2,14 @@ import $http from '@/common/request.js'
 import config from '@/config'
 import store from '@/store/index.js'
 function getProjectId() {
-  const projectId = store.state.user.userInfo.projectId
-  return projectId
+  const userInfo = store.state.user.userInfo
+  return userInfo
 }
-//  设置设备
+//  客服
 function customerservice() {
   let params = {
     'criteria': {
-      'projectId': getProjectId(),
+      'projectId': getProjectId().projectId,
       'state': 1
     }
   }
@@ -22,6 +22,19 @@ function customerservice() {
     data: JSON.stringify(params)
   })
 }
+//  个人信心
+function queryUserById() {
+  return $http({
+    serverSp: 'http://192.168.4.29:52015',
+    // serverSp: config.brsgServer.duoduoUrl,
+    url: `/user/queryUserById?userId=${getProjectId().userId}`,
+    method: 'GET',
+    isNotShowErrorToast: true,
+    errorSave: true
+  })
+}
+
 export {
-    customerservice
+    customerservice,
+    queryUserById
 }

+ 188 - 197
src/packagesEnv/pages/officehome/demo.wpy

@@ -263,214 +263,205 @@ page {
 </template>
 
 <script>
-import wepy from '@wepy/core';
-import store from '@/store';
-import config from '@/config';
-import moment from 'moment';
-import { mapState } from '@wepy/x';
-import { checkHasUserInfo } from '@/service/user';
-import { saveCompanyConfig } from '@/service/companyConfig';
-
+import wepy from '@wepy/core'
+import store from '@/store'
+import config from '@/config'
+import moment from 'moment'
+import { mapState } from '@wepy/x'
+import { checkHasUserInfo } from '@/service/user'
+import { saveCompanyConfig } from '@/service/companyConfig'
 
 wepy.page({
-    store,
-    data: {
-        imgpath: config.h5StaticPath + '/page-officehome-demo/',
-        img: config.h5StaticPath + '/page-officehome-demo/tiyan.png',//allopen.png
-        isHome: false,//是否是主页面
-        showChart: false,
-        serviceTime: false,
-        airOpen: true,
-        lampOpen: true,
-        curtainOpen: true,
-        waterOpen: true,
-        fanOpen: true,
-        wetOpen: true,
+  store,
+  data: {
+    imgpath: config.h5StaticPath + '/page-officehome-demo/',
+    img: config.h5StaticPath + '/page-officehome-demo/tiyan.png', // allopen.png
+    isHome: false, // 是否是主页面
+    showChart: false,
+    serviceTime: false,
+    airOpen: true,
+    lampOpen: true,
+    curtainOpen: true,
+    waterOpen: true,
+    fanOpen: true,
+    wetOpen: true
+  },
+  computed: {
+    ...mapState({ token: state => state.user.token, energyHeadData: state => state.portrait.energyHeadData })
+  },
+  onLoad() {
+    checkHasUserInfo()
+    setTimeout(() => {
+      this.img = this.imgpath + 'allopen.png'
+      this.isHome = true
+    }, 2000)
+  },
+  onReady() { },
+  methods: {
+    chartShowClick() {
+      this.img = this.imgpath + 'chart.png'
+      this.isHome = false
+      this.showChart = true
     },
-    computed: {
-        ...mapState({ token: state => state.user.token, energyHeadData: state => state.portrait.energyHeadData })
+    serviceTimeClick() {
+      this.img = this.imgpath + 'serviceTime.png'
+      this.isHome = false
+            // this.serviceTime = true;
     },
-    onLoad() {
-        var _this = this;
-        checkHasUserInfo().then(function (userInfo) {
-            console.log('checkHasUserInfo', userInfo);
-            var companyId = userInfo.companyId;
-            // saveCompanyConfig(companyId).then(() => 
-            // })
-        });
-        setTimeout(() => {
-            this.img = this.imgpath + 'allopen.png';
-            this.isHome = true;
-        }, 2000);
-
+    airClick() {
+      console.log('this.airOpen', this.airOpen)
+      if (this.airOpen) {
+        this.airOpen = false
+        this.img = this.imgpath + 'airclose.png'
+      } else {
+        this.airOpen = true
+        this.img = this.imgpath + 'allopen.png'
+      }
+      this.lampOpen = true
+      this.curtainOpen = true
+      this.waterOpen = true
+      this.fanOpen = true
+      this.wetOpen = true
     },
-    onReady() { },
-    methods: {
-        chartShowClick() {
-            this.img = this.imgpath + 'chart.png';
-            this.isHome = false;
-            this.showChart = true;
-        },
-        serviceTimeClick() {
-            this.img = this.imgpath + 'serviceTime.png';
-            this.isHome = false;
-            // this.serviceTime = true;
-        },
-        airClick() {
-            console.log('this.airOpen', this.airOpen);
-            if (this.airOpen) {
-                this.airOpen = false;
-                this.img = this.imgpath + 'airclose.png';
-            } else {
-                this.airOpen = true;
-                this.img = this.imgpath + 'allopen.png';
-            }
-            this.lampOpen = true;
-            this.curtainOpen = true;
-            this.waterOpen = true;
-            this.fanOpen = true;
-            this.wetOpen = true;
-        },
-        downCold() {
-            this.img = this.imgpath + 'downcold.png';
-            this.isHome = false;
-        },
-        upHot() {
-            this.img = this.imgpath + 'uphot.png';
-            this.isHome = false;
-        },
-        xiaoWind() {
-            this.img = this.imgpath + 'windxiao.png';
-            this.isHome = false;
-        },
-        daWind() {
-            this.img = this.imgpath + 'windda.png';
-            this.isHome = false;
-        },
-        lampOpenClick() {
-            if (!this.lampOpen) {
-                this.lampOpen = true;
-
-                this.airOpen = true;
-                this.curtainOpen = true;
-                this.waterOpen = true;
-                this.fanOpen = true;
-                this.wetOpen = true;
-                this.img = this.imgpath + 'allopen.png';
-            }
-        },
-        lampCloseClick() {
-            console.log('this.lampOpen', this.lampOpen);
-            if (this.lampOpen) {
-                this.lampOpen = false;
+    downCold() {
+      this.img = this.imgpath + 'downcold.png'
+      this.isHome = false
+    },
+    upHot() {
+      this.img = this.imgpath + 'uphot.png'
+      this.isHome = false
+    },
+    xiaoWind() {
+      this.img = this.imgpath + 'windxiao.png'
+      this.isHome = false
+    },
+    daWind() {
+      this.img = this.imgpath + 'windda.png'
+      this.isHome = false
+    },
+    lampOpenClick() {
+      if (!this.lampOpen) {
+        this.lampOpen = true
 
-                this.airOpen = true;
-                this.curtainOpen = true;
-                this.waterOpen = true;
-                this.fanOpen = true;
-                this.wetOpen = true;
-                this.img = this.imgpath + 'lampclose.png';
-            }
-        },
-        fanClick() {
-            if (this.fanOpen) {
-                this.fanOpen = false;
-                this.img = this.imgpath + 'fanclose.png';
-            } else {
-                this.fanOpen = true;
-                this.img = this.imgpath + 'allopen.png';
-            }
-            this.airOpen = true;
-            this.lampOpen = true;
-            this.curtainOpen = true;
-            this.waterOpen = true;
-            this.wetOpen = true;
-        },
-        waterClick() {
-            if (this.waterOpen) {
-                this.waterOpen = false;
-                this.img = this.imgpath + 'waterclose.png';
-            } else {
-                this.waterOpen = true;
-                this.img = this.imgpath + 'allopen.png';
-            }
-            this.airOpen = true;
-            this.lampOpen = true;
-            this.curtainOpen = true;
-            this.fanOpen = true;
-            this.wetOpen = true;
-        },
-        wetClick() {
-            if (this.wetOpen) {
-                this.wetOpen = false;
-                this.img = this.imgpath + 'wetclose.png';
-            } else {
+        this.airOpen = true
+        this.curtainOpen = true
+        this.waterOpen = true
+        this.fanOpen = true
+        this.wetOpen = true
+        this.img = this.imgpath + 'allopen.png'
+      }
+    },
+    lampCloseClick() {
+      console.log('this.lampOpen', this.lampOpen)
+      if (this.lampOpen) {
+        this.lampOpen = false
 
-                this.wetOpen = true;
-                this.img = this.imgpath + 'allopen.png';
-            }
-            this.airOpen = true;
-            this.lampOpen = true;
-            this.curtainOpen = true;
-            this.waterOpen = true;
-            this.fanOpen = true;
-        },
-        curtainOpenClick() {
-            if (!this.curtainOpen) {
-                this.airOpen = true;
-                this.lampOpen = true;
-                this.curtainOpen = true;
-                this.waterOpen = true;
-                this.fanOpen = true;
-                this.wetOpen = true;
-                this.img = this.imgpath + 'allopen.png';
-            }
-        },
-        curtainCloseClick() {
-            if (this.curtainOpen) {
-                this.curtainOpen = false;
+        this.airOpen = true
+        this.curtainOpen = true
+        this.waterOpen = true
+        this.fanOpen = true
+        this.wetOpen = true
+        this.img = this.imgpath + 'lampclose.png'
+      }
+    },
+    fanClick() {
+      if (this.fanOpen) {
+        this.fanOpen = false
+        this.img = this.imgpath + 'fanclose.png'
+      } else {
+        this.fanOpen = true
+        this.img = this.imgpath + 'allopen.png'
+      }
+      this.airOpen = true
+      this.lampOpen = true
+      this.curtainOpen = true
+      this.waterOpen = true
+      this.wetOpen = true
+    },
+    waterClick() {
+      if (this.waterOpen) {
+        this.waterOpen = false
+        this.img = this.imgpath + 'waterclose.png'
+      } else {
+        this.waterOpen = true
+        this.img = this.imgpath + 'allopen.png'
+      }
+      this.airOpen = true
+      this.lampOpen = true
+      this.curtainOpen = true
+      this.fanOpen = true
+      this.wetOpen = true
+    },
+    wetClick() {
+      if (this.wetOpen) {
+        this.wetOpen = false
+        this.img = this.imgpath + 'wetclose.png'
+      } else {
+        this.wetOpen = true
+        this.img = this.imgpath + 'allopen.png'
+      }
+      this.airOpen = true
+      this.lampOpen = true
+      this.curtainOpen = true
+      this.waterOpen = true
+      this.fanOpen = true
+    },
+    curtainOpenClick() {
+      if (!this.curtainOpen) {
+        this.airOpen = true
+        this.lampOpen = true
+        this.curtainOpen = true
+        this.waterOpen = true
+        this.fanOpen = true
+        this.wetOpen = true
+        this.img = this.imgpath + 'allopen.png'
+      }
+    },
+    curtainCloseClick() {
+      if (this.curtainOpen) {
+        this.curtainOpen = false
 
-                this.airOpen = true;
-                this.lampOpen = true;
-                this.waterOpen = true;
-                this.fanOpen = true;
-                this.wetOpen = true;
-                this.img = this.imgpath + 'curtainclose.png';
-            }
-        },
-        mainBack() {
-            if (this.isHome) {
-                wx.navigateBack();
-            } else {
-                this.img = this.imgpath + 'allopen.png';
-                this.isHome = true;
-                this.showChart = false;
+        this.airOpen = true
+        this.lampOpen = true
+        this.waterOpen = true
+        this.fanOpen = true
+        this.wetOpen = true
+        this.img = this.imgpath + 'curtainclose.png'
+      }
+    },
+    mainBack() {
+      if (this.isHome) {
+        wx.navigateBack()
+      } else {
+        this.img = this.imgpath + 'allopen.png'
+        this.isHome = true
+        this.showChart = false
 
-                this.airOpen = true;
-                this.lampOpen = true;
-                this.curtainOpen = true;
-                this.waterOpen = true;
-                this.fanOpen = true;
-                this.wetOpen = true;
-            }
-        },
-        mainImgShow() {
-            //如果是参数chart页面 则只能通过back按钮
-            //如果是其他非主页面 一点击则 显示主页面图片
-            if (!this.isHome && !this.showChart) {
-                this.img = this.imgpath + 'allopen.png';
-                this.isHome = true;
+        this.airOpen = true
+        this.lampOpen = true
+        this.curtainOpen = true
+        this.waterOpen = true
+        this.fanOpen = true
+        this.wetOpen = true
+      }
+    },
+    mainImgShow() {
+            // 如果是参数chart页面 则只能通过back按钮
+            // 如果是其他非主页面 一点击则 显示主页面图片
+      if (!this.isHome && !this.showChart) {
+        this.img = this.imgpath + 'allopen.png'
+        this.isHome = true
 
-                this.airOpen = true;
-                this.lampOpen = true;
-                this.curtainOpen = true;
-                this.waterOpen = true;
-                this.fanOpen = true;
-                this.wetOpen = true;
-            }
-        }
+        this.airOpen = true
+        this.lampOpen = true
+        this.curtainOpen = true
+        this.waterOpen = true
+        this.fanOpen = true
+        this.wetOpen = true
+      }
     }
-});
+  }
+})
 </script>
 
 <config>

+ 3 - 1
src/packagesEnv/pages/officehome/index.wpy

@@ -1010,7 +1010,7 @@ import {
     queryCustomAndScence,
     queryEquipmentRunConfig
 } from '../../api/officehome.js'
-
+import { checkHasUserInfo } from '@/service/user'
 import { isWithinLocation } from '@/service/location'
 import config from '@/config'
 let spaceInfoStatusTimer = null
@@ -1256,6 +1256,7 @@ wepy.page({
   },
     // 加载字体
   onLoad(routeParams) {
+    checkHasUserInfo()
     this.getCardWidth()
     this.getWeatherInfo()// 天气预报
     var nowTimeStr = moment().format('YYYY-MM-DD')
@@ -1933,6 +1934,7 @@ wepy.page({
     toRoom() {
       this.scrollTop = null
       this.scrollTop = 0
+      console.log('----滑下来----')
       this.transY = this.transYCopy
     },
     handleWorkOff(val) {

+ 25 - 20
src/packagesEnv/pages/personalCenter/index.wpy

@@ -18,7 +18,6 @@ page {
         top: 0;
         left: 0;
         z-index: 0;
-
     }
     .contain {
         padding-top: 240rpx;
@@ -120,9 +119,10 @@ page {
 <template>
     <div class="percsonal-center">
         <page-top-bar
-        iconClickedEmitId="toPage"
-        @toPage="toPage('/packagesEnv/pages/home/index')"
-          icon="{{h5Static+'/page-top-bar/return-icon.svg'}}"></page-top-bar>
+            iconClickedEmitId="toPage"
+            @toPage="toPage('/packagesEnv/pages/home/index')"
+            icon="{{h5Static+'/page-top-bar/return-icon.svg'}}"
+        ></page-top-bar>
         <image
             class="imgst"
             src="{{h5StaticPath}}/bg-personal.png"
@@ -133,17 +133,17 @@ page {
             <div class="head">
                 <image
                     class="imgHead"
-                    src="{{h5StaticPath}}/no-person.png"
+                    src="{{userInfo.headImgUrl}}"
                 />
                 <div @click="goToPersonalInfo">
                     <div>
-                        <span class="p-name">纳兰词</span>
+                        <span class="p-name">{{userInfo.name}}</span>
                         <image
                             style="width: 24rpx;height: 24rpx;"
                             src="{{h5StaticPath}}/icon-arrow-right.svg"
                         />
                     </div>
-                    <div class="p-comp">上格云智能技术有限公司</div>
+                    <div class="p-comp">{{ userInfo.companyName }}</div>
                 </div>
             </div>
             <div class="content">
@@ -193,11 +193,11 @@ page {
             </div>
         </div>
         <footer @callPhone="openPhonePanel"></footer>
-        <custome-service-panel 
-         :show="visiblePhone" 
-         :phone="phone"
-         @custome-service-close="closePhonePanel"
-         >
+        <custome-service-panel
+            :show="visiblePhone"
+            :phone="phone"
+            @custome-service-close="closePhonePanel"
+        >
         </custome-service-panel>
         <add-miniprogram-to-desk-panel
             :show="isShowAddminiProgramToDesk"
@@ -210,12 +210,14 @@ page {
 <script>
 import wepy from '@wepy/core'
 import config from '@/config'
+import { queryUserById } from '../../api/personalCenter'
 wepy.page({
   components: {},
   props: {},
   data: {
     visiblePhone: false,
     phone: '',
+    userInfo: null,
     h5StaticPath: config.h5StaticPath + '/page-personalCenter',
     h5Static: config.h5StaticPath,
     isShowAddminiProgramToDesk: false,
@@ -225,8 +227,18 @@ wepy.page({
             { name: '关于小飒指控', icon: 'icon-tip.svg', url: '/packagesEnv/pages/personalCenter/xiaosa' }
     ]
   },
+  onLoad() {
+    this.getUserInfo()
+  },
+
   computed: {},
   methods: {
+    getUserInfo() {
+      queryUserById().then(res => {
+        this.userInfo = res.data
+        this.userInfo.headImgUrl = res.data.headImgUrl || `${this.h5StaticPath}/no-person.png`
+      })
+    },
     openPhonePanel(val) {
       this.phone = val
       this.visiblePhone = true
@@ -248,15 +260,8 @@ wepy.page({
       })
     }
 
-  },
-    // 生命周期 - 创建完成(可以访问当前this实例)
-  created() {
-
-  },
-    // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {
-
   }
+
 })
 </script>
 <config>

+ 18 - 12
src/packagesEnv/pages/personalCenter/personalInfo.wpy

@@ -80,14 +80,15 @@ page{
 
 import wepy from '@wepy/core'
 import config from '@/config'
+import { queryUserById } from '../../api/personalCenter'
 wepy.page({
   props: {},
   data: {
     h5StaticPath: config.h5StaticPath + '/page-personalCenter',
     topArr: [
-        {name: '头像', text: '', url: 'no-person.png'},
-        {name: '姓名', text: '尹亚琼', url: ''},
-        {name: '手机号', text: '186909090', url: ''}
+        {name: '头像', text: '', url: ''},
+        {name: '姓名', text: '', url: ''},
+        {name: '手机号', text: '', url: ''}
     ],
     nextArr: [
         {name: '岗位', text: 'UX设计师'},
@@ -95,17 +96,22 @@ wepy.page({
     ]
   },
   computed: {},
-  methods: {
-
-  },
-    // 生命周期 - 创建完成(可以访问当前this实例)
-  created() {
-
+  onLoad() {
+    this.getUserInfo()
   },
-    // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {
-
+  methods: {
+    getUserInfo() {
+      queryUserById().then(res => {
+        const userInfo = res.data
+        this.topArr[0].url = userInfo.headImgUrl || 'no-person.png'
+        this.topArr[1].text = userInfo.name
+        this.topArr[2].text = userInfo.phone
+        this.nextArr[0].text = userInfo.job
+        this.nextArr[1].text = userInfo.companyName
+      })
+    }
   }
+
 })
 </script>
 <config>

+ 2 - 8
src/packagesEnv/pages/portrait/home.wpy

@@ -221,14 +221,8 @@ wepy.page({
   },
   onLoad() {
     umaInit()
-    var _this = this
-    checkHasUserInfo().then(function (userInfo) {
-      console.log('checkHasUserInfo', userInfo)
-      var companyId = userInfo.companyId
-            //   saveCompanyConfig(companyId).then(() => {
-      _this.getData()
-            //   }).catch((err) => {})
-    })
+    checkHasUserInfo()
+    this.getData()
     this.carbonCreditText = carbonCredit(this.projectId)
   },
   onReady() { },

+ 57 - 58
src/packagesEnv/pages/portrait/visitor.wpy

@@ -292,24 +292,24 @@ page {
 </template>
 
 <script>
-import wepy from '@wepy/core';
-import store from '@/store';
-import config from '@/config';
-import moment from 'moment';
-import { mapState } from '@wepy/x';
-import { checkLogin, checkHasUserInfo } from '@/service/user';
-import { queryInvitationStatisticsHttp, queeyBuriedEventLogHttp } from '@/packagesEnv/api/portrait';
+import wepy from '@wepy/core'
+import store from '@/store'
+import config from '@/config'
+import moment from 'moment'
+import { mapState } from '@wepy/x'
+import { checkLogin, checkHasUserInfo } from '@/service/user'
+import { queryInvitationStatisticsHttp, queeyBuriedEventLogHttp } from '@/packagesEnv/api/portrait'
 
-let numChart = null;
+let numChart = null
 let resultData = {
   data: [
 
   ]
 }
 function numChartData(F2, config) {
-  let data = resultData.data;
-  numChart = new F2.Chart({ ...config, appendPadding: [30, 30, 15, 5] });
-  numChart.clear();
+  let data = resultData.data
+  numChart = new F2.Chart({ ...config, appendPadding: [30, 30, 15, 5] })
+  numChart.clear()
   numChart.source(data, {
     'x': {
       type: 'linear',
@@ -319,7 +319,7 @@ function numChartData(F2, config) {
 
     }
 
-  });
+  })
 
   numChart.guide().text({
     top: false,
@@ -332,7 +332,7 @@ function numChartData(F2, config) {
     }, // 文本的图形样式属性
     offsetX: 20, // x 方向的偏移量
     offsetY: 12 // y 方向偏移量
-  });
+  })
   numChart.guide().text({
     position: ['min', 'max'], // 文本的起始位置,值为原始数据值,支持 callback
     content: '时长', // 显示的文本内容
@@ -342,8 +342,8 @@ function numChartData(F2, config) {
     }, // 文本的图形样式属性
     offsetX: -4, // x 方向的偏移量
     offsetY: -20 // y 方向偏移量
-  });
-  numChart.tooltip(false);
+  })
+  numChart.tooltip(false)
   numChart.point().position('x*y')
         .size('r', [0, 30])
         .shape('circle')
@@ -351,8 +351,8 @@ function numChartData(F2, config) {
           opacity: 0.6
         })
 
-  numChart.render();
-  return numChart;
+  numChart.render()
+  return numChart
 }
 wepy.page({
   store,
@@ -379,9 +379,8 @@ wepy.page({
     ...mapState({ userInfo: state => state.user.userInfo, token: state => state.user.token })
   },
   onLoad() {
-    checkHasUserInfo().then(() => {
-      this.getData();
-    })
+    checkHasUserInfo()
+    this.getData()
   },
   onReady() { },
   methods: {
@@ -398,14 +397,14 @@ wepy.page({
           this.imgSrc = res.tempFilePath
         },
         fail: res => {
-          console.log('转图片失败', res);
+          console.log('转图片失败', res)
         }
       }, this)
     },
     async  getData() {
-      let res = await this.getInvitationStatistics();
+      let res = await this.getInvitationStatistics()
       if (res && res.visitorTotal) { // 有访客,显示界面,再请求
-        await this.getBuriedEventLog();
+        await this.getBuriedEventLog()
         this.isPageShow = true
       }
     },
@@ -421,29 +420,29 @@ wepy.page({
         endDate: endDate
       }
       return queryInvitationStatisticsHttp(paramObj).then(res => {
-        this.isPageShow = false;
+        this.isPageShow = false
         if (JSON.stringify(res.data) === '{}') { return };
-        let resData = JSON.parse(JSON.stringify(res.data));
-        this.infoArr[0].value = resData.visitorTotal;
-        this.infoArr[1].value = resData.invitationTimeTotal;
-        this.infoArr[2].value = Number.isInteger(resData.avgTimePerDay) ? resData.avgTimePerDay : resData.avgTimePerDay.toFixed(2);
+        let resData = JSON.parse(JSON.stringify(res.data))
+        this.infoArr[0].value = resData.visitorTotal
+        this.infoArr[1].value = resData.invitationTimeTotal
+        this.infoArr[2].value = Number.isInteger(resData.avgTimePerDay) ? resData.avgTimePerDay : resData.avgTimePerDay.toFixed(2)
 
-        let charArr = [];
-        let resCharArr = resData.detailList;
+        let charArr = []
+        let resCharArr = resData.detailList
 
-        let startMonthday = this.yearMonth + '01';
-        let endMonthday = moment(this.yearMonth).endOf('month').format('YYYYMMDD');
+        let startMonthday = this.yearMonth + '01'
+        let endMonthday = moment(this.yearMonth).endOf('month').format('YYYYMMDD')
                 // 补齐坐标轴
         for (let i = Number(startMonthday); i <= Number(endMonthday); i++) {
-          let flag = true;
-          let jItem = {};
+          let flag = true
+          let jItem = {}
           resCharArr.forEach(j => {
-            let JMs = j.date; // 时间戳
+            let JMs = j.date // 时间戳
             if (i == JMs) {
-              flag = false;
-              jItem = j;
+              flag = false
+              jItem = j
             }
-          });
+          })
           if (flag) {
             charArr.push({
               date: i,
@@ -454,15 +453,15 @@ wepy.page({
             charArr.push(jItem)
           }
         }
-        let visitorNumArr = []; // 人数
-        let invitationTimeArr = []; // 时长
+        let visitorNumArr = [] // 人数
+        let invitationTimeArr = [] // 时长
         charArr.forEach(item => {
-          let dateItem = String(item.date);
-          item.date = moment(dateItem).format('DD');
-          visitorNumArr.push({ x: item.date, y: item.invitationTime, r: item.visitorNum, color: '#5E8BCF' });
-          invitationTimeArr.push({ x: item.date, y: item.invitationTime, r: item.invitationTime, color: '#D0DBED' });
+          let dateItem = String(item.date)
+          item.date = moment(dateItem).format('DD')
+          visitorNumArr.push({ x: item.date, y: item.invitationTime, r: item.visitorNum, color: '#5E8BCF' })
+          invitationTimeArr.push({ x: item.date, y: item.invitationTime, r: item.invitationTime, color: '#D0DBED' })
         })
-        resultData.data = invitationTimeArr.concat(visitorNumArr);
+        resultData.data = invitationTimeArr.concat(visitorNumArr)
         // return new Promise((res, reject) => {
         //   this.canvasToImg();
         // })
@@ -471,7 +470,7 @@ wepy.page({
       })
     },
     getBuriedEventLog() { // 访客使用的功能
-      let funArr = ['connect_wifi', 'navigation'];
+      let funArr = ['connect_wifi', 'navigation']
       let $lt = ''
       if (moment().format('YYYYMM') === this.yearMonth) {
         $lt = moment().add(1, 'days').format('YYYYMMDD')
@@ -490,36 +489,36 @@ wepy.page({
         return queeyBuriedEventLogHttp(paramObj).then(res => {
           if (res.count) {
             if (res.content[0].name === 'connect_wifi') {
-              this.functionArr[0].value = res.count;
+              this.functionArr[0].value = res.count
             } else {
-              this.functionArr[1].value = res.count;
+              this.functionArr[1].value = res.count
             }
-            let maxValue = Math.max.apply(Math, this.functionArr.map(item => { return item.value }));
+            let maxValue = Math.max.apply(Math, this.functionArr.map(item => { return item.value }))
             this.functionArr.forEach(item => {
               item.wth = item.value / maxValue * 220 // 220 为最大宽度
             })
           } else {
             this.functionArr.forEach(item => {
               item.value = 0
-              item.wth = 0;
+              item.wth = 0
             })
           }
         })
       })
     },
     checkTime(val) {
-      wx.uma.trackEvent('portrait_visitor_card', { key: '访客-月份切换' });
-      this.visible = !this.visible;
-      this.chartFlag = false;
-      this.yearMonth = val;
-      this.yearMonthText = moment(this.yearMonth).format('YYYY.MM');
-      this.getData();
+      wx.uma.trackEvent('portrait_visitor_card', { key: '访客-月份切换' })
+      this.visible = !this.visible
+      this.chartFlag = false
+      this.yearMonth = val
+      this.yearMonthText = moment(this.yearMonth).format('YYYY.MM')
+      this.getData()
     },
     changeMonth() {
-      this.visible = !this.visible;
+      this.visible = !this.visible
     }
   }
-});
+})
 </script>
 
 <config>