完善录音时长功能

This commit is contained in:
zhonghua.li
2026-02-07 19:51:03 +08:00
parent 33950f41fd
commit 3944fa6969
52 changed files with 2013 additions and 886 deletions

View File

@@ -1,8 +1,49 @@
"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-subpackage/ai_features/deal_attribution/deal_attribution.vue:62", "[DealAttribution] 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-subpackage/ai_features/deal_attribution/deal_attribution.vue:76", "[DealAttribution] Failed to get system info:", e);
return {
statusBarHeight: 20,
windowWidth: 375,
windowHeight: 667
};
}
}
const _sfc_main = {
data() {
const systemInfo = getSystemInfo();
const statusBarHeight = systemInfo.statusBarHeight;
const navbarHeight = 44;
const statusBarHeightRpx = statusBarHeight * 2;
const navbarHeightRpx = navbarHeight * 2;
const totalNavbarHeight = statusBarHeightRpx + navbarHeightRpx;
return {
statusBarHeight,
// 状态栏高度px
contentTop: totalNavbarHeight + "rpx",
// 内容区域距离顶部的距离
contentBottom: "0rpx",
// 内容区域距离底部的距离(默认值,会在 onReady 中更新)
conversionRate: "15.8",
totalDeals: "201",
dataList: [
@@ -14,6 +55,67 @@ const _sfc_main = {
]
};
},
onReady() {
this.$nextTick(() => {
const query = common_vendor.index.createSelectorQuery().in(this);
query.select(".nav-bar").boundingClientRect((data) => {
if (data && data.height) {
const actualHeight = data.height;
const actualHeightRpx = actualHeight * 2;
const statusBarHeightRpx = this.statusBarHeight * 2;
const totalHeight = statusBarHeightRpx + actualHeightRpx;
const adjustedHeight = Math.max(totalHeight - 4, 0);
this.$set(this, "contentTop", adjustedHeight + "rpx");
common_vendor.index.__f__("log", "at pages-subpackage/ai_features/deal_attribution/deal_attribution.vue:127", "[DealAttribution] 使用实际导航栏高度:", actualHeight, "px =", actualHeightRpx, "rpx, 总高度:", totalHeight, "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-subpackage/ai_features/deal_attribution/deal_attribution.vue:151", "[DealAttribution] 使用实际tabbar高度:", tabbarHeight, "px =", tabbarHeightRpx, "rpx, 调整后:", adjustedBottom, "rpx");
} else {
this.$set(this, "contentBottom", "0rpx");
}
}).exec();
setTimeout(() => {
const query2 = common_vendor.index.createSelectorQuery().in(this);
query2.select(".nav-bar").boundingClientRect((data) => {
if (data && data.height) {
const actualHeight = data.height;
const actualHeightRpx = actualHeight * 2;
const statusBarHeightRpx = this.statusBarHeight * 2;
const totalHeight = statusBarHeightRpx + actualHeightRpx;
const adjustedHeight = Math.max(totalHeight - 4, 0);
this.$set(this, "contentTop", adjustedHeight + "rpx");
common_vendor.index.__f__("log", "at pages-subpackage/ai_features/deal_attribution/deal_attribution.vue:170", "[DealAttribution] 延迟更新导航栏高度:", actualHeight, "px =", actualHeightRpx, "rpx, 总高度:", totalHeight, "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-subpackage/ai_features/deal_attribution/deal_attribution.vue:182", "[DealAttribution] 延迟更新tabbar高度:", tabbarHeight, "px =", tabbarHeightRpx, "rpx, 调整后:", adjustedBottom, "rpx");
}
}).exec();
}, 200);
});
},
methods: {
goBack() {
common_vendor.index.navigateBack();
@@ -23,16 +125,19 @@ const _sfc_main = {
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)),
b: common_vendor.t($data.conversionRate),
c: common_vendor.t($data.totalDeals),
d: common_vendor.f($data.dataList, (item, index, i0) => {
b: $data.statusBarHeight + "px",
c: common_vendor.t($data.conversionRate),
d: common_vendor.t($data.totalDeals),
e: common_vendor.f($data.dataList, (item, index, i0) => {
return {
a: common_vendor.t(item.factor),
b: common_vendor.t(item.description),
c: common_vendor.t(item.percentage),
d: index
};
})
}),
f: $data.contentTop,
g: $data.contentBottom
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-92834624"]]);

View File

@@ -1 +1 @@
<view class="feature-page data-v-92834624"><view class="page-header data-v-92834624"><view class="nav-bar data-v-92834624"><view class="nav-left data-v-92834624" bindtap="{{a}}"><text class="back-icon data-v-92834624">←</text></view><text class="nav-title data-v-92834624">成交归因分析</text></view></view><scroll-view class="content-scroll data-v-92834624" scroll-y="true"><view class="stats-card data-v-92834624"><view class="stat-item data-v-92834624"><text class="stat-value data-v-92834624">{{b}}%</text><text class="stat-label data-v-92834624">总体转化率</text></view><view class="stat-item data-v-92834624"><text class="stat-value data-v-92834624">{{c}}</text><text class="stat-label data-v-92834624">成交总数</text></view></view><view class="chart-section data-v-92834624"><text class="section-title data-v-92834624">成交因素分析图</text><view class="chart-placeholder data-v-92834624"><text class="placeholder-text data-v-92834624">📊 图表区域</text><text class="placeholder-desc data-v-92834624">此处将显示成交归因分析图表</text></view></view><view class="data-list data-v-92834624"><text class="section-title data-v-92834624">关键成交因素</text><view wx:for="{{d}}" wx:for-item="item" wx:key="d" class="list-item data-v-92834624"><view class="item-left data-v-92834624"><text class="item-date data-v-92834624">{{item.a}}</text><text class="item-desc data-v-92834624">{{item.b}}</text></view><view class="item-right data-v-92834624"><text class="item-percentage data-v-92834624">{{item.c}}%</text></view></view></view></scroll-view></view>
<view class="feature-page data-v-92834624"><view class="page-header data-v-92834624" style="{{'padding-top:' + b}}"><view class="nav-bar data-v-92834624"><view class="nav-left data-v-92834624" bindtap="{{a}}"><text class="back-icon data-v-92834624">←</text></view><text class="nav-title data-v-92834624">成交归因分析</text></view></view><scroll-view class="content-scroll data-v-92834624" scroll-y="true" style="{{'top:' + f + ';' + ('bottom:' + g)}}"><view class="stats-card data-v-92834624"><view class="stat-item data-v-92834624"><text class="stat-value data-v-92834624">{{c}}%</text><text class="stat-label data-v-92834624">总体转化率</text></view><view class="stat-item data-v-92834624"><text class="stat-value data-v-92834624">{{d}}</text><text class="stat-label data-v-92834624">成交总数</text></view></view><view class="chart-section data-v-92834624"><text class="section-title data-v-92834624">成交因素分析图</text><view class="chart-placeholder data-v-92834624"><text class="placeholder-text data-v-92834624">📊 图表区域</text><text class="placeholder-desc data-v-92834624">此处将显示成交归因分析图表</text></view></view><view class="data-list data-v-92834624"><text class="section-title data-v-92834624">关键成交因素</text><view wx:for="{{e}}" wx:for-item="item" wx:key="d" class="list-item data-v-92834624"><view class="item-left data-v-92834624"><text class="item-date data-v-92834624">{{item.a}}</text><text class="item-desc data-v-92834624">{{item.b}}</text></view><view class="item-right data-v-92834624"><text class="item-percentage data-v-92834624">{{item.c}}%</text></view></view></view></scroll-view></view>

View File

@@ -4,6 +4,11 @@
background: #f8f9fa;
}
.page-header.data-v-92834624 {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 999;
background: #ffffff;
border-bottom: 1rpx solid #e9ecef;
}
@@ -33,7 +38,15 @@
color: #333333;
}
.content-scroll.data-v-92834624 {
height: calc(100vh - 88rpx);
position: absolute;
left: 0;
right: 0;
top: 0; /* 先从顶部开始,通过内联样式动态设置 */
bottom: 0; /* 先从底部开始,通过内联样式动态设置 */
/* top和bottom值通过内联样式动态设置覆盖上面的默认值 */
padding: 0 !important;
margin: 0 !important;
box-sizing: border-box;
}
.stats-card.data-v-92834624 {
display: flex;