| @@ -13,4 +13,5 @@ | |||||
| .externalNativeBuild | .externalNativeBuild | ||||
| .cxx | .cxx | ||||
| /app/debug | /app/debug | ||||
| /app/release | |||||
| /app/release | |||||
| /app/cszxy | |||||
| @@ -19,13 +19,13 @@ android { | |||||
| // minSdkVersion 26 | // minSdkVersion 26 | ||||
| minSdkVersion 21 | minSdkVersion 21 | ||||
| targetSdkVersion 25 | targetSdkVersion 25 | ||||
| versionCode 30009 | |||||
| versionName "3.0.9" | |||||
| versionCode 30010 | |||||
| versionName "3.0.10" | |||||
| testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||||
| // ndk { | |||||
| // abiFilters "armeabi-v7a", "arm64-v8a", "x86" | |||||
| // } | |||||
| ndk { | |||||
| abiFilters "armeabi-v7a", "arm64-v8a", "x86" | |||||
| } | |||||
| } | } | ||||
| signingConfigs { | signingConfigs { | ||||
| yzx { | yzx { | ||||
| @@ -114,7 +114,7 @@ android { | |||||
| buildConfigField "String", "WS_URL", '"wss://oa.live.educlouddata.com/ws2api/"' | buildConfigField "String", "WS_URL", '"wss://oa.live.educlouddata.com/ws2api/"' | ||||
| applicationIdSuffix ".live" | applicationIdSuffix ".live" | ||||
| buildConfigField "String", "MP_ID",'"2"' | buildConfigField "String", "MP_ID",'"2"' | ||||
| buildConfigField "String", "ENV_NAME",'"qbj"' | |||||
| buildConfigField "String", "ENV_NAME",'"kz"' | |||||
| } | } | ||||
| yzx_test { | yzx_test { | ||||
| @@ -13,6 +13,7 @@ import com.qmuiteam.qmui.widget.dialog.QMUITipDialog.Builder.ICON_TYPE_FAIL | |||||
| import com.yzx.escreen.MainActivity | import com.yzx.escreen.MainActivity | ||||
| import com.yzx.escreen.R | import com.yzx.escreen.R | ||||
| import com.yzx.escreen.activity.base.BaseActivity | import com.yzx.escreen.activity.base.BaseActivity | ||||
| import com.yzx.escreen.config.Config | |||||
| import com.yzx.escreen.model.BaseUser | import com.yzx.escreen.model.BaseUser | ||||
| import com.yzx.escreen.model.TabEntity | import com.yzx.escreen.model.TabEntity | ||||
| import com.yzx.escreen.model.User | import com.yzx.escreen.model.User | ||||
| @@ -22,6 +23,8 @@ import com.yzx.escreen.utils.hideNavigationBar | |||||
| import com.yzx.escreen.utils.setSrc | import com.yzx.escreen.utils.setSrc | ||||
| import kotlinx.android.synthetic.main.activity_login.accountEdit | import kotlinx.android.synthetic.main.activity_login.accountEdit | ||||
| import kotlinx.android.synthetic.main.activity_login.accountLayout | import kotlinx.android.synthetic.main.activity_login.accountLayout | ||||
| import kotlinx.android.synthetic.main.activity_login.img1 | |||||
| import kotlinx.android.synthetic.main.activity_login.img2 | |||||
| import kotlinx.android.synthetic.main.activity_login.loginBtn | import kotlinx.android.synthetic.main.activity_login.loginBtn | ||||
| import kotlinx.android.synthetic.main.activity_login.pswCheckbox | import kotlinx.android.synthetic.main.activity_login.pswCheckbox | ||||
| import kotlinx.android.synthetic.main.activity_login.pswEdit | import kotlinx.android.synthetic.main.activity_login.pswEdit | ||||
| @@ -88,6 +91,10 @@ class LoginActivity : BaseActivity<LoginPresenter>(), LoginView { | |||||
| } else { | } else { | ||||
| pswCheckbox.isChecked = false | pswCheckbox.isChecked = false | ||||
| } | } | ||||
| var env = Config.getEvn() | |||||
| img1.setSrc(env.LOGO) | |||||
| img2.setSrc(env.APP_NAME) | |||||
| } | } | ||||
| private fun doLogin() { | private fun doLogin() { | ||||
| @@ -14,6 +14,51 @@ object Config { | |||||
| var ENV_NAME = BuildConfig.ENV_NAME | var ENV_NAME = BuildConfig.ENV_NAME | ||||
| val APP_ID = 602 | val APP_ID = 602 | ||||
| fun getEvn(): YzxEnv { | |||||
| when (ENV_NAME) { | |||||
| "qbj" -> { | |||||
| return YzxEnv( | |||||
| APP_NAME = "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/unit/app/base-logo-txt-qbj.png", | |||||
| LOGO = "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/unit/app/login-logo.png", | |||||
| ENV_NAME = ENV_NAME, | |||||
| MP_APPID = MP_APPID, | |||||
| MP_ID = MP_ID, | |||||
| WS_URL = WS_URL | |||||
| ) | |||||
| } | |||||
| "cszxy" -> { | |||||
| return YzxEnv( | |||||
| APP_NAME = "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/unit/app/base-logo-txt-cszxy.png", | |||||
| LOGO = "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/unit/app/login-logo.png", | |||||
| ENV_NAME = ENV_NAME, | |||||
| MP_APPID = MP_APPID, | |||||
| MP_ID = MP_ID, | |||||
| WS_URL = WS_URL | |||||
| ) | |||||
| } | |||||
| "kz" -> { | |||||
| return YzxEnv( | |||||
| APP_NAME = "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/unit/logo/name-kezhong.png", | |||||
| LOGO = "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/unit/logo/logo-kezhong.png", | |||||
| ENV_NAME = ENV_NAME, | |||||
| MP_APPID = MP_APPID, | |||||
| MP_ID = "101", | |||||
| WS_URL = WS_URL | |||||
| ) | |||||
| } | |||||
| else -> return YzxEnv( | |||||
| APP_NAME = "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/unit/app/base-logo-txt-qbj.png", | |||||
| LOGO = "https://oa-edu-1259243469.cos.ap-chengdu.myqcloud.com/public/unit/app/login-logo.png", | |||||
| ENV_NAME = ENV_NAME, | |||||
| MP_APPID = MP_APPID, | |||||
| MP_ID = MP_ID, | |||||
| WS_URL = WS_URL | |||||
| ) | |||||
| } | |||||
| } | |||||
| const val STU_CHANGE_STATUS_DROP_OUT = 42001 | const val STU_CHANGE_STATUS_DROP_OUT = 42001 | ||||
| const val STU_CHANGE_STATUS_LEAVE_SCHOOL = 42002 | const val STU_CHANGE_STATUS_LEAVE_SCHOOL = 42002 | ||||
| @@ -27,15 +72,24 @@ object Config { | |||||
| const val STU_CHANGE_STATUS_INTERNSHIP = 42010 | const val STU_CHANGE_STATUS_INTERNSHIP = 42010 | ||||
| val STU_CHANGE_STATUS_LIST = mutableListOf( | val STU_CHANGE_STATUS_LIST = mutableListOf( | ||||
| StuChangeType(STU_CHANGE_STATUS_DROP_OUT,"辍学",""), | |||||
| StuChangeType(STU_CHANGE_STATUS_LEAVE_SCHOOL,"休学",""), | |||||
| StuChangeType(STU_CHANGE_STATUS_RETURN_SCHOOL,"复学",""), | |||||
| StuChangeType(STU_CHANGE_STATUS_OUT_SCHOOL,"退学",""), | |||||
| StuChangeType(STU_CHANGE_STATUS_TRANSFER_SCHOOL,"转学",""), | |||||
| StuChangeType(STU_CHANGE_STATUS_REPEAT,"留级",""), | |||||
| StuChangeType(STU_CHANGE_STATUS_TRANSFER_OUT,"转出",""), | |||||
| StuChangeType(STU_CHANGE_STATUS_DOWNGRADE,"降级",""), | |||||
| StuChangeType(STU_CHANGE_STATUS_INTROSPECTION,"回家反省","反省"), | |||||
| StuChangeType(STU_CHANGE_STATUS_INTERNSHIP,"实习","反省") | |||||
| StuChangeType(STU_CHANGE_STATUS_DROP_OUT, "辍学", ""), | |||||
| StuChangeType(STU_CHANGE_STATUS_LEAVE_SCHOOL, "休学", ""), | |||||
| StuChangeType(STU_CHANGE_STATUS_RETURN_SCHOOL, "复学", ""), | |||||
| StuChangeType(STU_CHANGE_STATUS_OUT_SCHOOL, "退学", ""), | |||||
| StuChangeType(STU_CHANGE_STATUS_TRANSFER_SCHOOL, "转学", ""), | |||||
| StuChangeType(STU_CHANGE_STATUS_REPEAT, "留级", ""), | |||||
| StuChangeType(STU_CHANGE_STATUS_TRANSFER_OUT, "转出", ""), | |||||
| StuChangeType(STU_CHANGE_STATUS_DOWNGRADE, "降级", ""), | |||||
| StuChangeType(STU_CHANGE_STATUS_INTROSPECTION, "回家反省", "反省"), | |||||
| StuChangeType(STU_CHANGE_STATUS_INTERNSHIP, "实习", "反省") | |||||
| ) | ) | ||||
| } | |||||
| } | |||||
| data class YzxEnv( | |||||
| var APP_NAME: String, | |||||
| var LOGO: String, | |||||
| var ENV_NAME: String, | |||||
| var MP_APPID: String, | |||||
| var MP_ID: String, | |||||
| var WS_URL: String | |||||
| ) | |||||
| @@ -156,9 +156,10 @@ class LoginPresenter(view: LoginView) : BasePresenter<LoginView>(view) { | |||||
| fun getWXQrCode() { | fun getWXQrCode() { | ||||
| val url = Config.BASE_URL + YzxInterface.INTERFACE_GENERATE_WX_QR_TICKET | val url = Config.BASE_URL + YzxInterface.INTERFACE_GENERATE_WX_QR_TICKET | ||||
| var env = Config.getEvn() | |||||
| OkGo.post<YzxResponse<WxQrTicket>>(url) | OkGo.post<YzxResponse<WxQrTicket>>(url) | ||||
| .tag(this) | .tag(this) | ||||
| .params("mp_id", Config.MP_ID) | |||||
| .params("mp_id", env.MP_ID) | |||||
| .execute(object : JsonCallBack<YzxResponse<WxQrTicket>>() { | .execute(object : JsonCallBack<YzxResponse<WxQrTicket>>() { | ||||
| override fun onSuccess(response: Response<YzxResponse<WxQrTicket>>?) { | override fun onSuccess(response: Response<YzxResponse<WxQrTicket>>?) { | ||||
| if (response?.isSuccessful == true) { | if (response?.isSuccessful == true) { | ||||
| @@ -11,20 +11,22 @@ import java.text.SimpleDateFormat | |||||
| import java.util.TimeZone | import java.util.TimeZone | ||||
| fun ImageView.setSrc(identity: String, key: String) { | fun ImageView.setSrc(identity: String, key: String) { | ||||
| var url = "https://${identity.ifEmpty { "filea" }}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | |||||
| if(Config.ENV_NAME == 'cszxy'){ | |||||
| var url = | |||||
| "https://${identity.ifEmpty { "filea" }}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | |||||
| if ("cszxy" == Config.ENV_NAME || "kz" == Config.ENV_NAME) { | |||||
| url = "https://filea.educlouddata.com/edufile/imageView?uniqueKey=${key}" | url = "https://filea.educlouddata.com/edufile/imageView?uniqueKey=${key}" | ||||
| } | } | ||||
| Glide.with(this) | Glide.with(this) | ||||
| .load(url) | .load(url) | ||||
| .placeholder(R.color.gray_1) | .placeholder(R.color.gray_1) | ||||
| .into(this) | .into(this) | ||||
| this.setTag(R.id.image_src_tag,url) | |||||
| this.setTag(R.id.image_src_tag, url) | |||||
| } | } | ||||
| fun String.getImgUrl(key: String):String{ | |||||
| var url = "https://${this.ifEmpty { "filea" }}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | |||||
| if(Config.ENV_NAME == 'cszxy'){ | |||||
| fun String.getImgUrl(key: String): String { | |||||
| var url = | |||||
| "https://${this.ifEmpty { "filea" }}.oa.qbjjyyun.net/edufile/imageView?uniqueKey=${key}" | |||||
| if ("cszxy" == Config.ENV_NAME || "kz" == Config.ENV_NAME) { | |||||
| url = "https://filea.educlouddata.com/edufile/imageView?uniqueKey=${key}" | url = "https://filea.educlouddata.com/edufile/imageView?uniqueKey=${key}" | ||||
| } | } | ||||
| return url | return url | ||||
| @@ -37,7 +39,7 @@ fun ImageView.setSrc(url: String) { | |||||
| .into(this) | .into(this) | ||||
| } | } | ||||
| fun Int.toTime(format:String = "yyyy-MM-dd HH:mm"): String { | |||||
| fun Int.toTime(format: String = "yyyy-MM-dd HH:mm"): String { | |||||
| val format = TimeUtils.getSafeDateFormat(format) | val format = TimeUtils.getSafeDateFormat(format) | ||||
| format.timeZone = TimeZone.getTimeZone("GMT+8:00") | format.timeZone = TimeZone.getTimeZone("GMT+8:00") | ||||
| return TimeUtils.millis2String(this * 1000L, format) | return TimeUtils.millis2String(this * 1000L, format) | ||||
| @@ -60,7 +62,7 @@ fun Int.durationStr(): String { | |||||
| } else if (value > 60 * 60 && value <= 24 * 60 * 60) { | } else if (value > 60 * 60 && value <= 24 * 60 * 60) { | ||||
| var hour = value / 3600.0 | var hour = value / 3600.0 | ||||
| if (hour >= 23.5f && hour <25f) { | |||||
| if (hour >= 23.5f && hour < 25f) { | |||||
| return "1天" | return "1天" | ||||
| } | } | ||||
| @@ -69,7 +71,7 @@ fun Int.durationStr(): String { | |||||
| var day = value / (24 * 60 * 60) | var day = value / (24 * 60 * 60) | ||||
| var sub = value % (24 * 60 * 60); | var sub = value % (24 * 60 * 60); | ||||
| var hour = sub / 3600f | var hour = sub / 3600f | ||||
| if (hour >= 23.5f || hour <25f) { | |||||
| if (hour >= 23.5f || hour < 25f) { | |||||
| return "${day + 1}天" | return "${day + 1}天" | ||||
| } | } | ||||
| if (hour < 1) { | if (hour < 1) { | ||||
| @@ -79,7 +81,7 @@ fun Int.durationStr(): String { | |||||
| } | } | ||||
| } | } | ||||
| fun Dialog.hideNavigationBar(){ | |||||
| fun Dialog.hideNavigationBar() { | |||||
| val window = this.window | val window = this.window | ||||
| window?.apply { | window?.apply { | ||||
| val uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or | val uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or | ||||
| @@ -95,7 +97,7 @@ fun Dialog.hideNavigationBar(){ | |||||
| } | } | ||||
| } | } | ||||
| fun SimpleDateFormat.zhCn():SimpleDateFormat{ | |||||
| fun SimpleDateFormat.zhCn(): SimpleDateFormat { | |||||
| timeZone = TimeZone.getTimeZone("GMT+8:00") | timeZone = TimeZone.getTimeZone("GMT+8:00") | ||||
| return this | return this | ||||
| } | } | ||||
| @@ -0,0 +1,9 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
| <gradient android:angle="0" | |||||
| android:startColor="#b2CAE2FF" | |||||
| android:endColor="#b200A2FF"/> | |||||
| <corners android:radius="10dp" | |||||
| android:bottomRightRadius="0dp" | |||||
| android:topRightRadius="0dp"></corners> | |||||
| </shape> | |||||
| @@ -1,6 +1,7 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
| <corners android:radius="10dp"></corners> | |||||
| <corners android:radius="10dp" | |||||
| android:bottomLeftRadius="0dp" | |||||
| android:topLeftRadius="0dp"></corners> | |||||
| <solid android:color="@color/white"></solid> | <solid android:color="@color/white"></solid> | ||||
| <stroke android:width="@dimen/d_30" android:color="#01000000"></stroke> | |||||
| </shape> | </shape> | ||||
| @@ -11,49 +11,63 @@ | |||||
| android:src="@drawable/login_bg" | android:src="@drawable/login_bg" | ||||
| android:scaleType="centerCrop"/> | android:scaleType="centerCrop"/> | ||||
| <ScrollView | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent"> | |||||
| <!-- <ScrollView--> | |||||
| <!-- android:layout_width="match_parent"--> | |||||
| <!-- android:layout_height="match_parent">--> | |||||
| <LinearLayout | <LinearLayout | ||||
| android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
| android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
| android:layout_marginTop="200dp" | |||||
| android:layout_centerInParent="true" | |||||
| android:gravity="center"> | android:gravity="center"> | ||||
| <androidx.appcompat.widget.LinearLayoutCompat | <androidx.appcompat.widget.LinearLayoutCompat | ||||
| android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
| android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
| android:orientation="vertical"> | |||||
| android:orientation="horizontal"> | |||||
| <androidx.appcompat.widget.LinearLayoutCompat | |||||
| android:layout_width="500dp" | |||||
| android:layout_height="400dp" | |||||
| android:orientation="vertical" | |||||
| android:gravity="center" | |||||
| android:background="@drawable/bg_left"> | |||||
| <ImageView | |||||
| android:id="@+id/img1" | |||||
| android:layout_width="279dp" | |||||
| android:layout_height="179dp"/> | |||||
| <TextView | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_gravity="center_horizontal" | |||||
| android:text="------------------------ 欢迎登录 ------------------------" | |||||
| android:textColor="#fff" | |||||
| android:textSize="20dp" | |||||
| android:textStyle="normal" | |||||
| android:layout_marginTop="20dp"/> | |||||
| <ImageView | |||||
| android:id="@+id/img2" | |||||
| android:layout_width="380dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="20dp"/> | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | |||||
| <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 | <androidx.appcompat.widget.LinearLayoutCompat | ||||
| android:layout_width="500dp" | android:layout_width="500dp" | ||||
| android:layout_height="400dp" | android:layout_height="400dp" | ||||
| android:layout_gravity="center_horizontal" | android:layout_gravity="center_horizontal" | ||||
| android:layout_marginTop="@dimen/d_30" | |||||
| android:background="@drawable/shape_login_form" | android:background="@drawable/shape_login_form" | ||||
| android:orientation="vertical" | android:orientation="vertical" | ||||
| android:padding="@dimen/d_20"> | |||||
| android:gravity="center" | |||||
| android:padding="0dp"> | |||||
| <com.flyco.tablayout.CommonTabLayout | <com.flyco.tablayout.CommonTabLayout | ||||
| android:id="@+id/tabLayout" | android:id="@+id/tabLayout" | ||||
| @@ -177,5 +191,5 @@ | |||||
| </androidx.appcompat.widget.LinearLayoutCompat> | </androidx.appcompat.widget.LinearLayoutCompat> | ||||
| </androidx.appcompat.widget.LinearLayoutCompat> | </androidx.appcompat.widget.LinearLayoutCompat> | ||||
| </LinearLayout> | </LinearLayout> | ||||
| </ScrollView> | |||||
| <!-- </ScrollView>--> | |||||
| </RelativeLayout> | </RelativeLayout> | ||||