Commit 0ff462a9 authored by sheteng's avatar sheteng

v2.0 开发 11 切换app支付

parent 05738987
......@@ -99,7 +99,6 @@ class MainActivity() : XPageActivity() {
DataRePortUtils.report("start_app")
SettingSPUtils.lastAPPOpenReportTime = System.currentTimeMillis()
}
DataRePortUtils.report("st_app_open")
PermissionUtils.permission(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE
......
......@@ -76,6 +76,7 @@ class GameListFragment : XPageFragment() {
dataList.clear()
}
}
DataRePortUtils.report("st_app_open")
gameListModel.gameModel.observe(this) {
total = it.total
it.list?.let { it1 -> dataList.addAll(it1) }
......@@ -323,6 +324,7 @@ class GameListFragment : XPageFragment() {
private val CLICK_START_ACC_REQUEST_CODE: Int = 100;
private fun openWebviewForResult(url: String, itemData: GameInfo) {
gameInfo = itemData
DataRePortUtils.report("st_ic_game_clk",)
PageOption.to(CommonWebViewFragment::class.java)
.putString(CommonWebViewFragment.WEBVIEW_URL_KEY, HttpConfig.UI_MAIN_URL + url)
.putInt(CommonWebViewFragment.GAME_ID, itemData.id)
......@@ -349,6 +351,7 @@ class GameListFragment : XPageFragment() {
DataRePortUtils.report("st_speed_stop_pop_show")
}
} else {
DataRePortUtils.report("st_speed_start_clk", mapOf("scene" to 6))
startAccBtn(it)
}
}
......@@ -357,9 +360,11 @@ class GameListFragment : XPageFragment() {
}
private fun startAccBtn(itemData: GameInfo) {
DataRePortUtils.report("st_speed_start_clk", mapOf("scene" to 1))
LoginUtils.token?.let {
startAccPage(itemData)
} ?: let {
DataRePortUtils.report("st_speed_result", mapOf("result" to 0, "cause" to "4"))
context?.let { it1 ->
LoginUtils.login(it1) {
if (it) {
......
......@@ -213,6 +213,25 @@ class AcceleratorFragment : XPageFragment() {
}
}
binding.btnQuick.setOnClickListener {
AcceleratorUtils.state.let {
if (it.canStop) {
context?.let {
CommonDialog(it).setTitle("加速停止确认")
.setContent("停止加速可能会导致游戏断线,是否确认停止?")
.setBtnLeft("取消", {
DataRePortUtils.report("st_speed_stop_pop_cancel_clk")
}).setBtnRight("停止加速", {
DataRePortUtils.report("st_speed_stop_pop_ok_clk")
AcceleratorUtils.stopAccelerator({})
}).show<CommonDialog>()
DataRePortUtils.report("st_speed_stop_pop_show")
}
DataRePortUtils.report("st_speed_stop_clk")
return@setOnClickListener
} else {
DataRePortUtils.report("st_speed_start_clk", mapOf("scene" to 2))
}
}
startBtnClick()
}
......@@ -246,30 +265,12 @@ class AcceleratorFragment : XPageFragment() {
}
if (AcceleratorUtils.state != BaseService.State.Connected && AcceleratorUtils.state != BaseService.State.Stopping) {
binding.btnQuick.performClick()
startBtnClick()
}
}
fun startBtnClick() {
AcceleratorUtils.state.let {
if (it.canStop) {
context?.let {
CommonDialog(it).setTitle("加速停止确认")
.setContent("停止加速可能会导致游戏断线,是否确认停止?")
.setBtnLeft("取消", {
DataRePortUtils.report("st_speed_stop_pop_cancel_clk")
}).setBtnRight("停止加速", {
DataRePortUtils.report("st_speed_stop_pop_ok_clk")
AcceleratorUtils.stopAccelerator({})
}).show<CommonDialog>()
DataRePortUtils.report("st_speed_stop_pop_show")
}
DataRePortUtils.report("st_speed_stop_clk")
return
} else {
DataRePortUtils.report("st_speed_start_clk")
}
}
gameInfo?.let { AcceleratorUtils.setGameInfo(it) }
context?.let { it1 -> AcceleratorUtils.openLocation(it1) }
if (!LoginUtils.hasToken()) {
......@@ -278,7 +279,7 @@ class AcceleratorFragment : XPageFragment() {
})
}
DataRePortUtils.report("st_speed_result", mapOf("result" to 0, "cause" to "3"))
DataRePortUtils.report("st_speed_result", mapOf("result" to 0, "cause" to "4"))
return
}
......
......@@ -21,7 +21,7 @@ class NewsViewModel : ViewModel() {
fun getNotice(gameId: Int) {
viewModelScope.launch(Dispatchers.IO) {
val res =
HttpGo.getSync<NoticeList>("/api/announcement/list?gameId=$gameId&page=1&size=1&channelId=${SysUtils.getChannel()}&addrType=1")
HttpGo.getSync<NoticeList>("/api/announcement/list?gameId=$gameId&page=1&size=1&channelId=${SysUtils.getChannel()}&addrType=2")
res?.let {
if (it.code == 200) {
it.data?.list?.let {
......
......@@ -56,8 +56,8 @@ fun Project.setupCore() {
setupCommon()
android.apply {
defaultConfig {
versionCode = 1
versionName = "1.0.0"
versionCode = 4
versionName = "1.1.0"
}
compileOptions.isCoreLibraryDesugaringEnabled = true
lintOptions {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment