Commit 8c4c4751 authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :小象省钱
[实现方案] :加入权益支付和权益详情
parent 439ce884
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="@color/white">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
......
...@@ -261,7 +261,7 @@ public class Constant { ...@@ -261,7 +261,7 @@ public class Constant {
public static class Param { public static class Param {
public static final String mPacketName = "com.zxbw.xxsq"; public static final String mPacketName = "com.zxbw.xxsq";
public static boolean isLocal = mPacketName.equals("com.zx.localnews"); public static boolean isLocal = mPacketName.equals("com.zx.localnews");
public static String APPLS = "4874eb0b5f4ae5a5"; public static String APPLS = "8c39c8defd478ffd";
public static String androidId = ""; public static String androidId = "";
public static String carrier = ""; public static String carrier = "";
public static String h = ""; public static String h = "";
......
...@@ -128,6 +128,7 @@ public class NetConfig { ...@@ -128,6 +128,7 @@ public class NetConfig {
public static final String URL_PAY_CONFIG = "app/v2/location/user/pay-config";//獲取配置列表 public static final String URL_PAY_CONFIG = "app/v2/location/user/pay-config";//獲取配置列表
public static final String URL_PAY_ORDER = "app/v2/location/user/pay";//請求支付訂單 public static final String URL_PAY_ORDER = "app/v2/location/user/pay";//請求支付訂單
public static final String URL_PAY_RIGHTS_ORDER = "app/v1/location/equitCard/pay";//請求支付訂單
public static final String URL_PAY_SHOP_ORDER = "app/v3/location/user/pay";//商城里支付 public static final String URL_PAY_SHOP_ORDER = "app/v3/location/user/pay";//商城里支付
public static final String VERIFY_PAY_URL = "app/v1/location/user/pay-order"; public static final String VERIFY_PAY_URL = "app/v1/location/user/pay-order";
public static final String VERIFY_PAY_SWITCH_URL = "/app/v1/game/face/config"; public static final String VERIFY_PAY_SWITCH_URL = "/app/v1/game/face/config";
......
...@@ -5,6 +5,8 @@ import com.zxhl.cms.common.NetConfig ...@@ -5,6 +5,8 @@ import com.zxhl.cms.common.NetConfig
import com.zxhl.cms.net.model.box.* import com.zxhl.cms.net.model.box.*
import com.zxhl.cms.net.model.other.IsWeChatLoginEntity import com.zxhl.cms.net.model.other.IsWeChatLoginEntity
import com.zxhl.cms.net.model.other.WxBindEntity import com.zxhl.cms.net.model.other.WxBindEntity
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.qy.RightsDetailEntity
import com.zxhl.cms.net.model.uc.UserInfo import com.zxhl.cms.net.model.uc.UserInfo
import com.zxhl.cms.net.model.uc.VersionEntity import com.zxhl.cms.net.model.uc.VersionEntity
import io.reactivex.Observable import io.reactivex.Observable
...@@ -328,10 +330,13 @@ interface IHomeApi { ...@@ -328,10 +330,13 @@ interface IHomeApi {
@GET(NetConfig.QY.QY_JGQ_CARD_LIST) @GET(NetConfig.QY.QY_JGQ_CARD_LIST)
fun getQyJgqCardList(): Observable<Response<List<Any>>> fun getQyJgqCardList(): Observable<Response<List<JgqQyEntity>>>
@GET(NetConfig.QY.QY_JGQ_CARD_DETAIL) @GET(NetConfig.QY.QY_JGQ_CARD_DETAIL)
fun getQyJgqCardDetail(): Observable<Response<Any>> fun getQyJgqCardDetail(
@Query("brand") brand: String,
@Query("previewModel") previewModel: String
): Observable<Response<List<RightsDetailEntity>>>
} }
\ No newline at end of file
...@@ -152,4 +152,14 @@ public interface IUserInfoApi { ...@@ -152,4 +152,14 @@ public interface IUserInfoApi {
*/ */
@POST(NetConfig.User.USER_FREE_RECEIVE) @POST(NetConfig.User.USER_FREE_RECEIVE)
Observable<Response<VideoProcessEntity>> freeReceive(@Query("type") int type); Observable<Response<VideoProcessEntity>> freeReceive(@Query("type") int type);
/**
* 权益支付宝支付
*
* @return
*/
@POST(NetConfig.User.URL_PAY_RIGHTS_ORDER)
Observable<Response<AliPayEntity>> aliPayRights(@Query("goodsId") String goodsId, @Query("payType") String payType,@Query("phone") String phone);
} }
...@@ -17,6 +17,7 @@ class AppInEntity { ...@@ -17,6 +17,7 @@ class AppInEntity {
var risk_text: String = ""// var risk_text: String = ""//
var risk_open: String = ""//1开启 0 关闭 var risk_open: String = ""//1开启 0 关闭
var kefu_url: String = ""//客服地址 var kefu_url: String = ""//客服地址
var card_desc: String = ""//权益说明
} }
......
package com.zxhl.cms.net.model.qy
/**
* @author (wangXuewei)
* @datetime 2022-05-23 14:19 GMT+8
* @detail :金刚区权益
*/
class JgqQyEntity {
var brand: String? = ""
var sort: String? = ""
}
\ No newline at end of file
package com.zxhl.cms.net.model.qy
/**
* @author (wangXuewei)
* @datetime 2022-05-23 16:53 GMT+8
* @detail :
*/
class RightsDetailEntity {
var id: String? = ""
var brand: String? = ""
var category: String? = ""
var rechargeType: String? = ""
var goodsName: String? = ""
var originPrice: String? = ""
var costPrice: String? = ""
var costDiscount: String? = ""
var salePrice: String? = ""
var remark: String? = ""
var purchaseTime: String? = ""
var status: String? = ""
var productCode: String? = ""
}
\ No newline at end of file
...@@ -197,6 +197,12 @@ interface RounterApi { ...@@ -197,6 +197,12 @@ interface RounterApi {
@RounterUri(Constant.scheme + "://login") @RounterUri(Constant.scheme + "://login")
fun getIntentLogin(): Intent fun getIntentLogin(): Intent
@RounterUri(Constant.scheme + "://rights_detail")
fun getIntentRightsDetail(
@RounterParam("brandName") brandName: String,
@RounterParam("brandUrl") brandUrl: String
): Intent
@RounterUri(Constant.scheme + "://after_login") @RounterUri(Constant.scheme + "://after_login")
fun getIntentAfterLogin( fun getIntentAfterLogin(
@RounterParam("boxid") boxid: String, @RounterParam("boxid") boxid: String,
......
...@@ -31,6 +31,16 @@ public class JumpUtils { ...@@ -31,6 +31,16 @@ public class JumpUtils {
} }
} }
public static void RightsDetailJump(String brandName, String brandUrl) {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentRightsDetail(brandName, brandUrl);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppContext.get().startActivity(intent);
} catch (Exception e) {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void AfterLoginJump(String boxid, String needprice, String type, String onePrice, String fivePrice, String newPeople, String page) { public static void AfterLoginJump(String boxid, String needprice, String type, String onePrice, String fivePrice, String newPeople, String page) {
try { try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentAfterLogin(boxid, needprice, type, onePrice, fivePrice, newPeople, page); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentAfterLogin(boxid, needprice, type, onePrice, fivePrice, newPeople, page);
...@@ -277,9 +287,9 @@ public class JumpUtils { ...@@ -277,9 +287,9 @@ public class JumpUtils {
} }
} }
public static void BoxResultDetailJump(String boxName,String boxId, String characterId, String uid) { public static void BoxResultDetailJump(String boxName, String boxId, String characterId, String uid) {
try { try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentBoxResultDetail(boxName,boxId, characterId, uid); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentBoxResultDetail(boxName, boxId, characterId, uid);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppContext.get().startActivity(intent); AppContext.get().startActivity(intent);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -35,6 +35,18 @@ ...@@ -35,6 +35,18 @@
android:scheme="xxsq" /> android:scheme="xxsq" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".activity.RightsDetailActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="rights_detail"
android:scheme="xxsq" />
</intent-filter>
</activity>
</application> </application>
......
package com.zxbw.modulemain.activity
import android.os.Handler
import android.text.Html
import android.util.Log
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CircleCrop
import com.bumptech.glide.request.RequestOptions
import com.zxbw.modulemain.R
import com.zxbw.modulemain.adapter.RightsDetailListAdapter
import com.zxbw.modulemain.contract.RightsDetailContract
import com.zxbw.modulemain.contract.RightsPayContract
import com.zxbw.modulemain.presenter.RightsDetailPresenter
import com.zxbw.modulemain.presenter.RightsPayPresenter
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.Constant
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.model.box.AppInEntity
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.qy.RightsDetailEntity
import com.zxhl.cms.net.model.uc.AliPayEntity
import com.zxhl.cms.net.model.uc.PayResultEntity
import com.zxhl.cms.net.model.video.MemberEntity
import com.zxhl.cms.pay.PayContract
import com.zxhl.cms.pay.PayPresenter
import com.zxhl.cms.pay.alipay.AlipayServer
import com.zxhl.cms.utils.EventUtils
import com.zxhl.cms.utils.MainLooper
import com.zxhl.cms.utils.OnRecycleItemClickListener
import com.zxhl.cms.utils.RxBus
import com.zxhl.cms.widget.LoadingDialog
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.activity_layout_rights_detail.*
import kotlinx.android.synthetic.main.activity_login.*
import me.jessyan.autosize.utils.ScreenUtils
import java.text.DecimalFormat
/**
* @author (wangXuewei)
* @detail :权益详情
*/
class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPayContract.View,
OnRecycleItemClickListener<RightsDetailEntity> {
private var mPayPresenter: RightsPayPresenter? = null
private var mPresenter: RightsDetailPresenter? = null
private var mAdapter: RightsDetailListAdapter? = null
private var brandName: String = "";
private var mRightsData: RightsDetailEntity? = null
private var mLoading: LoadingDialog? = null
override fun layoutID(): Int {
return R.layout.activity_layout_rights_detail
}
override fun before() {
super.before()
setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
}
override fun init() {
var statusBarHeight = ScreenUtils.getStatusBarHeight()
if (statusBarHeight <= 0) {
statusBarHeight = 40;
}
id_rights_detail_title_sys_bar_view.layoutParams.height = statusBarHeight
id_img_back.setOnClickListener(this)
id_tv_buy_right.setOnClickListener(this)
//权益名称
brandName = intent?.data?.getQueryParameter("brandName") ?: ""
var brandUrl = intent?.data?.getQueryParameter("brandUrl") ?: ""
mPresenter = RightsDetailPresenter(this)
initPay()
id_tv_bread_name.text = brandName
id_tv_bread_desc.text = "${brandName}会员权益"
Glide.with(this).load(brandUrl)
.apply(RequestOptions.bitmapTransform(CircleCrop()))
.into(id_img_bread_logo)
var mAppConfig = SettingPreference.getConfig()
if (mAppConfig != null) {
id_tv_rights_instructions.text = Html.fromHtml(mAppConfig.card_desc)
}
mAdapter = RightsDetailListAdapter(this, this)
id_rcl_vip_package_list.layoutManager = GridLayoutManager(this, 3)
id_rcl_vip_package_list.adapter = mAdapter
mPresenter?.geRightsDetail(brandName)
}
override fun onClick(v: View?) {
when (v) {
id_img_back -> {
finish()
}
id_tv_buy_right -> {
gotoBuy()
}
}
}
override fun setRightsDetail(result: List<RightsDetailEntity>) {
mAdapter?.clear()
mAdapter?.appendToList(result)
mAdapter?.setSelectPos(0)
mRightsData = result[0]
id_tv_bread_price.text = "¥ ${mRightsData?.salePrice}"
var oldPrice = mRightsData?.originPrice?.toFloatOrNull() ?: 0f
var salePrice = mRightsData?.salePrice?.toFloatOrNull() ?: 0f
val df = DecimalFormat("#0.00")
id_tv_bread_save_price.text = "立省${df.format(oldPrice.minus(salePrice))}元"
}
override fun onItemClick(view: View?, position: Int, data: RightsDetailEntity?) {
mAdapter?.setSelectPos(position)
mRightsData = data
id_tv_bread_price.text = "¥ ${mRightsData?.salePrice}"
var oldPrice = mRightsData?.originPrice?.toFloatOrNull() ?: 0f
var salePrice = mRightsData?.salePrice?.toFloatOrNull() ?: 0f
val df = DecimalFormat("#0.00")
id_tv_bread_save_price.text = "立省${df.format(oldPrice.minus(salePrice))}元"
}
private fun gotoBuy() {
val phoneNumber = id_edt_user_phone_number.text.toString().trim { it <= ' ' }
if (phoneNumber.isEmpty()) {
showToast("请输入要兑换的手机号")
return
}
if (phoneNumber.length < 11) {
showToast("请检查要兑换的手机号")
return
}
if (mRightsData == null) {
showToast("请选择要购买的权益")
return
}
mLoading?.setLoading("请稍后...")
mLoading?.show()
mPayPresenter?.requestRightsAliPay(mRightsData?.id ?: "", pay_type.toString(), phoneNumber)
}
private var payResultObservable: Observable<PayResultEntity>? = null
companion object {
const val ALI_PAY = 1 //支付宝支付类型
const val WECHAT_PAY = 2 //微信支付类型
const val MINI_PROGRAM = 11 //微信支付类型
const val MIN_PAY_PROGRAM = 13 //敏付
}
private var pay_type: Int? = ALI_PAY
private fun initPay() {
mLoading = LoadingDialog.getLoadingDialog(
this,
getString(com.zxhl.cms.R.string.wait_ing),
false,
false
)
mPayPresenter = RightsPayPresenter(this)
payResultObservable = RxBus.get().register(Constant.PAY_RESULT, PayResultEntity::class.java)
payResultObservable?.observeOn(AndroidSchedulers.mainThread())
?.subscribe(Consumer<PayResultEntity> { obj ->
MainLooper?.get()?.postDelayed(Runnable {
mHandler?.removeCallbacksAndMessages(null)
}, 1000)
Log.d("qqbs", "verifyPay:${obj.txt}")
//println("verifyPay payResultObservable------------------------------- order:${obj.txt}")
if (obj.isPaySuc) {
EventUtils.onEvent("pay_page_pay_query_order", "付款成功")
mPayPresenter?.verifyPay(obj.txt, obj.payType)
} else {
//支付宝支付
if (obj.payType == 1) {
if (obj.payStatus == "6001") {
EventUtils.onEvent("zfb_pay_cancel")
} else {
EventUtils.onEvent("zfb_pay_error", obj.payStatus + " msg:" + obj.txt)
}
} else {
EventUtils.onEvent("wx_pay_error", obj.txt)
}
// showResultLoading(false)
}
}, Consumer<Throwable> { })
}
private var mHandler: Handler = Handler {
when (it.what) {
0 -> {
if (mLoading != null) {
mLoading?.setResult(false, "取消支付", 1000)
}
}
}
false
}
override fun requestOrderSuc(result: AliPayEntity) {
AlipayServer.payV2(this, result.wakeup!!)
}
override fun requestOrderFail(errorMsg: String) {
mLoading?.setResult(false, "请求失败", 1000)
}
override fun verifyOrderSuc(order: String) {
mLoading?.setResult(true, "支付成功", 1000)
}
override fun verifyOrderFail(errorMsg: String) {
mLoading?.setResult(false, "支付失败", 1000)
}
override fun onDestroy() {
super.onDestroy()
if (payResultObservable != null)
RxBus.get().unregister(Constant.PAY_RESULT, payResultObservable!!)
}
}
\ No newline at end of file
...@@ -16,6 +16,7 @@ import com.zxhl.cms.net.ApiClient ...@@ -16,6 +16,7 @@ import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.SettingPreference import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.callback.BaseObserver import com.zxhl.cms.net.callback.BaseObserver
import com.zxhl.cms.net.model.box.AppInEntity
import com.zxhl.cms.router.RounterApi import com.zxhl.cms.router.RounterApi
import com.zxhl.cms.router.RounterBus import com.zxhl.cms.router.RounterBus
import com.zxhl.cms.utils.EventUtils import com.zxhl.cms.utils.EventUtils
...@@ -61,6 +62,7 @@ class SplashActivity : BaseActivity(), SplashContract.View { ...@@ -61,6 +62,7 @@ class SplashActivity : BaseActivity(), SplashContract.View {
} }
private fun initListener() { private fun initListener() {
getAppInfo()
jumpMainPage() jumpMainPage()
// id_activity_splash_skip?.setOnClickListener { // id_activity_splash_skip?.setOnClickListener {
// jumpMainPage() // jumpMainPage()
...@@ -146,4 +148,20 @@ class SplashActivity : BaseActivity(), SplashContract.View { ...@@ -146,4 +148,20 @@ class SplashActivity : BaseActivity(), SplashContract.View {
} }
}) })
} }
private fun getAppInfo() {
ApiClient.homeApi.getAppInfo()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<AppInEntity>() {
override fun onSuccess(result: AppInEntity?) {
Constant.Switch.isOpenLogin = result?.login.equals("1")
Constant.Switch.isOpenPayTips = result?.risk_open.equals("1")
SettingPreference.saveConfig(result)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
}
})
}
} }
\ No newline at end of file
...@@ -11,39 +11,40 @@ import android.widget.LinearLayout ...@@ -11,39 +11,40 @@ import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CircleCrop
import com.bumptech.glide.request.RequestOptions
import com.zxbw.modulemain.R import com.zxbw.modulemain.R
import com.zxhl.cms.AppContext import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseRecyclerAdapter import com.zxhl.cms.common.base.BaseRecyclerAdapter
import com.zxhl.cms.net.model.box.AddressEntity import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.box.LotteryEntity
import com.zxhl.cms.utils.OnRecycleItemClickListener import com.zxhl.cms.utils.OnRecycleItemClickListener
import com.zxhl.cms.widget.RecycleImageView import kotlinx.android.synthetic.main.activity_layout_rights_detail.*
class JgqQyAdapter : BaseRecyclerAdapter<Any, JgqQyAdapter.ViewHolder> { class JgqQyAdapter : BaseRecyclerAdapter<JgqQyEntity, JgqQyAdapter.ViewHolder> {
private var mContext: Activity? = null private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<Any> private val listener: OnRecycleItemClickListener<JgqQyEntity>
constructor( constructor(
content: Activity?, content: Activity?,
listener: OnRecycleItemClickListener<Any> listener: OnRecycleItemClickListener<JgqQyEntity>
) : super() { ) : super() {
mContext = content mContext = content
this.listener = listener this.listener = listener
} }
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val bean = mList[position]
Glide.with(mContext!!).load("https://t10.baidu.com/it/u=3105518379,1723849651&fm=58").into(holder?.id_icon!!) Glide.with(mContext!!).load("https://t10.baidu.com/it/u=3105518379,1723849651&fm=58")
holder.id_name?.text = "爱奇艺" .apply(RequestOptions.bitmapTransform(CircleCrop()))
.into(holder?.id_icon!!)
holder.id_name?.text = bean.brand
holder.id_ll_qy_item_view?.setOnClickListener { holder.id_ll_qy_item_view?.setOnClickListener {
listener.onItemClick(it, position, null) listener.onItemClick(it, position, bean)
} }
} }
override fun getItemCount(): Int {
return 23
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder( return ViewHolder(
LayoutInflater.from(AppContext.get()) LayoutInflater.from(AppContext.get())
...@@ -63,7 +64,7 @@ class JgqQyAdapter : BaseRecyclerAdapter<Any, JgqQyAdapter.ViewHolder> { ...@@ -63,7 +64,7 @@ class JgqQyAdapter : BaseRecyclerAdapter<Any, JgqQyAdapter.ViewHolder> {
id_icon = id_icon =
itemView.findViewById<ImageView>(R.id.id_img_qy_icon) itemView.findViewById<ImageView>(R.id.id_img_qy_icon)
id_name = id_name =
itemView.findViewById<TextView>(R.id.id_img_qy_name) itemView.findViewById<TextView>(R.id.id_tv_qy_name)
} }
......
package com.zxbw.modulemain.adapter
import android.app.Activity
import android.content.Context
import android.graphics.Color
import android.graphics.Paint
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.zxbw.modulemain.R
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseRecyclerAdapter
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.qy.RightsDetailEntity
import com.zxhl.cms.utils.OnRecycleItemClickListener
class RightsDetailListAdapter :
BaseRecyclerAdapter<RightsDetailEntity, RightsDetailListAdapter.ViewHolder> {
private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<RightsDetailEntity>
private var mSelectPos: Int = -1;
constructor(
content: Activity?,
listener: OnRecycleItemClickListener<RightsDetailEntity>
) : super() {
mContext = content
this.listener = listener
}
fun setSelectPos(pos: Int) {
mSelectPos = pos
notifyDataSetChanged()
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val bean = mList[position]
holder.id_tv_rights_name?.text = bean.brand
holder.id_tv_rights_desc?.text = "${bean.category}${bean.goodsName}"
holder.id_tv_rights_price?.text = "${bean.salePrice}"
holder.id_tv_rights_old_price?.text = "¥${bean.originPrice}"
holder.id_tv_rights_old_price?.paint?.flags = Paint.STRIKE_THRU_TEXT_FLAG //中划线
if (position == mSelectPos) {
holder.id_ll_rights_item_view?.setBackgroundResource(R.drawable.img_rights_item_click)
holder.id_tv_rights_name?.setTextColor(Color.parseColor("#BA7E36"))
holder.id_tv_rights_desc?.setTextColor(Color.parseColor("#BA7E36"))
holder.id_tv_rights_price?.setTextColor(Color.parseColor("#BA7E36"))
holder.id_tv_rights_old_price?.setTextColor(Color.parseColor("#BA7E36"))
holder.id_tv_rights_old_price_desc?.setTextColor(Color.parseColor("#BA7E36"))
} else {
holder.id_ll_rights_item_view?.setBackgroundResource(R.drawable.img_rights_item_default)
holder.id_tv_rights_name?.setTextColor(Color.parseColor("#999999"))
holder.id_tv_rights_desc?.setTextColor(Color.parseColor("#999999"))
holder.id_tv_rights_price?.setTextColor(Color.parseColor("#999999"))
holder.id_tv_rights_old_price?.setTextColor(Color.parseColor("#999999"))
holder.id_tv_rights_old_price_desc?.setTextColor(Color.parseColor("#999999"))
}
holder.id_ll_rights_item_view?.setOnClickListener {
listener.onItemClick(it, position, bean)
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_rights_detail_view, parent, false)
)
}
class ViewHolder : RecyclerView.ViewHolder {
var id_ll_rights_item_view: LinearLayout?
var id_tv_rights_name: TextView?
var id_tv_rights_desc: TextView?
var id_tv_rights_price: TextView?
var id_tv_rights_old_price: TextView?
var id_tv_rights_old_price_desc: TextView?
constructor(
itemView: View
) : super(itemView) {
id_ll_rights_item_view =
itemView.findViewById<LinearLayout>(R.id.id_ll_rights_item_view)
id_tv_rights_name = itemView.findViewById<TextView>(R.id.id_tv_rights_name)
id_tv_rights_desc = itemView.findViewById<TextView>(R.id.id_tv_rights_desc)
id_tv_rights_price = itemView.findViewById<TextView>(R.id.id_tv_rights_price)
id_tv_rights_old_price = itemView.findViewById<TextView>(R.id.id_tv_rights_old_price)
id_tv_rights_old_price_desc = itemView.findViewById<TextView>(R.id.id_tv_rights_old_price_desc)
}
}
}
\ No newline at end of file
package com.zxbw.modulemain.adapter
import android.app.Activity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.zxbw.modulemain.R
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseRecyclerAdapter
import com.zxhl.cms.utils.OnRecycleItemClickListener
import com.zxhl.cms.widget.RecycleImageView
class ZeroBuyGoodsListAdapter : BaseRecyclerAdapter<Any, ZeroBuyGoodsListAdapter.ViewHolder> {
private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<Any>
constructor(
content: Activity?,
listener: OnRecycleItemClickListener<Any>
) : super() {
mContext = content
this.listener = listener
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.id_ll_zero_buy_goods_item_view?.setOnClickListener {
listener.onItemClick(it, position, null)
}
}
override fun getItemCount(): Int {
return 3
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_zero_buy_goods_view, parent, false)
)
}
class ViewHolder : RecyclerView.ViewHolder {
var id_ll_zero_buy_goods_item_view: LinearLayout?
var id_item_zero_buy_goods_img: RecycleImageView?
var id_tv_zero_buy_goods_name: TextView?
var id_tv_zero_buy_goods_price: TextView?
var id_tv_zero_buy_goods_old_price: TextView?
constructor(
itemView: View
) : super(itemView) {
id_ll_zero_buy_goods_item_view =
itemView.findViewById<LinearLayout>(R.id.id_ll_zero_buy_goods_item_view)
id_item_zero_buy_goods_img = itemView.findViewById<RecycleImageView>(R.id.id_item_zero_buy_goods_img)
id_tv_zero_buy_goods_name = itemView.findViewById<TextView>(R.id.id_tv_zero_buy_goods_name)
id_tv_zero_buy_goods_price = itemView.findViewById<TextView>(R.id.id_tv_zero_buy_goods_price)
id_tv_zero_buy_goods_old_price = itemView.findViewById<TextView>(R.id.id_tv_zero_buy_goods_old_price)
}
}
}
\ No newline at end of file
package com.zxbw.modulemain.contract package com.zxbw.modulemain.contract
import com.zxhl.cms.net.model.qy.JgqQyEntity
/** /**
* Created by gaoleichao on 2018/6/20. * 推荐
*
*/ */
class HomeRecommendContract { class HomeRecommendContract {
interface View { interface View {
fun setQyCardList() fun setQyCardList(result: List<JgqQyEntity>)
} }
interface Presenter { interface Presenter {
......
package com.zxbw.modulemain.contract
import com.zxhl.cms.net.model.qy.RightsDetailEntity
/**
* 权益详情
*/
class RightsDetailContract {
interface View {
fun setRightsDetail(result: List<RightsDetailEntity>)
}
interface Presenter {
fun geRightsDetail(brandName: String)
}
}
\ No newline at end of file
package com.zxbw.modulemain.contract
import android.app.Activity
import com.zxhl.cms.net.model.box.AppInEntity
import com.zxhl.cms.net.model.uc.AliPayEntity
import com.zxhl.cms.net.model.video.MemberEntity
/**
* Created by gaoleichao on 2021/8/31
*/
class RightsPayContract {
interface View {
fun requestOrderSuc(result: AliPayEntity)
fun requestOrderFail(errorMsg: String)
fun verifyOrderSuc(order: String)
fun verifyOrderFail(errorMsg: String)
}
interface Presenter {
fun requestRightsAliPay(goodsId: String, payType: String, phone: String)
fun verifyPay(order: String?, payType: Int)
}
}
\ No newline at end of file
...@@ -6,9 +6,12 @@ import androidx.recyclerview.widget.LinearLayoutManager ...@@ -6,9 +6,12 @@ import androidx.recyclerview.widget.LinearLayoutManager
import com.zxbw.modulemain.R import com.zxbw.modulemain.R
import com.zxbw.modulemain.adapter.GoodsListAdapter import com.zxbw.modulemain.adapter.GoodsListAdapter
import com.zxbw.modulemain.adapter.JgqQyAdapter import com.zxbw.modulemain.adapter.JgqQyAdapter
import com.zxbw.modulemain.adapter.ZeroBuyGoodsListAdapter
import com.zxbw.modulemain.contract.HomeRecommendContract import com.zxbw.modulemain.contract.HomeRecommendContract
import com.zxbw.modulemain.presenter.HomeRecommendPresenter import com.zxbw.modulemain.presenter.HomeRecommendPresenter
import com.zxhl.cms.common.base.BaseFragment import com.zxhl.cms.common.base.BaseFragment
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.OnRecycleItemClickListener import com.zxhl.cms.utils.OnRecycleItemClickListener
import kotlinx.android.synthetic.main.fragment_layout_recommend.* import kotlinx.android.synthetic.main.fragment_layout_recommend.*
...@@ -22,6 +25,7 @@ class RecommendFragment : BaseFragment, HomeRecommendContract.View { ...@@ -22,6 +25,7 @@ class RecommendFragment : BaseFragment, HomeRecommendContract.View {
private val title: String private val title: String
private var mPresenter: HomeRecommendPresenter? = null private var mPresenter: HomeRecommendPresenter? = null
private var mJgqQyAdapter: JgqQyAdapter? = null; private var mJgqQyAdapter: JgqQyAdapter? = null;
private var mZeroBuyAdapter: ZeroBuyGoodsListAdapter? = null;
private var mGoodsAdapter: GoodsListAdapter? = null; private var mGoodsAdapter: GoodsListAdapter? = null;
override fun layoutID(): Int { override fun layoutID(): Int {
...@@ -32,24 +36,30 @@ class RecommendFragment : BaseFragment, HomeRecommendContract.View { ...@@ -32,24 +36,30 @@ class RecommendFragment : BaseFragment, HomeRecommendContract.View {
mPresenter = HomeRecommendPresenter(this) mPresenter = HomeRecommendPresenter(this)
mJgqQyAdapter = JgqQyAdapter(activity, mJgqQyAdapter = JgqQyAdapter(activity,
OnRecycleItemClickListener<JgqQyEntity> { view, position, data ->
JumpUtils.RightsDetailJump(data.brand, "")
})
mZeroBuyAdapter = ZeroBuyGoodsListAdapter(activity,
OnRecycleItemClickListener<Any> { view, position, data -> OnRecycleItemClickListener<Any> { view, position, data ->
showToast("postion" + position) showToast("零元购")
}) })
mGoodsAdapter = GoodsListAdapter(activity, mGoodsAdapter = GoodsListAdapter(activity,
OnRecycleItemClickListener<Any> { view, position, data -> OnRecycleItemClickListener<Any> { view, position, data ->
showToast("postion" + position) showToast("postion" + position)
}) })
//金刚区权益
//金刚区
val gridLayoutManager = GridLayoutManager(activity, 3) val gridLayoutManager = GridLayoutManager(activity, 3)
gridLayoutManager.orientation = LinearLayoutManager.HORIZONTAL gridLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
id_rcl_jgq_qy_list?.layoutManager = gridLayoutManager id_rcl_jgq_qy_list?.layoutManager = gridLayoutManager
id_rcl_jgq_qy_list.adapter = mJgqQyAdapter id_rcl_jgq_qy_list.adapter = mJgqQyAdapter
//零元购
id_rcl_zero_buy_goods?.layoutManager = GridLayoutManager(activity, 3)
id_rcl_zero_buy_goods.adapter = mZeroBuyAdapter
//底部商品列表 //底部商品列表
id_rcl_goods_list?.layoutManager = LinearLayoutManager(activity) id_rcl_goods_list?.layoutManager = LinearLayoutManager(activity)
id_rcl_goods_list.adapter = mGoodsAdapter id_rcl_goods_list.adapter = mGoodsAdapter
mPresenter?.getQyCardList() mPresenter?.getQyCardList()
} }
...@@ -67,8 +77,9 @@ class RecommendFragment : BaseFragment, HomeRecommendContract.View { ...@@ -67,8 +77,9 @@ class RecommendFragment : BaseFragment, HomeRecommendContract.View {
this.title = "" this.title = ""
} }
override fun setQyCardList() { override fun setQyCardList(result: List<JgqQyEntity>) {
mJgqQyAdapter?.clear()
mJgqQyAdapter?.appendToList(result)
} }
} }
\ No newline at end of file
...@@ -9,12 +9,13 @@ import com.zxhl.cms.net.ApiClient ...@@ -9,12 +9,13 @@ import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.SettingPreference import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.callback.BaseObserver import com.zxhl.cms.net.callback.BaseObserver
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.uc.UserInfo import com.zxhl.cms.net.model.uc.UserInfo
import com.zxhl.cms.utils.EventUtils import com.zxhl.cms.utils.EventUtils
import com.zxhl.cms.utils.UserDataUtils import com.zxhl.cms.utils.UserDataUtils
/** /**
* Created by gaoleichao on 2018/6/20. * 推荐
*/ */
class HomeRecommendPresenter:HomeRecommendContract.Presenter { class HomeRecommendPresenter:HomeRecommendContract.Presenter {
...@@ -26,9 +27,11 @@ class HomeRecommendPresenter:HomeRecommendContract.Presenter { ...@@ -26,9 +27,11 @@ class HomeRecommendPresenter:HomeRecommendContract.Presenter {
override fun getQyCardList() { override fun getQyCardList() {
ApiClient.homeApi.getQyJgqCardList().compose(RxSchedulers.observableIO2Main()) ApiClient.homeApi.getQyJgqCardList().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<Any>>() { .subscribe(object : BaseObserver<List<JgqQyEntity>>() {
override fun onSuccess(result: List<Any>?) { override fun onSuccess(result: List<JgqQyEntity>?) {
mView.setQyCardList() if(!result.isNullOrEmpty()){
mView.setQyCardList(result)
}
} }
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) { override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
......
package com.zxbw.modulemain.presenter
import android.content.Context
import android.text.TextUtils
import android.util.Log
import com.zxbw.modulemain.contract.HomeRecommendContract
import com.zxbw.modulemain.contract.LoginContract
import com.zxbw.modulemain.contract.RightsDetailContract
import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.callback.BaseObserver
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.qy.RightsDetailEntity
import com.zxhl.cms.net.model.uc.UserInfo
import com.zxhl.cms.utils.EventUtils
import com.zxhl.cms.utils.UserDataUtils
/**
*/
class RightsDetailPresenter:RightsDetailContract.Presenter {
private val mView: RightsDetailContract.View
constructor(mView: RightsDetailContract.View) {
this.mView = mView
}
override fun geRightsDetail(brandName: String) {
ApiClient.homeApi.getQyJgqCardDetail(brandName,"2").compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<RightsDetailEntity>>() {
override fun onSuccess(result: List<RightsDetailEntity>?) {
if (!result.isNullOrEmpty()){
mView.setRightsDetail(result)
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
}
})
}
}
\ No newline at end of file
package com.zxbw.modulemain.presenter
import android.app.Activity
import android.text.TextUtils
import android.util.Log
import com.zxbw.modulemain.contract.RightsPayContract
import com.zxhl.cms.AppContext
import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.callback.BaseObserver
import com.zxhl.cms.net.model.box.AppInEntity
import com.zxhl.cms.net.model.box.BoxInfoEntity
import com.zxhl.cms.net.model.box.VerifacationEntity
import com.zxhl.cms.net.model.uc.AliPayEntity
import com.zxhl.cms.net.model.uc.PayMinEntity
import com.zxhl.cms.net.model.uc.PayVerifyEntity
import com.zxhl.cms.net.model.uc.WeChatPayEntity
import com.zxhl.cms.net.model.video.MemberEntity
import com.zxhl.cms.pay.alipay.AlipayServer
import com.zxhl.cms.utils.EventUtils
import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.UserDataUtils
import com.zxhl.cms.utils.WeChatPay
import org.json.JSONObject
/**
* Created by gaoleichao on 2021/8/31
*/
class RightsPayPresenter : RightsPayContract.Presenter {
private val mView: RightsPayContract.View
constructor(mView: RightsPayContract.View) {
this.mView = mView
}
override fun requestRightsAliPay(goodsId: String, payType: String, phone: String) {
ApiClient.userInfoAPi.aliPayRights(goodsId, payType, phone)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<AliPayEntity>() {
override fun onSuccess(result: AliPayEntity?) {
if (result != null) {
mView?.requestOrderSuc(result)
} else {
mView?.requestOrderFail("zfb订单支付请求成功 数据为空")
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.verifyOrderFail("zfb订单支付请求失败 code:${code} msg:${errorMsg}")
}
})
}
override fun verifyPay(order: String?, payType: Int) {
try {
if (payType == 1) {
val json = JSONObject(order)
val obj = json.getJSONObject("alipay_trade_app_pay_response")
val tradeOrder = obj.getString("trade_no")
val outTradeOrder = obj.getString("out_trade_no")
requestVerify(outTradeOrder, tradeOrder, payType)
} else if (payType == 2) {
val json = JSONObject(order)
val tradeOrder = ""
val outTradeOrder = json.getString("extData")
requestVerify(outTradeOrder, tradeOrder, payType)
} else if (payType == 11) {
if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType)
}
} else if (payType == 12) {
if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType)
}
}else if(payType==13){
if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType)
}
}
} catch (e: Exception) {
mView.verifyOrderFail("支付成功后 开始校验订单异常 e:${e.cause} msg:${e.message}")
}
}
private fun requestVerify(outTradeOrder: String, tradeOrder: String, payType: Int) {
ApiClient.userInfoAPi.verifyPay(outTradeOrder, tradeOrder, payType)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<PayVerifyEntity>() {
override fun onSuccess(result: PayVerifyEntity) {
UserDataUtils.updateUserInfo(null)
if (TextUtils.equals("200", result.status)) {
mView?.verifyOrderSuc(result.payStatus)
} else {
mView?.verifyOrderFail("订单校验请求成功 校验异常${result?.status?:-1}")
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.verifyOrderFail("订单校验请求失败:code:${code} msg:${errorMsg}")
}
})
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#EDD49D" />
<corners android:radius="2dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#F25E47" />
<corners android:radius="15dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffffff" />
<corners android:radius="5dp" />
</shape>
\ No newline at end of file
...@@ -20,6 +20,70 @@ ...@@ -20,6 +20,70 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:background="@drawable/shape_f25e47_r15"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="10dp"
android:layout_marginRight="12dp"
android:layout_marginBottom="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="新人首单0元购"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<View
android:layout_width="1dp"
android:layout_height="12dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#80ffffff" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="限时限量抢好物"
android:textColor="@color/white"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="20dp"
android:background="@drawable/shape_ffffff_r10"
android:gravity="center"
android:paddingLeft="9dp"
android:paddingRight="8dp"
android:text="查看更多 >"
android:textColor="#F25E47"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rcl_zero_buy_goods"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rcl_goods_list" android:id="@+id/id_rcl_goods_list"
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
android:id="@+id/id_ll_qy_item_view" android:id="@+id/id_ll_qy_item_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="15dp" android:layout_marginLeft="12dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginRight="15dp" android:layout_marginRight="12dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
android:layout_height="40dp" /> android:layout_height="40dp" />
<TextView <TextView
android:id="@+id/id_img_qy_name" android:id="@+id/id_tv_qy_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_ll_rights_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@drawable/img_rights_item_default"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="8dp"
android:paddingBottom="8dp">
<TextView
android:id="@+id/id_tv_rights_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="爱奇艺黄金"
android:textColor="@color/color_999999"
android:textSize="12sp" />
<TextView
android:id="@+id/id_tv_rights_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="会员月卡"
android:textColor="@color/color_999999"
android:textSize="12sp" />
<TextView
android:id="@+id/id_tv_rights_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="39"
android:textColor="@color/color_999999"
android:textSize="20sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/id_tv_rights_old_price_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="官方价 "
android:textColor="@color/color_999999"
android:textSize="10sp" />
<TextView
android:id="@+id/id_tv_rights_old_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥39"
android:textColor="@color/color_999999"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_ll_zero_buy_goods_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:background="@drawable/shape_ffffff_r5"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="10dp">
<com.zxhl.cms.widget.RecycleImageView
android:id="@+id/id_item_zero_buy_goods_img"
android:layout_width="match_parent"
android:layout_height="85dp"
android:layout_margin="4dp" />
<TextView
android:id="@+id/id_tv_zero_buy_goods_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:ellipsize="end"
android:maxLines="1"
android:text="商品名称商品名称品名称商品名称商品名称品名称商"
android:textColor="@color/color_333333"
android:textSize="12dp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="3dp"
android:text="¥"
android:textColor="#D81D00"
android:textSize="12sp" />
<TextView
android:id="@+id/id_tv_zero_buy_goods_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="0"
android:textColor="#D81D00"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_zero_buy_goods_old_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥20"
android:textColor="@color/color_999999"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment