Commit 23386ae3 authored by 王雪伟's avatar 王雪伟

Merge remote-tracking branch 'origin/master'

parents 5050b9cb 93821478
......@@ -9,4 +9,5 @@ class JgqQyEntity {
var brand: String? = ""
var sort: String? = ""
var icon: String? = ""
var maxDiscount: String? = ""
}
\ No newline at end of file
......@@ -206,7 +206,7 @@ interface RounterApi {
@RounterUri(Constant.scheme + "://zero_buy")
fun getIntentZeroBuyList(): Intent
@RounterUri(Constant.scheme + "://tb_goods_detail")
@RounterUri(Constant.scheme + "://tb_goods_detail")
fun getIntentTbGoodsDetail(): Intent
@RounterUri(Constant.scheme + "://after_login")
......@@ -255,4 +255,7 @@ interface RounterApi {
@RounterUri(Constant.scheme + "://flashsale")
fun getIntentFlashSale(): Intent
@RounterUri(Constant.scheme + "://withdrawal")
fun getIntentWithdrawal(): Intent
}
\ No newline at end of file
......@@ -378,4 +378,13 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void WithdrawalJump() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentWithdrawal();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppContext.get().startActivity(intent);
} catch (Exception e) {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
}
......@@ -68,7 +68,17 @@
android:scheme="xxsq" />
</intent-filter>
</activity>
<activity android:name=".activity.WithDrawalActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="withdrawal"
android:scheme="xxsq" />
</intent-filter>
</activity>
<activity android:name=".activity.RightsDetailActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
......
......@@ -8,11 +8,12 @@ import com.zxbw.modulemain.contract.CardVoucherContract
import com.zxbw.modulemain.presenter.CardVoucherPresenter
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.OnRecycleItemClickListener
import kotlinx.android.synthetic.main.activity_layout_card_voucher.*
class CardVoucherActivity:BaseActivity(),CardVoucherContract.View ,OnRecycleItemClickListener<Any>{
class CardVoucherActivity:BaseActivity(),CardVoucherContract.View ,OnRecycleItemClickListener<JgqQyEntity>{
private var mPresenter:CardVoucherPresenter?=null
private var mAdapter:CardAdapter?=null
override fun onClick(v: View?) {
......@@ -37,13 +38,20 @@ class CardVoucherActivity:BaseActivity(),CardVoucherContract.View ,OnRecycleItem
id_refresh_layout?.setOnRefreshListener {
mPresenter?.getCardList()
}
mPresenter?.getCardList()
}
override fun setData() {
override fun setData(result: List<JgqQyEntity>?) {
id_refresh_layout?.isRefreshing = false
mAdapter?.clear()
mAdapter?.appendToList(result)
mAdapter?.notifyDataSetChanged()
}
override fun onItemClick(view: View?, position: Int, data: Any?) {
override fun onItemClick(view: View?, position: Int, data: JgqQyEntity?) {
showToast(""+position)
JumpUtils.CardDetailJump()
}
......
package com.zxbw.modulemain.activity
import android.view.View
import com.zxbw.modulemain.R
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseActivity
class WithDrawalActivity:BaseActivity() {
override fun onClick(v: View?) {
}
override fun before() {
super.before()
setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
}
override fun layoutID(): Int {
return R.layout.activity_layout_withdrawal
}
override fun init() {
}
}
\ No newline at end of file
package com.zxbw.modulemain.adapter
import android.app.Activity
import android.graphics.Paint
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
......@@ -10,30 +11,35 @@ 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.net.model.qy.JgqQyEntity
import com.zxhl.cms.utils.OnRecycleItemClickListener
import com.zxhl.cms.widget.RecycleImageView
class CardAdapter : BaseRecyclerAdapter<Any, CardAdapter.ViewHolder> {
class CardAdapter : BaseRecyclerAdapter<JgqQyEntity, CardAdapter.ViewHolder> {
private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<Any>
private val listener: OnRecycleItemClickListener<JgqQyEntity>
constructor(
content: Activity?,
listener: OnRecycleItemClickListener<Any>
listener: OnRecycleItemClickListener<JgqQyEntity>
) : super() {
mContext = content
this.listener = listener
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
var bean = mList[position]
holder.id_tv_cards_name?.text="${bean.brand}"
holder.id_goods_icon?.setLoadImageUrl(bean.icon,false)
holder.id_goods_yuan_jia?.text=""
holder.id_tv_guanfang_price?.getPaint()?.setFlags(Paint.STRIKE_THRU_TEXT_FLAG) //中划线
holder.id_ll_item?.setOnClickListener {
listener.onItemClick(it, position, null)
}
}
override fun getItemCount(): Int {
return 23
return mList.size
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
......@@ -46,7 +52,9 @@ class CardAdapter : BaseRecyclerAdapter<Any, CardAdapter.ViewHolder> {
class ViewHolder : RecyclerView.ViewHolder {
var id_ll_item: LinearLayout?
var id_img_cards: RecycleImageView?
var id_goods_icon: RecycleImageView?
var id_tv_cards_name: TextView?
var id_goods_yuan_jia: TextView?
var id_tv_card_discount: TextView?
var id_tv_card_price: TextView?
var id_tv_guanfang_price: TextView?
......@@ -58,7 +66,9 @@ class CardAdapter : BaseRecyclerAdapter<Any, CardAdapter.ViewHolder> {
id_ll_item =
itemView.findViewById<LinearLayout>(R.id.id_ll_item)
id_img_cards = itemView.findViewById<RecycleImageView>(R.id.id_img_cards)
id_goods_icon = itemView.findViewById<RecycleImageView>(R.id.id_goods_icon)
id_tv_cards_name = itemView.findViewById<TextView>(R.id.id_tv_cards_name)
id_goods_yuan_jia = itemView.findViewById<TextView>(R.id.id_goods_yuan_jia)
id_tv_card_discount = itemView.findViewById<TextView>(R.id.id_tv_card_discount)
id_tv_card_price = itemView.findViewById<TextView>(R.id.id_tv_card_price)
id_tv_guanfang_price = itemView.findViewById<TextView>(R.id.id_tv_guanfang_price)
......
package com.zxbw.modulemain.contract
import com.zxhl.cms.net.model.qy.JgqQyEntity
class CardVoucherContract {
interface View {
fun setData()
fun setData(result: List<JgqQyEntity>?)
}
interface Presenter {
......
......@@ -32,7 +32,7 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
JumpUtils.webJump("关于我们", NetConfig.H5.WEB_URL_ABOUT_US)
}
id_ll_login_out?.setOnClickListener {
showToast("1")
}
id_ll_xieyi_zhengze?.setOnClickListener {
JumpUtils.webJump("隐私政策", NetConfig.H5.WEB_URL_PRIVACY)
......@@ -44,7 +44,7 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
JumpUtils.FlashSaleJump()
}
id_ll_shangwu_hezuo?.setOnClickListener {
JumpUtils.WithdrawalJump()
}
}
......
package com.zxbw.modulemain.presenter
import com.zxbw.modulemain.contract.CardVoucherContract
import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.callback.BaseObserver
import com.zxhl.cms.net.model.qy.JgqQyEntity
class CardVoucherPresenter : CardVoucherContract.Presenter {
private val mView: CardVoucherContract.View
......@@ -10,6 +14,17 @@ class CardVoucherPresenter : CardVoucherContract.Presenter {
}
override fun getCardList() {
ApiClient.homeApi.getQyJgqCardList().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<JgqQyEntity>>() {
override fun onSuccess(result: List<JgqQyEntity>?) {
if(!result.isNullOrEmpty()){
mView.setData(result)
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
}
})
}
}
\ 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="#ff333333" />
<corners
android:bottomLeftRadius="14dp"
android:bottomRightRadius="14dp"
android:topLeftRadius="14dp"
android:topRightRadius="14dp" />
</shape>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_ll_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="10dp"
android:layout_marginRight="16dp"
android:background="@drawable/shape_ffffff_r10"
android:id="@+id/id_ll_item"
android:orientation="horizontal">
<com.zxhl.cms.widget.RecycleImageView
android:id="@+id/id_img_cards"
<RelativeLayout
android:id="@+id/id_rl_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/img_daijinquan" />
android:padding="10dp">
<com.zxhl.cms.widget.RecycleImageView
android:id="@+id/id_img_cards"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/img_daijinquan" />
<com.zxhl.cms.widget.RecycleImageView
android:id="@+id/id_goods_icon"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_margin="8dp"
android:src="@drawable/icon_huangse" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/id_img_cards"
android:layout_marginLeft="50dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<TextView
android:id="@+id/id_goods_yuan_jia"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="元"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold"/>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
......@@ -26,8 +64,8 @@
android:id="@+id/id_tv_cards_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="猫眼电影5元代金券"
android:layout_marginTop="9dp"
android:text="猫眼电影5元代金券"
android:textColor="@color/color_333333"
android:textSize="14sp" />
......@@ -35,9 +73,9 @@
android:id="@+id/id_tv_card_discount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_edd49d_r4"
android:layout_marginBottom="8dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="8dp"
android:background="@drawable/shape_edd49d_r4"
android:paddingLeft="6dp"
android:paddingTop="2dp"
android:paddingRight="6dp"
......@@ -73,8 +111,8 @@
android:id="@+id/id_tv_guanfang_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="官方价 ¥5元"
android:layout_marginLeft="10dp"
android:text="官方价 ¥5元"
android:textColor="@color/color_999999"
android:textSize="10sp" />
</LinearLayout>
......
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