bug修复

This commit is contained in:
zhanchao 2026-08-12 14:27:07 +08:00
parent d9b271e757
commit b1a6e58a6f

View File

@ -38,6 +38,7 @@ const tip = ref("");
const claiming = ref(false);
const autoPrompted = ref(false);
const posterVisible = ref(false);
const bindingTeamId = ref("");
const projectNameText = computed(() => {
const projects = Array.isArray(issue.value?.projectSnapshot) ? issue.value.projectSnapshot : [];
@ -79,9 +80,8 @@ async function loadIssueDetail() {
async function hasBoundArchive() {
const openid = account.value?.openid || "";
if (!openid || !corpId.value) return false;
if (!openid || !corpId.value || !memberId.value) return false;
if (memberId.value) {
try {
const detail = await api(
"getCustomerByCustomerId",
@ -89,30 +89,22 @@ async function hasBoundArchive() {
false
);
const customer = detail?.data || null;
if (customer && String(customer.miniAppId || "") === String(openid)) {
return true;
}
const teamIds = Array.isArray(customer?.teamId) ? customer.teamId : [customer?.teamId];
bindingTeamId.value = teamIds.find(Boolean) || "";
return Boolean(customer && String(customer.miniAppId || "") === String(openid));
} catch (e) {
console.warn("getCustomerByCustomerId failed", e);
}
}
try {
const countRes = await api(
"getWxAppCustomerCount",
{ miniAppId: openid, corpId: corpId.value },
false
);
return Number(countRes?.data || 0) > 0;
} catch (e) {
console.warn("getWxAppCustomerCount failed", e);
return false;
}
}
function goBindArchive() {
const params = [
`corpId=${encodeURIComponent(corpId.value || "")}`,
`teamId=${encodeURIComponent(bindingTeamId.value || "")}`,
].join("&");
uni.navigateTo({
url: `/pages/archive/archive-manage?corpId=${encodeURIComponent(corpId.value || "")}`,
url: `/pages/archive/edit-archive?${params}`,
});
}