更改小程序 appId

This commit is contained in:
wangdongbo 2026-02-05 09:53:49 +08:00
parent bf9471cfa9
commit 47303b3a36
2 changed files with 210 additions and 130 deletions

View File

@ -1,28 +1,28 @@
{ {
"name": "ykt-team-wxapp", "name" : "ykt-team-wxapp",
"appid": "__UNI__3EBDA15", "appid" : "__UNI__3EBDA15",
"description": "", "description" : "",
"versionName": "1.0.0", "versionName" : "1.0.0",
"versionCode": "100", "versionCode" : "100",
"transformPx": false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus": { "app-plus" : {
"usingComponents": true, "usingComponents" : true,
"nvueStyleCompiler": "uni-app", "nvueStyleCompiler" : "uni-app",
"compilerVersion": 3, "compilerVersion" : 3,
"splashscreen": { "splashscreen" : {
"alwaysShowBeforeRender": true, "alwaysShowBeforeRender" : true,
"waiting": true, "waiting" : true,
"autoclose": true, "autoclose" : true,
"delay": 0 "delay" : 0
}, },
/* */ /* */
"modules": {}, "modules" : {},
/* */ /* */
"distribute": { "distribute" : {
/* android */ /* android */
"android": { "android" : {
"permissions": [ "permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@ -41,32 +41,32 @@
] ]
}, },
/* ios */ /* ios */
"ios": {}, "ios" : {},
/* SDK */ /* SDK */
"sdkConfigs": {} "sdkConfigs" : {}
} }
}, },
/* */ /* */
"quickapp": {}, "quickapp" : {},
/* */ /* */
"mp-weixin": { "mp-weixin" : {
"appid": "wx93af55767423938e", "appid" : "wx93af55767423938e",
"setting": { "setting" : {
"urlCheck": false "urlCheck" : false
}, },
"usingComponents": true "usingComponents" : true
}, },
"mp-alipay": { "mp-alipay" : {
"usingComponents": true "usingComponents" : true
}, },
"mp-baidu": { "mp-baidu" : {
"usingComponents": true "usingComponents" : true
}, },
"mp-toutiao": { "mp-toutiao" : {
"usingComponents": true "usingComponents" : true
}, },
"uniStatistics": { "uniStatistics" : {
"enable": false "enable" : false
}, },
"vueVersion": "3" "vueVersion" : "3"
} }

View File

