|
|
@@ -22,6 +22,8 @@ export struct MainView{
|
|
|
@Watch('changeText')
|
|
|
@StorageProp(AppStorageKeyFishCollect.FISHTEXT)
|
|
|
text:string=""
|
|
|
+ @StorageLink('musicID')
|
|
|
+ selectMusic:number=1
|
|
|
@State private currentIndex: number = 0
|
|
|
tabsController: TabsController = new TabsController()
|
|
|
@StorageProp(YTAvoid.SAFE_TOP_KEY) top: number = 0
|
|
|
@@ -78,7 +80,7 @@ export struct MainView{
|
|
|
|
|
|
caluc(){
|
|
|
//计算间隔时长
|
|
|
- this.countdownTime=this.countdownHour*60/Number(this.countdownCount)
|
|
|
+ this.countdownTime=Math.floor(this.countdownHour*60/Number(this.countdownCount))
|
|
|
}
|
|
|
|
|
|
//固定次数
|
|
|
@@ -148,9 +150,7 @@ export struct MainView{
|
|
|
for (let i = 0; i < this.count; i++) {
|
|
|
this.list.push(new Cell()); // 初始化 Cell 数组
|
|
|
}
|
|
|
- if(this.text!="") {
|
|
|
this.list.forEach(item => item.value = this.text)
|
|
|
- }
|
|
|
YTUserRequest.getFishFra((res)=>{
|
|
|
|
|
|
// promptAction.showToast({
|
|
|
@@ -180,7 +180,7 @@ export struct MainView{
|
|
|
this.infiniteTimeText=this.infiniteTime.toString()
|
|
|
this.fixedNumText=this.fixedNum.toString()
|
|
|
this.fixedTimeText=this.fixedTime.toString()
|
|
|
- this.countdownCount=(this.countdownHour*60/this.countdownTime).toString()
|
|
|
+ this.countdownCount=Math.floor(this.countdownHour*60/this.countdownTime).toString()
|
|
|
|
|
|
for (let i = 0; i < this.Merit.length; i++) {
|
|
|
if(this.currentMerit>this.Merit[i]&&this.currentMerit<this.Merit[i+1]){
|
|
|
@@ -206,7 +206,7 @@ export struct MainView{
|
|
|
|
|
|
//开启关闭音乐
|
|
|
async openMusic(){
|
|
|
- await avPlayerManager.playByRawSrc('music3.mp3')
|
|
|
+ await avPlayerManager.playByRawSrc(`music${this.selectMusic}.mp3`)
|
|
|
|
|
|
}
|
|
|
async closeMusic(){
|
|
|
@@ -322,6 +322,7 @@ export struct MainView{
|
|
|
Row(){
|
|
|
Image($r('[basic].media.quxiao')).width(20).onClick(()=>{
|
|
|
this.isShowTimeManger = false
|
|
|
+
|
|
|
this.caluc()
|
|
|
// 发送请求
|
|
|
YTUserRequest.updateFishWoodenModel(
|
|
|
@@ -334,6 +335,8 @@ export struct MainView{
|
|
|
woodenfishModel:this.woodenfishModel
|
|
|
} as Params)
|
|
|
|
|
|
+
|
|
|
+
|
|
|
// promptAction.showToast({
|
|
|
// message:JSON.stringify( {
|
|
|
// countdownHour:this.countdownHour,
|
|
|
@@ -407,12 +410,12 @@ export struct MainView{
|
|
|
Column({space:16}) {
|
|
|
TimeProgressCom({
|
|
|
progressValue:this.countdownHour,
|
|
|
- changeTabCurrNumberAndCountTime:(progressValue:string,tabIndex?:number,)=>{
|
|
|
- if(progressValue!='自定义') {
|
|
|
- this.countdownHour = Number(progressValue)
|
|
|
- }
|
|
|
+ changeTabCurrNumberAndCountTime:(progressValue:number,tabIndex:number=-1)=>{
|
|
|
+
|
|
|
if(tabIndex==3) {
|
|
|
this.tabsController.changeIndex(tabIndex)
|
|
|
+ }else {
|
|
|
+ this.countdownHour = Number(progressValue)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -706,7 +709,7 @@ export struct MainView{
|
|
|
.onClick(() => {
|
|
|
this.isShowTimeManger = true
|
|
|
clearInterval(this.inversetId)
|
|
|
- this.woodenfishModel=2
|
|
|
+ // this.woodenfishModel=2
|
|
|
// YTUserRequest.getFishFra((res)=>{
|
|
|
//
|
|
|
// promptAction.showToast({
|
|
|
@@ -767,7 +770,7 @@ export struct MainView{
|
|
|
}.width('100%')
|
|
|
.height('100%')
|
|
|
.padding({
|
|
|
- top: this.top + 22,
|
|
|
+ top: this.top,
|
|
|
left: 20,
|
|
|
right: 20
|
|
|
})
|
|
|
@@ -782,6 +785,8 @@ export struct MainView{
|
|
|
}else {
|
|
|
this.autoOnclick()
|
|
|
}
|
|
|
+ this.list.forEach(item => item.value = this.text)
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
}
|