Jelajahi Sumber

feat :1.橙宝日志 喂养记录得页面新增。

suwenjiang 1 Minggu lalu
induk
melakukan
a83e49fe84

+ 0 - 103
src/pages/babyInfo/babyInfo.vue

@@ -1,103 +0,0 @@
-<!-- 使用 type="home" 属性设置首页,其他页面不需要设置,默认为page;推荐使用json5,更强大,且允许注释 -->
-<route lang="json5" type="babyInfo">
-{
-  style: {
-    navigationStyle: 'default',
-    navigationBarTitleText: '%my.babyInfo%',
-  },
-}
-</route>
-<template>
-  <view class="min-h-screen bg-white">
-    <!-- 顶部导航栏 -->
-    <view class="fixed top-0 left-0 w-full bg-white border-b border-gray-100 z-50">
-      <view class="flex items-center justify-between px-4 h-12">
-        <text class="text-sm text-blue-500">编辑</text>
-      </view>
-    </view>
-
-    <!-- 主要内容区域 -->
-    <view class="pt-14 pb-4 px-4">
-      <!-- 头像区域 -->
-      <view class="flex justify-center mt-6 mb-8 relative">
-        <view
-          class="relative w-20 h-20 rounded-full bg-blue-50 flex items-center justify-center overflow-hidden"
-        >
-          <image :src="babyAvatarUrl" alt="宝宝头像" class="w-full h-full object-cover" />
-          <view
-            class="absolute bottom-0 right-0 w-6 h-6 bg-blue-500 rounded-full flex items-center justify-center"
-          >
-            <icon class="fas fa-camera text-white text-xs"></icon>
-          </view>
-        </view>
-      </view>
-
-      <!-- 信息列表 -->
-      <view class="space-y-4">
-        <view class="info-item">
-          <text class="info-label">宝宝昵称</text>
-          <text class="info-value">小星星</text>
-        </view>
-
-        <view class="info-item">
-          <text class="info-label">宝宝性别</text>
-          <text class="info-value">男孩</text>
-        </view>
-
-        <view class="info-item">
-          <text class="info-label">宝宝生日</text>
-          <text class="info-value">2023年3月4日</text>
-        </view>
-
-        <view class="info-item">
-          <text class="info-label">宝宝血型</text>
-          <text class="info-value text-gray-400">未填写</text>
-        </view>
-
-        <view class="info-item">
-          <text class="info-label">宝宝二维码</text>
-          <icon class="fas fa-chevron-right text-gray-400"></icon>
-        </view>
-      </view>
-    </view>
-  </view>
-</template>
-
-<script setup>
-  import { ref } from 'vue'
-  import { onLoad } from '@dcloudio/uni-app'
-  const babyAvatarUrl = ref(
-    'https://ai-public.mastergo.com/ai/img_res/8a91ddc9c5fd46352c7b33ff40870fb7.jpg',
-  )
-
-  const show = ref(false)
-  onLoad(({ id }) => {
-    if (id) {
-      //请求宝宝得参数
-      show.value = true
-    } else {
-      //没有宝宝参数
-      show.value = false
-    }
-  })
-</script>
-
-<style scoped>
-  .info-item {
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    padding: 14px 0;
-    border-bottom: 1px solid #f0f0f0;
-  }
-
-  .info-label {
-    font-size: 15px;
-    color: #333333;
-  }
-
-  .info-value {
-    font-size: 15px;
-    color: #666666;
-  }
-</style>

+ 5 - 4
src/pages/feed-statistics/feed-statistics.vue

@@ -18,10 +18,11 @@
       :safeAreaInsetTop="true"
       @click-left="handleClickLeft"
     ></wd-navbar>
-
+    <!-- :swipeable="true"   :slidable-num="4"-->
     <wd-tabs
       style="--wot-tabs-nav-height: 96rpx"
-      :swipeable="true"
+      sticky
+      slidable="auto"
       v-model="tabIndex"
       color="#F88842"
       @change="changeIndex"
@@ -31,7 +32,7 @@
         <wd-tab :title="item.title">
           <REcharts :id="echartsItem.id + index" :seriesData="echartsItem?.seriesData" :unit="unit">
             <template #default>
-              <view class="absolute right-4 top-7 z-[10] text-xs text-[#333]">
+              <view class="absolute right-4 top-7 text-xs text-[#333]">
                 <template v-if="handleColumns(echartsItem?.columns)">
                   <SwitchBtn
                     v-model:show="show"
@@ -542,8 +543,8 @@
 
   // tabs 切换
   function changeIndex({ index, name }) {
-    handleSwitch(index)
     tabIndex.value = index
+    handleSwitch(index)
   }
 
   // 图表的切换

+ 1 - 1
src/pages/feed/feed.vue

@@ -164,7 +164,7 @@
     },
   ])
 
-  const showCalendar = ref(false)
+  const showCalendar = ref(true)
   const showPopup = ref(false)
 
   const dataList = ref()

+ 1 - 0
src/pages/growth/growth.vue

@@ -22,6 +22,7 @@
     <wd-tabs
       style="--wot-tabs-nav-height: 96rpx"
       :swipeable="true"
+      sticky
       v-model="tabIndex"
       color="#F88842"
       @change="changeIndex"

+ 46 - 28
src/pages/index/index.vue

@@ -9,15 +9,21 @@
 }
 </route>
 <template>
-  <view class="bg-white overflow-hidden pb-tab" :style="{ marginTop: safeAreaInsets?.top + 'px' }">
-    <view class="min-h-screen bg-white">
-      <view class="max-w-lg mx-auto p-4">
+  <view class="bg-white min-h-screen relative">
+    <view class="w-full h-[220rpx] absolute top-0 left-0">
+      <image class="w-full h-full object-cover" :src="bg" mode="widthFix" />
+    </view>
+    <view
+      class="absolute top-0 left-0 bg-transparent"
+      :style="{ marginTop: safeAreaInsets?.top + 'px' }"
+    >
+      <view class="max-w-lg mx-auto p-4 bg-transparent">
         <view class="h-[220rpx] mb-[32rpx]">
           <view class="flex justify-end items-center h-[88rpx]">
             <view
               v-show="childrenList.length > 1"
               @click="showChildren = !showChildren"
-              class="text-sm flex justify-center items-center px-4 py-1 text-orange-500 border-[2rpx] border-solid border-orange-500 rounded-full whitespace-nowrap"
+              class="text-sm flex justify-center items-center px-4 py-1 text-orange-500 bg-white/[0.6] rounded-full whitespace-nowrap"
             >
               <wd-icon
                 name="translate-bold"
@@ -31,13 +37,19 @@
           <view class="flex items-center gap-3">
             <img :src="avatarUrl" class="w-16 h-16 rounded-full object-cover" alt="Baby Avatar" />
             <view v-if="childrenInfo">
-              <view class="text-xl font-semibold">
+              <view class="text-base font-semibold">
                 {{ childrenInfo.name }}
+                <image
+                  @click="goToBabyInfo(childrenInfo.id)"
+                  class="w-[28rpx] h-[28rpx] ml-2"
+                  :src="edit"
+                  mode="widthFix"
+                />
               </view>
               <view class="text-gray-600 text-sm">{{ childrenInfo.old }}</view>
             </view>
             <view v-else>
-              <text class="text-xl font-semibold text-[#333]">暂无宝宝,请立即添加</text>
+              <text class="text-sm font-semibold text-[#333]">暂无宝宝,请立即添加</text>
             </view>
           </view>
         </view>
@@ -107,7 +119,13 @@
       </view>
     </view>
   </view>
-  <wd-action-sheet v-model="showChildren" class="text-xl" title="选择宝宝" @close="close">
+  <wd-action-sheet
+    safe-area-inset-bottom
+    v-model="showChildren"
+    class="text-xl"
+    title="选择宝宝"
+    @close="close"
+  >
     <wd-cell-group border>
       <wd-cell
         size="large"
@@ -141,6 +159,8 @@
   import baby02 from '@img/index/baby-02.svg'
   import baby03 from '@img/index/baby-03.svg'
   import baby04 from '@img/index/baby-04.svg'
+  import edit from '@img/index/edit.svg'
+  import bg from '@img/index/bg.svg'
   import HeightItem from '@/components/height/height-item.vue'
 
   import { useMessage, useToast } from 'wot-design-uni'
@@ -157,7 +177,7 @@
 
   const inform = ref('')
   const childrenInfo = ref({
-    id: '0',
+    id: '1',
     name: '小奥特曼',
     old: '2岁3个月4天',
   })
