Requirements, push the quotation on the enterprise WeChat, and when the url is pushed and clicked, the interface must be adjusted to tell the background that the quotation has been clicked (viewed)
When I first write to determine whether it is OK Click and then drop the interface again. In this case, the screen will be blank when you return. It is estimated that the action is caused at the same time, because the js call interface has not been executed.
It should be written like this~~ The number of new messages will be updated later, so You have to wait until the new message interface is adjusted before jumping.
The text on the ps picture is useless~
Click After the url returns, the screen will be blank, so it will not be written — first adjust the interface and then jump to btw. This is only the case on the enterprise WeChat browser, and the others will not
Step 1: Click the html– searchCaroffer event
:top-method="refreshData"
:bottom-method="loadBottom"
:bottom-all -loaded="allLoaded"
:auto-fill="false"
bottom-pull-text=""
:bottom-distance="0">
< /span>
{ {item.title}}
{{ item.content }}
< br />
{{ item.createTime }}
{{ item. handleProcessUserName }} passed
{{ item.handleProcessUserName }} Dismissed
The second step-to determine if it is the first click, it is the first time, first confirm that it has been clicked and num has been updated before jumping
searchCaroffer (item) {
this.eachMessageDetail = item
if (item.messageHandleType) {
var urlStatus = item.type ==='HANDLE' && this.messageTypeList[item.messageHandleType].handleWay ==='OPEN_URL '&& !item.handleIsProcess
if (urlStatus) {
openUrl(item.id).then(res => {
if (res.status === 200) {
this.getNoticeNum('1')< br />} else if (res.status <500) {
this.$toast({
message: res.data.message,
iconClass:'icon icon-warning',< br /> duration: 1500
})
} else {
this.$toast({
message: res.data.message,
iconClass:'icon icon -warning',
duration: 1500
})
}
})
}
this.linkUrl = item.type ==='HANDLE' && this.messageTypeList[item.messageHandleType].handleWay ==='OPEN_URL' && item.handleIsProcess
if (this.linkUrl) {
this.linkDetail(item)
}
}
},
Step 3: Make sure the num number above is updated
getNoticeNum (item) {
noticeNum().t hen(res => {
if (res.status === 200) {
this.handleNum = res.data.data.HANDLE
this.notify = res.data.data. NOTIFY
if (Number(item) === 1) {
this.linkDetail(this.eachMessageDetail)
}
} else if (res.status <500) {< br /> this.$toast({
message: res.data.message,
iconClass:'icon icon-warning',
duration: 1500
})
}
})
},
The fourth step is to jump—because you need to remember the previous tab to return, remember to store it
linkDetail (item) {
if (item.handleUrl.indexOf('?')> -1) {
window.location.href = item.handleUrl +'&wcode=' + this.fromWX
} else {
window.location.href = item.handleUrl +'?wcode=' + this.fromWX
}
store.set('tabStatus', this.activeStatus)
},
Step 5—Get the storage status and remember to delete
created () {
if (store.get('tabStatus')) {
th is.activeStatus = store.get('tabStatus')
this.isStatus(this.activeStatus)
store.remove('tabStatus')
}
this.getMessageType()
this.getNoticeList()
this.getNoticeNum()
},