//页面B
//事件
handleGetContinue() {
if (this.data.busy) {
return
}
this.data.busy = true
const sid = this.data.order.sid
apiRevokeService(sid)
.then(res => {
this.setData({
'order.state': 7
})
wx.showToast({
title: '撤销成功',
icon: 'success',
duration: 1000
})
//当页面B修改数据成功后,页面A也要更新数据
const pages = getCurrentPages()
const listPage = pages.find(item => {
return item.route === 'pages/service-list/service-list'
})
if (listPage) {
const list = listPage.data.list
const item = list.items.find(item => {
return item.sid === sid //匹配页面a和页面b对应的sid,进行修改sid
})
if (item) {
item.state = 7
}
listPage.setData({
list
})
}
}
网友评论