Browse Source

标签匹配模型

branch0222
douzhuo 1 year ago
parent
commit
7e5baac43c
6 changed files with 142 additions and 154 deletions
  1. +1
    -58
      App.vue
  2. +1
    -0
      config.js
  3. +1
    -1
      pages/center/consumer/consumerDetail.vue
  4. +138
    -93
      pages/index/index.vue
  5. +0
    -1
      pages/index/personal.vue
  6. +1
    -1
      utils/util.js

+ 1
- 58
App.vue View File

@@ -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: {},
};
</script>



+ 1
- 0
config.js View File

@@ -3,6 +3,7 @@ import { host, iMServiceHost } from './utils/domain.js'
var config = {
service: {
host,
iMServiceHost,
getStage:`${host}/customer/getStage`,
//验证toen


+ 1
- 1
pages/center/consumer/consumerDetail.vue View File

@@ -395,7 +395,7 @@
</view>

<view class="pon-foot" v-if="buttonisshow">
<view class="foot-tab" @click="goRemind">添加提醒</view>
<!-- <view class="foot-tab" @click="goRemind">添加提醒</view> -->
<view class="foot-tab" @click="followRecordAdd()">写跟进</view>
</view>
<!-- closeable -->


+ 138
- 93
pages/index/index.vue View File

@@ -63,32 +63,56 @@
</view>
</view>
</view>
<!-- 临期项目提醒 -->
<view class="endworking" v-if="bulidIngObj.daysRemaining <= 60" :class="{sixty: (bulidIngObj.daysRemaining > 15 && bulidIngObj.daysRemaining <= 60), fifteen: bulidIngObj.daysRemaining <= 15}">
<view class="endworking" v-if="bulidIngObj.daysRemaining <= 60"
:class="{sixty: (bulidIngObj.daysRemaining > 15 && bulidIngObj.daysRemaining <= 60), fifteen: bulidIngObj.daysRemaining <= 15}">
您的服务于{{ bulidIngObj.endWorking }}到期,为了避免影响您的使用,请与服务商联系
</view>

<view class="title" v-if="equipmentisshow">设备</view>
<view class="shebenbox" v-if="equipmentisshow">
<view class="shebenche" @click="tapjumpequipment(0)">
<view class="shebenchenum">{{equipmentobj.totalNum || 0}}</view>
<view class="shebenchetext">设备总数</view>
</view>
<view class="shebenche" @click="tapjumpequipment(1)">
<view class="shebenchenum">{{equipmentobj.onlineNum || 0}}</view>
<view class="shebenchetext">在线</view>
</view>
<view class="shebenche" @click="tapjumpequipment(3)">
<view class="shebenchenum">{{equipmentobj.activeNum || 0}}</view>
<view class="shebenchetext">活跃</view>
<template v-if="checkAuthority('转写时长剩余')">
<view class="title">转写消费</view>
<view class="shebenbox">
<view class="shebenche">
<view class="shebenchenum">{{paraphraseObj.rechargeSum || 0}}</view>
<view class="shebenchetext">购买小时</view>
</view>
<view class="shebenche">
<view class="shebenchenum">{{paraphraseObj.presenterSum || 0}}</view>
<view class="shebenchetext">赠送小时</view>
</view>
<view class="shebenche">
<view class="shebenchenum">{{paraphraseObj.useSum || 0}}</view>
<view class="shebenchetext">已用小时</view>
</view>
<view class="shebenche">
<view class="shebenchenum" :style="paraphraseObj.surplusSum < 100 ? 'color: red' : ''">{{paraphraseObj.surplusSum || 0}}</view>
<view class="shebenchetext">剩余小时</view>
</view>
</view>
<view class="shebenche" @click="tapjumpequipment(2)">
<view class="shebenchenum" style="color: red;">{{equipmentobj.lowPowerNum || 0}}</view>
<view class="shebenchetext">急需充电</view>
</template>

<template v-if="equipmentisshow">
<view class="title" >设备</view>
<view class="shebenbox">
<view class="shebenche" @click="tapjumpequipment(0)">
<view class="shebenchenum">{{equipmentobj.totalNum || 0}}</view>
<view class="shebenchetext">设备总数</view>
</view>
<view class="shebenche" @click="tapjumpequipment(1)">
<view class="shebenchenum">{{equipmentobj.onlineNum || 0}}</view>
<view class="shebenchetext">在线</view>
</view>
<view class="shebenche" @click="tapjumpequipment(3)">
<view class="shebenchenum">{{equipmentobj.activeNum || 0}}</view>
<view class="shebenchetext">活跃</view>
</view>
<view class="shebenche" @click="tapjumpequipment(2)">
<view class="shebenchenum" style="color: red;">{{equipmentobj.lowPowerNum || 0}}</view>
<view class="shebenchetext">急需充电</view>
</view>
</view>
</view>

</template>
<view class="title">实时统计</view>
<view class="real-timebox">
<view class="timebox">
@@ -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 @@
</script>

<style lang="scss" scoped>
.modal-box{
display: flex;
flex-direction: column;
align-items: center;
width: 590rpx;
padding: 50rpx 30rpx 60rpx;
.modal-title{
text-align: center;
height: 45rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 45rpx;
margin-bottom: 60rpx;
}
.number-box{
width: 100%;
.modal-box {
display: flex;
justify-content: space-around;
margin-bottom: 80rpx;
.item{
flex-direction: column;
align-items: center;
width: 590rpx;
padding: 50rpx 30rpx 60rpx;

.modal-title {
text-align: center;
height: 45rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 45rpx;
margin-bottom: 60rpx;
}

.number-box {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
.num{
margin-bottom: 12rpx;
height: 60rpx;
font-size: 42rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333333;
line-height: 60rpx;
margin-bottom: 12rpx;
}
.num-text{
height: 45rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 45rpx;
justify-content: space-around;
margin-bottom: 80rpx;

.item {
display: flex;
flex-direction: column;
align-items: center;

.num {
margin-bottom: 12rpx;
height: 60rpx;
font-size: 42rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333333;
line-height: 60rpx;
margin-bottom: 12rpx;
}

.num-text {
height: 45rpx;
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 45rpx;
}
}
}

.get {
width: 400rpx;
height: 80rpx;
background: #3E50E8;
border-radius: 8rpx;
text-align: center;
line-height: 80rpx;
color: #fff;
}
}
.get{
width: 400rpx;
height: 80rpx;
background: #3E50E8;
border-radius: 8rpx;
text-align: center;
line-height: 80rpx;
color: #fff;
}
}

.update {
width: 100%;
height: 100%;
@@ -1235,17 +1280,17 @@
}
}
}
.endworking {
margin-top: 20rpx;
padding: 15rpx 30rpx;
width: 100%;
}
.sixty {
background-color: #FDFCDA;
}
.fifteen {
background-color: #F9C8C8;
color: #ff0000;


+ 0
- 1
pages/index/personal.vue View File

@@ -169,7 +169,6 @@
showCancel: true,
success:(res) => {
if (res.confirm) {
app.Closewebsocke()
uni.clearStorageSync(); //清除缓存
this.$u.post('/user/exitSystem', {id: uni.getStorageSync('exitSystemId')})
uni.showToast({


+ 1
- 1
utils/util.js View File

@@ -1,4 +1,4 @@
let WebIM = uni.WebIM = require("./WebIM.js")["default"];
// let WebIM = uni.WebIM = require("./WebIM.js")["default"];

function formatLongTime(mss) {
var days = parseInt(mss / (1000 * 60 * 60 * 24));


Loading…
Cancel
Save