diff --git a/TUICallKit-Vue3/App.vue b/TUICallKit-Vue3/App.vue index 0c99eea9..93859e52 100644 --- a/TUICallKit-Vue3/App.vue +++ b/TUICallKit-Vue3/App.vue @@ -67,10 +67,11 @@ const userinfo = async (code) => { wxcode(code) } - if(res.code==1){ + uni.setStorageSync('userData', res.data) + if(res.code==1 && res.data.diagnosis){ video(res.data) } - uni.setStorageSync('userData', res.data) + } catch (err) { diff --git a/TUICallKit-Vue3/TUIKit/pages/chat/chat.vue b/TUICallKit-Vue3/TUIKit/pages/chat/chat.vue index 19af35d2..106e85f8 100644 --- a/TUICallKit-Vue3/TUIKit/pages/chat/chat.vue +++ b/TUICallKit-Vue3/TUIKit/pages/chat/chat.vue @@ -166,7 +166,7 @@ const SDKAppID = app.globalData.SDKAppID || options.SDKAppID; targetUserID = options.targetUserID; currentUserID = userID; // 保存当前用户ID - + console.log('-------',userID,userSig,SDKAppID) // 获取用户头像 const userData = uni.getStorageSync('userData'); if (userData && userData.avatar) { @@ -180,7 +180,7 @@ } conversationID = `C2C${targetUserID}`; - console.log('当前用户:', currentUserID, '对方用户:', targetUserID); + console.log('当前用户:', currentUserID, '对方用户:', targetUserID,'conversationID'+conversationID); if (!app.globalData.imChat) { chat = TencentCloudChat.create({ @@ -212,7 +212,7 @@ } await loadHistoryMessages(); - uni.showToast({ title: '聊天已就绪', icon: 'success' }); + //uni.showToast({ title: '聊天已就绪', icon: 'success' }); // 监听键盘高度变化 uni.onKeyboardHeightChange((res) => { diff --git a/TUICallKit-Vue3/doctor/pages/doctor/doctor.vue b/TUICallKit-Vue3/doctor/pages/doctor/doctor.vue new file mode 100644 index 00000000..c0d4a402 --- /dev/null +++ b/TUICallKit-Vue3/doctor/pages/doctor/doctor.vue @@ -0,0 +1,649 @@ + + + + + diff --git a/TUICallKit-Vue3/main.js b/TUICallKit-Vue3/main.js index ccc5335d..8f880e54 100644 --- a/TUICallKit-Vue3/main.js +++ b/TUICallKit-Vue3/main.js @@ -116,12 +116,47 @@ function apiUrl(promise, Loading = true) { }) } +/** + * 解析页面参数(支持普通参数和扫码 scene 参数) + * @param {Object} options - 页面 options,如 getCurrentPages()[].options + * @returns {Object} 解析后的参数对象 + */ +function parsePageParams(options) { + const params = {} + if (!options) return params + + // 如果有 scene 参数(扫码进入),解析 scene + if (options.scene) { + try { + const decodedScene = decodeURIComponent(options.scene) + decodedScene.split('&').forEach(item => { + const [key, value] = item.split('=') + if (key && value) { + params[key] = value + } + }) + } catch (error) { + console.error('解析scene参数失败:', error) + } + } + + // 合并普通参数(普通跳转进入) + Object.keys(options).forEach(key => { + if (key !== 'scene' && options[key]) { + params[key] = options[key] + } + }) + + return params +} + export function createApp() { const app = createSSRApp(App) // Vue3挂载全局属性的方式 app.config.globalProperties.$url = baseUrl app.config.globalProperties.apiUrl = apiUrl + app.config.globalProperties.$parsePageParams = parsePageParams return { app diff --git a/TUICallKit-Vue3/pages.json b/TUICallKit-Vue3/pages.json index 98bea226..f36dc013 100644 --- a/TUICallKit-Vue3/pages.json +++ b/TUICallKit-Vue3/pages.json @@ -80,11 +80,22 @@ } } ] + }, + { + "root": "doctor", + "pages": [ + { + "path": "pages/doctor/doctor", + "style": { + "navigationBarTitleText": "医生信息" + } + } + ] } ], "tabBar": { - "color": "#7A7E83", - "selectedColor": "#FFA500", + "color": "#8a8a8a", + "selectedColor": "#204e2b", "borderStyle": "black", "backgroundColor": "#ffffff", "list": [{ diff --git a/TUICallKit-Vue3/pages/Card/Card.vue b/TUICallKit-Vue3/pages/Card/Card.vue index 37b65097..d5662e8c 100644 --- a/TUICallKit-Vue3/pages/Card/Card.vue +++ b/TUICallKit-Vue3/pages/Card/Card.vue @@ -1,9 +1,7 @@