修改pk页两个bug

This commit is contained in:
田岩
2025-11-26 11:03:21 +08:00
14 changed files with 370 additions and 67 deletions
+10 -2
View File
@@ -202,8 +202,16 @@
console.log('声音加载完毕', e.duration);
// 计算原始时长
const originalTime = Math.ceil(e.duration) || 1;
// 判断是否在118-123秒范围内
const displayTime = originalTime >= 118 && originalTime <= 124 ? 120 : originalTime;
let displayTime
if(originalTime >= 118 && originalTime <= 122) {
// 判断是否在118-123秒范围内
displayTime = 120
} else if(originalTime >= 58 && originalTime <= 62) {
// 判断是否在58-62秒范围内
displayTime = 60
} else {
displayTime = originalTime
}
// 赋值显示
console.log('displayTime', displayTime);
voiceTime.value = displayTime + 's';
+1 -3
View File
@@ -39,7 +39,6 @@
mode=""
@click="changeBtn"
></image>
<image
class="talk-btn-icon"
v-show="keyboardIsShow && !!inputText"
@@ -48,7 +47,6 @@
@click.stop="showKeyboard"
></image>
</view>
<uni-popup ref="popupRef" class="popup">
<view class="overlay-box">
<view class="circle-bg-box">
@@ -147,7 +145,7 @@
console.log('延迟开始');
recordingStatus.value = 'preparing';
popupRef.value.open();
recorderManager.start({ duration: 120000 });
recorderManager.start({ duration: 59000 });
startTime = Date.now();
}, 80);
};
+8 -4
View File
@@ -89,15 +89,17 @@
const expand = ref(false); // 展开状态
const isSigned = ref(false); // 今日签到状态
const continuousDay = ref(0); // 连续签到
const continuousDay30 = computed(() => continuousDay.value % 30); // 连续签到取模30的天数
// 判断一下当前的签到显示在第几周
const nowLine = computed(() => {
// 计算当前需要显示图标的天数(已签到则是连续天数,未签到则是下一天)
const currentDay = isSigned.value ? continuousDay.value : continuousDay.value + 1;
const currentDay = isSigned.value ? continuousDay30.value : continuousDay30.value + 1;
// 按每周7天分行,行数从0开始(例如:1-7天 → 第0行,8-14天 → 第1行...
// 注意:如果天数从1开始(不是0),需要减1再计算
console.log('nowLine', Math.floor((currentDay - 1) / 7));
return Math.floor((currentDay - 1) / 7);
});
const emits = defineEmits(['checkInFun']);
// 切换显示状态
const switchStatus = () => {
@@ -174,7 +176,7 @@
// 计算当前是第几天(以"前X天"为第1天)
const dayNumber = i - -X + 1; // 核心计算:转换为从1开始的序列
// 计算text字段
let text = '1'; // 默认显示1
if (dayNumber === 30) {
@@ -209,6 +211,7 @@
const open = (isSignedStatus, days, onCheckInClick = () => {}, onCheckInSuccess = () => {}) => {
isSigned.value = isSignedStatus; // 今日签到状态
// isSigned.value = false; // 今日签到状态
// continuousDay.value = 1; // 连续签到
continuousDay.value = days; // 连续签到
checkInClickCallback = onCheckInClick;
checkInSuccessCallback = onCheckInSuccess;
@@ -218,7 +221,8 @@
// const X = 10;
// console.log(`以${continuousDay.value}天`);
// console.log(`以${X}天前为第1天的35天分组日期:`);
dateGroups.value = generateGroupedDateList(X);
console.log('取模', continuousDay30.value);
dateGroups.value = generateGroupedDateList(continuousDay30.value);
} catch (err) {
console.error(err.message);
}