| @@ -1,6 +1,6 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | <project version="4"> | ||||
| <component name="CompilerConfiguration"> | <component name="CompilerConfiguration"> | ||||
| <bytecodeTargetLevel target="11" /> | |||||
| <bytecodeTargetLevel target="1.8" /> | |||||
| </component> | </component> | ||||
| </project> | </project> | ||||
| @@ -0,0 +1,17 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <project version="4"> | |||||
| <component name="deploymentTargetDropDown"> | |||||
| <targetSelectedWithDropDown> | |||||
| <Target> | |||||
| <type value="QUICK_BOOT_TARGET" /> | |||||
| <deviceKey> | |||||
| <Key> | |||||
| <type value="VIRTUAL_DEVICE_PATH" /> | |||||
| <value value="C:\Users\Administrator\.android\avd\EScreen_API_27.avd" /> | |||||
| </Key> | |||||
| </deviceKey> | |||||
| </Target> | |||||
| </targetSelectedWithDropDown> | |||||
| <timeTargetWasSelectedWithDropDown value="2023-08-16T10:14:10.010653100Z" /> | |||||
| </component> | |||||
| </project> | |||||
| @@ -4,18 +4,16 @@ | |||||
| <component name="GradleSettings"> | <component name="GradleSettings"> | ||||
| <option name="linkedExternalProjectsSettings"> | <option name="linkedExternalProjectsSettings"> | ||||
| <GradleProjectSettings> | <GradleProjectSettings> | ||||
| <option name="delegatedBuild" value="true" /> | |||||
| <option name="testRunner" value="GRADLE" /> | <option name="testRunner" value="GRADLE" /> | ||||
| <option name="disableWrapperSourceDistributionNotification" value="true" /> | |||||
| <option name="distributionType" value="DEFAULT_WRAPPED" /> | <option name="distributionType" value="DEFAULT_WRAPPED" /> | ||||
| <option name="externalProjectPath" value="$PROJECT_DIR$" /> | <option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||||
| <option name="gradleJvm" value="#JAVA_HOME" /> | |||||
| <option name="modules"> | <option name="modules"> | ||||
| <set> | <set> | ||||
| <option value="$PROJECT_DIR$" /> | <option value="$PROJECT_DIR$" /> | ||||
| <option value="$PROJECT_DIR$/app" /> | <option value="$PROJECT_DIR$/app" /> | ||||
| </set> | </set> | ||||
| </option> | </option> | ||||
| <option name="resolveModulePerSourceSet" value="false" /> | |||||
| </GradleProjectSettings> | </GradleProjectSettings> | ||||
| </option> | </option> | ||||
| </component> | </component> | ||||
| @@ -0,0 +1,6 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <project version="4"> | |||||
| <component name="KotlinJpsPluginSettings"> | |||||
| <option name="version" value="1.6.21" /> | |||||
| </component> | |||||
| </project> | |||||
| @@ -1,4 +1,3 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <project version="4"> | <project version="4"> | ||||
| <component name="DesignSurface"> | <component name="DesignSurface"> | ||||
| <option name="filePathToZoomLevelMap"> | <option name="filePathToZoomLevelMap"> | ||||
| @@ -49,7 +48,7 @@ | |||||
| </map> | </map> | ||||
| </option> | </option> | ||||
| </component> | </component> | ||||
| <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK"> | |||||
| <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |||||
| <output url="file://$PROJECT_DIR$/build/classes" /> | <output url="file://$PROJECT_DIR$/build/classes" /> | ||||
| </component> | </component> | ||||
| <component name="ProjectType"> | <component name="ProjectType"> | ||||
| @@ -30,9 +30,13 @@ | |||||
| android:supportsRtl="true" | android:supportsRtl="true" | ||||
| android:theme="@style/AppTheme" | android:theme="@style/AppTheme" | ||||
| android:usesCleartextTraffic="true"> | android:usesCleartextTraffic="true"> | ||||
| <activity | |||||
| android:name=".activity.LoginActivity" | |||||
| android:exported="false" /> | |||||
| <activity | <activity | ||||
| android:name=".activity.CameraActivity" | android:name=".activity.CameraActivity" | ||||
| android:exported="false" /> | android:exported="false" /> | ||||
| <!-- android:name=".MainActivity"--> | |||||
| <activity | <activity | ||||
| android:name=".MainActivity" | android:name=".MainActivity" | ||||
| android:configChanges="orientation|keyboard" | android:configChanges="orientation|keyboard" | ||||
| @@ -70,7 +74,7 @@ | |||||
| <service | <service | ||||
| android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService" | android:name="com.tencent.smtt.export.external.DexClassLoaderProviderService" | ||||
| android:label="dexopt" | android:label="dexopt" | ||||
| android:process=":dexopt"/> | |||||
| android:process=":dexopt" /> | |||||
| <receiver | <receiver | ||||
| android:name=".receiver.BootReceiver" | android:name=".receiver.BootReceiver" | ||||
| @@ -30,7 +30,7 @@ import com.lzy.okgo.OkGo | |||||
| import com.lzy.okgo.callback.StringCallback | import com.lzy.okgo.callback.StringCallback | ||||
| import com.lzy.okgo.model.Response | import com.lzy.okgo.model.Response | ||||
| import com.qmuiteam.qmui.widget.dialog.QMUIDialog | import com.qmuiteam.qmui.widget.dialog.QMUIDialog | ||||
| import com.yzx.escreen.activity.WebActivity | |||||
| 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 | ||||
| @@ -112,7 +112,8 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| override fun initView() { | override fun initView() { | ||||
| if (NetworkUtils.isConnected()) { | if (NetworkUtils.isConnected()) { | ||||
| if (!User.isLogin() && User.getUser().token.isEmpty()) { | if (!User.isLogin() && User.getUser().token.isEmpty()) { | ||||
| WebActivity.active(this, "${Config.OA_URL}/login") | |||||
| // WebActivity.active(this, "${Config.OA_URL}/login") | |||||
| LoginActivity.active(this) | |||||
| finish() | finish() | ||||
| } | } | ||||
| if (!User.isLogin()) { | if (!User.isLogin()) { | ||||
| @@ -174,12 +175,12 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| private fun checkAuto() { | private fun checkAuto() { | ||||
| isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", false) | isAutoShowLeave = SPUtils.getInstance().getBoolean("auto_show_leave", false) | ||||
| isAutoShowChange = SPUtils.getInstance().getBoolean("auto_show_change", false) | isAutoShowChange = SPUtils.getInstance().getBoolean("auto_show_change", false) | ||||
| // if (isAutoShowLeave || isAutoShowChange) { | |||||
| // mHandler.removeCallbacks(runnable) | |||||
| // mHandler.postDelayed(runnable, 2000) | |||||
| // } else { | |||||
| // mHandler.removeCallbacks(runnable) | |||||
| // } | |||||
| if (isAutoShowLeave || isAutoShowChange) { | |||||
| mHandler.removeCallbacks(runnable) | |||||
| mHandler.postDelayed(runnable, 2000) | |||||
| } else { | |||||
| mHandler.removeCallbacks(runnable) | |||||
| } | |||||
| } | } | ||||
| //接收消息 | //接收消息 | ||||
| @@ -187,10 +188,11 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| fun onMessageEvent(event: AutoSwitchChange) { | fun onMessageEvent(event: AutoSwitchChange) { | ||||
| checkAuto() | checkAuto() | ||||
| } | } | ||||
| //接收消息 | //接收消息 | ||||
| @Subscribe(threadMode = ThreadMode.MAIN) | @Subscribe(threadMode = ThreadMode.MAIN) | ||||
| fun onMessageEvent(event: UserLoginEvent) { | fun onMessageEvent(event: UserLoginEvent) { | ||||
| if (client?.isOpen == true){ | |||||
| if (client?.isOpen == true) { | |||||
| client?.close() | client?.close() | ||||
| } | } | ||||
| client = null | client = null | ||||
| @@ -326,48 +328,48 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| } | } | ||||
| private fun initWs() { | private fun initWs() { | ||||
| client = | |||||
| object : WebSocketClient(URI.create(Config.WS_URL), Draft_6455(), null, 10 * 1000) { | |||||
| override fun onOpen(handshakedata: ServerHandshake?) { | |||||
| LogUtils.d("WebSocketClient-onOpen", handshakedata) | |||||
| val user = User.getUser() | |||||
| val clientInfo = YzxClientInfo() | |||||
| clientInfo.type = 70 | |||||
| clientInfo.user_id = user.user_id.toString() | |||||
| clientInfo.unit_id = user.school_id.toString() | |||||
| clientInfo.token = user.token | |||||
| client?.send(Gson().toJson(clientInfo)) | |||||
| Thread { | |||||
| client = | |||||
| object : WebSocketClient(URI.create(Config.WS_URL), Draft_6455(), null, 10 * 1000) { | |||||
| override fun onOpen(handshakedata: ServerHandshake?) { | |||||
| LogUtils.d("WebSocketClient-onOpen", handshakedata) | |||||
| val user = User.getUser() | |||||
| val clientInfo = YzxClientInfo() | |||||
| clientInfo.type = 70 | |||||
| clientInfo.user_id = user.user_id.toString() | |||||
| clientInfo.unit_id = user.school_id.toString() | |||||
| clientInfo.token = user.token | |||||
| client?.send(Gson().toJson(clientInfo)) | |||||
| } | |||||
| } | |||||
| override fun onClose(code: Int, reason: String?, remote: Boolean) { | |||||
| LogUtils.d("WebSocketClient-onClose", code, reason, remote) | |||||
| override fun onClose(code: Int, reason: String?, remote: Boolean) { | |||||
| LogUtils.d("WebSocketClient-onClose", code, reason, remote) | |||||
| } | |||||
| } | |||||
| override fun onMessage(message: String?) { | |||||
| LogUtils.d("WebSocketClient-onMessage", message) | |||||
| if (message?.startsWith("ECHO:", true) == false) { | |||||
| viewPager2.post { | |||||
| wsMessage(message) | |||||
| override fun onMessage(message: String?) { | |||||
| LogUtils.d("WebSocketClient-onMessage", message) | |||||
| if (message?.startsWith("ECHO:", true) == false) { | |||||
| wsMessage(message) | |||||
| } | } | ||||
| } | } | ||||
| } | |||||
| override fun onError(ex: Exception?) { | |||||
| LogUtils.d("WebSocketClient-onError", ex) | |||||
| override fun onError(ex: Exception?) { | |||||
| LogUtils.d("WebSocketClient-onError", ex) | |||||
| } | |||||
| } | |||||
| } | |||||
| try { | |||||
| client?.connectBlocking() | |||||
| wsHeart() | |||||
| } catch (e: InterruptedException) { | |||||
| e.printStackTrace() | |||||
| LogUtils.d("WebSocketClient-catch", e) | |||||
| } | } | ||||
| try { | |||||
| client?.connectBlocking() | |||||
| wsHeart() | |||||
| } catch (e: InterruptedException) { | |||||
| e.printStackTrace() | |||||
| LogUtils.d("WebSocketClient-catch", e) | |||||
| } | |||||
| }.start() | |||||
| } | } | ||||
| private fun wsMessage(msg: String) { | private fun wsMessage(msg: String) { | ||||
| @@ -376,13 +378,23 @@ 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) { | ||||
| mPresenter?.getLeaveShowIds("${res.data.student_id}") | |||||
| EventBus.getDefault().post(EventLeaveIds("${res.data.student_id}")) | |||||
| // mPresenter?.getLeaveShowIds("${res.data.student_id}") | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //请假消息 | |||||
| @Subscribe(threadMode = ThreadMode.MAIN) | |||||
| fun onMessageEvent(detail: EventLeaveIds) { | |||||
| mPresenter?.getLeaveShowIds("${detail.ids}") | |||||
| } | |||||
| private fun wsHeart() { | private fun wsHeart() { | ||||
| viewPager2.postDelayed({ | |||||
| Thread{ | |||||
| Thread.sleep(10 * 1000) | |||||
| if (client?.isOpen == true) { | if (client?.isOpen == true) { | ||||
| client?.apply { | client?.apply { | ||||
| send(Gson().toJson(YzxHeart().getYzxHeader())) | send(Gson().toJson(YzxHeart().getYzxHeader())) | ||||
| @@ -395,7 +407,7 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| } | } | ||||
| } | } | ||||
| wsHeart() | wsHeart() | ||||
| }, 10 * 1000) | |||||
| }.start() | |||||
| } | } | ||||
| private fun showNetworkError() { | private fun showNetworkError() { | ||||
| @@ -464,7 +476,8 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| } | } | ||||
| viewPager2.removeCallbacks(netLoadingRun) | viewPager2.removeCallbacks(netLoadingRun) | ||||
| if (!User.isLogin()) { | if (!User.isLogin()) { | ||||
| WebActivity.active(this, "${Config.OA_URL}/login?logout=1") | |||||
| // WebActivity.active(this, "${Config.OA_URL}/login?logout=1") | |||||
| LoginActivity.active(this) | |||||
| finish() | finish() | ||||
| } | } | ||||
| checkVersion() | checkVersion() | ||||
| @@ -497,9 +510,11 @@ class MainActivity : BaseActivity<MainPresenter>(), NetworkUtils.OnNetworkStatus | |||||
| res.data.type == 1 -> { //强制升级 | res.data.type == 1 -> { //强制升级 | ||||
| updateApp(res.data) | updateApp(res.data) | ||||
| } | } | ||||
| curr - lastTipTime > 24 * 60 * 60 * 1000 -> { //非强制一天以内提示一次 | curr - lastTipTime > 24 * 60 * 60 * 1000 -> { //非强制一天以内提示一次 | ||||
| updateApp(res.data) | updateApp(res.data) | ||||
| } | } | ||||
| userCheck -> { // | userCheck -> { // | ||||
| updateApp(res.data) | updateApp(res.data) | ||||
| } | } | ||||
| @@ -618,17 +633,20 @@ class HomePagerAdapter(act: AppCompatActivity) : FragmentStateAdapter(act) { | |||||
| 0 -> { | 0 -> { | ||||
| return HomeFragment.getNewInstance() | return HomeFragment.getNewInstance() | ||||
| } | } | ||||
| 1 -> { | 1 -> { | ||||
| return ChangeFragment.getNewInstance() | return ChangeFragment.getNewInstance() | ||||
| } | } | ||||
| 2 -> { | 2 -> { | ||||
| return VisitorFragment.getNewInstance() | return VisitorFragment.getNewInstance() | ||||
| } | } | ||||
| 3 -> { | 3 -> { | ||||
| return MyFragment.getNewInstance() | return MyFragment.getNewInstance() | ||||
| } | } | ||||
| } | } | ||||
| return HomeFragment.getNewInstance() | |||||
| return HomeFragment() | |||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,247 @@ | |||||
| package com.yzx.escreen.activity | |||||
| import android.app.Activity | |||||
| import android.view.View | |||||
| import com.blankj.utilcode.util.KeyboardUtils | |||||
| import com.blankj.utilcode.util.LogUtils | |||||
| import com.blankj.utilcode.util.SPUtils | |||||
| import com.flyco.tablayout.listener.CustomTabEntity | |||||
| import com.flyco.tablayout.listener.OnTabSelectListener | |||||
| import com.qmuiteam.qmui.widget.dialog.QMUIDialog | |||||
| import com.qmuiteam.qmui.widget.dialog.QMUITipDialog | |||||
| import com.qmuiteam.qmui.widget.dialog.QMUITipDialog.Builder.ICON_TYPE_FAIL | |||||
| import com.yzx.escreen.MainActivity | |||||
| import com.yzx.escreen.R | |||||
| import com.yzx.escreen.activity.base.BaseActivity | |||||
| import com.yzx.escreen.model.BaseUser | |||||
| import com.yzx.escreen.model.TabEntity | |||||
| import com.yzx.escreen.model.User | |||||
| import com.yzx.escreen.presenter.LoginPresenter | |||||
| import com.yzx.escreen.presenter.LoginView | |||||
| import com.yzx.escreen.utils.hideNavigationBar | |||||
| import com.yzx.escreen.utils.setSrc | |||||
| import kotlinx.android.synthetic.main.activity_login.accountEdit | |||||
| import kotlinx.android.synthetic.main.activity_login.accountLayout | |||||
| import kotlinx.android.synthetic.main.activity_login.loginBtn | |||||
| import kotlinx.android.synthetic.main.activity_login.pswCheckbox | |||||
| import kotlinx.android.synthetic.main.activity_login.pswEdit | |||||
| import kotlinx.android.synthetic.main.activity_login.qrCodeImg | |||||
| import kotlinx.android.synthetic.main.activity_login.qrLayout | |||||
| import kotlinx.android.synthetic.main.activity_login.tabLayout | |||||
| import org.jetbrains.anko.startActivity | |||||
| class LoginActivity : BaseActivity<LoginPresenter>(), LoginView { | |||||
| companion object { | |||||
| fun active(act: Activity) { | |||||
| act.startActivity<LoginActivity>() | |||||
| } | |||||
| } | |||||
| private var mTicket = "" | |||||
| override val inflateId: Int | |||||
| get() = R.layout.activity_login | |||||
| override fun initView() { | |||||
| val tabData = arrayListOf<CustomTabEntity>() | |||||
| tabData.add(TabEntity("账号密码登录", 0, 0)) | |||||
| tabData.add(TabEntity("微信扫码登录", 0, 0)) | |||||
| tabLayout.setTabData(tabData) | |||||
| tabLayout.setOnTabSelectListener(object : OnTabSelectListener { | |||||
| override fun onTabSelect(position: Int) { | |||||
| if (position == 0) { | |||||
| qrLayout.visibility = View.GONE | |||||
| accountLayout.visibility = View.VISIBLE | |||||
| SPUtils.getInstance().put("last_login_tab_index",0) | |||||
| } else { | |||||
| qrLayout.visibility = View.VISIBLE | |||||
| accountLayout.visibility = View.GONE | |||||
| SPUtils.getInstance().put("last_login_tab_index",1) | |||||
| KeyboardUtils.hideSoftInput(this@LoginActivity) | |||||
| } | |||||
| } | |||||
| override fun onTabReselect(position: Int) { | |||||
| } | |||||
| }) | |||||
| val lastLoginTabIndex = SPUtils.getInstance().getInt("last_login_tab_index",0) | |||||
| if(lastLoginTabIndex == 1){ | |||||
| qrLayout.visibility = View.VISIBLE | |||||
| accountLayout.visibility = View.GONE | |||||
| tabLayout.currentTab = 1 | |||||
| } | |||||
| loginBtn.setOnClickListener { | |||||
| this.doLogin() | |||||
| } | |||||
| val isSavePsw = SPUtils.getInstance().getBoolean("is_save_psw", false) | |||||
| if (isSavePsw) { | |||||
| pswCheckbox.isChecked = true | |||||
| val phone = SPUtils.getInstance().getString("login_save_phone", "") | |||||
| val psw = SPUtils.getInstance().getString("login_save_psw", "") | |||||
| accountEdit.setText(phone) | |||||
| pswEdit.setText(psw) | |||||
| } else { | |||||
| pswCheckbox.isChecked = false | |||||
| } | |||||
| } | |||||
| private fun doLogin() { | |||||
| val phone = accountEdit.text.toString() | |||||
| val psw = pswEdit.text.toString() | |||||
| if (phone.isBlank()) { | |||||
| showDialogToast("请输入账号", icon = QMUITipDialog.Builder.ICON_TYPE_FAIL) | |||||
| return | |||||
| } | |||||
| if (psw.isBlank()) { | |||||
| showDialogToast("请输入密码", icon = QMUITipDialog.Builder.ICON_TYPE_FAIL) | |||||
| return | |||||
| } | |||||
| showLoading("登录中...") | |||||
| if(pswCheckbox.isChecked){ | |||||
| SPUtils.getInstance().put("is_save_psw",true) | |||||
| SPUtils.getInstance().put("login_save_phone",phone) | |||||
| SPUtils.getInstance().put("login_save_psw",psw) | |||||
| }else{ | |||||
| SPUtils.getInstance().put("is_save_psw",false) | |||||
| SPUtils.getInstance().remove("login_save_phone") | |||||
| SPUtils.getInstance().remove("login_save_psw") | |||||
| } | |||||
| mPresenter?.login(phone, psw) | |||||
| } | |||||
| override fun initData() { | |||||
| mPresenter?.getWXQrCode() | |||||
| } | |||||
| override fun initPresenter(): LoginPresenter = LoginPresenter(this) | |||||
| override fun onLoginSuccess(user: BaseUser, list: MutableList<BaseUser>) { | |||||
| val teaList = list.filter { | |||||
| return@filter it.type == 0 | |||||
| } | |||||
| when { | |||||
| teaList.isEmpty() -> { | |||||
| if(user.type == 0){ | |||||
| mPresenter?.switchUser(user.token, user.user_id, user.school_id) | |||||
| }else{ | |||||
| hideLoading() | |||||
| this.showDialogToast("无登录权限", icon = ICON_TYPE_FAIL) | |||||
| } | |||||
| } | |||||
| teaList.size == 1 -> { //多个角色 | |||||
| val item = teaList[0] | |||||
| mPresenter?.switchUser(user.token, item.user_id, item.unit_id) | |||||
| } | |||||
| else -> { | |||||
| mPresenter?.getUserRoleList(user.token) | |||||
| } | |||||
| } | |||||
| } | |||||
| override fun onLoginError(msg: String) { | |||||
| hideLoading() | |||||
| showDialogToast(msg, icon = ICON_TYPE_FAIL) | |||||
| } | |||||
| override fun onUserInfoSuccess(user: User) { | |||||
| hideLoading() | |||||
| startActivity<MainActivity>() | |||||
| finish() | |||||
| } | |||||
| override fun onWxQrCodeSuccess(imgUrl: String, ticket: String) { | |||||
| qrCodeImg.setSrc(imgUrl) | |||||
| mTicket = ticket | |||||
| mPresenter?.loginQuery(ticket) | |||||
| } | |||||
| override fun onDestroy() { | |||||
| qrCodeImg?.apply { | |||||
| removeCallbacks(null) | |||||
| } | |||||
| super.onDestroy() | |||||
| } | |||||
| private var mBindDialog: QMUIDialog? = null | |||||
| private var mOverTimeDialog: QMUIDialog? = null | |||||
| override fun onLoginQuerySuccess(user: BaseUser, code: Int) { | |||||
| when (code) { | |||||
| 0 -> { | |||||
| if (user.direct_login == 1) { | |||||
| mPresenter?.getUserLoginInfo(user.token) | |||||
| } else { | |||||
| mPresenter?.getUserRoleInfoByPhone(user.phone, user.tmp_token) | |||||
| } | |||||
| } | |||||
| 451 -> { | |||||
| if (mBindDialog == null) { | |||||
| mBindDialog = QMUIDialog.MessageDialogBuilder(this) | |||||
| .setTitle("温馨提示") | |||||
| .setMessage("您还未绑定微信公众,请绑定后再试!") | |||||
| .addAction("知道了") { dialog, index -> | |||||
| dialog.dismiss() | |||||
| } | |||||
| .create() | |||||
| mBindDialog?.show() | |||||
| mBindDialog?.hideNavigationBar() | |||||
| } else if (!mBindDialog!!.isShowing) { | |||||
| mBindDialog?.show() | |||||
| } | |||||
| qrCodeImg.postDelayed({ | |||||
| mPresenter?.loginQuery(mTicket) | |||||
| }, 1000) | |||||
| } | |||||
| 452 -> { | |||||
| qrCodeImg.postDelayed({ | |||||
| mPresenter?.loginQuery(mTicket) | |||||
| }, 1000) | |||||
| } | |||||
| else -> { | |||||
| if (mOverTimeDialog == null) { | |||||
| mOverTimeDialog = QMUIDialog.MessageDialogBuilder(this) | |||||
| .setTitle("温馨提示") | |||||
| .setMessage("二维码已使用,请重新扫码!") | |||||
| .addAction("知道了") { dialog, index -> | |||||
| dialog.dismiss() | |||||
| } | |||||
| .create() | |||||
| mOverTimeDialog!!.show() | |||||
| mOverTimeDialog!!.hideNavigationBar() | |||||
| } else if (!mOverTimeDialog!!.isShowing) { | |||||
| mOverTimeDialog?.show() | |||||
| } | |||||
| mPresenter?.getWXQrCode() | |||||
| } | |||||
| } | |||||
| } | |||||
| override fun onUserListSuccess(list: MutableList<BaseUser>, token: String) { | |||||
| LogUtils.d("onUserListSuccess", list) | |||||
| hideLoading() | |||||
| val builder = QMUIDialog.MenuDialogBuilder(this) | |||||
| list.forEach { | |||||
| builder.addItem( | |||||
| it.unit_name | |||||
| ) { dialog, which -> | |||||
| LogUtils.d("itemClick", which) | |||||
| val item = list[which] | |||||
| showLoading("登录中...") | |||||
| if(item.school_id>0){ | |||||
| mPresenter?.switchUnit(item.user_id, item.unit_id,token) | |||||
| }else{ | |||||
| mPresenter?.switchUser(token, item.user_id, item.unit_id) | |||||
| } | |||||
| } | |||||
| } | |||||
| builder.show() | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,65 @@ | |||||
| package com.yzx.escreen.activity | |||||
| import androidx.viewpager2.widget.ViewPager2 | |||||
| import com.blankj.utilcode.util.KeyboardUtils | |||||
| import com.flyco.tablayout.listener.CustomTabEntity | |||||
| import com.flyco.tablayout.listener.OnTabSelectListener | |||||
| import com.yzx.escreen.HomePagerAdapter | |||||
| import com.yzx.escreen.R | |||||
| import com.yzx.escreen.activity.base.BaseActivity | |||||
| import com.yzx.escreen.model.LeaveID | |||||
| import com.yzx.escreen.model.TabEntity | |||||
| import com.yzx.escreen.presenter.MainPresenter | |||||
| import com.yzx.escreen.presenter.MainView | |||||
| import kotlinx.android.synthetic.main.activity_test.tabLayout | |||||
| import kotlinx.android.synthetic.main.activity_test.viewPager2 | |||||
| class TestActivity : BaseActivity<MainPresenter>(), MainView { | |||||
| override val inflateId: Int | |||||
| get() = R.layout.activity_test | |||||
| override fun initView() { | |||||
| val tabData = arrayListOf<CustomTabEntity>() | |||||
| 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.visitor_select, R.mipmap.visitor_unselect)) | |||||
| tabData.add(TabEntity("我的", R.mipmap.my_select, R.mipmap.my_unselect)) | |||||
| tabLayout.setTabData(tabData) | |||||
| viewPager2.adapter = HomePagerAdapter(this) | |||||
| viewPager2.offscreenPageLimit = 3 | |||||
| viewPager2.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { | |||||
| override fun onPageSelected(position: Int) { | |||||
| super.onPageSelected(position) | |||||
| tabLayout.currentTab = position | |||||
| } | |||||
| }) | |||||
| tabLayout.setOnTabSelectListener(object : OnTabSelectListener { | |||||
| override fun onTabSelect(position: Int) { | |||||
| // viewPager2.currentItem = position | |||||
| viewPager2.setCurrentItem(position, false) | |||||
| KeyboardUtils.hideSoftInput(viewPager2) | |||||
| } | |||||
| override fun onTabReselect(position: Int) { | |||||
| } | |||||
| }) | |||||
| } | |||||
| override fun initData() { | |||||
| } | |||||
| override fun initPresenter(): MainPresenter=MainPresenter(this) | |||||
| override fun onLeaveIDsSuccess(list: MutableList<LeaveID>) { | |||||
| } | |||||
| override fun onLeaveIDsError() { | |||||
| } | |||||
| } | |||||
| @@ -4,10 +4,9 @@ import android.os.Bundle | |||||
| import android.view.View | import android.view.View | ||||
| import android.view.WindowManager | import android.view.WindowManager | ||||
| import androidx.appcompat.app.AppCompatActivity | import androidx.appcompat.app.AppCompatActivity | ||||
| import com.blankj.utilcode.util.BarUtils | |||||
| import com.gyf.immersionbar.ktx.immersionBar | |||||
| import com.yzx.escreen.R | |||||
| import com.qmuiteam.qmui.widget.dialog.QMUITipDialog | |||||
| import com.yzx.escreen.presenter.base.BasePresenter | import com.yzx.escreen.presenter.base.BasePresenter | ||||
| import com.yzx.escreen.utils.hideNavigationBar | |||||
| /** | /** | ||||
| * 类名:BaseActivity | * 类名:BaseActivity | ||||
| @@ -25,6 +24,8 @@ abstract class BaseActivity<out P : BasePresenter<*>> : AppCompatActivity() { | |||||
| */ | */ | ||||
| abstract val inflateId: Int | abstract val inflateId: Int | ||||
| private var mLoadingDialog: QMUITipDialog? = null | |||||
| /** | /** | ||||
| * 初始化视图操作在这里执行,执行时机为onCreate之后 | * 初始化视图操作在这里执行,执行时机为onCreate之后 | ||||
| */ | */ | ||||
| @@ -82,4 +83,39 @@ abstract class BaseActivity<out P : BasePresenter<*>> : AppCompatActivity() { | |||||
| } | } | ||||
| fun showDialogToast( | |||||
| msg: String, | |||||
| duration: Long = 1500, | |||||
| @QMUITipDialog.Builder.IconType icon: Int = QMUITipDialog.Builder.ICON_TYPE_SUCCESS | |||||
| ) { | |||||
| val tipDialog = QMUITipDialog.Builder(this) | |||||
| .setIconType(icon) | |||||
| .setTipWord(msg) | |||||
| .create() | |||||
| tipDialog.show() | |||||
| tipDialog.hideNavigationBar() | |||||
| window.decorView.postDelayed({ | |||||
| tipDialog.dismiss() | |||||
| }, duration) | |||||
| } | |||||
| fun showLoading(msg: String = "加载中...") { | |||||
| mLoadingDialog = QMUITipDialog.Builder(this) | |||||
| .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) | |||||
| .setTipWord(msg) | |||||
| .create() | |||||
| mLoadingDialog?.apply { | |||||
| show() | |||||
| } | |||||
| } | |||||
| fun hideLoading() { | |||||
| mLoadingDialog?.apply { | |||||
| if (isShowing) { | |||||
| dismiss() | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -7,90 +7,35 @@ import com.chad.library.adapter.base.BaseQuickAdapter | |||||
| import com.chad.library.adapter.base.viewholder.BaseViewHolder | import com.chad.library.adapter.base.viewholder.BaseViewHolder | ||||
| import com.yzx.escreen.R | import com.yzx.escreen.R | ||||
| import com.yzx.escreen.model.Visitor | import com.yzx.escreen.model.Visitor | ||||
| import com.yzx.escreen.utils.setSrc | |||||
| import com.yzx.escreen.utils.toTime | import com.yzx.escreen.utils.toTime | ||||
| import kotlinx.android.synthetic.main.layout_visitor_table.view.* | |||||
| import kotlinx.android.synthetic.main.layout_visitor_table.view.applyTime | |||||
| import kotlinx.android.synthetic.main.layout_visitor_table.view.bottomLine | |||||
| import kotlinx.android.synthetic.main.layout_visitor_table.view.inOutTime | |||||
| import kotlinx.android.synthetic.main.layout_visitor_table.view.isDrive | |||||
| import kotlinx.android.synthetic.main.layout_visitor_table.view.receptionUser | |||||
| import kotlinx.android.synthetic.main.layout_visitor_table.view.statusName | |||||
| import kotlinx.android.synthetic.main.layout_visitor_table.view.userName | |||||
| import org.jetbrains.anko.textColor | import org.jetbrains.anko.textColor | ||||
| class VisitorListAdapter(list: MutableList<Visitor>) : | class VisitorListAdapter(list: MutableList<Visitor>) : | ||||
| BaseQuickAdapter<Visitor, BaseViewHolder>(R.layout.layout_visitor_table, list) { | BaseQuickAdapter<Visitor, BaseViewHolder>(R.layout.layout_visitor_table, list) { | ||||
| init { | init { | ||||
| addChildClickViewIds(R.id.faceEmpty,R.id.nucleinEmpty,R.id.tripCodeEmpty,R.id.healthCodeEmpty) | |||||
| // addChildClickViewIds(R.id.faceEmpty) | |||||
| } | } | ||||
| @SuppressLint("SetTextI18n", "Range") | @SuppressLint("SetTextI18n", "Range") | ||||
| override fun convert(holder: BaseViewHolder, item: Visitor) { | override fun convert(holder: BaseViewHolder, item: Visitor) { | ||||
| holder.itemView.userName.text = item.user_name | holder.itemView.userName.text = item.user_name | ||||
| if (item.face_key.isNotEmpty()) { | |||||
| holder.itemView.faceImg.visibility = View.VISIBLE | |||||
| holder.itemView.faceEmpty.visibility = View.GONE | |||||
| holder.itemView.faceImg.setSrc(item.face_identity, item.face_key) | |||||
| } else { | |||||
| holder.itemView.faceEmpty.visibility = View.VISIBLE | |||||
| holder.itemView.faceImg.visibility = View.GONE | |||||
| } | |||||
| when { | |||||
| item.health_code_status >= 0 -> { | |||||
| holder.itemView.healthCodeStatusLayout.visibility = View.VISIBLE | |||||
| holder.itemView.healthCodeImg.visibility = View.GONE | |||||
| holder.itemView.healthCodeEmpty.visibility = View.GONE | |||||
| when (item.health_code_status) { | |||||
| 0 -> { | |||||
| holder.itemView.healthCodeStatus.text = "状态:绿码" | |||||
| holder.itemView.healthCodeStatus.textColor = Color.parseColor("#5DAD64") | |||||
| } | |||||
| 1 -> { | |||||
| holder.itemView.healthCodeStatus.text = "状态:黄码" | |||||
| holder.itemView.healthCodeStatus.textColor = Color.parseColor("#FCCF13") | |||||
| } | |||||
| 10 -> { | |||||
| holder.itemView.healthCodeStatus.text = "状态:红码" | |||||
| holder.itemView.healthCodeStatus.textColor = Color.parseColor("#FC0416") | |||||
| } | |||||
| } | |||||
| } | |||||
| item.health_code_key.isNotEmpty() -> { | |||||
| holder.itemView.healthCodeStatusLayout.visibility = View.GONE | |||||
| holder.itemView.healthCodeImg.visibility = View.VISIBLE | |||||
| holder.itemView.healthCodeEmpty.visibility = View.GONE | |||||
| holder.itemView.healthCodeImg.setSrc( | |||||
| item.health_code_identity, | |||||
| item.health_code_key | |||||
| ) | |||||
| } | |||||
| else -> { | |||||
| holder.itemView.healthCodeStatusLayout.visibility = View.GONE | |||||
| holder.itemView.healthCodeEmpty.visibility = View.VISIBLE | |||||
| holder.itemView.healthCodeImg.visibility = View.GONE | |||||
| } | |||||
| } | |||||
| if(item.nuclein_file_key.isNullOrBlank()){ | |||||
| holder.itemView.nucleinEmpty.visibility = View.VISIBLE | |||||
| holder.itemView.nucleinImg.visibility = View.GONE | |||||
| }else{ | |||||
| holder.itemView.nucleinImg.visibility = View.VISIBLE | |||||
| holder.itemView.nucleinEmpty.visibility = View.GONE | |||||
| holder.itemView.nucleinImg.setSrc(item.nuclein_file_identity, item.nuclein_file_key) | |||||
| } | |||||
| if(item.nuclein_time>0){ | |||||
| holder.itemView.nucleinStatusLayout.visibility = View.VISIBLE | |||||
| holder.itemView.nucleinStatus.text = item.getNucleinStatusObj().nuclein_name | |||||
| holder.itemView.nucleinStatus.setTextColor(Color.parseColor(item.getNucleinStatusObj().nuclein_color)) | |||||
| }else{ | |||||
| holder.itemView.nucleinStatusLayout.visibility = View.GONE | |||||
| } | |||||
| if (item.trip_code_key.isNullOrBlank()) { | |||||
| holder.itemView.tripCodeEmpty.visibility = View.VISIBLE | |||||
| holder.itemView.tripCodeImg.visibility = View.GONE | |||||
| } else { | |||||
| holder.itemView.tripCodeImg.visibility = View.VISIBLE | |||||
| holder.itemView.tripCodeEmpty.visibility = View.GONE | |||||
| holder.itemView.tripCodeImg.setSrc(item.trip_code_identity, item.trip_code_key) | |||||
| } | |||||
| // holder.itemView.userTypeName.text = when (item.user_type) { | |||||
| // 0 -> "" | |||||
| // 1 -> "老师" | |||||
| // 2 -> "学生" | |||||
| // 3 -> "访客" | |||||
| // else -> "--" | |||||
| // } | |||||
| holder.itemView.isDrive.text = if (item.is_drive == 1) { | holder.itemView.isDrive.text = if (item.is_drive == 1) { | ||||
| "是" | |||||
| "是(${item.license_plate})" | |||||
| } else { | } else { | ||||
| "否" | "否" | ||||
| } | } | ||||
| @@ -111,6 +56,7 @@ class VisitorListAdapter(list: MutableList<Visitor>) : | |||||
| } | } | ||||
| holder.itemView.applyTime.text = item.add_time.toTime() | holder.itemView.applyTime.text = item.add_time.toTime() | ||||
| holder.itemView.inOutTime.text = "${item.start_time.toTime()} - ${item.end_time.toTime()}" | |||||
| holder.itemView.bottomLine.visibility = if (holder.adapterPosition == data.size - 1) { | holder.itemView.bottomLine.visibility = if (holder.adapterPosition == data.size - 1) { | ||||
| View.GONE | View.GONE | ||||
| @@ -7,7 +7,7 @@ import com.lzy.okgo.OkGo | |||||
| import com.lzy.okgo.model.Response | import com.lzy.okgo.model.Response | ||||
| import com.yzx.escreen.App.Companion.getContext | import com.yzx.escreen.App.Companion.getContext | ||||
| import com.yzx.escreen.MainActivity | import com.yzx.escreen.MainActivity | ||||
| import com.yzx.escreen.activity.WebActivity | |||||
| import com.yzx.escreen.activity.LoginActivity | |||||
| import com.yzx.escreen.config.Config.OA_URL | import com.yzx.escreen.config.Config.OA_URL | ||||
| import com.yzx.escreen.model.ReToken | import com.yzx.escreen.model.ReToken | ||||
| import com.yzx.escreen.model.RefreshTokenEvent | import com.yzx.escreen.model.RefreshTokenEvent | ||||
| @@ -15,7 +15,7 @@ import com.yzx.escreen.model.User | |||||
| import com.yzx.escreen.presenter.base.JsonCallBack | import com.yzx.escreen.presenter.base.JsonCallBack | ||||
| import com.yzx.escreen.presenter.base.YzxResponse | import com.yzx.escreen.presenter.base.YzxResponse | ||||
| import org.greenrobot.eventbus.EventBus | import org.greenrobot.eventbus.EventBus | ||||
| import java.util.* | |||||
| import java.util.Date | |||||
| object RefreshToken { | object RefreshToken { | ||||
| fun refresh(callBack:RefreshCallback) { | fun refresh(callBack:RefreshCallback) { | ||||
| @@ -47,7 +47,8 @@ object RefreshToken { | |||||
| super.onError(response) | super.onError(response) | ||||
| LogUtils.d(response) | LogUtils.d(response) | ||||
| User.clearUserInfo() | User.clearUserInfo() | ||||
| val intent = Intent(getContext(), WebActivity::class.java) | |||||
| // val intent = Intent(getContext(), WebActivity::class.java) | |||||
| val intent = Intent(getContext(), LoginActivity::class.java) | |||||
| intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK | intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK | ||||
| intent.putExtra("link", OA_URL + "/login?logout=1") | intent.putExtra("link", OA_URL + "/login?logout=1") | ||||
| ActivityUtils.startActivity(intent) | ActivityUtils.startActivity(intent) | ||||
| @@ -57,7 +58,8 @@ object RefreshToken { | |||||
| }) | }) | ||||
| }else{ | }else{ | ||||
| User.clearUserInfo() | User.clearUserInfo() | ||||
| val intent = Intent(getContext(), WebActivity::class.java) | |||||
| // val intent = Intent(getContext(), WebActivity::class.java) | |||||
| val intent = Intent(getContext(), LoginActivity::class.java) | |||||
| intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK | intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK | ||||
| intent.putExtra("link", OA_URL + "/login?logout=1") | intent.putExtra("link", OA_URL + "/login?logout=1") | ||||
| ActivityUtils.startActivity(intent) | ActivityUtils.startActivity(intent) | ||||
| @@ -67,7 +69,8 @@ object RefreshToken { | |||||
| }else{ | }else{ | ||||
| if (currTime - lastLoginTime > 365L * 24 * 60 * 60 * 1000){ | if (currTime - lastLoginTime > 365L * 24 * 60 * 60 * 1000){ | ||||
| User.clearUserInfo() | User.clearUserInfo() | ||||
| val intent = Intent(getContext(), WebActivity::class.java) | |||||
| // val intent = Intent(getContext(), WebActivity::class.java) | |||||
| val intent = Intent(getContext(), LoginActivity::class.java) | |||||
| intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK | intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK | ||||
| intent.putExtra("link", OA_URL + "/login?logout=1") | intent.putExtra("link", OA_URL + "/login?logout=1") | ||||
| ActivityUtils.startActivity(intent) | ActivityUtils.startActivity(intent) | ||||
| @@ -4,10 +4,21 @@ object YzxInterface { | |||||
| const val FILE_UPLOAD_URL = "https://fileupload.oa.qbjjyyun.net/edufile/fileUpload" | const val FILE_UPLOAD_URL = "https://fileupload.oa.qbjjyyun.net/edufile/fileUpload" | ||||
| const val INTERFACE_LOGIN_ALL= "/login/user2/doLoginAll" //老师学生统一登录 | |||||
| const val INTERFACE_USER_ROLE_LIST= "/login/user2/getUserLoginRoleList" //多角色获取角色列表 | |||||
| const val INTERFACE_USER_ROLE_LIST_BY_PHONE= "/edu/weixin/getRolesByPhone" //多角色获取角色列表 | |||||
| const val INTERFACE_USER_SWITCH= "/login/user2/switchLoginRole" //切换角色 | |||||
| const val INTERFACE_USER_SWITCH_UNIT= "/edu/weixin/switchUnit" //切换角色 | |||||
| const val INTERFACE_COMMON_LOGIN_BY_TOKEN= "/login/user2/getUserLoginInfo" // 通过token登陆 | |||||
| const val INTERFACE_GET_COMMON_YUN_AVATAR= "/edu/activeApi/getYkjHeadPortrait" //根据登录人获取云空间头像 | |||||
| const val INTERFACE_REFRESH_TOKEN = "/login/user2/refreshToken"// 刷新token | const val INTERFACE_REFRESH_TOKEN = "/login/user2/refreshToken"// 刷新token | ||||
| const val INTERFACE_GET_ACCESS_TOKEN= "/rights/weixin/getAccessTokenByAppId" // 通过app_id获取access_token | const val INTERFACE_GET_ACCESS_TOKEN= "/rights/weixin/getAccessTokenByAppId" // 通过app_id获取access_token | ||||
| const val INTERFACE_GET_MINI_CODE= "/parent/mini/getMiniCode" // 获取小程序二维码 | const val INTERFACE_GET_MINI_CODE= "/parent/mini/getMiniCode" // 获取小程序二维码 | ||||
| const val INTERFACE_GENERATE_WX_QR_TICKET= "/login/wechat/generateQrTicket" // 获取微信带参数二维码的ticket | |||||
| const val INTERFACE_WX_DO_LOGIN_QUERY= "/edu/user/common/doLoginQuery" // 微信登录的轮询 | |||||
| /** | /** | ||||
| * 学生请假 | * 学生请假 | ||||
| */ | */ | ||||
| @@ -0,0 +1,60 @@ | |||||
| package com.yzx.escreen.fragment | |||||
| import android.os.Bundle | |||||
| import androidx.fragment.app.Fragment | |||||
| import android.view.LayoutInflater | |||||
| import android.view.View | |||||
| import android.view.ViewGroup | |||||
| import com.yzx.escreen.R | |||||
| // TODO: Rename parameter arguments, choose names that match | |||||
| // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER | |||||
| private const val ARG_PARAM1 = "param1" | |||||
| private const val ARG_PARAM2 = "param2" | |||||
| /** | |||||
| * A simple [Fragment] subclass. | |||||
| * Use the [BlankFragment.newInstance] factory method to | |||||
| * create an instance of this fragment. | |||||
| */ | |||||
| class BlankFragment : Fragment() { | |||||
| // TODO: Rename and change types of parameters | |||||
| private var param1: String? = null | |||||
| private var param2: String? = null | |||||
| override fun onCreate(savedInstanceState: Bundle?) { | |||||
| super.onCreate(savedInstanceState) | |||||
| arguments?.let { | |||||
| param1 = it.getString(ARG_PARAM1) | |||||
| param2 = it.getString(ARG_PARAM2) | |||||
| } | |||||
| } | |||||
| override fun onCreateView( | |||||
| inflater: LayoutInflater, container: ViewGroup?, | |||||
| savedInstanceState: Bundle? | |||||
| ): View? { | |||||
| // Inflate the layout for this fragment | |||||
| return inflater.inflate(R.layout.fragment_blank, container, false) | |||||
| } | |||||
| companion object { | |||||
| /** | |||||
| * Use this factory method to create a new instance of | |||||
| * this fragment using the provided parameters. | |||||
| * | |||||
| * @param param1 Parameter 1. | |||||
| * @param param2 Parameter 2. | |||||
| * @return A new instance of fragment BlankFragment. | |||||
| */ | |||||
| // TODO: Rename and change types and number of parameters | |||||
| @JvmStatic | |||||
| fun newInstance(param1: String, param2: String) = | |||||
| BlankFragment().apply { | |||||
| arguments = Bundle().apply { | |||||
| putString(ARG_PARAM1, param1) | |||||
| putString(ARG_PARAM2, param2) | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -7,8 +7,7 @@ import com.blankj.utilcode.util.ScreenUtils | |||||
| import com.qmuiteam.qmui.widget.dialog.QMUIDialog | import com.qmuiteam.qmui.widget.dialog.QMUIDialog | ||||
| import com.qmuiteam.qmui.widget.dialog.QMUITipDialog | import com.qmuiteam.qmui.widget.dialog.QMUITipDialog | ||||
| import com.yzx.escreen.R | import com.yzx.escreen.R | ||||
| import com.yzx.escreen.activity.WebActivity | |||||
| import com.yzx.escreen.config.Config | |||||
| import com.yzx.escreen.activity.LoginActivity | |||||
| import com.yzx.escreen.fragment.base.BaseFragment | import com.yzx.escreen.fragment.base.BaseFragment | ||||
| import com.yzx.escreen.model.TeacherInfo | import com.yzx.escreen.model.TeacherInfo | ||||
| import com.yzx.escreen.model.TimeShow | import com.yzx.escreen.model.TimeShow | ||||
| @@ -16,7 +15,19 @@ import com.yzx.escreen.model.User | |||||
| import com.yzx.escreen.presenter.MyPresenter | import com.yzx.escreen.presenter.MyPresenter | ||||
| import com.yzx.escreen.presenter.MyView | import com.yzx.escreen.presenter.MyView | ||||
| import com.yzx.escreen.utils.hideNavigationBar | import com.yzx.escreen.utils.hideNavigationBar | ||||
| import kotlinx.android.synthetic.main.fragment_my.* | |||||
| import kotlinx.android.synthetic.main.fragment_my.density | |||||
| import kotlinx.android.synthetic.main.fragment_my.groupName | |||||
| import kotlinx.android.synthetic.main.fragment_my.idCard | |||||
| import kotlinx.android.synthetic.main.fragment_my.isLeader | |||||
| import kotlinx.android.synthetic.main.fragment_my.jobName | |||||
| import kotlinx.android.synthetic.main.fragment_my.jobType | |||||
| import kotlinx.android.synthetic.main.fragment_my.logoutBtn | |||||
| import kotlinx.android.synthetic.main.fragment_my.phone | |||||
| import kotlinx.android.synthetic.main.fragment_my.sex | |||||
| import kotlinx.android.synthetic.main.fragment_my.sysExitBtn | |||||
| import kotlinx.android.synthetic.main.fragment_my.timeView | |||||
| import kotlinx.android.synthetic.main.fragment_my.unitName | |||||
| import kotlinx.android.synthetic.main.fragment_my.userName | |||||
| import org.greenrobot.eventbus.EventBus | import org.greenrobot.eventbus.EventBus | ||||
| import org.greenrobot.eventbus.Subscribe | import org.greenrobot.eventbus.Subscribe | ||||
| import org.greenrobot.eventbus.ThreadMode | import org.greenrobot.eventbus.ThreadMode | ||||
| @@ -103,7 +114,8 @@ class MyFragment : BaseFragment<MyPresenter>(), MyView { | |||||
| logoutBtn.setOnClickListener { | logoutBtn.setOnClickListener { | ||||
| activity?.apply { | activity?.apply { | ||||
| User.clearUserInfo() | User.clearUserInfo() | ||||
| WebActivity.active(this, "${Config.OA_URL}/login?logout=1") | |||||
| // WebActivity.active(this, "${Config.OA_URL}/login?logout=1") | |||||
| LoginActivity.active(this) | |||||
| finish() | finish() | ||||
| } | } | ||||
| } | } | ||||
| @@ -113,11 +113,11 @@ class VisitorFragment : BaseFragment<VisitorPresenter>(), VisitorView, | |||||
| val curr = TimeUtils.getNowMills() | val curr = TimeUtils.getNowMills() | ||||
| if (curr - lastClickTime > 500) { | if (curr - lastClickTime > 500) { | ||||
| lastClickTime = curr | lastClickTime = curr | ||||
| when (view.id) { | |||||
| R.id.faceEmpty, R.id.nucleinEmpty, R.id.tripCodeEmpty, R.id.healthCodeEmpty -> { | |||||
| mPresenter?.getDetail(mAdapter.getItem(position).id) | |||||
| } | |||||
| } | |||||
| // when (view.id) { | |||||
| // R.id.faceEmpty, R.id.nucleinEmpty, R.id.tripCodeEmpty, R.id.healthCodeEmpty -> { | |||||
| // mPresenter?.getDetail(mAdapter.getItem(position).id) | |||||
| // } | |||||
| // } | |||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,75 @@ | |||||
| package com.yzx.escreen.model | |||||
| import com.yzx.escreen.utils.getImgUrl | |||||
| import java.net.URLDecoder | |||||
| data class CBClassInfo( | |||||
| val brushed_face_num: Int = 0, | |||||
| val class_student_num: Int = 0, | |||||
| val class_teacher: ClassTeacher = ClassTeacher(), | |||||
| val leave_num: Int = 0, | |||||
| val unbrushed_face_num: Int = 0, | |||||
| val user_photo: UserPhoto = UserPhoto() | |||||
| ) | |||||
| data class ClassTeacher( | |||||
| val user_id: Int = 0, | |||||
| val user_name: String = "" | |||||
| ) | |||||
| data class UserPhoto( | |||||
| val head_portrait: String = "", | |||||
| val identity: String = "" | |||||
| ) | |||||
| data class ClassTeaInfo( | |||||
| val subject_name: String = "", | |||||
| val subject_id: String = "", | |||||
| val user_name: String = "", | |||||
| val user_id: String = "", | |||||
| val type: Int = 0 | |||||
| ) | |||||
| data class TimeTable( | |||||
| val lesson_no: Int = 0, | |||||
| val lesson_name: String = "", | |||||
| val subject_id: String = "", | |||||
| val subject_name: String = "" | |||||
| ) | |||||
| data class ClassActiveInfo( | |||||
| val add_time: Int = 0, | |||||
| val user_name: String = "", | |||||
| val content: String = "", | |||||
| val attachments: MutableList<ActiveAttachment> = mutableListOf() | |||||
| ){ | |||||
| fun getNewContent():String{ | |||||
| return URLDecoder.decode(content,"UTF-8") | |||||
| } | |||||
| fun getImgUrls():MutableList<String>{ | |||||
| val list = mutableListOf<String>() | |||||
| attachments.forEach { | |||||
| if (it.file_id?.isNotEmpty()) | |||||
| list.add(it.file_identity.getImgUrl(it.file_id)) | |||||
| } | |||||
| return list | |||||
| } | |||||
| } | |||||
| data class ActiveAttachment( | |||||
| val file_id: String = "", | |||||
| val file_identity: String = "" | |||||
| ) | |||||
| data class ClassStylePic( | |||||
| val identity: String = "", | |||||
| val picture_id: String = "" | |||||
| ) | |||||
| data class HeadClassInfo( | |||||
| val class_id: Int = 0, | |||||
| val class_name: String = "", | |||||
| val grade_id: Int = 0, | |||||
| val grade_name: String = "" | |||||
| ) | |||||
| @@ -0,0 +1,6 @@ | |||||
| package com.yzx.escreen.model | |||||
| class EventBugBean { | |||||
| } | |||||
| data class EventLeaveIds(var ids:String="") | |||||
| @@ -19,7 +19,7 @@ data class StuLeave( | |||||
| val end_time: Int = 0, | val end_time: Int = 0, | ||||
| val entry_flag: Int = 0, | val entry_flag: Int = 0, | ||||
| val face_identity: String = "", | val face_identity: String = "", | ||||
| val face_key: String = "", | |||||
| val face_key: String ?= "", | |||||
| val ftime: Int = 0, | val ftime: Int = 0, | ||||
| val grade_id: Int = 0, | val grade_id: Int = 0, | ||||
| val grade_name: String = "", | val grade_name: String = "", | ||||
| @@ -3,7 +3,22 @@ package com.yzx.escreen.model | |||||
| import com.blankj.utilcode.util.SPUtils | import com.blankj.utilcode.util.SPUtils | ||||
| import com.blankj.utilcode.util.TimeUtils | import com.blankj.utilcode.util.TimeUtils | ||||
| class BaseUser(var token: String, | |||||
| var type:Int, | |||||
| var role:String, | |||||
| var user_id:Int, | |||||
| var unit_id:Int, | |||||
| var school_id:Int, | |||||
| var unit_name:String, | |||||
| var school_name:String, | |||||
| var direct_login:Int, | |||||
| var tmp_token:String, | |||||
| var phone:String | |||||
| ) | |||||
| class UserAvatar(val identity:String,val head_portrait:String) | |||||
| class WxQrTicket(val ticket:String) | |||||
| class User( | class User( | ||||
| var user_name: String, | var user_name: String, | ||||
| var user_id: Int, | var user_id: Int, | ||||
| @@ -11,7 +11,7 @@ data class Visitor( | |||||
| val card_no: String = "", | val card_no: String = "", | ||||
| val end_time: Int = 0, | val end_time: Int = 0, | ||||
| val face_identity: String = "", | val face_identity: String = "", | ||||
| val face_key: String = "", | |||||
| val face_key: String ?= "", | |||||
| val health_code_identity: String = "", | val health_code_identity: String = "", | ||||
| val health_code_key: String = "", | val health_code_key: String = "", | ||||
| val health_code_status: Int = -1, | val health_code_status: Int = -1, | ||||
| @@ -0,0 +1,207 @@ | |||||
| package com.yzx.escreen.presenter | |||||
| import com.blankj.utilcode.util.LogUtils | |||||
| import com.lzy.okgo.OkGo | |||||
| import com.lzy.okgo.model.Response | |||||
| import com.yzx.escreen.config.Config | |||||
| import com.yzx.escreen.model.BaseUser | |||||
| import com.yzx.escreen.model.User | |||||
| import com.yzx.escreen.model.WxQrTicket | |||||
| 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.YzxResponse | |||||
| import com.yzx.escreen.config.YzxInterface | |||||
| class LoginPresenter(view: LoginView) : BasePresenter<LoginView>(view) { | |||||
| fun login(phone: String, psw: String) { | |||||
| val url = Config.BASE_URL + YzxInterface.INTERFACE_LOGIN_ALL | |||||
| OkGo.post<YzxResponse<BaseUser>>(url) | |||||
| .tag(this) | |||||
| .params("phone", phone) | |||||
| .params("password", psw) | |||||
| .params("original_password", psw) | |||||
| .execute(object : JsonCallBack<YzxResponse<BaseUser>>() { | |||||
| override fun onSuccess(response: Response<YzxResponse<BaseUser>>?) { | |||||
| if (response?.isSuccessful == true) { | |||||
| mView?.onLoginSuccess(response.body().data, response.body().list) | |||||
| LogUtils.d("login", response.body().list) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<BaseUser>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| mView?.onLoginError(response?.body()?.msg ?: "") | |||||
| } | |||||
| }) | |||||
| } | |||||
| fun switchUser(token: String, user_id: Int, unit_id: Int) { | |||||
| val url = Config.BASE_URL + YzxInterface.INTERFACE_USER_SWITCH | |||||
| OkGo.post<YzxResponse<User>>(url) | |||||
| .tag(this) | |||||
| .params("token", token) | |||||
| .params("user_id", user_id) | |||||
| .params("unit_id", unit_id) | |||||
| .params("type", 0) | |||||
| .execute(object : JsonCallBack<YzxResponse<User>>() { | |||||
| override fun onSuccess(response: Response<YzxResponse<User>>?) { | |||||
| if (response?.isSuccessful == true) { | |||||
| response.body().data.save() | |||||
| getUserLoginInfo(response.body().data.token) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<User>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| mView?.onLoginError(response?.body()?.msg ?: "") | |||||
| } | |||||
| }) | |||||
| } | |||||
| fun switchUnit(user_id: Int, school_id: Int, tmp_token: String) { | |||||
| val url = Config.BASE_URL + YzxInterface.INTERFACE_USER_SWITCH_UNIT | |||||
| OkGo.post<YzxResponse<User>>(url) | |||||
| .tag(this) | |||||
| .params("school_id", school_id) | |||||
| .params("user_id", user_id) | |||||
| .params("tmp_token", tmp_token) | |||||
| .params("client_id", 201) | |||||
| .params("type", 0) | |||||
| .execute(object : JsonCallBack<YzxResponse<User>>() { | |||||
| override fun onSuccess(response: Response<YzxResponse<User>>?) { | |||||
| if (response?.isSuccessful == true) { | |||||
| getUserLoginInfo(response.body().data.token) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<User>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| mView?.onLoginError(response?.body()?.msg ?: "") | |||||
| } | |||||
| }) | |||||
| } | |||||
| fun getUserLoginInfo(token: String) { | |||||
| val url = Config.BASE_URL + YzxInterface.INTERFACE_COMMON_LOGIN_BY_TOKEN | |||||
| OkGo.post<YzxResponse<User>>(url) | |||||
| .tag(this) | |||||
| .params("token", token) | |||||
| .execute(object : JsonCallBack<YzxResponse<User>>() { | |||||
| override fun onSuccess(response: Response<YzxResponse<User>>?) { | |||||
| if (response?.isSuccessful == true) { | |||||
| response.body().data.save() | |||||
| mView?.onUserInfoSuccess(response.body().data) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<User>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| mView?.onLoginError(response?.body()?.msg ?: "") | |||||
| } | |||||
| }) | |||||
| } | |||||
| fun getUserRoleInfoByPhone(phone: String, temp_token: String = "") { | |||||
| val url = Config.BASE_URL + YzxInterface.INTERFACE_USER_ROLE_LIST_BY_PHONE | |||||
| OkGo.post<YzxResponse<BaseUser>>(url) | |||||
| .tag(this) | |||||
| .params("phone", phone) | |||||
| .execute(object : JsonCallBack<YzxResponse<BaseUser>>() { | |||||
| override fun onSuccess(response: Response<YzxResponse<BaseUser>>?) { | |||||
| if (response?.isSuccessful == true) { | |||||
| val teaList = response.body().list.filter { return@filter it.role.toInt() == 0 } | |||||
| .toMutableList() | |||||
| teaList.forEach { | |||||
| it.unit_name = it.school_name | |||||
| it.unit_id = it.school_id | |||||
| } | |||||
| mView?.onUserListSuccess(teaList, temp_token) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<BaseUser>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| mView?.onLoginError(response?.body()?.msg ?: "") | |||||
| } | |||||
| }) | |||||
| } | |||||
| fun getUserRoleList(token: String) { | |||||
| val url = Config.BASE_URL + YzxInterface.INTERFACE_USER_ROLE_LIST | |||||
| OkGo.post<YzxResponse<BaseUser>>(url) | |||||
| .tag(this) | |||||
| .params("token", token) | |||||
| .execute(object : JsonCallBack<YzxResponse<BaseUser>>() { | |||||
| override fun onSuccess(response: Response<YzxResponse<BaseUser>>?) { | |||||
| if (response?.isSuccessful == true) { | |||||
| val teaList = response.body().list.filter { return@filter it.type == 0 } | |||||
| .toMutableList() | |||||
| mView?.onUserListSuccess(teaList, token) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<BaseUser>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| mView?.onLoginError(response?.body()?.msg ?: "") | |||||
| } | |||||
| }) | |||||
| } | |||||
| fun getWXQrCode() { | |||||
| val url = Config.BASE_URL + YzxInterface.INTERFACE_GENERATE_WX_QR_TICKET | |||||
| OkGo.post<YzxResponse<WxQrTicket>>(url) | |||||
| .tag(this) | |||||
| .params("mp_id", 4) | |||||
| .execute(object : JsonCallBack<YzxResponse<WxQrTicket>>() { | |||||
| override fun onSuccess(response: Response<YzxResponse<WxQrTicket>>?) { | |||||
| if (response?.isSuccessful == true) { | |||||
| val url = | |||||
| "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=${response.body().data.ticket}" | |||||
| mView?.onWxQrCodeSuccess(url, response.body().data.ticket) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<WxQrTicket>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| } | |||||
| }) | |||||
| } | |||||
| fun loginQuery(ticket: String) { | |||||
| val url = Config.BASE_URL + YzxInterface.INTERFACE_WX_DO_LOGIN_QUERY | |||||
| OkGo.post<YzxResponse<BaseUser>>(url) | |||||
| .tag(this) | |||||
| .params("ticket", ticket) | |||||
| .execute(object : JsonCallBack<YzxResponse<BaseUser>>() { | |||||
| override fun onSuccess(response: Response<YzxResponse<BaseUser>>?) { | |||||
| if (response?.isSuccessful == true) { | |||||
| val res = response.body() | |||||
| mView?.onLoginQuerySuccess(res.data, res.code) | |||||
| } | |||||
| } | |||||
| override fun onError(response: Response<YzxResponse<BaseUser>>?) { | |||||
| super.onError(response) | |||||
| LogUtils.d(response) | |||||
| } | |||||
| }) | |||||
| } | |||||
| } | |||||
| interface LoginView : IView { | |||||
| fun onLoginSuccess(user: BaseUser, list: MutableList<BaseUser>) | |||||
| fun onLoginError(msg: String) | |||||
| fun onUserInfoSuccess(user: User) | |||||
| fun onUserListSuccess(list: MutableList<BaseUser>, token: String) | |||||
| fun onWxQrCodeSuccess(imgUrl: String, ticket: String) | |||||
| fun onLoginQuerySuccess(user: BaseUser, code: Int) | |||||
| } | |||||
| @@ -5,7 +5,11 @@ 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.config.YzxInterface | import com.yzx.escreen.config.YzxInterface | ||||
| import com.yzx.escreen.model.* | |||||
| import com.yzx.escreen.model.AccessToken | |||||
| import com.yzx.escreen.model.Pager | |||||
| import com.yzx.escreen.model.QrCode | |||||
| import com.yzx.escreen.model.User | |||||
| import com.yzx.escreen.model.Visitor | |||||
| import com.yzx.escreen.presenter.base.BasePresenter | import com.yzx.escreen.presenter.base.BasePresenter | ||||
| import com.yzx.escreen.presenter.base.IView | import com.yzx.escreen.presenter.base.IView | ||||
| import com.yzx.escreen.presenter.base.JsonCallBack | import com.yzx.escreen.presenter.base.JsonCallBack | ||||
| @@ -24,7 +28,7 @@ class VisitorPresenter(view: VisitorView) : BasePresenter<VisitorView>(view) { | |||||
| .params("keyword", keyword) | .params("keyword", keyword) | ||||
| .params("audit_status", status) | .params("audit_status", status) | ||||
| .params("user_type", 3) | .params("user_type", 3) | ||||
| .params("page_size", 6) | |||||
| .params("page_size", 9) | |||||
| .params("page_no", pageNo) | .params("page_no", pageNo) | ||||
| .execute(object : JsonCallBack<YzxResponse<Visitor>>() { | .execute(object : JsonCallBack<YzxResponse<Visitor>>() { | ||||
| @@ -10,8 +10,7 @@ import com.lzy.okgo.model.HttpHeaders; | |||||
| import com.lzy.okgo.request.base.Request; | import com.lzy.okgo.request.base.Request; | ||||
| import com.yzx.escreen.App; | import com.yzx.escreen.App; | ||||
| import com.yzx.escreen.MainActivity; | import com.yzx.escreen.MainActivity; | ||||
| import com.yzx.escreen.activity.WebActivity; | |||||
| import com.yzx.escreen.config.Config; | |||||
| import com.yzx.escreen.activity.LoginActivity; | |||||
| import com.yzx.escreen.config.RefreshToken; | import com.yzx.escreen.config.RefreshToken; | ||||
| import com.yzx.escreen.model.User; | import com.yzx.escreen.model.User; | ||||
| import com.yzx.escreen.utils.Monitor; | import com.yzx.escreen.utils.Monitor; | ||||
| @@ -162,9 +161,9 @@ public abstract class JsonCallBack<T> extends AbsCallback<T> { | |||||
| public void onError() { | public void onError() { | ||||
| LogUtils.d("onError"); | LogUtils.d("onError"); | ||||
| User.Companion.clearUserInfo(); | User.Companion.clearUserInfo(); | ||||
| Intent intent = new Intent(App.Companion.getContext(),WebActivity.class); | |||||
| Intent intent = new Intent(App.Companion.getContext(), LoginActivity.class); | |||||
| intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||||
| intent.putExtra("link", Config.INSTANCE.getOA_URL()+"/login?logout=1"); | |||||
| // intent.putExtra("link", Config.INSTANCE.getOA_URL()+"/login?logout=1"); | |||||
| ActivityUtils.startActivity(intent); | ActivityUtils.startActivity(intent); | ||||
| ActivityUtils.finishActivity(MainActivity.class); | ActivityUtils.finishActivity(MainActivity.class); | ||||
| } | } | ||||
| @@ -5,16 +5,24 @@ import android.view.View | |||||
| import android.widget.ImageView | import android.widget.ImageView | ||||
| import com.blankj.utilcode.util.TimeUtils | import com.blankj.utilcode.util.TimeUtils | ||||
| import com.bumptech.glide.Glide | import com.bumptech.glide.Glide | ||||
| import com.yzx.escreen.R | |||||
| import java.text.SimpleDateFormat | import java.text.SimpleDateFormat | ||||
| import java.util.* | |||||
| import java.util.TimeZone | |||||
| fun ImageView.setSrc(identity: String, key: String) { | fun ImageView.setSrc(identity: String, key: String) { | ||||
| val url = "https://${identity}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | |||||
| val url = "https://${identity.ifEmpty { "filea" }}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | |||||
| Glide.with(this) | Glide.with(this) | ||||
| .load(url) | .load(url) | ||||
| .placeholder(R.color.gray_1) | |||||
| .into(this) | .into(this) | ||||
| this.setTag(R.id.image_src_tag,url) | |||||
| } | } | ||||
| fun String.getImgUrl(key: String):String{ | |||||
| return "https://${this.ifEmpty { "filea" }}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | |||||
| } | |||||
| fun ImageView.setSrc(url: String) { | fun ImageView.setSrc(url: String) { | ||||
| Glide.with(this) | Glide.with(this) | ||||
| .load(url) | .load(url) | ||||
| @@ -55,7 +55,7 @@ class LeaveDialog( | |||||
| @SuppressLint("SetTextI18n") | @SuppressLint("SetTextI18n") | ||||
| fun setData(detail: StuLeave) { | fun setData(detail: StuLeave) { | ||||
| leave_student_name.text = detail.leave_student_name | leave_student_name.text = detail.leave_student_name | ||||
| if (detail.face_key.isNotEmpty()) { | |||||
| if (detail.face_key?.isNotEmpty() == true) { | |||||
| val img = find<ImageView>(R.id.face_img) | val img = find<ImageView>(R.id.face_img) | ||||
| img.setSrc(detail.face_identity, detail.face_key) | img.setSrc(detail.face_identity, detail.face_key) | ||||
| img.visibility = View.VISIBLE | img.visibility = View.VISIBLE | ||||
| @@ -65,7 +65,7 @@ class LeaveDialog( | |||||
| find<View>(R.id.face_img).visibility = View.GONE | find<View>(R.id.face_img).visibility = View.GONE | ||||
| } | } | ||||
| find<ImageView>(R.id.face_img).setOnClickListener { | find<ImageView>(R.id.face_img).setOnClickListener { | ||||
| EventBus.getDefault().post(ViewImage(detail.id,detail.face_identity,detail.face_key)) | |||||
| EventBus.getDefault().post(ViewImage(detail.id,detail.face_identity,detail?.face_key?:"")) | |||||
| } | } | ||||
| find<TextView>(R.id.class_name).text = "${detail.grade_name}${detail.class_name}" | find<TextView>(R.id.class_name).text = "${detail.grade_name}${detail.class_name}" | ||||
| find<TextView>(R.id.leave_request_type_name).text = detail.leave_request_type_name | find<TextView>(R.id.leave_request_type_name).text = detail.leave_request_type_name | ||||
| @@ -17,9 +17,7 @@ import com.yzx.escreen.adapter.VisitorDialogStepAdapter | |||||
| import com.yzx.escreen.model.ViewImage | import com.yzx.escreen.model.ViewImage | ||||
| import com.yzx.escreen.model.Visitor | import com.yzx.escreen.model.Visitor | ||||
| import com.yzx.escreen.utils.setSrc | import com.yzx.escreen.utils.setSrc | ||||
| import com.yzx.escreen.utils.toDay | |||||
| import com.yzx.escreen.utils.toTime | import com.yzx.escreen.utils.toTime | ||||
| import kotlinx.android.synthetic.main.dialog_visitor.view.* | |||||
| import org.greenrobot.eventbus.EventBus | import org.greenrobot.eventbus.EventBus | ||||
| import org.jetbrains.anko.find | import org.jetbrains.anko.find | ||||
| import org.jetbrains.anko.textColor | import org.jetbrains.anko.textColor | ||||
| @@ -59,89 +57,91 @@ class VisitorDialog( | |||||
| //处理弹窗显示 | //处理弹窗显示 | ||||
| find<TextView>(R.id.userName).text = "${detail.user_name} ${detail.user_phone}" | find<TextView>(R.id.userName).text = "${detail.user_name} ${detail.user_phone}" | ||||
| find<TextView>(R.id.id_card_num).text = "${detail.card_no}" | find<TextView>(R.id.id_card_num).text = "${detail.card_no}" | ||||
| if (detail.face_key.isNotEmpty()) { | |||||
| if (detail.face_key?.isNotEmpty() == true) { | |||||
| val img = find<ImageView>(R.id.face_img) | val img = find<ImageView>(R.id.face_img) | ||||
| img.setSrc(detail.face_identity, detail.face_key) | img.setSrc(detail.face_identity, detail.face_key) | ||||
| img.visibility = View.VISIBLE | img.visibility = View.VISIBLE | ||||
| find<View>(R.id.face_empty).visibility = View.GONE | find<View>(R.id.face_empty).visibility = View.GONE | ||||
| find<View>(R.id.face_layout).visibility = View.VISIBLE | |||||
| } else { | } else { | ||||
| find<View>(R.id.face_empty).visibility = View.VISIBLE | find<View>(R.id.face_empty).visibility = View.VISIBLE | ||||
| find<View>(R.id.face_img).visibility = View.GONE | find<View>(R.id.face_img).visibility = View.GONE | ||||
| find<View>(R.id.face_layout).visibility = View.GONE | |||||
| } | } | ||||
| find<ImageView>(R.id.face_img).setOnClickListener { | find<ImageView>(R.id.face_img).setOnClickListener { | ||||
| EventBus.getDefault().post(ViewImage(detail.id, detail.face_identity, detail.face_key)) | |||||
| EventBus.getDefault().post(ViewImage(detail.id, detail.face_identity, detail?.face_key?:"")) | |||||
| } | } | ||||
| when { | |||||
| detail.health_code_status >= 0 -> { | |||||
| healthCodeStatusLayout.visibility = VISIBLE | |||||
| health_empty.visibility = GONE | |||||
| health_img.visibility = GONE | |||||
| when (detail.health_code_status) { | |||||
| 0 -> { | |||||
| healthCodeStatus.text = "状态:绿码" | |||||
| healthCodeStatus.textColor = Color.parseColor("#5DAD64") | |||||
| } | |||||
| 1 -> { | |||||
| healthCodeStatus.text = "状态:黄码" | |||||
| healthCodeStatus.textColor = Color.parseColor("#FCCF13") | |||||
| } | |||||
| 10 -> { | |||||
| healthCodeStatus.text = "状态:红码" | |||||
| healthCodeStatus.textColor = Color.parseColor("#FC0416") | |||||
| } | |||||
| } | |||||
| } | |||||
| detail.health_code_key.isNotEmpty() -> { | |||||
| healthCodeStatusLayout.visibility = GONE | |||||
| val img = find<ImageView>(R.id.health_img) | |||||
| img.setSrc(detail.health_code_identity, detail.health_code_key) | |||||
| img.visibility = View.VISIBLE | |||||
| find<View>(R.id.health_empty).visibility = View.GONE | |||||
| } | |||||
| else -> { | |||||
| healthCodeStatusLayout.visibility = GONE | |||||
| find<View>(R.id.health_empty).visibility = View.VISIBLE | |||||
| find<View>(R.id.health_img).visibility = View.GONE | |||||
| } | |||||
| } | |||||
| find<ImageView>(R.id.health_img).setOnClickListener { | |||||
| EventBus.getDefault() | |||||
| .post(ViewImage(detail.id, detail.health_code_identity, detail.health_code_key)) | |||||
| } | |||||
| if (detail.trip_code_key.isNotEmpty()) { | |||||
| val img = find<ImageView>(R.id.trip_img) | |||||
| img.setSrc(detail.trip_code_identity, detail.trip_code_key) | |||||
| img.visibility = View.VISIBLE | |||||
| find<View>(R.id.trip_empty).visibility = View.GONE | |||||
| } else { | |||||
| find<View>(R.id.trip_empty).visibility = View.VISIBLE | |||||
| find<View>(R.id.trip_img).visibility = View.GONE | |||||
| } | |||||
| if(detail.nuclein_file_key.isNullOrBlank()){ | |||||
| nuclein_img.visibility = View.GONE | |||||
| nuclein_empty.visibility = View.VISIBLE | |||||
| }else{ | |||||
| nuclein_img.visibility = View.VISIBLE | |||||
| nuclein_empty.visibility = View.GONE | |||||
| nuclein_img.setSrc(detail.nuclein_file_identity, detail.nuclein_file_key) | |||||
| } | |||||
| if(detail.nuclein_time>0){ | |||||
| nucleinStatusLayout.visibility = VISIBLE | |||||
| nucleinStatus.text = detail.getNucleinStatusObj().nuclein_name | |||||
| nucleinStatus.setTextColor(Color.parseColor(detail.getNucleinStatusObj().nuclein_color)) | |||||
| }else{ | |||||
| nucleinStatusLayout.visibility = GONE | |||||
| } | |||||
| find<ImageView>(R.id.trip_img).setOnClickListener { | |||||
| EventBus.getDefault() | |||||
| .post(ViewImage(detail.id, detail.trip_code_identity, detail.trip_code_key)) | |||||
| } | |||||
| find<ImageView>(R.id.nuclein_img).setOnClickListener { | |||||
| EventBus.getDefault() | |||||
| .post(ViewImage(detail.id, detail.nuclein_file_identity, detail.nuclein_file_key)) | |||||
| } | |||||
| find<TextView>(R.id.reception_user).text = "${detail.reception_user}" | |||||
| find<TextView>(R.id.visit_reason).text = "${detail.visit_reason}" | |||||
| // when { | |||||
| // detail.health_code_status >= 0 -> { | |||||
| // healthCodeStatusLayout.visibility = VISIBLE | |||||
| // health_empty.visibility = GONE | |||||
| // health_img.visibility = GONE | |||||
| // when (detail.health_code_status) { | |||||
| // 0 -> { | |||||
| // healthCodeStatus.text = "状态:绿码" | |||||
| // healthCodeStatus.textColor = Color.parseColor("#5DAD64") | |||||
| // } | |||||
| // 1 -> { | |||||
| // healthCodeStatus.text = "状态:黄码" | |||||
| // healthCodeStatus.textColor = Color.parseColor("#FCCF13") | |||||
| // } | |||||
| // 10 -> { | |||||
| // healthCodeStatus.text = "状态:红码" | |||||
| // healthCodeStatus.textColor = Color.parseColor("#FC0416") | |||||
| // } | |||||
| // } | |||||
| // } | |||||
| // detail.health_code_key.isNotEmpty() -> { | |||||
| // healthCodeStatusLayout.visibility = GONE | |||||
| // val img = find<ImageView>(R.id.health_img) | |||||
| // img.setSrc(detail.health_code_identity, detail.health_code_key) | |||||
| // img.visibility = View.VISIBLE | |||||
| // find<View>(R.id.health_empty).visibility = View.GONE | |||||
| // } | |||||
| // else -> { | |||||
| // healthCodeStatusLayout.visibility = GONE | |||||
| // find<View>(R.id.health_empty).visibility = View.VISIBLE | |||||
| // find<View>(R.id.health_img).visibility = View.GONE | |||||
| // } | |||||
| // } | |||||
| // find<ImageView>(R.id.health_img).setOnClickListener { | |||||
| // EventBus.getDefault() | |||||
| // .post(ViewImage(detail.id, detail.health_code_identity, detail.health_code_key)) | |||||
| // } | |||||
| // if (detail.trip_code_key.isNotEmpty()) { | |||||
| // val img = find<ImageView>(R.id.trip_img) | |||||
| // img.setSrc(detail.trip_code_identity, detail.trip_code_key) | |||||
| // img.visibility = View.VISIBLE | |||||
| // find<View>(R.id.trip_empty).visibility = View.GONE | |||||
| // } else { | |||||
| // find<View>(R.id.trip_empty).visibility = View.VISIBLE | |||||
| // find<View>(R.id.trip_img).visibility = View.GONE | |||||
| // } | |||||
| // if(detail.nuclein_file_key.isNullOrBlank()){ | |||||
| // nuclein_img.visibility = View.GONE | |||||
| // nuclein_empty.visibility = View.VISIBLE | |||||
| // }else{ | |||||
| // nuclein_img.visibility = View.VISIBLE | |||||
| // nuclein_empty.visibility = View.GONE | |||||
| // nuclein_img.setSrc(detail.nuclein_file_identity, detail.nuclein_file_key) | |||||
| // } | |||||
| // if(detail.nuclein_time>0){ | |||||
| // nucleinStatusLayout.visibility = VISIBLE | |||||
| // nucleinStatus.text = detail.getNucleinStatusObj().nuclein_name | |||||
| // nucleinStatus.setTextColor(Color.parseColor(detail.getNucleinStatusObj().nuclein_color)) | |||||
| // }else{ | |||||
| // nucleinStatusLayout.visibility = GONE | |||||
| // } | |||||
| // find<ImageView>(R.id.trip_img).setOnClickListener { | |||||
| // EventBus.getDefault() | |||||
| // .post(ViewImage(detail.id, detail.trip_code_identity, detail.trip_code_key)) | |||||
| // } | |||||
| // find<ImageView>(R.id.nuclein_img).setOnClickListener { | |||||
| // EventBus.getDefault() | |||||
| // .post(ViewImage(detail.id, detail.nuclein_file_identity, detail.nuclein_file_key)) | |||||
| // } | |||||
| // find<TextView>(R.id.reception_user).text = "${detail.reception_user}" | |||||
| // find<TextView>(R.id.visit_reason).text = "${detail.visit_reason}" | |||||
| find<TextView>(R.id.is_drive).text = when (detail.is_drive) { | find<TextView>(R.id.is_drive).text = when (detail.is_drive) { | ||||
| 1 -> "是" | 1 -> "是" | ||||
| 0 -> "否" | 0 -> "否" | ||||
| @@ -171,7 +171,7 @@ class VisitorDialog( | |||||
| else -> Color.parseColor("#333333") | else -> Color.parseColor("#333333") | ||||
| } | } | ||||
| find<TextView>(R.id.start_time).text = | find<TextView>(R.id.start_time).text = | ||||
| "${detail.start_time.toDay()} - ${detail.end_time.toDay()} 可进出${detail.in_out_num}次" | |||||
| "${detail.start_time.toTime()} - ${detail.end_time.toTime()}" | |||||
| } | } | ||||
| find<ImageView>(R.id.statusImg).setSrc(detail.getStatusImg()) | find<ImageView>(R.id.statusImg).setSrc(detail.getStatusImg()) | ||||
| @@ -0,0 +1,5 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <item android:drawable="@color/blue3" android:state_pressed="true" /> | |||||
| <item android:drawable="@color/blue2" /> | |||||
| </selector> | |||||
| @@ -0,0 +1,8 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <bitmap xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:gravity="bottom" | |||||
| android:dither="true" | |||||
| android:src="@mipmap/login_bg" | |||||
| android:tileMode="disabled"> | |||||
| </bitmap> | |||||
| @@ -0,0 +1,6 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <corners android:radius="10dp"></corners> | |||||
| <solid android:color="@color/white"></solid> | |||||
| <stroke android:width="@dimen/d_30" android:color="#01000000"></stroke> | |||||
| </shape> | |||||
| @@ -0,0 +1,5 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <corners android:radius="50dp"></corners> | |||||
| <solid android:color="@color/black"></solid> | |||||
| </shape> | |||||
| @@ -0,0 +1,181 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <RelativeLayout 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" | |||||
| tools:context=".activity.LoginActivity"> | |||||
| <ImageView | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| android:src="@drawable/login_bg" | |||||
| android:scaleType="centerCrop"/> | |||||
| <ScrollView | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent"> | |||||
| <LinearLayout | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="200dp" | |||||
| android:gravity="center"> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="vertical"> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_gravity="center_horizontal" | |||||
| android:text="成都市青白江区教育一体化综合平台" | |||||
| android:textColor="#3ca0e9" | |||||
| android:textSize="40dp" | |||||
| android:textStyle="bold" /> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_gravity="center_horizontal" | |||||
| android:layout_marginTop="14dp" | |||||
| android:text="---------- Chengdu Qingbaijiang Integrated Education Platform ---------" | |||||
| android:textColor="#3ca0e9" | |||||
| android:textSize="16dp" | |||||
| android:textStyle="normal" /> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="500dp" | |||||
| android:layout_height="400dp" | |||||
| android:layout_gravity="center_horizontal" | |||||
| android:layout_marginTop="@dimen/d_30" | |||||
| android:background="@drawable/shape_login_form" | |||||
| android:orientation="vertical" | |||||
| android:padding="@dimen/d_20"> | |||||
| <com.flyco.tablayout.CommonTabLayout | |||||
| android:id="@+id/tabLayout" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="50dp" | |||||
| app:tl_iconVisible="false" | |||||
| app:tl_indicator_color="#3ca0e9" | |||||
| app:tl_indicator_height="@dimen/dp_4" | |||||
| app:tl_indicator_width="150dp" | |||||
| app:tl_textSelectColor="#3ca0e9" | |||||
| app:tl_textUnselectColor="#333" | |||||
| app:tl_textsize="18dp" /> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:id="@+id/qrLayout" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:orientation="vertical" | |||||
| android:gravity="center_horizontal" | |||||
| android:paddingHorizontal="@dimen/d_30" | |||||
| android:visibility="gone"> | |||||
| <ImageView | |||||
| android:id="@+id/qrCodeImg" | |||||
| android:layout_width="200dp" | |||||
| android:layout_height="200dp" | |||||
| android:background="@color/blue2"/> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:text="扫码 > 关注 > 登录" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:background="@drawable/shape_login_round" | |||||
| android:textColor="@color/white" | |||||
| android:paddingVertical="@dimen/d_10" | |||||
| android:paddingHorizontal="@dimen/d_30"/> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:id="@+id/accountLayout" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:orientation="vertical" | |||||
| android:paddingHorizontal="@dimen/d_30" | |||||
| android:visibility="visible"> | |||||
| <LinearLayout | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:background="#f0f3f5" | |||||
| android:padding="@dimen/d_10" | |||||
| android:gravity="center_vertical"> | |||||
| <ImageView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:src="@mipmap/ic_psw" /> | |||||
| <EditText | |||||
| android:id="@+id/accountEdit" | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginLeft="@dimen/d_10" | |||||
| android:layout_weight="1" | |||||
| android:background="@null" | |||||
| android:hint="账号" | |||||
| android:text="" | |||||
| android:inputType="phone" | |||||
| android:singleLine="true" /> | |||||
| </LinearLayout> | |||||
| <LinearLayout | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/d_30" | |||||
| android:background="#f0f3f5" | |||||
| android:padding="@dimen/d_10" | |||||
| android:gravity="center_vertical"> | |||||
| <ImageView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:src="@mipmap/ic_account" /> | |||||
| <EditText | |||||
| android:id="@+id/pswEdit" | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginLeft="@dimen/d_10" | |||||
| android:layout_weight="1" | |||||
| android:background="@null" | |||||
| android:inputType="textPassword" | |||||
| android:hint="密码" | |||||
| android:text="" | |||||
| android:singleLine="true" /> | |||||
| </LinearLayout> | |||||
| <CheckBox | |||||
| android:id="@+id/pswCheckbox" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:text="记住账号密码" | |||||
| android:checked="true" | |||||
| android:layout_marginTop="@dimen/d_20"/> | |||||
| <androidx.appcompat.widget.AppCompatButton | |||||
| android:id="@+id/loginBtn" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:text="登 录" | |||||
| android:layout_marginTop="@dimen/d_20" | |||||
| android:background="@drawable/btn_blue_select" | |||||
| android:textColor="@color/white" | |||||
| android:textSize="@dimen/d_20"/> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| </LinearLayout> | |||||
| </ScrollView> | |||||
| </RelativeLayout> | |||||
| @@ -0,0 +1,47 @@ | |||||
| <?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:tl="http://schemas.android.com/apk/res-auto" | |||||
| xmlns:tools="http://schemas.android.com/tools" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| tools:context=".activity.TestActivity"> | |||||
| <RelativeLayout | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| android:gravity="center_horizontal"> | |||||
| <androidx.viewpager2.widget.ViewPager2 | |||||
| android:id="@+id/viewPager2" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| android:layout_above="@id/bottomLine" /> | |||||
| <View | |||||
| android:id="@+id/bottomLine" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="1px" | |||||
| android:layout_above="@id/tabLayout" | |||||
| android:background="#cacbcc" /> | |||||
| <com.flyco.tablayout.CommonTabLayout | |||||
| android:id="@+id/tabLayout" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_alignParentBottom="true" | |||||
| android:background="#ffffff" | |||||
| android:paddingVertical="@dimen/d_10" | |||||
| android:paddingTop="5dp" | |||||
| android:paddingBottom="5dp" | |||||
| tl:tl_iconHeight="48dp" | |||||
| tl:tl_iconWidth="44dp" | |||||
| tl:tl_textSelectColor="@color/colorPrimary" | |||||
| tl:tl_textUnselectColor="#999999" | |||||
| tl:tl_textsize="@dimen/d_24" /> | |||||
| </RelativeLayout> | |||||
| <FrameLayout | |||||
| android:id="@+id/dialogLayout" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent"/> | |||||
| </FrameLayout> | |||||
| @@ -99,199 +99,227 @@ | |||||
| android:text="颜小华 18780170404" /> | android:text="颜小华 18780170404" /> | ||||
| </LinearLayout> | </LinearLayout> | ||||
| <LinearLayout style="@style/visitor_dialog_row"> | |||||
| <LinearLayout | |||||
| android:id="@+id/face_layout" | |||||
| style="@style/visitor_dialog_row"> | |||||
| <TextView | <TextView | ||||
| style="@style/leave_dialog_title" | style="@style/leave_dialog_title" | ||||
| android:layout_width="100dp" | |||||
| android:text="" /> | |||||
| <LinearLayout | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_gravity="center_horizontal" | |||||
| android:layout_weight="1" | |||||
| android:orientation="vertical"> | |||||
| <TextView | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:gravity="center" | |||||
| android:text="人脸" | |||||
| android:textSize="@dimen/sp20" /> | |||||
| <com.qmuiteam.qmui.widget.QMUIRadiusImageView | |||||
| android:id="@+id/face_img" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="190dp" | |||||
| android:text="颜小华" | |||||
| app:qmui_border_color="@color/white" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| <TextView | |||||
| android:id="@+id/face_empty" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="190dp" | |||||
| android:background="@color/gray_2" | |||||
| android:gravity="center" | |||||
| android:text="未设置" | |||||
| android:textColor="@color/white" | |||||
| android:visibility="gone" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| </LinearLayout> | |||||
| <LinearLayout | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginStart="@dimen/d_20" | |||||
| android:layout_weight="1" | |||||
| android:gravity="center_horizontal" | |||||
| android:orientation="vertical"> | |||||
| <TextView | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:gravity="center" | |||||
| android:text="健康码" | |||||
| android:textSize="@dimen/sp20" /> | |||||
| <LinearLayout | |||||
| android:id="@+id/healthCodeStatusLayout" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="190dp" | |||||
| android:gravity="center" | |||||
| android:orientation="vertical"> | |||||
| <TextView | |||||
| android:id="@+id/healthCodeStatus" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:text="状态:绿码" | |||||
| android:textSize="@dimen/d_20" /> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:text="成都大数据中心提供" | |||||
| android:textColor="@color/gray_1" | |||||
| android:textSize="@dimen/d_15" /> | |||||
| </LinearLayout> | |||||
| <com.qmuiteam.qmui.widget.QMUIRadiusImageView | |||||
| android:id="@+id/health_img" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="190dp" | |||||
| android:text="颜小华" | |||||
| app:qmui_border_color="@color/white" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| <TextView | |||||
| android:id="@+id/health_empty" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="190dp" | |||||
| android:background="@color/gray_2" | |||||
| android:gravity="center" | |||||
| android:text="未上传" | |||||
| android:textColor="@color/white" | |||||
| android:visibility="gone" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| </LinearLayout> | |||||
| <LinearLayout | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginStart="@dimen/d_20" | |||||
| android:layout_weight="1" | |||||
| android:gravity="center_horizontal" | |||||
| android:orientation="vertical"> | |||||
| <TextView | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:gravity="center" | |||||
| android:text="行程码" | |||||
| android:textSize="@dimen/sp20" /> | |||||
| <com.qmuiteam.qmui.widget.QMUIRadiusImageView | |||||
| android:id="@+id/trip_img" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="190dp" | |||||
| android:text="颜小华" | |||||
| app:qmui_border_color="@color/white" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| <TextView | |||||
| android:id="@+id/trip_empty" | |||||
| android:layout_width="108dp" | |||||
| android:layout_height="190dp" | |||||
| android:background="@color/gray_2" | |||||
| android:gravity="center" | |||||
| android:text="未上传" | |||||
| android:textColor="@color/white" | |||||
| android:visibility="gone" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| </LinearLayout> | |||||
| <LinearLayout | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginStart="@dimen/d_20" | |||||
| android:layout_weight="1" | |||||
| android:orientation="vertical"> | |||||
| <TextView | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:gravity="center" | |||||
| android:text="核酸报告" | |||||
| android:textSize="@dimen/sp20" /> | |||||
| <com.qmuiteam.qmui.widget.QMUIRadiusImageView | |||||
| android:id="@+id/nuclein_img" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="190dp" | |||||
| android:text="颜小华" | |||||
| app:qmui_border_color="@color/white" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| <TextView | |||||
| android:id="@+id/nuclein_empty" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="190dp" | |||||
| android:background="@color/gray_2" | |||||
| android:gravity="center" | |||||
| android:text="未上传" | |||||
| android:textColor="@color/white" | |||||
| android:visibility="gone" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| <LinearLayout | |||||
| android:id="@+id/nucleinStatusLayout" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:gravity="center" | |||||
| android:orientation="vertical"> | |||||
| <TextView | |||||
| android:id="@+id/nucleinStatus" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:text="省内24小时:阴性" | |||||
| android:textSize="@dimen/d_16" /> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:text="成都大数据中心提供" | |||||
| android:textColor="@color/gray_1" | |||||
| android:textSize="@dimen/d_15" /> | |||||
| </LinearLayout> | |||||
| </LinearLayout> | |||||
| android:text="人脸信息" /> | |||||
| <com.qmuiteam.qmui.widget.QMUIRadiusImageView | |||||
| android:id="@+id/face_img" | |||||
| android:layout_width="150dp" | |||||
| android:layout_height="190dp" | |||||
| android:text="颜小华" | |||||
| app:qmui_border_color="@color/white" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| <TextView | |||||
| android:id="@+id/face_empty" | |||||
| android:layout_width="150dp" | |||||
| android:layout_height="190dp" | |||||
| android:background="@color/gray_2" | |||||
| android:gravity="center" | |||||
| android:text="未设置" | |||||
| android:textColor="@color/white" | |||||
| android:visibility="gone" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| </LinearLayout> | </LinearLayout> | ||||
| <!-- <LinearLayout style="@style/visitor_dialog_row">--> | |||||
| <!-- <TextView--> | |||||
| <!-- style="@style/leave_dialog_title"--> | |||||
| <!-- android:layout_width="100dp"--> | |||||
| <!-- android:text="" />--> | |||||
| <!-- <LinearLayout--> | |||||
| <!-- android:layout_width="0dp"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:layout_gravity="center_horizontal"--> | |||||
| <!-- android:layout_weight="1"--> | |||||
| <!-- android:orientation="vertical">--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:gravity="center"--> | |||||
| <!-- android:text="人脸"--> | |||||
| <!-- android:textSize="@dimen/sp20" />--> | |||||
| <!-- <com.qmuiteam.qmui.widget.QMUIRadiusImageView--> | |||||
| <!-- android:id="@+id/face_img"--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="190dp"--> | |||||
| <!-- android:text="颜小华"--> | |||||
| <!-- app:qmui_border_color="@color/white"--> | |||||
| <!-- app:qmui_corner_radius="@dimen/d_5" />--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:id="@+id/face_empty"--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="190dp"--> | |||||
| <!-- android:background="@color/gray_2"--> | |||||
| <!-- android:gravity="center"--> | |||||
| <!-- android:text="未设置"--> | |||||
| <!-- android:textColor="@color/white"--> | |||||
| <!-- android:visibility="gone"--> | |||||
| <!-- app:qmui_corner_radius="@dimen/d_5" />--> | |||||
| <!-- </LinearLayout>--> | |||||
| <!-- <LinearLayout--> | |||||
| <!-- android:layout_width="0dp"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:layout_marginStart="@dimen/d_20"--> | |||||
| <!-- android:layout_weight="1"--> | |||||
| <!-- android:gravity="center_horizontal"--> | |||||
| <!-- android:orientation="vertical">--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:gravity="center"--> | |||||
| <!-- android:text="健康码"--> | |||||
| <!-- android:textSize="@dimen/sp20" />--> | |||||
| <!-- <LinearLayout--> | |||||
| <!-- android:id="@+id/healthCodeStatusLayout"--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="190dp"--> | |||||
| <!-- android:gravity="center"--> | |||||
| <!-- android:orientation="vertical">--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:id="@+id/healthCodeStatus"--> | |||||
| <!-- android:layout_width="wrap_content"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:text="状态:绿码"--> | |||||
| <!-- android:textSize="@dimen/d_20" />--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:layout_width="wrap_content"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:text="成都大数据中心提供"--> | |||||
| <!-- android:textColor="@color/gray_1"--> | |||||
| <!-- android:textSize="@dimen/d_15" />--> | |||||
| <!-- </LinearLayout>--> | |||||
| <!-- <com.qmuiteam.qmui.widget.QMUIRadiusImageView--> | |||||
| <!-- android:id="@+id/health_img"--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="190dp"--> | |||||
| <!-- android:text="颜小华"--> | |||||
| <!-- app:qmui_border_color="@color/white"--> | |||||
| <!-- app:qmui_corner_radius="@dimen/d_5" />--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:id="@+id/health_empty"--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="190dp"--> | |||||
| <!-- android:background="@color/gray_2"--> | |||||
| <!-- android:gravity="center"--> | |||||
| <!-- android:text="未上传"--> | |||||
| <!-- android:textColor="@color/white"--> | |||||
| <!-- android:visibility="gone"--> | |||||
| <!-- app:qmui_corner_radius="@dimen/d_5" />--> | |||||
| <!-- </LinearLayout>--> | |||||
| <!-- <LinearLayout--> | |||||
| <!-- android:layout_width="0dp"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:layout_marginStart="@dimen/d_20"--> | |||||
| <!-- android:layout_weight="1"--> | |||||
| <!-- android:gravity="center_horizontal"--> | |||||
| <!-- android:orientation="vertical">--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:gravity="center"--> | |||||
| <!-- android:text="行程码"--> | |||||
| <!-- android:textSize="@dimen/sp20" />--> | |||||
| <!-- <com.qmuiteam.qmui.widget.QMUIRadiusImageView--> | |||||
| <!-- android:id="@+id/trip_img"--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="190dp"--> | |||||
| <!-- android:text="颜小华"--> | |||||
| <!-- app:qmui_border_color="@color/white"--> | |||||
| <!-- app:qmui_corner_radius="@dimen/d_5" />--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:id="@+id/trip_empty"--> | |||||
| <!-- android:layout_width="108dp"--> | |||||
| <!-- android:layout_height="190dp"--> | |||||
| <!-- android:background="@color/gray_2"--> | |||||
| <!-- android:gravity="center"--> | |||||
| <!-- android:text="未上传"--> | |||||
| <!-- android:textColor="@color/white"--> | |||||
| <!-- android:visibility="gone"--> | |||||
| <!-- app:qmui_corner_radius="@dimen/d_5" />--> | |||||
| <!-- </LinearLayout>--> | |||||
| <!-- <LinearLayout--> | |||||
| <!-- android:layout_width="0dp"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:layout_marginStart="@dimen/d_20"--> | |||||
| <!-- android:layout_weight="1"--> | |||||
| <!-- android:orientation="vertical">--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:gravity="center"--> | |||||
| <!-- android:text="核酸报告"--> | |||||
| <!-- android:textSize="@dimen/sp20" />--> | |||||
| <!-- <com.qmuiteam.qmui.widget.QMUIRadiusImageView--> | |||||
| <!-- android:id="@+id/nuclein_img"--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="190dp"--> | |||||
| <!-- android:text="颜小华"--> | |||||
| <!-- app:qmui_border_color="@color/white"--> | |||||
| <!-- app:qmui_corner_radius="@dimen/d_5" />--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:id="@+id/nuclein_empty"--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="190dp"--> | |||||
| <!-- android:background="@color/gray_2"--> | |||||
| <!-- android:gravity="center"--> | |||||
| <!-- android:text="未上传"--> | |||||
| <!-- android:textColor="@color/white"--> | |||||
| <!-- android:visibility="gone"--> | |||||
| <!-- app:qmui_corner_radius="@dimen/d_5" />--> | |||||
| <!-- <LinearLayout--> | |||||
| <!-- android:id="@+id/nucleinStatusLayout"--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:gravity="center"--> | |||||
| <!-- android:orientation="vertical">--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:id="@+id/nucleinStatus"--> | |||||
| <!-- android:layout_width="wrap_content"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:text="省内24小时:阴性"--> | |||||
| <!-- android:textSize="@dimen/d_16" />--> | |||||
| <!-- <TextView--> | |||||
| <!-- android:layout_width="wrap_content"--> | |||||
| <!-- android:layout_height="wrap_content"--> | |||||
| <!-- android:text="成都大数据中心提供"--> | |||||
| <!-- android:textColor="@color/gray_1"--> | |||||
| <!-- android:textSize="@dimen/d_15" />--> | |||||
| <!-- </LinearLayout>--> | |||||
| <!-- </LinearLayout>--> | |||||
| <!-- </LinearLayout>--> | |||||
| <LinearLayout | <LinearLayout | ||||
| style="@style/visitor_dialog_row" | style="@style/visitor_dialog_row" | ||||
| android:gravity="center_vertical"> | android:gravity="center_vertical"> | ||||
| @@ -0,0 +1,14 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| xmlns:tools="http://schemas.android.com/tools" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| tools:context=".fragment.BlankFragment"> | |||||
| <!-- TODO: Update blank fragment layout --> | |||||
| <TextView | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| android:text="@string/hello_blank_fragment" /> | |||||
| </FrameLayout> | |||||
| @@ -184,30 +184,15 @@ | |||||
| <TextView | <TextView | ||||
| style="@style/table_header" | style="@style/table_header" | ||||
| android:layout_weight="0.6" | |||||
| android:layout_weight="1" | |||||
| android:paddingStart="@dimen/dp_40" | android:paddingStart="@dimen/dp_40" | ||||
| android:text="姓名" /> | android:text="姓名" /> | ||||
| <TextView | |||||
| style="@style/table_header" | |||||
| android:layout_weight="0.6" | |||||
| android:text="人脸" /> | |||||
| <TextView | |||||
| style="@style/table_header" | |||||
| android:layout_weight="1" | |||||
| android:text="健康码" /> | |||||
| <TextView | |||||
| style="@style/table_header" | |||||
| android:layout_weight="1" | |||||
| android:text="行程码" /> | |||||
| <TextView | |||||
| style="@style/table_header" | |||||
| android:layout_weight="1.5" | |||||
| android:text="核酸报告" /> | |||||
| <!-- <TextView--> | |||||
| <!-- style="@style/table_header"--> | |||||
| <!-- android:layout_weight="0.6"--> | |||||
| <!-- android:paddingStart="@dimen/dp_40"--> | |||||
| <!-- android:text="姓名" />--> | |||||
| <TextView | <TextView | ||||
| style="@style/table_header" | style="@style/table_header" | ||||
| @@ -223,7 +208,10 @@ | |||||
| style="@style/table_header" | style="@style/table_header" | ||||
| android:layout_weight="1" | android:layout_weight="1" | ||||
| android:text="状态" /> | android:text="状态" /> | ||||
| <TextView | |||||
| style="@style/table_header" | |||||
| android:layout_weight="1.5" | |||||
| android:text="可进出时间" /> | |||||
| <TextView | <TextView | ||||
| style="@style/table_header" | style="@style/table_header" | ||||
| android:layout_weight="1" | android:layout_weight="1" | ||||
| @@ -12,155 +12,22 @@ | |||||
| android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
| android:gravity="center_vertical" | android:gravity="center_vertical" | ||||
| android:orientation="horizontal" | android:orientation="horizontal" | ||||
| android:paddingTop="@dimen/d_12" | |||||
| android:paddingBottom="@dimen/d_12"> | |||||
| android:paddingTop="@dimen/d_20" | |||||
| android:paddingBottom="@dimen/d_20"> | |||||
| <TextView | <TextView | ||||
| android:id="@+id/userName" | android:id="@+id/userName" | ||||
| style="@style/table_cell" | style="@style/table_cell" | ||||
| android:layout_weight="0.6" | |||||
| android:layout_weight="1" | |||||
| android:paddingStart="@dimen/dp_40" | android:paddingStart="@dimen/dp_40" | ||||
| android:text="请假学生" /> | android:text="请假学生" /> | ||||
| <FrameLayout | |||||
| style="@style/table_cell" | |||||
| android:layout_weight="0.6"> | |||||
| <com.qmuiteam.qmui.widget.QMUIRadiusImageView | |||||
| android:id="@+id/faceImg" | |||||
| android:layout_width="@dimen/d_70" | |||||
| android:layout_height="@dimen/d_70" | |||||
| app:qmui_border_color="@color/white" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/faceEmpty" | |||||
| android:layout_width="@dimen/d_70" | |||||
| android:layout_height="@dimen/d_70" | |||||
| android:paddingTop="@dimen/d_5" | |||||
| android:paddingBottom="@dimen/d_5" | |||||
| android:text="未设置" | |||||
| android:textColor="@color/white" | |||||
| app:qmui_backgroundColor="#ccc" | |||||
| app:qmui_borderColor="#ccc" | |||||
| app:qmui_radius="@dimen/d_5" /> | |||||
| </FrameLayout> | |||||
| <FrameLayout | |||||
| style="@style/table_cell" | |||||
| android:layout_weight="1"> | |||||
| <LinearLayout | |||||
| android:id="@+id/healthCodeStatusLayout" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:orientation="vertical"> | |||||
| <TextView | |||||
| android:id="@+id/healthCodeStatus" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:text="状态:绿码" | |||||
| android:textSize="@dimen/d_20"/> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:text="成都大数据中心提供" | |||||
| android:textColor="@color/gray_1" | |||||
| android:textSize="@dimen/d_15"/> | |||||
| </LinearLayout> | |||||
| <com.qmuiteam.qmui.widget.QMUIRadiusImageView | |||||
| android:id="@+id/healthCodeImg" | |||||
| android:layout_width="@dimen/d_70" | |||||
| android:layout_height="@dimen/d_70" | |||||
| app:qmui_border_color="@color/white" | |||||
| app:qmui_corner_radius="@dimen/d_5" | |||||
| android:visibility="gone"/> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/healthCodeEmpty" | |||||
| android:layout_width="@dimen/d_70" | |||||
| android:layout_height="@dimen/d_70" | |||||
| android:paddingTop="@dimen/d_5" | |||||
| android:paddingBottom="@dimen/d_5" | |||||
| android:text="未上传" | |||||
| android:textColor="@color/white" | |||||
| app:qmui_backgroundColor="#ccc" | |||||
| app:qmui_borderColor="#ccc" | |||||
| app:qmui_radius="@dimen/d_5" | |||||
| android:visibility="gone"/> | |||||
| </FrameLayout> | |||||
| <FrameLayout | |||||
| style="@style/table_cell" | |||||
| android:layout_weight="1"> | |||||
| <com.qmuiteam.qmui.widget.QMUIRadiusImageView | |||||
| android:id="@+id/tripCodeImg" | |||||
| android:layout_width="@dimen/d_70" | |||||
| android:layout_height="@dimen/d_70" | |||||
| app:qmui_border_color="@color/white" | |||||
| app:qmui_corner_radius="@dimen/d_5" /> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/tripCodeEmpty" | |||||
| android:layout_width="@dimen/d_70" | |||||
| android:layout_height="@dimen/d_70" | |||||
| android:paddingTop="@dimen/d_5" | |||||
| android:paddingBottom="@dimen/d_5" | |||||
| android:text="未上传" | |||||
| android:textColor="@color/white" | |||||
| app:qmui_backgroundColor="#ccc" | |||||
| app:qmui_borderColor="#ccc" | |||||
| app:qmui_radius="@dimen/d_5" /> | |||||
| </FrameLayout> | |||||
| <FrameLayout | |||||
| style="@style/table_cell" | |||||
| android:layout_weight="1.5"> | |||||
| <com.qmuiteam.qmui.widget.QMUIRadiusImageView | |||||
| android:id="@+id/nucleinImg" | |||||
| android:layout_width="@dimen/d_70" | |||||
| android:layout_height="@dimen/d_70" | |||||
| app:qmui_border_color="@color/white" | |||||
| app:qmui_corner_radius="@dimen/d_5" | |||||
| android:visibility="gone"/> | |||||
| <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton | |||||
| android:id="@+id/nucleinEmpty" | |||||
| android:layout_width="@dimen/d_70" | |||||
| android:layout_height="@dimen/d_70" | |||||
| android:paddingTop="@dimen/d_5" | |||||
| android:paddingBottom="@dimen/d_5" | |||||
| android:text="未上传" | |||||
| android:textColor="@color/white" | |||||
| app:qmui_backgroundColor="#ccc" | |||||
| app:qmui_borderColor="#ccc" | |||||
| app:qmui_radius="@dimen/d_5" | |||||
| android:visibility="visible"/> | |||||
| <LinearLayout | |||||
| android:id="@+id/nucleinStatusLayout" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="vertical" | |||||
| android:gravity="center_vertical" | |||||
| android:layout_gravity="center_vertical" | |||||
| android:layout_marginStart="@dimen/d_80"> | |||||
| <TextView | |||||
| android:id="@+id/nucleinStatus" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:text="状态:绿码" | |||||
| android:textSize="@dimen/d_20"/> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:text="成都大数据中心提供" | |||||
| android:textColor="@color/gray_1" | |||||
| android:textSize="@dimen/d_15"/> | |||||
| </LinearLayout> | |||||
| </FrameLayout> | |||||
| <!-- <TextView--> | |||||
| <!-- android:id="@+id/userTypeName"--> | |||||
| <!-- style="@style/table_cell"--> | |||||
| <!-- android:layout_weight="0.6"--> | |||||
| <!-- android:paddingStart="@dimen/dp_40"--> | |||||
| <!-- android:text="请假学生" />--> | |||||
| <TextView | <TextView | ||||
| android:id="@+id/isDrive" | android:id="@+id/isDrive" | ||||
| @@ -179,6 +46,11 @@ | |||||
| style="@style/table_cell" | style="@style/table_cell" | ||||
| android:layout_weight="1" | android:layout_weight="1" | ||||
| android:text="状态" /> | android:text="状态" /> | ||||
| <TextView | |||||
| android:id="@+id/inOutTime" | |||||
| style="@style/table_cell" | |||||
| android:layout_weight="1.5" | |||||
| android:text="申请时间" /> | |||||
| <TextView | <TextView | ||||
| android:id="@+id/applyTime" | android:id="@+id/applyTime" | ||||
| style="@style/table_cell" | style="@style/table_cell" | ||||
| @@ -3,7 +3,7 @@ | |||||
| <color name="colorPrimary">#3ca0e9</color> | <color name="colorPrimary">#3ca0e9</color> | ||||
| <color name="colorPrimary88">#883ca0e9</color> | <color name="colorPrimary88">#883ca0e9</color> | ||||
| <color name="colorPrimaryDark">#00574B</color> | <color name="colorPrimaryDark">#00574B</color> | ||||
| <color name="colorAccent">#D81B60</color> | |||||
| <color name="colorAccent">#3ca0e9</color> | |||||
| <color name="white">#FFFFFF</color> | <color name="white">#FFFFFF</color> | ||||
| <color name="black">#000000</color> | <color name="black">#000000</color> | ||||
| <color name="colorBlack10">#19000000</color> | <color name="colorBlack10">#19000000</color> | ||||
| @@ -25,6 +25,7 @@ | |||||
| <color name="green2">#53a051</color> | <color name="green2">#53a051</color> | ||||
| <color name="blue">#4d92dc</color> | <color name="blue">#4d92dc</color> | ||||
| <color name="blue2">#3ca0e9</color> | <color name="blue2">#3ca0e9</color> | ||||
| <color name="blue3">#aa3ca0e9</color> | |||||
| <color name="orange">#ff8635</color> | <color name="orange">#ff8635</color> | ||||
| <color name="transparent">@android:color/transparent</color> | <color name="transparent">@android:color/transparent</color> | ||||
| <color name="nb.theme.background">@color/white</color> | <color name="nb.theme.background">@color/white</color> | ||||
| @@ -2,4 +2,5 @@ | |||||
| <resources> | <resources> | ||||
| <item type="id" name="tag_dialog_name"/> | <item type="id" name="tag_dialog_name"/> | ||||
| <item type="id" name="tag_dialog_type"/> | <item type="id" name="tag_dialog_type"/> | ||||
| <item type="id" name="image_src_tag"/> | |||||
| </resources> | </resources> | ||||
| @@ -2,4 +2,6 @@ | |||||
| <string name="app_name">一体化平台</string> | <string name="app_name">一体化平台</string> | ||||
| <string name="update_title">检测到新版本</string> | <string name="update_title">检测到新版本</string> | ||||
| <string name="updatecontent">解决了若干bug</string> | <string name="updatecontent">解决了若干bug</string> | ||||
| <!-- TODO: Remove or change this placeholder text --> | |||||
| <string name="hello_blank_fragment">Hello blank fragment</string> | |||||
| </resources> | </resources> | ||||
| @@ -1,6 +1,5 @@ | |||||
| #Wed May 06 13:56:55 CST 2020 | |||||
| distributionBase=GRADLE_USER_HOME | distributionBase=GRADLE_USER_HOME | ||||
| distributionPath=wrapper/dists | distributionPath=wrapper/dists | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip | |||||
| zipStoreBase=GRADLE_USER_HOME | zipStoreBase=GRADLE_USER_HOME | ||||
| zipStorePath=wrapper/dists | zipStorePath=wrapper/dists | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip | |||||
| @@ -1,78 +1,129 @@ | |||||
| #!/usr/bin/env sh | |||||
| #!/bin/sh | |||||
| # | |||||
| # Copyright ? 2015-2021 the original authors. | |||||
| # | |||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| # you may not use this file except in compliance with the License. | |||||
| # You may obtain a copy of the License at | |||||
| # | |||||
| # https://www.apache.org/licenses/LICENSE-2.0 | |||||
| # | |||||
| # Unless required by applicable law or agreed to in writing, software | |||||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| # See the License for the specific language governing permissions and | |||||
| # limitations under the License. | |||||
| # | |||||
| ############################################################################## | ############################################################################## | ||||
| ## | |||||
| ## Gradle start up script for UN*X | |||||
| ## | |||||
| # | |||||
| # Gradle start up script for POSIX generated by Gradle. | |||||
| # | |||||
| # Important for running: | |||||
| # | |||||
| # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is | |||||
| # noncompliant, but you have some other compliant shell such as ksh or | |||||
| # bash, then to run this script, type that shell name before the whole | |||||
| # command line, like: | |||||
| # | |||||
| # ksh Gradle | |||||
| # | |||||
| # Busybox and similar reduced shells will NOT work, because this script | |||||
| # requires all of these POSIX shell features: | |||||
| # * functions; | |||||
| # * expansions ?$var?, ?${var}?, ?${var:-default}?, ?${var+SET}?, | |||||
| # ?${var#prefix}?, ?${var%suffix}?, and ?$( cmd )?; | |||||
| # * compound commands having a testable exit status, especially ?case?; | |||||
| # * various built-in commands including ?command?, ?set?, and ?ulimit?. | |||||
| # | |||||
| # Important for patching: | |||||
| # | |||||
| # (2) This script targets any POSIX shell, so it avoids extensions provided | |||||
| # by Bash, Ksh, etc; in particular arrays are avoided. | |||||
| # | |||||
| # The "traditional" practice of packing multiple parameters into a | |||||
| # space-separated string is a well documented source of bugs and security | |||||
| # problems, so this is (mostly) avoided, by progressively accumulating | |||||
| # options in "$@", and eventually passing that to Java. | |||||
| # | |||||
| # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, | |||||
| # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; | |||||
| # see the in-line comments for details. | |||||
| # | |||||
| # There are tweaks for specific operating systems such as AIX, CygWin, | |||||
| # Darwin, MinGW, and NonStop. | |||||
| # | |||||
| # (3) This script is generated from the Groovy template | |||||
| # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt | |||||
| # within the Gradle project. | |||||
| # | |||||
| # You can find Gradle at https://github.com/gradle/gradle/. | |||||
| # | |||||
| ############################################################################## | ############################################################################## | ||||
| # Attempt to set APP_HOME | # Attempt to set APP_HOME | ||||
| # Resolve links: $0 may be a link | # Resolve links: $0 may be a link | ||||
| PRG="$0" | |||||
| # Need this for relative symlinks. | |||||
| while [ -h "$PRG" ] ; do | |||||
| ls=`ls -ld "$PRG"` | |||||
| link=`expr "$ls" : '.*-> \(.*\)$'` | |||||
| if expr "$link" : '/.*' > /dev/null; then | |||||
| PRG="$link" | |||||
| else | |||||
| PRG=`dirname "$PRG"`"/$link" | |||||
| fi | |||||
| app_path=$0 | |||||
| # Need this for daisy-chained symlinks. | |||||
| while | |||||
| APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path | |||||
| [ -h "$app_path" ] | |||||
| do | |||||
| ls=$( ls -ld "$app_path" ) | |||||
| link=${ls#*' -> '} | |||||
| case $link in #( | |||||
| /*) app_path=$link ;; #( | |||||
| *) app_path=$APP_HOME$link ;; | |||||
| esac | |||||
| done | done | ||||
| SAVED="`pwd`" | |||||
| cd "`dirname \"$PRG\"`/" >/dev/null | |||||
| APP_HOME="`pwd -P`" | |||||
| cd "$SAVED" >/dev/null | |||||
| APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit | |||||
| APP_NAME="Gradle" | APP_NAME="Gradle" | ||||
| APP_BASE_NAME=`basename "$0"` | |||||
| APP_BASE_NAME=${0##*/} | |||||
| # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||||
| DEFAULT_JVM_OPTS="" | |||||
| DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' | |||||
| # Use the maximum available, or set MAX_FD != -1 to use that value. | # Use the maximum available, or set MAX_FD != -1 to use that value. | ||||
| MAX_FD="maximum" | |||||
| MAX_FD=maximum | |||||
| warn () { | warn () { | ||||
| echo "$*" | echo "$*" | ||||
| } | |||||
| } >&2 | |||||
| die () { | die () { | ||||
| echo | echo | ||||
| echo "$*" | echo "$*" | ||||
| echo | echo | ||||
| exit 1 | exit 1 | ||||
| } | |||||
| } >&2 | |||||
| # OS specific support (must be 'true' or 'false'). | # OS specific support (must be 'true' or 'false'). | ||||
| cygwin=false | cygwin=false | ||||
| msys=false | msys=false | ||||
| darwin=false | darwin=false | ||||
| nonstop=false | nonstop=false | ||||
| case "`uname`" in | |||||
| CYGWIN* ) | |||||
| cygwin=true | |||||
| ;; | |||||
| Darwin* ) | |||||
| darwin=true | |||||
| ;; | |||||
| MINGW* ) | |||||
| msys=true | |||||
| ;; | |||||
| NONSTOP* ) | |||||
| nonstop=true | |||||
| ;; | |||||
| case "$( uname )" in #( | |||||
| CYGWIN* ) cygwin=true ;; #( | |||||
| Darwin* ) darwin=true ;; #( | |||||
| MSYS* | MINGW* ) msys=true ;; #( | |||||
| NONSTOP* ) nonstop=true ;; | |||||
| esac | esac | ||||
| CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ||||
| # Determine the Java command to use to start the JVM. | # Determine the Java command to use to start the JVM. | ||||
| if [ -n "$JAVA_HOME" ] ; then | if [ -n "$JAVA_HOME" ] ; then | ||||
| if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||||
| # IBM's JDK on AIX uses strange locations for the executables | # IBM's JDK on AIX uses strange locations for the executables | ||||
| JAVACMD="$JAVA_HOME/jre/sh/java" | |||||
| JAVACMD=$JAVA_HOME/jre/sh/java | |||||
| else | else | ||||
| JAVACMD="$JAVA_HOME/bin/java" | |||||
| JAVACMD=$JAVA_HOME/bin/java | |||||
| fi | fi | ||||
| if [ ! -x "$JAVACMD" ] ; then | if [ ! -x "$JAVACMD" ] ; then | ||||
| die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | ||||
| @@ -81,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the | |||||
| location of your Java installation." | location of your Java installation." | ||||
| fi | fi | ||||
| else | else | ||||
| JAVACMD="java" | |||||
| JAVACMD=java | |||||
| which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||||
| Please set the JAVA_HOME variable in your environment to match the | Please set the JAVA_HOME variable in your environment to match the | ||||
| @@ -89,84 +140,95 @@ location of your Java installation." | |||||
| fi | fi | ||||
| # Increase the maximum file descriptors if we can. | # Increase the maximum file descriptors if we can. | ||||
| if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | |||||
| MAX_FD_LIMIT=`ulimit -H -n` | |||||
| if [ $? -eq 0 ] ; then | |||||
| if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | |||||
| MAX_FD="$MAX_FD_LIMIT" | |||||
| fi | |||||
| ulimit -n $MAX_FD | |||||
| if [ $? -ne 0 ] ; then | |||||
| warn "Could not set maximum file descriptor limit: $MAX_FD" | |||||
| fi | |||||
| else | |||||
| warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | |||||
| fi | |||||
| if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then | |||||
| case $MAX_FD in #( | |||||
| max*) | |||||
| MAX_FD=$( ulimit -H -n ) || | |||||
| warn "Could not query maximum file descriptor limit" | |||||
| esac | |||||
| case $MAX_FD in #( | |||||
| '' | soft) :;; #( | |||||
| *) | |||||
| ulimit -n "$MAX_FD" || | |||||
| warn "Could not set maximum file descriptor limit to $MAX_FD" | |||||
| esac | |||||
| fi | fi | ||||
| # For Darwin, add options to specify how the application appears in the dock | |||||
| if $darwin; then | |||||
| GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | |||||
| fi | |||||
| # Collect all arguments for the java command, stacking in reverse order: | |||||
| # * args from the command line | |||||
| # * the main class name | |||||
| # * -classpath | |||||
| # * -D...appname settings | |||||
| # * --module-path (only if needed) | |||||
| # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. | |||||
| # For Cygwin or MSYS, switch paths to Windows format before running java | |||||
| if "$cygwin" || "$msys" ; then | |||||
| APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) | |||||
| CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) | |||||
| JAVACMD=$( cygpath --unix "$JAVACMD" ) | |||||
| # For Cygwin, switch paths to Windows format before running java | |||||
| if $cygwin ; then | |||||
| APP_HOME=`cygpath --path --mixed "$APP_HOME"` | |||||
| CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | |||||
| JAVACMD=`cygpath --unix "$JAVACMD"` | |||||
| # We build the pattern for arguments to be converted via cygpath | |||||
| ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | |||||
| SEP="" | |||||
| for dir in $ROOTDIRSRAW ; do | |||||
| ROOTDIRS="$ROOTDIRS$SEP$dir" | |||||
| SEP="|" | |||||
| done | |||||
| OURCYGPATTERN="(^($ROOTDIRS))" | |||||
| # Add a user-defined pattern to the cygpath arguments | |||||
| if [ "$GRADLE_CYGPATTERN" != "" ] ; then | |||||
| OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | |||||
| fi | |||||
| # Now convert the arguments - kludge to limit ourselves to /bin/sh | # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||||
| i=0 | |||||
| for arg in "$@" ; do | |||||
| CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | |||||
| CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | |||||
| if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | |||||
| eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | |||||
| else | |||||
| eval `echo args$i`="\"$arg\"" | |||||
| for arg do | |||||
| if | |||||
| case $arg in #( | |||||
| -*) false ;; # don't mess with options #( | |||||
| /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath | |||||
| [ -e "$t" ] ;; #( | |||||
| *) false ;; | |||||
| esac | |||||
| then | |||||
| arg=$( cygpath --path --ignore --mixed "$arg" ) | |||||
| fi | fi | ||||
| i=$((i+1)) | |||||
| # Roll the args list around exactly as many times as the number of | |||||
| # args, so each arg winds up back in the position where it started, but | |||||
| # possibly modified. | |||||
| # | |||||
| # NB: a `for` loop captures its iteration list before it begins, so | |||||
| # changing the positional parameters here affects neither the number of | |||||
| # iterations, nor the values presented in `arg`. | |||||
| shift # remove old arg | |||||
| set -- "$@" "$arg" # push replacement arg | |||||
| done | done | ||||
| case $i in | |||||
| (0) set -- ;; | |||||
| (1) set -- "$args0" ;; | |||||
| (2) set -- "$args0" "$args1" ;; | |||||
| (3) set -- "$args0" "$args1" "$args2" ;; | |||||
| (4) set -- "$args0" "$args1" "$args2" "$args3" ;; | |||||
| (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | |||||
| (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | |||||
| (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | |||||
| (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | |||||
| (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | |||||
| esac | |||||
| fi | fi | ||||
| # Escape application args | |||||
| save () { | |||||
| for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | |||||
| echo " " | |||||
| } | |||||
| APP_ARGS=$(save "$@") | |||||
| # Collect all arguments for the java command, following the shell quoting and substitution rules | |||||
| eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" | |||||
| # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong | |||||
| if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then | |||||
| cd "$(dirname "$0")" | |||||
| fi | |||||
| # Collect all arguments for the java command; | |||||
| # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of | |||||
| # shell script including quotes and variable substitutions, so put them in | |||||
| # double quotes to make sure that they get re-expanded; and | |||||
| # * put everything else in single quotes, so that it's not re-expanded. | |||||
| set -- \ | |||||
| "-Dorg.gradle.appname=$APP_BASE_NAME" \ | |||||
| -classpath "$CLASSPATH" \ | |||||
| org.gradle.wrapper.GradleWrapperMain \ | |||||
| "$@" | |||||
| # Use "xargs" to parse quoted args. | |||||
| # | |||||
| # With -n1 it outputs one arg per line, with the quotes and backslashes removed. | |||||
| # | |||||
| # In Bash we could simply go: | |||||
| # | |||||
| # readarray ARGS < <( xargs -n1 <<<"$var" ) && | |||||
| # set -- "${ARGS[@]}" "$@" | |||||
| # | |||||
| # but POSIX shell has neither arrays nor command substitution, so instead we | |||||
| # post-process each arg (as a line of input to sed) to backslash-escape any | |||||
| # character that might be a shell metacharacter, then use eval to reverse | |||||
| # that process (while maintaining the separation between arguments), and wrap | |||||
| # the whole thing up as a single "set" statement. | |||||
| # | |||||
| # This will of course break if any of these variables contains a newline or | |||||
| # an unmatched quote. | |||||
| # | |||||
| eval "set -- $( | |||||
| printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | | |||||
| xargs -n1 | | |||||
| sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | | |||||
| tr '\n' ' ' | |||||
| )" '"$@"' | |||||
| exec "$JAVACMD" "$@" | exec "$JAVACMD" "$@" | ||||
| @@ -1,3 +1,19 @@ | |||||
| @rem | |||||
| @rem Copyright 2015 the original author or authors. | |||||
| @rem | |||||
| @rem Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| @rem you may not use this file except in compliance with the License. | |||||
| @rem You may obtain a copy of the License at | |||||
| @rem | |||||
| @rem https://www.apache.org/licenses/LICENSE-2.0 | |||||
| @rem | |||||
| @rem Unless required by applicable law or agreed to in writing, software | |||||
| @rem distributed under the License is distributed on an "AS IS" BASIS, | |||||
| @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| @rem See the License for the specific language governing permissions and | |||||
| @rem limitations under the License. | |||||
| @rem | |||||
| @if "%DEBUG%" == "" @echo off | @if "%DEBUG%" == "" @echo off | ||||
| @rem ########################################################################## | @rem ########################################################################## | ||||
| @rem | @rem | ||||
| @@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=. | |||||
| set APP_BASE_NAME=%~n0 | set APP_BASE_NAME=%~n0 | ||||
| set APP_HOME=%DIRNAME% | set APP_HOME=%DIRNAME% | ||||
| @rem Resolve any "." and ".." in APP_HOME to make it shorter. | |||||
| for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi | |||||
| @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||||
| set DEFAULT_JVM_OPTS= | |||||
| set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" | |||||
| @rem Find java.exe | @rem Find java.exe | ||||
| if defined JAVA_HOME goto findJavaFromJavaHome | if defined JAVA_HOME goto findJavaFromJavaHome | ||||
| set JAVA_EXE=java.exe | set JAVA_EXE=java.exe | ||||
| %JAVA_EXE% -version >NUL 2>&1 | %JAVA_EXE% -version >NUL 2>&1 | ||||
| if "%ERRORLEVEL%" == "0" goto init | |||||
| if "%ERRORLEVEL%" == "0" goto execute | |||||
| echo. | echo. | ||||
| echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||||
| @@ -35,7 +54,7 @@ goto fail | |||||
| set JAVA_HOME=%JAVA_HOME:"=% | set JAVA_HOME=%JAVA_HOME:"=% | ||||
| set JAVA_EXE=%JAVA_HOME%/bin/java.exe | set JAVA_EXE=%JAVA_HOME%/bin/java.exe | ||||
| if exist "%JAVA_EXE%" goto init | |||||
| if exist "%JAVA_EXE%" goto execute | |||||
| echo. | echo. | ||||
| echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | ||||
| @@ -45,28 +64,14 @@ echo location of your Java installation. | |||||
| goto fail | goto fail | ||||
| :init | |||||
| @rem Get command-line arguments, handling Windows variants | |||||
| if not "%OS%" == "Windows_NT" goto win9xME_args | |||||
| :win9xME_args | |||||
| @rem Slurp the command line arguments. | |||||
| set CMD_LINE_ARGS= | |||||
| set _SKIP=2 | |||||
| :win9xME_args_slurp | |||||
| if "x%~1" == "x" goto execute | |||||
| set CMD_LINE_ARGS=%* | |||||
| :execute | :execute | ||||
| @rem Setup the command line | @rem Setup the command line | ||||
| set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | ||||
| @rem Execute Gradle | @rem Execute Gradle | ||||
| "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% | |||||
| "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* | |||||
| :end | :end | ||||
| @rem End local scope for the variables with windows NT shell | @rem End local scope for the variables with windows NT shell | ||||