Merge remote-tracking branch 'origin/dev-wdb' into dev-hjf
This commit is contained in:
commit
6e4a9020a2
@ -3,7 +3,7 @@ MP_IMAGE_URL=https://patient.youcan365.com
|
|||||||
MP_CACHE_PREFIX=development
|
MP_CACHE_PREFIX=development
|
||||||
MP_WX_APP_ID=wx1d8337a40c11d66c
|
MP_WX_APP_ID=wx1d8337a40c11d66c
|
||||||
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
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_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
||||||
MP_INVITE_PATIENT_QRCODE=https://patient.youcan365.com/invite-patient
|
MP_INVITE_PATIENT_QRCODE=https://patient.youcan365.com/invite-patient
|
||||||
MP_PATIENT_PAGE_BASE_URL= 'https://www.youcan365.com/patientDeploy/#/'
|
MP_PATIENT_PAGE_BASE_URL= 'https://www.youcan365.com/patientDeploy/#/'
|
||||||
|
|||||||
@ -3,7 +3,7 @@ MP_IMAGE_URL=https://patient.youcan365.com
|
|||||||
MP_CACHE_PREFIX=development
|
MP_CACHE_PREFIX=development
|
||||||
MP_WX_APP_ID=wx1d8337a40c11d66c
|
MP_WX_APP_ID=wx1d8337a40c11d66c
|
||||||
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
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_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
||||||
MP_INVITE_PATIENT_QRCODE=https://patient.youcan365.com/invite-patient
|
MP_INVITE_PATIENT_QRCODE=https://patient.youcan365.com/invite-patient
|
||||||
MP_PATIENT_PAGE_BASE_URL= 'https://www.youcan365.com/patientDeploy/#/'
|
MP_PATIENT_PAGE_BASE_URL= 'https://www.youcan365.com/patientDeploy/#/'
|
||||||
|
|||||||
854
App.vue
854
App.vue
@ -1,424 +1,430 @@
|
|||||||
<script>
|
<script>
|
||||||
import useAccountStore from "@/store/account.js";
|
import useAccountStore from "@/store/account.js";
|
||||||
import { globalTimChatManager } from "@/utils/tim-chat.js";
|
import {
|
||||||
|
globalTimChatManager
|
||||||
export default {
|
} from "@/utils/tim-chat.js";
|
||||||
onLaunch: function () {
|
|
||||||
// 需在 pinia 安装后再获取 store,避免 getActivePinia 报错
|
export default {
|
||||||
const { account, login, initIMAfterLogin, getDoctorInfo } =
|
onLaunch: function() {
|
||||||
useAccountStore();
|
const {
|
||||||
|
account,
|
||||||
// 如果已有缓存的账户信息,尝试初始化 IM,否则重新登录
|
login,
|
||||||
if (account && account.openid) {
|
initIMAfterLogin,
|
||||||
console.log("App Launch: 已有登录信息,初始化 IM");
|
getDoctorInfo
|
||||||
initIMAfterLogin().catch((err) => {
|
} = useAccountStore();
|
||||||
console.error("IM初始化失败:", err);
|
|
||||||
});
|
if (account && account.openid) {
|
||||||
getDoctorInfo();
|
console.log("App Launch: 已有登录信息,初始化 IM");
|
||||||
} else {
|
initIMAfterLogin().catch((err) => {
|
||||||
console.log("App Launch: 无登录信息,开始登录");
|
console.error("IM初始化失败:", err);
|
||||||
login().catch((err) => {
|
});
|
||||||
console.error("自动登录失败:", err);
|
getDoctorInfo();
|
||||||
});
|
} else {
|
||||||
}
|
console.log("App Launch: 无登录信息,开始登录");
|
||||||
},
|
login().catch((err) => {
|
||||||
onShow: function () {
|
console.error("自动登录失败:", err);
|
||||||
console.log("App Show");
|
});
|
||||||
},
|
}
|
||||||
onHide: function () {
|
},
|
||||||
console.log("App Hide");
|
onShow: function() {
|
||||||
// 小程序退出时退出腾讯IM登录
|
console.log("App Show");
|
||||||
// try {
|
},
|
||||||
// if (globalTimChatManager && globalTimChatManager.tim) {
|
onHide: function() {
|
||||||
// console.log('小程序退出,开始退出腾讯IM');
|
console.log("App Hide");
|
||||||
// globalTimChatManager.destroy();
|
// 小程序退出时退出腾讯IM登录
|
||||||
// console.log('腾讯IM退出成功');
|
// try {
|
||||||
// }
|
// if (globalTimChatManager && globalTimChatManager.tim) {
|
||||||
// } catch (error) {
|
// console.log('小程序退出,开始退出腾讯IM');
|
||||||
// console.error('退出腾讯IM失败:', error);
|
// globalTimChatManager.destroy();
|
||||||
// }
|
// console.log('腾讯IM退出成功');
|
||||||
},
|
// }
|
||||||
};
|
// } catch (error) {
|
||||||
</script>
|
// console.error('退出腾讯IM失败:', error);
|
||||||
|
// }
|
||||||
<style lang="scss">
|
},
|
||||||
$primary-color: #0877f1;
|
};
|
||||||
|
</script>
|
||||||
page {
|
|
||||||
height: 100%;
|
<style lang="scss">
|
||||||
background: #f5f5f5;
|
$primary-color: #0877f1;
|
||||||
}
|
|
||||||
|
page {
|
||||||
/* 全局按钮样式 - 使用项目主题色 */
|
height: 100%;
|
||||||
button[type="primary"],
|
background: #f5f5f5;
|
||||||
.button-primary,
|
}
|
||||||
uni-button[type="primary"] {
|
|
||||||
background-color: $primary-color !important;
|
/* 全局按钮样式 - 使用项目主题色 */
|
||||||
border-color: $primary-color !important;
|
button[type="primary"],
|
||||||
color: #fff !important;
|
.button-primary,
|
||||||
}
|
uni-button[type="primary"] {
|
||||||
|
background-color: $primary-color !important;
|
||||||
button[type="primary"]:not([disabled]):active,
|
border-color: $primary-color !important;
|
||||||
.button-primary:active,
|
color: #fff !important;
|
||||||
uni-button[type="primary"]:not([disabled]):active {
|
}
|
||||||
background-color: darken($primary-color, 10%) !important;
|
|
||||||
border-color: darken($primary-color, 10%) !important;
|
button[type="primary"]:not([disabled]):active,
|
||||||
}
|
.button-primary:active,
|
||||||
|
uni-button[type="primary"]:not([disabled]):active {
|
||||||
/* 微信小程序按钮样式覆盖 */
|
background-color: darken($primary-color, 10%) !important;
|
||||||
.wx-button[type="primary"] {
|
border-color: darken($primary-color, 10%) !important;
|
||||||
background-color: $primary-color !important;
|
}
|
||||||
border-color: $primary-color !important;
|
|
||||||
color: #fff !important;
|
/* 微信小程序按钮样式覆盖 */
|
||||||
}
|
.wx-button[type="primary"] {
|
||||||
|
background-color: $primary-color !important;
|
||||||
.shadow-up {
|
border-color: $primary-color !important;
|
||||||
box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
color: #fff !important;
|
||||||
rgba(0, 0, 0, 0.1) 0px -10px 15px -3px, rgba(0, 0, 0, 0.1) 0px -4px 6px -4px;
|
}
|
||||||
}
|
|
||||||
|
.shadow-up {
|
||||||
.shadow-lg {
|
box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||||
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
rgba(0, 0, 0, 0.1) 0px -10px 15px -3px, rgba(0, 0, 0, 0.1) 0px -4px 6px -4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.relative {
|
.shadow-lg {
|
||||||
position: relative;
|
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
||||||
}
|
}
|
||||||
.absolute {
|
|
||||||
position: absolute;
|
.relative {
|
||||||
}
|
position: relative;
|
||||||
|
}
|
||||||
.inline-block {
|
|
||||||
display: inline-block;
|
.absolute {
|
||||||
}
|
position: absolute;
|
||||||
|
}
|
||||||
.flex {
|
|
||||||
display: flex;
|
.inline-block {
|
||||||
}
|
display: inline-block;
|
||||||
|
}
|
||||||
.flex-col {
|
|
||||||
flex-direction: column;
|
.flex {
|
||||||
}
|
display: flex;
|
||||||
|
}
|
||||||
.flex-wrap {
|
|
||||||
flex-wrap: wrap;
|
.flex-col {
|
||||||
}
|
flex-direction: column;
|
||||||
|
}
|
||||||
.flex-grow {
|
|
||||||
flex-grow: 1;
|
.flex-wrap {
|
||||||
}
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
.flex-shrink-0 {
|
|
||||||
flex-shrink: 0;
|
.flex-grow {
|
||||||
}
|
flex-grow: 1;
|
||||||
|
}
|
||||||
.items-center {
|
|
||||||
align-items: center;
|
.flex-shrink-0 {
|
||||||
}
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
.justify-center {
|
|
||||||
justify-content: center;
|
.items-center {
|
||||||
}
|
align-items: center;
|
||||||
|
}
|
||||||
.justify-between {
|
|
||||||
justify-content: space-between;
|
.justify-center {
|
||||||
}
|
justify-content: center;
|
||||||
|
}
|
||||||
.justify-around {
|
|
||||||
justify-content: space-around;
|
.justify-between {
|
||||||
}
|
justify-content: space-between;
|
||||||
|
}
|
||||||
.justify-end {
|
|
||||||
justify-content: flex-end;
|
.justify-around {
|
||||||
}
|
justify-content: space-around;
|
||||||
|
}
|
||||||
.bg-gray {
|
|
||||||
background: #f5f5f5;
|
.justify-end {
|
||||||
}
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
.bg-primary {
|
|
||||||
background: $primary-color;
|
.bg-gray {
|
||||||
}
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
.bg-success {
|
|
||||||
background: green;
|
.bg-primary {
|
||||||
}
|
background: $primary-color;
|
||||||
|
}
|
||||||
.bg-white {
|
|
||||||
background: #fff;
|
.bg-success {
|
||||||
}
|
background: green;
|
||||||
|
}
|
||||||
.bg-warning {
|
|
||||||
background: orange;
|
.bg-white {
|
||||||
}
|
background: #fff;
|
||||||
|
}
|
||||||
.bg-danger {
|
|
||||||
background: rgb(248 113 113);
|
.bg-warning {
|
||||||
}
|
background: orange;
|
||||||
|
}
|
||||||
.bg-light-text-color {
|
|
||||||
position: relative;
|
.bg-danger {
|
||||||
}
|
background: rgb(248 113 113);
|
||||||
|
}
|
||||||
.bg-light-text-color::after {
|
|
||||||
content: "";
|
.bg-light-text-color {
|
||||||
position: absolute;
|
position: relative;
|
||||||
top: 0;
|
}
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
.bg-light-text-color::after {
|
||||||
height: 100%;
|
content: "";
|
||||||
opacity: 0.2;
|
position: absolute;
|
||||||
background: currentColor;
|
top: 0;
|
||||||
}
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
.py-3 {
|
height: 100%;
|
||||||
padding-top: 6rpx;
|
opacity: 0.2;
|
||||||
padding-bottom: 6rpx;
|
background: currentColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.py-5 {
|
.py-3 {
|
||||||
padding-top: 10rpx;
|
padding-top: 6rpx;
|
||||||
padding-bottom: 10rpx;
|
padding-bottom: 6rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-15 {
|
.py-5 {
|
||||||
padding: 30rpx;
|
padding-top: 10rpx;
|
||||||
}
|
padding-bottom: 10rpx;
|
||||||
|
}
|
||||||
.p-10 {
|
|
||||||
padding: 20rpx;
|
.p-15 {
|
||||||
}
|
padding: 30rpx;
|
||||||
|
}
|
||||||
.px-5 {
|
|
||||||
padding-left: 10rpx;
|
.p-10 {
|
||||||
padding-right: 10rpx;
|
padding: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.px-10 {
|
.px-5 {
|
||||||
padding-left: 20rpx;
|
padding-left: 10rpx;
|
||||||
padding-right: 20rpx;
|
padding-right: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.px-12 {
|
.px-10 {
|
||||||
padding-left: 24rpx;
|
padding-left: 20rpx;
|
||||||
padding-right: 24rpx;
|
padding-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.px-15 {
|
.px-12 {
|
||||||
padding-left: 30rpx;
|
padding-left: 24rpx;
|
||||||
padding-right: 30rpx;
|
padding-right: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pt-5 {
|
.px-15 {
|
||||||
padding-top: 10rpx;
|
padding-left: 30rpx;
|
||||||
}
|
padding-right: 30rpx;
|
||||||
.pt-15 {
|
}
|
||||||
padding-top: 30rpx;
|
|
||||||
}
|
.pt-5 {
|
||||||
|
padding-top: 10rpx;
|
||||||
.break-all {
|
}
|
||||||
word-break: break-all;
|
|
||||||
}
|
.pt-15 {
|
||||||
|
padding-top: 30rpx;
|
||||||
.pb-5 {
|
}
|
||||||
padding-bottom: 10rpx;
|
|
||||||
}
|
.break-all {
|
||||||
|
word-break: break-all;
|
||||||
.pb-10 {
|
}
|
||||||
padding-bottom: 20rpx;
|
|
||||||
}
|
.pb-5 {
|
||||||
|
padding-bottom: 10rpx;
|
||||||
.py-10 {
|
}
|
||||||
padding-top: 20rpx;
|
|
||||||
padding-bottom: 20rpx;
|
.pb-10 {
|
||||||
}
|
padding-bottom: 20rpx;
|
||||||
|
}
|
||||||
.py-12 {
|
|
||||||
padding-top: 24rpx;
|
.py-10 {
|
||||||
padding-bottom: 24rpx;
|
padding-top: 20rpx;
|
||||||
}
|
padding-bottom: 20rpx;
|
||||||
|
}
|
||||||
.py-15 {
|
|
||||||
padding-top: 30rpx;
|
.py-12 {
|
||||||
padding-bottom: 30rpx;
|
padding-top: 24rpx;
|
||||||
}
|
padding-bottom: 24rpx;
|
||||||
|
}
|
||||||
.mr-5 {
|
|
||||||
margin-right: 10rpx;
|
.py-15 {
|
||||||
}
|
padding-top: 30rpx;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
.mr-10 {
|
}
|
||||||
margin-right: 20rpx;
|
|
||||||
}
|
.mr-5 {
|
||||||
|
margin-right: 10rpx;
|
||||||
.ml-15 {
|
}
|
||||||
margin-left: 30rpx;
|
|
||||||
}
|
.mr-10 {
|
||||||
|
margin-right: 20rpx;
|
||||||
.mb-5 {
|
}
|
||||||
margin-bottom: 10rpx;
|
|
||||||
}
|
.ml-15 {
|
||||||
|
margin-left: 30rpx;
|
||||||
.mb-10 {
|
}
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
.mb-5 {
|
||||||
|
margin-bottom: 10rpx;
|
||||||
.mt-10 {
|
}
|
||||||
margin-top: 20rpx;
|
|
||||||
}
|
.mb-10 {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
.mt-15 {
|
}
|
||||||
margin-top: 30rpx;
|
|
||||||
}
|
.mt-10 {
|
||||||
|
margin-top: 20rpx;
|
||||||
.mt-12 {
|
}
|
||||||
margin-top: 24rpx;
|
|
||||||
}
|
.mt-15 {
|
||||||
|
margin-top: 30rpx;
|
||||||
.mx-10 {
|
}
|
||||||
margin-left: 20rpx;
|
|
||||||
margin-right: 20rpx;
|
.mt-12 {
|
||||||
}
|
margin-top: 24rpx;
|
||||||
|
}
|
||||||
.mx-auto {
|
|
||||||
margin-left: auto;
|
.mx-10 {
|
||||||
margin-right: auto;
|
margin-left: 20rpx;
|
||||||
}
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
.rounded {
|
|
||||||
border-radius: 16rpx;
|
.mx-auto {
|
||||||
}
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
.rounded-sm {
|
}
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
.rounded {
|
||||||
|
border-radius: 16rpx;
|
||||||
.rounded-full {
|
}
|
||||||
border-radius: 999px;
|
|
||||||
}
|
.rounded-sm {
|
||||||
|
border-radius: 8rpx;
|
||||||
.text-center {
|
}
|
||||||
text-align: center;
|
|
||||||
}
|
.rounded-full {
|
||||||
|
border-radius: 999px;
|
||||||
.text-right {
|
}
|
||||||
text-align: right;
|
|
||||||
}
|
.text-center {
|
||||||
|
text-align: center;
|
||||||
.text-gray {
|
}
|
||||||
color: #999;
|
|
||||||
}
|
.text-right {
|
||||||
|
text-align: right;
|
||||||
.text-black {
|
}
|
||||||
color: #000;
|
|
||||||
}
|
.text-gray {
|
||||||
|
color: #999;
|
||||||
.text-dark {
|
}
|
||||||
color: #333;
|
|
||||||
}
|
.text-black {
|
||||||
|
color: #000;
|
||||||
.text-danger {
|
}
|
||||||
color: #f56c6c;
|
|
||||||
}
|
.text-dark {
|
||||||
|
color: #333;
|
||||||
.text-primary {
|
}
|
||||||
color: $primary-color;
|
|
||||||
}
|
.text-danger {
|
||||||
|
color: #f56c6c;
|
||||||
.text-success {
|
}
|
||||||
color: #67c23a;
|
|
||||||
}
|
.text-primary {
|
||||||
|
color: $primary-color;
|
||||||
.text-white {
|
}
|
||||||
color: #fff;
|
|
||||||
}
|
.text-success {
|
||||||
|
color: #67c23a;
|
||||||
.text-warning {
|
}
|
||||||
color: #f56c6c;
|
|
||||||
}
|
.text-white {
|
||||||
|
color: #fff;
|
||||||
.text-sm {
|
}
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
.text-warning {
|
||||||
|
color: #f56c6c;
|
||||||
.text-base {
|
}
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
.text-sm {
|
||||||
|
font-size: 24rpx;
|
||||||
.text-lg {
|
}
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
.text-base {
|
||||||
|
font-size: 28rpx;
|
||||||
.text-xl {
|
}
|
||||||
font-size: 36rpx;
|
|
||||||
}
|
.text-lg {
|
||||||
|
font-size: 32rpx;
|
||||||
.leading-normal {
|
}
|
||||||
line-height: 1.5;
|
|
||||||
}
|
.text-xl {
|
||||||
|
font-size: 36rpx;
|
||||||
.border {
|
}
|
||||||
border: 1px solid #eee;
|
|
||||||
}
|
.leading-normal {
|
||||||
|
line-height: 1.5;
|
||||||
.border-dashed {
|
}
|
||||||
border: 1px dashed #eee;
|
|
||||||
}
|
.border {
|
||||||
|
border: 1px solid #eee;
|
||||||
.border-b {
|
}
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
}
|
.border-dashed {
|
||||||
|
border: 1px dashed #eee;
|
||||||
.border-auto {
|
}
|
||||||
border: 1px solid;
|
|
||||||
}
|
.border-b {
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
.border-dashed-auto {
|
}
|
||||||
border: 1px dashed;
|
|
||||||
}
|
.border-auto {
|
||||||
|
border: 1px solid;
|
||||||
.border-primary {
|
}
|
||||||
border: 1px solid $primary-color;
|
|
||||||
}
|
.border-dashed-auto {
|
||||||
|
border: 1px dashed;
|
||||||
.font-semibold {
|
}
|
||||||
font-weight: bold;
|
|
||||||
}
|
.border-primary {
|
||||||
|
border: 1px solid $primary-color;
|
||||||
.truncate {
|
}
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
.font-semibold {
|
||||||
text-overflow: ellipsis;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.w-0 {
|
.truncate {
|
||||||
width: 0;
|
white-space: nowrap;
|
||||||
}
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
.w-full {
|
}
|
||||||
width: 100%;
|
|
||||||
}
|
.w-0 {
|
||||||
|
width: 0;
|
||||||
.overflow-hidden {
|
}
|
||||||
overflow: hidden;
|
|
||||||
}
|
.w-full {
|
||||||
|
width: 100%;
|
||||||
.border-box {
|
}
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
.overflow-hidden {
|
||||||
|
overflow: hidden;
|
||||||
.line-clamp-2 {
|
}
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-box-orient: vertical;
|
.border-box {
|
||||||
-webkit-line-clamp: 2;
|
box-sizing: border-box;
|
||||||
overflow: hidden;
|
}
|
||||||
}
|
|
||||||
|
.line-clamp-2 {
|
||||||
.h-full {
|
display: -webkit-box;
|
||||||
height: 100%;
|
-webkit-box-orient: vertical;
|
||||||
}
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
.safe-bottom-padding {
|
}
|
||||||
height: env(safe-area-inset-bottom);
|
|
||||||
}
|
.h-full {
|
||||||
</style>
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.safe-bottom-padding {
|
||||||
|
height: env(safe-area-inset-bottom);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -1,24 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<view v-if="showCancel || showConfirm" class="relative flex px-15 py-12 bg-white text-center"
|
<view v-if="showCancel || showConfirm" class="relative flex px-15 py-12 bg-white text-center"
|
||||||
:class="hidedenShadow ? '' : 'shadow-up'">
|
:class="showShadow ? 'shadow-up' : ''">
|
||||||
<view v-if="showCancel" class="flex-grow py-10 text-base border-primary rounded text-primary rounded"
|
<view v-if="showCancel && customCancel" class="relative" :style="widthStyle">
|
||||||
|
<slot name="cancel"></slot>
|
||||||
|
</view>
|
||||||
|
<view v-else-if="showCancel" class="py-10 text-base border-primary rounded text-primary rounded" :style="widthStyle"
|
||||||
@click="cancel()">
|
@click="cancel()">
|
||||||
{{ cancelText }}
|
{{ cancelText }}
|
||||||
</view>
|
</view>
|
||||||
<view v-if="showConfirm" class="flex-grow py-10 text-base border-primary bg-primary text-white rounded"
|
<view v-if="showConfirm && customConfirm" :class="showCancel && showConfirm ? 'ml-15' : ''" :style="widthStyle">
|
||||||
:class="showCancel && showConfirm ? 'ml-15' : ''" @click="confirm()">
|
<slot name="confirm"></slot>
|
||||||
|
</view>
|
||||||
|
<view v-else-if="showConfirm" class="py-10 text-base border-primary bg-primary text-white rounded"
|
||||||
|
:class="showCancel && showConfirm ? 'ml-15' : ''" :style="widthStyle" @click="confirm()">
|
||||||
{{ confirmText }}
|
{{ confirmText }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { computed, useSlots, ref } from "vue";
|
||||||
|
|
||||||
import useDebounce from '@/utils/useDebounce';
|
import useDebounce from '@/utils/useDebounce';
|
||||||
|
|
||||||
const emits = defineEmits(['cancel', 'confirm']);
|
const emits = defineEmits(['cancel', 'confirm']);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
hidedenShadow: {
|
showShadow: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: true
|
||||||
},
|
},
|
||||||
cancelText: {
|
cancelText: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -40,5 +48,11 @@ const props = defineProps({
|
|||||||
|
|
||||||
const cancel = useDebounce(() => emits('cancel'));
|
const cancel = useDebounce(() => emits('cancel'));
|
||||||
const confirm = useDebounce(() => emits('confirm'));
|
const confirm = useDebounce(() => emits('confirm'));
|
||||||
|
const slots = useSlots();
|
||||||
|
const customCancel = computed(() => !!slots.cancel);
|
||||||
|
const customConfirm = computed(() => !!slots.confirm);
|
||||||
|
const widthStyle = computed(() => {
|
||||||
|
const val = [props.showCancel, props.showConfirm].filter(Boolean);
|
||||||
|
return `width: ${100 / (val.length || 1)}%`
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
@ -42,9 +42,13 @@ const props = defineProps({
|
|||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: 20
|
default: 20
|
||||||
},
|
},
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const placeholder = computed(() => `请输入${props.name || ''}`)
|
const placeholder = computed(() => props.placeholder || `请输入${props.name || ''}`)
|
||||||
const value = computed(() => {
|
const value = computed(() => {
|
||||||
const v = props.form?.[props.title];
|
const v = props.form?.[props.title];
|
||||||
return v === undefined || v === null ? '' : String(v);
|
return v === undefined || v === null ? '' : String(v);
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<view v-if="btns" class="footer-buttons">
|
<view v-if="btns" class="footer-buttons">
|
||||||
<button-footer hideden-shadow :cancelText="btns.cancelText" :confirmText="btns.confirmText"
|
<button-footer :showShadow="false" :cancelText="btns.cancelText" :confirmText="btns.confirmText"
|
||||||
:showCancel="btns.showCancel" :showConfirm="btns.showConfirm" @confirm="confirm()" @cancel="close()" />
|
:showCancel="btns.showCancel" :showConfirm="btns.showConfirm" @confirm="confirm()" @cancel="close()" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -368,22 +368,6 @@ const loadConversationList = async () => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("加载会话列表失败:", 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 {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,7 +84,7 @@ function toAggreement(type) {
|
|||||||
|
|
||||||
async function getPhoneNumber(e) {
|
async function getPhoneNumber(e) {
|
||||||
const phoneCode = e && e.detail && e.detail.code;
|
const phoneCode = e && e.detail && e.detail.code;
|
||||||
// if (e && !phoneCode) return;
|
if (e && !phoneCode) return;
|
||||||
const res = await login(phoneCode);
|
const res = await login(phoneCode);
|
||||||
|
|
||||||
if (res && redirectUrl.value) {
|
if (res && redirectUrl.value) {
|
||||||
|
|||||||
@ -245,11 +245,16 @@ async function tryConsumePendingFollowUpSend() {
|
|||||||
const currentGroupId = normalizeGroupId(groupId.value || "");
|
const currentGroupId = normalizeGroupId(groupId.value || "");
|
||||||
|
|
||||||
// 必须匹配当前会话,才允许发送
|
// 必须匹配当前会话,才允许发送
|
||||||
if (!payloadConversationID || payloadConversationID !== currentConversationID) return;
|
if (!payloadConversationID || payloadConversationID !== currentConversationID)
|
||||||
if (payloadGroupId && currentGroupId && payloadGroupId !== currentGroupId) return;
|
return;
|
||||||
|
if (payloadGroupId && currentGroupId && payloadGroupId !== currentGroupId)
|
||||||
|
return;
|
||||||
|
|
||||||
const messages = Array.isArray(payload.messages) ? payload.messages : [];
|
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) {
|
if (!messages.length) {
|
||||||
uni.removeStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY);
|
uni.removeStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY);
|
||||||
return;
|
return;
|
||||||
@ -438,7 +443,9 @@ onLoad((options) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const rawGroupId = decodeQueryValue(options.groupID || "");
|
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 = [];
|
messageList.value = [];
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
if (options.conversationID) {
|
if (options.conversationID) {
|
||||||
@ -872,13 +879,17 @@ onShow(() => {
|
|||||||
checkLoginAndInitTIM();
|
checkLoginAndInitTIM();
|
||||||
} else if (timChatManager.tim && !timChatManager.isLoggedIn) {
|
} else if (timChatManager.tim && !timChatManager.isLoggedIn) {
|
||||||
timChatManager.ensureIMConnection();
|
timChatManager.ensureIMConnection();
|
||||||
} else if (timChatManager.tim && timChatManager.isLoggedIn && chatInfo.value.conversationID) {
|
} else if (
|
||||||
|
timChatManager.tim &&
|
||||||
|
timChatManager.isLoggedIn &&
|
||||||
|
chatInfo.value.conversationID
|
||||||
|
) {
|
||||||
// 页面从后台返回时,重新加载消息列表
|
// 页面从后台返回时,重新加载消息列表
|
||||||
console.log("页面从后台返回,重新加载消息列表");
|
console.log("页面从后台返回,重新加载消息列表");
|
||||||
messageList.value = [];
|
messageList.value = [];
|
||||||
isCompleted.value = false;
|
isCompleted.value = false;
|
||||||
lastFirstMessageId.value = "";
|
lastFirstMessageId.value = "";
|
||||||
loadMessageList();
|
// loadMessageList();
|
||||||
}
|
}
|
||||||
|
|
||||||
startIMMonitoring(30000);
|
startIMMonitoring(30000);
|
||||||
|
|||||||
@ -48,7 +48,7 @@
|
|||||||
<text class="mr-5 text-base text-gray">如没有符合的内容,请</text>
|
<text class="mr-5 text-base text-gray">如没有符合的内容,请</text>
|
||||||
<text class="text-base text-primary">联系客服</text>
|
<text class="text-base text-primary">联系客服</text>
|
||||||
</view>
|
</view>
|
||||||
<button-footer :showCancel="false" @confirm="save()" />
|
<button-footer :showShadow="false" :showCancel="false" @confirm="save()" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</full-page>
|
</full-page>
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
<text class="mr-5 text-base text-gray">如没有符合的内容,请</text>
|
<text class="mr-5 text-base text-gray">如没有符合的内容,请</text>
|
||||||
<text class="text-base text-primary">联系客服</text>
|
<text class="text-base text-primary">联系客服</text>
|
||||||
</view>
|
</view>
|
||||||
<button-footer :showCancel="false" @confirm="save()" />
|
<button-footer :showShadow="false" :showCancel="false" @confirm="save()" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</full-page>
|
</full-page>
|
||||||
|
|||||||
@ -12,7 +12,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</common-cell>
|
</common-cell>
|
||||||
<form-select :form="formData" name="性别" title="gender" :range="genderOptions" @change="onChange($event)" />
|
<form-select :form="formData" name="性别" title="gender" :range="genderOptions" @change="onChange($event)" />
|
||||||
<form-input :form="formData" disableChange wordLimit="11" title="mobile" name="手机号 (不可修改)" />
|
<form-input v-if="account && account.mobile" :form="formData" disableChange wordLimit="11" title="mobile"
|
||||||
|
name="手机号 (不可修改)" />
|
||||||
|
<form-input v-else :form="formData" disableChange wordLimit="11" title="mobile" name="手机号 (不可修改)"
|
||||||
|
placeholder=" " />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="bg-white px-10 mb-10 rounded">
|
<view class="bg-white px-10 mb-10 rounded">
|
||||||
@ -48,7 +51,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<button-footer :cancelText="cancelText" :confirmText="confirmText" @confirm="save()" @cancel="back()" />
|
<button-footer v-if="account && account.mobile" :cancelText="cancelText" :confirmText="confirmText"
|
||||||
|
@confirm="save()" @cancel="back()" />
|
||||||
|
<button-footer v-else :cancelText="cancelText" :confirmText="confirmText" @confirm="save()" @cancel="back()">
|
||||||
|
<template #confirm>
|
||||||
|
<view class="relative py-10 text-base border-primary bg-primary text-white rounded">
|
||||||
|
{{ confirmText }}
|
||||||
|
<button class="phone-btn absolute w-full h-full" open-type="getPhoneNumber"
|
||||||
|
@getphonenumber="getPhoneNumber"></button>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</button-footer>
|
||||||
</template>
|
</template>
|
||||||
</full-page>
|
</full-page>
|
||||||
</template>
|
</template>
|
||||||
@ -72,7 +85,7 @@ import fullPage from "@/components/full-page.vue";
|
|||||||
|
|
||||||
const { account, doctorInfo } = storeToRefs(useAccountStore());
|
const { account, doctorInfo } = storeToRefs(useAccountStore());
|
||||||
const { useLoad, useShow } = useGuard();
|
const { useLoad, useShow } = useGuard();
|
||||||
const { getDoctorInfo } = useAccountStore();
|
const { getDoctorInfo, login } = useAccountStore();
|
||||||
|
|
||||||
const job = { assistant: "医生助理", doctor: "医生" };
|
const job = { assistant: "医生助理", doctor: "医生" };
|
||||||
const jobOptions = [{ name: '医生', value: 'doctor' }, { name: '医生助理', value: 'assistant' }, { name: '无', value: '' }];
|
const jobOptions = [{ name: '医生', value: 'doctor' }, { name: '医生助理', value: 'assistant' }, { name: '无', value: '' }];
|
||||||
@ -185,7 +198,7 @@ function toCert() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function selectDept() {
|
function selectDept() {
|
||||||
if(rule.value.dept.disabled) return;
|
if (rule.value.dept.disabled) return;
|
||||||
const eventName = `selectDept_${Date.now()}`
|
const eventName = `selectDept_${Date.now()}`
|
||||||
const deptIds = (formData.value.hlwDepts || []).map(i => i.deptId).filter(Boolean).join(',')
|
const deptIds = (formData.value.hlwDepts || []).map(i => i.deptId).filter(Boolean).join(',')
|
||||||
uni.navigateTo({
|
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() {
|
async function save() {
|
||||||
if (
|
if (
|
||||||
typeof formData.value.anotherName !== "string" ||
|
typeof formData.value.anotherName !== "string" ||
|
||||||
@ -253,4 +281,10 @@ useShow(() => {
|
|||||||
width: 64rpx;
|
width: 64rpx;
|
||||||
height: 64rpx;
|
height: 64rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.phone-btn {
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<input v-model="name" class="w-full" placeholder="请输入名称" />
|
<input v-model="name" class="w-full" placeholder="请输入名称" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button-footer hideden-shadow confirmText="保存" @confirm="confirm()" @cancel="close()" />
|
<button-footer :showShadow="false" confirmText="保存" @confirm="confirm()" @cancel="close()" />
|
||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { ref } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import api from '@/utils/api';
|
import api from '@/utils/api';
|
||||||
import { toast } from '@/utils/widget';
|
import { toast } from '@/utils/widget';
|
||||||
@ -55,16 +55,16 @@ export default defineStore("accountStore", () => {
|
|||||||
corpId,
|
corpId,
|
||||||
});
|
});
|
||||||
if (res.success && res.data) {
|
if (res.success && res.data) {
|
||||||
if (!res.data.mobile) {
|
// if (!res.data.mobile) {
|
||||||
const target = '/pages/login/login';
|
// const target = '/pages/login/login';
|
||||||
uni.redirectTo({ url: target });
|
// uni.redirectTo({ url: target });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
account.value = res.data;
|
account.value = res.data;
|
||||||
openid.value = res.data.openid;
|
openid.value = res.data.openid;
|
||||||
// 持久化账户信息
|
// 持久化账户信息
|
||||||
cache.set(CACHE_KEYS.ACCOUNT, res.data);
|
// cache.set(CACHE_KEYS.ACCOUNT, res.data);
|
||||||
cache.set(CACHE_KEYS.OPENID, res.data.openid);
|
// cache.set(CACHE_KEYS.OPENID, res.data.openid);
|
||||||
|
|
||||||
// 登录成功后初始化腾讯IM
|
// 登录成功后初始化腾讯IM
|
||||||
await getDoctorInfo({ openid: openid.value });
|
await getDoctorInfo({ openid: openid.value });
|
||||||
@ -155,9 +155,25 @@ export default defineStore("accountStore", () => {
|
|||||||
doctorInfo.value = null;
|
doctorInfo.value = null;
|
||||||
|
|
||||||
// 清空缓存
|
// 清空缓存
|
||||||
cache.remove(CACHE_KEYS.ACCOUNT);
|
// cache.remove(CACHE_KEYS.ACCOUNT);
|
||||||
cache.remove(CACHE_KEYS.OPENID);
|
// 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 }
|
return { account, openid, isIMInitialized, doctorInfo, login, getDoctorInfo, initIMAfterLogin, logout }
|
||||||
})
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user