From 7e5baac43c4625b128146571a321b965b90565c5 Mon Sep 17 00:00:00 2001 From: douzhuo <17611323298@163.com> Date: Thu, 12 Jan 2023 10:32:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=8C=B9=E9=85=8D=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 59 +----- config.js | 1 + pages/center/consumer/consumerDetail.vue | 2 +- pages/index/index.vue | 231 ++++++++++++++--------- pages/index/personal.vue | 1 - utils/util.js | 2 +- 6 files changed, 142 insertions(+), 154 deletions(-) diff --git a/App.vue b/App.vue index 278a56c..5fcc8f6 100644 --- a/App.vue +++ b/App.vue @@ -165,66 +165,9 @@ }).catch(e=>{}) } const token = uni.getStorageSync("weapp_session_login_data") - if (typeof token.token != "string") { - console.log("没有") - return - } else { - this.infoscoket() - } }, onHide() {}, - methods: { - infoscoket() { - let pushon = uni.getStorageSync('weapp_session_userInfo_data').loginName - uni.connectSocket({ - url: 'wss://hfju.com/ws?uid=' + pushon + '_applets', - header: { - "content-type": "application/json", - 'Access-Token': uni.getStorageSync('weapp_session_login_data').token - } - }); - uni.onSocketOpen(function(res) { - console.log('WebSocket连接已打开!'); - }); - uni.onSocketError(function(res) { - console.log('WebSocket连接打开失败,请检查!'); - }); - uni.onSocketMessage(function(res) { - console.log('收到服务器内容:' + res.data); - let cedata = JSON.stringify(res); - let data = JSON.parse(cedata); - let zdata = JSON.parse(data.data) - if (zdata.to == "recCmd") { - uni.$emit('update', { - msg: '页面更新' - }) - return - } - uni.showModal({ - title: '提示', - content: zdata.to + '的设备电量过低请检查!', - cancelText: "取消", // 取消按钮的文字 - confirmText: "查看", // 确认按钮文字 - success: function(res) { - if (res.confirm) { - console.log('用户点击确定'); - uni.navigateTo({ - url: `/pages/main/toviewtherecording/index?jump=` + "jump" - }) - } else if (res.cancel) { - console.log('用户点击取消'); - } - } - }); - }); - }, - Closewebsocke() { - uni.closeSocket(); - uni.onSocketClose(function(res) { - console.log('WebSocket 已关闭!'); - }); - }, - } + methods: {}, }; diff --git a/config.js b/config.js index e830fea..9daba82 100644 --- a/config.js +++ b/config.js @@ -3,6 +3,7 @@ import { host, iMServiceHost } from './utils/domain.js' var config = { service: { host, + iMServiceHost, getStage:`${host}/customer/getStage`, //验证toen diff --git a/pages/center/consumer/consumerDetail.vue b/pages/center/consumer/consumerDetail.vue index de95e77..f3c1f58 100644 --- a/pages/center/consumer/consumerDetail.vue +++ b/pages/center/consumer/consumerDetail.vue @@ -395,7 +395,7 @@ - 添加提醒 + 写跟进 diff --git a/pages/index/index.vue b/pages/index/index.vue index 11b2dce..0e4e823 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -63,32 +63,56 @@ - + - + 您的服务于{{ bulidIngObj.endWorking }}到期,为了避免影响您的使用,请与服务商联系 - 设备 - - - {{equipmentobj.totalNum || 0}} - 设备总数 - - - {{equipmentobj.onlineNum || 0}} - 在线 - - - {{equipmentobj.activeNum || 0}} - 活跃 + + + 实时统计 @@ -301,6 +325,7 @@ statDateStart: '', statDateEnd: '', needShow: ['客户管理', '接待记录', '销讲数据', '设备管理', '值班顾问', '顾问排名', '违禁记录'], // 权限配置需要展示出来的功能入口 + paraphraseObj: {}, // 转写消费 }; }, @@ -328,15 +353,15 @@ }) } this.initPopup() - + }, onShow() { - this.upDateBulidIngObj() + this.upDateBulidIngObj() this.LOADING = true this.getMenu() - + this.userInfo = uni.getStorageSync('weapp_session_userInfo_data'); if (this.userInfo.dataCode == 6 || this.userInfo.dataCode == 3) { this.methodsisshow = false; @@ -369,6 +394,7 @@ this.initworkThisWeek() this.initrealTimeStatistics() this.updateInit() + this.findByHouseIdForRecharge() }, onPullDownRefresh() { @@ -405,17 +431,19 @@ } this.initworkThisWeek() this.initrealTimeStatistics() + this.findByHouseIdForRecharge() + setTimeout(() => { uni.stopPullDownRefresh() }, 3000) }, methods: { max100(num) { - if(num>100){ + if (num > 100) { return 100 - } else if(!num){ + } else if (!num) { return 0; - }else{ + } else { return num; } }, @@ -519,13 +547,13 @@ uni.setStorageSync("weapp_session_Menu_data", data) this.Menulist = uni.getStorageSync('weapp_session_Menu_data'); let remind = uni.getStorageSync("remind"); - uni.setStorageSync("remind",1); - if(this.Menulist.length){ + uni.setStorageSync("remind", 1); + if (this.Menulist.length) { if (this.Menulist.findIndex(item => item.name == '今日接待弹框') != -1) { - this.modalShow = remind==0?true:false - } else { - this.modalShow = false - } + this.modalShow = remind == 0 ? true : false + } else { + this.modalShow = false + } } }) }, @@ -597,15 +625,15 @@ return } else { this.realtimeobj = { - sumCustomer: data.data.data.sumCustomer||0, - receivingCustomer: data.data.data.receivingCustomer||0, - activeCustomer: data.data.data.activeCustomer||0, - prohibitedCustomer: data.data.data.prohibitedCustomer||0, + sumCustomer: data.data.data.sumCustomer || 0, + receivingCustomer: data.data.data.receivingCustomer || 0, + activeCustomer: data.data.data.activeCustomer || 0, + prohibitedCustomer: data.data.data.prohibitedCustomer || 0, avgDuration: Math.floor(data.data.data.avgDuration / 60) || 0, - tagCustomer: data.data.data.tagCustomer||0, - fraction: data.data.data.fraction||0, - wordFinishFraction: data.data.data.wordFinishFraction||0, - receptionCount: data.data.data.receptionCount||0 + tagCustomer: data.data.data.tagCustomer || 0, + fraction: data.data.data.fraction || 0, + wordFinishFraction: data.data.data.wordFinishFraction || 0, + receptionCount: data.data.data.receptionCount || 0 } } }, @@ -614,6 +642,16 @@ } }) }, + + // 转写充值剩余 + findByHouseIdForRecharge() { + this.$u.get(`/cusLvStatistics/findByHouseIdForRecharge?houseId=${this.buildingID}`).then(res => { + console.log(res) + if (res) { + this.paraphraseObj = res.list + } + }) + }, //设备 initequipment() { @@ -868,61 +906,68 @@