From bbc99ec0dd89f6e4bb2113c3826c6f961d46e01b Mon Sep 17 00:00:00 2001
From: zoujiandong <10130823232@qq.com>
Date: Mon, 16 Jun 2025 19:01:04 +0800
Subject: [PATCH] 6.16
---
App.vue | 1 +
api/api.js | 10 +-
components/navBar/navBar.vue | 21 ++-
components/navBarSearch/navBarSearch.vue | 17 ++-
components/tabBar/tabBar.vue | 59 +++++---
main.js | 43 +++++-
pages.json | 28 ++--
pages/case/case.vue | 18 ++-
pages/caseTalk/caseTalk.vue | 38 ++---
pages/certList/certList.vue | 3 +-
pages/detail/detail.vue | 120 ++++++++++------
pages/index/index.vue | 19 +--
pages/login/login.vue | 13 +-
pages/my/my.vue | 15 +-
pages/myCollect/myCollect.vue | 3 +-
pages/myJoin/myJoin.vue | 3 +-
pages/publish/publish.vue | 37 ++---
pages/search/search.vue | 3 +-
pages/searchList/searchList.vue | 8 +-
pages/sickList/sickList.vue | 3 +-
pages/specialList/specialList.vue | 29 ++--
pages/videoList/videoList.vue | 3 +-
utils/cookie.js | 33 +++++
utils/host.js | 9 ++
utils/navTo.js | 37 +++--
utils/request.js | 175 +++++++++++++----------
26 files changed, 488 insertions(+), 260 deletions(-)
create mode 100644 utils/cookie.js
create mode 100644 utils/host.js
diff --git a/App.vue b/App.vue
index 3b81961..12e899d 100644
--- a/App.vue
+++ b/App.vue
@@ -5,6 +5,7 @@
});
onShow(()=>{
console.log('App Show')
+
});
onHide(()=>{
console.log('App Hide')
diff --git a/api/api.js b/api/api.js
index f69c699..0b7c740 100644
--- a/api/api.js
+++ b/api/api.js
@@ -178,8 +178,14 @@ const api = {
},
givePoint(data){
return request('/reward',data,'post',true);
- }
-
+ },
+ h5Login(data){
+ return request('/login/hcp',data,'post');
+ },
+ readRecord(data){
+ return request('/user/case/read',data,'post',false,'application/json');
+ }
+
}
diff --git a/components/navBar/navBar.vue b/components/navBar/navBar.vue
index cc22edd..6fade8e 100644
--- a/components/navBar/navBar.vue
+++ b/components/navBar/navBar.vue
@@ -19,7 +19,7 @@
props.searchWord,(newVal)=>{
keyWord.value=newVal
})
const goMy=()=>{
- uni.navigateTo({
+ navTo({
url:'/pages/my/my'
})
}
const search=()=>{
if(props.type=='home'){
- uni.navigateTo({
+ navTo({
url: `/pages/search/search?keyWord=${keyWord.value}`,
});
}else if(props.type=='caseTalk'){
- uni.navigateTo({
+ navTo({
url: `/pages/specialList/specialList?keyWord=${keyWord.value}`,
});
}
@@ -87,6 +90,16 @@ const search=()=>{
}
+onLoad(()=>{
+ let userInfo = uni.getStorageSync('userInfo');
+ if(userInfo && userInfo.avatar){
+ userHeadImg.value=userInfo.avatar
+ }else{
+ userHeadImg.value=headImg;
+ }
+
+
+})
\ No newline at end of file
diff --git a/main.js b/main.js
index 1986a82..775eeea 100644
--- a/main.js
+++ b/main.js
@@ -1,5 +1,9 @@
import App from './App'
import navTo from './utils/navTo'
+// #ifdef h5
+import api from './api/api'
+import cookie from './utils/cookie'
+// #endif
import uviewPlus, { setConfig } from 'uview-plus'
// #ifndef VUE3
import Vue from 'vue'
@@ -11,13 +15,44 @@ const app = new Vue({
})
app.$mount()
// #endif
-
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
-
- app.use(uviewPlus, () => {
+
+ app.use(uviewPlus, async() => {
+ // if(process.env.UNI_PLATFORM =="h5"){
+
+ // let token = '';
+ // if(window.location.href.indexOf('//casedata.igandan.com')>-1){
+ // token = uni.getStorageSync('AUTH_TOKEN_CASEDATA');
+ // }else{
+ // token = uni.getStorageSync('DEV_AUTH_TOKEN_CASEDATA');
+ // }
+ // if(!token){
+ // let video_token = cookie.readCookie('video_token');
+ // alert(video_token)
+ // const res = await api.h5Login({
+ // token: video_token
+ // });
+ // let result = res.data;
+ // if (window.location.href.indexOf('//casedata.igandan.com')>-1) {
+ // uni.setStorageSync("AUTH_TOKEN_CASEDATA",result.token);
+ // } else {
+ // uni.setStorageSync("DEV_AUTH_TOKEN_CASEDATA",result.token);
+ // };
+ // uni.setStorageSync("userInfo",{
+ // avatar:result.avatar,
+ // user_id:result.user_id,
+ // status:result.status,
+ // user_name:result.user_name,
+ // doctor_id:result.doctor_id,
+ // });
+ // }
+
+ // }
+
+
return {
options: {
// 修改$u.config对象的属性
@@ -28,7 +63,7 @@ export function createApp() {
}
}
})
- console.log(uni.$u.config.v);
+
//app.config.globalProperties.$navTo = navTo
return {
app
diff --git a/pages.json b/pages.json
index 3313972..fb31a03 100644
--- a/pages.json
+++ b/pages.json
@@ -16,35 +16,35 @@
{
"path": "pages/index/index",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
{
"path": "pages/publish/publish",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
{
"path": "pages/certImg/certImg",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
{
"path": "pages/sickList/sickList",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
{
"path": "pages/videoList/videoList",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
@@ -59,49 +59,49 @@
{
"path": "pages/caseTalk/caseTalk",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
{
"path": "pages/specialList/specialList",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
{
"path": "pages/certList/certList",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
{
"path": "pages/my/my",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
{
"path": "pages/myJoin/myJoin",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
{
"path": "pages/myCollect/myCollect",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
{
"path": "pages/detail/detail",
"style": {
- "navigationBarTitleText": "详情",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom",
"usingComponents": {
"polyv-player": "plugin://polyv-player/player"
@@ -112,14 +112,14 @@
{
"path": "pages/search/search",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
{
"path": "pages/searchList/searchList",
"style": {
- "navigationBarTitleText": "uni-app",
+ "navigationBarTitleText": "肝胆相照临床病例库",
"navigationStyle": "custom"
}
},
diff --git a/pages/case/case.vue b/pages/case/case.vue
index 73904e6..ff3c7b4 100644
--- a/pages/case/case.vue
+++ b/pages/case/case.vue
@@ -13,15 +13,27 @@
import tabBar from '@/components/tabBar/tabBar.vue';
const src = ref('')
onLoad((options)=>{
- const { envVersion } = uni.getAccountInfoSync().miniProgram;
+ if(process.env.UNI_PLATFORM =="h5"){
+ let token='';
+ if(window.location.href.indexOf('//casedata.igandan.com')>-1){
+ token=uni.getStorageSync("AUTH_TOKEN_CASEDATA");
+ src.value = 'https://caseplatform.igandan.com/web/home?token='+token;
+ }else{
+ token=uni.getStorageSync("DEV_AUTH_TOKEN_CASEDATA");
+ src.value = 'https://dev-caseplatform.igandan.com/web/home?token='+token;
+ }
+
+ }else{
+ const { envVersion } = uni.getAccountInfoSync().miniProgram;
let token=''
if (envVersion == "release") {
token=uni.getStorageSync("AUTH_TOKEN_CASEDATA");
} else {
token= uni.getStorageSync("DEV_AUTH_TOKEN_CASEDATA");
};
- console.log(token)
- src.value = 'https://dev-caseplatform.igandan.com/web/home?token='+token;
+ src.value = 'https://dev-caseplatform.igandan.com/web/home?token='+token;
+ }
+
})
diff --git a/pages/caseTalk/caseTalk.vue b/pages/caseTalk/caseTalk.vue
index 642d464..251635a 100644
--- a/pages/caseTalk/caseTalk.vue
+++ b/pages/caseTalk/caseTalk.vue
@@ -3,11 +3,11 @@
- {{ numInfo.exchange_collect_num}}
+ {{ numInfo.exchange_num}}
病例数
- {{ numInfo.exchange_num }}
+ {{numInfo.exchange_collect_num}}
互动数
@@ -36,7 +36,7 @@
最新收录
-
+
查看更多
@@ -46,12 +46,12 @@
class="cell"
v-for="(item) in new_articles"
:key="item.exchange_id"
- @click="goDetail(item.exchange_id)"
+
>
- {{
+ {{
item.exchange_title
}}
-
+
{{ item.user_name }}({{ item.hospital_name }})
- {{ item.exchange_content }}
+ {{ item.exchange_content }}
-
+
{{ cell.label_name }}
-
+
@@ -148,9 +149,10 @@
import tabBar from "@/components/tabBar/tabBar.vue";
import headImg from "@/static/headImg.png";
import dayjs from "dayjs";
+ import navTo from "@/utils/navTo.js";
import api from "@/api/api";
import { reactive,ref } from 'vue';
- import { onLoad } from "@dcloudio/uni-app";
+ import { onShow } from "@dcloudio/uni-app";
const numInfo=reactive({})
const most_read_articles=ref([]);
const new_articles=ref([]);
@@ -160,17 +162,17 @@
return dayjs(date).format('YYYY-MM-DD')
};
// const goList = () => {
- // uni.navigateTo({
+ // navTo({
// url: '/pages/specialList/specialList'
// })
// };
const goList=(type)=>{
if(type=='read'){
- uni.navigateTo({
+ navTo({
url:'/pages/specialList/specialList?is_selected=1'
})
}else{
- uni.navigateTo({
+ navTo({
url:'/pages/specialList/specialList'
})
}
@@ -183,7 +185,7 @@
})
}
const goDetail = (id) => {
- uni.navigateTo({
+ navTo({
url: `/pages/detail/detail?id=${id}&type=exchange`,
});
};
@@ -226,7 +228,7 @@ const hotList=()=>{
}).then(res=>{
})
}
-onLoad(()=>{
+onShow(()=>{
getStatic();
goodList();
searchList();
diff --git a/pages/certList/certList.vue b/pages/certList/certList.vue
index 55c1312..64233fa 100644
--- a/pages/certList/certList.vue
+++ b/pages/certList/certList.vue
@@ -58,6 +58,7 @@ import api from "@/api/api";
import { onLoad } from "@dcloudio/uni-app";
import dayjs from "dayjs";
import switchImg from "@/static/switch.png";
+import navTo from "@/utils/navTo.js";
import certImg from "@/static/cert.png";
const paging = ref(null);
const isSearch=ref(false);
@@ -95,7 +96,7 @@ onLoad((options) => {
})
const goDetail=(url)=>{
- uni.navigateTo({
+ navTo({
url: `/pages/certImg/certImg?src=${url}`
})
}
diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue
index 39de2e7..aed74d6 100644
--- a/pages/detail/detail.vue
+++ b/pages/detail/detail.vue
@@ -9,7 +9,44 @@
>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ info.video_title }}
{{
info.article_title
@@ -59,45 +96,10 @@
style="width: 200px; height: 200px; position: fixed; top: -9999px"
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
@@ -113,12 +119,12 @@
病例信息
-
+
结果与讨论
-
+
@@ -521,7 +527,6 @@
-