fix 活动功能的绑定账号
This commit is contained in:
parent
400ac6943e
commit
1618540d17
|
|
@ -33,9 +33,11 @@ import com.yingmao.clash.net.http.HttpReqType
|
|||
import com.yingmao.clash.net.http.HttpStatus
|
||||
import com.yingmao.clash.net.http.entity.Activity_
|
||||
import com.yingmao.clash.net.http.entity.GetActivityRsp
|
||||
import com.yingmao.clash.util.CommonUtils
|
||||
|
||||
import com.yingmao.clash.view.RxToast
|
||||
import com.yingmao.clash.view.adapter.GetActivityAdapter
|
||||
import com.yingmao.clash.view.dialog.DialogBandChoose
|
||||
|
||||
class ActivityActivity : BaseActivity() {
|
||||
private lateinit var activityAtyVM: ActivityAtyVM
|
||||
|
|
@ -72,8 +74,14 @@ class ActivityActivity : BaseActivity() {
|
|||
getActivityAdapter =
|
||||
GetActivityAdapter(R.layout.get_activity_item_layout, object : MyAdapterListener {
|
||||
override fun onMyItemChildClickListener(itemBean: Activity_) {
|
||||
if (itemBean.redirectLink.contains("BindAccount")) {
|
||||
|
||||
showBindAccDialog(itemBean)
|
||||
} else {
|
||||
|
||||
showActDialog(itemBean)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
getActivityAdapter.animationEnable = true
|
||||
|
|
@ -83,9 +91,9 @@ class ActivityActivity : BaseActivity() {
|
|||
|
||||
private fun showActDialog(bean: Activity_) {
|
||||
var command = MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_VPN_UserCommand, "")!!
|
||||
if (TextUtils.isEmpty(command)){
|
||||
command=NewMainActivity.userCommand!!
|
||||
}
|
||||
// if (TextUtils.isEmpty(command)){
|
||||
// command= MainApplication.getUserInfo()?.userCommand!!
|
||||
// }
|
||||
command = "领会员${command}"
|
||||
copyToClipboard(command)
|
||||
var act_dialog = MaterialDialog(this@ActivityActivity).show {
|
||||
|
|
@ -113,16 +121,31 @@ class ActivityActivity : BaseActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun checkExpire(): Boolean {
|
||||
val validPeriod = MMKV.defaultMMKV().decodeLong(BZYConstants.MMKV_KEY_VPN_VALID_PERIOD)
|
||||
if (validPeriod > 0) {
|
||||
var nowTime = System.currentTimeMillis();
|
||||
com.yingmao.clash.common.log.Log.d("validPeriod==>$validPeriod, nowTime==>$nowTime")
|
||||
if (validPeriod >= nowTime) {
|
||||
return false
|
||||
private fun showBindAccDialog(bean: Activity_) {
|
||||
|
||||
var act_dialog = MaterialDialog(this@ActivityActivity).show {
|
||||
this.cancelable(false)
|
||||
cornerRadius(res = R.dimen.dp_10)
|
||||
customView(
|
||||
R.layout.act_dialog_layout,
|
||||
scrollable = false,
|
||||
noVerticalPadding = true,
|
||||
horizontalPadding = false
|
||||
)
|
||||
val finshBut = getCustomView().findViewById<TextView>(R.id.tv_pay_finish)
|
||||
finshBut.text = "绑定";
|
||||
finshBut.setOnClickListener {
|
||||
showBingDialogChoose()
|
||||
dismiss()
|
||||
}
|
||||
getCustomView().findViewById<TextView>(R.id.tv_pay_cancle).setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
getCustomView().findViewById<TextView>(R.id.act_dia_title).text = bean.title
|
||||
getCustomView().findViewById<TextView>(R.id.tv_act_info).text = bean.content
|
||||
getCustomView().findViewById<TextView>(R.id.tv_act_tz).visibility=View.GONE
|
||||
getCustomView().findViewById<TextView>(R.id.tv_act_com).visibility=View.GONE
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private fun goLink(url: String) {
|
||||
|
|
@ -172,6 +195,18 @@ class ActivityActivity : BaseActivity() {
|
|||
activityAtyVM.getActivity(mPageInfo)
|
||||
}
|
||||
|
||||
private fun showBingDialogChoose() {
|
||||
val dialog = DialogBandChoose(this@ActivityActivity)
|
||||
dialog.setOnBandClickListener(object : DialogBandChoose.OnBandClickListener {
|
||||
override fun onBandClick(isPhone: Boolean) {
|
||||
val intent = Intent(CommonUtils.getApp(), BandPhoneActivity::class.java)
|
||||
intent.putExtra("isPhone", isPhone)
|
||||
startActivity(intent)
|
||||
}
|
||||
})
|
||||
dialog.show()
|
||||
}
|
||||
|
||||
override fun httpLoading(httpStatus: HttpStatus.Loading) {
|
||||
if (httpStatus.reqType == HttpReqType.GetActivity) {
|
||||
if (mPageInfo.isFirstPage) {
|
||||
|
|
@ -228,7 +263,7 @@ class ActivityActivity : BaseActivity() {
|
|||
if (mPageInfo.isFirstPage) {
|
||||
swipeLayout.isRefreshing = true
|
||||
}
|
||||
RxToast.error("获取订单信息异常")
|
||||
RxToast.error("获取活动信息异常")
|
||||
getActivityAdapter.loadMoreModule.loadMoreFail()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ subprojects {
|
|||
minSdk = 21
|
||||
//noinspection ExpiredTargetSdkVersion
|
||||
targetSdk = 31
|
||||
versionName = "1.0.1.0"
|
||||
versionCode = 1010
|
||||
versionName = "1.0.1.1"
|
||||
versionCode = 1011
|
||||
resValue("string", "release_name", "v$versionName")
|
||||
resValue("integer", "release_code", "$versionCode")
|
||||
externalNativeBuild {
|
||||
|
|
@ -284,6 +284,26 @@ subprojects {
|
|||
)
|
||||
)
|
||||
}
|
||||
|
||||
create("6507") {
|
||||
isDefault = true
|
||||
dimension = flavorDimensionList[0]
|
||||
buildConfigField("boolean", "PREMIUM", "Boolean.parseBoolean(\"false\")")
|
||||
if (isApp) {
|
||||
// applicationIdSuffix = ".meta"
|
||||
}
|
||||
buildConfigField("boolean", "is_back_cn", "false")
|
||||
buildConfigField("boolean", "is_ym", "true")
|
||||
buildConfigField("boolean", "is_free", "false")
|
||||
buildConfigField("String", "applicationId", "\"com.yingmao.clash\"")
|
||||
buildConfigField("String", "service_url", "\"https://api.yingmaovpnpro.win:18002\"")
|
||||
buildConfigField("String", "productId", "\"6507\"")
|
||||
manifestPlaceholders(
|
||||
mapOf(
|
||||
"APP_NAME" to "@string/app_name_gz", "APP_ICON" to "@mipmap/ic_logo_9972"
|
||||
)
|
||||
)
|
||||
}
|
||||
create("182242") {
|
||||
isDefault = true
|
||||
dimension = flavorDimensionList[0]
|
||||
|
|
|
|||
Loading…
Reference in New Issue