XUYangWei 2 months ago
parent
commit
af0a39d1fe
100 changed files with 408 additions and 2197 deletions
  1. 1 1
      AppScope/app.json5
  2. 1 1
      AppScope/resources/base/element/string.json
  3. BIN
      AppScope/resources/base/media/background.png
  4. BIN
      AppScope/resources/base/media/foreground.png
  5. 3 3
      build-profile.json5
  6. 2 1
      commons/basic/Index.ets
  7. 2 1
      commons/basic/src/main/ets/apis/YTRequest.ets
  8. 7 0
      commons/basic/src/main/ets/apis/YTUserRequest.ets
  9. 33 4
      commons/basic/src/main/ets/components/generalComp/AgreePrivacy.ets
  10. 1 0
      commons/basic/src/main/ets/components/generalComp/YtDoubleConfirm.ets
  11. 0 44
      commons/basic/src/main/ets/models/index.ets
  12. 16 0
      commons/basic/src/main/ets/utils/VibrationUtils.ets
  13. 0 4
      commons/basic/src/main/ets/utils/YTRouter.ets
  14. 0 95
      features/feature/src/main/ets/utils/Sector.ets
  15. 0 816
      features/feature/src/main/ets/view/BigWheelView.ets
  16. 0 132
      features/feature/src/main/ets/view/EatWhatView.ets
  17. 13 0
      features/feature/src/main/ets/view/FragranceView.ets
  18. 280 82
      features/feature/src/main/ets/view/MainView.ets
  19. 0 411
      features/feature/src/main/ets/view/RanNumberView.ets
  20. 0 257
      features/feature/src/main/ets/view/RollDiceView.ets
  21. 0 292
      features/feature/src/main/ets/view/TossCoinView.ets
  22. BIN
      features/feature/src/main/resources/base/media/103.png
  23. BIN
      features/feature/src/main/resources/base/media/104.png
  24. BIN
      features/feature/src/main/resources/base/media/105.png
  25. BIN
      features/feature/src/main/resources/base/media/106.png
  26. BIN
      features/feature/src/main/resources/base/media/107.png
  27. BIN
      features/feature/src/main/resources/base/media/108.png
  28. BIN
      features/feature/src/main/resources/base/media/109.png
  29. BIN
      features/feature/src/main/resources/base/media/110.png
  30. BIN
      features/feature/src/main/resources/base/media/114.png
  31. BIN
      features/feature/src/main/resources/base/media/115.png
  32. BIN
      features/feature/src/main/resources/base/media/beizi_1.png
  33. BIN
      features/feature/src/main/resources/base/media/beizi_10.png
  34. BIN
      features/feature/src/main/resources/base/media/beizi_11.png
  35. BIN
      features/feature/src/main/resources/base/media/beizi_12.png
  36. BIN
      features/feature/src/main/resources/base/media/beizi_13.png
  37. BIN
      features/feature/src/main/resources/base/media/beizi_14.png
  38. BIN
      features/feature/src/main/resources/base/media/beizi_15.png
  39. BIN
      features/feature/src/main/resources/base/media/beizi_16.png
  40. BIN
      features/feature/src/main/resources/base/media/beizi_17.png
  41. BIN
      features/feature/src/main/resources/base/media/beizi_18.png
  42. BIN
      features/feature/src/main/resources/base/media/beizi_19.png
  43. BIN
      features/feature/src/main/resources/base/media/beizi_2.png
  44. BIN
      features/feature/src/main/resources/base/media/beizi_20.png
  45. BIN
      features/feature/src/main/resources/base/media/beizi_21.png
  46. BIN
      features/feature/src/main/resources/base/media/beizi_22.png
  47. BIN
      features/feature/src/main/resources/base/media/beizi_23.png
  48. BIN
      features/feature/src/main/resources/base/media/beizi_24.png
  49. BIN
      features/feature/src/main/resources/base/media/beizi_25.png
  50. BIN
      features/feature/src/main/resources/base/media/beizi_26.png
  51. BIN
      features/feature/src/main/resources/base/media/beizi_27.png
  52. BIN
      features/feature/src/main/resources/base/media/beizi_28.png
  53. BIN
      features/feature/src/main/resources/base/media/beizi_29.png
  54. BIN
      features/feature/src/main/resources/base/media/beizi_3.png
  55. BIN
      features/feature/src/main/resources/base/media/beizi_30.png
  56. BIN
      features/feature/src/main/resources/base/media/beizi_31.png
  57. BIN
      features/feature/src/main/resources/base/media/beizi_32.png
  58. BIN
      features/feature/src/main/resources/base/media/beizi_33.png
  59. BIN
      features/feature/src/main/resources/base/media/beizi_34.png
  60. BIN
      features/feature/src/main/resources/base/media/beizi_35.png
  61. BIN
      features/feature/src/main/resources/base/media/beizi_36.png
  62. BIN
      features/feature/src/main/resources/base/media/beizi_37.png
  63. BIN
      features/feature/src/main/resources/base/media/beizi_38.png
  64. BIN
      features/feature/src/main/resources/base/media/beizi_39.png
  65. BIN
      features/feature/src/main/resources/base/media/beizi_4.png
  66. BIN
      features/feature/src/main/resources/base/media/beizi_40.png
  67. BIN
      features/feature/src/main/resources/base/media/beizi_41.png
  68. BIN
      features/feature/src/main/resources/base/media/beizi_42.png
  69. BIN
      features/feature/src/main/resources/base/media/beizi_43.png
  70. BIN
      features/feature/src/main/resources/base/media/beizi_44.png
  71. BIN
      features/feature/src/main/resources/base/media/beizi_45.png
  72. BIN
      features/feature/src/main/resources/base/media/beizi_46.png
  73. BIN
      features/feature/src/main/resources/base/media/beizi_47.png
  74. BIN
      features/feature/src/main/resources/base/media/beizi_48.png
  75. BIN
      features/feature/src/main/resources/base/media/beizi_49.png
  76. BIN
      features/feature/src/main/resources/base/media/beizi_5.png
  77. BIN
      features/feature/src/main/resources/base/media/beizi_50.png
  78. BIN
      features/feature/src/main/resources/base/media/beizi_51.png
  79. BIN
      features/feature/src/main/resources/base/media/beizi_52.png
  80. BIN
      features/feature/src/main/resources/base/media/beizi_53.png
  81. BIN
      features/feature/src/main/resources/base/media/beizi_54.png
  82. BIN
      features/feature/src/main/resources/base/media/beizi_55.png
  83. BIN
      features/feature/src/main/resources/base/media/beizi_56.png
  84. BIN
      features/feature/src/main/resources/base/media/beizi_57.png
  85. BIN
      features/feature/src/main/resources/base/media/beizi_58.png
  86. BIN
      features/feature/src/main/resources/base/media/beizi_6.png
  87. BIN
      features/feature/src/main/resources/base/media/beizi_7.png
  88. BIN
      features/feature/src/main/resources/base/media/beizi_8.png
  89. BIN
      features/feature/src/main/resources/base/media/beizi_9.png
  90. BIN
      features/feature/src/main/resources/base/media/muyu.png
  91. 1 25
      features/feature/src/main/resources/base/profile/router_map.json
  92. 3 3
      features/user/src/main/ets/components/LoginInput.ets
  93. 3 3
      features/user/src/main/ets/components/Terms.ets
  94. 1 1
      features/user/src/main/ets/pages/LoginPage.ets
  95. 1 1
      features/user/src/main/ets/pages/Privacy.ets
  96. 10 10
      features/user/src/main/ets/pages/SettingPage.ets
  97. 1 1
      features/user/src/main/ets/pages/SuggestionPage.ets
  98. 1 1
      features/user/src/main/ets/pages/UserAgreement.ets
  99. 15 5
      features/user/src/main/ets/views/LoginView.ets
  100. 13 3
      features/user/src/main/ets/views/RegisterOrResetPassView.ets

+ 1 - 1
AppScope/app.json5

@@ -1,6 +1,6 @@
 {
   "app": {
-    "bundleName": "com.ytpm.ytxjd",
+    "bundleName": "com.ytpm.jxmy",
     "vendor": "example",
     "versionCode": 1000000,
     "versionName": "1.0.0",

+ 1 - 1
AppScope/resources/base/element/string.json

@@ -2,7 +2,7 @@
   "string": [
     {
       "name": "app_name",
-      "value": "樱桃小决定"
+      "value": "静心木鱼"
     }
   ]
 }

BIN
AppScope/resources/base/media/background.png


BIN
AppScope/resources/base/media/foreground.png


+ 3 - 3
build-profile.json5

@@ -5,11 +5,11 @@
         "name": "default",
         "material": {
           "storeFile": "sign/basic.p12",
-          "storePassword": "000000187CD06458091FA47389D48BC101B8367DE23AB9D60937F522FB6EFC874B3CCBF3CF140A50",
+          "storePassword": "000000186A1F18DF422ED6943A1FA65F0BBC9BDD53B427AADCBF1E5B94DF6F522CD9408949319969",
           "keyAlias": "yt112233",
-          "keyPassword": "0000001804DB1A9D8153633E7AA037AEC254E68493CF286BE33E6F821CB8F46AB67E1EB65367D447",
+          "keyPassword": "0000001824A2B71C1054C5E4430720E522095F6AEE2977EAF316C2702B6F04E0ADBF4D6B84C91CE0",
           "signAlg": "SHA256withECDSA",
-          "profile": "C:/Users/EDY/Downloads/樱桃小决定调试Debug.p7b",
+          "profile": "C:/Users/EDY/Downloads/木鱼调试证书Debug.p7b",
           "certpath": "sign/调试证书.cer"
         }
       }

+ 2 - 1
commons/basic/Index.ets

@@ -50,11 +50,12 @@ export { yTRouter } from "./src/main/ets/utils/YTRouter"
 
 export * from "./src/main/ets/utils/YTBreakPoint"
 
-export { BasicType,coinItem } from './src/main/ets/models/index'
+export { BasicType } from './src/main/ets/models/index'
 
 export * from '@mumu/crop'
 
 export * from './src/main/ets/models'
+export{Vibration} from './src/main/ets/utils/VibrationUtils'
 export {bigWheelDB,BigWheel}from './src/main/ets/utils/BigWheelDB'
 
 

+ 2 - 1
commons/basic/src/main/ets/apis/YTRequest.ets

@@ -16,6 +16,7 @@ import { promptAction } from '@kit.ArkUI';
 
 export const baseURL: string = 'http://192.168.1.160:48097'
 // export const baseURL: string = 'https://hm.ytpm.net/prod-decision/decisionApUser'
