|
@@ -1,20 +1,20 @@
|
|
|
<template>
|
|
|
<div class="mineMessage">
|
|
|
- <div class="msgItem" v-for="item in msgList">
|
|
|
+ <div class="msgItem" v-for="item in msgList" @click="toDetail(item)">
|
|
|
<div class="msgItemLeft">
|
|
|
<img src="./image/msgIcon.png" class="msgIcon">
|
|
|
<div class="redDoll" v-show="item.isNew"></div>
|
|
|
</div>
|
|
|
<div class="msgItemRight">
|
|
|
- <div class="msgItemName">您有一条最新政策待查看!</div>
|
|
|
- <div class="msgItemTime">2024-06-18 19:34:06</div>
|
|
|
+ <div class="msgItemName">{{ item.content }}!</div>
|
|
|
+ <div class="msgItemTime">{{ item.createdAt }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getMsgList,getUserLocalStorageInfo } from "@/js_sdk/http";
|
|
|
+import { getMyList,getUserLocalStorageInfo,updateInformation,parkSystemMsgReadAdd } from "@/js_sdk/http";
|
|
|
export default {
|
|
|
name: "mineMessage",
|
|
|
data(){
|
|
@@ -26,23 +26,65 @@ export default {
|
|
|
],
|
|
|
requestParam: {
|
|
|
userId: getUserLocalStorageInfo().userId,
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10
|
|
|
+ userType: getUserLocalStorageInfo().userType,
|
|
|
},
|
|
|
total:0
|
|
|
}
|
|
|
},
|
|
|
- mounted(){
|
|
|
+ // mounted(){
|
|
|
+ // this.getList()
|
|
|
+ // },
|
|
|
+ onShow(){
|
|
|
this.getList()
|
|
|
},
|
|
|
methods:{
|
|
|
getList(){
|
|
|
- getMsgList(this.requestParam).then(res=>{
|
|
|
- res.rows.forEach(element => {
|
|
|
- this.msgList.push(element)
|
|
|
+ this.msgList = []
|
|
|
+ getMyList(this.requestParam).then(res=>{
|
|
|
+ res.forEach(element => {
|
|
|
+ const json = this.getItemJson(element)
|
|
|
+ this.msgList.push(json)
|
|
|
})
|
|
|
- this.total = res.total
|
|
|
})
|
|
|
+ },
|
|
|
+ getItemJson(item){
|
|
|
+ item.isNew = item.readStatus == '0'
|
|
|
+ return item
|
|
|
+ },
|
|
|
+ toDetail(item){
|
|
|
+ // 1 反馈 2 资源预约 3 政策
|
|
|
+ let url = ''
|
|
|
+ if(item.type === '1'){
|
|
|
+ this.readMsg(item)
|
|
|
+ url = '/pages/subPackages/minePages/feedback_detail?id=' + item.businessId
|
|
|
+ }
|
|
|
+ if(item.type === '2'){
|
|
|
+ this.readMsg(item)
|
|
|
+ url = '/pages/subPackages/resourceReservation_manage/edit?id=' + item.businessId
|
|
|
+ }
|
|
|
+ if(item.type === '3'){
|
|
|
+ this.readSysMsg(item)
|
|
|
+ url = '/pages/subPackages/industrialPolicy/detail?id='+item.businessId
|
|
|
+ }
|
|
|
+ uni.navigateTo({
|
|
|
+ url: url
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ readMsg(item){
|
|
|
+ const data = {
|
|
|
+ id: item.id,
|
|
|
+ status: '1'
|
|
|
+ }
|
|
|
+ updateInformation(data)
|
|
|
+ },
|
|
|
+ readSysMsg(item){
|
|
|
+ const data = {
|
|
|
+ msg_id: item.businessId,
|
|
|
+ user_type: getUserLocalStorageInfo().userType,
|
|
|
+ userId: getUserLocalStorageInfo().userId,
|
|
|
+ }
|
|
|
+ parkSystemMsgReadAdd(data)
|
|
|
}
|
|
|
}
|
|
|
}
|