|
|
@@ -12,9 +12,9 @@
|
|
|
<FamilyTianpanCard
|
|
|
v-if="isLoggedIn"
|
|
|
:visible="isLoggedIn"
|
|
|
- :fortune="dailyFortune || {}"
|
|
|
+ :fortune="dailyFortuneSafe"
|
|
|
:mood="todayMood"
|
|
|
- :dominantElement="dominantElement || ''"
|
|
|
+ :dominantElement="dominantElementSafe"
|
|
|
:weeklyTip="familyWeeklyInsight"
|
|
|
:traditionalData="traditionalData" />
|
|
|
|
|
|
@@ -378,6 +378,14 @@ export default {
|
|
|
}
|
|
|
return '0'
|
|
|
},
|
|
|
+ // WXML 不支持模板内 || {} 字面量,需在 computed 中预先做 fallback
|
|
|
+ dailyFortuneSafe: function() {
|
|
|
+ return this.dailyFortune || {}
|
|
|
+ },
|
|
|
+ // WXML 不支持模板内 || '' 字面量,需在 computed 中预先做 fallback
|
|
|
+ dominantElementSafe: function() {
|
|
|
+ return this.dominantElement || ''
|
|
|
+ },
|
|
|
dailyFortune: function() {
|
|
|
// 优先使用后端接口数据
|
|
|
if (this.dailyFortuneData) {
|