| | |
| | | setPages() |
| | | pageVC.reloadData() |
| | | |
| | | // if viewModel.listenType.value == .game1 || viewModel.listenType.value == .game2{ |
| | | // btn_forward.isHidden = true |
| | | // label_pageNum.isHidden = true |
| | | // |
| | | // if viewModel.listenType.value == .game1{ |
| | | // showGameLevel() |
| | | // } |
| | | // }else if viewModel.listenType.value == .story1 || viewModel.listenType.value == .story2{ |
| | | // let count = (data as! Listen1Model).storyList.count |
| | | // viewModel.maxPage.accept(count) |
| | | // label_pageNum.text = "已完成:\(viewModel.currentPage.value + 1)/\(viewModel.maxPage.value)" |
| | | // }else{ |
| | | // pageVC.reloadData() |
| | | // } |
| | | |
| | | timer = Timer(fire: .distantPast, interval: 1.0, repeats: true, block: {[weak self] _ in |
| | | self?.viewModel.times += 1 |
| | | }) |
| | |
| | | weakSelf.btn_exit.setTitle("完成", for: .normal) |
| | | } |
| | | } |
| | | |
| | | |
| | | //以下无效代码 |
| | | // |
| | | // |
| | | // //完成 |
| | | // if nextPage >= weakSelf.viewModel.maxPage.value{ |
| | | // switch weakSelf.viewModel.listenType.value { |
| | | // case .game1,.game2: |
| | | // if let dict = noti.object as? Dictionary<String,Any>{ |
| | | // weakSelf.gamesComplete(gameId: dict["gameId"] as! Int,integral: dict["gameIntegral"] as! Int) |
| | | // } |
| | | // case .lesson1,.lesson2,.lesson3,.lesson4,.lesson5: |
| | | // weakSelf.studyComplete() |
| | | // case .story1,.story2: |
| | | // if let dict = noti.object as? Dictionary<String,Any>{ |
| | | // weakSelf.storyComplete(storyId: dict["storyId"] as! Int, integral: dict["storyIntegral"] as! Int) |
| | | // } |
| | | // } |
| | | // return |
| | | // } |
| | | |
| | | weakSelf.listenFightLine = .next |
| | | weakSelf.pageVC.scroll(toPage: nextPage, animation: true) |
| | |
| | | |
| | | @objc func beforeAction(){ |
| | | listenFightLine = .before |
| | | let beforePage = max(0, viewModel.currentPage.value - 1) |
| | | var beforePage = max(0, viewModel.currentPage.value - 1) |
| | | pageVC.scroll(toPage: beforePage, animation: true) |
| | | viewModel.currentPage.accept(beforePage) |
| | | |