feat:新增喂养计划页面 #13

Merged
ilhamtahir merged 1 commits from feature/6-petplan into main 2024-12-25 07:44:05 +08:00
+11 -6
View File
@@ -40,8 +40,11 @@ function handleUser(index: number) {
resetUserClick() resetUserClick()
userList.value[index].isClick = true userList.value[index].isClick = true
} }
function handleAdd() {
uni.navigateTo({ url: '/pages/start-filing/index' })
}
function handleEdit() { function handleEdit() {
console.log('edit') uni.navigateTo({ url: '/pages/feed-calculator/index' })
} }
</script> </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"> <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" /> <image :src="card" class="w-full h-full absolute z-20" />
<view class="z-20 absolute w-full mt-[35px] flex flex-col"> <view class="z-20 absolute w-full mt-[35px] flex flex-col">
<image :src="addBtn" class="w-[47px] h-[47px] mx-auto" /> <image :src="addBtn" class="w-[47px] h-[47px] mx-auto" @click="handleAdd" />
<text class="text-[12px] text-[#D9D9D9] mx-auto mt-[6px]"> <text class="text-[12px] text-[#D9D9D9] mx-auto mt-[6px]" @click="handleAdd">
添加你的喂养计划 添加你的喂养计划
</text> </text>
</view> </view>
@@ -63,7 +66,7 @@ function handleEdit() {
编辑计划 编辑计划
</text> </text>
</view> </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>
<!-- 喂养计划已注册 --> <!-- 喂养计划已注册 -->
<view v-else> <view v-else>
@@ -72,7 +75,7 @@ function handleEdit() {
<text>{{ item.name }}</text> <text>{{ item.name }}</text>
<view v-if="item.isClick" class="w-[16px] h-[3px] bg-[#4545E5]" /> <view v-if="item.isClick" class="w-[16px] h-[3px] bg-[#4545E5]" />
</view> </view>
<image :src="userAddBtn" class="w-[24px] h-[24px]" /> <image :src="userAddBtn" class="w-[24px] h-[24px]" @tap="handleAdd" />
</view> </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"> <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 FEEDING PLAN
</text> </text>
</view> </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]" /> <image :src="item.image" class="w-[80px] h-[80px]" />
<view class="ml-[12px] mt-[10px] flex-1"> <view class="ml-[12px] mt-[10px] flex-1">
<text class="font-600"> <text class="font-600">