+// export const baseURL:string='https://hm.ytpm.net/prod-decision'
 export const instance = axios.create({
   baseURL,
   timeout: 5000
@@ -47,7 +48,7 @@ instance.interceptors.response.use((response: AxiosResponse) => {
     return Promise.reject('401');
   }
   if (response.data.code == 500) {
-    IBestToast.show({ message: response.data.msg, type: "fail" })
+    IBestToast.show({ message: response.data.msg})
     return Promise.reject(response.data);
   }
 

+ 7 - 0
commons/basic/src/main/ets/apis/YTUserRequest.ets

@@ -83,6 +83,12 @@ export class YTUserRequest extends YTRequest {
       })
   }
 
+  //注销
+  static logout(){
+    YTUserRequest.post<null,null>(`/decisionApUser/logout`).then(()=>{
+
+    })
+  }
   //华为登录
   static harmonyLogin(instance: LoginCollect) {
     try {
@@ -95,6 +101,7 @@ export class YTUserRequest extends YTRequest {
             .then(data => {
               const token = data['token']
               userInfo.setToken(token)
+              YTUserRequest.changeNickname('华为用户',()=>{})
               YTUserRequest.refreshUserInfo((userInfo) => {
                 YTLog.info(userInfo)
                 IBestToast.hide()

+ 33 - 4
commons/basic/src/main/ets/components/generalComp/AgreePrivacy.ets

@@ -1,7 +1,15 @@
 import { BasicType } from '../../models';
+import { yTRouter } from '../../utils/YTRouter';
 import { YTToast } from '../../utils/YTToast';
 import { YTButton } from './YTButton';
 
+@Extend(Span)
+function spanEx(click: () => void) {
+  // .decoration({ type: TextDecorationType.Underline, color: $r('[basic].color.main_ac_color_dark') })
+  .fontColor('rgba(0, 0, 0, 0.85)')
+  .onClick(click)
+}
+
 @Builder
 export function agreePrivacy(item: BasicType<undefined>) {
   Column() {
@@ -9,16 +17,37 @@ export function agreePrivacy(item: BasicType<undefined>) {
       .fontSize(14)
       .fontColor('Color.Black')
       .margin({ top: 14, bottom: 8 })
-    Text('已阅读并同意《用户协议》和《隐私政策》')
-      .fontSize(13)
-      .fontColor($r('sys.color.mask_secondary'))
-      .margin({ bottom: 19 })
+    Text() {
+      Span('我已阅读并同意')
+      // Span('《中国认证服务条款》')
+      //   .spanEx(() => {
+      //
+      //   })
+      //
+      // Span('以及')
+      Span('《樱桃小决定用户协议》')
+        .spanEx(() => {
+          yTRouter.router2userAgreement()
+
+        })
+      Span('和')
+      Span('《隐私政策》')
+        .spanEx(() => {
+          yTRouter.router2Privacy()
+        })
+      Span('。')
+    }
+    .fontWeight(300)
+    .fontColor('#FF686868')
+    .fontSize(12)
 
 
     Column() {
       YTButton({
         btContent: '同意并登入',
         btHeight: 37,
+        bgc:'rgba(253, 95, 229, 1)',
+        btFontColor:Color.White,
         click: () => {
           YTToast.getInstance().hide()
 

+ 1 - 0
commons/basic/src/main/ets/components/generalComp/YtDoubleConfirm.ets

@@ -19,6 +19,7 @@ export function yTDoubleConfirm(item: BasicType<undefined>) {
           btContent: '确定',
           btWidth: 108,
           btHeight: 37,
+          bgc:'#fd54e3',
           btFontSize: 12,
           click: item.click
         }

+ 0 - 44
commons/basic/src/main/ets/models/index.ets

@@ -54,47 +54,3 @@ export type ResultCallBack<T> = (res?: T, err?: Error) => void
 export type BreakPointString = 'xs' | 'sm' | 'md' | 'lg'
 
 
-export interface  DecisionItem{
-  title:string,
-  message:string,
-  icon:string | ResourceStr,
-  pageName:string
-}
-export const decisionItemList:DecisionItem[]=[
-  {
-    title:"抛硬币",
-    message:"选正反",
-    icon:$r('app.media.coin'),
-    pageName: "TossCoinView"
-  },
-  {
-    title:"掷筛子",
-    message:"摇一摇",
-    icon:$r('app.media.dice'),
-    pageName: "RollDiceView"
-  },
-  {
-    title:"吃什么",
-    message:"h",
-    icon:$r('app.media.eat'),
-    pageName: "EatWhatView"
-  },
-  {
-    title:"大转盘",
-    message:"搏一搏",
-    icon:$r('app.media.big'),
-    pageName: "BigWheelView"
-  },
-  {
-    title:"随机数",
-    message:"数字",
-    icon:$r('app.media.rannum'),
-    pageName: "RanNumberView"
-  }
-]
-//抛硬币需要存到本地
-export interface coinItem{
-  back:number,
-  fore:number,
-  currRes:string
-}

+ 16 - 0
commons/basic/src/main/ets/utils/VibrationUtils.ets

@@ -0,0 +1,16 @@
+import { vibrator } from '@kit.SensorServiceKit'
+
+export class Vibration{
+  // 开启震动
+  static startVibration() {
+    vibrator.startVibration({ type: 'time', duration: 200 }, { usage: 'alarm' })
+  }
+  // 关闭震动
+  static stopVibration() {
+    vibrator.stopVibration()
+  }
+}
+
+
+
+

+ 0 - 4
commons/basic/src/main/ets/utils/YTRouter.ets

@@ -14,10 +14,6 @@ export class YTRouter extends NavPathStack {
     return YTRouter.instance
   }
 
-router2DecisionPage(name:string){
-    YTRouter.getInstance().pushPathByName(name,'')
-  }
-
   router2SettingPage() {
     yTRouter.pushPathByName('SettingPage', '')
   }

+ 0 - 95
features/feature/src/main/ets/utils/Sector.ets

@@ -1,95 +0,0 @@
-// 定义扇形组件
-@Component
-export struct Sector {
-  @Prop radius: number; // 扇形的半径
-  @Prop angle: number; // 扇形的角度
-  @Prop color: string; // 扇形的颜色
-
-
-
-  // 创建扇形路径的函数
-  createSectorPath(radius: number, angle: number): string {
-    const centerX = radius / 2; // 计算扇形中心的X坐标
-    const centerY = radius / 2; // 计算扇形中心的Y坐标
-    const startX = centerX; // 扇形起始点的X坐标
-    const startY = centerY - radius; // 扇形起始点的Y坐标
-    const halfAngle = angle / 4; // 计算半个角度
-    // 计算扇形结束点1的坐标
-    const endX1 = centerX + radius * Math.cos((halfAngle * Math.PI) / 180);
-    const endY1 = centerY - radius * Math.sin((halfAngle * Math.PI) / 180);
-
-    // 计算扇形结束点2的坐标
-    const endX2 = centerX + radius * Math.cos((-halfAngle * Math.PI) / 180);
-    const endY2 = centerY - radius * Math.sin((-halfAngle * Math.PI) / 180);
-
-    // 判断是否为大弧
-    const largeArcFlag = angle / 2 > 180 ? 1 : 0;
-    const sweepFlag = 1; // 设置弧线方向为顺时针
-
-    const pathCommands =
-      `M${startX} ${startY} A${radius} ${radius} 0 ${largeArcFlag} ${sweepFlag} ${endX1} ${endY1} L${centerX} ${centerY} L${endX2} ${endY2} A${radius} ${radius} 0 ${largeArcFlag} ${1 -
-        sweepFlag} ${startX} ${startY} Z`;
-    // 生成SVG路径命令
-    // const pathCommands =
-    //   `M${startX} ${startY} A${radius} ${radius} 0 ${largeArcFlag} ${sweepFlag} ${startX} ${startY} A${radius} ${radius} 0 ${largeArcFlag} ${1 -
-    //     sweepFlag} ${endX2} ${endY2} Z`;
-    return pathCommands; // 返回路径命令
-  }
-
-
-  // 构建扇形组件
-  build() {
-    Stack() {
-      // 创建第一个扇形路径
-      Path()
-        .width(`${this.radius}px`) // 设置宽度为半径
-        .height(`${this.radius}px`) // 设置高度为半径
-        .commands(this.createSectorPath(this.radius, this.angle)) // 设置路径命令
-        .fillOpacity(1) // 设置填充透明度
-        .fill(this.color) // 设置填充颜色
-        // .stroke(Color.Black)
-        .strokeWidth(0) // 设置边框宽度为0
-        .rotate({ angle: this.angle / 4 - 90 }); // 旋转扇形
-
-      // 创建第二个扇形路径
-      Path()
-        .width(`${this.radius}px`) // 设置宽度为半径
-        .height(`${this.radius}px`) // 设置高度为半径
-        .commands(this.createSectorPath(this.radius, this.angle)) // 设置路径命令
-        .fillOpacity(1) // 设置填充透明度
-        .fill(this.color) // 设置填充颜色
-        // .stroke('#f8edfa')
-        // .stroke(Color.Black)
-        .strokeWidth(0) // 设置边框宽度为0
-        .rotate({ angle: 180 - (this.angle / 4 - 90) }); // 旋转扇形
-    }
-  }
-}
-
-// 定义单元格类
-@ObservedV2
-export class Cell {
-  @Trace id:number=0
-  @Trace angle: number = 0; // 扇形的角度
-  @Trace title: string; // 当前格子的标题
-  @Trace color: string; // 背景颜色
-  @Trace rotate: number = 0; // 在转盘要旋转的角度
-  angleStart: number = 0; // 轮盘所在区间的起始
-  angleEnd: number = 0; // 轮盘所在区间的结束
-  proportion: number = 0; // 所占比例
-
-  // 构造函数
-  constructor(id:number,proportion: number, title: string, color: string) {
-    this.proportion = proportion; // 设置比例
-    this.title = title; // 设置标题
-    this.color = color; // 设置颜色
-    this.id=id
-  }
-}
-
-export interface CellStorage{
-  id:number,
-  title: string,
-  color: string,
-  proportion: number
-}

+ 0 - 816
features/feature/src/main/ets/view/BigWheelView.ets

@@ -1,816 +0,0 @@
-import { BigWheel, bigWheelDB, YTAvoid, YTHeader, yTRouter } from 'basic'
-import { Cell, CellStorage, Sector } from '../utils/Sector';
-import { CounterComponent, CounterType, promptAction } from '@kit.ArkUI';
-import { it } from '@ohos/hypium';
-import { JSON } from '@kit.ArkTS';
-
-
-@Builder
-function BigWheelViewBuilder(){
-  NavDestination(){
-    BigWheelView()
-  }.title("大转盘")
-  .hideTitleBar(true)
-}
-
-@Component
-struct BigWheelView{
-  @StorageProp(YTAvoid.SAFE_TOP_KEY) safeBottom: number = 0
-
-  //持久化的数组,方便下次打开应用直接承接上一次的数据
-  @StorageLink('bigwheel')
-  DBCells:CellStorage[]=[]
-  @StorageLink('unselectbigwheel')
-  DBUnselectCell:Cell[]=[]
-  @StorageLink('selectbigwheel')
-  DBSelectCell:Cell[]=[]
-
-  //转盘操作数组
-  @State cells: Cell[] = []; // 存储单元格的数组
-  //随着每次操作,需要触发画布重新画
-  @Watch('drawCircleWithCustomRadii')
-  @State changeCanvas:number=0
-  @State wheelWidth: number = 400; // 转盘的宽度
-  @State currentAngle: number = 0; // 当前转盘的角度
-  @State selectedName: string = ""; // 选中的名称
-  @State isRepeat:boolean=false
-  @Watch('filter')
-  @State selected:Cell[]=[]
-  @State UnSelected:Cell[]=[]
-  @State randomAngle:number=0
-  isAnimating: boolean = false; // 动画状态
-  colorIndex: number = 0; // 颜色索引
-  spinDuration:number=5000
-  @State spinDurationTime:number=this.spinDuration/1000
-  //是否显示设置界面
-  @State isShow:boolean=false
-  private settings: RenderingContextSettings = new RenderingContextSettings(true)
-  private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
-
-  //转盘选中判断
-  @State currSelectNumber:number=1
-  @State number:number=4 //转盘数量
-
-  //打开半模态命名模态
-  @State isshowRename:boolean=false
-
-  colorPalette: string[] = [ // 颜色调色板
-    // "#26c2ff",
-    // "#978efe",
-    // "#c389fe",
-    // "#ff85bd",
-    // "#ff7051",
-    // "#fea800",
-    // "#ffcf18",
-    // "#a9c92a",
-    // "#fea800",
-    // "#ffcf18",
-    // "#a9c92a"
-
-    "#fff",
-    "#fff",
-    "#fff",
-    "#fff",
-    "#fff",
-    "#fff",
-  ];
-  filter(){
-    //每次选中的数组有变化,那就要重新过滤,就要移除没选中的数组里面的数据
-  this.UnSelected = this.cells.filter(item => !this.selected.includes(item));
-
-
-    // promptAction.showToast({
-    //   message:JSON.stringify(this.UnSelected)
-    // })
-    //要把选的变成灰色
-    // this.cells.map((item)=>{
-    //
-    // })
-    this.DBUnselectCell=this.UnSelected
-    this.DBSelectCell=this.selected
-
-  }
-
-  async selectCount(){
-    return await bigWheelDB.queryCount()
-  }
-
-  // this.cells.push(new Cell(1, 1, "转盘1", this.colorPalette[this.colorIndex++ % this.colorPalette.length]));
-  // 组件即将出现时调用
-  aboutToAppear() {
-    if(this.DBCells.length==0) {
-      this.cells.push(new Cell(1, 1, "转盘1",'#fff' ));
-      this.cells.push(new Cell(2, 1, "转盘2", '#fff' ));
-      this.cells.push(new Cell(3, 1, "转盘3",'#fff' ));
-      this.cells.push(new Cell(4, 1, "转盘4", '#fff' ));
-
-      this.UnSelected=this.cells
-    }else{
-      this.DBCells.forEach((item)=>{
-        this.cells.push(new Cell(item.id,item.proportion,item.title,item.color))
-      })
-      this.number=this.cells.length
-      this.UnSelected=this.DBUnselectCell
-      this.selected=this.DBSelectCell
-
-      // this.DBSelectCell.forEach((item)=>{
-      //   this.selected.push(new Cell(item.id,item.proportion,item.title,item.color))
-      // })
-      this.currSelectNumber=this.number-3
-    }
-    // this.UnSelected=this.cells
-    this.calculateAngles(); // 计算角度
-  }
-  //动画
-  private startAnimation(){
-
-    if (this.isAnimating) { // 如果正在动画中,返回
-      return;
-    }
-    if(this.selected.length==this.cells.length){
-      return
-    }
-    //如果都已经被选了,则不能再转了
-    this.calculateNoSelectedAngles()
-    this.selectedName = ""; // 清空选中的名称
-    this.isAnimating = true; // 设置动画状态为正在动画
-    animateTo({ // 开始动画
-      duration: this.spinDuration, // 动画持续时间为5000毫秒
-      curve: Curve.EaseInOut, // 动画曲线为缓入缓出
-      onFinish: () => { // 动画完成后的回调
-        this.currentAngle %= 360; // 保持当前角度在0到360之间
-        for (const cell of this.cells) {
-          // 遍历每个单元格
-          // 检查当前角度是否在单元格的角度范围内
-          if (360 - this.currentAngle >= cell.angleStart && 360 - this.currentAngle <= cell.angleEnd) {
-            if(!this.isRepeat) {
-              this.selected.push(cell)
-              //这里需要下次点击的时候
-              cell.color = '#e5e7ea'
-            }else{
-              this.selected=[]
-            }
-            this.selectedName = cell.title; // 设置选中的名称为当前单元格的标题
-            //每次转弯要保存
-
-
-            break; // 找到后退出循环
-          }
-        }
-        this.DBCells=this.cells.map((item)=>{
-          return {
-            id:item.id,
-            title:item.title,
-            proportion:item.proportion,
-            color:item.color
-          } as CellStorage
-        })
-        this.isAnimating = false; // 设置动画状态为未动画
-      },
-    }, () => { // 动画进行中的回调
-      //在这里判断
-      // this.randomAngle=Math.floor(Math.random()*360)
-      // this.currentAngle += (360 * this.spinDuration/1000 + Math.floor(Math.random() * 360)); // 更新当前角度,增加随机旋转
-      //在这里算已经选过的,不能在指了
-
-      // this.currentAngle += (360 * this.spinDuration/1000 + Math.floor(Math.random() * 360)); // 更新当前角度,增加随机旋转
-
-      // promptAction.showToast({
-      //   message:this.randomAngle.toString()
-      // })
-      this.currentAngle += (360 * this.spinDuration/1000)+this.randomAngle
-
-
-
-    });
-
-  }
-
-  // 计算每个单元格的角度
-  private calculateAngles() {
-    // 根据比例计算总比例
-    const totalProportion = this.cells.reduce((sum, cell) => sum + cell.proportion, 0);
-    this.cells.forEach(cell => {
-      cell.angle = (cell.proportion * 360) / totalProportion; // 计算每个单元格的角度
-    });
-
-    let cumulativeAngle = 0; // 累计角度
-    this.cells.forEach(cell => {
-      cell.angleStart = cumulativeAngle; // 设置起始角度
-      cumulativeAngle += cell.angle; // 更新累计角度
-      cell.angleEnd = cumulativeAngle; // 设置结束角度
-      cell.rotate = cumulativeAngle - (cell.angle / 2); // 计算旋转角度
-    });
-
-
-    // bigWheelDB.batchDelete(this.cells.map(item=>item.id))
-    // bigWheelDB.batchInsert(this.cells.map((item)=>{
-    //   return {
-    //     id:item.id,
-    //     title:item.title,
-    //     angle:item.angle,
-    //     proportion:item.proportion,
-    //     color:item.color,
-    //     angleEnd:item.angleEnd,
-    //     angleStart:item.angleStart,
-    //     rotate:item.rotate
-    //   } as BigWheel
-    // }))
-    //触发画布
-    this.changeCanvas++
-  }
-
-  private calculateNoSelectedAngles(){
-    //在这里计算
-    if(this.isRepeat){
-      return
-    }
-
-    if(this.UnSelected.length!=0) {
-      //随机选取一个没有选中的角度范围扇形
-      const currangle=this.currentAngle%360
-      const randomIndex = Math.floor(Math.random() * this.UnSelected.length) as number
-      const ranNumStart = 360-this.UnSelected[randomIndex].angleEnd
-      const ranNumEnd = 360-this.UnSelected[randomIndex].angleStart
-      this.randomAngle =Math.floor(Math.random() * (ranNumEnd - ranNumStart) + ranNumStart)-currangle
-    }
-    // else{
-    //   this.randomAngle=Math.floor(Math.random()*360)
-    // }
-  }
-
-  private drawCircleWithCustomRadii() {
-    // this.context.clearRect(0,0,0,0)
-    this.context.clearRect(0, 0, 220, 220); // 清空Canvas的内容
-    const centerX = 110 // 圆心x坐标
-    const centerY = 110 // 圆心y坐标
-    const radius = 110  // 圆半径
-    // 根据自定义角度数组绘制半径线
-    this.cells.forEach(angle => {
-      // 将角度转换为弧度(Canvas使用弧度制)
-      const radians = (angle.angleEnd-90) * Math.PI / 180
-
-      // 计算半径线终点坐标
-      const endX = centerX + radius * Math.cos(radians)
-      const endY = centerY + radius * Math.sin(radians)
-
-      // 绘制半径线
-      this.context.beginPath()
-      this.context.moveTo(centerX, centerY)
-      this.context.lineTo(endX, endY)
-      this.context.strokeStyle = '#efd4f9' // 红色半径线
-      this.context.lineWidth = 1.5
-      this.context.stroke()
-
-      // // 标注角度值(修正后的文本绘制方式)
-      // this.context.font = '12px sans-serif'
-      // this.context.fillStyle = '#000000'
-      // this.context.textAlign = 'center'
-      // this.context.textBaseline = 'middle'
-
-      // // 文本位置稍微向外偏移
-      // const textRadius = radius + 15
-      // const textX = centerX + textRadius * Math.cos(radians)
-      // const textY = centerY + textRadius * Math.sin(radians)
-
-      // 使用fillText绘制文本
-      // this.context.fillText(`${angle}°`, textX, textY)
-    })
-
-  }
-
-  // aboutToDisappear(): void {
-  //   //组件销毁保存数据
-  //   this.DBCells=this.cells
-  //   this.DBUnselectCell=this.UnSelected
-  //   promptAction.showToast({
-  //     message:"xxx"
-  //   })
-  //
-  // }
-
-  build() {
-    Stack({alignContent:Alignment.Center}){
-      Stack({alignContent:Alignment.Top}){
-        Column() {
-          // YTHeader({ title: '大转盘', })
-          Row(){
-            Image($r('[basic].media.ic_back'))
-              .width(24)
-              .margin({ left: 16 })
-              .onClick(()=>{
-                yTRouter.routerBack()
-              })
-            Text('大转盘')
-              .fontSize(18)
-              .fontWeight(700)
-              .fontColor(Color.Black)
-
-            Image($r('[basic].media.Subtract'))
-              .width(24)
-              .margin({right: 16 })
-              .onClick(()=>{
-                this.isShow=true
-              })
-          }.width('100%')
-          .height(84)
-          .justifyContent(FlexAlign.SpaceBetween)
-          .padding({ top: 44 })
-          .margin({bottom:20})
-
-          Row(){
-            Column(){}.width(24).height(24)
-            // Image($r('[basic].media.voicemuisc')).width(24)
-            Text('重置').fontColor('rgba(0, 0, 0, 0.65)').onClick(()=>{
-
-              if(!this.isRepeat){
-                //背景色变成白色
-                this.cells.forEach((item)=>{
-                  item.color='#fff'
-                })
-              }else{
-
-              }
-              //重置,所有的转盘重新开始
-              // this.DBCells.forEach((item)=>{
-              //   this.cells.push(new Cell(item.id,item.proportion,item.title,item.color))
-              // })
-              this.selected=[]
-              this.UnSelected=[]
-              this.UnSelected=this.cells
-
-              this.DBUnselectCell=this.UnSelected
-              this.DBSelectCell=this.selected
-              this.DBCells=this.cells.map((item)=>{
-                return {
-                  id:item.id,
-                  title:item.title,
-                  proportion:item.proportion,
-                  color:item.color
-                } as CellStorage
-              })
-              // this.DBCells=this.cells
-              // this.UnSelected=this.DBUnselectCell
-              // this.selected=this.DBSelectCell
-
-            })
-          }.width('100%')
-          .justifyContent(FlexAlign.SpaceBetween)
-          .padding({left:30,right:30})
-
-          // 显示当前状态
-          Text(this.isAnimating ? '旋转中' : `${this.selectedName}`)
-            .fontSize(20)
-            .fontColor("#0b0e15")
-            .height(40)
-            .margin({top:100})
-
-          Stack() {
-            Stack() {
-              // 遍历每个单元格并绘制扇形
-              ForEach(this.cells, (cell: Cell) => {
-                Stack() {
-                  Sector({ radius: lpx2px(this.wheelWidth) / 2, angle: cell.angle, color: cell.color }); // 创建扇形
-                  Text(cell.title).fontColor(Color.Black).fontWeight(700).margin({ bottom: `${this.wheelWidth / 1.4}lpx` }); // 显示单元格标题
-                }.width('100%').height('100%').rotate({ angle: cell.rotate }); // 设置宽度和高度,并旋转
-              });
-            }
-            .borderRadius('50%') // 设置圆角
-            // .backgroundColor(Color.Gray) // 设置背景颜色
-            .width(`${this.wheelWidth}lpx`) // 设置转盘宽度
-            .height(`${this.wheelWidth}lpx`) // 设置转盘高度
-            .rotate({ angle: this.currentAngle }); // 旋转转盘
-
-            // 创建指针
-            // Image({ width: 20, height: 10 })
-            //   .points([[0, 0], [10, -20], [20, 0]]) // 设置指针的点
-            //   .fill("#d72b0b") // 设置指针颜色
-            //   .height(20) // 设置指针高度
-            //   .margin({ bottom: '140lpx' }); // 设置指针底部边距
-
-            Column() {
-              Canvas(this.context)
-                .width(220)
-                .height(220)
-                .borderRadius('50%')
-                .backgroundColor(Color.Transparent)
-                .onReady(() => {
-                  this.drawCircleWithCustomRadii()
-                })
-            } .width(`${this.wheelWidth}lpx`) // 设置转盘宽度
-            .height(`${this.wheelWidth}lpx`) // 设置转盘高度
-            .justifyContent(FlexAlign.Center)
-            .rotate({ angle: this.currentAngle }) // 旋转转盘
-
-
-
-            // 创建开始按钮
-            // Button('开始')
-            //   .fontColor("#c53a2c") // 设置按钮字体颜色
-            //   .borderWidth(10) // 设置按钮边框宽度
-            //   .borderColor("#dd2218") // 设置按钮边框颜色
-            //   .backgroundColor("#fde427") // 设置按钮背景颜色
-            //   .width('200lpx') // 设置按钮宽度
-            //   .height('200lpx') // 设置按钮高度
-            //   .borderRadius('50%') // 设置按钮为圆形
-            //   .clickEffect({ level: ClickEffectLevel.LIGHT }) // 设置点击效果
-            Image($r('[basic].media.zhizheng'))
-              .width('70lpx') // 设置按钮宽度
-              .height('70lpx') // 设置按钮高度
-              .objectFit(ImageFit.Contain)
-              .clickEffect({ level: ClickEffectLevel.LIGHT }) // 设置点击效果
-              // .onClick(() => { // 点击按钮时的回调函数
-              //
-              // });
-          }
-          .width(`${this.wheelWidth+26}lpx`)
-          .height(`${this.wheelWidth+26}lpx`)
-          .backgroundImage($r('[basic].media.xuanzhuankuang'))
-          .backgroundImageSize({width:'100%',height:'100%'})
-          .backgroundImagePosition(Alignment.Center)
-
-          // // 创建滚动区域
-          // Scroll() {
-          //   Column() {
-          //     // 遍历每个单元格,创建输入框和计数器
-          //     ForEach(this.cells, (item: Cell, index: number) => {
-          //       Row() {
-          //         // 创建文本输入框,显示单元格标题
-          //         TextInput({ text: item.title })
-          //           .layoutWeight(1) // 设置输入框占据剩余空间
-          //           .onChange((value) => { // 输入框内容变化时的回调
-          //             item.title = value; // 更新单元格标题
-          //           });
-          //         // 创建计数器组件
-          //         CounterComponent({
-          //           options: {
-          //             type: CounterType.COMPACT, // 设置计数器类型为紧凑型
-          //             numberOptions: {
-          //               label: `当前占比`, // 设置计数器标签
-          //               value: item.proportion, // 设置计数器初始值
-          //               min: 1, // 设置最小值
-          //               max: 100, // 设置最大值
-          //               step: 1, // 设置步长
-          //               onChange: (value: number) => { // 计数器值变化时的回调
-          //                 item.proportion = value; // 更新单元格的比例
-          //                 this.calculateAngles(); // 重新计算角度
-          //               }
-          //             }
-          //           }
-          //         });
-          //         // 创建删除按钮
-          //         Button('删除').onClick(() => {
-          //           this.cells.splice(index, 1); // 从单元格数组中删除当前单元格
-          //           this.calculateAngles(); // 重新计算角度
-          //         });
-          //       }.width('100%').justifyContent(FlexAlign.SpaceBetween) // 设置行的宽度和内容对齐方式
-          //       .padding({ left: 40, right: 40 }); // 设置左右内边距
-          //     });
-          //   }.layoutWeight(1); // 设置滚动区域占据剩余空间
-          // }.layoutWeight(1) // 设置滚动区域占据剩余空间
-          // .margin({ top: 20, bottom: 20 }) // 设置上下外边距
-          // .align(Alignment.Top); // 设置对齐方式为顶部对齐
-
-          Button('转一转').fontColor(Color.White)
-            .backgroundColor('#fd54e3').width('70%')
-            .height(44).borderRadius(20)
-            .margin({top:107,bottom:48})
-            .onClick(()=>{
-              this.startAnimation()
-            })
-          Row({space:15}) {
-            ForEach([2,3,4,5],(item:number,index:number)=>{
-              Text((item+1).toString())
-                .width(40)
-                .height(40)
-                .textAlign(TextAlign.Center)
-                .border({width:1,color:'#000000'})
-                .borderRadius('50%')
-                .backgroundColor(this.currSelectNumber==index?'#bff2ff':'#f2f2f2')
-                .onClick(()=>{
-                  promptAction.showToast({
-                    message:JSON.stringify(this.selected)
-                  })
-
-                  this.currSelectNumber=index
-                  this.number=item+1
-                  const arr=this.cells
-                  this.cells=[]
-                  //如果选中的长度比之前要长
-                  if(this.number>arr.length) {
-                    for (let i = 0; i < this.number; i++) {
-                      if (i < arr.length) {
-                        this.cells.push(arr[i])
-                      }else{
-                      this.cells.push(new Cell(i + 1, 1, "转盘" + (i + 1), '#fff'));
-                    }
-                      }
-                  }else{
-                    //短
-                    for (let i = 0; i < this.number; i++) {
-                      this.cells.push(arr[i])
-                    }
-
-                  }
-                  //要继承之前没选中的,选中的数组根据id
-                  // this.UnSelected=this.cells
-                  // this.selected=[]
-                  this.calculateAngles(); // 重新计算角度
-                  //选中的和没选中的也要重新计算角度
-                  let selId=[] as number[]
-                  let unselId=[] as number[]
-                  //找到id重新过滤
-                  this.selected.forEach((selItem)=>{
-                    selId.push(selItem.id)
-                  })
-                  this.UnSelected.forEach((unselItem)=>{
-                    unselId.push(unselItem.id)
-                  })
-                  this.selected=[]
-                  this.UnSelected=[]
-
-                  this.cells.forEach((selItem)=>{
-                    selId.forEach((i)=>{
-                      if(i==selItem.id){
-                        this.selected.push(selItem)
-                      }
-                    })
-                  })
-
-                  this.cells.forEach((unselItem)=>{
-                    unselId.forEach((i)=>{
-                      if(i==unselItem.id){
-                        this.UnSelected.push(unselItem)
-                      }
-                    })
-                  })
-
-
-                  this.DBUnselectCell=this.UnSelected
-                  this.DBSelectCell=this.selected
-                  // promptAction.showToast({
-                  //   message:JSON.stringify(this.cells)
-                  // })
-                  this.DBCells=[]
-                  this.DBCells=this.cells.map((item)=>{
-                    return {
-                      id:item.id,
-                      title:item.title,
-                      proportion:item.proportion,
-                      color:item.color
-                    } as CellStorage
-                  })
-                  // this.UnSelected=this.DBUnselectCell
-                  // this.selected=this.DBSelectCell
-                })
-            })
-
-            Row(){
-              Image($r('[basic].media.zidingyi')).width(16)
-              Text('命名').fontSize(12).fontColor(Color.White)
-            }.width(64)
-            .height(40)
-            .borderRadius(20)
-            .backgroundColor('rgba(255, 157, 240, 1)')
-            .justifyContent(FlexAlign.Center)
-            .onClick(()=>{
-              this.isshowRename=true
-            })
-            // .bindSheet($$this.isshowRename,this.reNameBuilder,{
-            //   width:300,
-            //   height:318,
-            //   showClose:false,
-            //   preferType:SheetType.POPUP
-            // }).onClick(()=>{
-            //   //打开半模态
-            //   this.isshowRename=true
-            //   //
-            // })
-
-          }
-
-
-          // Row(){
-          //   ForEach([2,3,4,5,6],(item:number,index)=>{
-          //     Text((item).toString()).width(20).fontColor(Color.Red).onClick(()=>{
-          //       this.cells=[]
-          //       for(let i=0;i<item;i++){
-          //         this.cells.push(new Cell(i+1,1, "转盘"+(i+1), this.colorPalette[i]));
-          //       }
-          //       this.calculateAngles(); // 重新计算角度
-          //
-          //     })
-          //   })
-          // }
-
-
-
-          // 创建添加新内容按钮
-          // Button('添加新内容').onClick(() => {
-          //   // 向单元格数组中添加新单元格
-          //   // this.cells.push(new Cell(1, "新内容", this.colorPalette[this.colorIndex++ % this.colorPalette.length]));
-          //   this.calculateAngles(); // 重新计算角度
-          // }).margin({ top: 20, bottom: 20 }); // 设置按钮的上下外边距
-
-
-
-
-
-        }.width('100%').padding({ bottom: this.safeBottom })
-        .justifyContent(FlexAlign.Center).onClick(()=>{
-          this.isShow=false
-        })
-        if(this.isShow) {
-          Column() {
-
-            //允许结果是否重复
-            Row() {
-              Row({ space: 10 }) {
-                Image($r('[basic].media.qiehuan')).width(24)
-                Text('允许结果重复').fontWeight(700)
-              }
-
-              Row() {
-                Toggle({ type: ToggleType.Switch ,isOn:$$this.isRepeat})
-                  .width(38)
-                  .height(20)
-                  .selectedColor('rgba(253, 84, 227, 1)')  //打开状态下的背景颜色
-                  .switchStyle({
-                    pointRadius: 8, //圆形滑块半径
-                    trackBorderRadius: 14, //滑轨的圆角
-                    pointColor: Color.White, //圆形滑块颜色  switchPointColor不生效
-                    unselectedColor: 'rgba(233, 233, 234, 1)'  //关闭状态的背景颜色
-                  })
-                  .onClick(() => {
-                    this.isRepeat=!this.isRepeat
-                  })
-
-              }
-
-            }
-            .width('100%')
-            .height(40)
-            .backgroundColor(Color.White)
-            .borderRadius(8)
-            .justifyContent(FlexAlign.SpaceBetween)
-            .padding({ left: 12, right: 12 })
-            .alignItems(VerticalAlign.Center)
-
-            Row() {
-              Text('每次转动轮盘可能会随机选中相同的选项').fontSize(12).fontColor('rgba(0, 0, 0, 0.45)')
-
-            }.width('100%')
-            .justifyContent(FlexAlign.Start)
-            .padding({ left: 22 })
-            .margin({ bottom: 25, top: 10 })
-
-            Row() {
-              Row({ space: 10 }) {
-                Image($r('[basic].media.xuanzhuantime')).width(24)
-                Text('旋转时长').fontWeight(700)
-              }
-
-              Row() {
-
-                Counter() {
-                  Text(this.spinDurationTime.toString() + 's').border({ width: 0 })
-                }
-                .onInc(() => {
-                  this.spinDurationTime++
-                  this.spinDuration = this.spinDurationTime * 1000
-                })
-                .onDec(() => {
-                  this.spinDurationTime--
-                  this.spinDuration = this.spinDurationTime * 1000
-                })
-              }
-
-            }
-            .width('100%')
-            .height(40)
-            .backgroundColor(Color.White)
-            .borderRadius(8)
-            .justifyContent(FlexAlign.SpaceBetween)
-            .padding({ left: 12, right: 12 })
-            .alignItems(VerticalAlign.Center)
-
-          }
-          .width('100%')
-          .height(214)
-          .padding({ left: 22, top: 56, right: 22 })
-          .borderRadius({ bottomLeft: 20, bottomRight: 20 })
-          .linearGradient({
-            angle: 135,
-            colors: [
-              ['rgba(239, 144, 237, 1)', 0.2],
-              ['rgba(191, 242, 255, 1)', 1]
-            ]
-          })
-        }
-      }.height('100%')
-      .backgroundImage($r('[basic].media.backimgNumber'))
-      .backgroundImageSize({width:'100%',height:'100%'})
-      if(this.isshowRename) {
-
-        Column() {
-          Column() {
-            Row() {
-              Text('转盘命名').fontSize(20).fontWeight(500).fontColor('#FF1C1C1C').margin({left:110,right:64,top:24})
-              Column() {
-                Image($r('[basic].media.quxiaocl')).width(10)
-              }.width(24)
-              .height(24)
-              .backgroundColor(Color.White)
-              .justifyContent(FlexAlign.Center)
-              .borderRadius('50%')
-              .onClick(() => {
-                this.isshowRename = false
-              })
-
-            }.width('100%')
-            Column({space:10}){
-              ForEach(this.cells,(item:Cell,index:number)=>{
-
-                reNameInput({
-                  text:item.title,
-                  num:index+1,
-                  inputChange:(value:string)=>{
-                    item.title=value
-                  }
-                })
-              })
-            }
-          }.width(300).height(318)
-          .justifyContent(FlexAlign.Start)
-          .borderRadius(20)
-          .padding({left:16,right:16})
-          .linearGradient({
-            angle:135,
-            colors:[
-              ['rgba(248, 211, 249, 1)',0.2],
-              ['rgba(192, 242, 255, 1)',1]
-            ]
-          })
-
-        }.width('100%').height('100%').justifyContent(FlexAlign.Center).backgroundColor('rgba(30, 30, 30,0.5)')
-      }
-    }
-
-
-  }
-
-
-}
-@Component
-struct reNameInput{
-  @Prop text:string=""
-  @Prop num:number=1
-  inputChange=(value:string)=>{
-
-  }
-  build() {
-    Row({space:10}){
-      Text(`转盘${this.num}`)
-      TextInput({text:this.text})
-        .width(194)
-        .height(30)
-        .padding(0)
-        .border({width:{bottom:1,left:0,right:0,top:0},color:Color.Black})
-        .borderRadius(0)
-        .backgroundColor(Color.Transparent)
-        .onChange((value:string)=>{
-          this.inputChange(value)
-        })
-    }.width('100%')
-
-  }
-}
-
-// Text('旋转秒数').fontColor(Color.Black)
-// CounterComponent({
-//   options: {
-//     type: CounterType.COMPACT, // 设置计数器类型为紧凑型
-//     numberOptions: {
-//       value: this.spinDuration/1000, // 设置计数器初始值 5
-//       min: 1, // 设置最小值
-//       max: 100, // 设置最大值
-//       step: 1, // 设置步长
-//       onChange: (value: number) => { // 计数器值变化时的回调
-//         this.spinDuration = value*1000;
-//         // this.calculateAngles(); // 重新计算角度
-//       }
-//     }
-//   }
-// }).backgroundColor(Color.White)
-
-
-// Row(){
-//   Column(){
-//     //是否允许结果重复
-//     Button('是否允许结果重复').onClick(()=>{
-//       this.isRepeat=!this.isRepeat
-//     })
-//     Text(this.isRepeat+"")
-//   }
-//
-// }

+ 0 - 132
features/feature/src/main/ets/view/EatWhatView.ets

@@ -1,132 +0,0 @@
-import { ReqString, YTAvoid, YTHeader, YTUserRequest } from 'basic'
-import { promptAction } from '@kit.ArkUI'
-
-@Builder
-function EatWhatViewBuilder(){
-  NavDestination(){
-    EatWhatView()
-  }.title("吃什么")
-  .hideTitleBar(true)
-}
-
-@Component
-struct EatWhatView{
-  @StorageProp(YTAvoid.SAFE_TOP_KEY) safeBottom: number = 0
-
-  // @State
-  // eat:ResourceStr[
-  eat: ImageFrameInfo[] = Array.from<string>({ length: 5 }).map<ImageFrameInfo>((v: string, index: number) => {
-    return {
-      src: $r(`app.media.${index+103}`),
-    }
-  })
-  @State
-  eatResult:string=""
-
-
-  @State
-  eatEat:ResourceStr=""
-  @State
-  isrun:boolean=false
-
-  interId:number=0
-
-  //图片随机
-  eatRandom(){
-    return  this.eat[Math.floor(Math.random()*this.eat.length)]
-  }
-  //最终接口数据
-  getEatResult(){
-    YTUserRequest.getEatResult((res)=>{
-      const a=res as ReqString
-      promptAction.showToast({
-        message:a['foodName'].toString()
-      })
-      this.eatResult=a['foodName']
-
-    })
-
-  }
-
-  private getNearEat(){
-    YTUserRequest.getNearEatResult((res)=>{
-      if(res!=null) {  //筛子一样,吃什么一样
-        const result = res as ReqString
-        this.eatResult= result['foodName']
-      }
-    })
-  }
-
-
-  aboutToAppear(): void {
-    this.getNearEat()
-  }
-
-
-  build() {
-    Column() {
-      YTHeader({ title: '吃什么' })
-      Row({ space: 20 }) {
-        // Stack() {
-        // Image($r('[basic].media.voicemuisc')).width(30).height(30).margin({left:20,right:50})
-        Column(){}.width(24).height(24).margin({left:20,right:50})
-
-      }.width('100%').margin({top:20}).justifyContent(FlexAlign.Start); // 设置宽度和内容居中对齐
-
-
-      Column() {
-
-          Column(){
-            if(this.isrun) {
-              Image(this.eatEat).width(30)
-            }else{
-              Text(this.eatResult)
-            }
-
-            // Text(this.eatEat).fontSize(20)
-          }.width(this.isrun?80:110)
-          .height(70)
-          .justifyContent(FlexAlign.Center)
-          .backgroundImage($r('[basic].media.number'))
-          .backgroundImageSize({width:'100%',height:"100%"})
-          .margin({bottom:40})
-
-        Image($r('[basic].media.eatwhatGai')).width(150)
-
-      }.width('100%').height(500).justifyContent(FlexAlign.Center).margin({bottom:100}) // 设置组件的宽度、权重、对齐方式和底部内边距
-
-
-
-
-        Button('换一个').fontColor(Color.White)
-        .backgroundColor('#fd54e3').width('70%')
-        .height(44).borderRadius(20)
-        .onClick(()=>{
-          this.isrun=true
-
-          setTimeout(()=>{
-            this.isrun=false
-            this.eatResult=""
-            clearInterval(this.interId)
-            this.getEatResult()
-
-          },3000)
-
-          if(this.isrun) {
-           this.interId= setInterval(() => {
-              this.eatEat = this.eatRandom().src as ResourceStr
-            }, 100)
-          }
-
-        })
-
-
-
-
-    }.padding({ bottom: this.safeBottom })
-    .height('100%')
-    .backgroundImage($r('[basic].media.backimgNumber'))
-    .backgroundImageSize({width:'100%',height:'100%'})
-    .backgroundColor(Color.White)
-  }
-}

+ 13 - 0
features/feature/src/main/ets/view/FragranceView.ets

@@ -0,0 +1,13 @@
+import { YTHeader } from 'basic';
+
+@Component
+export struct FragranceView{
+  build() {
+    Column(){
+
+    }.width('100%')
+    .height('100%')
+
+
+  }
+}

+ 280 - 82
features/feature/src/main/ets/view/MainView.ets

@@ -1,108 +1,306 @@
-import { DecisionItem, decisionItemList, userInfo, UserInfo, YTAvoid, yTRouter } from "basic"
-
+import { Vibration, YTAvoid, YTHeader } from 'basic';
 
+// 观察者模式装饰器
+@ObservedV2
+class Cell {
+  value: string = '功德+1'; // 默认显示的文字
+  @Trace // 跟踪属性变化
+  opacity: number = 0; // 文字透明度
+  @Trace // 跟踪属性变化
+  y: number = 0; // 文字的垂直偏移量
+}
 @Component
-export struct MainView {
-  @StorageProp(YTAvoid.SAFE_TOP_KEY)
-  top:number=0
-  @StorageProp(UserInfo.KEY) userInfo: UserInfo = userInfo
-  build() {
+export struct MainView{
+  @State currentIndex: number = 0
+  tabsController: TabsController = new TabsController()
+  @StorageProp(YTAvoid.SAFE_TOP_KEY) top: number = 0
+  @State list: Cell[] = []; // 存储所有 Cell 对象的数组
+  private indexCount: number = 0; // 记录当前滚动的索引
+  private count: number = 10; // 列表中 Cell 对象的数量
+  private image: ResourceStr=$r('app.media.muyu')
+
+  //动画true/false
+  @State isAnimation:boolean=false
+  //进度条
+  @State currentMerit:number=0
+  @State totalMerit:number=500
+
+  //时间间隔
+  @State time:number=1000
+
+  @State isShowTimeManger:boolean=false
+
+
+  @State valueTime:number=10
+
+  //点击动画
+  onclikMerit(){
+    if(this.isAnimation){
+      return
+    }
+    this.isAnimation=true
+    this.currentMerit++
+    let index = this.indexCount % this.count; // 计算当前滚动的索引
+    this.indexCount++; // 更新索引计数器
+    animateToImmediately({
+      // 立即开始动画
+      duration: 0, // 动画持续时间为0毫秒
+      onFinish: () => { // 动画完成后的回调
+        animateToImmediately({
+          // 再次立即开始动画
+          duration: 500, // 动画持续时间为1000毫秒
+          onFinish:()=>{
+            this.isAnimation=false
+          }
+        }, () => {
+          this.list[index].y = -200 // 设置 Cell 的垂直偏移量
+          this.list[index].opacity = 0 // 设置 Cell 的透明度
+        })
+
+      }
+    }, () => {
+      this.list[index].y = 0 // 设置 Cell 的垂直偏移量
+      this.list[index].opacity = 1 // 设置 Cell 的透明度
+
+    })
+
+  }
+
+  @Builder
+  timeMangerBuilder(){
     Column(){
+      Stack({alignContent:Alignment.Top}) {
+        Tabs({ barPosition: BarPosition.Start, controller: this.tabsController  }) {
+          TabContent() {
+
+            TextInput()
+              .width(60)
+              .height(20)
+              .padding(0)
+              .type(InputType.Number) // 设置输入类型为数字
+              .textAlign(TextAlign.Center)
+              .borderRadius(4)
+              .backgroundColor(Color.Gray)
+
+          }.tabBar('无限')
+
+          TabContent() {
+            TextInput()
+              .width(60)
+              .height(20)
+              .padding(0)
+              .type(InputType.Number) // 设置输入类型为数字
+              .textAlign(TextAlign.Center)
+              .borderRadius(4)
+              .backgroundColor(Color.Gray)
+
+          }.tabBar('固定次数')
+
+          TabContent() {
+            TextInput()
+              .width(60)
+              .height(20)
+              .padding(0)
+              .type(InputType.Number) // 设置输入类型为数字
+              .textAlign(TextAlign.Center)
+              .borderRadius(4)
+              .backgroundColor(Color.Gray)
+
+          }.tabBar('倒计时')
+
+        }.width('100%').barHeight(0)
+        Row(){
+          Text('无限')
+            .layoutWeight(1)
+            .borderRadius(10)
+            .height(30)
+            .backgroundColor(this.currentIndex==0?Color.Green:Color.Transparent)
+            .onClick(()=>{
+            this.currentIndex=0
+            this.tabsController.changeIndex(this.currentIndex)
+
+          })
+          Text('固定次数')
+            .layoutWeight(1)
+            .borderRadius(10)
+            .height(30)
+            .backgroundColor(this.currentIndex==1?Color.Green:Color.Transparent).onClick(()=>{
+            this.currentIndex=1
+            this.tabsController.changeIndex(this.currentIndex)
+
+          })
+          Text('倒计时')
+            .layoutWeight(1)
+            .borderRadius(10)
+            .height(30)
+            .backgroundColor(this.currentIndex==2?Color.Green:Color.Transparent)
+            .onClick(()=>{
+            this.currentIndex=2
+            this.tabsController.changeIndex(this.currentIndex)
+
+          })
+
+        }.width('100%')
+        .backgroundColor(Color.Pink)
+      }
+
+
+    }.width('100%')
+    .height('100%')
+    .padding({top:30})
+    .backgroundColor(Color.White)
+
+  }
+
+  // 初始化方法,在组件即将显示时被调用
+  aboutToAppear(): void {
+    for (let i = 0; i < this.count; i++) {
+      this.list.push(new Cell()); // 初始化 Cell 数组
+    }
+  }
+
+  build() {
+    Column() {
+
       Row(){
-        Text('樱桃决定').fontSize(18)
-          .fontWeight(700)
-          .fontColor(Color.Black)
-      }.width('100%')
-      .justifyContent(FlexAlign.Center)
-      .height(44 + this.top)
-      .padding({ top: this.top,left:18,right:9 }) //27 padding18
+        Text(`积功德: ${this.currentMerit}`).fontColor(Color.White).layoutWeight(2)
+        Text('清零').fontColor(Color.White).onClick(()=>{
+          this.currentMerit=0
+        }).layoutWeight(1)
 
+        Image($r('app.media.muyu')).width(30).layoutWeight(1)
 
-      Column(){
 
-        // Text('我是首页的swiper组件')
-        Image($r('[basic].media.banner')).width('100%').height(170).objectFit(ImageFit.Fill)
 
       }.width('100%')
-      .height(170)
-      // .margin({left:20,right:20})
-      // .backgroundColor(Color.Green)
-
-
-      Stack({alignContent:Alignment.Center}) {
-        Column() {
-          List({ space: 10 }) {
-            ForEach(decisionItemList, (item: DecisionItem, index) => {
-              ListItem() {
-                Row() {
-                  Text(item.title).fontSize(30)
-
-                }
-                .width('95%')
-                .height(100)
-                .borderRadius(20)
-                .backgroundImage(item.icon)
-                .backgroundImageSize({ width: '100%', height: 100 })
-                // .backgroundColor(Color.Red)
-                .justifyContent(FlexAlign.Center)
-                .onClick(() => {
-                  yTRouter.router2DecisionPage(item.pageName)
-                })
-              }
-            })
+      .justifyContent(FlexAlign.SpaceBetween)
 
-          }.margin({ top: 10 })
-          .alignListItem(ListItemAlign.Center)
-          .scrollBar(BarState.Off)
+      Row(){
+        Column(){
+          Progress({ value: this.currentMerit, total: this.totalMerit, type: ProgressType.Ring })
+            .width(120).color(Color.Orange)
+            .style({ strokeWidth: 10, shadow: true })
+            .backgroundColor(Color.White)
 
+          Text(`${this.currentMerit}/${this.totalMerit}`).fontColor(Color.White)
         }
-        .offset({ y: -20 })
-        .layoutWeight(1)
-        .padding({ left: 10, right: 10 })
-        .borderRadius({ topLeft: 20, topRight: 20 })
-        .backgroundColor(Color.White)
+        Column({space:30}){
+          Image($r('app.media.muyu')).width(30)
+          Image($r('app.media.muyu')).width(30)
+        }
+      }.width('100%').justifyContent(FlexAlign.SpaceBetween)
+
+      Row(){
+        Button('改变文字').onClick(()=>{
+          this.list.forEach(item=>{item.value='吴亮+1'})
+        })
+        Button('敲击时长间隔1秒').onClick(()=>{
+          this.time=1000
+
+        })
+        Button('固定10次').onClick(()=>{
+          //自动敲击
+          const a=setInterval(()=>{
+            this.onclikMerit()
+
+          },this.time)
+          const b=setTimeout(()=>{
+            clearInterval(a)
+            clearTimeout(b)
+          },this.time*10)
+
 
+        })
+        Button('倒计时规定时间').onClick(()=>{
+          this.onclikMerit()
+          const a=setInterval(()=>{
+            this.onclikMerit()
+          },this.time)
+          const b=setTimeout(()=>{
+            clearInterval(a)
+            clearTimeout(b)
+          },10000)
 
-        if(!this.userInfo.checkLogin()) {
-          Column() {
+        })
+      }
+
+      Button('xxx').bindSheet($$this.isShowTimeManger,this.timeMangerBuilder(),{
+        width:'100%',
+        height:400,
+        showClose:false
+      }).onClick(()=>{
+        this.isShowTimeManger=true
+      })
+
+      Button('震动').onClick(()=>{
+        Vibration.startVibration()
+      })
+
+
+      Stack() {
+        Progress({ value: this.valueTime, total: 70, type: ProgressType.Linear }).backgroundColor(Color.White)
+        Row({space:30}){
+          ForEach([0,10,20,30,40,50,60,70],(item:number)=>{
             Column(){
+            }.width(10)
+            .height(10)
+            .borderRadius('50%')
+            .onClick(()=>{
+              this.valueTime=item
+            })
+            .backgroundColor(this.valueTime>=item?Color.Pink:Color.White)
+          })
 
-            }.layoutWeight(1)
-            Row() {
-              Text('登录使用更多功能').fontColor(Color.White).fontSize(20)
-
-              Text('马上登录')
-                .padding({
-                  left: 8,
-                  right: 8,
-                  top: 6,
-                  bottom: 6
-                })
-                .backgroundColor('rgba(253, 84, 227, 1)')
-                .borderRadius(22)
-            }
-            .width('100%')
-            .justifyContent(FlexAlign.SpaceBetween)
-            .padding({ left: 20, right: 20 })
-            .height(56)
-            .backgroundColor('rgba(26, 26, 26, 0.4)')
-          }
-          .layoutWeight(1)
-          .width('100%')
-          .onClick(() => {
-            yTRouter.router2LoginPage()
+
+        }.width('100%')
+
+      }
+
+
+
+      Column() { // 创建一个垂直布局容器
+        Stack() { // 创建一个堆栈布局容器
+          ForEach(this.list, (item: Cell, _index: number) => { // 遍历 list 中的每一个 Cell
+            Text(item.value)// 显示 Cell 中的文字
+              .fontColor(Color.White)// 设置文字颜色为白色
+              .fontSize('50lpx')// 设置文字大小
+              .translate({ x: 0, y: `${item.y}lpx` })// 设置文字的垂直偏移量
+              .opacity(item.opacity) // 设置文字的透明度
           })
-          .justifyContent(FlexAlign.End)
         }
+        .width(200) // 设置堆栈布局容器的宽度
+        .height(200) // 设置堆栈布局容器的高度
+        .align(Alignment.BottomEnd) // 设置对齐方式为底部右端
 
-      }.layoutWeight(1)
-
+        Image(this.image)// 显示图片
+          .width(200)// 设置图片宽度
+          .height(200)// 设置图片高度
+          .objectFit(ImageFit.Contain)// 图片适应容器
+          .clickEffect({
+            // 点击效果配置
+            scale: 0.5, // 缩放比例
+            level: ClickEffectLevel.LIGHT // 效果级别
+          })
+          .onClick(() => { // 点击图片时触发的回调
+            this.onclikMerit()
+          })
 
+        Row(){
 
+          Image($r('app.media.muyu')).width(30)
+        }.width('100%')
+        .justifyContent(FlexAlign.End)
+      }
+      .width('100%')
+      .backgroundColor(Color.Black) // 设置背景颜色为黑色
 
     }.width('100%')
     .height('100%')
-    .backgroundImage($r('[basic].media.back'))
-    .backgroundImageSize({width:'100%',height:'100%'})
+    .padding({
+      top:this.top,
+      left:16,
+      right:16
+    })
+    .backgroundColor(Color.Black)
   }
 }

+ 0 - 411
features/feature/src/main/ets/view/RanNumberView.ets

@@ -1,411 +0,0 @@
-import { it } from '@ohos/hypium';
-import { IBestToast, ReqString, YTAvoid, YTButton, YTHeader, YTRequest, YTUserRequest } from 'basic'
-import { LengthMetrics, promptAction } from '@kit.ArkUI';
-
-@Builder
-function RanNumberViewBuilder(){
-  NavDestination(){
-    RanNumberView()
-  }.title("随机数")
-  .hideTitleBar(true)
-}
-@Component
-struct RanNumberView{
-  @StorageProp(YTAvoid.SAFE_TOP_KEY) safeBottom: number = 0
-
-  // 存储生成的随机数字符串
-  @State private generatedNumbers: string = '';
-  // 应用的主题色
-  @State private primaryColor: string = '#fea024';
-  // 文本的颜色
-  @State private fontColor: string = "#2e2e2e";
-  // 输入框是否获取焦点的状态变量
-  @State private isFocusStart: boolean = false;
-  @State private isFocusEnd: boolean = false;
-  @State private isFocusCount: boolean = false;
-  // 是否允许生成的随机数重复
-  // @State private isUnique: boolean = true;
-  // 随机数生成的起始值
-
-  @State startText:string=""
-  @State endText:string=""
-  @State countText:string=""
-
-  private startValue: number = 0;
-  // 随机数生成的结束值
-  private endValue: number = 0;
-  // 要生成的随机数个数
- private  countValue: number = 0;
-
-  @State private randomNumberArr:number[]=[]
-
-
-  /**
-   * todo:bug:
-   * 改变值,会引起UI刷新
-   */
-  // 生成随机数的方法
-  // // 将生成的随机数复制到剪贴板的方法
-  // private copyToClipboard(text: string): void {
-  //   const pasteboardData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, text); // 创建剪贴板数据
-  //   const systemPasteboard = pasteboard.getSystemPasteboard(); // 获取系统剪贴板
-  //   systemPasteboard.setData(pasteboardData); // 设置剪贴板数据
-  //   // 显示复制成功的提示信息
-  //   promptAction.showToast({ message: '已复制' });
-  // }
-
-  private getNumber(count:number,maxnumber:number,minnumber:number){
-    YTUserRequest.getNumberResult(count,maxnumber,minnumber,(res)=>{
-
-      const result=res as ReqString
-
-      this.generatedNumbers=result['results']
-      this.randomNumberArr=this.generatedNumbers.split(',').map(item=>Number(item))
-
-    })
-  }
-  private getNearNumber(){
-    YTUserRequest.getNearNumberResult((res)=>{
-      if(res!=null) {  //筛子一样,吃什么一样
-        const result = res as ReqString
-        this.startValue = Number(result['minValue'])
-        this.startText=result['minValue']
-        this.endValue = Number(result['maxValue'])
-        this.endText=result['maxValue']
-        this.countValue = Number(result['count'])
-        this.countText=result['count']
-        this.generatedNumbers = result['results']
-        this.randomNumberArr = this.generatedNumbers.split(',').map(item => Number(item))
-      }
-    })
-  }
-
-
-  aboutToAppear(): void {
-    this.getNearNumber()
-  }
-
-  build() {
-    Column() {
-      YTHeader({ title: '随机数' })
-      //声音
-      Row(){
-        Column(){}.width(24).height(24)
-        // Image($r('[basic].media.voicemuisc')).width(24)
-      }.width('100%')
-      .justifyContent(FlexAlign.Start)
-      .padding({left:30})
-
-      Column() {
-
-        Flex({ wrap: FlexWrap.Wrap,space:{cross:LengthMetrics.vp(22),main:LengthMetrics.vp(22)} }) {
-          ForEach(this.randomNumberArr, (item: number, index: number) => {
-            Column() {
-              Text(item.toString()).width(30)
-
-            }
-            .width(this.countValue > 3 ? 60 : 88)
-            .height(this.countValue > 3 ? 52 : 76)
-            .justifyContent(FlexAlign.Center)
-            .alignItems(HorizontalAlign.Center)
-            // .margin({ bottom: 20 })
-            .backgroundImage($r('[basic].media.number'))
-            .backgroundImageSize({ width: "100%", height: '100%' })
-
-          })
-
-
-        }.padding({ left: 34, right: 34 })
-      }.width('100%')
-      .height(300)
-
-      // 输入随机数范围的两个值
-      Column({space:20}) {
-        Row() {
-          Text('取值范围:').margin({right:30})
-          Column() {
-            TextInput({text: $$this.startText }) // 输入框,显示占位符
-              .width(46)
-              .height(46)
-              .padding(0)
-              .type(InputType.Number) // 设置输入类型为数字
-              .placeholderColor('rgba(0, 0, 0, 0.95)')
-              .textAlign(TextAlign.Center)
-              .fontColor('rgba(0, 0, 0, 0.95)')
-              .borderRadius(8) // 设置圆角半径
-              .backgroundColor(Color.White) // 设置背景颜色
-              .showUnderline(false) // 不显示下划线
-              .onChange((value: string) => {
-                if (Number(value) > 100) {
-                  IBestToast.show({
-                    message: '生成范围只能是100以内'
-                  })
-                  return
-                }
-                if (Number(value) < 0) {
-                  IBestToast.show({
-                    message: '生成范围不能小于0'
-                  })
-                  return
-                }
-                this.startText=value
-                this.startValue = Number(value)
-
-              }); // 输入值变化时的处理
-          }.width(50)
-          .height(50)
-          .justifyContent(FlexAlign.Center)
-          .backgroundImage($r('[basic].media.caikuang'))
-          .backgroundImageSize({ width: 50, height: 50 })
-
-          // 分隔符
-          // Line().width(10) // 设置分隔符宽度
-          Column().width(27).height(1).backgroundColor('rgba(0, 0, 0, 0.35)').margin({left:4,right:4})
-          Column() {
-          TextInput({text:$$this.endText}) // 输入框,显示占位符
-            .width(46)
-            .height(46)
-            .padding(0)
-            .type(InputType.Number) // 设置输入类型为数字
-            .textAlign(TextAlign.Center)
-            .placeholderColor('rgba(0, 0, 0, 0.95)')
-            .fontColor('rgba(0, 0, 0, 0.95)')
-            .borderRadius(8) // 设置圆角半径
-            .backgroundColor(Color.White) // 设置背景颜色
-            .showUnderline(false) // 不显示下划线
-            .onChange((value: string) =>{
-              if(Number(value)>100){
-                IBestToast.show({
-                  message:'生成范围只能是100以内'
-                })
-                return
-              }
-              if(Number(value)<0){
-                IBestToast.show({
-                  message:'生成范围不能小于0'
-                })
-                return
-              }
-              this.endText=value
-              this.endValue = Number(value)
-            }); // 输入值变化时的处理
-          }.width(50)
-          .height(50)
-          .justifyContent(FlexAlign.Center)
-          .backgroundImage($r('[basic].media.caikuang'))
-          .backgroundImageSize({ width: 50, height: 50 })
-
-
-
-        }.width('100%').margin({top:10})
-
-        Row() {
-          Text('生成个数:').margin({right:30})
-          Column() {
-          TextInput({text:$$this.countText}) // 输入框,显示占位符
-            .width(46)
-            .height(46)
-            .padding(0)
-            .textAlign(TextAlign.Center)
-            .type(InputType.Number) // 设置输入类型为数字
-            .placeholderColor('rgba(0, 0, 0, 0.95)')
-            .fontColor('rgba(0, 0, 0, 0.95)')
-            .borderRadius(8) // 设置圆角半径
-            .backgroundColor(Color.White) // 设置背景颜色
-            .showUnderline(false) // 不显示下划线
-            .onChange((value: string) =>{
-              if(Number(value)>10){
-                IBestToast.show({
-                  message:'只能生成10个数'
-                })
-                return
-              }
-              if(Number(value)<0){
-                IBestToast.show({
-                  message:'不能是负数'
-                })
-                return
-              }
-
-              this.countText=value
-            this.countValue = Number(value)
-
-            }); // 输入值变化时的处理
-          }.width(50)
-          .height(50)
-          .justifyContent(FlexAlign.Center)
-          .backgroundImage($r('[basic].media.caikuang'))
-          .backgroundImageSize({ width: 50, height: 50 })
-        }.width('100%')
-      }.width(330)
-      .height(170)
-      .padding({left:30,top:10})
-      .borderRadius(20)
-      .backgroundColor('#e0f8ff')
-      .justifyContent(FlexAlign.Start)
-
-      Row() {
-          Row() {
-            Text('最大范围').fontSize(12).fontColor('rgba(0, 0, 0, 0.45)').margin({top:2})
-            Text('0-100').fontSize(12).fontColor('rgba(0, 0, 0, 0.65)').margin({bottom:2})
-          }.margin({ right: 40 })
-        Row() {
-          Text('最多生成').fontSize(12).fontColor('rgba(0, 0, 0, 0.45)').margin({top:2})
-          Text('十个数').fontSize(12).fontColor('rgba(0, 0, 0, 0.65)').margin({bottom:2})
-        }
-      }.width('100%')
-      .padding({
-        left: 72,
-        right: 72,})
-      .margin({
-        bottom: 67,
-        top: 16
-      })
-      .justifyContent(FlexAlign.Center)
-
-      // Button('数字是否可以重复').onClick(()=>{
-      //   this.isUnique=!this.isUnique
-      // })
-      // Text(JSON.stringify(this.isUnique))
-
-      YTButton({
-        bgc:'#fd54e3',
-        btHeight:40,
-        btBorderRadius:24,
-        btWidth:246,
-        btFontColor:Color.White,
-        btFontSize:20,
-        click:()=>{
-          if(this.countValue==0){
-            IBestToast.show({
-              message:'最少生成1个数'
-            })
-            return
-          }
-
-          if(this.countValue==10){
-            IBestToast.show({
-              message:'最多生成10个数'
-            })
-            return
-          }
-
-          if(this.endText==""){
-            this.endText="0"
-          }
-          if(this.startText==""){
-            this.startText="0"
-          }
-          if(this.countText==""){
-            this.countText="0"
-          }
-
-          this.getNumber(this.countValue,this.endValue,this.startValue)
-          //不随机生成,从后端拿
-          // this.generateRandomNumbers()
-        },
-        btContent:'随机数生成'
-
-      })
-
-    }.padding({ bottom: this.safeBottom })
-    .height('100%')
-    .backgroundColor(Color.White)
-    .backgroundImage($r('[basic].media.backimgNumber'))
-    .backgroundImageSize({width:'100%',height:"100%"})
-  }
-}
-/**
- *  Row() {
- Text('数字是否可重复')
- .fontWeight(400) // 设置字体粗细为400
- .fontSize(16) // 设置字体大小为16
- .fontColor(this.fontColor) // 设置文本颜色
- .layoutWeight(1); // 设置布局权重为1
-
- Toggle({ type: ToggleType.Checkbox, isOn: this.isUnique }) // 切换按钮
- .width('100lpx') // 设置宽度
- .height('50lpx') // 设置高度
- .borderColor(Color.Gray) // 设置边框颜色
- .selectedColor(this.primaryColor) // 设置选中时的颜色
- .onChange((isOn: boolean) => this.isUnique = isOn) // 切换状态变化时的处理
- .align(Alignment.End); // 设置对齐方式为右对齐
- }
- .margin({
- top: `${this.baseSpacing}lpx`, // 上边距
- })
- .width('100%') // 设置宽度为100%
- .padding({
- left: `${this.baseSpacing}lpx`, // 左内边距
- right: `${this.baseSpacing}lpx`, // 右内边距
- top: `${this.baseSpacing / 3}lpx`, // 上内边距
- })
- .hitTestBehavior(HitTestMode.Block) // 设置点击测试行为
- .onClick(() => this.isUnique = !this.isUnique); // 点击时切换状态
- */
-/**
- *  private generateRandomNumbers(): void {
-
- const startValue = this.startValue; // 获取当前设定的起始值
- const endValue = this.endValue; // 获取当前设定的结束值
- const countValue = this.countValue; // 获取当前设定的生成个数
- const range: number = endValue - startValue + 1; // 计算生成范围
-
-
- // 用于存储生成的随机数
- const generatedNumbers = new Set<number>(); // 使用Set来自动去重
- const tempArray: number[] = []; // 临时数组,用于辅助生成不重复的随机数
-
- // 如果不允许重复,则使用去重算法生成随机数
- if (!this.isUnique) {
- // 如果请求的随机数数量超过了范围内的总数,则显示错误提示
- if (countValue > range) {
- this.getUIContext().showAlertDialog({
- title: '错误提示',
- message: `请求的随机数数量超过了范围内的总数`,
- confirm: {
- defaultFocus: true,
- value: '我知道了',
- fontColor: Color.White,
- backgroundColor: this.primaryColor,
- action: () => {} // 点击确认后的回调
- },
- onWillDismiss: () => {}, // 对话框即将关闭时的回调
- alignment: DialogAlignment.Center, // 对话框的对齐方式
- });
- return;
- }
-
- for (let i = 0; i < countValue; i++) {
- let randomIndex = Math.floor(Math.random() * (range - i)); // 在剩余范围内选择一个随机索引
- let randomNum = 0;
- if (tempArray[randomIndex] !== undefined) { // 如果索引位置已有值,则使用该值
- randomNum = tempArray[randomIndex];
- } else {
- randomNum = startValue + randomIndex; // 否则计算新的随机数
- }
- generatedNumbers.add(randomNum); // 添加到Set中,自动去重
- if (tempArray[range - 1 - i] === undefined) { // 更新末尾元素的位置
- tempArray[range - 1 - i] = startValue + range - 1 - i;
- }
- tempArray[randomIndex] = tempArray[range - 1 - i]; // 将末尾元素移到随机位置
- }
- // 将生成的随机数转换成JSON格式的字符串
- this.generatedNumbers = JSON.stringify(Array.from(generatedNumbers));
- } else {
- // 如果允许重复,则直接生成随机数
- for (let i = 0; i < this.countValue; i++) {
- let randomNumber = this.startValue + Math.floor(Math.random() * (this.endValue - this.startValue));
- tempArray.push(randomNumber);
- }
- // 将生成的随机数转换成JSON格式的字符串
- this.generatedNumbers = JSON.stringify(tempArray);
- }
-
- //最终将生成的字符串转化为数组
- this.randomNumberArr=JSON.parse(this.generatedNumbers)
- // this.flexChangeValue=this.countValue
-
-
- }
- */

+ 0 - 257
features/feature/src/main/ets/view/RollDiceView.ets

@@ -1,257 +0,0 @@
-import { ReqString, YTAvoid, YTHeader, YTUserRequest } from 'basic'
-import { promptAction, PromptAction } from '@kit.ArkUI'
-import { it } from '@ohos/hypium'
-
-@Builder
-function RollDiceViewBuilder(){
-  NavDestination(){
-    RollDiceView()
-  }.title("掷筛子")
-  .hideTitleBar(true)
-}
-
-@Component
-struct RollDiceView {
-  @StorageProp(YTAvoid.SAFE_TOP_KEY) safeBottom: number = 0
-  //遮罩层的动画图片数组
-  cupImages: ImageFrameInfo[] =Array.from<string>({length:58}).map<ImageFrameInfo>((v:string,index:number)=>{
-    return {
-      src: $r(`app.media.beizi_${index}`),
-    }
-  })
-
-  @State state:AnimationStatus = AnimationStatus.Initial
-
-
-  images: ImageFrameInfo[] = Array.from<string>({ length: 5 }).map<ImageFrameInfo>((v: string, index: number) => {
-    return {
-      src: $r(`[basic].media.shai_${index+1}`),
-    }
-  })
-
-
-  @State currentIndex:number=0
-  controller: VideoController = new VideoController();
-
-
-  //几颗筛子
-  @State
-  number:number=1
-
-  //当前筛子的选中数量
-  @State
-  currSelectNumber:number=0
-
-  randomNumber():number{
-   return Math.floor(Math.random()*5)
-  }
-  //筛子结果
-  @State
-  RollDiceList:number[]=[0]
-
-  //获取筛子
-  getDiceResult(number:number){
-
-      YTUserRequest.getRollDiceResult(number,(res,err)=>{
-        // promptAction.showToast({
-        //   message:JSON.stringify(res)
-        // })
-        const a=res as ReqString
-        promptAction.showToast({
-          message:a['diceResults'].toString()
-        })
-        this.RollDiceList=a['diceResults'].split(',').map(item=>{
-          return Number(item)-1
-        })
-
-      })
-
-
-
-  }
-  private getNearRollDice(){
-    YTUserRequest.getNearRollDiceResult((res)=>{
-      if(res!=null) {  //筛子一样,吃什么一样
-        const result = res as ReqString
-        this.number= Number(result['diceCount'])
-        this.currSelectNumber=this.number-1
-        this.RollDiceList= result['diceResults'].split(',').map(item=>{
-          return Number(item)-1
-        })
-      }
-    })
-  }
-
-
-  aboutToAppear(): void {
-    this.getNearRollDice()
-  }
-
-  build() {
-    Column() {
-      YTHeader({ title: '掷筛子' })
-
-      Column(){
-
-        Stack() {
-
-
-          Column() {
-            if (this.currSelectNumber+1 == 1) {
-              Column() {
-                Image($r(`[basic].media.shai_${this.RollDiceList[0] + 1}`)).width(150)
-              }
-            } else if (this.currSelectNumber+1  == 2) {
-              Column() {
-                Row() {
-                  Image($r(`[basic].media.shai_${this.RollDiceList[0] + 1}`)).width(100)
-                }.width('100%')
-                .justifyContent(FlexAlign.Start)
-
-                Row() {
-                  Image($r(`[basic].media.shai_${this.RollDiceList[1] + 1}`)).width(100)
-                }.width('100%')
-                .justifyContent(FlexAlign.End)
-              }
-            } else if (this.currSelectNumber+1  == 3) {
-              Column() {
-                Row() {
-                  Image($r(`[basic].media.shai_${this.RollDiceList[0] + 1}`)).width(100)
-                }.width('100%')
-                .justifyContent(FlexAlign.Center)
-
-                Row({space:10}) {
-                  Image($r(`[basic].media.shai_${this.RollDiceList[1] + 1}`)).width(100)
-                  Image($r(`[basic].media.shai_${this.RollDiceList[2] + 1}`)).width(100)
-                }.width('100%')
-                .justifyContent(FlexAlign.Center)
-              }
-            } else if (this.currSelectNumber+1  == 4) {
-              Column() {
-                Row({space:10}) {
-                  Image($r(`[basic].media.shai_${this.RollDiceList[0] + 1}`)).width(60)
-                  Image($r(`[basic].media.shai_${this.RollDiceList[1] + 1}`)).width(60)
-                }.width('100%')
-                .justifyContent(FlexAlign.Center)
-
-                Row({space:10}) {
-                  Image($r(`[basic].media.shai_${this.RollDiceList[2] + 1}`)).width(60)
-                  Image($r(`[basic].media.shai_${this.RollDiceList[3] + 1}`)).width(60)
-                }.width('100%')
-                .justifyContent(FlexAlign.Center)
-              }
-            } else if (this.currSelectNumber+1  == 5) {
-              Column() {
-                Row({space:30}) {
-                  Image($r(`[basic].media.shai_${this.RollDiceList[0] + 1}`)).width(60)
-                  Image($r(`[basic].media.shai_${this.RollDiceList[1] + 1}`)).width(60)
-                }.width('100%')
-                .justifyContent(FlexAlign.Center)
-
-                Row({space:10}) {
-                  Image($r(`[basic].media.shai_${this.RollDiceList[2] + 1}`)).width(60)
-                  Image($r(`[basic].media.shai_${this.RollDiceList[3] + 1}`)).width(60)
-                  Image($r(`[basic].media.shai_${this.RollDiceList[4] + 1}`)).width(60)
-                }.width('100%')
-                .justifyContent(FlexAlign.Center)
-              }
-            }
-            // else if (this.currSelectNumber+1  == 6) {
-            //   Column() {
-            //     Row() {
-            //       Image($r(`[basic].media.shai_${this.RollDiceList[0] + 1}`)).width(60).height(60)
-            //       Image($r(`[basic].media.shai_${this.RollDiceList[1] + 1}`)).width(60).height(60)
-            //       Image($r(`[basic].media.shai_${this.RollDiceList[2] + 1}`)).width(60).height(60)
-            //
-            //     }.width('100%')
-            //     .justifyContent(FlexAlign.Center)
-            //
-            //     Row() {
-            //       Image($r(`[basic].media.shai_${this.RollDiceList[3] + 1}`)).width(60).height(60)
-            //       Image($r(`[basic].media.shai_${this.RollDiceList[4] + 1}`)).width(60).height(60)
-            //       Image($r(`[basic].media.shai_${this.RollDiceList[5] + 1}`)).width(60).height(60)
-            //     }.width('100%')
-            //     .justifyContent(FlexAlign.End)
-            //   }
-            // }
-          }.width(200)
-          .height(400)
-          .margin({bottom:100})
-          .justifyContent(FlexAlign.End)
-
-          ImageAnimator()
-            .width('110%')
-            .height(500)
-            .images(this.cupImages)// 动画数组
-            .duration(this.cupImages.length * 100)// 持续
-            .state(this.state)// 动画状态
-            .iterations(-1) // 播放次数
-
-
-        }.width('100%')
-        .height(500)
-
-
-      }.width('100%')
-      .height(500)
-      .justifyContent(FlexAlign.Center)
-      //随机选取图片
-      Button('掷筛子').fontColor(Color.White)
-        .backgroundColor('#fd54e3').width('70%')
-        .height(44).borderRadius(20)
-        .margin({top:40,bottom:30})
-        .onClick(()=>{
-
-
-        this.state=AnimationStatus.Running
-        this.RollDiceList=[]
-       // const timeCupId=setTimeout(()=>{
-       //    this.number=(Math.floor(Math.random()*6)+1)
-       //    for(let i=0;i<this.number;i++){
-       //      this.RollDiceList.push(this.randomNumber())
-       //    }
-       //  },3000)
-
-          const timeCupId=setTimeout(()=>{
-            this.getDiceResult(this.number)
-           },3000)
-
-
-        const timeId=setTimeout(()=>{
-          this.state=AnimationStatus.Stopped
-
-        },this.cupImages.length * 100)
-      })
-      Row({space:15}) {
-        ForEach([0, 1, 2, 3, 4],(item:number,index:number)=>{
-          Text((item+1).toString())
-            .width(50)
-            .height(50)
-            .textAlign(TextAlign.Center)
-            .border({width:1,color:'#000000'})
-            .borderRadius('50%')
-            .backgroundColor(this.currSelectNumber==index?'#bff2ff':'#f2f2f2').onClick(()=>{
-            this.currSelectNumber=index
-            this.number=item+1
-            this.RollDiceList=[]
-            for (let idx = 0; idx < item+1; idx++) {
-              this.RollDiceList.push(idx)
-            }
-
-
-          })
-        })
-
-      }
-
-
-
-
-
-    }.padding({ bottom: this.safeBottom })
-    .height('100%')
-    .backgroundImage($r('[basic].media.backimgNumber'))
-    .backgroundImageSize({width:'100%',height:'100%'})
-  }
-
-}

+ 0 - 292
features/feature/src/main/ets/view/TossCoinView.ets

@@ -1,292 +0,0 @@
-import { coinItem, ReqString, YTAvoid, YTHeader, YTUserRequest } from 'basic'
-import { promptAction } from '@kit.ArkUI'
-
-@Builder
-function TossCoinViewBuilder(){
-  NavDestination(){
-    TossCoinView()
-  }.title("抛硬币")
-  .hideTitleBar(true)
-}
-
-@Component
-struct TossCoinView{
-  @StorageProp(YTAvoid.SAFE_TOP_KEY) safeBottom: number = 0
-  @State cellWidth: number = 50 // 单元格宽度
-  @State headsCount: number = 0 // 正面朝上的次数
-  @State tailsCount: number = 0 // 反面朝上的次数
-  @State rotationAngle: number = 0 // 旋转角度
-  @State verticalOffset: number = 0 // 纵向位移
-  @State isAnimRun: boolean = false // 动画是否正在执行
-
-  @State isfore:boolean=true
-  @StorageLink('coinData')
-  coinReslut:coinItem={} as coinItem
-
-  number1:number[]=[22,26,30,34]
-  number2:number[]=[24,28,32,36]
-
-
-  getResult() {
-
-      YTUserRequest.getTossCoinResult((res)=>{
-        const a=res as ReqString
-        const b=a['result'] as string
-        promptAction.showToast({
-          message:b
-        })
-        if(b=='正面'){
-          this.rotationAngle=0
-        }else{
-          this.rotationAngle=180
-        }
-
-      })
-  }
-  //后端没有给出重置相关接口,数据量不大可以存本地
-
-
-
-
-
-  // 判断当前是否显示正面
-  isHeadsFaceUp() {
-    let normalizedAngle = this.rotationAngle % 360; // 规范化角度
-    // promptAction.showToast({
-    //   message:normalizedAngle.toString()
-    // })
-    // 判断角度范围,确定是否显示正面
-    if (normalizedAngle >= 0 && normalizedAngle < 90 || normalizedAngle >= 270 && normalizedAngle <= 360) {
-      return true; // 显示正面
-    }else {
-      return false; // 显示反面
-    }
-  }
-  runAnimation(){
-    if (this.isAnimRun) {
-      return;
-    }
-    this.isAnimRun = true
-
-    let maxAnimationSteps = 2 * (10 + Math.floor(Math.random() * 10)); // 计算最大动画次数
-    let totalAnimationDuration = 1500; // 动画总时长 2000
-
-
-    // 第一次动画,向上抛出
-    animateToImmediately({
-      duration: totalAnimationDuration / 2, // 动画时长为总时长的一半
-      onFinish: () => { // 动画完成后的回调
-        // 第二次动画,向下落
-        animateToImmediately({
-          duration: totalAnimationDuration / 2,
-          onFinish: () => {
-            this.rotationAngle = this.rotationAngle % 360; // 确保角度在0到360之间
-            // 判断当前显示的面
-            if (this.isHeadsFaceUp()) { // 如果是正面
-              this.tailsCount++; // 反面朝上的次数加1
-            } else { // 如果是反面
-              this.headsCount++; // 正面朝上的次数加1
-            }
-            this.coinReslut={back:this.tailsCount,fore:this.headsCount,currRes:this.isHeadsFaceUp()?'正面':'反面'}
-            this.isAnimRun = false
-          }
-        }, () => {
-          this.verticalOffset = 0; // 重置纵向位移
-        });
-      }
-    }, () => {
-      // 设置纵向位移,模拟抛硬币的效果
-      this.verticalOffset = -100 * (1 + Math.floor(Math.random() * 2)); // 随机设置向上的位移
-    });
-
-    // 循环动画,增加旋转效果
-    for (let i = 0; i < maxAnimationSteps; i++) {
-      animateToImmediately({
-        delay: i * totalAnimationDuration / maxAnimationSteps, // 设置每次动画的延迟
-        duration: 100, // 每次动画的持续时间
-        onFinish: () => {
-          // 动画完成后的回调
-        }
-      }, () => {
-        this.rotationAngle += 90; // 每次增加90度旋转
-      });
-    }
-
-  }
-  aboutToAppear(): void {
-    this.tailsCount=this.coinReslut.back
-    this.headsCount=this.coinReslut.fore
-    if (this.coinReslut.currRes=='正面') {
-      this.rotationAngle=0
-    }else {
-      this.rotationAngle=180
-    }
-
-  }
-
-  build() {
-    Column() {
-      YTHeader({ title: '抛硬币' })
-
-
-
-      Row({ space: 20 }) {
-        // Stack() {
-        Column(){}.width(24).height(24).margin({left:20,right:50})
-        //  Image($r('[basic].media.voicemuisc')).width(30).height(30).margin({left:20,right:50})
-        //
-        // }
-        // .borderRadius('50%') // 设置圆角
-        // .width(20) // 设置宽度
-        // .height(20) // 设置高度
-        // .linearGradient({
-        //   // 设置线性渐变背景
-        //   direction: GradientDirection.LeftBottom,
-        //   colors: [['#ebcf2f', 0.0], ['#fef888', 0.5], ['#ebcf2f', 1.0]]
-        // });
-        Text('正')
-
-        // 显示反面朝上的次数
-        Text(`${this.tailsCount}`)
-          .fontSize(20)
-          .fontColor(Color.Black);
-
-        // Stack() {
-        //   // 显示100
-        //   Image($r('[basic].media.coinback')).width(20).height(20).borderRadius(10)
-        // }
-        // .borderRadius('50%') // 设置圆角
-        // .width(20) // 设置宽度
-        // .height(20) // 设置高度
-        // .linearGradient({
-        //   // 设置线性渐变背景
-        //   direction: GradientDirection.LeftBottom,
-        //   colors: [['#ebcf2f', 0.0], ['#fef888', 0.5], ['#ebcf2f', 1.0]]
-        // });
-        Text('反')
-
-        // 显示正面朝上的次数
-        Text(`${this.headsCount}`)
-          .fontSize(20)
-          .fontColor(Color.Black);
-        Image($r('[basic].media.repeat')).width(30).height(30).margin({left:50,right:20}).onClick(()=>{
-         //重置
-          this.tailsCount=0
-          this.headsCount=0
-          this.rotationAngle=0
-          this.isHeadsFaceUp()
-          this.coinReslut={back:0,fore:0,currRes:'正面'} as coinItem
-        })
-
-      }.width('100%').margin({top:20}).justifyContent(FlexAlign.Center); // 设置宽度和内容居中对齐
-
-      Column() {
-        if(!this.isAnimRun){
-          Column(){
-            Text(this.isHeadsFaceUp()?'正':"反").fontSize(20)
-          }.width(80)
-          .height(70)
-          .justifyContent(FlexAlign.Center)
-          .backgroundImage($r('[basic].media.number'))
-          .backgroundImageSize({width:'100%',height:"100%"})
-          .margin({bottom:40})
-        }
-
-
-        Stack() {
-          // 创建放大版地鼠组件
-          // Hamster({ cellWidth: this.cellWidth * 3 })
-          //   .visibility(this.isHeadsFaceUp() ? Visibility.Visible : Visibility.Hidden); // 根据状态显示或隐藏
-
-          Image($r('[basic].media.coinbefore')).width('100%').visibility(this.isHeadsFaceUp() ? Visibility.Visible : Visibility.Hidden)
-
-          // 显示100
-          Image($r('[basic].media.coinback'))
-            .width('100%')
-            .visibility(!this.isHeadsFaceUp() ? Visibility.Visible : Visibility.Hidden)// 根据状态显示或隐藏
-            .rotate({
-              // 旋转180度
-              x: 1,
-              y: 0,
-              z: 0,
-              angle: 180
-            });
-        }
-        .borderRadius('50%') // 设置圆角
-        .width(180) // 设置宽度
-        .height(180) // 设置高度
-        .shadow({
-          radius:5,
-          color:"#f8cd46",
-          offsetY:this.isHeadsFaceUp() ?15:-15
-        })
-        // .linearGradient({
-        //   // 设置线性渐变背景
-        //   direction: GradientDirection.LeftBottom,
-        //   colors: [['#ebcf2f', 0.0], ['#fef888', 0.5], ['#ebcf2f', 1.0]]
-        // })
-        .rotate({
-          // 根据当前角度旋转
-          x: 1,
-          y: 0,
-          z: 0,
-          // angle:30
-          angle: this.rotationAngle
-        })
-        .translate({ x: 0, y: this.verticalOffset }) // 设置纵向位移
-      }.width('100%').height(500).justifyContent(FlexAlign.Center).margin({bottom:100}) // 设置组件的宽度、权重、对齐方式和底部内边距
-
-      Button('抛硬币').fontColor(Color.White)
-        .backgroundColor('#fd54e3').width('70%')
-        .height(44).borderRadius(20)
-        .onClick(()=>{
-          if (this.isAnimRun) {
-            return;
-          }
-          this.runAnimation()
-          setTimeout(()=>{
-            this.getResult()
-          },1000)
-
-        })
-
-      //
-      // Button('xxxx').onClick(()=>{
-      //   YTUserRequest.getTossCoinResult((res)=>{
-      //     const a=res as ReqString
-      //     const b=a['result']
-      //     promptAction.showToast({
-      //       message:b.toString()
-      //     })
-      //   })
-      // })
-      // Button('xxxx').onClick(()=>{
-      //   YTUserRequest.getRollDiceResult(3,(res,err)=>{
-      //     // promptAction.showToast({
-      //     //   message:JSON.stringify(res)
-      //     // })
-      //     const a=res as ReqString
-      //     promptAction.showToast({
-      //       message:a['diceResults'].toString()
-      //     })
-      //   })
-      // })
-
-      // Button('xxx').onClick(()=>{
-      //   YTUserRequest.getNumberResult(3,10,1,(res)=>{
-      //     const a=res as ReqString
-      //     promptAction.showToast({
-      //       message:JSON.stringify(a)
-      //     })
-      //   })
-      // })
-
-
-    }.padding({ bottom: this.safeBottom })
-    .height('100%')
-    .backgroundImage($r('[basic].media.backimgNumber'))
-    .backgroundImageSize({width:'100%',height:'100%'})
-
-  }
-
-}

BIN
features/feature/src/main/resources/base/media/103.png


BIN
features/feature/src/main/resources/base/media/104.png


BIN
features/feature/src/main/resources/base/media/105.png


BIN
features/feature/src/main/resources/base/media/106.png


BIN
features/feature/src/main/resources/base/media/107.png


BIN
features/feature/src/main/resources/base/media/108.png


BIN
features/feature/src/main/resources/base/media/109.png


BIN
features/feature/src/main/resources/base/media/110.png


BIN
features/feature/src/main/resources/base/media/114.png


BIN
features/feature/src/main/resources/base/media/115.png


BIN
features/feature/src/main/resources/base/media/beizi_1.png


BIN
features/feature/src/main/resources/base/media/beizi_10.png


BIN
features/feature/src/main/resources/base/media/beizi_11.png


BIN
features/feature/src/main/resources/base/media/beizi_12.png


BIN
features/feature/src/main/resources/base/media/beizi_13.png


BIN
features/feature/src/main/resources/base/media/beizi_14.png


BIN
features/feature/src/main/resources/base/media/beizi_15.png


BIN
features/feature/src/main/resources/base/media/beizi_16.png


BIN
features/feature/src/main/resources/base/media/beizi_17.png


BIN
features/feature/src/main/resources/base/media/beizi_18.png


BIN
features/feature/src/main/resources/base/media/beizi_19.png


BIN
features/feature/src/main/resources/base/media/beizi_2.png


BIN
features/feature/src/main/resources/base/media/beizi_20.png


BIN
features/feature/src/main/resources/base/media/beizi_21.png


BIN
features/feature/src/main/resources/base/media/beizi_22.png


BIN
features/feature/src/main/resources/base/media/beizi_23.png


BIN
features/feature/src/main/resources/base/media/beizi_24.png


BIN
features/feature/src/main/resources/base/media/beizi_25.png


BIN
features/feature/src/main/resources/base/media/beizi_26.png


BIN
features/feature/src/main/resources/base/media/beizi_27.png


BIN
features/feature/src/main/resources/base/media/beizi_28.png


BIN
features/feature/src/main/resources/base/media/beizi_29.png


BIN
features/feature/src/main/resources/base/media/beizi_3.png


BIN
features/feature/src/main/resources/base/media/beizi_30.png


BIN
features/feature/src/main/resources/base/media/beizi_31.png


BIN
features/feature/src/main/resources/base/media/beizi_32.png


BIN
features/feature/src/main/resources/base/media/beizi_33.png


BIN
features/feature/src/main/resources/base/media/beizi_34.png


BIN
features/feature/src/main/resources/base/media/beizi_35.png


BIN
features/feature/src/main/resources/base/media/beizi_36.png


BIN
features/feature/src/main/resources/base/media/beizi_37.png


BIN
features/feature/src/main/resources/base/media/beizi_38.png


BIN
features/feature/src/main/resources/base/media/beizi_39.png


BIN
features/feature/src/main/resources/base/media/beizi_4.png


BIN
features/feature/src/main/resources/base/media/beizi_40.png


BIN
features/feature/src/main/resources/base/media/beizi_41.png


BIN
features/feature/src/main/resources/base/media/beizi_42.png


BIN
features/feature/src/main/resources/base/media/beizi_43.png


BIN
features/feature/src/main/resources/base/media/beizi_44.png


BIN
features/feature/src/main/resources/base/media/beizi_45.png


BIN
features/feature/src/main/resources/base/media/beizi_46.png


BIN
features/feature/src/main/resources/base/media/beizi_47.png


BIN
features/feature/src/main/resources/base/media/beizi_48.png


BIN
features/feature/src/main/resources/base/media/beizi_49.png


BIN
features/feature/src/main/resources/base/media/beizi_5.png


BIN
features/feature/src/main/resources/base/media/beizi_50.png


BIN
features/feature/src/main/resources/base/media/beizi_51.png


BIN
features/feature/src/main/resources/base/media/beizi_52.png


BIN
features/feature/src/main/resources/base/media/beizi_53.png


BIN
features/feature/src/main/resources/base/media/beizi_54.png


BIN
features/feature/src/main/resources/base/media/beizi_55.png


BIN
features/feature/src/main/resources/base/media/beizi_56.png


BIN
features/feature/src/main/resources/base/media/beizi_57.png


BIN
features/feature/src/main/resources/base/media/beizi_58.png


BIN
features/feature/src/main/resources/base/media/beizi_6.png


BIN
features/feature/src/main/resources/base/media/beizi_7.png


BIN
features/feature/src/main/resources/base/media/beizi_8.png


BIN
features/feature/src/main/resources/base/media/beizi_9.png


BIN
features/feature/src/main/resources/base/media/muyu.png


+ 1 - 25
features/feature/src/main/resources/base/profile/router_map.json

@@ -1,29 +1,5 @@
 {
   "routerMap": [
-    {
-      "name": "TossCoinView",
-      "pageSourceFile": "src/main/ets/view/TossCoinView.ets",
-      "buildFunction": "TossCoinViewBuilder"
-    },
-    {
-      "name": "RollDiceView",
-      "pageSourceFile": "src/main/ets/view/RollDiceView.ets",
-      "buildFunction": "RollDiceViewBuilder"
-    },
-    {
-      "name": "RanNumberView",
-      "pageSourceFile": "src/main/ets/view/RanNumberView.ets",
-      "buildFunction": "RanNumberViewBuilder"
-    },
-    {
-      "name": "EatWhatView",
-      "pageSourceFile": "src/main/ets/view/EatWhatView.ets",
-      "buildFunction": "EatWhatViewBuilder"
-    },
-    {
-      "name": "BigWheelView",
-      "pageSourceFile": "src/main/ets/view/BigWheelView.ets",
-      "buildFunction": "BigWheelViewBuilder"
-    }
+
   ]
 }

+ 3 - 3
features/user/src/main/ets/components/LoginInput.ets

@@ -39,16 +39,16 @@ export struct LoginInput {
         .placeholderColor($r('[basic].color.main_na_color'))
         .backgroundColor(Color.Transparent)
         .padding(0)
-        .caretColor($r('[basic].color.main_ac_color_dark'))
+        .caretColor('rgba(0, 0, 0, 0.85)')
         .onChange(this.inputChange)
 
       if (this.needCode) {
         Text(this.time == 61 ? '获取验证码' : this.time + '后重新发送')
           .height(30)
           .fontSize(12)
-          .fontColor(Color.White)
+          .fontColor('rgba(253, 84, 227, 0.75)')
           .borderRadius(16)
-          .backgroundColor($r('[basic].color.main_ac_color_dark'))
+          // .backgroundColor($r('[basic].color.main_ac_color_dark'))
           .onClick(() => {
             this.loginCollect.requestSmsCode((res) => {
               if (res.smsCode) {

+ 3 - 3
features/user/src/main/ets/components/Terms.ets

@@ -4,7 +4,7 @@ import { yTRouter } from 'basic'
 @Extend(Span)
 function spanEx(click: () => void) {
   // .decoration({ type: TextDecorationType.Underline, color: $r('[basic].color.main_ac_color_dark') })
-  .fontColor($r('[basic].color.main_ac_color_dark'))
+  .fontColor('rgba(0, 0, 0, 0.85)')
   .onClick(click)
 }
 
@@ -24,7 +24,7 @@ export struct Terms {
           .onChange(() => {
             this.onAgreeChange()
           })
-          .selectedColor($r('[basic].color.main_ac_color_dark'))
+          .selectedColor('rgba(0, 0, 0, 0.85)')
         Text() {
           Span('我已阅读并同意')
           // Span('《中国认证服务条款》')
@@ -33,7 +33,7 @@ export struct Terms {
           //   })
           //
           // Span('以及')
-          Span('《小决定用户协议》')
+          Span('《樱桃小决定用户协议》')
             .spanEx(() => {
               yTRouter.router2userAgreement()
 

+ 1 - 1
features/user/src/main/ets/pages/LoginPage.ets

@@ -34,7 +34,7 @@ struct LoginPage {
             .fontWeight(400)
             .alignSelf(ItemAlign.End)
             .textAlign(TextAlign.Center)
-            .fontColor($r('[basic].color.main_ac_color_light'))
+            .fontColor('rgba(0, 0, 0, 0.85)')
             .onClick(() => {
               yTRouter.routerBack()
             })

+ 1 - 1
features/user/src/main/ets/pages/Privacy.ets

@@ -21,7 +21,7 @@ export struct Privacy {
     Column() {
       YTHeader({ title: "隐私政策" })
       Web({
-        src: "https://hm-static.ytpm.net/friend/doc/%E9%9A%90%E7%A7%81%E6%94%BF%E7%AD%96.html",
+        src: "https://hm-test.ytpm.net/decisionPrivacy",
         controller: this.webviewController,
         renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
       }).padding(20)

+ 10 - 10
features/user/src/main/ets/pages/SettingPage.ets

@@ -191,6 +191,7 @@ struct SettingPage {
               yTToast.doubleConfirm({
                 message: '注销后数据无法恢复,是否注销?', click: () => {
                   IBestToast.show({ message: '注销成功' })
+                  YTUserRequest.logout()
                   userInfo.logout()
                   yTToast.hide()
                   yTRouter.routerBack()
@@ -228,7 +229,7 @@ struct SettingPage {
               .placeholderColor($r('[basic].color.main_na_color'))
               .backgroundColor(Color.Transparent)
               .padding(0)
-              .caretColor($r('[basic].color.main_ac_color_dark'))
+              .caretColor('rgba(0, 0, 0, 0.85)')
           }
           .height(56)
           .width('100%')
@@ -252,7 +253,7 @@ struct SettingPage {
               .placeholderColor($r('[basic].color.main_na_color'))
               .backgroundColor(Color.Transparent)
               .padding(0)
-              .caretColor($r('[basic].color.main_ac_color_dark'))
+              .caretColor('rgba(0, 0, 0, 0.85)')
 
             if (this.needCode) {
               Text(this.time == 61 ? '获取验证码' : this.time + '后重新发送')
@@ -261,8 +262,7 @@ struct SettingPage {
                 .borderRadius(8)
                 .padding({left:12,right:12,top:8,bottom:8})
                 .textAlign(TextAlign.Center)
-                .fontColor('rgba(255, 255, 255, 1)')
-                .backgroundColor('rgba(28, 28, 28, 1)')
+                .fontColor('rgba(253, 84, 227, 0.75)')
                 .onClick(() => {
                   const rep = new RegExp('^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$');
                   if (this.phoneNumber.match(rep) && this.time == 61) {
@@ -337,7 +337,7 @@ struct SettingPage {
               .placeholderColor($r('[basic].color.main_na_color'))
               .backgroundColor(Color.Transparent)
               .padding(0)
-              .caretColor($r('[basic].color.main_ac_color_dark'))
+              .caretColor('rgba(0, 0, 0, 0.85)')
 
 
 
@@ -351,7 +351,7 @@ struct SettingPage {
           Divider().strokeWidth(1).color('#1A1C1C1C').margin({bottom:12})
           Text('密码必须包含8-20位数字或字母、特殊符号')
             .fontSize(10)
-            .fontColor('#e1e1e1')
+            .fontColor('rgba(0, 0, 0, 0.85)')
             .height(24)
             .textAlign(TextAlign.Center)
 
@@ -372,7 +372,7 @@ struct SettingPage {
               .backgroundColor(Color.Transparent)
               .padding(0)
               .maxLength(20)
-              .caretColor($r('[basic].color.main_ac_color_dark'))
+              .caretColor('rgba(0, 0, 0, 0.85)')
           }
           .height(56)
           .width('100%')
@@ -559,9 +559,9 @@ struct SettingPage {
               })
               return
             }
-            // YTRequest.changeNickname(this.value, () => {
-            //   IBestToast.show({ message: '名称修改成功' })
-            // })
+            YTUserRequest.changeNickname(this.value, () => {
+              IBestToast.show({ message: '名称修改成功' })
+            })
             //TODO 发送请求后关闭弹窗
             this.showReviseName = false
           }

+ 1 - 1
features/user/src/main/ets/pages/SuggestionPage.ets

@@ -22,7 +22,7 @@ struct SuggestionPage {
           Text()
             .width(3)
             .height(10)
-            .backgroundColor($r('[basic].color.main_ac_color_dark'))
+            .backgroundColor('rgba(0, 0, 0, 0.85)')
             .margin({ right: 3 })
           Text() {
             Span('问题描述 ')

+ 1 - 1
features/user/src/main/ets/pages/UserAgreement.ets

@@ -17,7 +17,7 @@ struct UserAgreementPage {
     Column() {
       YTHeader({ title: '用户协议' })
       Web({
-        src: "https://hm-static.ytpm.net/friend/doc/%E7%94%A8%E6%88%B7%E5%8D%8F%E8%AE%AE.html",
+        src: "https://hm-test.ytpm.net/decisionUserAgreent",
         controller: this.webviewController,
         renderMode: RenderMode.ASYNC_RENDER // 设置渲染模式
       })

+ 15 - 5
features/user/src/main/ets/views/LoginView.ets

@@ -86,7 +86,7 @@ export struct LoginView {
       Row() {
         if (!this.isPassword) {
           Text('密码登录')
-            .fontColor($r('[basic].color.main_ac_color_dark'))
+            .fontColor('rgba(0, 0, 0, 0.85)')
             .fontSize(12)
             .fontWeight(700)
             .onClick(() => {
@@ -95,7 +95,7 @@ export struct LoginView {
           Blank()
         } else {
           Text('验证码登录')
-            .fontColor($r('[basic].color.main_ac_color_dark'))
+            .fontColor('rgba(0, 0, 0, 0.85)')
             .fontWeight(700)
             .fontSize(12)
             .onClick(() => {
@@ -103,7 +103,7 @@ export struct LoginView {
             })
           Blank()
           Text('忘记密码?')
-            .fontColor($r('[basic].color.main_ac_color_dark'))
+            .fontColor('rgba(0, 0, 0, 0.85)')
             .fontSize(12)
             .fontWeight(700)
             .onClick(() => {
@@ -117,14 +117,24 @@ export struct LoginView {
 
       YTButton({
         btContent: '登录',
+        btFontColor:'rgba(0, 0, 0, 0.75)',
+        bgc:Color.Transparent,
         click: () => {
           this.loginCollect.executeLogin("common")
         }
-      })
+      }).borderRadius(40)
+        .linearGradient({
+          angle: 135,
+          colors: [
+            ['rgba(230, 163, 240, 1)', 0.2],
+            ['rgba(191, 242, 255, 1)', 1]
+          ]
+        })
+
 
 
       Text('未注册的手机号码登陆后将自动注册')
-        .fontColor($r('[basic].color.main_ac_color_dark'))
+        .fontColor('rgba(0, 0, 0, 0.85)')
         .fontSize(12)
         .margin({ top: 16, bottom: 56 })
         .alignSelf(ItemAlign.Start)

+ 13 - 3
features/user/src/main/ets/views/RegisterOrResetPassView.ets

@@ -67,24 +67,34 @@ export struct RegisterOrResetPassComp {
         .fontSize(10)
         .fontColor('#e1e1e1')
         .margin({ top: 4, bottom: 48 })
-        .fontColor('#FFEA4A18')
+        .fontColor('rgba(0, 0, 0, 0.85)')
 
 
       YTButton({
         //: '立即重置'
         btContent: this.calcButtonContent(),
+        btFontColor:'rgba(0, 0, 0, 0.75)',
+        bgc:Color.Transparent,
         click: () => {
           this.loginCollect.executeLogin("common")
         },
         btBorderRadius: 32
-      })
+      }).borderRadius(40)
+        .linearGradient({
+          angle: 135,
+          colors: [
+            ['rgba(230, 163, 240, 1)', 0.2],
+            ['rgba(191, 242, 255, 1)', 1]
+          ]
+        })
+
 
       if(this.loginCollect.getOperation()=='reset'){
 
       }else{
         Text('注册成功后将自动登录')
           .fontSize(10)
-          .fontColor($r('[basic].color.main_ac_color_dark'))
+          .fontColor('rgba(0, 0, 0, 0.85)')
           .margin({ top: 16 })
       }
 

Some files were not shown because too many files changed in this diff