173 lines
7.7 KiB
JavaScript
173 lines
7.7 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const _sfc_main = {
|
|
data() {
|
|
const systemInfo = common_vendor.index.getSystemInfoSync();
|
|
const statusBarHeight = systemInfo.statusBarHeight || 20;
|
|
const navbarHeight = 44;
|
|
const statusBarHeightRpx = statusBarHeight * 2;
|
|
const navbarHeightRpx = navbarHeight * 2;
|
|
const totalNavbarHeight = statusBarHeightRpx + navbarHeightRpx;
|
|
return {
|
|
contentTop: totalNavbarHeight + "rpx",
|
|
// 内容区域距离顶部的距离
|
|
contentBottom: "96rpx"
|
|
// 内容区域距离底部的距离(默认值,会在 onReady 中更新)
|
|
};
|
|
},
|
|
computed: {
|
|
// 计算内容区域的位置(使用计算属性确保响应式)
|
|
computedContentTop() {
|
|
const systemInfo = common_vendor.index.getSystemInfoSync();
|
|
const statusBarHeight = systemInfo.statusBarHeight || 20;
|
|
const navbarHeight = 44;
|
|
const statusBarHeightRpx = statusBarHeight * 2;
|
|
const navbarHeightRpx = navbarHeight * 2;
|
|
const totalNavbarHeight = statusBarHeightRpx + navbarHeightRpx;
|
|
return totalNavbarHeight + "rpx";
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.updateNavbarPosition();
|
|
},
|
|
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:175", "[AIAnalysis] 使用实际导航栏高度:", actualHeight, "px =", actualHeightRpx, "rpx, 调整后:", adjustedHeight, "rpx");
|
|
} else {
|
|
const systemInfo = common_vendor.index.getSystemInfoSync();
|
|
const statusBarHeight = systemInfo.statusBarHeight || 20;
|
|
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:199", "[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:217", "[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:229", "[AIAnalysis] 延迟更新tabbar高度:", tabbarHeight, "px =", tabbarHeightRpx, "rpx, 调整后:", adjustedBottom, "rpx");
|
|
}
|
|
}).exec();
|
|
}, 200);
|
|
});
|
|
},
|
|
methods: {
|
|
// 计算并更新导航栏和内容区域的位置
|
|
updateNavbarPosition() {
|
|
const systemInfo = common_vendor.index.getSystemInfoSync();
|
|
const statusBarHeight = systemInfo.statusBarHeight || 20;
|
|
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:258", "[AIAnalysis][goBack] 当前是第一个页面,无法返回");
|
|
return;
|
|
}
|
|
common_vendor.index.navigateBack({
|
|
fail: (err) => {
|
|
common_vendor.index.__f__("error", "at pages/ai_analysis/ai_analysis.vue:263", "[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:272", "导航失败:", err);
|
|
common_vendor.index.showToast({
|
|
title: "页面跳转失败",
|
|
icon: "none"
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
if (!Array) {
|
|
const _easycom_uni_nav_bar2 = common_vendor.resolveComponent("uni-nav-bar");
|
|
_easycom_uni_nav_bar2();
|
|
}
|
|
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 {
|
|
a: common_vendor.o($options.goBack),
|
|
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")),
|
|
d: common_vendor.o(($event) => $options.navigateToPage("customer_count")),
|
|
e: common_vendor.o(($event) => $options.navigateToPage("quality_coverage")),
|
|
f: common_vendor.o(($event) => $options.navigateToPage("speech_rating")),
|
|
g: common_vendor.o(($event) => $options.navigateToPage("intent_level")),
|
|
h: common_vendor.o(($event) => $options.navigateToPage("deal_attribution")),
|
|
i: common_vendor.o(($event) => $options.navigateToPage("opening_rate")),
|
|
j: common_vendor.o(($event) => $options.navigateToPage("over_commitment")),
|
|
k: common_vendor.o(($event) => $options.navigateToPage("red_line_touch")),
|
|
l: $options.computedContentTop || $data.contentTop,
|
|
m: $data.contentBottom || "96rpx"
|
|
};
|
|
}
|
|
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
|