道具卡显示使用时间精确到时分秒
This commit is contained in:
parent
d49a3840a2
commit
5b286d7e8a
@ -308,7 +308,7 @@
|
||||
<view class="card-info">
|
||||
<text class="card-name">{{ item.name || item.title || '道具卡' }}</text>
|
||||
<text class="card-desc">{{ item.description || item.rules || '可在抽奖时使用' }}</text>
|
||||
<text class="card-use-time" v-if="itemCardsTab === 1 && item.used_at">使用时间:{{ formatDate(item.used_at) }}</text>
|
||||
<text class="card-use-time" v-if="itemCardsTab === 1 && item.used_at">使用时间:{{ formatDateTimeSeconds(item.used_at) }}</text>
|
||||
</view>
|
||||
<view class="card-count-badge" v-if="itemCardsTab === 0">
|
||||
<text class="count-num">×{{ item.remaining ?? item.count ?? 1 }}</text>
|
||||
@ -925,6 +925,12 @@ export default {
|
||||
if (!d) return ''
|
||||
|
||||
return `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,'0')}-${String(d.getDate()).padStart(2,'0')} ${String(d.getHours()).padStart(2,'0')}:${String(d.getMinutes()).padStart(2,'0')}`
|
||||
},
|
||||
formatDateTimeSeconds(ts) {
|
||||
const d = this.toDate(ts)
|
||||
if (!d) return ''
|
||||
|
||||
return `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,'0')}-${String(d.getDate()).padStart(2,'0')} ${String(d.getHours()).padStart(2,'0')}:${String(d.getMinutes()).padStart(2,'0')}:${String(d.getSeconds()).padStart(2,'0')}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user