浏览代码

fix: 修复部分已知问题
1.新增 app icon, 修改宝宝的默认头像为 应用图标
2. 修复部分情况下首页数据无法更新的BUG

YuJing 1 月之前
父节点
当前提交
7df13f0d23

二进制
AppScope/resources/base/media/app_icon.png


二进制
AppScope/resources/base/media/background.png


二进制
AppScope/resources/base/media/foreground.png


+ 5 - 5
features/feature/src/main/ets/components/RecipeComp.ets

@@ -14,11 +14,11 @@ export struct RecipeComp {
 
   // 展开食谱弹窗
   async expandRecipe(item: Recipe){
-    item.ingredients = ['南瓜100g', '高铁面粉100g', '高铁面粉100g']
-    item.steps = ['1. 南瓜去皮去籽,切成小块', '2. 上锅蒸15分钟至软烂', '3. 用勺子压成泥状', '4.米粉用温水调成糊状', '5.将南瓜泥与米粉混合均匀']
-    item.description = '富含β-胡萝卜素和膳食纤维,\n' +
-      '有助于宝宝视力发展和消化\n' +
-      '系统健康'
+    // item.ingredients = ['南瓜100g', '高铁面粉100g', '高铁面粉100g']
+    // item.steps = ['1. 南瓜去皮去籽,切成小块', '2. 上锅蒸15分钟至软烂', '3. 用勺子压成泥状', '4.米粉用温水调成糊状', '5.将南瓜泥与米粉混合均匀']
+    // item.description = '富含β-胡萝卜素和膳食纤维,\n' +
+    //   '有助于宝宝视力发展和消化\n' +
+    //   '系统健康'
 
     let param: DiaLogParam = {
       pageEnum: DiaLogPageEnum.RecipePopup,

+ 1 - 1
features/feature/src/main/ets/components/YTDiaLogBuild.ets

@@ -616,7 +616,7 @@ struct  BigWheelManagerBuilder{
           Toggle({ type: ToggleType.Switch ,isOn:$$this.isRepeat})
             .width(38)
             .height(20)
-            .selectedColor('rgba(253, 84, 227, 1)')  //打开状态下的背景颜色
+            .selectedColor('#95C50A')  //打开状态下的背景颜色
             .switchStyle({
               pointRadius: 8, //圆形滑块半径
               trackBorderRadius: 14, //滑轨的圆角

+ 1 - 1
features/feature/src/main/ets/components/YtDatePicker.ets

@@ -48,7 +48,7 @@ export struct YtDatePicker{
           .linearGradient(this.linearInfo)
 
         DatePicker({
-          end: new Date(),
+          // end: new Date(),
           selected: this.selectedDate,
         })
           .selectedTextStyle({

+ 6 - 1
features/feature/src/main/ets/components/bigwheel/BigWheelView.ets

@@ -242,6 +242,9 @@ export struct BigWheelView{
         this.isRepeat = obj.isRepeat ?? this.isRepeat
         this.spinDurationTime = obj.spinDurationTime ?? this.spinDurationTime
         this.spinDuration = obj.spinDuration ?? this.spinDuration
+        if(this.isRepeat) {
+          this.resetTurnTable()
+        }
       }
     })
   }
@@ -379,11 +382,13 @@ export struct BigWheelView{
             .onReady(() => {
               this.drawCircleWithCustomRadii()
             })
-        } .width(this.wheelWidth) // 设置转盘宽度
+        }
+        .width(this.wheelWidth) // 设置转盘宽度
         .height(this.wheelWidth) // 设置转盘高度
         .justifyContent(FlexAlign.Center)
         .rotate({ angle: this.currentAngle }) // 旋转转盘
 
+        // 指针
         Image($r('app.media.zhizheng'))
           .width(63) // 设置按钮宽度
           .height(79) // 设置按钮高度

+ 23 - 10
features/feature/src/main/ets/model/Index.ets

@@ -44,6 +44,13 @@ export class PurchaseList {
 export class Cuisine {
   @Trace id?: number;
   @Trace name?: string;
+
+  constructor(i?: Cuisine) {
+    if (i) {
+      this.id = i.id;
+      this.name = i.name;
+    }
+  }
 }
 
 // 宝宝信息
@@ -102,9 +109,9 @@ export class DayPlan {
 
   constructor(i?: DayPlan) {
     if (i) {
-      this.breakfast = i.breakfast;
-      this.lunch = i.lunch;
-      this.dinner = i.dinner;
+      this.breakfast = new Cuisine(i.breakfast);
+      this.lunch = new Cuisine(i.lunch);
+      this.dinner = new Cuisine(i.dinner);
     } else {
       this.breakfast = new Cuisine();
       this.lunch = new Cuisine();
@@ -135,15 +142,21 @@ export class WeeklyPlanPurchaseList {
     this.wednesday = new DayPlan();
   }
 
+  /**
+   * 浅拷贝
+   * @description: 因为 ObservedV2 直接使用实例化对象进行数据请求会在前面加一个 __ob__。 所以需要进行浅拷贝
+   * @param plan
+   * @returns
+   */
   static clone(plan: WeeklyPlanPurchaseList){
     return {
-      friday: plan.friday,
-      monday: plan.monday,
-      saturday: plan.saturday,
-      sunday: plan.sunday,
-      thursday: plan.thursday,
-      tuesday: plan.tuesday,
-      wednesday: plan.wednesday,
+      friday: JSON.parse(JSON.stringify(plan.friday)),
+      monday: JSON.parse(JSON.stringify(plan.monday)),
+      saturday: JSON.parse(JSON.stringify(plan.saturday)),
+      sunday: JSON.parse(JSON.stringify(plan.sunday)),
+      thursday: JSON.parse(JSON.stringify(plan.thursday)),
+      tuesday: JSON.parse(JSON.stringify(plan.tuesday)),
+      wednesday: JSON.parse(JSON.stringify(plan.wednesday)),
       id: plan.id,
     } as WeeklyPlanPurchaseList
   }

+ 1 - 1
features/feature/src/main/ets/pages/BabyInfoPage.ets

@@ -31,7 +31,7 @@ struct BabyInfoPage {
 
           Row(){
             Row({space: 16}){
-              Image(this.vm.babyInfo.avatarUrl ?? $r('app.media.default_img'))
+              Image(this.vm.babyInfo.avatarUrl ?? $r('app.media.app_icon'))
                 .width(60)
                 .aspectRatio(1)
                 .borderRadius(14)

+ 1 - 1
features/feature/src/main/ets/view/MainView.ets

@@ -81,7 +81,7 @@ export struct MainView {
 
             // 头像
             Row(){
-              Image(this.vm.babyInfo.avatarUrl)
+              Image(this.vm.babyInfo.avatarUrl ?? $r('app.media.app_icon'))
                 .width("100%")
                 .borderRadius(14)
                 .aspectRatio(1)

+ 3 - 3
features/user/src/main/ets/views/Mine.ets

@@ -167,9 +167,9 @@ export struct Mine {
       const data = new systemShare.SharedData({
         // utd: uniformTypeDescriptor.UniformDataType.HYPERLINK,
         utd: uniformTypeDescriptor.UniformDataType.TEXT,
-        title: '盒小仓',
-        content: 'http://appgallery.huawei.com/app/detail?id=6917580461832049757',
-        description: "http://appgallery.huawei.com/app/detail?id=6917580461832049757"
+        title: '萌食记',
+        content: 'http://appgallery.huawei.com/app/detail?id=6917584355003564036',
+        description: "http://appgallery.huawei.com/app/detail?id=6917584355003564036"
       })
       const controller = new systemShare.ShareController(data)
       const context = this.getUIContext().getHostContext()! as common.UIAbilityContext;

二进制
products/entry/src/main/resources/base/media/startIcon.png