新增贵族主页
@@ -204,8 +204,7 @@ dependencies {
|
|||||||
implementation "com.llew.huawei:verifier:1.0.3"
|
implementation "com.llew.huawei:verifier:1.0.3"
|
||||||
annotationProcessor 'androidx.annotation:annotation:1.1.0'
|
annotationProcessor 'androidx.annotation:annotation:1.1.0'
|
||||||
|
|
||||||
api "com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar"
|
implementation 'io.github.h07000223:flycoTabLayout:3.0.0'
|
||||||
api "com.nex3z:flow-layout:1.2.2"
|
|
||||||
|
|
||||||
api project(':core')
|
api project(':core')
|
||||||
|
|
||||||
|
@@ -1233,6 +1233,10 @@
|
|||||||
android:name=".avroom.firstcharge.FirstChargeDialog"
|
android:name=".avroom.firstcharge.FirstChargeDialog"
|
||||||
android:theme="@style/dialogactivity" />
|
android:theme="@style/dialogactivity" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".vip.VipMainActivity"
|
||||||
|
android:screenOrientation="portrait" />
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@@ -0,0 +1,40 @@
|
|||||||
|
package com.yizhuan.erban.avroom.widget
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.Bitmap
|
||||||
|
import android.graphics.BitmapFactory
|
||||||
|
import android.graphics.Canvas
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.widget.ProgressBar
|
||||||
|
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||||
|
import com.yizhuan.erban.R
|
||||||
|
|
||||||
|
class VipProgressBar(context: Context, attrs: AttributeSet?) : ProgressBar(context, attrs) {
|
||||||
|
|
||||||
|
private var thumbBitmap: Bitmap =
|
||||||
|
BitmapFactory.decodeResource(context.resources, R.drawable.ic_vip_thumb)
|
||||||
|
private var thumbWidth: Float = thumbBitmap.width.toFloat()
|
||||||
|
private var thumbHeight: Float = thumbBitmap.height.toFloat()
|
||||||
|
private var mWidth = 0
|
||||||
|
private var mHeight = 0
|
||||||
|
private val leftPadding = ScreenUtil.dip2px(9f)
|
||||||
|
|
||||||
|
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||||
|
super.onSizeChanged(w, h, oldw, oldh)
|
||||||
|
mWidth = w
|
||||||
|
mHeight = h
|
||||||
|
}
|
||||||
|
|
||||||
|
@Synchronized
|
||||||
|
override fun onDraw(canvas: Canvas) {
|
||||||
|
super.onDraw(canvas)
|
||||||
|
val radio = progress * 1.0f / max
|
||||||
|
canvas.drawBitmap(
|
||||||
|
thumbBitmap,
|
||||||
|
(mWidth - leftPadding * 2) * radio - thumbWidth / 2f + leftPadding,
|
||||||
|
(mHeight - thumbHeight) / 2f,
|
||||||
|
null
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -16,7 +16,6 @@ import com.idlefish.flutterboost.FlutterBoost;
|
|||||||
import com.yizhuan.erban.MainActivity;
|
import com.yizhuan.erban.MainActivity;
|
||||||
import com.yizhuan.erban.R;
|
import com.yizhuan.erban.R;
|
||||||
import com.yizhuan.erban.UIHelper;
|
import com.yizhuan.erban.UIHelper;
|
||||||
import com.yizhuan.erban.avroom.dialog.CreateRoomDialog;
|
|
||||||
import com.yizhuan.erban.base.BaseFragment;
|
import com.yizhuan.erban.base.BaseFragment;
|
||||||
import com.yizhuan.erban.databinding.FragmentMeBinding;
|
import com.yizhuan.erban.databinding.FragmentMeBinding;
|
||||||
import com.yizhuan.erban.decoration.view.MyDecorationActivity;
|
import com.yizhuan.erban.decoration.view.MyDecorationActivity;
|
||||||
@@ -34,6 +33,7 @@ import com.yizhuan.erban.ui.relation.FansListActivity;
|
|||||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
||||||
import com.yizhuan.erban.ui.widget.higuide.TuTuGuideHelper;
|
import com.yizhuan.erban.ui.widget.higuide.TuTuGuideHelper;
|
||||||
|
import com.yizhuan.erban.vip.VipMainActivity;
|
||||||
import com.yizhuan.xchat_android_core.UriProvider;
|
import com.yizhuan.xchat_android_core.UriProvider;
|
||||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.HeadWearInfo;
|
import com.yizhuan.xchat_android_core.decoration.headwear.bean.HeadWearInfo;
|
||||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
||||||
@@ -42,7 +42,6 @@ import com.yizhuan.xchat_android_core.manager.RelationShipEvent;
|
|||||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
||||||
import com.yizhuan.xchat_android_core.noble.NobleProtocol;
|
import com.yizhuan.xchat_android_core.noble.NobleProtocol;
|
||||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
|
||||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||||
@@ -327,6 +326,9 @@ public class MeFragment extends BaseFragment implements View.OnClickListener {
|
|||||||
case R.id.me_item_link_room:
|
case R.id.me_item_link_room:
|
||||||
CommonWebViewActivity.start(mContext, UriProvider.getLinkRoomUrl());
|
CommonWebViewActivity.start(mContext, UriProvider.getLinkRoomUrl());
|
||||||
break;
|
break;
|
||||||
|
case R.id.me_item_vip:
|
||||||
|
VipMainActivity.start(mContext,0);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -147,7 +147,7 @@ public class ChargeActivity extends BaseActivity {
|
|||||||
tvCharge.setOnClickListener(v -> {
|
tvCharge.setOnClickListener(v -> {
|
||||||
if (mSelectChargeBean == null) return;
|
if (mSelectChargeBean == null) return;
|
||||||
getDialogManager().showProgressDialog(this, false);
|
getDialogManager().showProgressDialog(this, false);
|
||||||
PaymentActivity.start(this, payChannel, String.valueOf(mSelectChargeBean.chargeProdId));
|
PaymentActivity.start(this, payChannel, mSelectChargeBean.chargeProdId);
|
||||||
});
|
});
|
||||||
tvAgreement.setOnClickListener(v -> {
|
tvAgreement.setOnClickListener(v -> {
|
||||||
CommonWebViewActivity.start(this, UriProvider.getRechargeAgreementUrl());
|
CommonWebViewActivity.start(this, UriProvider.getRechargeAgreementUrl());
|
||||||
|
@@ -112,6 +112,7 @@ public class LinePagerIndicator extends View implements IPagerIndicator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageSelected(int position) {
|
public void onPageSelected(int position) {
|
||||||
|
onPageScrolled(position,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -30,9 +30,11 @@ public class ColorTransitionPagerTitleView extends SimplePagerTitleView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelected(int index, int totalCount) {
|
public void onSelected(int index, int totalCount) {
|
||||||
|
setTextColor(mSelectedColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDeselected(int index, int totalCount) {
|
public void onDeselected(int index, int totalCount) {
|
||||||
|
setTextColor(mNormalColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
28
app/src/main/java/com/yizhuan/erban/vip/VipAuthAdapter.kt
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
package com.yizhuan.erban.vip
|
||||||
|
|
||||||
|
import android.widget.ImageView
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder
|
||||||
|
import com.yizhuan.erban.R
|
||||||
|
import com.yizhuan.erban.ui.utils.load
|
||||||
|
import com.yizhuan.xchat_android_core.vip.VipAuthInfo
|
||||||
|
import com.yizhuan.xchat_android_core.vip.VipInfo
|
||||||
|
|
||||||
|
class VipAuthAdapter :
|
||||||
|
BaseQuickAdapter<VipAuthInfo, BaseViewHolder>(R.layout.item_vip_auth) {
|
||||||
|
|
||||||
|
|
||||||
|
private var vipInfo: VipInfo? = null
|
||||||
|
|
||||||
|
fun setVipInfo(vipInfo: VipInfo?) {
|
||||||
|
this.vipInfo = vipInfo
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun convert(helper: BaseViewHolder, item: VipAuthInfo) {
|
||||||
|
helper.setText(R.id.tv_auth_name, item.authName)
|
||||||
|
.setText(R.id.tv_auth_desc, item.authDesc)
|
||||||
|
helper.getView<ImageView>(R.id.iv_auth_icon).load(item.authIcon)
|
||||||
|
helper.itemView.alpha =
|
||||||
|
if (vipInfo?.ownAuthTypes?.contains(item.authType) == true) 1f else 0.5f
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,109 @@
|
|||||||
|
package com.yizhuan.erban.vip;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.yizhuan.erban.R;
|
||||||
|
import com.yizhuan.erban.ui.widget.XRecyclerView.ScaleTransitionPagerTitleView;
|
||||||
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||||
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||||
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||||
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||||
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class VipMagicIndicatorAdapter extends CommonNavigatorAdapter {
|
||||||
|
private final Context mContext;
|
||||||
|
private final List<? extends CharSequence> mTitleList;
|
||||||
|
|
||||||
|
private int textSize = 14;
|
||||||
|
private float minScale =1f;
|
||||||
|
private boolean showIndicator =true;
|
||||||
|
|
||||||
|
public VipMagicIndicatorAdapter(Context context, List<? extends CharSequence> charSequences ) {
|
||||||
|
this.mContext = context;
|
||||||
|
this.mTitleList = charSequences;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return mTitleList == null ? 0 : mTitleList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPagerTitleView getTitleView(Context context, final int i) {
|
||||||
|
ScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new ScaleTransitionPagerTitleView(context, true);
|
||||||
|
scaleTransitionPagerTitleView.setNormalColor(Color.parseColor("#FFBC9E66"));
|
||||||
|
scaleTransitionPagerTitleView.setSelectedColor(Color.parseColor("#FFFFE3AF"));
|
||||||
|
scaleTransitionPagerTitleView.setMinScale(minScale);
|
||||||
|
scaleTransitionPagerTitleView.setTextSize(textSize);
|
||||||
|
int padding = UIUtil.dip2px(context, 5);
|
||||||
|
scaleTransitionPagerTitleView.setPadding(padding, 0, padding, 0);
|
||||||
|
scaleTransitionPagerTitleView.setText(mTitleList.get(i));
|
||||||
|
scaleTransitionPagerTitleView.setOnClickListener(view -> {
|
||||||
|
if (mOnItemSelectListener != null) {
|
||||||
|
mOnItemSelectListener.onItemSelect(i, scaleTransitionPagerTitleView);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
return scaleTransitionPagerTitleView;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPagerIndicator getIndicator(Context context) {
|
||||||
|
if (!showIndicator) return null;
|
||||||
|
LinePagerIndicator indicator = new LinePagerIndicator(context);
|
||||||
|
indicator.setMode(LinePagerIndicator.MODE_EXACTLY);
|
||||||
|
indicator.setLineHeight(UIUtil.dip2px(mContext, 3));
|
||||||
|
indicator.setRoundRadius(UIUtil.dip2px(mContext, 10));
|
||||||
|
indicator.setLineWidth(UIUtil.dip2px(mContext, 26));
|
||||||
|
indicator.setColors(Color.parseColor("#FFFFD3A8"));
|
||||||
|
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
|
lp.bottomMargin = UIUtil.dip2px(mContext, 0);
|
||||||
|
indicator.setLayoutParams(lp);
|
||||||
|
return indicator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTextSize() {
|
||||||
|
return textSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTextSize(int textSize) {
|
||||||
|
this.textSize = textSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getMinScale() {
|
||||||
|
return minScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinScale(float minScale) {
|
||||||
|
this.minScale = minScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowIndicator() {
|
||||||
|
return showIndicator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowIndicator(boolean showIndicator) {
|
||||||
|
this.showIndicator = showIndicator;
|
||||||
|
}
|
||||||
|
|
||||||
|
private OnItemSelectListener mOnItemSelectListener;
|
||||||
|
|
||||||
|
public void setOnItemSelectListener(OnItemSelectListener onItemSelectListener) {
|
||||||
|
mOnItemSelectListener = onItemSelectListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnItemSelectListener {
|
||||||
|
void onItemSelect(int position, TextView view);
|
||||||
|
}
|
||||||
|
}
|
266
app/src/main/java/com/yizhuan/erban/vip/VipMainActivity.kt
Normal file
@@ -0,0 +1,266 @@
|
|||||||
|
package com.yizhuan.erban.vip
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.activity.viewModels
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
import androidx.core.view.isInvisible
|
||||||
|
import androidx.core.view.isVisible
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
|
import com.netease.nim.uikit.StatusBarUtil
|
||||||
|
import com.netease.nim.uikit.common.util.sys.TimeUtil
|
||||||
|
import com.yizhuan.erban.R
|
||||||
|
import com.yizhuan.erban.avroom.firstcharge.SelectPayTypeDialog
|
||||||
|
import com.yizhuan.erban.bank_card.activity.AddBankCardAgreementActivity
|
||||||
|
import com.yizhuan.erban.base.BaseViewBindingActivity
|
||||||
|
import com.yizhuan.erban.base.TitleBar
|
||||||
|
import com.yizhuan.erban.common.EmptyViewHelper
|
||||||
|
import com.yizhuan.erban.common.widget.dialog.DialogManager
|
||||||
|
import com.yizhuan.erban.databinding.ActivityVipMainBinding
|
||||||
|
import com.yizhuan.erban.ui.setting.ModifyPwdActivity
|
||||||
|
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||||
|
import com.yizhuan.erban.ui.utils.load
|
||||||
|
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||||
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||||
|
import com.yizhuan.xchat_android_core.UriProvider
|
||||||
|
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||||
|
import com.yizhuan.xchat_android_core.pay.PayModel
|
||||||
|
import com.yizhuan.xchat_android_core.pay.PaymentActivity
|
||||||
|
import com.yizhuan.xchat_android_core.pay.bean.PaymentResult
|
||||||
|
import com.yizhuan.xchat_android_core.pay.model.unionpay.UnionPayModel
|
||||||
|
import com.yizhuan.xchat_android_core.vip.VipAuthInfo
|
||||||
|
import com.yizhuan.xchat_android_core.vip.VipInfo
|
||||||
|
import com.yizhuan.xchat_android_core.vip.VipPageInfo
|
||||||
|
import com.yizhuan.xchat_android_library.utils.JavaUtil
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
class VipMainActivity : BaseViewBindingActivity<ActivityVipMainBinding>(),
|
||||||
|
VipMagicIndicatorAdapter.OnItemSelectListener {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context, roomUid: Long) {
|
||||||
|
val starter = Intent(context, VipMainActivity::class.java)
|
||||||
|
starter.putExtra("roomUid", roomUid)
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
|
||||||
|
private const val BIND_CODE_GOLD = 200
|
||||||
|
}
|
||||||
|
|
||||||
|
private val perAdapter = VipAuthAdapter()
|
||||||
|
private lateinit var rvDelegate: RVDelegate<VipAuthInfo>
|
||||||
|
private val roomUid by lazy { intent.getLongExtra("roomUid", 0) }
|
||||||
|
private val vipViewModel: VipViewModel by viewModels()
|
||||||
|
|
||||||
|
private var currVipInfo: VipInfo? = null
|
||||||
|
private var vipInfos: List<VipInfo>? = null
|
||||||
|
private var myVipInfo: VipInfo? = null
|
||||||
|
private var vipPageInfo: VipPageInfo? = null
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
override fun init() {
|
||||||
|
initWhiteTitleBar("贵族中心")
|
||||||
|
mTitleBar.addAction(object : TitleBar.ImageAction(R.drawable.ic_room_pk_help) {
|
||||||
|
override fun performAction(view: View) {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
rvDelegate = RVDelegate.Builder<VipAuthInfo>()
|
||||||
|
.setLayoutManager(GridLayoutManager(this, 3))
|
||||||
|
.setRecyclerView(binding.recyclerView)
|
||||||
|
.setEmptyView(EmptyViewHelper.createEmptyView(context, "没有搜索结果"))
|
||||||
|
.setAdapter(perAdapter)
|
||||||
|
.build()
|
||||||
|
binding.recyclerView.isNestedScrollingEnabled = false
|
||||||
|
vipViewModel.getVipPageInfo()
|
||||||
|
vipViewModel.vipInfoLiveData.observe(this) {
|
||||||
|
|
||||||
|
vipPageInfo = it
|
||||||
|
it?.let {
|
||||||
|
vipInfos = it.vipInfos
|
||||||
|
myVipInfo = it.vipInfos?.find { vipInfo -> it.currLevel == vipInfo.vipLevel }
|
||||||
|
val nextVipInfo =
|
||||||
|
it.vipInfos?.getOrNull((it.vipInfos?.indexOf(myVipInfo) ?: -1) + 1)
|
||||||
|
|
||||||
|
if (nextVipInfo == null || nextVipInfo == myVipInfo) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
myVipInfo?.let { vipInfo ->
|
||||||
|
|
||||||
|
binding.llMyVipInfo.isVisible = true
|
||||||
|
binding.tvOpenVip.isVisible = false
|
||||||
|
binding.tvNotOpen.text = "当前权力值:${it.currScore}"
|
||||||
|
binding.tvCurrValue.text = "当前${it.currScore}"
|
||||||
|
binding.tvCurrLevelName.text = myVipInfo?.vipName
|
||||||
|
binding.tvNextLevelName.text = nextVipInfo?.vipName
|
||||||
|
binding.tvKeepValue.text = "保级${vipInfo.levelKeepScore}"
|
||||||
|
binding.tvUpValue.text = "升级${vipInfo.levelUpScore}"
|
||||||
|
binding.tvUpgradeValue.text = "${vipInfo.levelUpScore - it.currScore}"
|
||||||
|
binding.tvResidueTime.text = TimeUtil.getElapseTimeForVip(it.remainSeconds)
|
||||||
|
binding.seekBar.max = vipInfo.levelUpScore
|
||||||
|
binding.seekBar.progress = it.currScore
|
||||||
|
|
||||||
|
val currValueParams =
|
||||||
|
binding.tvCurrValue.layoutParams as ConstraintLayout.LayoutParams
|
||||||
|
currValueParams.horizontalBias = it.currScore.toFloat() / vipInfo.levelUpScore
|
||||||
|
binding.tvCurrValue.layoutParams = currValueParams
|
||||||
|
|
||||||
|
val keepParams =
|
||||||
|
binding.ivKeepIndicator.layoutParams as ConstraintLayout.LayoutParams
|
||||||
|
keepParams.horizontalBias =
|
||||||
|
vipInfo.levelKeepScore.toFloat() / vipInfo.levelUpScore
|
||||||
|
binding.ivKeepIndicator.layoutParams = keepParams
|
||||||
|
|
||||||
|
} ?: run {
|
||||||
|
binding.llMyVipInfo.isVisible = false
|
||||||
|
binding.tvOpenVip.isVisible = true
|
||||||
|
binding.tvNotOpen.text = "尚未开通贵族"
|
||||||
|
}
|
||||||
|
|
||||||
|
initTitleTab()
|
||||||
|
perAdapter.setNewData(it.vipAuthInfos)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun initWhiteTitleBar(title: String?) {
|
||||||
|
mTitleBar = findViewById(R.id.title_bar)
|
||||||
|
if (mTitleBar != null) {
|
||||||
|
mTitleBar.setTitle(title)
|
||||||
|
mTitleBar.setImmersive(false)
|
||||||
|
mTitleBar.setTitleColor(resources.getColor(R.color.white))
|
||||||
|
mTitleBar.setLeftImageResource(R.drawable.arrow_left_white)
|
||||||
|
mTitleBar.setCommonBackgroundColor(resources.getColor(R.color.transparent))
|
||||||
|
mTitleBar.setLeftClickListener { onLeftClickListener() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化推荐和派对tab
|
||||||
|
*/
|
||||||
|
private fun initTitleTab() {
|
||||||
|
val tagList: MutableList<String> = ArrayList()
|
||||||
|
vipInfos?.forEach {
|
||||||
|
tagList.add(it.vipName)
|
||||||
|
}
|
||||||
|
val commonNavigator = CommonNavigator(context)
|
||||||
|
commonNavigator.setTitleWrapContent(true)
|
||||||
|
val magicIndicatorAdapter = VipMagicIndicatorAdapter(context, tagList)
|
||||||
|
magicIndicatorAdapter.setOnItemSelectListener(this)
|
||||||
|
commonNavigator.adapter = magicIndicatorAdapter
|
||||||
|
binding.magicIndicator.navigator = commonNavigator
|
||||||
|
commonNavigator.titleContainer.showDividers = LinearLayout.SHOW_DIVIDER_MIDDLE
|
||||||
|
onItemSelect(if (myVipInfo == null) 0 else vipInfos?.indexOf(myVipInfo) ?: 0, null)
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
override fun onItemSelect(position: Int, view: TextView?) {
|
||||||
|
currVipInfo = vipInfos?.getOrNull(position)
|
||||||
|
binding.ivMyLevel.isInvisible = currVipInfo?.vipLevel != myVipInfo?.vipLevel
|
||||||
|
binding.tvNotOpen.text = if (myVipInfo == null) {
|
||||||
|
"尚未开通贵族"
|
||||||
|
} else {
|
||||||
|
"当前权力值:${vipPageInfo?.currScore ?: 0}"
|
||||||
|
}
|
||||||
|
binding.tvNotOpen.isInvisible =
|
||||||
|
!(currVipInfo?.vipLevel == myVipInfo?.vipLevel || myVipInfo == null)
|
||||||
|
binding.ivVipIcon.load(currVipInfo?.vipLogo)
|
||||||
|
binding.tvAuthNum.text =
|
||||||
|
"${currVipInfo?.ownAuthTypes?.size ?: 0}/${vipPageInfo?.vipAuthInfos?.size ?: 0}"
|
||||||
|
perAdapter.setVipInfo(currVipInfo)
|
||||||
|
binding.magicIndicator.onPageSelected(position)
|
||||||
|
perAdapter.notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
loadData()
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("CheckResult", "SetTextI18n")
|
||||||
|
private fun loadData() {
|
||||||
|
PayModel.get().getChargeList(9, AuthModel.get().currentUid)
|
||||||
|
.compose(bindToLifecycle())
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
val chargeInfo = it.list.getOrNull(0)
|
||||||
|
chargeInfo?.let { chargeBean ->
|
||||||
|
binding.tvOpenVip.text = "¥${chargeBean.getMoney()}立刻成为大鹅贵族"
|
||||||
|
binding.tvOpenVip.setOnClickListener {
|
||||||
|
SelectPayTypeDialog.newInstance(
|
||||||
|
chargeBean.chargeProdId,
|
||||||
|
"¥${chargeBean.money}",
|
||||||
|
)
|
||||||
|
.show(context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
it.printStackTrace()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
|
dialogManager.dismissDialog()
|
||||||
|
if (resultCode != RESULT_OK) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//支付页面返回处理
|
||||||
|
if (requestCode == PaymentActivity.REQUEST_CODE_PAY) {
|
||||||
|
if (data != null && data.extras != null) {
|
||||||
|
val paymentResult: PaymentResult? =
|
||||||
|
data.getParcelableExtra(PaymentActivity.KEY_PAY_RESULT)
|
||||||
|
if (paymentResult != null) {
|
||||||
|
// 充值金额超过限定时,就必须先实名认证
|
||||||
|
when (JavaUtil.str2int(paymentResult.code)) {
|
||||||
|
PayModel.NOT_REAL_NAME_BEFORE_CHARGING -> dialogManager.showTipsDialog(
|
||||||
|
getString(R.string.tips_need_to_certification),
|
||||||
|
getString(R.string.go_to_certification),
|
||||||
|
object : DialogManager.AbsOkDialogListener() {
|
||||||
|
override fun onOk() {
|
||||||
|
// 跳去实名认证页面
|
||||||
|
CommonWebViewActivity.start(
|
||||||
|
this@VipMainActivity,
|
||||||
|
UriProvider.getTutuRealNamePage()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
UnionPayModel.CODE_NEED_BIND_BANK_CARD_FIRST -> dialogManager.showTipsDialog(
|
||||||
|
getString(R.string.tips_need_bind_bank_card_first),
|
||||||
|
object : DialogManager.AbsOkDialogListener() {
|
||||||
|
override fun onOk() {
|
||||||
|
// 跳去添加银行卡页面
|
||||||
|
AddBankCardAgreementActivity.start(this@VipMainActivity)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
else -> {
|
||||||
|
toast(paymentResult.msg)
|
||||||
|
//重新获取钱包信息
|
||||||
|
PayModel.get().getWalletInfo(AuthModel.get().currentUid).subscribe()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (requestCode == BIND_CODE_GOLD) {
|
||||||
|
ModifyPwdActivity.start(this, ModifyPwdActivity.FOGERT_PAY_PWD)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun needSteepStateBar() = true
|
||||||
|
|
||||||
|
override fun setStatusBar() {
|
||||||
|
super.setStatusBar()
|
||||||
|
StatusBarUtil.transparencyBar(this)
|
||||||
|
}
|
||||||
|
}
|
28
app/src/main/java/com/yizhuan/erban/vip/VipViewModel.kt
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
package com.yizhuan.erban.vip
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.MutableLiveData
|
||||||
|
import com.yizhuan.erban.base.BaseViewModel
|
||||||
|
import com.yizhuan.xchat_android_core.bean.response.ListResult
|
||||||
|
import com.yizhuan.xchat_android_core.home.bean.*
|
||||||
|
import com.yizhuan.xchat_android_core.home.model.HomeModel
|
||||||
|
import com.yizhuan.xchat_android_core.utils.net.ServerException
|
||||||
|
import com.yizhuan.xchat_android_core.utils.toast
|
||||||
|
import com.yizhuan.xchat_android_core.vip.VipInfo
|
||||||
|
import com.yizhuan.xchat_android_core.vip.VipModel
|
||||||
|
import com.yizhuan.xchat_android_core.vip.VipPageInfo
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.async
|
||||||
|
|
||||||
|
class VipViewModel : BaseViewModel() {
|
||||||
|
|
||||||
|
private val _vipInfoLiveData = MutableLiveData<VipPageInfo>()
|
||||||
|
val vipInfoLiveData: LiveData<VipPageInfo> = _vipInfoLiveData
|
||||||
|
|
||||||
|
fun getVipPageInfo(){
|
||||||
|
safeLaunch {
|
||||||
|
_vipInfoLiveData.value = VipModel.getVipPageInfo()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
BIN
app/src/main/res/drawable-xhdpi/bg_vip_main_bottom.png
Normal file
After Width: | Height: | Size: 259 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_vip_main_per.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_vip_main_top.png
Normal file
After Width: | Height: | Size: 472 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_vip_my_level.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_vip_auth_text.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_vip_keep_indicator.png
Normal file
After Width: | Height: | Size: 647 B |
BIN
app/src/main/res/drawable-xhdpi/ic_vip_thumb.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
11
app/src/main/res/drawable/bg_vip_open_btn.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:endColor="#ffffc133"
|
||||||
|
android:startColor="#ffffeac3"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
<corners android:radius="24dp" />
|
||||||
|
</shape>
|
23
app/src/main/res/drawable/bg_vip_seek_bar.xml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 定义轨道的背景 -->
|
||||||
|
<item android:id="@android:id/background">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#FF443A24"/>
|
||||||
|
<corners android:radius="@dimen/dp_10" />
|
||||||
|
<stroke android:width="1px" android:color="#FFB49158"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 定义轨道上已完成部分的样式 -->
|
||||||
|
<item android:id="@android:id/progress">
|
||||||
|
<clip>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="0"
|
||||||
|
android:endColor="#FFFFE5BA"
|
||||||
|
android:startColor="#FFF2B04E" />
|
||||||
|
<corners android:radius="@dimen/dp_10" />
|
||||||
|
</shape>
|
||||||
|
</clip>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
@@ -665,6 +665,25 @@
|
|||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/me_item_vip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
||||||
|
android:drawableStart="@mipmap/icon_me_link_room"
|
||||||
|
android:drawableEnd="@drawable/arrow_right"
|
||||||
|
android:drawablePadding="13dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:onClick="@{click}"
|
||||||
|
android:paddingTop="@dimen/dp_15"
|
||||||
|
android:paddingEnd="15dp"
|
||||||
|
android:paddingBottom="@dimen/dp_15"
|
||||||
|
android:text="贵族中心"
|
||||||
|
android:textColor="@color/text_normal_c6c6e9"
|
||||||
|
android:textSize="13sp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -1,124 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:background="@color/white"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="60dp"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_marginTop="8dp">
|
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
|
||||||
android:id="@+id/iv_cover"
|
|
||||||
android:layout_width="60dp"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
app:riv_corner_radius="@dimen/dp_30"
|
|
||||||
android:src="@mipmap/app_logo" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/ll_name_container"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical|start"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxEms="15"
|
|
||||||
android:textColor="@color/color_1A1A1A"
|
|
||||||
android:textSize="@dimen/dp_15"
|
|
||||||
tools:text="房间名" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/lock_bg"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:src="@drawable/ic_room_lock_icon"
|
|
||||||
android:visibility="visible" />
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<com.nex3z.flowlayout.FlowLayout
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/dp_5"
|
|
||||||
app:flChildSpacing="5dp"
|
|
||||||
app:flChildSpacingForLastRow="align"
|
|
||||||
app:flRowSpacing="10dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:id="@+id/iv_tab_category"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="@dimen/tag_height"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
android:src="@mipmap/ic_tag_default" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:id="@+id/iv_emperor_recommend"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="@dimen/dp_14"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
tools:background="@drawable/ic_king_recommend" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:id="@+id/iv_tab_label"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="@dimen/tag_height"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
android:src="@mipmap/ic_top1"
|
|
||||||
android:visibility="visible"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_online_number"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textColor="@color/color_999999"
|
|
||||||
android:textSize="12sp"
|
|
||||||
tools:text="100人在线" />
|
|
||||||
|
|
||||||
</com.nex3z.flowlayout.FlowLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
<com.yizhuan.erban.ui.widget.LivingIconView
|
|
||||||
android:id="@+id/liv_living_icon"
|
|
||||||
android:layout_width="12dp"
|
|
||||||
android:layout_height="12dp"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_marginBottom="@dimen/dp_5"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginTop="25dp"
|
|
||||||
android:background="@color/transparent" />
|
|
||||||
</LinearLayout>
|
|
337
app/src/module_labour_union/res/layout/activity_vip_main.xml
Normal file
@@ -0,0 +1,337 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#232017"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_top"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:background="@drawable/bg_vip_main_top"
|
||||||
|
app:layout_constraintDimensionRatio="750:580"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/magic_indicator">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_vip_icon"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_my_level"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:visibility="invisible"
|
||||||
|
android:src="@drawable/bg_vip_my_level"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/iv_vip_icon" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_not_open"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:text="尚未开通贵族"
|
||||||
|
android:visibility="invisible"
|
||||||
|
android:textColor="#ffb59862"
|
||||||
|
android:textSize="12dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/iv_my_level" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bottom"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:background="@drawable/bg_vip_main_bottom"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHeight_min="601dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_not_open" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_per"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:background="@drawable/bg_vip_main_per"
|
||||||
|
app:layout_constraintDimensionRatio="624:48"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bottom" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_auth_num"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:textColor="#ffffe7cf"
|
||||||
|
android:textSize="14dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/view_per"
|
||||||
|
tools:text="3/12" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:layout_marginBottom="125dp"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
android:scrollbars="none"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_auth_num"
|
||||||
|
app:layout_constraintVertical_bias="0" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_open_vip"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="44dp"
|
||||||
|
android:layout_marginStart="36dp"
|
||||||
|
android:layout_marginEnd="36dp"
|
||||||
|
android:layout_marginBottom="30dp"
|
||||||
|
android:background="@drawable/bg_vip_open_btn"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="¥6立刻成为大鹅贵族"
|
||||||
|
android:textColor="#ff4e2f00"
|
||||||
|
android:textSize="16dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<com.yizhuan.erban.base.TitleBar
|
||||||
|
android:id="@+id/title_bar"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||||
|
android:id="@+id/magic_indicator"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title_bar" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_my_vip_info"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:background="#FF302B20">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:baselineAligned="true">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:text="当前等级"
|
||||||
|
android:textColor="#ffbc9e66"
|
||||||
|
android:textSize="10dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_curr_level_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:text="骑士"
|
||||||
|
android:textColor="#ffffe3af"
|
||||||
|
android:textSize="12dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:text="还差:"
|
||||||
|
android:textColor="#ffbc9e66"
|
||||||
|
android:textSize="10dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_upgrade_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="4562"
|
||||||
|
android:textColor="#ffffe3af"
|
||||||
|
android:textSize="13dp" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="权力值可升级到"
|
||||||
|
android:textColor="#ffbc9e66"
|
||||||
|
android:textSize="10dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_next_level_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="男爵"
|
||||||
|
android:textColor="#ffbc9e66"
|
||||||
|
android:textSize="10dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:text="剩余时间:"
|
||||||
|
android:textColor="#ffbc9e66"
|
||||||
|
android:textSize="10dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_residue_time"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="21天23小时"
|
||||||
|
android:textColor="#ffffe3af"
|
||||||
|
android:textSize="13dp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_time_help"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:src="@drawable/ic_help_black" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#FF252014">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_auth_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_marginBottom="50dp"
|
||||||
|
android:src="@drawable/ic_vip_auth_text"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<com.yizhuan.erban.avroom.widget.VipProgressBar
|
||||||
|
android:id="@+id/seek_bar"
|
||||||
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="14dp"
|
||||||
|
android:max="100"
|
||||||
|
android:paddingStart="9dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingEnd="9dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:progress="50"
|
||||||
|
android:progressDrawable="@drawable/bg_vip_seek_bar"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_auth_text"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iv_auth_text" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_keep_indicator"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:src="@drawable/ic_vip_keep_indicator"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/seek_bar"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/seek_bar"
|
||||||
|
app:layout_constraintHorizontal_bias="0.2"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/seek_bar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_keep_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="保级1000"
|
||||||
|
android:textColor="#ffbc9e66"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/iv_keep_indicator"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/iv_keep_indicator"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/iv_keep_indicator" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_up_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:text="升级5000"
|
||||||
|
android:textColor="#ffbc9e66"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/seek_bar"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/seek_bar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_curr_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:text="当前800"
|
||||||
|
android:textColor="#ffffe3af"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/seek_bar"
|
||||||
|
app:layout_constraintHorizontal_bias="0.3"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/seek_bar"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/seek_bar" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
37
app/src/module_labour_union/res/layout/item_vip_auth.xml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_auth_icon"
|
||||||
|
android:layout_width="46dp"
|
||||||
|
android:layout_height="46dp"
|
||||||
|
android:src="@drawable/default_cover" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_auth_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="7dp"
|
||||||
|
android:textColor="#ff9f8052"
|
||||||
|
android:textSize="14dp"
|
||||||
|
tools:text="专属铭牌" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_auth_desc"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:textColor="#ff8b7245"
|
||||||
|
android:textSize="12dp"
|
||||||
|
tools:text="专属身份铭牌" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
@@ -17,7 +17,7 @@ public class ChargeBean implements Serializable{
|
|||||||
"channel": "wx" //充值渠道
|
"channel": "wx" //充值渠道
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public int chargeProdId;
|
public String chargeProdId;
|
||||||
public String prodName;
|
public String prodName;
|
||||||
public int money;
|
public int money;
|
||||||
public int giftGoldNum;
|
public int giftGoldNum;
|
||||||
@@ -42,11 +42,11 @@ public class ChargeBean implements Serializable{
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
public int getChargeProdId() {
|
public String getChargeProdId() {
|
||||||
return chargeProdId;
|
return chargeProdId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setChargeProdId(int chargeProdId) {
|
public void setChargeProdId(String chargeProdId) {
|
||||||
this.chargeProdId = chargeProdId;
|
this.chargeProdId = chargeProdId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +1,15 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.vip
|
||||||
|
|
||||||
|
data class VipAuthInfo(
|
||||||
|
val authDesc: String = "",
|
||||||
|
val authIcon: String = "",
|
||||||
|
val authIntro: String = "",
|
||||||
|
val authName: String = "",
|
||||||
|
val authType: Int = 0,
|
||||||
|
val createTime: String = "",
|
||||||
|
val descPic: String = "",
|
||||||
|
val id: Int = 0,
|
||||||
|
val seq: Int = 0,
|
||||||
|
val status: Int = 0,
|
||||||
|
val updateTime: String = ""
|
||||||
|
)
|
@@ -0,0 +1,22 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.vip
|
||||||
|
|
||||||
|
data class VipInfo(
|
||||||
|
val comingSoon: Int = 0,
|
||||||
|
val createTime: String = "",
|
||||||
|
val levelKeepScore: Int = 0,
|
||||||
|
val levelUpScore: Int = 0,
|
||||||
|
val ownAuthTypes: List<Int>? = null,
|
||||||
|
val updateTime: String = "",
|
||||||
|
val vipIcon: String = "",
|
||||||
|
val vipLevel: Int = 0,
|
||||||
|
val vipLogo: String = "",
|
||||||
|
val vipName: String = ""
|
||||||
|
) {
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
return other is VipInfo && other.vipLevel == vipLevel
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun hashCode(): Int {
|
||||||
|
return vipLevel
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,31 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.vip
|
||||||
|
|
||||||
|
import com.yizhuan.xchat_android_core.base.BaseModel
|
||||||
|
import com.yizhuan.xchat_android_core.bean.response.ServiceResult
|
||||||
|
import com.yizhuan.xchat_android_core.utils.net.launchRequest
|
||||||
|
import com.yizhuan.xchat_android_library.net.rxnet.RxNet
|
||||||
|
import retrofit2.http.GET
|
||||||
|
|
||||||
|
object VipModel : BaseModel() {
|
||||||
|
|
||||||
|
private val api = RxNet.create(Api::class.java)
|
||||||
|
|
||||||
|
suspend fun getVipPageInfo(): VipPageInfo? =
|
||||||
|
launchRequest {
|
||||||
|
api.getVipPageInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private interface Api {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取vip主页信息
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("vip/getVipPageInfo")
|
||||||
|
suspend fun getVipPageInfo(): ServiceResult<VipPageInfo>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,9 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.vip
|
||||||
|
|
||||||
|
data class VipPageInfo(
|
||||||
|
val vipAuthInfos: List<VipAuthInfo>? = null,
|
||||||
|
val vipInfos: List<VipInfo>? = null,
|
||||||
|
val remainSeconds: Int = 0,
|
||||||
|
val currLevel: Int = 0,
|
||||||
|
val currScore: Int = 0
|
||||||
|
)
|
@@ -1,26 +1,16 @@
|
|||||||
package com.yizhuan.xchat_android_core.pay.model.alipay;
|
package com.yizhuan.xchat_android_core.pay.model.alipay;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.text.TextUtils;
|
|
||||||
|
|
||||||
import com.alipay.sdk.app.PayTask;
|
|
||||||
import com.yizhuan.xchat_android_core.Constants;
|
import com.yizhuan.xchat_android_core.Constants;
|
||||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||||
import com.yizhuan.xchat_android_core.exception.NullDataException;
|
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||||
import com.yizhuan.xchat_android_core.pay.PayModel;
|
|
||||||
import com.yizhuan.xchat_android_core.pay.bean.NotRealNameYetException;
|
|
||||||
import com.yizhuan.xchat_android_core.pay.bean.PmChargeLimitException;
|
|
||||||
import com.yizhuan.xchat_android_core.pay.bean.alipay.AlipayInfo;
|
import com.yizhuan.xchat_android_core.pay.bean.alipay.AlipayInfo;
|
||||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
|
||||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||||
import com.yizhuan.xchat_android_library.utils.LogUtil;
|
|
||||||
import com.yizhuan.xchat_android_library.utils.NetworkUtils;
|
import com.yizhuan.xchat_android_library.utils.NetworkUtils;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import io.reactivex.Single;
|
import io.reactivex.Single;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
@@ -52,6 +42,7 @@ public class AliPayModel extends BaseModel implements IAliPayModel {
|
|||||||
public Single<ServiceResult<AlipayInfo>> requestAliPay(Activity context, String chargeProdId) {
|
public Single<ServiceResult<AlipayInfo>> requestAliPay(Activity context, String chargeProdId) {
|
||||||
return api.requestAilPayOrder(
|
return api.requestAilPayOrder(
|
||||||
String.valueOf(AuthModel.get().getCurrentUid()),
|
String.valueOf(AuthModel.get().getCurrentUid()),
|
||||||
|
AvRoomDataManager.get().getRoomUid() == 0 ? null : String.valueOf(AvRoomDataManager.get().getRoomUid()),
|
||||||
chargeProdId,
|
chargeProdId,
|
||||||
Constants.CHARGE_ALIPAY,
|
Constants.CHARGE_ALIPAY,
|
||||||
NetworkUtils.getIPAddress(context),
|
NetworkUtils.getIPAddress(context),
|
||||||
@@ -72,6 +63,7 @@ public class AliPayModel extends BaseModel implements IAliPayModel {
|
|||||||
*/
|
*/
|
||||||
@POST("/charge/pay/apply")
|
@POST("/charge/pay/apply")
|
||||||
Single<ServiceResult<AlipayInfo>> requestAilPayOrder(@Query("uid") String uid,
|
Single<ServiceResult<AlipayInfo>> requestAilPayOrder(@Query("uid") String uid,
|
||||||
|
@Query("roomUid") String roomUid,
|
||||||
@Query("chargeProdId") String chargeProdId,
|
@Query("chargeProdId") String chargeProdId,
|
||||||
@Query("payChannel") String payChannel,
|
@Query("payChannel") String payChannel,
|
||||||
@Query("clientIp") String clientIp,
|
@Query("clientIp") String clientIp,
|
||||||
|
@@ -6,6 +6,7 @@ import com.yizhuan.xchat_android_core.Constants;
|
|||||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||||
import com.yizhuan.xchat_android_core.base.BaseModel;
|
import com.yizhuan.xchat_android_core.base.BaseModel;
|
||||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||||
|
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||||
import com.yizhuan.xchat_android_core.pay.bean.wechatpay.WeChatAppParam;
|
import com.yizhuan.xchat_android_core.pay.bean.wechatpay.WeChatAppParam;
|
||||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||||
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
||||||
@@ -49,10 +50,6 @@ public class WeChatPayModel extends BaseModel implements IWeChatPayModel {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class Helper {
|
|
||||||
public static final WeChatPayModel INSTANCE = new WeChatPayModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static WeChatPayModel get() {
|
public static WeChatPayModel get() {
|
||||||
return WeChatPayModel.Helper.INSTANCE;
|
return WeChatPayModel.Helper.INSTANCE;
|
||||||
}
|
}
|
||||||
@@ -68,6 +65,7 @@ public class WeChatPayModel extends BaseModel implements IWeChatPayModel {
|
|||||||
public Single<ServiceResult<WeChatAppParam>> requestWeChatPay(Activity context, String chargeProdId) {
|
public Single<ServiceResult<WeChatAppParam>> requestWeChatPay(Activity context, String chargeProdId) {
|
||||||
return api.requestWeChatPayOrder(
|
return api.requestWeChatPayOrder(
|
||||||
String.valueOf(AuthModel.get().getCurrentUid()),
|
String.valueOf(AuthModel.get().getCurrentUid()),
|
||||||
|
AvRoomDataManager.get().getRoomUid() == 0 ? null : String.valueOf(AvRoomDataManager.get().getRoomUid()),
|
||||||
chargeProdId,
|
chargeProdId,
|
||||||
Constants.CHARGE_WX,
|
Constants.CHARGE_WX,
|
||||||
NetworkUtils.getIPAddress(context),
|
NetworkUtils.getIPAddress(context),
|
||||||
@@ -89,9 +87,14 @@ public class WeChatPayModel extends BaseModel implements IWeChatPayModel {
|
|||||||
*/
|
*/
|
||||||
@POST("/charge/pay/apply")
|
@POST("/charge/pay/apply")
|
||||||
Single<ServiceResult<WeChatAppParam>> requestWeChatPayOrder(@Query("uid") String uid,
|
Single<ServiceResult<WeChatAppParam>> requestWeChatPayOrder(@Query("uid") String uid,
|
||||||
|
@Query("roomUid") String roomUid,
|
||||||
@Query("chargeProdId") String chargeProdId,
|
@Query("chargeProdId") String chargeProdId,
|
||||||
@Query("payChannel") String payChannel,
|
@Query("payChannel") String payChannel,
|
||||||
@Query("clientIp") String clientIp,
|
@Query("clientIp") String clientIp,
|
||||||
@Query("ticket") String ticket);
|
@Query("ticket") String ticket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final class Helper {
|
||||||
|
public static final WeChatPayModel INSTANCE = new WeChatPayModel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -289,6 +289,19 @@ public class TimeUtil {
|
|||||||
return retStr;
|
return retStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getElapseTimeForVip(int seconds) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
if (seconds < 1) seconds = 1;
|
||||||
|
|
||||||
|
int day = seconds / (60 * 60 * 24);
|
||||||
|
sb.append(day).append("天");
|
||||||
|
|
||||||
|
int hour = seconds / (60 * 60) % 24;
|
||||||
|
sb.append(hour).append("小时");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public static String getElapseTimeForShow(int milliseconds) {
|
public static String getElapseTimeForShow(int milliseconds) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
int seconds = milliseconds / 1000;
|
int seconds = milliseconds / 1000;
|
||||||
|