搜索页等
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
</view>
|
||||
<view class="prompt_div">
|
||||
<view class="prompt_div_left">
|
||||
<view class="top">{{ formatSeconds(item.stdyTm) || '' }}</view>
|
||||
<view class="top">{{ secondsToHours(item.stdyTm) }}h</view>
|
||||
<view class="bottom">学习时长</view>
|
||||
</view>
|
||||
<view class="prompt_div_line"></view>
|
||||
@@ -58,7 +58,6 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, reactive } from 'vue';
|
||||
import { formatSeconds } from '@/common/common';
|
||||
import common from '@/common/common';
|
||||
import { queryStdyBatchByCrsId } from '@/api/courseRecord.js';
|
||||
const status = ref('loadmore'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
|
||||
@@ -81,7 +80,14 @@
|
||||
return data_list.length * 136 + 'rpx';
|
||||
}
|
||||
});
|
||||
|
||||
const secondsToHours = (seconds) => {
|
||||
console.log('typeof seconds', typeof seconds);
|
||||
if (typeof seconds === 'number') {
|
||||
// 转换为小时并保留一位小数
|
||||
return (seconds / 3600).toFixed(1);
|
||||
}
|
||||
return '0.0';
|
||||
};
|
||||
// 点击获取详情
|
||||
const show_list_click = () => {
|
||||
show_list_state.value = !show_list_state.value;
|
||||
@@ -99,11 +105,10 @@
|
||||
// 跳转到详情
|
||||
const click_list_item = (list_item) => {
|
||||
common.navigateTo(
|
||||
`/pages/courseRecord/courseStudyRecordDetail?stdyId=${list_item.stdyBatch}&crsName=${item.value.crsName}`
|
||||
`/pages/courseRecord/courseStudyRecordDetail?stdyId=${list_item.stdyBatch}&crsName=${item.value.crsName || ''}`
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// 计算两个标准时间的时间差值
|
||||
const formatDuration = (startTm, endTm) => {
|
||||
// 解析时间字符串为时间戳(毫秒)
|
||||
|
||||
Reference in New Issue
Block a user