|
|
@@ -1,8 +1,12 @@
|
|
|
-import { AppStorageKeyFishCollect, avPlayerManager, Vibration, YTAvoid, YTHeader, yTRouter } from 'basic';
|
|
|
+import { AppStorageKeyFishCollect, avPlayerManager,
|
|
|
+ BlessCustomCustomDialog,
|
|
|
+ Vibration, YTAvoid, YTHeader, yTRouter,
|
|
|
+ YTUserRequest } from 'basic';
|
|
|
import { faceDetector } from '@kit.CoreVisionKit';
|
|
|
import { trustedAppService } from '@kit.DeviceSecurityKit';
|
|
|
import { promptAction } from '@kit.ArkUI';
|
|
|
import { Cell } from '../models';
|
|
|
+import { it } from '@ohos/hypium';
|
|
|
|
|
|
|
|
|
@Component
|
|
|
@@ -38,7 +42,7 @@ export struct MainView{
|
|
|
@State isAnimation:boolean=false
|
|
|
//进度条
|
|
|
@State currentMerit:number=0
|
|
|
- @State totalMerit:number=500
|
|
|
+ @State totalMerit:number=10
|
|
|
|
|
|
//时间间隔
|
|
|
@State time:number=1000
|
|
|
@@ -46,6 +50,19 @@ export struct MainView{
|
|
|
@State isShowTimeManger:boolean=false
|
|
|
@State valueTime:number=10
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ dialogController: CustomDialogController=new CustomDialogController({
|
|
|
+ builder:BlessCustomCustomDialog({
|
|
|
+ imgIndex:Math.floor(Math.random()*12)
|
|
|
+ }),
|
|
|
+ alignment:DialogAlignment.Center,
|
|
|
+ customStyle:true,
|
|
|
+ width:'100%',
|
|
|
+ height:'100%',
|
|
|
+ })
|
|
|
+
|
|
|
//开启关闭音乐
|
|
|
async openMusic(){
|
|
|
await avPlayerManager.playByRawSrc('music3.mp3')
|
|
|
@@ -55,6 +72,13 @@ export struct MainView{
|
|
|
await avPlayerManager.stop()
|
|
|
}
|
|
|
|
|
|
+ //功德满足情况弹窗
|
|
|
+ // openDialog(currNumber:number,totalNumber:number){
|
|
|
+ // if(currNumber==totalNumber){
|
|
|
+ // this.dialogController.open()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
//点击动画
|
|
|
onclikMerit(){
|
|
|
if(this.isAnimation){
|
|
|
@@ -68,6 +92,10 @@ export struct MainView{
|
|
|
}
|
|
|
this.isAnimation=true
|
|
|
this.currentMerit++
|
|
|
+ // this.openDialog(this.currentIndex,this.totalMerit)
|
|
|
+ if(this.currentMerit==this.totalMerit){
|
|
|
+ this.dialogController.open()
|
|
|
+ }
|
|
|
let index = this.indexCount % this.count; // 计算当前滚动的索引
|
|
|
this.indexCount++; // 更新索引计数器
|
|
|
animateToImmediately({
|
|
|
@@ -98,32 +126,33 @@ export struct MainView{
|
|
|
@Builder
|
|
|
timeMangerBuilder(){
|
|
|
Column(){
|
|
|
+ Row(){
|
|
|
+ Image($r('[basic].media.quxiao')).width(20).onClick(()=>{
|
|
|
+ this.isShowTimeManger = false
|
|
|
+ })
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
+ Row(){
|
|
|
+
|
|
|
+ Text('自动敲击设置').fontColor(Color.White).fontSize(20)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .margin({bottom:20})
|
|
|
Stack({alignContent:Alignment.Top}) {
|
|
|
Tabs({ barPosition: BarPosition.Start, controller: this.tabsController }) {
|
|
|
TabContent() {
|
|
|
Column() {
|
|
|
- Text('敲击间隔时长(1-10秒)')
|
|
|
-
|
|
|
- Row() {
|
|
|
- TextInput()
|
|
|
- .width(70)
|
|
|
- .height(40)
|
|
|
- .padding(0)
|
|
|
- .type(InputType.Number) // 设置输入类型为数字
|
|
|
- .textAlign(TextAlign.Center)
|
|
|
- .borderRadius(4)
|
|
|
- .backgroundColor(Color.Gray)
|
|
|
-
|
|
|
- Text('秒')
|
|
|
- }
|
|
|
- }
|
|
|
+ Column({ space: 16 }) {
|
|
|
+ Row() {
|
|
|
+ Text() {
|
|
|
+ Span('敲击间隔时长').fontSize(16)
|
|
|
+ Span('(1-10秒)').fontSize(12)
|
|
|
+ }.fontColor(Color.White)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
|
|
|
- }.tabBar('无限')
|
|
|
|
|
|
- TabContent() {
|
|
|
- Column() {
|
|
|
- Column() {
|
|
|
- Text('敲击次数(1-9999次)')
|
|
|
Row() {
|
|
|
TextInput()
|
|
|
.width(70)
|
|
|
@@ -133,64 +162,133 @@ export struct MainView{
|
|
|
.textAlign(TextAlign.Center)
|
|
|
.borderRadius(4)
|
|
|
.backgroundColor(Color.Gray)
|
|
|
+ .margin({ right: 5 })
|
|
|
|
|
|
- Text('秒')
|
|
|
- }
|
|
|
+ Text('秒').fontColor('rgba(250, 222, 113, 1)')
|
|
|
+ }.width('100%').justifyContent(FlexAlign.Center)
|
|
|
}
|
|
|
+ .width('100%')
|
|
|
+ .height(136)
|
|
|
+ .borderRadius(8)
|
|
|
+ .padding(20)
|
|
|
+ .backgroundColor('rgba(77, 77, 77, 1)')
|
|
|
+
|
|
|
+ }.layoutWeight(1).justifyContent(FlexAlign.Start)
|
|
|
+ }.tabBar('无限').layoutWeight(1)
|
|
|
+ TabContent() {
|
|
|
+ Column(){
|
|
|
+ Column({space:16}) {
|
|
|
+ Row(){
|
|
|
+ Text() {
|
|
|
+ Span('敲击次数').fontSize(16)
|
|
|
+ Span('(1-9999次)').fontSize(12)
|
|
|
+ }.fontColor(Color.White)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
|
|
|
- Column() {
|
|
|
- Text('敲击间隔时长(1-10秒)')
|
|
|
- Row() {
|
|
|
- TextInput()
|
|
|
- .width(70)
|
|
|
- .height(40)
|
|
|
- .padding(0)
|
|
|
- .type(InputType.Number) // 设置输入类型为数字
|
|
|
- .textAlign(TextAlign.Center)
|
|
|
- .borderRadius(4)
|
|
|
- .backgroundColor(Color.Gray)
|
|
|
|
|
|
- Text('秒')
|
|
|
- }
|
|
|
- }
|
|
|
+ Row() {
|
|
|
+ TextInput()
|
|
|
+ .width(70)
|
|
|
+ .height(40)
|
|
|
+ .padding(0)
|
|
|
+ .type(InputType.Number) // 设置输入类型为数字
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .borderRadius(4)
|
|
|
+ .backgroundColor(Color.Gray)
|
|
|
+ .margin({right:5})
|
|
|
|
|
|
- }
|
|
|
+ Text('秒').fontColor('rgba(250, 222, 113, 1)')
|
|
|
+ }.width('100%').justifyContent(FlexAlign.Center)
|
|
|
+
|
|
|
+ Row(){
|
|
|
+ Text() {
|
|
|
+ Span('敲击间隔时长').fontSize(16)
|
|
|
+ Span('(1-10秒)').fontSize(12)
|
|
|
+ }.fontColor(Color.White)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
|
|
|
- }.tabBar('固定次数')
|
|
|
|
|
|
+ Row() {
|
|
|
+ TextInput()
|
|
|
+ .width(70)
|
|
|
+ .height(40)
|
|
|
+ .padding(0)
|
|
|
+ .type(InputType.Number) // 设置输入类型为数字
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .borderRadius(4)
|
|
|
+ .backgroundColor(Color.Gray)
|
|
|
+ .margin({right:5})
|
|
|
+
|
|
|
+ Text('秒').fontColor('rgba(250, 222, 113, 1)')
|
|
|
+ }.width('100%').justifyContent(FlexAlign.Center)
|
|
|
+
|
|
|
+ }.width('100%').height(210).borderRadius(8).padding(20).backgroundColor('rgba(77, 77, 77, 1)')
|
|
|
+ }.layoutWeight(1).justifyContent(FlexAlign.Start)
|
|
|
+ }.tabBar('固定次数').layoutWeight(1)
|
|
|
TabContent() {
|
|
|
- Column() {
|
|
|
- Column() {
|
|
|
- Text('倒计时(1-9999次)')
|
|
|
- Stack() {
|
|
|
- Progress({ value: this.valueTime, total: 70, type: ProgressType.Linear }).backgroundColor('#4c4c4c')
|
|
|
- Row({space:30}){
|
|
|
- ForEach([0,10,20,30,40,50,60,70],(item:number,index:number)=>{
|
|
|
- Column(){
|
|
|
- }.width(10)
|
|
|
- .height(10)
|
|
|
+ Column(){
|
|
|
+ Column({space:16}) {
|
|
|
+ Column({space:16}) {
|
|
|
+ Row(){
|
|
|
+ Text() {
|
|
|
+ Span('倒计时').fontSize(16)
|
|
|
+ Span('(1-9999次)').fontSize(12)
|
|
|
+ }.fontColor(Color.White)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+ Stack({alignContent:Alignment.TopStart}) {
|
|
|
+ Progress({ value: this.valueTime, total: 60, type: ProgressType.Linear }).width(290).height(16).backgroundColor('rgba(255, 255, 255, 0.55)').margin({left:14})
|
|
|
+ Row({space:17}){
|
|
|
+ ForEach([0,10,20,30,40,50,60],(item:number,index:number)=> {
|
|
|
+
|
|
|
+ Column() {
|
|
|
+ Column() {
|
|
|
+ }
|
|
|
+ .width(16)
|
|
|
+ .height(16)
|
|
|
.borderRadius('50%')
|
|
|
- .onClick(()=>{
|
|
|
- if(index!=7){
|
|
|
+ .onClick(() => {
|
|
|
+ if (index != 6) {
|
|
|
+ this.valueTime = item //比实际小10
|
|
|
+ } else {
|
|
|
this.valueTime=item
|
|
|
- }else{
|
|
|
- this.currentIndex=3
|
|
|
+ this.currentIndex = 3
|
|
|
this.tabsController.changeIndex(this.currentIndex)
|
|
|
}
|
|
|
|
|
|
})
|
|
|
- .backgroundColor(Color.Yellow)
|
|
|
- // .backgroundColor(this.valueTime>=item?Color.Yellow:Color.White)
|
|
|
+ .backgroundColor(this.valueTime == item ? Color.Yellow : Color.White)
|
|
|
+ Column() {
|
|
|
+ if (item != 60) {
|
|
|
+ Text(item + "分钟")
|
|
|
+ .fontSize(10)
|
|
|
+ .fontColor(this.valueTime == item ? Color.White : 'rgba(255, 255, 255, 0.55)')
|
|
|
+ } else {
|
|
|
+ Text('自定义')
|
|
|
+ .fontSize(10)
|
|
|
+ .fontColor(this.valueTime == item ? Color.White : 'rgba(255, 255, 255, 0.55)')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.alignItems(HorizontalAlign.Start)
|
|
|
})
|
|
|
|
|
|
|
|
|
}.width('100%')
|
|
|
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- Column() {
|
|
|
- Text('敲击间隔时长(1-10秒)')
|
|
|
+ Column({space:16}) {
|
|
|
+ Row(){
|
|
|
+ Text() {
|
|
|
+ Span('敲击次数').fontSize(16)
|
|
|
+ Span('(1-9999次)').fontSize(12)
|
|
|
+ }.fontColor(Color.White)
|
|
|
+ }.width('100%')
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
Row() {
|
|
|
TextInput()
|
|
|
.width(70)
|
|
|
@@ -201,15 +299,17 @@ export struct MainView{
|
|
|
.borderRadius(4)
|
|
|
.backgroundColor(Color.Gray)
|
|
|
|
|
|
- Text('秒')
|
|
|
+ Text('秒').fontColor('rgba(250, 222, 113, 1)')
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ }.width('100%').borderRadius(8).padding(20).backgroundColor('rgba(77, 77, 77, 1)')
|
|
|
|
|
|
+ }.layoutWeight(1).justifyContent(FlexAlign.Start)
|
|
|
|
|
|
- }.tabBar('倒计时')
|
|
|
+ }.tabBar('倒计时').layoutWeight(1)
|
|
|
TabContent() {
|
|
|
+ Column(){
|
|
|
Column() {
|
|
|
Text('自定义时间')
|
|
|
Row() {
|
|
|
@@ -222,18 +322,21 @@ export struct MainView{
|
|
|
.borderRadius(4)
|
|
|
.backgroundColor(Color.Gray)
|
|
|
|
|
|
- Text('秒')
|
|
|
+ Text('秒').fontColor('rgba(250, 222, 113, 1)')
|
|
|
}
|
|
|
}
|
|
|
- }.tabBar('自定义')
|
|
|
+ }.layoutWeight(1).justifyContent(FlexAlign.Start)
|
|
|
+ }.tabBar('自定义').layoutWeight(1)
|
|
|
|
|
|
- }.width('100%').barHeight(0)
|
|
|
+ }.width('100%').margin({top:20}).barHeight(0)
|
|
|
Row(){
|
|
|
Text('无限')
|
|
|
.layoutWeight(1)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
.borderRadius(10)
|
|
|
- .height(30)
|
|
|
- .backgroundColor(this.currentIndex==0?Color.Green:Color.Transparent)
|
|
|
+ .height(40)
|
|
|
+ .fontColor(this.currentIndex==0?Color.Black:'rgba(255, 255, 255, 0.35)')
|
|
|
+ .backgroundColor(this.currentIndex==0?'rgba(250, 222, 113, 1)':Color.Transparent)
|
|
|
.onClick(()=>{
|
|
|
this.currentIndex=0
|
|
|
this.tabsController.changeIndex(this.currentIndex)
|
|
|
@@ -241,9 +344,11 @@ export struct MainView{
|
|
|
})
|
|
|
Text('固定次数')
|
|
|
.layoutWeight(1)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
.borderRadius(10)
|
|
|
- .height(30)
|
|
|
- .backgroundColor(this.currentIndex==1?Color.Green:Color.Transparent).onClick(()=>{
|
|
|
+ .height(40)
|
|
|
+ .fontColor(this.currentIndex==1?Color.Black:'rgba(255, 255, 255, 0.35)')
|
|
|
+ .backgroundColor(this.currentIndex==1?'rgba(250, 222, 113, 1)':Color.Transparent).onClick(()=>{
|
|
|
this.currentIndex=1
|
|
|
this.tabsController.changeIndex(this.currentIndex)
|
|
|
|
|
|
@@ -251,8 +356,10 @@ export struct MainView{
|
|
|
Text('倒计时')
|
|
|
.layoutWeight(1)
|
|
|
.borderRadius(10)
|
|
|
- .height(30)
|
|
|
- .backgroundColor((this.currentIndex==2||this.currentIndex==3)?Color.Green:Color.Transparent)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .height(40)
|
|
|
+ .fontColor((this.currentIndex==2||this.currentIndex==3)?Color.Black:'rgba(255, 255, 255, 0.35)')
|
|
|
+ .backgroundColor((this.currentIndex==2||this.currentIndex==3)?'rgba(250, 222, 113, 1)':Color.Transparent)
|
|
|
.onClick(()=>{
|
|
|
this.currentIndex=2
|
|
|
this.tabsController.changeIndex(this.currentIndex)
|
|
|
@@ -261,15 +368,15 @@ export struct MainView{
|
|
|
|
|
|
}.width('100%')
|
|
|
.borderRadius(10)
|
|
|
- .height(30)
|
|
|
- .backgroundColor(Color.Pink)
|
|
|
- }
|
|
|
+ .height(40)
|
|
|
+ .backgroundColor('rgba(77, 77, 77, 1)')
|
|
|
+ }.layoutWeight(1)
|
|
|
|
|
|
|
|
|
}.width('100%')
|
|
|
.height('100%')
|
|
|
.padding(20)
|
|
|
- .backgroundColor(Color.White)
|
|
|
+ .backgroundColor('rgba(25, 25, 25, 1)')
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -278,281 +385,287 @@ export struct MainView{
|
|
|
for (let i = 0; i < this.count; i++) {
|
|
|
this.list.push(new Cell()); // 初始化 Cell 数组
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- build() {
|
|
|
- Column() {
|
|
|
|
|
|
+ YTUserRequest.getFishFra((res)=>{
|
|
|
+ promptAction.showToast({
|
|
|
+ message:JSON.stringify(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
|
|
|
- Stack({alignContent:Alignment.Bottom}) {
|
|
|
- Column() {
|
|
|
- if (this.isShowMessage) {
|
|
|
+ }
|
|
|
|
|
|
- Row() {
|
|
|
- Column({ space: 20 }) {
|
|
|
- //积功德+清零
|
|
|
- Row() {
|
|
|
- Text() {
|
|
|
- Span('积功德: ').fontColor(Color.White).fontSize(18)
|
|
|
- Span(`${this.currentMerit}`).fontSize(18).fontColor($r('[basic].color.login_main_yellow'))
|
|
|
- }.margin({ left: 50 })
|
|
|
+ build() {
|
|
|
+ Stack() {
|
|
|
+ Image($r('[basic].media.dengguang')).width('100%').height('100%')
|
|
|
+ Image($r('[basic].media.dizuo')).width(256).height(60).margin({top:460})
|
|
|
+ Column() {
|
|
|
+ Stack({ alignContent: Alignment.Bottom }) {
|
|
|
+ Column() {
|
|
|
+ if (this.isShowMessage) {
|
|
|
|
|
|
+ Row() {
|
|
|
+ Column({ space: 20 }) {
|
|
|
+ //积功德+清零
|
|
|
Row() {
|
|
|
- Text('清零')
|
|
|
- .borderRadius(20)
|
|
|
- .padding({
|
|
|
- left: 6,
|
|
|
- right: 6,
|
|
|
- top: 4,
|
|
|
- bottom: 4
|
|
|
- })
|
|
|
- .backgroundColor($r('[basic].color.login_main_yellow'))
|
|
|
- .fontColor(Color.Black)
|
|
|
- .onClick(() => {
|
|
|
- this.currentMerit = 0
|
|
|
- })
|
|
|
-
|
|
|
+ Text() {
|
|
|
+ Span('积功德: ').fontColor(Color.White).fontSize(18)
|
|
|
+ Span(`${this.currentMerit}`).fontSize(18).fontColor($r('[basic].color.login_main_yellow'))
|
|
|
+ }.margin({ left: 50 })
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Text('清零')
|
|
|
+ .borderRadius(20)
|
|
|
+ .fontSize(14)
|
|
|
+ .padding({
|
|
|
+ left: 8,
|
|
|
+ right: 8,
|
|
|
+ top: 5,
|
|
|
+ bottom: 5
|
|
|
+ })
|
|
|
+ .backgroundColor($r('[basic].color.login_main_yellow'))
|
|
|
+ .fontColor('rgba(0, 0, 0, 0.95)')
|
|
|
+ .onClick(() => {
|
|
|
+ this.currentMerit = 0
|
|
|
+ })
|
|
|
|
|
|
- }
|
|
|
|
|
|
- }.width('100%').justifyContent(FlexAlign.SpaceAround)
|
|
|
+ }
|
|
|
|
|
|
- //进度条
|
|
|
- Column() {
|
|
|
- Stack({ alignContent: Alignment.Center }) {
|
|
|
- Progress({ value: this.currentMerit, total: this.totalMerit, type: ProgressType.Ring })
|
|
|
- .width(80).color('#3dbbd1')
|
|
|
- .style({ strokeWidth: 6, shadow: true })
|
|
|
- .backgroundColor(Color.White)
|
|
|
- Text('集福').fontSize(20).fontColor(Color.White)
|
|
|
- }.margin({ left: 10 })
|
|
|
+ }.width('100%').justifyContent(FlexAlign.SpaceAround)
|
|
|
|
|
|
- Text() {
|
|
|
- Span(`${this.currentMerit}`).fontColor($r('[basic].color.login_main_yellow'))
|
|
|
- Span(`/${this.totalMerit}`)
|
|
|
- }.fontColor(Color.White).margin({ left: 10 }).width(80).textAlign(TextAlign.Center)
|
|
|
-
|
|
|
- }.width('100%').justifyContent(FlexAlign.Start).alignItems(HorizontalAlign.Start)
|
|
|
- }.layoutWeight(1)
|
|
|
-
|
|
|
- //右边的按钮
|
|
|
-
|
|
|
- Column({ space: 20 }) {
|
|
|
- Image($r('app.media.muyu')).width(30).onClick(() => {
|
|
|
- this.isShowSilder = !this.isShowSilder
|
|
|
- })
|
|
|
- if (this.isShowSilder) {
|
|
|
- //是否开启声音
|
|
|
- Image($r('app.media.muyu')).width(30).onClick(() => {
|
|
|
- this.isOpenMusic = !this.isOpenMusic
|
|
|
- })
|
|
|
- //是否开启震动
|
|
|
- Image($r('app.media.muyu')).width(30).onClick(() => {
|
|
|
- this.isOpenVibration = !this.isOpenVibration
|
|
|
+ //进度条
|
|
|
+ Column() {
|
|
|
+ Stack({ alignContent: Alignment.Center }) {
|
|
|
+ Progress({ value: this.currentMerit, total: this.totalMerit, type: ProgressType.Ring })
|
|
|
+ .width(80).color('rgba(61, 186, 208, 1)')
|
|
|
+ .style({ strokeWidth: 7, shadow: true })
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ Text('集福').fontSize(20).fontColor('rgba(252, 253, 237, 1)')
|
|
|
+ }.margin({ left: 10 })
|
|
|
+
|
|
|
+ Text() {
|
|
|
+ Span(`${this.currentMerit}`).fontColor($r('[basic].color.login_main_yellow'))
|
|
|
+ Span(`/${this.totalMerit}`)
|
|
|
+ }.fontColor(Color.White).margin({ left: 10 }).width(80).textAlign(TextAlign.Center)
|
|
|
+
|
|
|
+ }.width('100%').justifyContent(FlexAlign.Start).alignItems(HorizontalAlign.Start)
|
|
|
+ }.layoutWeight(1)
|
|
|
+
|
|
|
+ //右边的按钮
|
|
|
+
|
|
|
+ Column({ space: 20 }) {
|
|
|
+ Image($r('[basic].media.shezhix')).width(32).onClick(() => {
|
|
|
+ this.isShowSilder = !this.isShowSilder
|
|
|
})
|
|
|
+ if (this.isShowSilder) {
|
|
|
+ //是否开启声音
|
|
|
+ Image($r('[basic].media.zhendong')).width(32).onClick(() => {
|
|
|
+ this.isOpenMusic = !this.isOpenMusic
|
|
|
+ })
|
|
|
+ //是否开启震动
|
|
|
+ Image($r('[basic].media.shengying')).width(32).onClick(() => {
|
|
|
+ this.isOpenVibration = !this.isOpenVibration
|
|
|
+ })
|
|
|
|
|
|
- Column() {
|
|
|
Column() {
|
|
|
- Text(this.isAuto ? '自动' : '手动')
|
|
|
- .padding({
|
|
|
- left: 3,
|
|
|
- right: 3,
|
|
|
- top: 10,
|
|
|
- bottom: 10
|
|
|
- })
|
|
|
- .margin({ bottom: 10 })
|
|
|
- .backgroundColor('#252111')
|
|
|
- .fontColor(Color.White)
|
|
|
- .onClick(() => {
|
|
|
- this.isAuto = !this.isAuto
|
|
|
- //如果是本来自动,再点击就是手动,不需要设置任何东西
|
|
|
- // if (!this.isHand) {
|
|
|
- // this.isHand = true
|
|
|
- // } else {
|
|
|
- // //如果本来是手动,再点击就是自动,就需要设置东西
|
|
|
- // this.isHand = false
|
|
|
- // }
|
|
|
- })
|
|
|
- if (this.isAuto) {
|
|
|
- Column({ space: 10 }) {
|
|
|
- Text('结束')
|
|
|
- .padding({
|
|
|
- left: 3,
|
|
|
- right: 3,
|
|
|
- top: 10,
|
|
|
- bottom: 10
|
|
|
- })
|
|
|
- .fontColor(Color.White)
|
|
|
- .backgroundColor('#252111')
|
|
|
- .onClick(() => {
|
|
|
- this.isAuto = !this.isAuto
|
|
|
- })
|
|
|
- Text('设置')
|
|
|
- .padding({
|
|
|
- left: 3,
|
|
|
- right: 3,
|
|
|
- top: 10,
|
|
|
- bottom: 10
|
|
|
- })
|
|
|
- .fontColor(Color.White)
|
|
|
- .backgroundColor('#252111')
|
|
|
- .bindSheet($$this.isShowTimeManger, this.timeMangerBuilder(), {
|
|
|
- width: '100%',
|
|
|
- height: 400,
|
|
|
- showClose: false,
|
|
|
- })
|
|
|
- .onClick(() => {
|
|
|
- this.isShowTimeManger = true
|
|
|
- })
|
|
|
- Text('设置2')
|
|
|
- .padding({
|
|
|
- left: 3,
|
|
|
- right: 3,
|
|
|
- top: 10,
|
|
|
- bottom: 10
|
|
|
- })
|
|
|
- .fontColor(Color.White)
|
|
|
- .backgroundColor('#252111')
|
|
|
- .onClick(() => {
|
|
|
- //去往设置页面
|
|
|
- yTRouter.router2FishSettingPage()
|
|
|
- })
|
|
|
+ Column() {
|
|
|
+ Text(this.isAuto ? '自动' : '手动')
|
|
|
+ .padding({
|
|
|
+ left: 3,
|
|
|
+ right: 3,
|
|
|
+ top: 10,
|
|
|
+ bottom: 10
|
|
|
+ })
|
|
|
+ .margin({ bottom: 10 })
|
|
|
+ .backgroundColor('#252111')
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .onClick(() => {
|
|
|
+ this.isAuto = !this.isAuto
|
|
|
+ //如果是本来自动,再点击就是手动,不需要设置任何东西
|
|
|
+ // if (!this.isHand) {
|
|
|
+ // this.isHand = true
|
|
|
+ // } else {
|
|
|
+ // //如果本来是手动,再点击就是自动,就需要设置东西
|
|
|
+ // this.isHand = false
|
|
|
+ // }
|
|
|
+ })
|
|
|
+ if (this.isAuto) {
|
|
|
+ Column({ space: 10 }) {
|
|
|
+ Text('结束')
|
|
|
+ .padding({
|
|
|
+ left: 3,
|
|
|
+ right: 3,
|
|
|
+ top: 10,
|
|
|
+ bottom: 10
|
|
|
+ })
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .backgroundColor('#252111')
|
|
|
+ .onClick(() => {
|
|
|
+ this.isAuto = !this.isAuto
|
|
|
+ })
|
|
|
+ Text('无限')
|
|
|
+ .padding({
|
|
|
+ left: 3,
|
|
|
+ right: 3,
|
|
|
+ top: 10,
|
|
|
+ bottom: 10
|
|
|
+ })
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .backgroundColor('#252111')
|
|
|
+ .bindSheet($$this.isShowTimeManger, this.timeMangerBuilder(), {
|
|
|
+ width: '100%',
|
|
|
+ height: 400,
|
|
|
+ showClose: false,
|
|
|
+ })
|
|
|
+ .onClick(() => {
|
|
|
+ this.isShowTimeManger = true
|
|
|
+ })
|
|
|
+ Text('设置')
|
|
|
+ .padding({
|
|
|
+ left: 3,
|
|
|
+ right: 3,
|
|
|
+ top: 10,
|
|
|
+ bottom: 10
|
|
|
+ })
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .backgroundColor('#252111')
|
|
|
+ .onClick(() => {
|
|
|
+ //去往设置页面
|
|
|
+ yTRouter.router2FishSettingPage()
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- }.width(50)
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
- .alignItems(HorizontalAlign.End)
|
|
|
+ }.width(50)
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .alignItems(HorizontalAlign.End)
|
|
|
|
|
|
- }.width('100%')
|
|
|
- .height(300)
|
|
|
-
|
|
|
- .alignItems(VerticalAlign.Top)
|
|
|
- }
|
|
|
- }
|
|
|
- .height('100%')
|
|
|
- .margin({ top: 20 })
|
|
|
-
|
|
|
- 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) // 设置文字的透明度
|
|
|
- })
|
|
|
+ }.width('100%')
|
|
|
+ .height(400)
|
|
|
+ .alignItems(VerticalAlign.Top)
|
|
|
+ }
|
|
|
}
|
|
|
- .width(200) //
|
|
|
- .height(100)
|
|
|
- .align(Alignment.BottomEnd)
|
|
|
- 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).onClick(()=>{
|
|
|
- this.isShowMessage=!this.isShowMessage
|
|
|
- })
|
|
|
- }.width('100%')
|
|
|
- .margin({top:50})
|
|
|
- .justifyContent(FlexAlign.End)
|
|
|
- }
|
|
|
- .width('100%')
|
|
|
- .margin({bottom:20})
|
|
|
-
|
|
|
- }.height('100%')
|
|
|
-
|
|
|
- // 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)
|
|
|
- //
|
|
|
- // })
|
|
|
- // }
|
|
|
- //
|
|
|
- // 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)
|
|
|
- // })
|
|
|
- //
|
|
|
- //
|
|
|
- // }.width('100%')
|
|
|
- //
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ .height('100%')
|
|
|
+ .margin({ top: 20 })
|
|
|
+
|
|
|
+ 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) // 设置文字的透明度
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .width(200) //
|
|
|
+ .height(70)
|
|
|
+ .align(Alignment.BottomEnd)
|
|
|
+
|
|
|
+ Image(this.image)
|
|
|
+ .width(200)
|
|
|
+ .height(200)
|
|
|
+ .objectFit(ImageFit.Contain)
|
|
|
+ .clickEffect({
|
|
|
+ // 点击效果配置
|
|
|
+ scale: 0.5, // 缩放比例
|
|
|
+ level: ClickEffectLevel.LIGHT // 效果级别
|
|
|
+ })
|
|
|
+ .onClick(() => { // 点击图片时触发的回调
|
|
|
+ this.onclikMerit()
|
|
|
+ })
|
|
|
|
|
|
+ Row() {
|
|
|
|
|
|
- }.width('100%')
|
|
|
- .height('100%')
|
|
|
- .padding({
|
|
|
- top:this.top,
|
|
|
- left:16,
|
|
|
- right:16
|
|
|
- })
|
|
|
- .backgroundColor(Color.Black)
|
|
|
+ Image($r('[basic].media.suoxiao')).width(24).onClick(() => {
|
|
|
+ this.isShowMessage = !this.isShowMessage
|
|
|
+ })
|
|
|
+ }.width('100%')
|
|
|
+ .margin({ top: 50 })
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .margin({ bottom: 20 })
|
|
|
+
|
|
|
+ }.height('100%')
|
|
|
+
|
|
|
+ // 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)
|
|
|
+ //
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // 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)
|
|
|
+ // })
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // }.width('100%')
|
|
|
+ //
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ }.width('100%')
|
|
|
+ .height('100%')
|
|
|
+ .padding({
|
|
|
+ top: this.top + 22,
|
|
|
+ left: 20,
|
|
|
+ right: 20
|
|
|
+ })
|
|
|
+ }.backgroundColor(Color.Black)
|
|
|
}
|
|
|
}
|