|
@@ -174,6 +174,15 @@ export default {
|
|
|
|
|
|
// 搜索框功能
|
|
|
watch(filterKeyword, utils.debounce(async (vNew) => {
|
|
|
+ // 可能此前已经选中了某个企业,所以在更新列表前先清空选中状态
|
|
|
+ for (let index = 0; index < corpListRaw.value.length; index++) {
|
|
|
+ const element = corpListRaw.value[index]
|
|
|
+ window.gUnityInst.SendMessage('Panel1', 'HideEnterprise', element.id) //隐藏某个企业
|
|
|
+ window.gUnityInst.SendMessage('Panel1', 'HideEnterpriseName', element.id) //隐藏某个企业名称
|
|
|
+ }
|
|
|
+ isShowDesc.value = false
|
|
|
+ activeCorpId.value = null
|
|
|
+
|
|
|
corpListRaw.value = await api.getGeneralList({
|
|
|
searchKey: vNew,
|
|
|
})
|
|
@@ -248,24 +257,29 @@ export default {
|
|
|
for (let index = 0; index < corpListRaw.value.length; index++) {
|
|
|
const element = corpListRaw.value[index]
|
|
|
window.gUnityInst.SendMessage('Panel1', 'HideEnterprise', element.id) //隐藏某个企业
|
|
|
- window.gUnityInst.SendMessage('Panel1', 'HideEnterpriseName', element.id) //隐藏某个企业
|
|
|
+ window.gUnityInst.SendMessage('Panel1', 'HideEnterpriseName', element.id) //隐藏某个企业名称
|
|
|
if (element.id === id) {
|
|
|
isFound = true
|
|
|
window.gUnityInst.SendMessage('Panel1', 'ShowEnterprise', element.id) //显示某个企业
|
|
|
- window.gUnityInst.SendMessage('Panel1', 'ShowEnterpriseName', element.id) //显示某个企业
|
|
|
+ window.gUnityInst.SendMessage('Panel1', 'ShowEnterpriseName', element.id) //显示某个企业名称
|
|
|
window.gUnityInst.SendMessage('Panel1', 'SetEnterpriseSelected', element.id) //高亮某个企业
|
|
|
} else if (!isFound) {
|
|
|
window.gUnityInst.SendMessage('Panel1', 'ShowEnterprise', element.id) //显示某个企业
|
|
|
} else {
|
|
|
}
|
|
|
}
|
|
|
- activeCorpId.value = id
|
|
|
- isShowDesc.value = true
|
|
|
+
|
|
|
+ // scroll into view
|
|
|
const clickedElement = document.querySelector(`#corp-item-${id}`)
|
|
|
if (clickedElement) {
|
|
|
clickedElement.scrollIntoView()
|
|
|
}
|
|
|
|
|
|
+ // 显示详情界面
|
|
|
+ activeCorpId.value = id
|
|
|
+ isShowDesc.value = true
|
|
|
+
|
|
|
+ // 详情界面图片
|
|
|
if (activeCorpId.value) {
|
|
|
api.getGeneralDetail(activeCorpId.value).then((res) => {
|
|
|
bannerImgList.value = res.file
|
|
@@ -281,30 +295,6 @@ export default {
|
|
|
} else {
|
|
|
bannerImgList.value = []
|
|
|
}
|
|
|
-
|
|
|
- // // 只显示选中的
|
|
|
- // if (activeCorpId.value === id) {
|
|
|
- // activeCorpId.value = ''
|
|
|
- // isShowDesc.value = false
|
|
|
- // window.gUnityInst.SendMessage('Panel1', 'HideEnterprise', id) //隐藏某个企业
|
|
|
- // } else {
|
|
|
- // for (let index = 0; index < corpListRaw.value.length; index++) {
|
|
|
- // const element = corpListRaw.value[index]
|
|
|
- // if (element.id === id) {
|
|
|
- // window.gUnityInst.SendMessage('Panel1', 'ShowEnterprise', element.id) //显示某个企业
|
|
|
- // window.gUnityInst.SendMessage('Panel1', 'SetEnterpriseSelected', element.id) //高亮某个企业
|
|
|
- // } else {
|
|
|
- // window.gUnityInst.SendMessage('Panel1', 'SetEnterpriseUnselected', element.id) //高亮某个企业
|
|
|
- // window.gUnityInst.SendMessage('Panel1', 'HideEnterprise', element.id) //隐藏某个企业
|
|
|
- // }
|
|
|
- // }
|
|
|
- // activeCorpId.value = id
|
|
|
- // isShowDesc.value = true
|
|
|
- // // const clickedElement = document.querySelector(`#corp-item-${id}`)
|
|
|
- // // if (clickedElement) {
|
|
|
- // // clickedElement.scrollIntoView()
|
|
|
- // // }
|
|
|
- // }
|
|
|
}
|
|
|
window.handleClickEnterprise = onClickCorpItem
|
|
|
|