diff --git a/App.vue b/App.vue index da7524f..7f0c7d5 100644 --- a/App.vue +++ b/App.vue @@ -46,6 +46,11 @@ this.$u.get("/user/getUser").then(data => { uni.setStorageSync("weapp_session_userInfo_data", data) }) + this.$u.get("/user/getMenu").then(data => { + uni.setStorageSync("weapp_session_Menu_data", data) + }) + + wx.setInnerAudioOption({ obeyMuteSwitch: false }); diff --git a/config.js b/config.js index a6d4e94..ba87998 100644 --- a/config.js +++ b/config.js @@ -22,6 +22,8 @@ var config = { login: `${host}/user/login`, //获取用户信息 getUser: `${host}/user/getUser`, + //获取权限 + getMenu:`${host}/user/getMenu`, //发送验证码 sendCode:`${host}/user/sendCode`, //验证码校验 diff --git a/pages/index/index.vue b/pages/index/index.vue index bef9ab5..c207c79 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,6 +1,6 @@ @@ -209,58 +189,76 @@ export default { data() { return { - userInfo:{}, - Showhiddenunits:false, - lpanlist:[],//楼盘列表 - buildingname:'',//楼盘名 - buildingID:'',//楼盘id - buildingishow:false,//是否选择楼盘 - Myworkcard:false, - percentage:'',//设备电量 - Whetheroffline:false,//是否离线 - signalDevice:0,//信号 - signalDevicetext:"", - audioStatus:false, - equipmentisshow:false, - equipmentobj:{ - totalNum:'', - onlineNum:'', - activeNum:'', - lowPowerNum:'', + userInfo: {}, + Showhiddenunits: false, + lpanlist: [], //楼盘列表 + buildingname: '', //楼盘名 + buildingID: '', //楼盘id + buildingishow: false, //是否选择楼盘 + Myworkcard: false, + percentage: '', //设备电量 + Whetheroffline: false, //是否离线 + signalDevice: 0, //信号 + signalDevicetext: "", + audioStatus: false, + equipmentisshow: false, + equipmentobj: { + totalNum: '', + onlineNum: '', + activeNum: '', + lowPowerNum: '', + }, + Menulist: [], + realtimeobj: { + sumCustomer: '', + receivingCustomer: '', + activeCustomer: '', + sumDuration: '', + tagCustomer: '', + fraction: '', + }, + Thisweekobj: { + sumCustomer: '', + receivingCustomer: '', + activeCustomer: '', + sumDuration: '', + tagCustomer: '', + fraction: '', } }; }, components: {}, onShow() { this.userInfo = uni.getStorageSync('weapp_session_userInfo_data'); - if(this.userInfo.zkProperties.length==1){ - this.buildingID=uni.getStorageSync('buildingID').id; - this.buildingname=uni.getStorageSync('buildingID').name; - this.buildingishow=false; - }else{ - this.buildingishow=true; - this.buildingname=uni.getStorageSync('buildingID').name; - this.buildingID=uni.getStorageSync('buildingID').id; - this.userInfo.zkProperties.forEach(item=>{ - item.label=item.propertyName; - item.value=item.id + this.Menulist = uni.getStorageSync('weapp_session_Menu_data'); + if (this.userInfo.zkProperties.length == 1) { + this.buildingID = uni.getStorageSync('buildingID').id; + this.buildingname = uni.getStorageSync('buildingID').name; + this.buildingishow = false; + } else { + this.buildingishow = true; + this.buildingname = uni.getStorageSync('buildingID').name; + this.buildingID = uni.getStorageSync('buildingID').id; + this.userInfo.zkProperties.forEach(item => { + item.label = item.propertyName; + item.value = item.id }) - this.lpanlist=this.userInfo.zkProperties + this.lpanlist = this.userInfo.zkProperties } if (this.userInfo.dataCode == 6) { - this.Myworkcard=true; - this.equipmentisshow=false; + this.Myworkcard = true; + this.equipmentisshow = false; this.iniodianloang() - }else{ - this.equipmentisshow=true; - this.Myworkcard=false; + } else { + this.equipmentisshow = true; + this.Myworkcard = false; this.initequipment() } this.initworkThisWeek() - // this.initrealTimeStatistics() + this.initrealTimeStatistics() }, methods: { - initworkThisWeek(){ + initworkThisWeek() { uni.request({ url: config.service.workThisWeek, method: "POST", @@ -269,19 +267,26 @@ 'Access-Token': uni.getStorageSync('weapp_session_login_data').token }, data: { - houseId:this.buildingID + houseId: this.buildingID }, success: (data) => { if (data.data.data == null) { return - }else{ - + } else { + this.Thisweekobj = { + sumCustomer: data.data.data.sumCustomer, + receivingCustomer: data.data.data.receivingCustomer, + activeCustomer: data.data.data.activeCustomer, + sumDuration: data.data.data.sumDuration, + tagCustomer: data.data.data.tagCustomer, + fraction: data.data.data.fraction, + } } } }) }, //实时统计 - initrealTimeStatistics(){ + initrealTimeStatistics() { uni.request({ url: config.service.realTimeStatistics, method: "POST", @@ -290,19 +295,26 @@ 'Access-Token': uni.getStorageSync('weapp_session_login_data').token }, data: { - houseId:this.buildingID + houseId: this.buildingID }, success: (data) => { if (data.data.data == null) { return - }else{ - + } else { + this.realtimeobj = { + sumCustomer: data.data.data.sumCustomer, + receivingCustomer: data.data.data.receivingCustomer, + activeCustomer: data.data.data.activeCustomer, + sumDuration: data.data.data.sumDuration, + tagCustomer: data.data.data.tagCustomer, + fraction: data.data.data.fraction, + } } } }) }, //设备 - initequipment(){ + initequipment() { uni.request({ url: config.service.findEquipmentState, method: "POST", @@ -311,17 +323,17 @@ 'Access-Token': uni.getStorageSync('weapp_session_login_data').token }, data: { - propertyId:this.buildingID + propertyId: this.buildingID }, success: (data) => { if (data.data.data == null) { return - }else{ - this.equipmentobj={ - totalNum:'0', - onlineNum:'0', - activeNum:'0', - lowPowerNum:'0', + } else { + this.equipmentobj = { + totalNum: data.data.data.totalNum, + onlineNum: data.data.data.onlineNum, + activeNum: data.data.data.activeNum, + lowPowerNum: data.data.data.lowPowerNum, } } } @@ -344,229 +356,212 @@ if (data.data.data > 100) { this.percentage = 100; } else { - if(data.data.data.onLine==0){ - this.Whetheroffline=false; - }else{ - this.Whetheroffline=true; + if (data.data.data.onLine == 0) { + this.Whetheroffline = false; + } else { + this.Whetheroffline = true; this.percentage = data.data.data.electricity; - this.signalDevice=data.data.data.signalDevice/1; + this.signalDevice = data.data.data.signalDevice / 1; console.log(this.signalDevice) - this.audioStatus=data.data.data.audioStatus; - if(this.signalDevice>80){ - this.signalDevicetext='高'; - }else{ - if(this.signalDevice==0){ - this.signalDevicetext='无'; - }else{ - this.signalDevicetext='低'; + this.audioStatus = data.data.data.audioStatus; + if (this.signalDevice > 80) { + this.signalDevicetext = '高'; + } else { + if (this.signalDevice == 0) { + this.signalDevicetext = '无'; + } else { + this.signalDevicetext = '低'; } } - } - - } + } + + } } } }) }, //选择楼盘弹框 - piskbuilding(){ - this.Showhiddenunits=true; + piskbuilding() { + this.Showhiddenunits = true; }, // 楼盘选择确认 confirm(e) { - this.buildingname=e[0].label; - this.buildingID=e[0].value; - let lopan={ - id:e[0].value, - name:e[0].label + this.buildingname = e[0].label; + this.buildingID = e[0].value; + let lopan = { + id: e[0].value, + name: e[0].label } uni.setStorageSync("buildingID", lopan); //楼盘id写入缓存 }, // 楼盘选择取消 - cancel(){ - this.Showhiddenunits=false; - }, - //销讲数据 - Piabodata(){ - uni.navigateTo({ - url: '/pages/center/Piabodata/index' - }); - }, - // 接待记录 - record(){ - uni.navigateTo({ - url: '/pages/center/records/index' - }); + cancel() { + this.Showhiddenunits = false; }, - //值班顾问 - toconsultanonduty(){ - uni.navigateTo({ - url: '/pages/mine/consultanonduty/index' - }); - }, - //设备 - toequipment(){ - uni.navigateTo({ - url: '/pages/mine/equipment/index' - }); - }, - // 客户管理 - goConsumer(){ - uni.navigateTo({ - url: '/pages/center/consumer/index' - }); + Piabodata(item) { + if (item == '销讲数据') { + uni.navigateTo({ + url: '/pages/center/Piabodata/index' + }); + } else if (item == '接待记录') { + uni.navigateTo({ + url: '/pages/center/records/index' + }); + } else if (item == '值班顾问') { + uni.navigateTo({ + url: '/pages/mine/consultanonduty/index' + }); + } else if (item == '设备管理') { + uni.navigateTo({ + url: '/pages/mine/equipment/index' + }); + } else { + uni.navigateTo({ + url: '/pages/center/consumer/index' + }); + } }, }, - + }; diff --git a/pages/login/index.vue b/pages/login/index.vue index 450e439..036fb95 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -105,6 +105,7 @@ 'token': res }; uni.setStorageSync(WXB_SESSION_LOGIN_DATA, data); //写入缓存 + that.getMenu() that.getUser(); util.showSuccess('登录成功'); } else { @@ -145,6 +146,11 @@ url: '/pages/index/index' }); }); + }, + getMenu(){ + this.$u.get("/user/getMenu").then(data => { + uni.setStorageSync("weapp_session_Menu_data", data) + }) } diff --git a/pages/login/yinzhongmalogin.vue b/pages/login/yinzhongmalogin.vue index 3f48475..c752516 100644 --- a/pages/login/yinzhongmalogin.vue +++ b/pages/login/yinzhongmalogin.vue @@ -120,6 +120,7 @@ 'token': data.data.data }; uni.setStorageSync(WXB_SESSION_LOGIN_DATA, token); //写入缓存 + this.getMenu() this.getUser() } else { util.showNone(data.data.message); @@ -134,6 +135,11 @@ }); } }, + getMenu(){ + this.$u.get("/user/getMenu").then(data => { + uni.setStorageSync("weapp_session_Menu_data", data) + }) + }, getUser(){ util.getRequestPromise(config.service.getUser, {}, false, "GET").then(data => { if (data.zkProperties) { diff --git a/static/images/function1.png b/static/images/function1.png new file mode 100644 index 0000000..d010077 Binary files /dev/null and b/static/images/function1.png differ diff --git a/static/images/function2.png b/static/images/function2.png new file mode 100644 index 0000000..4c62afd Binary files /dev/null and b/static/images/function2.png differ diff --git a/static/images/function3.png b/static/images/function3.png new file mode 100644 index 0000000..2259922 Binary files /dev/null and b/static/images/function3.png differ diff --git a/static/images/function4.png b/static/images/function4.png new file mode 100644 index 0000000..c3c75a4 Binary files /dev/null and b/static/images/function4.png differ diff --git a/static/images/function5.png b/static/images/function5.png new file mode 100644 index 0000000..bb4f2f5 Binary files /dev/null and b/static/images/function5.png differ diff --git a/static/images/function6.png b/static/images/function6.png new file mode 100644 index 0000000..2420b00 Binary files /dev/null and b/static/images/function6.png differ diff --git a/static/images/function7.png b/static/images/function7.png new file mode 100644 index 0000000..a348f35 Binary files /dev/null and b/static/images/function7.png differ