Commit 5a28f929 authored by 郑娟's avatar 郑娟

消息数量提示

parent f1a91f0d
......@@ -11,5 +11,5 @@ module.exports = {
ocrPath:'"http://180.104.121.66:8088/r/api"',
fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="',
appId: '"com.xcmg.app.dev"',
currentVersion: '"4.2.0"'
currentVersion: '"4.2.2"'
}
......@@ -52,7 +52,9 @@
<div class="info-content">
<div class="add-name">
<img src="@/assets/functionCenter/con-sign@2x.png" alt="">
<div class="name-title">融租方案确认</div>
<div class="name-title">融租方案确认
<p v-if="signCount > 0" :class="{'content-wrap-class-width':signCount > 99, 'content-wrap-class':signCount <= 99}">{{ signCount > 99 ? '99+' : signCount }}</p>
</div>
</div>
<div class="add-content" @click="conSign">
<img src="@/assets/functionCenter/in@2x.png" alt="">
......@@ -61,7 +63,7 @@
<div class="info-content">
<div class="add-name">
<img src="@/assets/functionCenter/con-sign@2x.png" alt="">
<div class="name-title">合同创建</div>
<div class="name-title">合同创建</div>
</div>
<div class="add-content" @click="goStart">
<img src="@/assets/functionCenter/in@2x.png" alt="">
......@@ -79,7 +81,9 @@
<div class="info-content">
<div class="add-name">
<img src="@/assets/functionCenter/car@2x.png" alt="">
<div class="name-title">合同签订</div>
<div class="name-title">合同签订
<p v-if="carCount > 0" :class="{'content-wrap-class-width':carCount > 99, 'content-wrap-class':carCount <= 99}">{{ carCount > 99 ? '99+' : carCount }}</p>
</div>
</div>
<div class="add-content" @click="goCarConfirm">
<img src="@/assets/functionCenter/in@2x.png" alt="">
......@@ -179,6 +183,9 @@ export default {
pagenum: 1,
role: '未绑定',
// multipleRole: window.localStorage.getItem('multipleRole'),
signCount: 0, // 融租方案确认 待办数量
carCount: 0, // 合同签订 代待办数量
}
},
computed: {},
......@@ -186,9 +193,12 @@ export default {
beforeRouteEnter (to, from, next) {
// if (true) {
next(vm => {
vm.signCount = 0 // 融租方案确认 待办数量
vm.carCount = 0 // 合同签订 代待办数量
if (window.localStorage.getItem('user_phone')) {
vm.userQuery()
}
vm.numQuery()
})
// }
// next()
......@@ -197,6 +207,23 @@ export default {
// this.userQuery()
// },
methods: {
numQuery () {
let vm = this
let url = $config.basePath + 'number_display_query'
let param = {
bp_id: JSON.parse(window.localStorage.getItem('now_user_bp_bind_id')).bp_id,
}
vm.$post(url, param).then(function (res) {
if (res.result === 'S') {
if ('info' in res) {
vm.signCount = res.info.con_confirm_num || 0
vm.carCount = res.info.car_confirm_num || 0
}
} else {
this.hlsPopup.showLongCenter(res.message)
}
})
},
userQuery () {
let vm = this
// let url = $config.basePath + 'user_query'
......@@ -760,6 +787,34 @@ export default {
color: #656464;
letter-spacing: 0;
line-height: 18px;
position:relative;
.content-wrap-class {
position: absolute;
top: 0;
right: -21px;
font-size: 10px;
width: 18px;
height: 18px;
text-align: center;
line-height: 18px;
background-color: red;
color: #fff;
border-radius: 50%;
}
.content-wrap-class-width {
position: absolute;
top: 0px;
right: -30px;
font-size: 10px;
width: 28px;
height: 18px;
text-align: center;
line-height: 18px;
background-color: red;
color: #fff;
border-radius: 50%;
}
}
}
......@@ -844,7 +899,7 @@ export default {
img {
height: 15px;
width: 15px;
}
}
}
.name-title {
......
......@@ -2,6 +2,10 @@
<h-view id="message-center">
<h-header class="bar-custom">
<div slot="center" class="top-word">消息通知</div>
<div slot="right" style="padding: 11px 13px 0 0;">
<!-- <Icon name="browsing-history-o" color="white" size="6vw" @click="readAll"/> -->
<img src="@/assets/messageCenter/clear.png" width="31%" alt="" @click="readAll" >
</div>
</h-header>
<!-- <h-content class="content"> -->
......@@ -22,10 +26,13 @@
<div v-if="item.notice_type==1" slot="left-icon" class="left-icon red-icon-box">
<img src="@/assets/messageCenter/message.png" >
</div>
<div
slot="name"
:class="{'font-color':true,'over-color':item.notice_type==2,'red':item.notice_type==1}"
>{{ item.notice_title }}</div>
>{{ item.notice_title }}
<p :class="{'notice-status':true, 'notice-read':item.notice_status==='READ','notice-unread':item.notice_status==='SENT'}">{{ item.notice_status=='READ'?'已读':'未读' }}</p>
</div>
<div slot="content" class="time-color">{{ item.notice_time }}</div>
</item>
<div class="msg-content">
......@@ -63,7 +70,10 @@
</h-view>
</template>
<script>
// import {Icon} from 'vant'
// import 'vant/lib/icon/style'
export default {
// components: {Icon},
data () {
return {
textHeight: null,
......@@ -97,6 +107,33 @@ export default {
}
},
methods: {
// 全部已读
readAll () {
let vm = this
hlsPopup.showConfirm({
title: '是否全部已读',
// content: `是否全部已读`,
onConfirm: data => {
if (data === 1) {
// 全部已读接口 app_notice_update
let url = process.env.basePath + 'app_notice_update'
let param = {
phone: window.localStorage.getItem('user_phone'),
update_type: 'ALL',
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.pagenum = 1
vm.getInfo()
}
})
console.log(data)
}
},
})
},
// 计算文字 显示展开 收起
calculateText () {
// 获取一行文字的height 计算当前文字比较列表文字
......@@ -159,6 +196,7 @@ export default {
vm.pagenum++
vm.$refs.scroll.update(false)
}
vm.$forceUpdate()
} else {
hlsPopup.showLongCenter(res.message)
}
......@@ -428,4 +466,22 @@ export default {
}
}
}
//消息已读样式
.notice-status{
font-size: 12px;
display: inline-block;
// background-color: #fc8129;
color: white;
width: 34px;
text-align: center;
border-radius: 9px;
}
.notice-read{
background-color: #c3bfbc;
}
.notice-unread{
background-color: #fc2946;
}
</style>
......@@ -24,9 +24,22 @@ export default {
beforeRouteEnter (to, from, next) {
next(vm => {
vm.getDetail()
vm.getReaded()
})
},
methods: {
getReaded () {//已读
let vm = this
let url = process.env.basePath + 'app_notice_update'
let param = {
notice_id: vm.$route.params.notice_id,
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
})
},
getDetail () {
let vm = this
let url = process.env.basePath + 'app_notice_detail_query'
......
......@@ -26,10 +26,13 @@
<img slot="icon" src="../assets/image/tab/n_product@2x.png">
<span slot="label">产品中心</span>
</tabbar-item>
<tabbar-item :link="{path:'/tab/message-center'}" :selected="$route.path === '/tab/message-center'">
<tabbar-item :link="{path:'/tab/message-center'}" :selected="$route.path === '/tab/message-center'" class="notice">
<img slot="icon-active" src="../assets/image/tab/message@2x.png">
<img slot="icon" src="../assets/image/tab/n_message@2x.png">
<span slot="label">消息</span>
<div slot="label">
消息
<p v-if="messageNum>0" class="notice-status">{{ messageNum <= 99 ? messageNum : '99+' }}</p>
</div>
</tabbar-item>
<tabbar-item :link="{path:'/tab/function-center'}" :selected="$route.path === '/tab/function-center'">
<img slot="icon-active" src="../assets/image/tab/function@2x.png">
......@@ -53,8 +56,12 @@ export default {
return {
pathList: [],
transitionName: '',
messageNum: 0, // 未读消息数量
}
},
activated () {
this.getUnreadNum()
},
watch: { // 监听路由变化
$route (to, from) {
if (this.pathList.includes(to.path)) {
......@@ -83,6 +90,25 @@ export default {
},
},
methods: {
getUnreadNum () {
console.log('消息记录获取');
let vm = this
let url = process.env.basePath + 'hls_app_notice_query'
let param = {
phone: window.localStorage.getItem('user_phone'),
pagesize: '10',
pagenum: 1,
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
let returnData = []
returnData = res.lists
if (returnData.length !== 0) vm.messageNum = returnData[0].unread_count
}
})
},
tabClick () {
let vm = this
if (!window.localStorage.getItem('password')) {
......@@ -158,4 +184,16 @@ export default {
}
}
}
.notice{
position: relative;
.notice-status{
position: absolute;
top: 0;
right: 10px;
background-color: #fc2946;
color: white;
width: 23px;
border-radius: 9px;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment