258 lines
11 KiB
JavaScript
258 lines
11 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
function getSystemInfo() {
|
|
if (typeof common_vendor.wx$1 !== "undefined" && common_vendor.wx$1.getWindowInfo) {
|
|
try {
|
|
const windowInfo = common_vendor.wx$1.getWindowInfo();
|
|
return {
|
|
statusBarHeight: windowInfo.statusBarHeight || 20,
|
|
windowWidth: windowInfo.windowWidth,
|
|
windowHeight: windowInfo.windowHeight
|
|
};
|
|
} catch (e) {
|
|
common_vendor.index.__f__("warn", "at pages/ai_analysis/ai_analysis.vue:138", "[AIAnalysis] Failed to use wx.getWindowInfo, fallback to getSystemInfoSync:", e);
|
|
}
|
|
}
|
|
try {
|
|
const systemInfo = common_vendor.index.getSystemInfoSync();
|
|
return {
|
|
statusBarHeight: systemInfo.statusBarHeight || 20,
|
|
windowWidth: systemInfo.windowWidth,
|
|
windowHeight: systemInfo.windowHeight
|
|
};
|
|
} catch (e) {
|
|
common_vendor.index.__f__("error", "at pages/ai_analysis/ai_analysis.vue:152", "[AIAnalysis] Failed to get system info:", e);
|
|
return {
|
|
statusBarHeight: 20,
|
|
windowWidth: 375,
|
|
windowHeight: 667
|
|
};
|
|
}
|
|
}
|
|
const _sfc_main = {
|
|
// 注意:子包组件不在这里注册,通过 componentPlaceholder 自动处理
|
|
// CustomerCountPopup, QualityCoveragePopup 通过 componentPlaceholder 配置自动注册
|
|
data() {
|
|
const systemInfo = getSystemInfo();
|
|
const statusBarHeight = systemInfo.statusBarHeight;
|
|
const navbarHeight = 44;
|
|
const statusBarHeightRpx = statusBarHeight * 2;
|
|
const navbarHeightRpx = navbarHeight * 2;
|
|
const totalNavbarHeight = statusBarHeightRpx + navbarHeightRpx;
|
|
return {
|
|
contentTop: totalNavbarHeight + "rpx",
|
|
// 内容区域距离顶部的距离
|
|
contentBottom: "96rpx",
|
|
// 内容区域距离底部的距离(默认值,会在 onReady 中更新)
|
|
showQualityCoverage: false,
|
|
// 是否显示质检覆盖率弹出框
|
|
subpackageLoaded: false,
|
|
// 子包是否已加载
|
|
popupsInitialized: false,
|
|
// 弹出框组件是否已初始化
|
|
openQualityCoverageTrigger: 0
|
|
// 打开质检覆盖率弹出框的触发器
|
|
};
|
|
},
|
|
computed: {
|
|
// 计算内容区域的位置(使用计算属性确保响应式)
|
|
computedContentTop() {
|
|
const systemInfo = getSystemInfo();
|
|
const statusBarHeight = systemInfo.statusBarHeight;
|
|
const navbarHeight = 44;
|
|
const statusBarHeightRpx = statusBarHeight * 2;
|
|
const navbarHeightRpx = navbarHeight * 2;
|
|
const totalNavbarHeight = statusBarHeightRpx + navbarHeightRpx;
|
|
return totalNavbarHeight + "rpx";
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.updateNavbarPosition();
|
|
setTimeout(() => {
|
|
this.preloadSubpackage();
|
|
}, 100);
|
|
this.$nextTick(() => {
|
|
setTimeout(() => {
|
|
this.popupsInitialized = true;
|
|
common_vendor.index.__f__("log", "at pages/ai_analysis/ai_analysis.vue:223", "[AIAnalysis] Popup components ready (using v-show)");
|
|
}, 500);
|
|
});
|
|
},
|
|
onShow() {
|
|
this.$nextTick(() => {
|
|
this.updateNavbarPosition();
|
|
setTimeout(() => {
|
|
this.updateNavbarPosition();
|
|
}, 50);
|
|
});
|
|
},
|
|
onReady() {
|
|
this.$nextTick(() => {
|
|
const query = common_vendor.index.createSelectorQuery().in(this);
|
|
query.select(".uni-navbar__content").boundingClientRect((data) => {
|
|
if (data && data.height) {
|
|
const actualHeight = data.height;
|
|
const actualHeightRpx = actualHeight * 2;
|
|
const adjustedHeight = Math.max(actualHeightRpx - 4, 0);
|
|
this.$set(this, "contentTop", adjustedHeight + "rpx");
|
|
common_vendor.index.__f__("log", "at pages/ai_analysis/ai_analysis.vue:250", "[AIAnalysis] 使用实际导航栏高度:", actualHeight, "px =", actualHeightRpx, "rpx, 调整后:", adjustedHeight, "rpx");
|
|
} else {
|
|
const systemInfo = getSystemInfo();
|
|
const statusBarHeight = systemInfo.statusBarHeight;
|
|
const navbarHeight = 44;
|
|
const statusBarHeightRpx = statusBarHeight * 2;
|
|
const navbarHeightRpx = navbarHeight * 2;
|
|
const totalNavbarHeight = statusBarHeightRpx + navbarHeightRpx;
|
|
const adjustedHeight = Math.max(totalNavbarHeight - 4, 0);
|
|
this.$set(this, "contentTop", adjustedHeight + "rpx");
|
|
}
|
|
}).exec();
|
|
const queryTabbar = common_vendor.index.createSelectorQuery().in(this);
|
|
queryTabbar.select(".tabbar").boundingClientRect((tabbarData) => {
|
|
if (tabbarData && tabbarData.height) {
|
|
const tabbarHeight = tabbarData.height;
|
|
const tabbarHeightRpx = tabbarHeight * 2;
|
|
const adjustedBottom = Math.max(tabbarHeightRpx - 4, 0);
|
|
this.$set(this, "contentBottom", adjustedBottom + "rpx");
|
|
common_vendor.index.__f__("log", "at pages/ai_analysis/ai_analysis.vue:274", "[AIAnalysis] 使用实际tabbar高度:", tabbarHeight, "px =", tabbarHeightRpx, "rpx, 调整后:", adjustedBottom, "rpx");
|
|
} else {
|
|
this.$set(this, "contentBottom", "96rpx");
|
|
}
|
|
}).exec();
|
|
setTimeout(() => {
|
|
const query2 = common_vendor.index.createSelectorQuery().in(this);
|
|
query2.select(".uni-navbar__content").boundingClientRect((data) => {
|
|
if (data && data.height) {
|
|
const actualHeight = data.height;
|
|
const actualHeightRpx = actualHeight * 2;
|
|
const adjustedHeight = Math.max(actualHeightRpx - 4, 0);
|
|
this.$set(this, "contentTop", adjustedHeight + "rpx");
|
|
common_vendor.index.__f__("log", "at pages/ai_analysis/ai_analysis.vue:292", "[AIAnalysis] 延迟更新导航栏高度:", actualHeight, "px =", actualHeightRpx, "rpx, 调整后:", adjustedHeight, "rpx");
|
|
}
|
|
}).exec();
|
|
const queryTabbar2 = common_vendor.index.createSelectorQuery().in(this);
|
|
queryTabbar2.select(".tabbar").boundingClientRect((tabbarData) => {
|
|
if (tabbarData && tabbarData.height) {
|
|
const tabbarHeight = tabbarData.height;
|
|
const tabbarHeightRpx = tabbarHeight * 2;
|
|
const adjustedBottom = Math.max(tabbarHeightRpx - 4, 0);
|
|
this.$set(this, "contentBottom", adjustedBottom + "rpx");
|
|
common_vendor.index.__f__("log", "at pages/ai_analysis/ai_analysis.vue:304", "[AIAnalysis] 延迟更新tabbar高度:", tabbarHeight, "px =", tabbarHeightRpx, "rpx, 调整后:", adjustedBottom, "rpx");
|
|
}
|
|
}).exec();
|
|
}, 200);
|
|
});
|
|
},
|
|
methods: {
|
|
// 预加载子包
|
|
preloadSubpackage() {
|
|
if (typeof common_vendor.wx$1 !== "undefined" && common_vendor.wx$1.loadSubpackage) {
|
|
common_vendor.wx$1.loadSubpackage({
|
|
name: "pages-subpackage",
|
|
success: () => {
|
|
common_vendor.index.__f__("log", "at pages/ai_analysis/ai_analysis.vue:319", "[AIAnalysis] Subpackage loaded successfully");
|
|
this.subpackageLoaded = true;
|
|
},
|
|
fail: (err) => {
|
|
common_vendor.index.__f__("error", "at pages/ai_analysis/ai_analysis.vue:323", "[AIAnalysis] Failed to load subpackage:", err);
|
|
this.subpackageLoaded = true;
|
|
}
|
|
});
|
|
} else {
|
|
common_vendor.index.__f__("log", "at pages/ai_analysis/ai_analysis.vue:330", "[AIAnalysis] loadSubpackage API not available, assuming subpackage will load automatically");
|
|
this.subpackageLoaded = true;
|
|
}
|
|
},
|
|
// 显示质检覆盖率弹出框
|
|
showQualityCoveragePopup() {
|
|
this.showQualityCoverage = true;
|
|
this.$nextTick(() => {
|
|
this.openQualityCoverageTrigger++;
|
|
});
|
|
},
|
|
// 质检覆盖率弹出框关闭事件
|
|
onQualityCoveragePopupClose() {
|
|
this.showQualityCoverage = false;
|
|
},
|
|
// 计算并更新导航栏和内容区域的位置
|
|
updateNavbarPosition() {
|
|
const systemInfo = getSystemInfo();
|
|
const statusBarHeight = systemInfo.statusBarHeight;
|
|
const navbarHeight = 44;
|
|
const statusBarHeightRpx = statusBarHeight * 2;
|
|
const navbarHeightRpx = navbarHeight * 2;
|
|
const totalNavbarHeight = statusBarHeightRpx + navbarHeightRpx;
|
|
const contentTop = totalNavbarHeight + "rpx";
|
|
this.$set(this, "contentTop", contentTop);
|
|
this.$forceUpdate();
|
|
},
|
|
goBack() {
|
|
const pages = getCurrentPages();
|
|
if (pages.length <= 1) {
|
|
common_vendor.index.__f__("log", "at pages/ai_analysis/ai_analysis.vue:371", "[AIAnalysis][goBack] 当前是第一个页面,无法返回");
|
|
return;
|
|
}
|
|
common_vendor.index.navigateBack({
|
|
fail: (err) => {
|
|
common_vendor.index.__f__("error", "at pages/ai_analysis/ai_analysis.vue:376", "[AIAnalysis][goBack] 返回失败:", err);
|
|
}
|
|
});
|
|
},
|
|
navigateToPage(pageName) {
|
|
const pagePath = `pages-subpackage/ai_features/${pageName}/${pageName}`;
|
|
common_vendor.index.navigateTo({
|
|
url: `/${pagePath}`,
|
|
fail: (err) => {
|
|
common_vendor.index.__f__("error", "at pages/ai_analysis/ai_analysis.vue:385", "导航失败:", err);
|
|
common_vendor.index.showToast({
|
|
title: "页面跳转失败",
|
|
icon: "none"
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
if (!Array) {
|
|
const _easycom_uni_nav_bar2 = common_vendor.resolveComponent("uni-nav-bar");
|
|
const _component_QualityCoveragePopup = common_vendor.resolveComponent("QualityCoveragePopup");
|
|
(_easycom_uni_nav_bar2 + _component_QualityCoveragePopup)();
|
|
}
|
|
const _easycom_uni_nav_bar = () => "../../uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.js";
|
|
if (!Math) {
|
|
_easycom_uni_nav_bar();
|
|
}
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return common_vendor.e({
|
|
a: common_vendor.o($options.goBack, "84"),
|
|
b: common_vendor.p({
|
|
fixed: true,
|
|
statusBar: true,
|
|
title: "AI销冠系统",
|
|
leftIcon: "left",
|
|
color: "#333",
|
|
backgroundColor: "#FFFFFF"
|
|
}),
|
|
c: common_vendor.o(($event) => $options.navigateToPage("recording_duration"), "78"),
|
|
d: common_vendor.o(($event) => $options.navigateToPage("customer_count"), "2b"),
|
|
e: common_vendor.o((...args) => $options.showQualityCoveragePopup && $options.showQualityCoveragePopup(...args), "8b"),
|
|
f: common_vendor.o(($event) => $options.navigateToPage("speech_rating"), "4d"),
|
|
g: common_vendor.o(($event) => $options.navigateToPage("intent_level"), "20"),
|
|
h: common_vendor.o(($event) => $options.navigateToPage("deal_attribution"), "bf"),
|
|
i: common_vendor.o(($event) => $options.navigateToPage("opening_rate"), "7e"),
|
|
j: common_vendor.o(($event) => $options.navigateToPage("over_commitment"), "ac"),
|
|
k: common_vendor.o(($event) => $options.navigateToPage("red_line_touch"), "7d"),
|
|
l: $options.computedContentTop || $data.contentTop,
|
|
m: $data.contentBottom || "96rpx",
|
|
n: $data.showQualityCoverage
|
|
}, $data.showQualityCoverage ? {
|
|
o: common_vendor.o($options.onQualityCoveragePopupClose, "f6"),
|
|
p: common_vendor.p({
|
|
["open-trigger"]: $data.openQualityCoverageTrigger
|
|
})
|
|
} : {});
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8462a2f1"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/ai_analysis/ai_analysis.js.map
|