@@ -224,6 +244,13 @@
   // 获取屏幕边界到安全区域距离
   const { safeAreaInsets } = uni.getSystemInfoSync()
 
+  // 前往宝宝信息页面
+  function goToBabyInfo(id = '') {
+    uni.navigateTo({
+      url: `/pages/myUser/component/babyInformation?id=${id}`,
+    })
+  }
+
   // 暂无宝宝数据
   function withButtonProps() {
     message
@@ -232,19 +259,17 @@
         title: '暂无宝宝数据',
         confirmButtonText: '前往添加',
 
-        cancelButtonProps: {
-          // type: 'error',
-          customClass: 'custom-shadow',
-        },
-        confirmButtonProps: {
-          // type: 'success',
-          customClass: 'custom-shadow',
-        },
+        // cancelButtonProps: {
+        //   // type: 'error',
+        //   customClass: 'custom-shadow',
+        // },
+        // confirmButtonProps: {
+        // type: 'primary',
+        // customClass: 'custom-shadow',
+        // },
       })
       .then(() => {
-        uni.navigateTo({
-          url: '/pages/babyInfo/babyInfo',
-        })
+        goToBabyInfo()
       })
       .catch(() => {})
   }
@@ -349,14 +374,7 @@
     color: #262626;
   }
 
