|
@@ -1,27 +1,28 @@
|
|
<template>
|
|
<template>
|
|
<view class="message-page">
|
|
<view class="message-page">
|
|
- <view class="device-msg-wrap base-wrap" @tap="toDeviceMsgPage">
|
|
|
|
|
|
+ <view class="device-msg-wrap base-wrap" v-for="(item, index) in deviceList" :key="index" @tap="toDeviceMsgPage(item)">
|
|
<view class="row">
|
|
<view class="row">
|
|
<view class="title">
|
|
<view class="title">
|
|
<view>{{ $t('设备消息') }}</view>
|
|
<view>{{ $t('设备消息') }}</view>
|
|
- <view class="bage">{{ deviceInfo.unread }}</view>
|
|
|
|
|
|
+ <view class="bage">{{ item.unread }}</view>
|
|
</view>
|
|
</view>
|
|
- <view class="time">{{deviceInfo.message_date}}</view>
|
|
|
|
|
|
+ <view class="time">{{item.message_date}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="device-info">
|
|
<view class="device-info">
|
|
- <image class="img" :src="deviceInfo.image" />
|
|
|
|
|
|
+ <image class="img" :src="item.image" />
|
|
<view class="info">
|
|
<view class="info">
|
|
- <view class="name">{{ deviceInfo.car_name }}</view>
|
|
|
|
- <view class="status">{{deviceInfo.message_overview}}</view>
|
|
|
|
|
|
+ <view class="name">{{ item.car_name }}</view>
|
|
|
|
+ <view class="status">{{item.message_overview}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
<view class="sys-msg-wrap base-wrap">
|
|
<view class="sys-msg-wrap base-wrap">
|
|
<view class="title">{{ $t('系统消息') }}</view>
|
|
<view class="title">{{ $t('系统消息') }}</view>
|
|
<view class="msg-item" v-for="(item, index) in sysMsgList" :key="index">
|
|
<view class="msg-item" v-for="(item, index) in sysMsgList" :key="index">
|
|
<view class="msg">
|
|
<view class="msg">
|
|
{{ item.title }}
|
|
{{ item.title }}
|
|
- <view v-if="item.title" class="btn">绑定设备</view>
|
|
|
|
|
|
+ <view v-if="item.type === 1" class="btn">绑定设备</view>
|
|
</view>
|
|
</view>
|
|
<view class="time">{{ item.ctime }}</view>
|
|
<view class="time">{{ item.ctime }}</view>
|
|
<view class="dtl">{{ item.overview }}</view>
|
|
<view class="dtl">{{ item.overview }}</view>
|
|
@@ -39,6 +40,7 @@ export default {
|
|
return {
|
|
return {
|
|
value: 10,
|
|
value: 10,
|
|
sysMsgList: [],
|
|
sysMsgList: [],
|
|
|
|
+ deviceList: [],
|
|
deviceInfo: {}
|
|
deviceInfo: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -49,16 +51,16 @@ export default {
|
|
// })
|
|
// })
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- toDeviceMsgPage() {
|
|
|
|
- const { car_id } = this.deviceInfo
|
|
|
|
|
|
+ toDeviceMsgPage(itemData) {
|
|
|
|
+ const { car_id } = itemData
|
|
uni.navigateTo({ url: `/pages/message/deviceInfo?car_id=${car_id}` })
|
|
uni.navigateTo({ url: `/pages/message/deviceInfo?car_id=${car_id}` })
|
|
},
|
|
},
|
|
queryDeviceMsg() {
|
|
queryDeviceMsg() {
|
|
http.postApi(config.API_DEVICE_MSG, {}, res => {
|
|
http.postApi(config.API_DEVICE_MSG, {}, res => {
|
|
if (res.succeed) {
|
|
if (res.succeed) {
|
|
- console.log(111, res.body)
|
|
|
|
- this.setData({
|
|
|
|
- deviceInfo: res.body.data[0]
|
|
|
|
|
|
+ this.deviceList = res.body.data
|
|
|
|
+ this.deviceList.map(item => {
|
|
|
|
+ item.message_date = common.formatTime(item.message_date)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -66,10 +68,10 @@ export default {
|
|
querySysMsgList() {
|
|
querySysMsgList() {
|
|
http.postApi(config.API_MESSAGE_LIST, { msg_type: 'PLAT' }, res => {
|
|
http.postApi(config.API_MESSAGE_LIST, { msg_type: 'PLAT' }, res => {
|
|
if (res.succeed) {
|
|
if (res.succeed) {
|
|
- this.setData({
|
|
|
|
- sysMsgList: res.body.data.list
|
|
|
|
|
|
+ this.sysMsgList= res.body.data.list
|
|
|
|
+ this.sysMsgList.map(item => {
|
|
|
|
+ item.ctime = common.formatTime(item.ctime)
|
|
})
|
|
})
|
|
- console.log(111, res.body)
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|