diff --git a/.env.development b/.env.development
index 255b496..2d56c39 100644
--- a/.env.development
+++ b/.env.development
@@ -3,7 +3,7 @@ MP_IMAGE_URL=https://patient.youcan365.com
MP_CACHE_PREFIX=development
MP_WX_APP_ID=wx1d8337a40c11d66c
MP_CORP_ID=wwe3fb2faa52cf9dfb
-MP_TIM_SDK_APP_ID=1600123876
+MP_TIM_SDK_APP_ID=1600126296
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
MP_INVITE_PATIENT_QRCODE=https://patient.youcan365.com/invite-patient
MP_PATIENT_PAGE_BASE_URL= 'https://www.youcan365.com/patientDeploy/#/'
diff --git a/.env.localhost b/.env.localhost
index 25cc623..8a87a34 100644
--- a/.env.localhost
+++ b/.env.localhost
@@ -3,7 +3,7 @@ MP_IMAGE_URL=https://patient.youcan365.com
MP_CACHE_PREFIX=development
MP_WX_APP_ID=wx1d8337a40c11d66c
MP_CORP_ID=wwe3fb2faa52cf9dfb
-MP_TIM_SDK_APP_ID=1600123876
+MP_TIM_SDK_APP_ID=1600126296
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
MP_INVITE_PATIENT_QRCODE=https://patient.youcan365.com/invite-patient
MP_PATIENT_PAGE_BASE_URL= 'https://www.youcan365.com/patientDeploy/#/'
diff --git a/App.vue b/App.vue
index 621260a..07beaf8 100644
--- a/App.vue
+++ b/App.vue
@@ -1,424 +1,430 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/components/button-footer.vue b/components/button-footer.vue
index 33214a4..0d04a23 100644
--- a/components/button-footer.vue
+++ b/components/button-footer.vue
@@ -1,24 +1,32 @@
-
+
+
+
+
{{ cancelText }}
-
+
+
+
+
{{ confirmText }}
\ No newline at end of file
diff --git a/components/form-template/form-cell/form-input.vue b/components/form-template/form-cell/form-input.vue
index 7214f88..0f944a8 100644
--- a/components/form-template/form-cell/form-input.vue
+++ b/components/form-template/form-cell/form-input.vue
@@ -42,9 +42,13 @@ const props = defineProps({
type: [Number, String],
default: 20
},
+ placeholder: {
+ type: String,
+ default: ''
+ }
})
-const placeholder = computed(() => `请输入${props.name || ''}`)
+const placeholder = computed(() => props.placeholder || `请输入${props.name || ''}`)
const value = computed(() => {
const v = props.form?.[props.title];
return v === undefined || v === null ? '' : String(v);
diff --git a/pages/home/components/cert-popup.vue b/pages/home/components/cert-popup.vue
index 8deb31c..0bb0bdf 100644
--- a/pages/home/components/cert-popup.vue
+++ b/pages/home/components/cert-popup.vue
@@ -37,7 +37,7 @@
diff --git a/pages/home/message-home.vue b/pages/home/message-home.vue
index 5270017..955b46d 100644
--- a/pages/home/message-home.vue
+++ b/pages/home/message-home.vue
@@ -368,22 +368,6 @@ const loadConversationList = async () => {
}
} catch (error) {
console.error("加载会话列表失败:", error);
-
- // 如果是超时或连接错误,提示用户重试
- if (
- error.message &&
- (error.message.includes("超时") || error.message.includes("连接"))
- ) {
- uni.showToast({
- title: "网络连接不稳定,请重试",
- icon: "none",
- });
- } else {
- uni.showToast({
- title: error.message || "加载失败,请重试",
- icon: "none",
- });
- }
} finally {
loading.value = false;
}
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 93fe717..fbdc489 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -84,7 +84,7 @@ function toAggreement(type) {
async function getPhoneNumber(e) {
const phoneCode = e && e.detail && e.detail.code;
- // if (e && !phoneCode) return;
+ if (e && !phoneCode) return;
const res = await login(phoneCode);
if (res && redirectUrl.value) {
diff --git a/pages/message/index.vue b/pages/message/index.vue
index 48ec97a..d022130 100644
--- a/pages/message/index.vue
+++ b/pages/message/index.vue
@@ -245,11 +245,16 @@ async function tryConsumePendingFollowUpSend() {
const currentGroupId = normalizeGroupId(groupId.value || "");
// 必须匹配当前会话,才允许发送
- if (!payloadConversationID || payloadConversationID !== currentConversationID) return;
- if (payloadGroupId && currentGroupId && payloadGroupId !== currentGroupId) return;
+ if (!payloadConversationID || payloadConversationID !== currentConversationID)
+ return;
+ if (payloadGroupId && currentGroupId && payloadGroupId !== currentGroupId)
+ return;
const messages = Array.isArray(payload.messages) ? payload.messages : [];
- const context = payload.context && typeof payload.context === "object" ? payload.context : {};
+ const context =
+ payload.context && typeof payload.context === "object"
+ ? payload.context
+ : {};
if (!messages.length) {
uni.removeStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY);
return;
@@ -438,7 +443,9 @@ onLoad((options) => {
};
const rawGroupId = decodeQueryValue(options.groupID || "");
- groupId.value = rawGroupId.startsWith("GROUP") ? rawGroupId.replace(/^GROUP/, "") : rawGroupId;
+ groupId.value = rawGroupId.startsWith("GROUP")
+ ? rawGroupId.replace(/^GROUP/, "")
+ : rawGroupId;
messageList.value = [];
isLoading.value = false;
if (options.conversationID) {
@@ -872,13 +879,17 @@ onShow(() => {
checkLoginAndInitTIM();
} else if (timChatManager.tim && !timChatManager.isLoggedIn) {
timChatManager.ensureIMConnection();
- } else if (timChatManager.tim && timChatManager.isLoggedIn && chatInfo.value.conversationID) {
+ } else if (
+ timChatManager.tim &&
+ timChatManager.isLoggedIn &&
+ chatInfo.value.conversationID
+ ) {
// 页面从后台返回时,重新加载消息列表
console.log("页面从后台返回,重新加载消息列表");
messageList.value = [];
isCompleted.value = false;
lastFirstMessageId.value = "";
- loadMessageList();
+ // loadMessageList();
}
startIMMonitoring(30000);
diff --git a/pages/work/department-select.vue b/pages/work/department-select.vue
index 230013a..e3e5501 100644
--- a/pages/work/department-select.vue
+++ b/pages/work/department-select.vue
@@ -48,7 +48,7 @@
如没有符合的内容,请
联系客服
-
+
diff --git a/pages/work/hospital-select.vue b/pages/work/hospital-select.vue
index e1c8cd3..6a97065 100644
--- a/pages/work/hospital-select.vue
+++ b/pages/work/hospital-select.vue
@@ -26,7 +26,7 @@
如没有符合的内容,请
联系客服
-
+
diff --git a/pages/work/profile.vue b/pages/work/profile.vue
index bc10500..a854b15 100644
--- a/pages/work/profile.vue
+++ b/pages/work/profile.vue
@@ -12,7 +12,10 @@
-
+
+
@@ -48,7 +51,17 @@
-
+
+
+
+
+ {{ confirmText }}
+
+
+
+
@@ -72,7 +85,7 @@ import fullPage from "@/components/full-page.vue";
const { account, doctorInfo } = storeToRefs(useAccountStore());
const { useLoad, useShow } = useGuard();
-const { getDoctorInfo } = useAccountStore();
+const { getDoctorInfo, login } = useAccountStore();
const job = { assistant: "医生助理", doctor: "医生" };
const jobOptions = [{ name: '医生', value: 'doctor' }, { name: '医生助理', value: 'assistant' }, { name: '无', value: '' }];
@@ -185,7 +198,7 @@ function toCert() {
}
function selectDept() {
- if(rule.value.dept.disabled) return;
+ if (rule.value.dept.disabled) return;
const eventName = `selectDept_${Date.now()}`
const deptIds = (formData.value.hlwDepts || []).map(i => i.deptId).filter(Boolean).join(',')
uni.navigateTo({
@@ -196,6 +209,21 @@ function selectDept() {
})
}
+async function getPhoneNumber(e) {
+ const phoneCode = e && e.detail && e.detail.code;
+ if (e && !phoneCode) return;
+ try {
+ const res = await login(phoneCode);
+ if (!res || !res.mobile) {
+ return toast('绑定手机号失败')
+ }
+ save()
+ } catch (e) {
+ toast('绑定手机号失败')
+ }
+
+}
+
async function save() {
if (
typeof formData.value.anotherName !== "string" ||
@@ -253,4 +281,10 @@ useShow(() => {
width: 64rpx;
height: 64rpx;
}
+
+.phone-btn {
+ left: 0;
+ top: 0;
+ opacity: 0;
+}
diff --git a/pages/work/team/invite/rename-popup.vue b/pages/work/team/invite/rename-popup.vue
index d782eba..4d75fb4 100644
--- a/pages/work/team/invite/rename-popup.vue
+++ b/pages/work/team/invite/rename-popup.vue
@@ -9,7 +9,7 @@
-
+
diff --git a/store/account.js b/store/account.js
index 12eba8e..9203c64 100644
--- a/store/account.js
+++ b/store/account.js
@@ -1,4 +1,4 @@
-import { ref } from "vue";
+import { ref, watch } from "vue";
import { defineStore } from "pinia";
import api from '@/utils/api';
import { toast } from '@/utils/widget';
@@ -55,16 +55,16 @@ export default defineStore("accountStore", () => {
corpId,
});
if (res.success && res.data) {
- if (!res.data.mobile) {
- const target = '/pages/login/login';
- uni.redirectTo({ url: target });
- return;
- }
+ // if (!res.data.mobile) {
+ // const target = '/pages/login/login';
+ // uni.redirectTo({ url: target });
+ // return;
+ // }
account.value = res.data;
openid.value = res.data.openid;
// 持久化账户信息
- cache.set(CACHE_KEYS.ACCOUNT, res.data);
- cache.set(CACHE_KEYS.OPENID, res.data.openid);
+ // cache.set(CACHE_KEYS.ACCOUNT, res.data);
+ // cache.set(CACHE_KEYS.OPENID, res.data.openid);
// 登录成功后初始化腾讯IM
await getDoctorInfo({ openid: openid.value });
@@ -155,9 +155,25 @@ export default defineStore("accountStore", () => {
doctorInfo.value = null;
// 清空缓存
- cache.remove(CACHE_KEYS.ACCOUNT);
- cache.remove(CACHE_KEYS.OPENID);
+ // cache.remove(CACHE_KEYS.ACCOUNT);
+ // cache.remove(CACHE_KEYS.OPENID);
}
+ watch(account, n => {
+ if (n) {
+ cache.set(CACHE_KEYS.ACCOUNT, n);
+ } else {
+ cache.remove(CACHE_KEYS.ACCOUNT);
+ }
+ })
+
+ watch(openid, n => {
+ if (n) {
+ cache.set(CACHE_KEYS.OPENID, n);
+ } else {
+ cache.remove(CACHE_KEYS.OPENID);
+ }
+ })
+
return { account, openid, isIMInitialized, doctorInfo, login, getDoctorInfo, initIMAfterLogin, logout }
})
\ No newline at end of file