|
|
@@ -28,7 +28,7 @@ Page({ |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad() { |
|
|
|
|
|
|
|
|
|
|
|
const eventChannel = this.getOpenerEventChannel() |
|
|
|
if (eventChannel.on) { |
|
|
|
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 |
|
|
@@ -38,13 +38,13 @@ Page({ |
|
|
|
detailValue: listDetail.info, |
|
|
|
selectedTag: listDetail.type, |
|
|
|
businessCommunicationDemandId: listDetail.businessCommunicationDemandId, |
|
|
|
setTags:true, |
|
|
|
setTags: true, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
this.getTags(); |
|
|
|
}, |
|
|
|
onShow(){ |
|
|
|
onShow() { |
|
|
|
this.setData({ |
|
|
|
currentIndex: 1 |
|
|
|
}) |
|
|
@@ -63,26 +63,26 @@ Page({ |
|
|
|
// 拾取焦点触发 |
|
|
|
textareaBlur() { |
|
|
|
// let tags = this.data.tags; |
|
|
|
let { detailValue, tags, setTags} = this.data; |
|
|
|
let { detailValue, tags, setTags } = this.data; |
|
|
|
let value = this.trimRight(detailValue); |
|
|
|
// 如果手动选择过tag不再处理 |
|
|
|
if (setTags || !value) { |
|
|
|
return |
|
|
|
} |
|
|
|
let selectedTag = []; |
|
|
|
tags.forEach((el,inx)=>{ |
|
|
|
tags.forEach((el, inx) => { |
|
|
|
el.isActive = ''; |
|
|
|
el.needKeyword = el.keyword ? el.keyword.split(',') : []; |
|
|
|
el.needKeyword.forEach(subel => { |
|
|
|
if(value.indexOf(subel) != -1 && selectedTag.length < 4){ |
|
|
|
if(selectedTag.indexOf(el.typeName) == -1){ |
|
|
|
if (value.indexOf(subel) != -1 && selectedTag.length < 4) { |
|
|
|
if (selectedTag.indexOf(el.typeName) == -1) { |
|
|
|
selectedTag.push(el.typeName); |
|
|
|
el.isActive = 'active' + selectedTag.indexOf(el.typeName); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if(selectedTag.length < 1){ |
|
|
|
if (selectedTag.length < 1) { |
|
|
|
selectedTag.push(tags[tags.length - 1].typeName); |
|
|
|
tags[tags.length - 1].isActive = 'active' + 0; |
|
|
|
} |
|
|
@@ -110,7 +110,7 @@ Page({ |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let tags = this.data.tags; |
|
|
|
tags.forEach(el => { |
|
|
|
el.isActive = ''; |
|
|
@@ -178,12 +178,17 @@ Page({ |
|
|
|
let prevPage = pages[pages.length - 2]; //上一个页面 |
|
|
|
let info = prevPage.data //取上页data里的数据也可以修改 |
|
|
|
let tempListData = info.listData; |
|
|
|
let str = "release"; |
|
|
|
tempListData.forEach(el => { |
|
|
|
if (el.businessCommunicationDemandId == businessCommunicationDemandId) { |
|
|
|
el.info = Page.data.detailValue |
|
|
|
el.info = Page.data.detailValue; |
|
|
|
if(el.state != 0){ |
|
|
|
el.state = 0; |
|
|
|
str = 'needRefresh'; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
prevPage.setData({ listData: tempListData })//设置数据 |
|
|
|
prevPage.setData({ listData: tempListData ,currentTab : str})//设置数据 |
|
|
|
wx.navigateBack() |
|
|
|
}, 1000); |
|
|
|
} |
|
|
@@ -239,7 +244,7 @@ Page({ |
|
|
|
let datas = res.data; |
|
|
|
let selectedTag = this.data.selectedTag; |
|
|
|
datas.forEach(el => { |
|
|
|
el.isActive = ""; |
|
|
|
el.isActive = ''; |
|
|
|
if (selectedTag.indexOf(el.typeName) != -1) { |
|
|
|
el.isActive = 'active' + selectedTag.indexOf(el.typeName); |
|
|
|
} |