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