@ -1,53 +1,89 @@
<template> <template>
<view class="archive-container"> <view class="archive-container">
<view class="mb-10 flex items-center justify-between"> <view class="mb-10 flex items-center justify-between">
<view class="module-title flex-shrink-0 truncate"> <view class="module-title flex-shrink-0 truncate"> 成员档案 </view>
成员档案 <view
</view> class="flex items-center px-10 leading-normal rounded-sm"
<view class="flex items-center px-10 leading-normal rounded-sm" @click="toManagePage()"> @click="toManagePage()"
<image class="manage-icon mr-5" src="/static/home/archive-manage.png" mode="aspectFit"></image> >
<view style="font-size: 28rpx; color: #065BD6;">档案管理</view> <image
class="manage-icon mr-5"
src="/static/home/archive-manage.png"
mode="aspectFit"
></image>
<view style="font-size: 28rpx; color: #065bd6">档案管理</view>
</view> </view>
</view> </view>
<view v-if="customers.length === 0" class="flex items-center justify-center h-80 border-dashed text-dark rounded"> <view
v-if="customers.length === 0"
class="flex items-center justify-center h-80 border-dashed text-dark rounded"
>
<uni-icons type="plusempty" size="16" color="#999"></uni-icons> <uni-icons type="plusempty" size="16" color="#999"></uni-icons>
<view class="text-base text-dark">新建档案</view> <view class="text-base text-dark">新建档案</view>
</view> </view>
<scroll-view scroll-x="true"> <scroll-view scroll-x="true">
<view class="flex flex-nowrap pb-5 "> <view class="flex flex-nowrap pb-5">
<view v-for="i in customers" :key="i._id" class="customer-card flex-shrink-0 mr-15 relative" <view
:class="current && i._id === current._id ? 'current-customer' : ''" @click="toggle(i)"> v-for="i in customers"
:key="i._id"
class="customer-card flex-shrink-0 mr-15 relative"
:class="current && i._id === current._id ? 'current-customer' : ''"
@click="toggle(i)"
>
<!-- 关系标签 --> <!-- 关系标签 -->
<view v-if="i.relationship" class="relationship-tag" <view
:class="i.relationship === '本人' ? 'tag-blue' : 'tag-green'"> v-if="i.relationship"
class="relationship-tag"
:class="i.relationship === '本人' ? 'tag-blue' : 'tag-green'"
>
{{ i.relationship }} {{ i.relationship }}
</view> </view>
<view class="flex flex-col items-center"> <view class="flex flex-col items-center">
<view class="customer-name text-lg leading-normal font-semibold whitespace-nowrap " <view
:class="current && i._id === current._id ? 'text-primary' : 'text-dark'"> class="customer-name text-lg leading-normal font-semibold whitespace-nowrap"
:class="
current && i._id === current._id ? 'text-primary' : 'text-dark'
"
>
{{ i.name }} {{ i.name }}
</view> </view>
<view class="flex items-center mb-5"> <view class="flex items-center mb-5">
<image v-if="i.sex" class="sex-icon mr-5" <image
:src="i.sex === '男' ? '/static/home/male.svg' : '/static/home/female.svg'" /> v-if="i.sex"
class="sex-icon mr-5"
:src="
i.sex === '男'
? '/static/home/male.svg'
: '/static/home/female.svg'
"
/>
<view class="customer-age text-base leading-normal text-gray"> <view class="customer-age text-base leading-normal text-gray">
{{ i.age > 0 ? i.age + '岁' : '' }} {{ i.age > 0 ? i.age + "岁" : "" }}
</view> </view>
</view> </view>
</view> </view>
<!-- 选中状态底部条和三角 --> <!-- 选中状态底部条和三角 -->
<view v-if="current && i._id === current._id" class="active-indicator"> <view
v-if="current && i._id === current._id"
class="active-indicator"
>
<view class="active-bar"></view> <view class="active-bar"></view>
<view class="active-triangle"></view> <view class="active-triangle"></view>
</view> </view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view v-if="canAuth" class="px-10 py-5 mt-5 flex items-center bg-danger rounded-sm"> <view
v-if="canAuth"
class="px-10 py-5 mt-5 flex items-center bg-danger rounded-sm"
>
<view class="mr-5 w-0 flex-grow text-base text-white"> <view class="mr-5 w-0 flex-grow text-base text-white">
点击右侧授权按钮, 我们将更精准的为您服务 点击右侧授权按钮, 我们将更精准的为您服务
</view> </view>
<view class="px-12 py-5 text-base rounded-sm text-dark bg-white" @click="auth()"> <view
class="px-12 py-5 text-base rounded-sm text-dark bg-white"
@click="auth()"
>
授权 授权
</view> </view>
</view> </view>
@ -57,18 +93,32 @@
<view class="info-content"> <view class="info-content">
<view class="flex items-center justify-between mb-8"> <view class="flex items-center justify-between mb-8">
<view class="info-title">个人基本信息</view> <view class="info-title">个人基本信息</view>
<image class="arrow-icon-small" src="/static/home/arrow-right-blue.png" mode="aspectFit"></image> <image
class="arrow-icon-small"
src="/static/home/arrow-right-blue.png"
mode="aspectFit"
></image>
</view> </view>
<view v-if="baseInfoError" class="text-sm text-danger">请完善您的个人信息</view> <view v-if="baseInfoError" class="text-sm text-danger"
>请完善您的个人信息</view
>
<view v-else class="info-subtitle">完善个人信息</view> <view v-else class="info-subtitle">完善个人信息</view>
</view> </view>
</view> </view>
<view v-if="hasHealthTemp" class="ml-10 info-card-new flex-grow" @click="toHealthList()"> <view
v-if="hasHealthTemp"
class="ml-10 info-card-new flex-grow"
@click="toHealthList()"
>
<view class="info-bg info-bg-health"></view> <view class="info-bg info-bg-health"></view>
<view class="info-content"> <view class="info-content">
<view class="flex items-center justify-between mb-8"> <view class="flex items-center justify-between mb-8">
<view class="info-title">健康信息</view> <view class="info-title">健康信息</view>
<image class="arrow-icon-small" src="/static/home/arrow-right-blue.png" mode="aspectFit"></image> <image
class="arrow-icon-small"
src="/static/home/arrow-right-blue.png"
mode="aspectFit"
></image>
</view> </view>
<view class="info-subtitle">上传健康档案</view> <view class="info-subtitle">上传健康档案</view>
</view> </view>
@ -77,28 +127,28 @@
</view> </view>
</template> </template>
<script setup> <script setup>
import { computed, onMounted, ref, watch } from 'vue'; import { computed, onMounted, ref, watch } from "vue";
import { storeToRefs } from 'pinia' import { storeToRefs } from "pinia";
import useAccount from '@/store/account'; import useAccount from "@/store/account";
import api from '@/utils/api'; import api from "@/utils/api";
import { toast, confirm } from '@/utils/widget'; import { toast, confirm } from "@/utils/widget";
const props = defineProps({ const props = defineProps({
corpId: { corpId: {
type: String, type: String,
default: '' default: "",
}, },
customers: { customers: {
type: Array, type: Array,
default: () => [] default: () => [],
}, },
team: { team: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
} },
}) });
const emit = defineEmits(['update:customers']); const emit = defineEmits(["update:customers"]);
const { account } = storeToRefs(useAccount()); const { account } = storeToRefs(useAccount());
const current = ref(null); const current = ref(null);
@ -106,41 +156,61 @@ const customers = ref([]);
const canAuth = computed(() => { const canAuth = computed(() => {
if (current.value && props.team && props.team.teamId) { if (current.value && props.team && props.team.teamId) {
const teamIds = Array.isArray(current.value.teamId) ? current.value.teamId : []; const teamIds = Array.isArray(current.value.teamId)
? current.value.teamId
: [];
return !teamIds.includes(props.team.teamId); return !teamIds.includes(props.team.teamId);
} }
return false return false;
}) });
const qrcode = computed(() => { const qrcode = computed(() => {
const qrcodes = props.team && Array.isArray(props.team.qrcodes) ? props.team.qrcodes : []; const qrcodes =
return qrcodes[0] || '' props.team && Array.isArray(props.team.qrcodes) ? props.team.qrcodes : [];
}) return qrcodes[0] || "";
});
const hasHealthTemp = computed(() => qrcode.value && Array.isArray(qrcode.value.healthTempList) && qrcode.value.healthTempList.length > 0) const hasHealthTemp = computed(
const baseInfo = computed(() => qrcode.value && qrcode.value.teamFileds && Array.isArray(qrcode.value.teamFileds.baseInfo) ? qrcode.value.teamFileds.baseInfo : []) () =>
qrcode.value &&
Array.isArray(qrcode.value.healthTempList) &&
qrcode.value.healthTempList.length > 0
);
const baseInfo = computed(() =>
qrcode.value &&
qrcode.value.teamFileds &&
Array.isArray(qrcode.value.teamFileds.baseInfo)
? qrcode.value.teamFileds.baseInfo
: []
);
const baseInfoError = computed(() => { const baseInfoError = computed(() => {
const requiredTitles = baseInfo.value.filter(i => i.required).map(i => i.title); const requiredTitles = baseInfo.value
return current.value && requiredTitles.some(i => !current.value[i]); .filter((i) => i.required)
}) .map((i) => i.title);
return current.value && requiredTitles.some((i) => !current.value[i]);
});
function fillBaseInfo() { function fillBaseInfo() {
if (canAuth.value) { if (canAuth.value) {
toast('请先授权本服务团队') toast("请先授权本服务团队");
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/archive/edit-archive?teamId=${props.team.teamId}&corpId=${props.corpId}&id=${current.value._id}` url: `/pages/archive/edit-archive?teamId=${props.team.teamId}&corpId=${props.corpId}&id=${current.value._id}`,
}) });
} }
} }
function toHealthList() { function toHealthList() {
if (canAuth.value) { if (canAuth.value) {
toast('请先授权本服务团队') toast("请先授权本服务团队");
} else { } else {
const name = `${current.value.name} ${current.value.relationship ? `(${current.value.relationship})` : ''}` const name = `${current.value.name} ${
current.value.relationship ? `(${current.value.relationship})` : ""
}`;
uni.navigateTo({ uni.navigateTo({
url: `/pages/health/list?teamId=${props.team.teamId}&corpId=${props.corpId}&id=${current.value._id}&name=${encodeURIComponent(name)}` url: `/pages/health/list?teamId=${props.team.teamId}&corpId=${
}) props.corpId
}&id=${current.value._id}&name=${encodeURIComponent(name)}`,
});
} }
} }
@ -149,54 +219,67 @@ function toggle(i) {
} }
function toManagePage() { function toManagePage() {
uni.navigateTo({ url: `/pages/archive/archive-manage?corpId=${props.corpId}&teamId=${props.team.teamId}` }) uni.navigateTo({
url: `/pages/archive/archive-manage?corpId=${props.corpId}&teamId=${props.team.teamId}`,
});
} }
async function auth() { async function auth() {
await confirm(`是否授权${props.team.name}提供服务`); await confirm(`是否授权${props.team.name}提供服务`);
const res = await api('authCustomerToTeam', { corpId: props.corpId, teamId: props.team.teamId, id: current.value._id }); const res = await api("authCustomerToTeam", {
corpId: props.corpId,
teamId: props.team.teamId,
id: current.value._id,
});
if (res && res.success) { if (res && res.success) {
await toast('授权成功'); await toast("授权成功");
getCustomers() getCustomers();
} else { } else {
toast(res?.message || '授权失败'); toast(res?.message || "授权失败");
} }
} }
async function getCustomers() { async function getCustomers() {
const res = await api('getMiniAppCustomers', { miniAppId: account.value.openid, corpId: props.corpId }); const res = await api("getMiniAppCustomers", {
miniAppId: account.value.openid,
corpId: props.corpId,
});
if (res && res.success) { if (res && res.success) {
customers.value = res && Array.isArray(res.data) ? res.data : []; customers.value = res && Array.isArray(res.data) ? res.data : [];
const customer = customers.value.find(i => current.value && i._id === current.value._id); const customer = customers.value.find(
(i) => current.value && i._id === current.value._id
);
current.value = customer || customers.value[0] || null; current.value = customer || customers.value[0] || null;
// customers // customers
emit('update:customers', customers.value); emit("update:customers", customers.value);
} else { } else {
toast(res.message || '获取档案失败'); toast(res.message || "获取档案失败");
} }
} }
onMounted(() => { onMounted(() => {
uni.$on('reloadTeamCustomers', getCustomers) uni.$on("reloadTeamCustomers", getCustomers);
}) });
watch(() => props.corpId, n => {
if (n) {
getCustomers()
} else {
customers.value = [];
}
}, { immediate: true });
watch(
() => props.corpId,
(n) => {
if (n) {
getCustomers();
} else {
customers.value = [];
}
},
{ immediate: true }
);
</script> </script>
<style scoped> <style scoped>
.archive-container { .archive-container {
padding: 24rpx 30rpx; padding: 24rpx 30rpx;
margin: 0 30rpx; margin: 0 30rpx;
background: linear-gradient(181deg, #C2DCFF 1.01%, #FFFFFF 43.31%); background: linear-gradient(181deg, #c2dcff 1.01%, #ffffff 43.31%);
border-radius: 16rpx; border-radius: 16rpx;
box-shadow: box-shadow: inset 0 2rpx 0 0 rgba(255, 255, 255, 0.82),
inset 0 2rpx 0 0 rgba(255, 255, 255, 0.82),
0 8rpx 10rpx 0 rgba(60, 169, 145, 0.06); 0 8rpx 10rpx 0 rgba(60, 169, 145, 0.06);
} }
@ -218,19 +301,18 @@ watch(() => props.corpId, n => {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: linear-gradient(180deg, #FFFFFF 0%, #E6EFFB 100%); background: linear-gradient(180deg, #ffffff 0%, #e6effb 100%);
border-radius: 12rpx; border-radius: 12rpx;
border: 2rpx solid #AECAF2; border: 2rpx solid #aecaf2;
transition: all 0.2s; transition: all 0.2s;
position: relative; position: relative;
} }
.current-customer { .current-customer {
background: #FFFFFF; background: #ffffff;
border: 2rpx solid #065BD6; border: 2rpx solid #065bd6;
} }
.relationship-tag { .relationship-tag {
position: absolute; position: absolute;
top: -2rpx; top: -2rpx;
@ -245,7 +327,7 @@ watch(() => props.corpId, n => {
} }
.relationship-tag::after { .relationship-tag::after {
content: ''; content: "";
position: absolute; position: absolute;
right: 0; right: 0;
bottom: -8rpx; bottom: -8rpx;
@ -255,19 +337,19 @@ watch(() => props.corpId, n => {
} }
.tag-blue { .tag-blue {
background: #065BD6; background: #065bd6;
} }
.tag-blue::after { .tag-blue::after {
border-top: 8rpx solid #003F96; border-top: 8rpx solid #003f96;
} }
.tag-green { .tag-green {
background: #1DBF98; background: #1dbf98;
} }
.tag-green::after { .tag-green::after {
border-top: 8rpx solid #0F8C6D; border-top: 8rpx solid #0f8c6d;
} }
.active-indicator { .active-indicator {
@ -295,7 +377,7 @@ watch(() => props.corpId, n => {
transform: translateX(-50%) rotate(45deg); transform: translateX(-50%) rotate(45deg);
width: 12rpx; width: 12rpx;
height: 12rpx; height: 12rpx;
background: #065BD6; background: #065bd6;
margin-top: -8rpx; margin-top: -8rpx;
} }
@ -315,12 +397,11 @@ watch(() => props.corpId, n => {
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
.info-card-new { .info-card-new {
position: relative; position: relative;
padding: 24rpx; padding: 24rpx;
border-radius: 16rpx; border-radius: 16rpx;
background: linear-gradient(115deg, #F4F9FF 14.74%, #DBEAFF 66.11%); background: linear-gradient(115deg, #f4f9ff 14.74%, #dbeaff 66.11%);
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06); box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
overflow: hidden; overflow: hidden;
width: 310rpx; width: 310rpx;
@ -347,22 +428,21 @@ watch(() => props.corpId, n => {
} }
.info-bg-base { .info-bg-base {
background-image: url('/static/home/basic-info-bg.svg'); background-image: url("/static/home/basic-info-bg.svg");
} }
.info-bg-health { .info-bg-health {
background-image: url('/static/home/health-info-bg.svg'); background-image: url("/static/home/health-info-bg.svg");
} }
.info-title { .info-title {
color: #213E80; color: #213e80;
font-size: 32rpx; font-size: 32rpx;
font-weight: 500; font-weight: 500;
} }
.info-subtitle { .info-subtitle {
color: #78808F; color: #78808f;
font-size: 24rpx; font-size: 24rpx;
} }