|
@@ -188,48 +188,52 @@ export default {
|
|
|
|
|
|
// 无论是网页里还是unity内部点击了企业,都调用这个
|
|
// 无论是网页里还是unity内部点击了企业,都调用这个
|
|
function onClickCorpItem(id) {
|
|
function onClickCorpItem(id) {
|
|
- // let isFound = false
|
|
|
|
- // for (let index = 0; index < corpListRaw.value.length; index++) {
|
|
|
|
- // const element = corpListRaw.value[index]
|
|
|
|
- // if (element.id === id) {
|
|
|
|
- // isFound = true
|
|
|
|
- // window.gUnityInst.SendMessage('Panel1', 'ShowEnterprise', element.id) //显示某个企业
|
|
|
|
- // window.gUnityInst.SendMessage('Panel1', 'SetEnterpriseUnSelected', element.id) //高亮某个企业
|
|
|
|
- // } else if (!isFound) {
|
|
|
|
- // window.gUnityInst.SendMessage('Panel1', 'ShowEnterprise', element.id) //显示某个企业
|
|
|
|
- // } else {
|
|
|
|
- // window.gUnityInst.SendMessage('Panel1', 'HideEnterprise', element.id) //隐藏某个企业
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // activeCorpId.value = id
|
|
|
|
- // isShowDesc.value = true
|
|
|
|
- // const clickedElement = document.querySelector(`#corp-item-${id}`)
|
|
|
|
- // if (clickedElement) {
|
|
|
|
- // clickedElement.scrollIntoView()
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- 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) //隐藏某个企业
|
|
|
|
- }
|
|
|
|
|
|
+ // 被选中的,既显示位置又显示名字,还要有选中特效。在它之前的,只显示位置。
|
|
|
|
+ let isFound = false
|
|
|
|
+ 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) //隐藏某个企业
|
|
|
|
+ if (element.id === id) {
|
|
|
|
+ isFound = true
|
|
|
|
+ window.gUnityInst.SendMessage('Panel1', 'ShowEnterprise', 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
|
|
|
|
- // const clickedElement = document.querySelector(`#corp-item-${id}`)
|
|
|
|
- // if (clickedElement) {
|
|
|
|
- // clickedElement.scrollIntoView()
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
|
|
+ activeCorpId.value = id
|
|
|
|
+ isShowDesc.value = true
|
|
|
|
+ const clickedElement = document.querySelector(`#corp-item-${id}`)
|
|
|
|
+ if (clickedElement) {
|
|
|
|
+ clickedElement.scrollIntoView()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // // 只显示选中的
|
|
|
|
+ // 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
|
|
window.handleClickEnterprise = onClickCorpItem
|
|
|
|
|