fix:修复margin-top引起的背景颜色失效问题,增加添加、修改的交互逻辑

This commit was merged in pull request #13.
This commit is contained in:
zlong committed 2024-12-23 10:29:46 +08:00
1 parent 8b3ee05f80
commit 26f539abc9
1 file changed
+11 -6
+11 -6
View File
@@ -40,8 +40,11 @@ function handleUser(index: number) {
resetUserClick()
userList.value[index].isClick = true
}
function handleAdd() {
uni.navigateTo({ url: '/pages/start-filing/index' })
}
function handleEdit() {
console.log('edit')
uni.navigateTo({ url: '/pages/feed-calculator/index' })
}
</script>
@@ -52,8 +55,8 @@ function handleEdit() {
<view v-if="userList.length === 0" class="w-[calc(100% - 32px)] min-h-[135px] rounded-lg m-[16px] relative">
<image :src="card" class="w-full h-full absolute z-20" />
<view class="z-20 absolute w-full mt-[35px] flex flex-col">
<image :src="addBtn" class="w-[47px] h-[47px] mx-auto" />
<text class="text-[12px] text-[#D9D9D9] mx-auto mt-[6px]">
<image :src="addBtn" class="w-[47px] h-[47px] mx-auto" @click="handleAdd" />
<text class="text-[12px] text-[#D9D9D9] mx-auto mt-[6px]" @click="handleAdd">
添加你的喂养计划
</text>
</view>
@@ -63,7 +66,7 @@ function handleEdit() {
编辑计划
</text>
</view>
<view class="absolute right-0 top-0 w-[78px] h-[24px] z-20" @tap="handleEdit" />
<view class="absolute right-0 top-0 w-[78px] h-[24px] z-20" @tap="handleAdd" />
</view>
<!-- 喂养计划已注册 -->
<view v-else>
@@ -72,7 +75,7 @@ function handleEdit() {
<text>{{ item.name }}</text>
<view v-if="item.isClick" class="w-[16px] h-[3px] bg-[#4545E5]" />
</view>
<image :src="userAddBtn" class="w-[24px] h-[24px]" />
<image :src="userAddBtn" class="w-[24px] h-[24px]" @tap="handleAdd" />
</view>
<view v-for="(item, index) in clickUser" :key="index" class="w-[calc(100% - 32px)] min-h-[129px] rounded-lg m-[16px] relative bg-[white] p-[16px] flex items-center">
@@ -101,7 +104,9 @@ function handleEdit() {
FEEDING PLAN
</text>
</view>
<view v-for="(item, index) in clickUser[0].plan" :key="index" class="bg-[white] w-full mt-3 pl-[10px] pr-[20px] flex " :class="[clickUser[0].plan.length - 1 === index ? 'rounded-b-lg' : 'plan_card_bottom']">
</view>
<view class="absolute z-20 w-full rounded-lg bg-[white] top-[30px]">
<view v-for="(item, index) in clickUser[0].plan" :key="index" class="w-full mt-3 pl-[10px] pr-[20px] flex " :class="[clickUser[0].plan.length - 1 === index ? 'rounded-b-lg' : 'plan_card_bottom']">
<image :src="item.image" class="w-[80px] h-[80px]" />
<view class="ml-[12px] mt-[10px] flex-1">
<text class="font-600">