Browse Source

修改公告不穿projectID

trunk1017
douzhuo 2 years ago
parent
commit
3eeb05f4ea
1 changed files with 18 additions and 15 deletions
  1. +18
    -15
      pages/mine/messageList.vue

+ 18
- 15
pages/mine/messageList.vue View File

@@ -30,9 +30,9 @@
<template v-else> <template v-else>
{{ fomatDate(item.createTime) }} {{ fomatDate(item.createTime) }}
</template> </template>
{{item.title}} {{item.title}}
<template v-if="item.readFlag==0"> <template v-if="item.readFlag==0">
<view class="notRead"></view> <view class="notRead"></view>
</template> </template>
@@ -175,16 +175,19 @@
}, },


updateInit() { updateInit() {
let obj = {
messageType: this.list[this.current].id,
id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
num: this.pageNum,
size: this.pageSize
}
if (this.current == 0) {
obj.projectId = uni.getStorageSync('buildingID').id
}
uni.request({ uni.request({
url: config.service.updateList, url: config.service.updateList,
method: "GET", method: "GET",
data: {
messageType: this.list[this.current].id,
projectId: uni.getStorageSync('buildingID').id,
id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
num: this.pageNum,
size: this.pageSize
},
data: obj,
header: { header: {
'content-type': 'application/json', 'content-type': 'application/json',
'Access-Token': uni.getStorageSync('weapp_session_login_data').token 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
@@ -194,7 +197,7 @@
if (this.pageNum != 1) { if (this.pageNum != 1) {
this.updateAnnList = [...this.updateAnnList, ...res.data.data.list.results]; this.updateAnnList = [...this.updateAnnList, ...res.data.data.list.results];
} else { } else {
this.updateAnnList = res.data.data.list.results || [] this.updateAnnList = res.data.data.list.results || []
} }
} }
@@ -245,7 +248,7 @@
}) })
} }
}, },
fomatDate(date) { fomatDate(date) {
if (!date) return '--' if (!date) return '--'
let arr = date.split(' ') let arr = date.split(' ')
@@ -253,7 +256,7 @@
let result = str.split('-') let result = str.split('-')
return `${result[1]}月${result[2]}日` return `${result[1]}月${result[2]}日`
}, },
// 转换时间 // 转换时间
getTimeLine(date, type = 1) { getTimeLine(date, type = 1) {
let resu = '--' let resu = '--'
@@ -263,10 +266,10 @@
let arr = date.split(' ') let arr = date.split(' ')
let str = arr[0] let str = arr[0]
let result = str.split('-') let result = str.split('-')
let m = (time.getMonth() + 1) < 10 ? `0${time.getMonth() + 1}` : (time.getMonth() + 1) let m = (time.getMonth() + 1) < 10 ? `0${time.getMonth() + 1}` : (time.getMonth() + 1)
let d = time.getDate() < 10 ? `0${time.getDate()}` : time.getDate() let d = time.getDate() < 10 ? `0${time.getDate()}` : time.getDate()
if (type == 1) { if (type == 1) {
resu = `${m}.${d}-${result[1]}.${result[2]}` resu = `${m}.${d}-${result[1]}.${result[2]}`
} else { } else {
@@ -274,7 +277,7 @@
} }
return resu return resu
}, },
change(index) { change(index) {
this.current = index; this.current = index;
this.initPage() this.initPage()


Loading…
Cancel
Save