|
@@ -36,6 +36,7 @@ import { useUserStore } from '@/store'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
import Card from '@designer-hub/app/src/components/card.vue'
|
|
|
import ListHelperEvo from '@/components/list-helper-evo.vue'
|
|
|
+// import { formatDuration } from '@designer-hub/app/src/core/utils/common'
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
const { userInfo } = storeToRefs(userStore)
|
|
@@ -69,8 +70,9 @@ const browseRecordCountItems = computed(() => [
|
|
|
{
|
|
|
title: '浏览时长',
|
|
|
subTitle: '本年',
|
|
|
- value: browseRecordCount.value?.duration ?? 0,
|
|
|
- subValue: browseRecordCount.value?.durationYear ?? 0,
|
|
|
+ // 浏览时长 小于60秒,显示秒 大于60秒小于1小时,显示分钟 大于1小时小于1天,显示x小时x分钟 大于1天,显示x天x小时x分钟
|
|
|
+ value: formatDuration(browseRecordCount.value?.duration ?? 0),
|
|
|
+ subValue: formatDuration(browseRecordCount.value?.durationYear ?? 0),
|
|
|
},
|
|
|
{
|
|
|
title: '发圈次数',
|
|
@@ -113,6 +115,19 @@ const toOrderDetails = (it: any) => {
|
|
|
const toArchives = () => {
|
|
|
uni.navigateTo({ url: '/pages/agent/designer/archives/index?id=' + id.value })
|
|
|
}
|
|
|
+const formatDuration = (duration: number) => {
|
|
|
+ if (duration < 60) {
|
|
|
+ return `${duration}秒`
|
|
|
+ } else if (duration < 3600) {
|
|
|
+ return `${Math.floor(duration / 60)}分钟`
|
|
|
+ } else if (duration < 86400) {
|
|
|
+ return `${Math.floor(duration / 3600)}小时${Math.floor((duration % 3600) / 60)}分钟`
|
|
|
+ } else {
|
|
|
+ return `${Math.floor(duration / 86400)}天${Math.floor((duration % 86400) / 3600)}小时${Math.floor(
|
|
|
+ (duration % 3600) / 60,
|
|
|
+ )}分钟`
|
|
|
+ }
|
|
|
+}
|
|
|
onLoad(async (query) => {
|
|
|
id.value = query?.id
|
|
|
await setData()
|