From f8ff13639d7166730c05b656c4c8f6a5903d34f0 Mon Sep 17 00:00:00 2001 From: huxuejian Date: Fri, 10 Apr 2026 16:16:25 +0800 Subject: [PATCH 01/24] =?UTF-8?q?feat:=202.3=E7=89=88=E6=9C=AC=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 健康档案新增体检报告 2. 文件是上传支持pdf --- App.vue | 8 ++ .../form-cell/form-positive-find.vue | 89 +++++++++++++++++++ .../form-template/form-cell/form-upload.vue | 63 +++++++++++-- components/form-template/form-cell/index.vue | 4 +- components/form-template/index.vue | 2 +- pages/health/list.vue | 10 ++- static/pdf.svg | 1 + 7 files changed, 164 insertions(+), 13 deletions(-) create mode 100644 components/form-template/form-cell/form-positive-find.vue create mode 100644 static/pdf.svg diff --git a/App.vue b/App.vue index 326d821..2c8ce4a 100644 --- a/App.vue +++ b/App.vue @@ -196,6 +196,10 @@ page { padding-top: 10rpx; } +.pt-12 { + padding-top: 24rpx; +} + .pt-15 { padding-top: 30rpx; } @@ -251,6 +255,10 @@ page { margin-bottom: 20rpx; } +.mt-5 { + margin-top: 10rpx; +} + .mt-10 { margin-top: 20rpx; } diff --git a/components/form-template/form-cell/form-positive-find.vue b/components/form-template/form-cell/form-positive-find.vue new file mode 100644 index 0000000..3ff8c3a --- /dev/null +++ b/components/form-template/form-cell/form-positive-find.vue @@ -0,0 +1,89 @@ + + + + \ No newline at end of file diff --git a/components/form-template/form-cell/form-upload.vue b/components/form-template/form-cell/form-upload.vue index 2fdcb00..1296be0 100644 --- a/components/form-template/form-cell/form-upload.vue +++ b/components/form-template/form-cell/form-upload.vue @@ -6,11 +6,12 @@ + - + @@ -48,26 +49,72 @@ const files = computed(() => value.value.map(i => { url: i.url, name: i.name, type: i.type, - isImage: /image/i.test(i.type) + isImage: /image/i.test(i.type), + isPdf: /application\/pdf/i.test(i.type), } })) -function addImage() { - uni.chooseImage({ - count: 1, +function addFile() { + wx.chooseMessageFile({ + count: 1, // 最多选择1个文件 + type: 'all', // 所有类型文件 success: async (res) => { + const file = res.tempFiles[0]; + const { path, name, size } = file; + const type = checkFileValid(name, size); + // 检查文件类型和大小 + if (!type) return; loading(); - const result = await upload(res.tempFilePaths[0]); + const result = await upload(path); hideLoading(); if (result) { - change([...value.value, { url: result, type: 'image/png' }]) + change([...value.value, { url: result, type }]) } else { toast('上传失败') } + }, + fail: (err) => { + toast('上传失败') } }) } +function checkFileValid(fileName, fileSize) { + // 获取文件扩展名 + const ext = fileName.split('.').pop().toLowerCase(); + // 文件大小限制 (10MB) + const maxSize = 10 * 1024 * 1024; + if (fileSize > maxSize) { + toast('文件大小不能超过10MB') + return false; + } + + if (['jpg', 'jpeg', 'png'].includes(ext)) { + return 'image/png' + } + if (ext === 'pdf') { + return 'application/pdf' + } + toast('仅支持图片或PDF') + return false; +} + +// function addImage() { +// uni.chooseImage({ +// count: 1, +// success: async (res) => { +// loading(); +// const result = await upload(res.tempFilePaths[0]); +// hideLoading(); +// if (result) { +// change([...value.value, { url: result, type: 'image/png' }]) +// } else { +// toast('上传失败') +// } +// } +// }) +// } + function change(value) { emits('change', { title: props.title, diff --git a/components/form-template/form-cell/index.vue b/components/form-template/form-cell/index.vue index e00418d..d4b9b87 100644 --- a/components/form-template/form-cell/index.vue +++ b/components/form-template/form-cell/index.vue @@ -1,5 +1,5 @@ diff --git a/pages/login/agreement-popup.vue b/pages/login/agreement-popup.vue new file mode 100644 index 0000000..c5f4ce4 --- /dev/null +++ b/pages/login/agreement-popup.vue @@ -0,0 +1,80 @@ + + + + + \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue index 3e39656..7d7c584 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -30,7 +30,7 @@ @getphonenumber="getPhoneNumber"> 手机号快捷登录 - @@ -43,6 +43,7 @@ 《隐私政策》 + @@ -56,6 +57,7 @@ import { get, set } from "@/utils/cache"; import { toast } from "@/utils/widget"; import groupAvatar from "@/components/group-avatar.vue"; +import agreementPopup from "./agreement-popup.vue"; const env = __VITE_ENV__; const appid = env.MP_WX_APP_ID; @@ -64,6 +66,7 @@ const checked = ref(false); const redirectUrl = ref(""); const { account } = storeToRefs(useAccountStore()); const { login } = useAccountStore(); +const visible = ref(false) function attempRedirect(url) { return new Promise((resolve, reject) => { @@ -85,8 +88,9 @@ function attempSwitchTab(url) { }); } -function remind() { - toast("请先阅读并同意用户协议和隐私政策"); +function onAgree() { + visible.value = false; + checked.value = true; } function toAggreement(type) { @@ -102,7 +106,6 @@ function toHome() { } - async function bindTeam() { const res = await api('bindWxappWithTeam', { appid, corpId: team.value.corpId, teamId: team.value.teamId, openid: account.value.openid }); if (!res || !res.success) { From 2bd1cd2349914b725392f09d3edb34057df61155 Mon Sep 17 00:00:00 2001 From: huxuejian Date: Fri, 15 May 2026 17:51:38 +0800 Subject: [PATCH 16/24] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/archive/edit-archive.vue | 2 +- pages/article/article-detail.vue | 64 +++++++++++++++++++++++++++++++- pages/article/article-list.vue | 34 ++++++++--------- utils/api.js | 1 + 4 files changed, 82 insertions(+), 19 deletions(-) diff --git a/pages/archive/edit-archive.vue b/pages/archive/edit-archive.vue index 8ef48e5..1f1ae23 100644 --- a/pages/archive/edit-archive.vue +++ b/pages/archive/edit-archive.vue @@ -237,7 +237,7 @@ async function getBaseForm() { } async function getCustomer() { - const res = await api('getRefrencePeople', { customerId: customerId.value }); + const res = await api('getCustomerByCustomerId', { customerId: customerId.value }); if (res && res.success && res.data) { customer.value = res.data; setDisabledTitles(res.data) diff --git a/pages/article/article-detail.vue b/pages/article/article-detail.vue index a6f58fe..8658e62 100644 --- a/pages/article/article-detail.vue +++ b/pages/article/article-detail.vue @@ -30,10 +30,13 @@ import { onLoad } from "@dcloudio/uni-app"; import FullPage from "@/components/full-page.vue"; import api from "@/utils/api.js"; +import { set } from "@/utils/cache"; +import { toast } from "@/utils/widget.js"; import { ref } from "vue"; import { storeToRefs } from "pinia"; import useAccountStore from "@/store/account.js"; const { account } = storeToRefs(useAccountStore()); +const { login } = useAccountStore() const loading = ref(true); const error = ref(""); const articleData = ref({ @@ -102,6 +105,7 @@ const loadArticle = async () => { if (res.success && res.data) { // 格式化日期 let date = ""; + if (res.data.createTime) { const d = new Date(res.data.createTime); const year = d.getFullYear(); @@ -115,6 +119,34 @@ const loadArticle = async () => { content: processRichTextContent(res.data.content || ""), date: date, }; + if (isWechatChannels(res.data)) { + uni.openChannelsActivity({ + finderUserName: res.data.wechatChannels.finderUserName, + feedId: res.data.wechatChannels.feedId, + fail: err => { + const errMsg = err.errMsg || ''; + if (/cancel/i.test(errMsg)) { + return + } + toast(`打开视频号失败:${errMsg}`) + } + }) + return + } + // if (res.data.link) { + // uni.openOfficialAccountArticle({ + // url: res.data.link, + // fail: err => { + // const errMsg = err.errMsg || ''; + // console.error(errMsg) + // console.log(errMsg) + // if (/cancel/i.test(errMsg)) { + // return + // } + // toast(`打开文章失败:${errMsg}`) + // } + // }) + // } } else { error.value = res.message || "加载文章失败"; } @@ -126,11 +158,41 @@ const loadArticle = async () => { } }; +function isWechatChannels(item) { + return item?.wechatChannels?.finderUserName && item?.wechatChannels?.feedId; +} + +async function handleSend(sendId) { + try { + await login(); + markArticleRead(sendId); + authToTeam(sendId) + } catch (e) { + console.log(e) + } +} + +// 通过发送记录 将微信用户关联到团队 +async function authToTeam(sendId) { + const res = await api("relateWechatAccountWithTeam", { + sendId, + openid: account.value?.openid, + unionid: account.value?.unionid, + appid: account.value?.appId, + }) + if (res.success) { + set('home-invite-team-info', { teamId: res.data }) + } +} + + onLoad((options) => { corpId.value = options.corpId; if (options.id) { articleId = options.id; - markArticleRead(options.sendId || ''); + if (options.sendId) { + handleSend(options.sendId) + } loadArticle(); } else { error.value = "文章信息不完整"; diff --git a/pages/article/article-list.vue b/pages/article/article-list.vue index bddd0bd..5d33bcb 100644 --- a/pages/article/article-list.vue +++ b/pages/article/article-list.vue @@ -198,23 +198,23 @@ const loadArticleList = async (reset = false) => { function goToDetail(item) { if (!item?.articleId) return; - if (isWechatChannels(item.articleInfo)) { - uni.openChannelsActivity({ - finderUserName: item.articleInfo.wechatChannels.finderUserName, - feedId: item.articleInfo.wechatChannels.feedId, - success: () => { - markArticleRead(item._id, item.articleId); - }, - fail: err => { - const errMsg = err.errMsg || ''; - if (/cancel/i.test(errMsg)) { - return - } - toast(`打开视频号失败:${errMsg}`) - } - }) - return - } + // if (isWechatChannels(item.articleInfo)) { + // uni.openChannelsActivity({ + // finderUserName: item.articleInfo.wechatChannels.finderUserName, + // feedId: item.articleInfo.wechatChannels.feedId, + // success: () => { + // markArticleRead(item._id, item.articleId); + // }, + // fail: err => { + // const errMsg = err.errMsg || ''; + // if (/cancel/i.test(errMsg)) { + // return + // } + // toast(`打开视频号失败:${errMsg}`) + // } + // }) + // return + // } uni.navigateTo({ url: `/pages/article/article-detail?sendId=${item._id}&id=${item.articleId}&corpId=${corpId.value}` }); } diff --git a/utils/api.js b/utils/api.js index 62475ab..aeec03d 100644 --- a/utils/api.js +++ b/utils/api.js @@ -42,6 +42,7 @@ const urlsConfig = { searchRateList: 'searchRateList', submitRateRecord: 'submitRateRecord', getRateRecord: 'getRateRecord', + relateWechatAccountWithTeam: 'relateWechatAccountWithTeam' }, member: { addCustomer: 'add', From b27bb9b33b168d812705ab326d7de99e07fe6b25 Mon Sep 17 00:00:00 2001 From: huxuejian Date: Sat, 16 May 2026 11:20:21 +0800 Subject: [PATCH 17/24] =?UTF-8?q?fix:=20=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/login/login.vue | 4 ++-- pages/login/redirect-page.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/login/login.vue b/pages/login/login.vue index 7d7c584..3d5cb48 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -23,7 +23,7 @@ + + + @@ -103,6 +115,10 @@ const props = defineProps({ type: Object, default: () => ({}), }, + customers: { + type: Array, + default: () => [], + }, teams: { type: Array, default: () => [], @@ -112,11 +128,13 @@ const props = defineProps({ const currentTeam = computed(() => props.teams.find((i) => props.team && i.teamId === props.team.teamId) ); + const qrcode = computed(() => { const qrcodes = props.team && Array.isArray(props.team.qrcodes) ? props.team.qrcodes : []; return qrcodes[0] || '' }) const teamStyle = computed(() => `max-width:${props.teams.length ? 'calc(100% - 60rpx)' : '100%'}`) +const firstCustomer = computed(() => props.customers && props.customers[0] ? props.customers[0] : {}) function select(team) { emits("changeTeam", team); @@ -126,7 +144,7 @@ function select(team) { function toTeamDetail() { if (props.team && props.team.teamId) { uni.navigateTo({ - url: `/pages/team/team-detail?teamId=${props.team.teamId}&corpId=${props.team.corpId}&corpName=${encodeURIComponent(props.team.corpName || '')}` + url: `/pages/team/team-detail?firstCustomerId=${firstCustomer.value._id || ''}&teamId=${props.team.teamId}&corpId=${props.team.corpId}&corpName=${encodeURIComponent(props.team.corpName || '')}` }); } } @@ -311,4 +329,13 @@ onMounted(() => { .rounded-circle { border-radius: 50%; } + +.icon-share { + width: 24rpx; + height: 24rpx; +} + +.opacity-0 { + opacity: 0; +} \ No newline at end of file diff --git a/pages/login/redirect-page.vue b/pages/login/redirect-page.vue index a35548c..1c409a5 100644 --- a/pages/login/redirect-page.vue +++ b/pages/login/redirect-page.vue @@ -38,7 +38,10 @@ async function changeTeam({ teamId, corpId, corpUserId, qrid, referenceCustomerI team.value.corpName = res.data.corpName; set('home-invite-team-info', { teamId: team.value.teamId, - corpUserId: corpUserId || '' + corpUserId: corpUserId || '', + corpUserId, + qrid, + referenceCustomerId: referenceCustomerId || '' }); await login() if (account.value && account.value.mobile) { diff --git a/pages/team/team-detail.vue b/pages/team/team-detail.vue index 24ec31c..f6a6ace 100644 --- a/pages/team/team-detail.vue +++ b/pages/team/team-detail.vue @@ -7,7 +7,15 @@ - {{ team.name }} + + {{ team.name }} + + + 推荐 + + + {{ corpName }} @@ -54,7 +62,7 @@