fix: 六爻结果页公历时间只显示到分钟
- 添加formatSolar计算属性格式化公历时间 - 移除秒数显示,只保留年月日时分 - 提升用户体验,时间显示更简洁
This commit is contained in:
1 parent
572b318e97
commit
8442584d4f
1 file changed
+17
-1
@@ -16,7 +16,7 @@
|
||||
<view class="info-row">
|
||||
<view class="info-item">
|
||||
<text class="info-label">公历</text>
|
||||
<text class="info-value">{{ result.solar || '-' }}</text>
|
||||
<text class="info-value">{{ formatSolar }}</text>
|
||||
</view>
|
||||
<view class="info-divider"></view>
|
||||
<view class="info-item">
|
||||
@@ -186,6 +186,22 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
formatSolar() {
|
||||
if (!this.result.solar) return '-'
|
||||
const solar = this.result.solar
|
||||
if (solar.includes(':')) {
|
||||
const parts = solar.split(' ')
|
||||
if (parts.length === 2) {
|
||||
const datePart = parts[0]
|
||||
const timePart = parts[1]
|
||||
const timeParts = timePart.split(':')
|
||||
if (timeParts.length >= 2) {
|
||||
return `${datePart} ${timeParts[0]}:${timeParts[1]}`
|
||||
}
|
||||
}
|
||||
}
|
||||
return solar
|
||||
},
|
||||
liuYaoData() {
|
||||
if (!this.result.benGuaLiuYaoName) return []
|
||||
|
||||
|
||||
Reference in new issue
Block a user