From 87e9cde197efd5b9420e42186f7d4517dc39cfec Mon Sep 17 00:00:00 2001 From: huxuejian Date: Wed, 4 Feb 2026 09:16:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/group-avatar.vue | 2 +- pages.json | 334 ++++++++++++++++--------------- pages/archive/archive-result.vue | 142 +++++++++++++ pages/archive/edit-archive.vue | 54 +++-- pages/login/login.vue | 23 ++- pages/login/redirect-page.vue | 6 +- pages/team/friend.vue | 8 +- pages/team/homepage.vue | 4 +- pages/team/team-detail.vue | 6 +- routes/index.js | 4 + store/account.js | 42 ++-- utils/api.js | 3 + 12 files changed, 420 insertions(+), 208 deletions(-) create mode 100644 pages/archive/archive-result.vue diff --git a/components/group-avatar.vue b/components/group-avatar.vue index 6a5ede1..357f924 100644 --- a/components/group-avatar.vue +++ b/components/group-avatar.vue @@ -52,7 +52,7 @@ const groups = computed(() => { style: `width: ${size.value.md}rpx; height: ${size.value.md}rpx;` } } - return { list: [list.value.slice(0, 1)], style: `width: ${size.value.lg}rpx; height: ${size.lg}rpx;` } + return { list: [list.value.slice(0, 1)], style: `width: ${size.value.lg}rpx; height: ${size.value.lg}rpx;` } }) function reGenerate() { diff --git a/pages.json b/pages.json index 4eb0e21..2c91e8a 100644 --- a/pages.json +++ b/pages.json @@ -1,165 +1,171 @@ { - "pages": [ - { - "path": "pages/home/home", - "style": { - "navigationBarTitleText": "首页", - "navigationStyle": "custom" - } - }, - { - "path": "pages/article/article-list", - "style": { - "navigationBarTitleText": "我的宣教" - } - }, - { - "path": "pages/survey/survey-list", - "style": { - "navigationBarTitleText": "我的问卷" - } - }, - { - "path": "pages/message/message", - "style": { - "navigationBarTitleText": "消息" - } - }, - { - "path": "pages/message/index", - "style": { - "navigationBarTitleText": "聊天", - "enablePullDownRefresh": false - } - }, - { - "path": "pages/login/login", - "style": { - "navigationBarTitleText": "柚健康" - } - }, - { - "path": "pages/login/redirect-page", - "style": { - "navigationBarTitleText": "柚健康" - } - }, - { - "path": "pages/archive/archive-manage", - "style": { - "navigationBarTitleText": "档案管理" - } - }, - { - "path": "pages/archive/edit-archive", - "style": { - "navigationBarTitleText": "新增档案" - } - }, - { - "path": "pages/health/list", - "style": { - "navigationBarTitleText": "健康信息" - } - }, - { - "path": "pages/health/record", - "style": { - "navigationBarTitleText": "健康信息" - } - }, - { - "path": "pages/library/diagnosis-list", - "style": { - "navigationBarTitleText": "选择诊断" - } - }, - { - "path": "pages/team/team-detail", - "style": { - "navigationBarTitleText": "团队介绍" - } - }, - { - "path": "pages/team/homepage", - "style": { - "navigationBarTitleText": "个人主页" - } - }, - { - "path": "pages/team/friend", - "style": { - "navigationBarTitleText": "添加好友" - } - }, - { - "path": "pages/web-view/web-view", - "style": { - "navigationBarTitleText": "" - } - }, - { - "path": "pages/mine/mine", - "style": { - "navigationBarTitleText": "我的" - } - }, - { - "path": "pages/mine/contact", - "style": { - "navigationBarTitleText": "联系客服" - } - }, - { - "path": "pages/common/privacy", - "style": { - "navigationBarTitleText": "隐私政策" - } - }, - { - "path": "pages/common/agreement", - "style": { - "navigationBarTitleText": "用户协议" - } - }, - { - "path": "pages/article/article-detail", - "style": { - "navigationBarTitleText": "宣教文章" - } - } - ], - "globalStyle": { - "navigationBarTextStyle": "white", - "navigationBarTitleText": "uni-app", - "navigationBarBackgroundColor": "#065bd6", - "backgroundColor": "#065bd6" - }, - "tabBar": { - "color": "#666666", - "selectedColor": "#007aff", - "backgroundColor": "#ffffff", - "borderStyle": "white", - "list": [ - { - "pagePath": "pages/home/home", - "iconPath": "static/tabbar/home.png", - "selectedIconPath": "static/tabbar/home_selected.png", - "text": "消息" - }, - { - "pagePath": "pages/message/message", - "iconPath": "static/tabbar/consult.png", - "selectedIconPath": "static/tabbar/consult_selected.png", - "text": "咨询" - }, - { - "pagePath": "pages/mine/mine", - "iconPath": "static/tabbar/mine.png", - "selectedIconPath": "static/tabbar/mine_selected.png", - "text": "我的" - } - ] - }, - "uniIdRouter": {} -} \ No newline at end of file + "pages": [ + { + "path": "pages/home/home", + "style": { + "navigationBarTitleText": "首页", + "navigationStyle": "custom" + } + }, + { + "path": "pages/article/article-list", + "style": { + "navigationBarTitleText": "我的宣教" + } + }, + { + "path": "pages/survey/survey-list", + "style": { + "navigationBarTitleText": "我的问卷" + } + }, + { + "path": "pages/message/message", + "style": { + "navigationBarTitleText": "消息" + } + }, + { + "path": "pages/message/index", + "style": { + "navigationBarTitleText": "聊天", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "柚健康" + } + }, + { + "path": "pages/login/redirect-page", + "style": { + "navigationBarTitleText": "柚健康" + } + }, + { + "path": "pages/archive/archive-manage", + "style": { + "navigationBarTitleText": "档案管理" + } + }, + { + "path": "pages/archive/edit-archive", + "style": { + "navigationBarTitleText": "新增档案" + } + }, + { + "path": "pages/archive/archive-result", + "style": { + "navigationBarTitleText": "团队服务" + } + }, + { + "path": "pages/health/list", + "style": { + "navigationBarTitleText": "健康信息" + } + }, + { + "path": "pages/health/record", + "style": { + "navigationBarTitleText": "健康信息" + } + }, + { + "path": "pages/library/diagnosis-list", + "style": { + "navigationBarTitleText": "选择诊断" + } + }, + { + "path": "pages/team/team-detail", + "style": { + "navigationBarTitleText": "团队介绍" + } + }, + { + "path": "pages/team/homepage", + "style": { + "navigationBarTitleText": "个人主页" + } + }, + { + "path": "pages/team/friend", + "style": { + "navigationBarTitleText": "添加好友" + } + }, + { + "path": "pages/web-view/web-view", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/mine/mine", + "style": { + "navigationBarTitleText": "我的" + } + }, + { + "path": "pages/mine/contact", + "style": { + "navigationBarTitleText": "联系客服" + } + }, + { + "path": "pages/common/privacy", + "style": { + "navigationBarTitleText": "隐私政策" + } + }, + { + "path": "pages/common/agreement", + "style": { + "navigationBarTitleText": "用户协议" + } + }, + { + "path": "pages/article/article-detail", + "style": { + "navigationBarTitleText": "宣教文章" + } + } + ], + "globalStyle": { + "navigationBarTextStyle": "white", + "navigationBarTitleText": "uni-app", + "navigationBarBackgroundColor": "#065bd6", + "backgroundColor": "#065bd6" + }, + "tabBar": { + "color": "#666666", + "selectedColor": "#007aff", + "backgroundColor": "#ffffff", + "borderStyle": "white", + "list": [ + { + "pagePath": "pages/home/home", + "iconPath": "static/tabbar/home.png", + "selectedIconPath": "static/tabbar/home_selected.png", + "text": "消息" + }, + { + "pagePath": "pages/message/message", + "iconPath": "static/tabbar/consult.png", + "selectedIconPath": "static/tabbar/consult_selected.png", + "text": "咨询" + }, + { + "pagePath": "pages/mine/mine", + "iconPath": "static/tabbar/mine.png", + "selectedIconPath": "static/tabbar/mine_selected.png", + "text": "我的" + } + ] + }, + "uniIdRouter": {} +} diff --git a/pages/archive/archive-result.vue b/pages/archive/archive-result.vue new file mode 100644 index 0000000..a6af733 --- /dev/null +++ b/pages/archive/archive-result.vue @@ -0,0 +1,142 @@ + + + diff --git a/pages/archive/edit-archive.vue b/pages/archive/edit-archive.vue index 7d1bbf5..159734c 100644 --- a/pages/archive/edit-archive.vue +++ b/pages/archive/edit-archive.vue @@ -11,7 +11,7 @@ ({ ...customer.value, ...form.value })); -function back() { - const pages = getCurrentPages(); - if (pages.length > 1) { - uni.navigateBack(); - } else { - uni.redirectTo({ url: `/pages/home/home?corpId=${corpId.value}&teamId=${teamId.value}` }) - } -} - function change({ title, value }) { if (title) { form.value[title] = value; @@ -80,7 +72,7 @@ function change({ title, value }) { } function confirm() { - if (!tempRef.value.verify() || Object.keys(form.value).length === 0) return; + if (!tempRef.value.verify()) return; if (customerId.value) { updateArchive(); } else { @@ -97,12 +89,15 @@ async function addArchive() { teamId: teamId.value, corpId: corpId.value, mobile: account.value.mobile, - miniAppId: account.value.openid + miniAppId: account.value.openid, + externalUserId: externalUserId.value, } loading.value = false; const res = await api('addCustomer', { params }); if (res && res.success) { - back() + uni.redirectTo({ + url: `/pages/archive/archive-result?corpId=${corpId.value}&teamId=${teamId.value}` + }) } else { toast(res?.message || '新增档案失败'); } @@ -122,12 +117,15 @@ async function bindArchive(customerId) { async function init() { if (customerId.value) { - await getCustomer() + await getCustomer(); } else { const res = await getArchives(); if (res.length > 0) { visible.value = true; } + if (!externalUserId.value) { + getExternalUserId(); + } } await getBaseForm(); } @@ -166,6 +164,32 @@ async function getCustomer() { } } +async function updateArchive() { + if (Object.keys(form.value).length > 0) { + const res = await api('updateCustomer', { id: customerId.value, ...form.value }); + if (res && res.success) { + await toast('修改成功'); + uni.navigateBack(); + } else { + toast(res?.message || '修改失败'); + } + } else { + uni.navigateBack(); + } +} + +// async updateCustomer() { +// if (Object.keys(this.form).length === 0) return this.editMemberId; +// const { success, message } = await updateCustomer( +// this.editMemberId, +// this.form +// ); +// if (success) return this.editMemberId; +// this.widget.hideLoading(); +// this.widget.toast(message); +// return Promise.reject(); +// }, + onLoad(options => { customerId.value = options.id || ''; uni.setNavigationBarTitle({ title: customerId.value ? '编辑档案' : '新增档案' }) diff --git a/pages/login/login.vue b/pages/login/login.vue index b99e2ad..00897cf 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -17,8 +17,8 @@ 手机号快捷登录 + 手机号快捷登录 + --> @@ -35,6 +35,7 @@ import { ref } from "vue"; import { onLoad } from "@dcloudio/uni-app"; import useAccountStore from "@/store/account"; +import api from '@/utils/api'; import { get } from "@/utils/cache"; import { toast } from "@/utils/widget"; @@ -71,16 +72,27 @@ function remind() { } function toHome() { - uni.navigateTo({ + uni.switchTab({ url: "/pages/home/home", }); } +async function checkTeamArchive(account) { + const res = await api('getWxAppCustomerCount', { miniAppId: account.openid, corpId: account.corpId, teamId: '1nYlVrNXGT173674701967643308' || team.value.teamId }); + if (res && res.data > 0) { + toHome(); + } else { + attempToPage(redirectUrl.value) + } +} + 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) { + if (res && team.value) { + checkTeamArchive(res) + } else if (res && redirectUrl.value) { await attempToPage(redirectUrl.value); } else if (res) { toHome(); @@ -99,7 +111,6 @@ onLoad((opts) => { if (opts.source === "teamInvite") { team.value = get("invite-team-info"); redirectUrl.value = `/pages/archive/edit-archive?teamId=${team.value.teamId}&corpId=${team.value.corpId}`; - console.log("redirectUrl", redirectUrl.value); return; } redirectUrl.value = opts.redirectUrl || ""; diff --git a/pages/login/redirect-page.vue b/pages/login/redirect-page.vue index 98d2a73..8e74c0d 100644 --- a/pages/login/redirect-page.vue +++ b/pages/login/redirect-page.vue @@ -15,13 +15,13 @@ const corpId = ref(""); const loading = ref(false); const team = ref(null); -async function changeTeam({ teamId, corpId, corpName }) { +async function changeTeam({ teamId, corpId }) { loading.value = true; const res = await api("getTeamData", { teamId, corpId, withCorpName: true }); loading.value = false; if (res && res.data) { team.value = res.data; - team.value.corpName = corpName; + team.value.corpName = res.data.corpName; set("invite-team-info", { corpId: team.value.corpId, teamId: team.value.teamId, @@ -45,9 +45,7 @@ onLoad((options) => { typeof options.q === "string" ? decodeURIComponent(options.q) : ""; const [, url = ""] = href.split("?"); const data = url.split("&").reduce((acc, cur) => { - console.log(cur); const [key, value] = cur.split("="); - console.log(key, "=====", value); acc[key] = value; return acc; }, {}); diff --git a/pages/team/friend.vue b/pages/team/friend.vue index 56ba737..085a936 100644 --- a/pages/team/friend.vue +++ b/pages/team/friend.vue @@ -14,13 +14,18 @@ + + 点击识别下方二维码,加我为好友 +