| @@ -19,8 +19,8 @@ android { | |||||
| // minSdkVersion 26 | // minSdkVersion 26 | ||||
| minSdkVersion 21 | minSdkVersion 21 | ||||
| targetSdkVersion 25 | targetSdkVersion 25 | ||||
| versionCode 30002 | |||||
| versionName "3.0.2" | |||||
| versionCode 30005 | |||||
| versionName "3.0.5" | |||||
| testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||||
| // ndk { | // ndk { | ||||
| @@ -87,11 +87,11 @@ android { | |||||
| shrinkResources false | shrinkResources false | ||||
| // buildConfigField "String", "BASE_URL", '"http://192.168.69.99:9009"' | // buildConfigField "String", "BASE_URL", '"http://192.168.69.99:9009"' | ||||
| // buildConfigField "String", "M_URL", '"http://192.168.69.112:8098"' | // buildConfigField "String", "M_URL", '"http://192.168.69.112:8098"' | ||||
| // buildConfigField "String", "BASE_URL", '"https://oa.qbjjyyun.net/api"' | |||||
| buildConfigField "String", "BASE_URL", '"https://oa.qbjjyyun.net/api"' | |||||
| buildConfigField "String", "OA_URL", '"https://oa.live.educlouddata.com"' | buildConfigField "String", "OA_URL", '"https://oa.live.educlouddata.com"' | ||||
| // buildConfigField "String", "OA_URL", '"http://192.168.69.114:3000"' | // buildConfigField "String", "OA_URL", '"http://192.168.69.114:3000"' | ||||
| buildConfigField "String", "M_URL", '"https://m.live.educlouddata.com/"' | buildConfigField "String", "M_URL", '"https://m.live.educlouddata.com/"' | ||||
| buildConfigField "String", "BASE_URL", '"https://oa.live.educlouddata.com/api"' | |||||
| // buildConfigField "String", "BASE_URL", '"https://oa.live.educlouddata.com/api"' | |||||
| buildConfigField "String", "APP_NAME", '"一体化平台(开发)"' | buildConfigField "String", "APP_NAME", '"一体化平台(开发)"' | ||||
| buildConfigField "String", "MP_APPID", '"wxbb397ddae71bb14c"' | buildConfigField "String", "MP_APPID", '"wxbb397ddae71bb14c"' | ||||
| // buildConfigField "String", "WS_URL", '"ws://192.168.69.114:9801/"' | // buildConfigField "String", "WS_URL", '"ws://192.168.69.114:9801/"' | ||||
| @@ -81,8 +81,8 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| private val mHandler = Handler(Looper.getMainLooper()) | private val mHandler = Handler(Looper.getMainLooper()) | ||||
| private val runnable = object : Runnable { | private val runnable = object : Runnable { | ||||
| override fun run() { | override fun run() { | ||||
| val isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", false) | |||||
| val isAutoShowChange = SPUtils.getInstance().getBoolean("auto_show_change", false) | |||||
| val isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", true) | |||||
| val isAutoShowChange = SPUtils.getInstance().getBoolean("auto_show_change", true) | |||||
| if (isAutoShowLeave || isAutoShowChange) { | if (isAutoShowLeave || isAutoShowChange) { | ||||
| if (!idsLoading) { | if (!idsLoading) { | ||||
| idsLoading = true | idsLoading = true | ||||
| @@ -173,8 +173,8 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| } | } | ||||
| private fun checkAuto() { | private fun checkAuto() { | ||||
| isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", false) | |||||
| isAutoShowChange = SPUtils.getInstance().getBoolean("auto_show_change", false) | |||||
| isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", true) | |||||
| isAutoShowChange = SPUtils.getInstance().getBoolean("auto_show_change", true) | |||||
| if (isAutoShowLeave || isAutoShowChange) { | if (isAutoShowLeave || isAutoShowChange) { | ||||
| mHandler.removeCallbacks(runnable) | mHandler.removeCallbacks(runnable) | ||||
| mHandler.postDelayed(runnable, 2000) | mHandler.postDelayed(runnable, 2000) | ||||
| @@ -346,7 +346,10 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| override fun onClose(code: Int, reason: String?, remote: Boolean) { | override fun onClose(code: Int, reason: String?, remote: Boolean) { | ||||
| LogUtils.d("WebSocketClient-onClose", code, reason, remote) | LogUtils.d("WebSocketClient-onClose", code, reason, remote) | ||||
| Thread{ | |||||
| Thread.sleep(60*1000) | |||||
| initWs() | |||||
| }.start() | |||||
| } | } | ||||
| override fun onMessage(message: String?) { | override fun onMessage(message: String?) { | ||||
| @@ -358,7 +361,10 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| override fun onError(ex: Exception?) { | override fun onError(ex: Exception?) { | ||||
| LogUtils.d("WebSocketClient-onError", ex) | LogUtils.d("WebSocketClient-onError", ex) | ||||
| Thread{ | |||||
| Thread.sleep(60*1000) | |||||
| initWs() | |||||
| }.start() | |||||
| } | } | ||||
| } | } | ||||
| @@ -378,6 +384,7 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| val res = gson.fromJson<YzxClientInfo>(msg, resultType) | val res = gson.fromJson<YzxClientInfo>(msg, resultType) | ||||
| if (res.data.student_id > 0) { | if (res.data.student_id > 0) { | ||||
| if (isAutoShowLeave || isAutoShowChange) { | if (isAutoShowLeave || isAutoShowChange) { | ||||
| LogUtils.d("WebSocketClient--wsMessage",res) | |||||
| EventBus.getDefault().post(EventLeaveIds("${res.data.student_id}")) | EventBus.getDefault().post(EventLeaveIds("${res.data.student_id}")) | ||||
| // mPresenter?.getLeaveShowIds("${res.data.student_id}") | // mPresenter?.getLeaveShowIds("${res.data.student_id}") | ||||
| } | } | ||||
| @@ -387,6 +394,7 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| //请假消息 | //请假消息 | ||||
| @Subscribe(threadMode = ThreadMode.MAIN) | @Subscribe(threadMode = ThreadMode.MAIN) | ||||
| fun onMessageEvent(detail: EventLeaveIds) { | fun onMessageEvent(detail: EventLeaveIds) { | ||||
| LogUtils.d("WebSocketClient--onMessageEvent",detail) | |||||
| mPresenter?.getLeaveShowIds("${detail.ids}") | mPresenter?.getLeaveShowIds("${detail.ids}") | ||||
| } | } | ||||
| @@ -590,7 +598,7 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| override fun onLeaveIDsSuccess(list: MutableList<LeaveID>) { | override fun onLeaveIDsSuccess(list: MutableList<LeaveID>) { | ||||
| idsLoading = false | idsLoading = false | ||||
| LogUtils.d("获取详情结束--ids", TimeUtils.getNowMills()) | |||||
| LogUtils.d("WebSocketClient--获取详情结束--ids", list) | |||||
| val listLeave = list.filter { it.type == 0 }.toMutableList() | val listLeave = list.filter { it.type == 0 }.toMutableList() | ||||
| val listChange = list.filter { it.type == 1 }.toMutableList() | val listChange = list.filter { it.type == 1 }.toMutableList() | ||||
| var type = 0 | var type = 0 | ||||
| @@ -59,6 +59,7 @@ class LoginActivity : BaseActivity<LoginPresenter>(), LoginView { | |||||
| accountLayout.visibility = View.GONE | accountLayout.visibility = View.GONE | ||||
| SPUtils.getInstance().put("last_login_tab_index",1) | SPUtils.getInstance().put("last_login_tab_index",1) | ||||
| KeyboardUtils.hideSoftInput(this@LoginActivity) | KeyboardUtils.hideSoftInput(this@LoginActivity) | ||||
| mPresenter?.getWXQrCode() | |||||
| } | } | ||||
| } | } | ||||
| @@ -71,6 +72,7 @@ class LoginActivity : BaseActivity<LoginPresenter>(), LoginView { | |||||
| qrLayout.visibility = View.VISIBLE | qrLayout.visibility = View.VISIBLE | ||||
| accountLayout.visibility = View.GONE | accountLayout.visibility = View.GONE | ||||
| tabLayout.currentTab = 1 | tabLayout.currentTab = 1 | ||||
| mPresenter?.getWXQrCode() | |||||
| } | } | ||||
| loginBtn.setOnClickListener { | loginBtn.setOnClickListener { | ||||
| this.doLogin() | this.doLogin() | ||||
| @@ -112,7 +114,7 @@ class LoginActivity : BaseActivity<LoginPresenter>(), LoginView { | |||||
| } | } | ||||
| override fun initData() { | override fun initData() { | ||||
| mPresenter?.getWXQrCode() | |||||
| } | } | ||||
| override fun initPresenter(): LoginPresenter = LoginPresenter(this) | override fun initPresenter(): LoginPresenter = LoginPresenter(this) | ||||
| @@ -127,7 +127,7 @@ class ChangeFragment : BaseFragment<ChangePresenter>(), ChangeView, | |||||
| changeSwitchBtnTxt(isChecked) | changeSwitchBtnTxt(isChecked) | ||||
| EventBus.getDefault().post(AutoSwitchChange(2)) | EventBus.getDefault().post(AutoSwitchChange(2)) | ||||
| } | } | ||||
| val isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_change", false) | |||||
| val isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_change", true) | |||||
| switchBtn.isChecked = isAutoShowLeave | switchBtn.isChecked = isAutoShowLeave | ||||
| changeSwitchBtnTxt(isAutoShowLeave) | changeSwitchBtnTxt(isAutoShowLeave) | ||||
| @@ -149,7 +149,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| changeSwitchBtnTxt(isChecked) | changeSwitchBtnTxt(isChecked) | ||||
| EventBus.getDefault().post(AutoSwitchChange(1)) | EventBus.getDefault().post(AutoSwitchChange(1)) | ||||
| } | } | ||||
| val isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", false) | |||||
| val isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", true) | |||||
| switchBtn.isChecked = isAutoShowLeave | switchBtn.isChecked = isAutoShowLeave | ||||
| changeSwitchBtnTxt(isAutoShowLeave) | changeSwitchBtnTxt(isAutoShowLeave) | ||||
| @@ -477,6 +477,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| @Subscribe(threadMode = ThreadMode.MAIN) | @Subscribe(threadMode = ThreadMode.MAIN) | ||||
| fun onMessageEvent(event: MessageEventAuto) { | fun onMessageEvent(event: MessageEventAuto) { | ||||
| val list = event.list.filter { it.type == 0 }.toMutableList() | val list = event.list.filter { it.type == 0 }.toMutableList() | ||||
| LogUtils.d("WebSocketClient-onMessageEvent",event) | |||||
| if (list.isNotEmpty() && switchBtn.isChecked) { | if (list.isNotEmpty() && switchBtn.isChecked) { | ||||
| onLeaveIDsSuccess(list) | onLeaveIDsSuccess(list) | ||||
| } | } | ||||
| @@ -498,7 +499,9 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| list.forEachIndexed { index, leaveID -> | list.forEachIndexed { index, leaveID -> | ||||
| pageTv.postDelayed({ | pageTv.postDelayed({ | ||||
| mPresenter?.getDetail(leaveID.id) | |||||
| if(leaveID.id>0){ | |||||
| mPresenter?.getDetail(leaveID.id) | |||||
| } | |||||
| }, 500L * index) | }, 500L * index) | ||||
| } | } | ||||
| } | } | ||||
| @@ -19,7 +19,10 @@ class MainPresenter(view: MainView) : BasePresenter<MainView>(view) { | |||||
| if (User.getUser().token.isEmpty()) { | if (User.getUser().token.isEmpty()) { | ||||
| return | return | ||||
| } | } | ||||
| val url = "${Config.BASE_URL}${YzxInterface.INTERFACE_STUDENT_GET_SHOW_BOX_LIST}" | |||||
| var url = "${Config.BASE_URL}${YzxInterface.INTERFACE_STUDENT_GET_SHOW_BOX_LIST}" | |||||
| if(student_id.isEmpty()){ | |||||
| url = "${Config.BASE_URL}${YzxInterface.INTERFACE_STUDENT_GET_SHOW_BOX_LIST_OLD}" | |||||
| } | |||||
| OkGo.post<YzxResponse<LeaveID>>(url) | OkGo.post<YzxResponse<LeaveID>>(url) | ||||
| .tag(this) | .tag(this) | ||||
| .params("student_id", student_id) | .params("student_id", student_id) | ||||