| @@ -19,8 +19,8 @@ android { | |||||
| // minSdkVersion 26 | // minSdkVersion 26 | ||||
| minSdkVersion 21 | minSdkVersion 21 | ||||
| targetSdkVersion 25 | targetSdkVersion 25 | ||||
| versionCode 30010 | |||||
| versionName "3.0.10" | |||||
| versionCode 30100 | |||||
| versionName "3.1.0" | |||||
| testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||||
| ndk { | ndk { | ||||
| @@ -114,7 +114,7 @@ android { | |||||
| buildConfigField "String", "WS_URL", '"wss://oa.live.educlouddata.com/ws2api/"' | buildConfigField "String", "WS_URL", '"wss://oa.live.educlouddata.com/ws2api/"' | ||||
| applicationIdSuffix ".live" | applicationIdSuffix ".live" | ||||
| buildConfigField "String", "MP_ID",'"2"' | buildConfigField "String", "MP_ID",'"2"' | ||||
| buildConfigField "String", "ENV_NAME",'"kz"' | |||||
| buildConfigField "String", "ENV_NAME",'"qbj"' | |||||
| } | } | ||||
| yzx_test { | yzx_test { | ||||
| @@ -34,7 +34,6 @@ import com.yzx.escreen.activity.LoginActivity | |||||
| import com.yzx.escreen.activity.base.BaseActivity | import com.yzx.escreen.activity.base.BaseActivity | ||||
| import com.yzx.escreen.config.Config | import com.yzx.escreen.config.Config | ||||
| import com.yzx.escreen.config.RefreshToken | import com.yzx.escreen.config.RefreshToken | ||||
| import com.yzx.escreen.fragment.ChangeFragment | |||||
| import com.yzx.escreen.fragment.HomeFragment | import com.yzx.escreen.fragment.HomeFragment | ||||
| import com.yzx.escreen.fragment.SettingFragment | import com.yzx.escreen.fragment.SettingFragment | ||||
| import com.yzx.escreen.fragment.VisitorFragment | import com.yzx.escreen.fragment.VisitorFragment | ||||
| @@ -144,7 +143,7 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| } | } | ||||
| val tabData = arrayListOf<CustomTabEntity>() | val tabData = arrayListOf<CustomTabEntity>() | ||||
| tabData.add(TabEntity("学生请假", R.mipmap.leave_select, R.mipmap.leave_unselect)) | tabData.add(TabEntity("学生请假", R.mipmap.leave_select, R.mipmap.leave_unselect)) | ||||
| tabData.add(TabEntity("学籍异动", R.mipmap.change_select, R.mipmap.change_unselect)) | |||||
| // tabData.add(TabEntity("学籍异动", R.mipmap.change_select, R.mipmap.change_unselect)) | |||||
| tabData.add(TabEntity("访客管理", R.mipmap.visitor_select, R.mipmap.visitor_unselect)) | tabData.add(TabEntity("访客管理", R.mipmap.visitor_select, R.mipmap.visitor_unselect)) | ||||
| // tabData.add(TabEntity("我的", R.mipmap.my_select, R.mipmap.my_unselect)) | // tabData.add(TabEntity("我的", R.mipmap.my_select, R.mipmap.my_unselect)) | ||||
| tabData.add(TabEntity("设置", R.mipmap.setting_select, R.mipmap.setting)) | tabData.add(TabEntity("设置", R.mipmap.setting_select, R.mipmap.setting)) | ||||
| @@ -650,15 +649,15 @@ class HomePagerAdapter(act: AppCompatActivity) : FragmentStateAdapter(act) { | |||||
| return HomeFragment.getNewInstance() | return HomeFragment.getNewInstance() | ||||
| } | } | ||||
| 1 -> { | |||||
| return ChangeFragment.getNewInstance() | |||||
| } | |||||
| // 1 -> { | |||||
| // return ChangeFragment.getNewInstance() | |||||
| // } | |||||
| 2 -> { | |||||
| 1 -> { | |||||
| return VisitorFragment.getNewInstance() | return VisitorFragment.getNewInstance() | ||||
| } | } | ||||
| 3 -> { | |||||
| 2 -> { | |||||
| return SettingFragment.getNewInstance() | return SettingFragment.getNewInstance() | ||||
| } | } | ||||
| } | } | ||||
| @@ -61,6 +61,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| private val statusBtnList = mutableListOf<QMUIRoundButton>() | private val statusBtnList = mutableListOf<QMUIRoundButton>() | ||||
| var keyword: String = "" | var keyword: String = "" | ||||
| var status: String = "" | var status: String = "" | ||||
| var add_time: String = "today" | |||||
| private var isLoading = false | private var isLoading = false | ||||
| private val mShowList = mutableListOf<StuLeave>() | private val mShowList = mutableListOf<StuLeave>() | ||||
| private val mShowDialogList = mutableListOf<BaseDialog>() | private val mShowDialogList = mutableListOf<BaseDialog>() | ||||
| @@ -87,17 +88,13 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| preTxtBtn.setOnClickListener { pre() } | preTxtBtn.setOnClickListener { pre() } | ||||
| nextTxtBtn.setOnClickListener { next() } | nextTxtBtn.setOnClickListener { next() } | ||||
| allBtn.setOnClickListener { changeStatus(0) } | allBtn.setOnClickListener { changeStatus(0) } | ||||
| status1Btn.setOnClickListener { changeStatus(1) } | |||||
| status2Btn.setOnClickListener { changeStatus(2) } | |||||
| status3Btn.setOnClickListener { changeStatus(3) } | |||||
| status4Btn.setOnClickListener { changeStatus(4) } | |||||
| status5Btn.setOnClickListener { changeStatus(5) } | |||||
| yesterday.setOnClickListener { changeStatus(2) } | |||||
| last7Days.setOnClickListener { changeStatus(3) } | |||||
| today.setOnClickListener { changeStatus(1) } | |||||
| statusBtnList.add(allBtn) | statusBtnList.add(allBtn) | ||||
| statusBtnList.add(status1Btn) | |||||
| statusBtnList.add(status2Btn) | |||||
| statusBtnList.add(status3Btn) | |||||
| statusBtnList.add(status4Btn) | |||||
| statusBtnList.add(status5Btn) | |||||
| statusBtnList.add(today) | |||||
| statusBtnList.add(yesterday) | |||||
| statusBtnList.add(last7Days) | |||||
| keywordInput.setOnKeyListener { _, keyCode, _ -> | keywordInput.setOnKeyListener { _, keyCode, _ -> | ||||
| if (!isLoading) { | if (!isLoading) { | ||||
| if (keyCode == KeyEvent.KEYCODE_ENTER) { | if (keyCode == KeyEvent.KEYCODE_ENTER) { | ||||
| @@ -117,9 +114,9 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| var lastClickTime = TimeUtils.getNowMills() | var lastClickTime = TimeUtils.getNowMills() | ||||
| mAdapter.setOnItemClickListener { adapter, view, position -> | mAdapter.setOnItemClickListener { adapter, view, position -> | ||||
| val curr = TimeUtils.getNowMills() | val curr = TimeUtils.getNowMills() | ||||
| if(curr - lastClickTime > 500){ | |||||
| if (curr - lastClickTime > 500) { | |||||
| lastClickTime = curr | lastClickTime = curr | ||||
| LogUtils.d("获取详情开始",TimeUtils.getNowMills(),mAdapter.getItem(position).id) | |||||
| LogUtils.d("获取详情开始", TimeUtils.getNowMills(), mAdapter.getItem(position).id) | |||||
| showLayoutLoading() | showLayoutLoading() | ||||
| mPresenter?.getDetail(mAdapter.getItem(position).id) | mPresenter?.getDetail(mAdapter.getItem(position).id) | ||||
| } | } | ||||
| @@ -128,13 +125,14 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| mAdapter.setOnItemChildClickListener { adapter, view, position -> | mAdapter.setOnItemChildClickListener { adapter, view, position -> | ||||
| LogUtils.d("setOnItemChildClickListener", position) | LogUtils.d("setOnItemChildClickListener", position) | ||||
| val curr = TimeUtils.getNowMills() | val curr = TimeUtils.getNowMills() | ||||
| if(curr - lastClickTime > 500){ | |||||
| if (curr - lastClickTime > 500) { | |||||
| lastClickTime = curr | lastClickTime = curr | ||||
| when (view.id) { | when (view.id) { | ||||
| R.id.cancelBtn -> { | R.id.cancelBtn -> { | ||||
| mCancelItem = mAdapter.getItem(position) | mCancelItem = mAdapter.getItem(position) | ||||
| showCancelDialog() | showCancelDialog() | ||||
| } | } | ||||
| R.id.faceEmpty -> { | R.id.faceEmpty -> { | ||||
| showLayoutLoading() | showLayoutLoading() | ||||
| mPresenter?.getDetail(mAdapter.getItem(position).id) | mPresenter?.getDetail(mAdapter.getItem(position).id) | ||||
| @@ -185,7 +183,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| showLayoutLoading() | showLayoutLoading() | ||||
| initData() | initData() | ||||
| } | } | ||||
| changeStatusBtn(0) | |||||
| changeStatusBtn(1) | |||||
| loadingLayout.setOnClickListener { | loadingLayout.setOnClickListener { | ||||
| //do nothing | //do nothing | ||||
| } | } | ||||
| @@ -193,16 +191,61 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| showLayoutLoading() | showLayoutLoading() | ||||
| initData() | initData() | ||||
| } | } | ||||
| filterBtn.setOnClickListener { | |||||
| showFilterDialog(this.status) | |||||
| } | |||||
| } | } | ||||
| private fun showLayoutLoading(){ | |||||
| private fun showLayoutLoading() { | |||||
| loadingLayout.visibility = View.VISIBLE | loadingLayout.visibility = View.VISIBLE | ||||
| } | } | ||||
| private fun hideLayoutLoading(){ | |||||
| private fun hideLayoutLoading() { | |||||
| loadingLayout.visibility = View.GONE | loadingLayout.visibility = View.GONE | ||||
| } | } | ||||
| @SuppressLint("SetTextI18n") | |||||
| private fun showFilterDialog(status: String) { | |||||
| var idx = if (status == "") { | |||||
| 0 | |||||
| } else { | |||||
| status.toInt() | |||||
| } | |||||
| val dialogVacation = BaseDialog(act, R.style.BaseDialog, R.layout.dialog_time_filter) | |||||
| val btns = mutableListOf<TextView>() | |||||
| btns.add(dialogVacation.find(R.id.allBtn)) | |||||
| btns.add(dialogVacation.find(R.id.status1Btn)) | |||||
| btns.add(dialogVacation.find(R.id.status2Btn)) | |||||
| btns.add(dialogVacation.find(R.id.status3Btn)) | |||||
| btns.add(dialogVacation.find(R.id.status4Btn)) | |||||
| btns.add(dialogVacation.find(R.id.status5Btn)) | |||||
| btns.forEachIndexed { index, button -> | |||||
| button.setOnClickListener { | |||||
| btns.forEachIndexed { childIdx, btn -> | |||||
| btn.isSelected = childIdx == index | |||||
| } | |||||
| idx = index | |||||
| } | |||||
| button.isSelected = index == idx | |||||
| } | |||||
| dialogVacation.find<TextView>(R.id.submitBtn).setOnClickListener { | |||||
| this.status = if (idx == 0) { | |||||
| "" | |||||
| } else { | |||||
| "${idx}" | |||||
| } | |||||
| dialogVacation.hide() | |||||
| showLayoutLoading() | |||||
| initData() | |||||
| } | |||||
| dialogVacation.find<TextView>(R.id.closeBtn).setOnClickListener { | |||||
| dialogVacation.hide() | |||||
| } | |||||
| //处理弹窗显示 | |||||
| dialogVacation.show() | |||||
| dialogVacation.hideNavigationBar() | |||||
| } | |||||
| @SuppressLint("SetTextI18n") | @SuppressLint("SetTextI18n") | ||||
| private fun showCancelDialog() { | private fun showCancelDialog() { | ||||
| val dialogVacation = BaseDialog(act, R.style.BaseDialog, R.layout.dialog_vacation) | val dialogVacation = BaseDialog(act, R.style.BaseDialog, R.layout.dialog_vacation) | ||||
| @@ -302,10 +345,26 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| return | return | ||||
| } | } | ||||
| changeStatusBtn(status) | changeStatusBtn(status) | ||||
| this.status = if (status == 0) { | |||||
| "" | |||||
| } else { | |||||
| "${status}" | |||||
| this.add_time = when (status) { | |||||
| 0 -> { | |||||
| "" | |||||
| } | |||||
| 1 -> { | |||||
| "today" | |||||
| } | |||||
| 2 -> { | |||||
| "yesterday" | |||||
| } | |||||
| 3 -> { | |||||
| "last7Days" | |||||
| } | |||||
| else -> { | |||||
| "" | |||||
| } | |||||
| } | } | ||||
| showLayoutLoading() | showLayoutLoading() | ||||
| initData() | initData() | ||||
| @@ -317,7 +376,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| if (NetworkUtils.isConnected()) { | if (NetworkUtils.isConnected()) { | ||||
| showEmpty(1) | showEmpty(1) | ||||
| isLoading = true | isLoading = true | ||||
| mPresenter?.getLeaveList(mPager.page_no, keyword, status) | |||||
| mPresenter?.getLeaveList(mPager.page_no, keyword, status, add_time) | |||||
| } else { | } else { | ||||
| showEmpty(2) | showEmpty(2) | ||||
| } | } | ||||
| @@ -336,6 +395,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| this.QMUIEmptyView.setTitleText("数据加载中") | this.QMUIEmptyView.setTitleText("数据加载中") | ||||
| } | } | ||||
| } | } | ||||
| 2 -> { | 2 -> { | ||||
| mAdapter.setEmptyView(R.layout.layout_loading) | mAdapter.setEmptyView(R.layout.layout_loading) | ||||
| mAdapter.emptyLayout?.apply { | mAdapter.emptyLayout?.apply { | ||||
| @@ -344,6 +404,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| 3 -> { | 3 -> { | ||||
| mAdapter.setEmptyView(R.layout.layout_empty) | mAdapter.setEmptyView(R.layout.layout_empty) | ||||
| } | } | ||||
| @@ -356,7 +417,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| return | return | ||||
| } | } | ||||
| isLoading = true | isLoading = true | ||||
| mPresenter?.getLeaveList(mPager.page_no, keyword, status) | |||||
| mPresenter?.getLeaveList(mPager.page_no, keyword, status, add_time) | |||||
| } | } | ||||
| private fun pre() { | private fun pre() { | ||||
| @@ -368,7 +429,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| } else { | } else { | ||||
| isLoading = true | isLoading = true | ||||
| showLayoutLoading() | showLayoutLoading() | ||||
| mPresenter?.getLeaveList(mPager.page_no - 1, keyword, status) | |||||
| mPresenter?.getLeaveList(mPager.page_no - 1, keyword, status, add_time) | |||||
| } | } | ||||
| } | } | ||||
| @@ -381,7 +442,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| } else { | } else { | ||||
| isLoading = true | isLoading = true | ||||
| showLayoutLoading() | showLayoutLoading() | ||||
| mPresenter?.getLeaveList(mPager.page_no + 1, keyword, status) | |||||
| mPresenter?.getLeaveList(mPager.page_no + 1, keyword, status, add_time) | |||||
| } | } | ||||
| } | } | ||||
| @@ -390,7 +451,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| @SuppressLint("SetTextI18n") | @SuppressLint("SetTextI18n") | ||||
| override fun onLeaveListSuccess(list: MutableList<StuLeave>, pager: Pager) { | override fun onLeaveListSuccess(list: MutableList<StuLeave>, pager: Pager) { | ||||
| pageTv?.apply { | pageTv?.apply { | ||||
| if(isRefresh){ | |||||
| if (isRefresh) { | |||||
| toast("刷新成功!") | toast("刷新成功!") | ||||
| isRefresh = false | isRefresh = false | ||||
| } | } | ||||
| @@ -433,7 +494,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| override fun onLeaveListError(error: String) { | override fun onLeaveListError(error: String) { | ||||
| isLoading = false | isLoading = false | ||||
| hideLayoutLoading() | hideLayoutLoading() | ||||
| if(isRefresh){ | |||||
| if (isRefresh) { | |||||
| toast("刷新失败,请重试!") | toast("刷新失败,请重试!") | ||||
| isRefresh = false | isRefresh = false | ||||
| } | } | ||||
| @@ -458,7 +519,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| } else { | } else { | ||||
| mShowList.add(detail) | mShowList.add(detail) | ||||
| } | } | ||||
| LogUtils.d("获取详情结束",TimeUtils.getNowMills(),detail.id) | |||||
| LogUtils.d("获取详情结束", TimeUtils.getNowMills(), detail.id) | |||||
| hideLayoutLoading() | hideLayoutLoading() | ||||
| showLeaveDialog(detail) | showLeaveDialog(detail) | ||||
| } | } | ||||
| @@ -477,7 +538,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) | |||||
| LogUtils.d("WebSocketClient-onMessageEvent", event) | |||||
| if (list.isNotEmpty() && switchBtn.isChecked) { | if (list.isNotEmpty() && switchBtn.isChecked) { | ||||
| onLeaveIDsSuccess(list) | onLeaveIDsSuccess(list) | ||||
| } | } | ||||
| @@ -499,7 +560,7 @@ class HomeFragment : BaseFragment<HomePresenter>(), HomeView, | |||||
| list.forEachIndexed { index, leaveID -> | list.forEachIndexed { index, leaveID -> | ||||
| pageTv.postDelayed({ | pageTv.postDelayed({ | ||||
| if(leaveID.id>0){ | |||||
| if (leaveID.id > 0) { | |||||
| mPresenter?.getDetail(leaveID.id) | mPresenter?.getDetail(leaveID.id) | ||||
| } | } | ||||
| }, 500L * index) | }, 500L * index) | ||||
| @@ -4,24 +4,65 @@ import com.blankj.utilcode.util.LogUtils | |||||
| import com.lzy.okgo.OkGo | import com.lzy.okgo.OkGo | ||||
| import com.lzy.okgo.model.Response | import com.lzy.okgo.model.Response | ||||
| import com.yzx.escreen.config.Config | import com.yzx.escreen.config.Config | ||||
| import com.yzx.escreen.model.* | |||||
| import com.yzx.escreen.presenter.base.* | |||||
| import com.yzx.escreen.config.YzxInterface | import com.yzx.escreen.config.YzxInterface | ||||
| import com.yzx.escreen.model.LeaveID | |||||
| import com.yzx.escreen.model.Pager | |||||
| import com.yzx.escreen.model.StuLeave | |||||
| import com.yzx.escreen.model.User | |||||
| import com.yzx.escreen.model.Vacation | |||||
| import com.yzx.escreen.presenter.base.BasePresenter | |||||
| import com.yzx.escreen.presenter.base.IView | |||||
| import com.yzx.escreen.presenter.base.JsonCallBack | |||||
| import com.yzx.escreen.presenter.base.SimpleResponse | |||||
| import com.yzx.escreen.presenter.base.YzxResponse | |||||
| import java.util.Calendar | |||||
| class HomePresenter(view: HomeView) : BasePresenter<HomeView>(view) { | class HomePresenter(view: HomeView) : BasePresenter<HomeView>(view) { | ||||
| fun getLeaveList(pageNo: Int, keyword: String, status: String) { | |||||
| fun getLeaveList(pageNo: Int, keyword: String, status: String, add_time: String) { | |||||
| if(User.getUser().token.isEmpty()){ | if(User.getUser().token.isEmpty()){ | ||||
| return | return | ||||
| } | } | ||||
| val calendar = Calendar.getInstance() | |||||
| var endTime: Long =0 | |||||
| var startTime: Long =0 | |||||
| when (add_time) { | |||||
| "today" -> { | |||||
| calendar.set(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH),calendar.get(Calendar.DATE),23,59,59) | |||||
| endTime = calendar.timeInMillis/1000 // 当前时间戳 | |||||
| calendar.set(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH),calendar.get(Calendar.DATE),0,0,0) | |||||
| startTime = calendar.timeInMillis/1000 // 开始时间戳 | |||||
| } | |||||
| "yesterday" -> { | |||||
| calendar.add(Calendar.DAY_OF_YEAR, -1) // 将日期往前推1天 | |||||
| calendar.set(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH),calendar.get(Calendar.DATE),23,59,59) | |||||
| endTime = calendar.timeInMillis/1000 // 当前时间戳 | |||||
| calendar.set(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH),calendar.get(Calendar.DATE),0,0,0) | |||||
| startTime = calendar.timeInMillis/1000 // 开始时间戳 | |||||
| } | |||||
| "last7Days" -> { | |||||
| calendar.set(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH),calendar.get(Calendar.DATE),23,59,59) | |||||
| endTime = calendar.timeInMillis/1000 // 当前时间戳 | |||||
| calendar.add(Calendar.DAY_OF_YEAR, -6) // 将日期往前推6天 | |||||
| calendar.set(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH),calendar.get(Calendar.DATE),0,0,0) | |||||
| startTime = calendar.timeInMillis/1000 // 近七天的开始时间戳 | |||||
| } | |||||
| } | |||||
| val params = HashMap<String,String>() | |||||
| params["keyword"] = keyword | |||||
| params["status"] = status | |||||
| params["page_size"] = "6" | |||||
| params["page_no"] = "$pageNo" | |||||
| if(add_time!=""){ | |||||
| params["start_time"] = "$startTime" | |||||
| params["end_time"] = "$endTime" | |||||
| } | |||||
| val url = "${Config.BASE_URL}${YzxInterface.INTERFACE_GET_STU_LEAVE_LIST}" | val url = "${Config.BASE_URL}${YzxInterface.INTERFACE_GET_STU_LEAVE_LIST}" | ||||
| OkGo.post<YzxResponse<StuLeave>>(url) | OkGo.post<YzxResponse<StuLeave>>(url) | ||||
| .tag(this) | .tag(this) | ||||
| .params("keyword", keyword) | |||||
| .params("status", status) | |||||
| .params("page_size", 6) | |||||
| .params("page_no", pageNo) | |||||
| .params(params) | |||||
| .execute(object : JsonCallBack<YzxResponse<StuLeave>>() { | .execute(object : JsonCallBack<YzxResponse<StuLeave>>() { | ||||
| @@ -14,7 +14,7 @@ fun ImageView.setSrc(identity: String, key: String) { | |||||
| var url = | var url = | ||||
| "https://${identity.ifEmpty { "filea" }}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | "https://${identity.ifEmpty { "filea" }}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | ||||
| if ("cszxy" == Config.ENV_NAME || "kz" == Config.ENV_NAME) { | if ("cszxy" == Config.ENV_NAME || "kz" == Config.ENV_NAME) { | ||||
| url = "https://filea.educlouddata.com/edufile/imageView?uniqueKey=${key}" | |||||
| url = "https://file.educlouddata.com/edufile/imageView?uniqueKey=${key}" | |||||
| } | } | ||||
| Glide.with(this) | Glide.with(this) | ||||
| .load(url) | .load(url) | ||||
| @@ -27,7 +27,7 @@ fun String.getImgUrl(key: String): String { | |||||
| var url = | var url = | ||||
| "https://${this.ifEmpty { "filea" }}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | "https://${this.ifEmpty { "filea" }}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | ||||
| if ("cszxy" == Config.ENV_NAME || "kz" == Config.ENV_NAME) { | if ("cszxy" == Config.ENV_NAME || "kz" == Config.ENV_NAME) { | ||||
| url = "https://filea.educlouddata.com/edufile/imageView?uniqueKey=${key}" | |||||
| url = "https://file.educlouddata.com/edufile/imageView?uniqueKey=${key}" | |||||
| } | } | ||||
| return url | return url | ||||
| } | } | ||||
| @@ -0,0 +1,140 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| xmlns:app="http://schemas.android.com/apk/res-auto" | |||||
| xmlns:tools="http://schemas.android.com/tools" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| android:orientation="vertical"> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout | |||||
| android:layout_width="800dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:minWidth="1400dp" | |||||
| android:orientation="vertical" | |||||
| app:qmui_backgroundColor="@color/white" | |||||
| app:qmui_radius="@dimen/d_15"> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundFrameLayout | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| app:qmui_backgroundColor="@color/colorPrimary" | |||||
| app:qmui_radiusTopLeft="@dimen/d_15" | |||||
| app:qmui_radiusTopRight="@dimen/d_15"> | |||||
| <TextView | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:gravity="center" | |||||
| android:padding="@dimen/d_28" | |||||
| android:text="状态筛选" | |||||
| android:textColor="@color/white" | |||||
| android:textSize="@dimen/sp20" | |||||
| android:textStyle="bold" /> | |||||
| </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundFrameLayout> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:paddingHorizontal="@dimen/dp_40" | |||||
| android:paddingVertical="30dp" | |||||
| android:gravity="center"> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/allBtn" | |||||
| style="@style/home_status_btn" | |||||
| android:text="全部" | |||||
| android:textColor="@color/s_app_color_status_text" | |||||
| app:qmui_backgroundColor="@color/s_app_color_status_bg" | |||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/status1Btn" | |||||
| style="@style/home_status_btn" | |||||
| android:text="待处理" | |||||
| android:textColor="@color/s_app_color_status_text" | |||||
| app:qmui_backgroundColor="@color/s_app_color_status_bg" | |||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/status2Btn" | |||||
| style="@style/home_status_btn" | |||||
| android:text="已确认" | |||||
| android:textColor="@color/s_app_color_status_text" | |||||
| app:qmui_backgroundColor="@color/s_app_color_status_bg" | |||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:paddingHorizontal="@dimen/dp_40" | |||||
| android:paddingVertical="30dp" | |||||
| android:gravity="center"> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/status3Btn" | |||||
| style="@style/home_status_btn" | |||||
| android:text="已拒绝" | |||||
| android:textColor="@color/s_app_color_status_text" | |||||
| app:qmui_backgroundColor="@color/s_app_color_status_bg" | |||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/status4Btn" | |||||
| style="@style/home_status_btn" | |||||
| android:text="正常销假" | |||||
| android:textColor="@color/s_app_color_status_text" | |||||
| app:qmui_backgroundColor="@color/s_app_color_status_bg" | |||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/status5Btn" | |||||
| style="@style/home_status_btn" | |||||
| android:text="超时销假" | |||||
| android:textColor="@color/s_app_color_status_text" | |||||
| app:qmui_backgroundColor="@color/s_app_color_status_bg" | |||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:gravity="center" | |||||
| android:orientation="horizontal" | |||||
| android:layout_marginTop="@dimen/d_30"> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/closeBtn" | |||||
| android:layout_width="300dp" | |||||
| android:layout_height="80dp" | |||||
| android:layout_gravity="center_horizontal" | |||||
| android:layout_marginTop="@dimen/dp_40" | |||||
| android:layout_marginBottom="@dimen/d_20" | |||||
| android:padding="@dimen/d_10" | |||||
| android:text="关闭" | |||||
| android:textColor="@color/black" | |||||
| android:textSize="@dimen/sp20" | |||||
| app:qmui_borderColor="@color/gray" | |||||
| app:qmui_radius="@dimen/d_5" /> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/submitBtn" | |||||
| android:layout_width="300dp" | |||||
| android:layout_height="80dp" | |||||
| android:layout_gravity="center_horizontal" | |||||
| android:layout_marginStart="@dimen/d_30" | |||||
| android:layout_marginTop="@dimen/dp_40" | |||||
| android:layout_marginBottom="@dimen/d_20" | |||||
| android:padding="@dimen/d_10" | |||||
| android:text="确定" | |||||
| android:textColor="@color/white" | |||||
| android:textSize="@dimen/sp20" | |||||
| app:qmui_backgroundColor="@color/colorPrimary" | |||||
| app:qmui_borderColor="@color/colorPrimary" | |||||
| app:qmui_radius="@dimen/d_5" /> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout> | |||||
| </FrameLayout> | |||||
| @@ -98,41 +98,25 @@ | |||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | app:qmui_borderColor="@color/s_app_color_status_border" /> | ||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | ||||
| android:id="@+id/status1Btn" | |||||
| android:id="@+id/today" | |||||
| style="@style/home_status_btn" | style="@style/home_status_btn" | ||||
| android:text="待处理" | |||||
| android:text="今天" | |||||
| android:textColor="@color/s_app_color_status_text" | android:textColor="@color/s_app_color_status_text" | ||||
| app:qmui_backgroundColor="@color/s_app_color_status_bg" | app:qmui_backgroundColor="@color/s_app_color_status_bg" | ||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | app:qmui_borderColor="@color/s_app_color_status_border" /> | ||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | ||||
| android:id="@+id/status2Btn" | |||||
| android:id="@+id/yesterday" | |||||
| style="@style/home_status_btn" | style="@style/home_status_btn" | ||||
| android:text="已确认" | |||||
| android:text="昨天" | |||||
| android:textColor="@color/s_app_color_status_text" | android:textColor="@color/s_app_color_status_text" | ||||
| app:qmui_backgroundColor="@color/s_app_color_status_bg" | app:qmui_backgroundColor="@color/s_app_color_status_bg" | ||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | app:qmui_borderColor="@color/s_app_color_status_border" /> | ||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | ||||
| android:id="@+id/status3Btn" | |||||
| android:id="@+id/last7Days" | |||||
| style="@style/home_status_btn" | style="@style/home_status_btn" | ||||
| android:text="已拒绝" | |||||
| android:textColor="@color/s_app_color_status_text" | |||||
| app:qmui_backgroundColor="@color/s_app_color_status_bg" | |||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/status4Btn" | |||||
| style="@style/home_status_btn" | |||||
| android:text="正常销假" | |||||
| android:textColor="@color/s_app_color_status_text" | |||||
| app:qmui_backgroundColor="@color/s_app_color_status_bg" | |||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/status5Btn" | |||||
| style="@style/home_status_btn" | |||||
| android:text="超时销假" | |||||
| android:text="最近七天" | |||||
| android:textColor="@color/s_app_color_status_text" | android:textColor="@color/s_app_color_status_text" | ||||
| app:qmui_backgroundColor="@color/s_app_color_status_bg" | app:qmui_backgroundColor="@color/s_app_color_status_bg" | ||||
| app:qmui_borderColor="@color/s_app_color_status_border" /> | app:qmui_borderColor="@color/s_app_color_status_border" /> | ||||
| @@ -142,6 +126,16 @@ | |||||
| android:layout_height="1px" | android:layout_height="1px" | ||||
| android:layout_weight="1" /> | android:layout_weight="1" /> | ||||
| <TextView | |||||
| android:id="@+id/filterBtn" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:text=" 筛选" | |||||
| android:drawableLeft="@mipmap/ic_filter" | |||||
| android:layout_marginEnd="30dp" | |||||
| android:textColor="#3c7ef6" | |||||
| android:textSize="16dp"/> | |||||
| <Switch | <Switch | ||||
| android:id="@+id/switchBtn" | android:id="@+id/switchBtn" | ||||
| android:layout_width="48dp" | android:layout_width="48dp" | ||||