diff --git a/src/pages/feed-plan/index.vue b/src/pages/feed-plan/index.vue index e6620f7..b438ac5 100644 --- a/src/pages/feed-plan/index.vue +++ b/src/pages/feed-plan/index.vue @@ -2,6 +2,9 @@ import avator from '@/static/image/pet-parameters/avator.png' import addBtn from '@/static/image/pet-plan/add_btn.png' import card from '@/static/image/pet-plan/card.png' +import editBtn from '@/static/image/pet-plan/edit.png' +import miniGoods from '@/static/image/pet-plan/mini_goods.png' +import nutritionGoods from '@/static/image/pet-plan/nutrition_goods.png' import userAddBtn from '@/static/image/pet-plan/user_add_btn.png' import ToolApi from '@/utils' @@ -10,13 +13,26 @@ interface User { image: string label: string[] isClick: boolean + plan: { image: string, name: string, weight: string, energy: string, label: string[] }[] } const titleName = ref('喂养计划') const safeHeight = ToolApi.getSafeHeight() +// 用户存在情况 const userList = ref([ - { name: '子龙', image: avator, label: ['1岁', '孟加拉豹猫', '8kg'], isClick: true }, - { name: '广坤', image: avator, label: ['1岁', '孟加拉豹猫', '8kg'], isClick: false }, + { name: '子龙', image: avator, label: ['1岁', '孟加拉豹猫', '8kg'], plan: [ + { image: miniGoods, name: 'MINI主食包', weight: '500', energy: '1200kcal', label: ['湿粮', '呵护肠胃'] }, + { image: nutritionGoods, name: '营养加焙烘焙粮', weight: '500', energy: '1200kcal', label: ['湿粮', '呵护肠胃'] }, + ], isClick: true }, + { name: '广坤', image: avator, label: ['12岁', '孟加拉豹猫', '8kg'], plan: [ + { image: miniGoods, name: 'MINI主食包', weight: '600', energy: '1300kcal', label: ['湿粮', '呵护肠胃'] }, + { image: nutritionGoods, name: '营养加焙烘焙粮', weight: '1000', energy: '1300kcal', label: ['湿粮', '呵护肠胃'] }, + ], isClick: false }, ]) +// 用户不存在情况 +// const userList = ref([]) +const clickUser = computed(() => { + return userList.value.filter(user => user.isClick === true) +}) function resetUserClick() { userList.value.forEach(i => (i.isClick = false)) } @@ -24,13 +40,16 @@ function handleUser(index: number) { resetUserClick() userList.value[index].isClick = true } +function handleEdit() { + console.log('edit') +}