diff --git a/App.vue b/App.vue index af47bbf..b87149f 100644 --- a/App.vue +++ b/App.vue @@ -33,6 +33,11 @@ -webkit-line-clamp: 2; overflow: hidden; } +.ellipsis-one-lines { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} /* #ifdef H5 */ .zp-container{ z-index: 0!important; diff --git a/components/navBar/navBar.vue b/components/navBar/navBar.vue index c16e0ab..9520f85 100644 --- a/components/navBar/navBar.vue +++ b/components/navBar/navBar.vue @@ -88,7 +88,7 @@ const search=()=>{ }); }else if(props.type=='caseTalk'){ navTo({ - url: `/pages/specialList/specialList?keyWord=${keyWord.value}`, + url: `/pages/specialList/specialList?keyWord=${keyWord.value}&from=talkHome`, }); } // if (!keyWord.value) { diff --git a/pages/caseTalk/caseTalk.vue b/pages/caseTalk/caseTalk.vue index d29587c..8fd2a13 100644 --- a/pages/caseTalk/caseTalk.vue +++ b/pages/caseTalk/caseTalk.vue @@ -26,9 +26,9 @@ - + - {{ item.exchange_title }} + {{ item.exchange_title }} @@ -62,7 +62,7 @@ >{{ item.user_name }}({{ item.hospital_name }}) - {{ item.exchange_content }} + {{ htmlToText(item.exchange_content) }} - + {{ item.read_num }} - + {{ item.collect_num }} - + {{ item.comment_num }} @@ -216,6 +217,13 @@ const goDetail = (id) => { }); }; +const htmlToText=(html)=>{ + return html + .replace(/<[^>]*>/g, '') // 移除所有HTML标签 + .replace(/ /gi, ' ') // 将HTML实体转换为字符 + .replace(//gi, '\n').replace(/]*>/gi, '') // 移除标签及其内容 + .replace(/]*>[\s\S]*?/gi, ''); // 将换行符替换为实际的换行符 +} const goodList=()=>{ api.searchExchageGood({ is_selected:1, diff --git a/pages/specialList/specialList.vue b/pages/specialList/specialList.vue index 24679c7..e676934 100644 --- a/pages/specialList/specialList.vue +++ b/pages/specialList/specialList.vue @@ -10,6 +10,7 @@ >