fix: 问题修复
This commit is contained in:
parent
9af63de623
commit
946d29ad97
@ -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 });
|
const res = await api('bindMiniAppArchive', { id: customerId, corpId: corpId.value, teamId: teamId.value, miniAppId: account.value.openid });
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
await toast('绑定成功');
|
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 {
|
} else {
|
||||||
toast(res?.message || '绑定失败');
|
toast(res?.message || '绑定失败');
|
||||||
}
|
}
|
||||||
@ -195,7 +199,7 @@ async function getBaseForm() {
|
|||||||
formItems.value = Array.isArray(res.data) ? res.data : [];
|
formItems.value = Array.isArray(res.data) ? res.data : [];
|
||||||
const mobileIndex = formItems.value.findIndex(item => item.title === 'mobile');
|
const mobileIndex = formItems.value.findIndex(item => item.title === 'mobile');
|
||||||
if (mobileIndex > -1) {
|
if (mobileIndex > -1) {
|
||||||
formItems.value[mobileIndex].appendText = `(授权手机号不可修改)`;
|
formItems.value[mobileIndex].appendText = `(授权手机号)`;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -22,7 +22,8 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from "vue";
|
import { computed, ref } from "vue";
|
||||||
import { storeToRefs } from "pinia";
|
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 useAccount from "@/store/account";
|
||||||
import api from "@/utils/api";
|
import api from "@/utils/api";
|
||||||
import { toast } from "@/utils/widget";
|
import { toast } from "@/utils/widget";
|
||||||
@ -37,12 +38,12 @@ import teamMate from "./team-mate.vue";
|
|||||||
import ycHome from "./yc-home.vue";
|
import ycHome from "./yc-home.vue";
|
||||||
import pageLoading from "./loading.vue";
|
import pageLoading from "./loading.vue";
|
||||||
|
|
||||||
const { useLoad, useShow } = useGuard();
|
// const { useLoad, useShow } = useGuard();
|
||||||
const { account } = storeToRefs(useAccount());
|
const { account } = storeToRefs(useAccount());
|
||||||
|
|
||||||
const team = ref(null);
|
const team = ref(null);
|
||||||
const teams = ref([]);
|
const teams = ref([]);
|
||||||
const loading = ref(true);
|
const loading = ref(false);
|
||||||
const customers = ref([]);
|
const customers = ref([]);
|
||||||
|
|
||||||
const corpId = computed(() => team.value?.corpId);
|
const corpId = computed(() => team.value?.corpId);
|
||||||
@ -83,14 +84,18 @@ async function getTeams() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
useLoad((opts) => {
|
// useLoad((opts) => {
|
||||||
if (opts.teamId) {
|
// if (opts.teamId) {
|
||||||
team.value = { teamId: opts.teamId, corpId: opts.corpId };
|
// team.value = { teamId: opts.teamId, corpId: opts.corpId };
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
useShow(() => {
|
onShow(() => {
|
||||||
|
if (account.value && account.value.openid) {
|
||||||
getTeams();
|
getTeams();
|
||||||
|
} else {
|
||||||
|
teams.value = [];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export default defineStore("accountStore", () => {
|
|||||||
code
|
code
|
||||||
});
|
});
|
||||||
loading.value = false
|
loading.value = false
|
||||||
if (res.success && res.data && res.data.mobile) {
|
if (res.success && res.data) {
|
||||||
account.value = res.data;
|
account.value = res.data;
|
||||||
openid.value = res.data.openid;
|
openid.value = res.data.openid;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user