feat: 页面提交
This commit is contained in:
parent
5f1f83f6c7
commit
f4f29469b3
@ -4,3 +4,4 @@ MP_CACHE_PREFIX=development
|
|||||||
MP_WX_APP_ID=wx93af55767423938e
|
MP_WX_APP_ID=wx93af55767423938e
|
||||||
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
||||||
MP_TIM_SDK_APP_ID=1600123876
|
MP_TIM_SDK_APP_ID=1600123876
|
||||||
|
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
||||||
|
|||||||
8
.env.ip
Normal file
8
.env.ip
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
MP_API_BASE_URL=http://192.168.60.2:8080
|
||||||
|
MP_IMAGE_URL=https://patient.youcan365.com
|
||||||
|
MP_CACHE_PREFIX=development
|
||||||
|
MP_WX_APP_ID=wx93af55767423938e
|
||||||
|
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
||||||
|
MP_TIM_SDK_APP_ID=1600123876
|
||||||
|
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
||||||
|
|
||||||
@ -4,3 +4,4 @@ MP_CACHE_PREFIX=development
|
|||||||
MP_WX_APP_ID=wx93af55767423938e
|
MP_WX_APP_ID=wx93af55767423938e
|
||||||
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
MP_CORP_ID=wwe3fb2faa52cf9dfb
|
||||||
MP_TIM_SDK_APP_ID=1600123876
|
MP_TIM_SDK_APP_ID=1600123876
|
||||||
|
MP_INVITE_TEAMMATE_QRCODE=https://patient.youcan365.com/invite-teammate
|
||||||
|
|||||||
68
package.json
68
package.json
@ -1,34 +1,40 @@
|
|||||||
{
|
{
|
||||||
"name": "ykt-wxapp",
|
"name": "ykt-wxapp",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "node scripts/pre-build.js",
|
"prebuild": "node scripts/pre-build.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"tim-upload-plugin": "^1.4.2",
|
"tim-upload-plugin": "^1.4.2",
|
||||||
"tim-wx-sdk": "^2.27.6"
|
"tim-wx-sdk": "^2.27.6"
|
||||||
},
|
},
|
||||||
"uni-app": {
|
"uni-app": {
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": {
|
"dev": {
|
||||||
"title": "测试",
|
"title": "测试",
|
||||||
"env": {
|
"env": {
|
||||||
"UNI_PLATFORM": "mp-weixin"
|
"UNI_PLATFORM": "mp-weixin"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
"title": "本地",
|
"title": "本地",
|
||||||
"env": {
|
"env": {
|
||||||
"UNI_PLATFORM": "mp-weixin"
|
"UNI_PLATFORM": "mp-weixin"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
"ip": {
|
||||||
},
|
"title": "本机ip",
|
||||||
"devDependencies": {}
|
"env": {
|
||||||
|
"UNI_PLATFORM": "mp-weixin"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"devDependencies": {}
|
||||||
}
|
}
|
||||||
@ -4,43 +4,66 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { storeToRefs } from "pinia";
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import useGuard from "@/hooks/useGuard.js";
|
||||||
|
import useAccountStore from "@/store/account.js";
|
||||||
import api from '@/utils/api';
|
import api from '@/utils/api';
|
||||||
import { set } from "@/utils/cache";
|
|
||||||
import { toast } from '@/utils/widget';
|
import { toast } from '@/utils/widget';
|
||||||
|
|
||||||
const teamId = ref('');
|
const { useLoad } = useGuard()
|
||||||
const corpId = ref('');
|
const { account, doctorInfo } = storeToRefs(useAccountStore());
|
||||||
const loading = ref(false);
|
|
||||||
const team = ref(null)
|
|
||||||
|
|
||||||
async function changeTeam({ teamId, corpId, corpName }) {
|
async function getTeam(teamId) {
|
||||||
loading.value = true;
|
if (teamId) {
|
||||||
const res = await api('getTeamData', { teamId, corpId, withCorpName: true });
|
const res = await api('getTeamData', { teamId, corpId: account.value.corpId });
|
||||||
loading.value = false;
|
if (res && res.data) {
|
||||||
if (res && res.data) {
|
return toJoinTeam(teamId)
|
||||||
team.value = res.data;
|
} else {
|
||||||
team.value.corpName = corpName;
|
await toast(res?.message || '获取团队信息失败')
|
||||||
set('invite-team-info', {
|
}
|
||||||
corpId: team.value.corpId,
|
|
||||||
teamId: team.value.teamId,
|
|
||||||
corpName: team.value.corpName,
|
|
||||||
teamName: team.value.name,
|
|
||||||
avatars: team.value && Array.isArray(team.value.memberList) ? team.value.memberList.map(item => item.avatar || '') : [],
|
|
||||||
})
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pages/login/login?source=teamInvite'
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
toast(res?.message || '获取团队信息失败')
|
await toast('获取团队信息失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad(options => {
|
async function toJoinTeam(teamId) {
|
||||||
teamId.value = options.teamId || '';
|
// 已注册
|
||||||
corpId.value = options.corpId || '';
|
if (doctorInfo.value && doctorInfo.value.userid) {
|
||||||
changeTeam({ teamId: teamId.value, corpId: corpId.value });
|
const data = {
|
||||||
|
teamId,
|
||||||
|
corpId: account.value.corpId,
|
||||||
|
id: doctorInfo.value._id,
|
||||||
|
userId: doctorInfo.value.userid
|
||||||
|
}
|
||||||
|
const res = await api('joinTheInvitedTeam', data);
|
||||||
|
if (res && res.success) {
|
||||||
|
await toast('加入团队成功');
|
||||||
|
return uni.switchTab({
|
||||||
|
url: '/pages/work/work'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
await toast(res?.message || '加入团队失败')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: `/pages/work/profile?type=joinTeam&teamId=${teamId}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
useLoad(options => {
|
||||||
|
const href = typeof options.q === 'string' ? decodeURIComponent(options.q) : '';
|
||||||
|
const [, url = ''] = href.split('?');
|
||||||
|
const data = url.split('&').reduce((acc, cur) => {
|
||||||
|
const [key, value] = cur.split('=');
|
||||||
|
acc[key] = value;
|
||||||
|
return acc;
|
||||||
|
}, {})
|
||||||
|
if (data.type === 'inviteTeam') {
|
||||||
|
getTeam(data.teamId)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@ -72,7 +72,9 @@ const { getDoctorInfo } = useAccountStore();
|
|||||||
const job = { assistant: '医生助理', doctor: '医生' };
|
const job = { assistant: '医生助理', doctor: '医生' };
|
||||||
|
|
||||||
const form = ref({});
|
const form = ref({});
|
||||||
|
const inviteTeamId = ref('')
|
||||||
const type = ref('');
|
const type = ref('');
|
||||||
|
|
||||||
const formData = computed(() => ({ ...(doctorInfo.value || {}), ...form.value, mobile: account.value?.mobile }));
|
const formData = computed(() => ({ ...(doctorInfo.value || {}), ...form.value, mobile: account.value?.mobile }));
|
||||||
const cancelText = computed(() => doctorInfo.value ? '取消' : '暂不填写');
|
const cancelText = computed(() => doctorInfo.value ? '取消' : '暂不填写');
|
||||||
const confirmText = computed(() => type.value === 'cert' ? '下一步' : '保存');
|
const confirmText = computed(() => type.value === 'cert' ? '下一步' : '保存');
|
||||||
@ -189,6 +191,9 @@ async function save() {
|
|||||||
if (doctorInfo.value) {
|
if (doctorInfo.value) {
|
||||||
data.id = doctorInfo.value._id;
|
data.id = doctorInfo.value._id;
|
||||||
}
|
}
|
||||||
|
if (inviteTeamId.value) {
|
||||||
|
data.inviteTeamId = inviteTeamId.value;
|
||||||
|
}
|
||||||
const res = await api(apiName, data);
|
const res = await api(apiName, data);
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
await getDoctorInfo()
|
await getDoctorInfo()
|
||||||
@ -206,6 +211,9 @@ async function save() {
|
|||||||
|
|
||||||
useLoad(opts => {
|
useLoad(opts => {
|
||||||
type.value = opts?.type;
|
type.value = opts?.type;
|
||||||
|
if (type.value === 'joinTeam' && opts.teamId) {
|
||||||
|
inviteTeamId.value = opts.teamId
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
useShow(() => {
|
useShow(() => {
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
成员邀请码
|
成员邀请码
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-center overflow-hidden">
|
<view class="flex justify-center overflow-hidden">
|
||||||
<uqrcode canvas-id="qrcode" value="https://uqrcode.cn/doc" :options="options"></uqrcode>
|
<uqrcode canvas-id="qrcode" :value="qrcode" :options="options"></uqrcode>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-10 px-15 text-base text-dark leading-normal text-center">
|
<view class="mt-10 px-15 text-base text-dark leading-normal text-center">
|
||||||
微信扫一扫上面的二维码
|
微信扫一扫上面的二维码
|
||||||
@ -20,19 +20,24 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import { computed, ref } from "vue";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import useGuard from "@/hooks/useGuard.js";
|
import useGuard from "@/hooks/useGuard.js";
|
||||||
import useAccountStore from "@/store/account.js";
|
import useAccountStore from "@/store/account.js";
|
||||||
import api from '@/utils/api';
|
import api from '@/utils/api';
|
||||||
import { toast } from "@/utils/widget";
|
import { toast } from "@/utils/widget";
|
||||||
|
|
||||||
|
const env = __VITE_ENV__;
|
||||||
|
const inviteQrcode = env.MP_INVITE_TEAMMATE_QRCODE;
|
||||||
|
|
||||||
const options = { margin: 10 };
|
const options = { margin: 10 };
|
||||||
const team = ref(null);
|
const team = ref(null);
|
||||||
const teamId = ref('');
|
const teamId = ref('');
|
||||||
const { useLoad, useShow } = useGuard();
|
const { useLoad, useShow } = useGuard();
|
||||||
const { account } = storeToRefs(useAccountStore());
|
const { account } = storeToRefs(useAccountStore());
|
||||||
|
|
||||||
|
const qrcode = computed(() => `${inviteQrcode}?type=inviteTeam&teamId=${teamId.value}`)
|
||||||
|
|
||||||
async function getTeam() {
|
async function getTeam() {
|
||||||
const res = await api('getTeamData', { teamId: teamId.value, corpId: account.value.corpId });
|
const res = await api('getTeamData', { teamId: teamId.value, corpId: account.value.corpId });
|
||||||
if (res && res.data) {
|
if (res && res.data) {
|
||||||
|
|||||||
@ -22,9 +22,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-shrink-0 flex flex-col items-center justify-center" @click.stop="invitePatient(i)">
|
<view class="flex-shrink-0 flex flex-col items-center justify-center" @click.stop="invite(i)">
|
||||||
<image class="mb-5 qrcode" src="/static/work/qrcode.svg" />
|
<image class="mb-5 qrcode" src="/static/work/qrcode.svg" />
|
||||||
<view class="w-full text-sm text-dark text-center">邀请患者</view>
|
<view class="w-full text-sm text-dark text-center">邀请成员</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -47,8 +47,9 @@ const { useShow } = useGuard();
|
|||||||
const { doctorInfo, account } = storeToRefs(useAccountStore());
|
const { doctorInfo, account } = storeToRefs(useAccountStore());
|
||||||
const list = ref([]);
|
const list = ref([]);
|
||||||
|
|
||||||
function invitePatient(team) {
|
function invite(team) {
|
||||||
uni.navigateTo({ url: `/pages/work/team/invite/invite-patient?teamId=${team.teamId || ''}` })
|
uni.navigateTo({ url: `/pages/work/team/invite/invite-teammate?teamId=${team.teamId || ''}` })
|
||||||
|
// uni.navigateTo({ url: `/pages/work/team/invite/invite-patient?teamId=${team.teamId || ''}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
function toCreate() {
|
function toCreate() {
|
||||||
|
|||||||
@ -3,6 +3,10 @@ export default [
|
|||||||
path: 'pages/login/login',
|
path: 'pages/login/login',
|
||||||
meta: { title: '登录', login: false },
|
meta: { title: '登录', login: false },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'pages/login/redirect-page',
|
||||||
|
meta: { title: '登录', login: true },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'pages/login/redirect-page',
|
path: 'pages/login/redirect-page',
|
||||||
meta: { title: '登录', login: false },
|
meta: { title: '登录', login: false },
|
||||||
|
|||||||
@ -21,7 +21,8 @@ const urlsConfig = {
|
|||||||
updateTeamInfo: "updateTeamInfo",
|
updateTeamInfo: "updateTeamInfo",
|
||||||
createOwnTeam: 'createOwnTeam',
|
createOwnTeam: 'createOwnTeam',
|
||||||
removeTeammate: "removeTeammate",
|
removeTeammate: "removeTeammate",
|
||||||
toggleTeamLeaderRole: "toggleTeamLeaderRole"
|
toggleTeamLeaderRole: "toggleTeamLeaderRole",
|
||||||
|
joinTheInvitedTeam: 'joinTheInvitedTeam'
|
||||||
},
|
},
|
||||||
|
|
||||||
knowledgeBase: {
|
knowledgeBase: {
|
||||||
|
|||||||
@ -21,6 +21,9 @@ export default (command, mode) => {
|
|||||||
case "localhost":
|
case "localhost":
|
||||||
mode = "localhost";
|
mode = "localhost";
|
||||||
break;
|
break;
|
||||||
|
case "ip":
|
||||||
|
mode = "ip";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
mode = "production";
|
mode = "production";
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user