Merge commit 'c56580d6c019eb82019b2fe4b9e821edea3d2d14' into dev-wdb
# Conflicts: # pages/message/message.vue
This commit is contained in:
commit
03aac339d8
@ -9,12 +9,12 @@
|
||||
</common-cell>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { computed, onMounted } from 'vue';
|
||||
import { set } from '@/utils/cache';
|
||||
|
||||
import commonCell from '../common-cell.vue';
|
||||
|
||||
const emits = defineEmits(['change']);
|
||||
const emits = defineEmits(['change', 'addRule']);
|
||||
const props = defineProps({
|
||||
form: {
|
||||
type: Object,
|
||||
@ -52,6 +52,18 @@ function select() {
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.required && props.title) {
|
||||
emits('addRule', {
|
||||
title: props.title,
|
||||
fn: () => {
|
||||
if (value.value.length > 0) return true;
|
||||
return `请选择${props.name || ''}`
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
<style>
|
||||
@import '../cell-style.css';
|
||||
|
||||
@ -12,10 +12,10 @@
|
||||
@change="change" />
|
||||
<form-textarea v-else-if="attrs.type === 'textarea'" v-bind="attrs" :form="form" :disableChange="disableChange"
|
||||
@change="change" />
|
||||
<form-mult-disease v-else-if="attrs.type === 'selfMultipleDiseases'" v-bind="attrs" :form="form"
|
||||
@change="change"></form-mult-disease>
|
||||
<form-mult-disease v-else-if="attrs.type === 'diagnosis'" v-bind="attrs" :form="form"
|
||||
@change="change"></form-mult-disease>
|
||||
<form-mult-disease v-else-if="attrs.type === 'selfMultipleDiseases'" v-bind="attrs" :form="form" @change="change"
|
||||
@addRule="addRule"></form-mult-disease>
|
||||
<form-mult-disease v-else-if="attrs.type === 'diagnosis'" v-bind="attrs" :form="form" @change="change"
|
||||
@addRule="addRule"></form-mult-disease>
|
||||
<form-upload v-else-if="attrs.type === 'files'" v-bind="attrs" :form="form" @change="change" />
|
||||
<form-mult-other v-else-if="attrs.type === 'multiSelectAndOther'" v-bind="attrs" :form="form" @change="change" />
|
||||
<!--
|
||||
@ -52,11 +52,14 @@ defineProps({
|
||||
})
|
||||
|
||||
const attrs = useAttrs();
|
||||
const emits = defineEmits(['change']);
|
||||
const emits = defineEmits(['change', 'addRule']);
|
||||
|
||||
function change(data) {
|
||||
emits('change', data)
|
||||
}
|
||||
function addRule(data) {
|
||||
emits('addRule', data)
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- <script>
|
||||
|
||||
@ -42,7 +42,6 @@ const disabledMap = computed(() => props.disableTitles.reduce((m, i) => {
|
||||
return m
|
||||
}, {}))
|
||||
|
||||
provide('addRule', addRule);
|
||||
|
||||
const customRule = ref({});
|
||||
|
||||
|
||||
@ -152,7 +152,11 @@ async function bindArchive(customerId) {
|
||||
const res = await api('bindMiniAppArchive', { id: customerId, corpId: corpId.value, teamId: teamId.value, miniAppId: account.value.openid });
|
||||
if (res && res.success) {
|
||||
await toast('绑定成功');
|
||||
uni.reLaunch({ url: `/pages/home/home?corpId=${corpId.value}&teamId=${teamId.value}` })
|
||||
set('home-invite-teamId', teamId.value);
|
||||
uni.switchTab({
|
||||
url:'/pages/home/home'
|
||||
})
|
||||
// uni.reLaunch({ url: `/pages/home/home?corpId=${corpId.value}&teamId=${teamId.value}` })
|
||||
} else {
|
||||
toast(res?.message || '绑定失败');
|
||||
}
|
||||
@ -195,7 +199,7 @@ async function getBaseForm() {
|
||||
formItems.value = Array.isArray(res.data) ? res.data : [];
|
||||
const mobileIndex = formItems.value.findIndex(item => item.title === 'mobile');
|
||||
if (mobileIndex > -1) {
|
||||
formItems.value[mobileIndex].appendText = `(授权手机号不可修改)`;
|
||||
formItems.value[mobileIndex].appendText = `(授权手机号)`;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@ -137,7 +137,11 @@ function addArchive() {
|
||||
function getTempRows(type, data) {
|
||||
if (config[type] && tempShowField.value && tempShowField.value[type]) {
|
||||
const list = [];
|
||||
config[type].forEach(i => {
|
||||
let titles = config[type];
|
||||
if (data.corp === '其他') {
|
||||
titles = ['corpName', 'diagnosisName', 'files']
|
||||
}
|
||||
titles.forEach(i => {
|
||||
if (tempShowField.value[type][i]) {
|
||||
list.push({ title: i, label: tempShowField.value[type][i], value: data[i], key: `${i}_${data._id}` })
|
||||
}
|
||||
|
||||
@ -22,7 +22,8 @@
|
||||
<script setup>
|
||||
import { computed, ref } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import useGuard from "@/hooks/useGuard";
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
// import useGuard from "@/hooks/useGuard";
|
||||
import useAccount from "@/store/account";
|
||||
import api from "@/utils/api";
|
||||
import { toast } from "@/utils/widget";
|
||||
@ -37,12 +38,13 @@ import teamMate from "./team-mate.vue";
|
||||
import ycHome from "./yc-home.vue";
|
||||
import pageLoading from "./loading.vue";
|
||||
|
||||
const { useLoad, useShow } = useGuard();
|
||||
// const { useLoad, useShow } = useGuard();
|
||||
const { account } = storeToRefs(useAccount());
|
||||
const { login } = useAccount();
|
||||
|
||||
const team = ref(null);
|
||||
const teams = ref([]);
|
||||
const loading = ref(true);
|
||||
const loading = ref(false);
|
||||
const customers = ref([]);
|
||||
|
||||
const corpId = computed(() => team.value?.corpId);
|
||||
@ -83,14 +85,23 @@ async function getTeams() {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
useLoad((opts) => {
|
||||
if (opts.teamId) {
|
||||
team.value = { teamId: opts.teamId, corpId: opts.corpId };
|
||||
}
|
||||
});
|
||||
// useLoad((opts) => {
|
||||
// if (opts.teamId) {
|
||||
// team.value = { teamId: opts.teamId, corpId: opts.corpId };
|
||||
// }
|
||||
// });
|
||||
|
||||
useShow(() => {
|
||||
getTeams();
|
||||
onLoad(() => {
|
||||
if (!account.value) login();
|
||||
})
|
||||
|
||||
onShow(async () => {
|
||||
if (!account.value) await login();
|
||||
if (account.value && account.value.openid) {
|
||||
getTeams();
|
||||
} else {
|
||||
teams.value = [];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<image class="logo" src="/static/logo-plain.png"></image>
|
||||
</view>
|
||||
<view class="w-0 flex-grow">
|
||||
<view class="text-lg font-semibold text-white">柚健康 </view>
|
||||
<view class="text-lg font-semibold text-white">健康柚</view>
|
||||
<view class="leading-normal text-base text-white truncate">全周期健康管理伙伴</view>
|
||||
</view>
|
||||
<view v-if="menuButtonInfo && menuButtonInfo.width > 0" class="flex-shrink-0"
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<view v-else class="doctor-card doctor-card-empty">
|
||||
<view class="doctor-info">
|
||||
<image class="logo" src="/static/logo-plain.png" mode="aspectFill" />
|
||||
<view class="doctor-name">柚健康</view>
|
||||
<view class="doctor-name">健康柚</view>
|
||||
<view class="login-tip">全周期健康管理伙伴</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -5,57 +5,31 @@
|
||||
</text>
|
||||
|
||||
<!-- 图片消息 -->
|
||||
<image
|
||||
v-else-if="message.type === 'TIMImageElem'"
|
||||
class="message-image"
|
||||
:src="
|
||||
message.payload.imageInfoArray[0].LocalURL ||
|
||||
message.payload.imageInfoArray[0].url
|
||||
"
|
||||
mode="aspectFill"
|
||||
:style="getImageStyle(message.payload.imageInfoArray[0])"
|
||||
@click="
|
||||
<image v-else-if="message.type === 'TIMImageElem'" class="message-image" :src="message.payload.imageInfoArray[0].LocalURL ||
|
||||
message.payload.imageInfoArray[0].url
|
||||
" mode="aspectFill" :style="getImageStyle(message.payload.imageInfoArray[0])" @click="
|
||||
$emit(
|
||||
'previewImage',
|
||||
message.payload.imageInfoArray[0].LocalURL ||
|
||||
message.payload.imageInfoArray[0].url
|
||||
message.payload.imageInfoArray[0].url
|
||||
)
|
||||
"
|
||||
/>
|
||||
" />
|
||||
|
||||
<!-- 语音消息 -->
|
||||
<view
|
||||
v-else-if="message.type === 'TIMSoundElem'"
|
||||
class="voice-message"
|
||||
:class="{ 'voice-playing': isPlaying }"
|
||||
:style="getVoiceStyle(message.payload.second)"
|
||||
@click="$emit('playVoice', message)"
|
||||
>
|
||||
<view v-else-if="message.type === 'TIMSoundElem'" class="voice-message" :class="{ 'voice-playing': isPlaying }"
|
||||
:style="getVoiceStyle(message.payload.second)" @click="$emit('playVoice', message)">
|
||||
<view class="voice-content">
|
||||
<view class="voice-icon-wrapper">
|
||||
<uni-icons
|
||||
type="sound"
|
||||
size="20"
|
||||
:color="message.flow === 'out' ? '#fff' : '#333'"
|
||||
:class="{ 'icon-animate': isPlaying }"
|
||||
/>
|
||||
<uni-icons type="sound" size="20" :color="message.flow === 'out' ? '#fff' : '#333'"
|
||||
:class="{ 'icon-animate': isPlaying }" />
|
||||
<!-- 播放中的声波动画 -->
|
||||
<view v-if="isPlaying" class="sound-wave">
|
||||
<view
|
||||
class="wave-bar"
|
||||
:style="{ background: message.flow === 'out' ? '#fff' : '#0877f1' }"
|
||||
style="animation-delay: 0s"
|
||||
></view>
|
||||
<view
|
||||
class="wave-bar"
|
||||
:style="{ background: message.flow === 'out' ? '#fff' : '#0877f1' }"
|
||||
style="animation-delay: 0.2s"
|
||||
></view>
|
||||
<view
|
||||
class="wave-bar"
|
||||
:style="{ background: message.flow === 'out' ? '#fff' : '#0877f1' }"
|
||||
style="animation-delay: 0.4s"
|
||||
></view>
|
||||
<view class="wave-bar" :style="{ background: message.flow === 'out' ? '#fff' : '#0877f1' }"
|
||||
style="animation-delay: 0s"></view>
|
||||
<view class="wave-bar" :style="{ background: message.flow === 'out' ? '#fff' : '#0877f1' }"
|
||||
style="animation-delay: 0.2s"></view>
|
||||
<view class="wave-bar" :style="{ background: message.flow === 'out' ? '#fff' : '#0877f1' }"
|
||||
style="animation-delay: 0.4s"></view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="voice-duration">{{ message.payload.second }}"</text>
|
||||
@ -65,39 +39,24 @@
|
||||
<!-- 自定义消息卡片 -->
|
||||
<template v-else-if="message.type === 'TIMCustomElem'">
|
||||
<!-- 文章消息 -->
|
||||
<view
|
||||
v-if="getCustomMessageType(message) === 'article'"
|
||||
class="article-card"
|
||||
@click="handleArticleClick(message)"
|
||||
>
|
||||
<view v-if="getCustomMessageType(message) === 'article'" class="article-card" @click="handleArticleClick(message)">
|
||||
<view class="article-content">
|
||||
<view class="article-title">{{ getArticleData(message).title }}</view>
|
||||
<view class="article-desc">{{ getArticleData(message).desc }}</view>
|
||||
</view>
|
||||
<image
|
||||
v-if="getArticleData(message).imgUrl"
|
||||
class="article-image"
|
||||
:src="getArticleData(message).imgUrl"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<image v-if="getArticleData(message).imgUrl" class="article-image" :src="getArticleData(message).imgUrl"
|
||||
mode="aspectFill" />
|
||||
</view>
|
||||
|
||||
<!-- 问卷消息 -->
|
||||
<view
|
||||
v-else-if="getCustomMessageType(message) === 'survey'"
|
||||
class="survey-card"
|
||||
@click="handleSurveyClick(message)"
|
||||
>
|
||||
<view v-else-if="getCustomMessageType(message) === 'survey'" class="survey-card"
|
||||
@click="handleSurveyClick(message)">
|
||||
<view class="survey-content">
|
||||
<view class="survey-title">{{ getSurveyData(message).title }}</view>
|
||||
<view class="survey-desc">{{ getSurveyData(message).desc }}</view>
|
||||
</view>
|
||||
<image
|
||||
v-if="getSurveyData(message).imgUrl"
|
||||
class="survey-image"
|
||||
:src="getSurveyData(message).imgUrl"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<image v-if="getSurveyData(message).imgUrl" class="survey-image" :src="getSurveyData(message).imgUrl"
|
||||
mode="aspectFill" />
|
||||
</view>
|
||||
|
||||
<!-- 其他自定义消息 -->
|
||||
@ -122,6 +81,7 @@ import { getParsedCustomMessage } from "@/utils/chat-utils.js";
|
||||
// import MessageCard from "./message-card/message-card.vue";
|
||||
|
||||
const props = defineProps({
|
||||
corpId: String,
|
||||
message: Object,
|
||||
patientInfo: Object,
|
||||
formatTime: Function,
|
||||
@ -237,7 +197,7 @@ const getArticleData = (message) => {
|
||||
const handleArticleClick = (message) => {
|
||||
const { articleId } = getArticleData(message);
|
||||
uni.navigateTo({
|
||||
url: `/pages/article/article-detail?id=${articleId}`,
|
||||
url: `/pages/article/article-detail?id=${articleId}&corpId=${props.corpId}`,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -103,6 +103,7 @@
|
||||
<view class="message-bubble" :class="getBubbleClass(message)">
|
||||
<!-- 消息内容 -->
|
||||
<MessageTypes
|
||||
:corpId="corpId"
|
||||
:message="message"
|
||||
:formatTime="formatTime"
|
||||
:playingVoiceId="playingVoiceId"
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<view class="message-page">
|
||||
|
||||
|
||||
<!-- 消息列表 -->
|
||||
<scroll-view
|
||||
class="message-list"
|
||||
|
||||
@ -29,7 +29,7 @@ export default defineStore("accountStore", () => {
|
||||
code
|
||||
});
|
||||
loading.value = false
|
||||
if (res.success && res.data && res.data.mobile) {
|
||||
if (res.success && res.data) {
|
||||
account.value = res.data;
|
||||
openid.value = res.data.openid;
|
||||
|
||||
|
||||
@ -35,7 +35,8 @@ const urlsConfig = {
|
||||
getArticle: 'getArticle',
|
||||
addArticleSendRecord: 'addArticleSendRecord',
|
||||
addArticleReadRecord: 'addArticleReadRecord',
|
||||
getMiniAppReceivedArticleList: 'getMiniAppReceivedArticleList'
|
||||
getMiniAppReceivedArticleList: 'getMiniAppReceivedArticleList',
|
||||
getPageDisease:'getPageDisease'
|
||||
},
|
||||
member: {
|
||||
addCustomer: 'add',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user