优化,完善代码

This commit is contained in:
2026-05-14 14:42:51 +08:00
parent 79a21ff0a5
commit 16c91facac
26 changed files with 1792 additions and 1322 deletions

View File

@@ -29,11 +29,33 @@
this.id = option.id
this.getDetail()
},
onShow(){
this.recordView(this.id)
},
methods:{
recordView(assetId) {
let token = this.$getToken()
let userInfo = uni.getStorageSync('userInfo')
if(token){
return
}
if (token) {
let url = "/potential/add";
this.$u.get(url, {
assetId: this.id,
assetsName: '查看公告' + this.title,
userType: userInfo.userType
}, {
'WT': this.$getToken()
}).then(obj => {
}).catch(err => {
console.log("记录客户浏览记录失败", err)
})
}
},
getDetail(){
this.$u.get(`/notice/detail?id=${this.id}`,{},{
WT: this.$getToken()
}).then(res=>{
this.$u.get(`/notice/detail?id=${this.id}`,{},{}).then(res=>{
if(res.flag) {
this.title = res.data.noticeTitle;
this.content = res.data.noticeContent;
@@ -44,12 +66,13 @@
})
}
this.attachments = res.data.attachments;
this.recordView(this.id)
}
})
},
download(item){
uni.downloadFile({
url: this.$config.staticUrl + item.url,
url: this.$config.staticUrl + item.fileUrl,
success(res) {
uni.openDocument({
filePath: res.tempFilePath