|
@@ -183,13 +183,13 @@ const store = new Vuex.Store({
|
|
|
updateChildren({ commit }, children) {
|
|
updateChildren({ commit }, children) {
|
|
|
commit('setChildren', children)
|
|
commit('setChildren', children)
|
|
|
},
|
|
},
|
|
|
- // 切换孩子前检查家庭中是否有孩子成员
|
|
|
|
|
|
|
+ // 兼容旧 action:切换成员前检查(effectiveRole 年龄语义保留,用于过滤未成年成员)
|
|
|
switchToChildWithCheck({ commit }, { memberId, members }) {
|
|
switchToChildWithCheck({ commit }, { memberId, members }) {
|
|
|
var hasChildren = members && members.some(function(m) {
|
|
var hasChildren = members && members.some(function(m) {
|
|
|
return m.effectiveRole === 'child'
|
|
return m.effectiveRole === 'child'
|
|
|
})
|
|
})
|
|
|
if (!hasChildren) {
|
|
if (!hasChildren) {
|
|
|
- uni.showToast({ title: '家庭中暂无孩子', icon: 'none' })
|
|
|
|
|
|
|
+ uni.showToast({ title: '家庭中暂无可切换的未成年成员', icon: 'none' })
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
commit('switchToChild', memberId)
|
|
commit('switchToChild', memberId)
|