-  :deep() {
-    .wd-message-box {
-      .custom-shadow {
-        box-shadow:
-          0 3px 1px -2px rgb(0 0 0 / 20%),
-          0 2px 2px 0 rgb(0 0 0 / 14%),
-          0 1px 5px 0 rgb(0 0 0 / 12%);
-      }
-    }
+  ::v-deep .wd-button.is-primary {
+    background: linear-gradient(270deg, #f88842 0%, #ffac78 100%);
   }
 </style>

+ 1 - 1
src/static/images/index/baby-01.svg

@@ -2,7 +2,7 @@
 <rect width="48" height="48" rx="12" fill="#A3D4FF" fill-opacity="0.6"/>
 <path d="M24.0994 29.0646C21.0198 29.0646 18.1264 27.2594 16.4671 29.5913C15.4043 31.0866 14.7803 32.9141 14.7803 34.8906C14.7803 39.9436 18.8772 44.0416 23.9302 44.0416C28.9832 44.0416 33.0822 39.9436 33.0822 34.8906C33.0822 33.1214 32.582 31.4716 31.7138 30.0724C30.0989 27.4719 27.3863 29.0646 24.0994 29.0646ZM23.9693 40.5327C20.2489 40.5327 17.2328 37.5165 17.2328 33.795C17.2328 32.3991 17.6568 31.1036 18.3834 30.0301C19.5943 28.2376 21.2673 30.2068 23.5928 30.2068C26.0495 30.2068 28.5771 28.373 29.7531 30.3368C30.359 31.3468 30.7091 32.5291 30.7091 33.795C30.7091 37.5176 27.6919 40.5327 23.9704 40.5327H23.9693Z" fill="#FFFDED"/>
 <path d="M38.8554 21.007C38.8554 24.2019 32.1727 26.795 23.9302 26.795C15.6877 26.795 9.00608 24.2019 9.00608 21.007C9.00608 17.8122 15.6887 15.2212 23.9302 15.2212C32.1717 15.2212 38.8554 17.8111 38.8554 21.007Z" fill="#FFFDED"/>
-<path d="M34.0827 21.8678C34.0827 24.1511 29.5373 25.9986 23.9291 25.9986C18.321 25.9986 13.7746 24.15 13.7746 21.8678C13.7746 19.5857 18.3231 17.7371 23.9291 17.7371C29.5352 17.7371 34.0827 19.5878 34.0827 21.8678Z" fill="#F88842"/>
+<path d="M34.0827 21.8678C34.0827 24.1511 29.5373 25.9986 23.9291 25.9986C18.321 25.9986 13.7746 24.15 13.7746 21.8678C13.7746 19.5857 18.3231 17.7371 23.9291 17.7371C29.5352 17.7371 34.0827 19.5878 34.0827 21.8678Z" fill="#68BAFF"/>
 <path d="M9.00608 22.4421C9.00608 25.638 15.6887 28.2301 23.9302 28.2301C32.1717 28.2301 38.8554 25.638 38.8554 22.4421V25.6433C38.8554 28.8392 32.1727 31.4292 23.9302 31.4292C15.6877 31.4292 9.00608 28.8392 9.00608 25.6433" fill="#FFFDED"/>
 <path d="M23.9291 25.305C29.7414 25.305 33.7749 24.1924 33.5275 20.7353C33.2017 16.1635 27.2594 15.0541 27.2594 13.2246C27.2594 12.1797 27.7828 10.8091 27.7828 9.37193C27.7828 7.93472 26.867 4.40991 23.9291 4.40991C20.9913 4.40991 20.0786 7.93684 20.0786 9.37193C20.0786 10.807 20.6021 12.1797 20.6021 13.2246C20.6021 15.0541 14.6587 16.1624 14.3329 20.7353C14.0855 24.1924 18.119 25.305 23.9291 25.305Z" fill="#E1F1FF"/>
 <path opacity="0.5" d="M26.0654 7.15331C26.0654 7.77303 25.5631 8.27643 24.9433 8.27643C24.3236 8.27643 23.8192 7.77303 23.8192 7.15331C23.8192 6.53359 24.3226 6.03125 24.9433 6.03125C25.5641 6.03125 26.0654 6.53253 26.0654 7.15331Z" fill="#FFFDED"/>

+ 22 - 0
src/static/images/index/bg.svg

@@ -0,0 +1,22 @@
+<svg width="375" height="154" viewBox="0 0 375 154" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_971_13039)">
+<rect width="375" height="154" fill="white"/>
+<rect width="375" height="154" fill="url(#paint0_radial_971_13039)" fill-opacity="0.6"/>
+<foreignObject x="-40" y="-40" width="455" height="234"><div xmlns="http://www.w3.org/1999/xhtml" style="backdrop-filter:blur(20px);clip-path:url(#bgblur_1_971_13039_clip_path);height:100%;width:100%"></div></foreignObject><rect data-figma-bg-blur-radius="40" width="375" height="154" fill="url(#paint1_linear_971_13039)"/>
+</g>
+<defs>
+<clipPath id="bgblur_1_971_13039_clip_path" transform="translate(40 40)"><rect width="375" height="154"/>
+</clipPath><radialGradient id="paint0_radial_971_13039" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(35.5 95.7688) rotate(-11.6129) scale(346.595 230.97)">
+<stop stop-color="#F88842"/>
+<stop offset="0.445" stop-color="#F88842" stop-opacity="0.4"/>
+<stop offset="1" stop-color="#FFAC78"/>
+</radialGradient>
+<linearGradient id="paint1_linear_971_13039" x1="187.5" y1="0" x2="187.5" y2="154" gradientUnits="userSpaceOnUse">
+<stop stop-color="white" stop-opacity="0"/>
+<stop offset="1" stop-color="white"/>
+</linearGradient>
+<clipPath id="clip0_971_13039">
+<rect width="375" height="154" fill="white"/>
+</clipPath>
+</defs>
+</svg>

+ 3 - 0
src/static/images/index/edit.svg

@@ -0,0 +1,3 @@
+<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M1.75 7.43754C1.74996 7.37746 1.76229 7.31803 1.78623 7.26293C1.81017 7.20783 1.84519 7.15826 1.88912 7.11729L8.45163 0.992286C8.53456 0.914824 8.64435 0.872618 8.75781 0.874577C8.87128 0.876536 8.97954 0.922507 9.05975 1.00279L11.6847 3.62779C11.7264 3.66936 11.7592 3.71889 11.7812 3.77343C11.8032 3.82797 11.814 3.88639 11.813 3.9452C11.8119 4.00402 11.799 4.06201 11.775 4.11572C11.751 4.16943 11.7165 4.21774 11.6734 4.25779L5.11088 10.3828C5.02983 10.4582 4.92321 10.5001 4.8125 10.5H2.1875C2.07147 10.5 1.96019 10.4539 1.87814 10.3719C1.79609 10.2898 1.75 10.1786 1.75 10.0625V7.43754ZM2.625 7.62741V9.62504H4.64013L10.745 3.92704L8.7395 1.92066L2.625 7.62741ZM0.875 12.6875V11.8125H13.125V12.6875H0.875Z" fill="#999999" stroke="#999999" stroke-width="0.2"/>
+</svg>