Commit b5a0a30d authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :小象省钱
[实现方案] :调整UI
parent e906f58a
......@@ -56,11 +56,19 @@ class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View {
id_tb_goods_detail_title_sys_bar_view.layoutParams.height = statusBarHeight
goodsDetail = intent.getSerializableExtra("goods") as TbGoodsItemEntity
refreshData()
// mPresenter?.getGoodsDetail(goodsDetail?.item_id ?: "")
}
private fun refreshData(){
mPresenter = TbGoodsDetailPresenter(this)
mGoodsAdapter = GoodsListAdapter(this,
OnRecycleItemClickListener<TbGoodsItemEntity> { view, position, data ->
JumpUtils.TbGoodsDetailJump()
var intent = Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putExtra("goods", data)
intent.setClass(this, TbGoodsDetailActivity().javaClass)
startActivity(intent)
})
id_rcl_recommend_goods_list?.layoutManager = LinearLayoutManager(this)
id_rcl_recommend_goods_list.adapter = mGoodsAdapter
......@@ -77,9 +85,16 @@ class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View {
link = goodsDetail?.item_id!!
}
mPresenter?.getConvertLink(link)
mPresenter?.getGoodsDetail(goodsDetail?.item_id ?: "")
mPresenter?.getTjGoodsList()
}
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
Log.d("wxw","newIntent")
if (intent!=null){
goodsDetail = intent.getSerializableExtra("goods") as TbGoodsItemEntity
refreshData()
}
}
private fun initView() {
......@@ -173,6 +188,13 @@ class TbGoodsDetailActivity : BaseActivity(), TbGoodsDetailContract.View {
}
override fun setTjGoodsList(isRefresh: Boolean, result: List<TbGoodsItemEntity>?) {
if (!result.isNullOrEmpty()){
mGoodsAdapter?.clear()
mGoodsAdapter?.appendToList(result)
}
}
private interface JumpTbCallBack {
fun jumpSuccess();
fun jumpError(error: String);
......
......@@ -39,13 +39,36 @@ class GoodsListAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, GoodsListAdapter
val bean = mList[position]
holder.id_tv_goods_name?.text = bean.title
if (mContext?.isFinishing == false) {
holder.id_item_goods_img?.setLoadImageUrl(bean.pict_url, 0, 5)
if(bean.pict_url?.startsWith("//img") == true){
holder.id_item_goods_img?.setLoadImageUrl("https:"+bean.pict_url, 0, 5)
}else{
holder.id_item_goods_img?.setLoadImageUrl(bean.pict_url, 0, 5)
}
}
holder.id_tv_tb_price_value?.text = "淘宝商城价 : ¥${bean.reserve_price}"
holder.id_tv_yhq_value?.text = "${bean.coupon_start_fee}元券"
var r_price = bean.reserve_price?.toDoubleOrNull() ?: 0 as Double
var c_price = bean.coupon_start_fee?.toDoubleOrNull() ?: 0 as Double
holder.id_tv_goods_price?.text = Utils.getNoMoreThanTwoDigits(Utils.sub(r_price, c_price))
if (bean.coupon_amount.isNullOrEmpty()){
holder.id_tv_yhq_value?.visibility =View.GONE
holder.id_tv_goods_price?.text ="${bean.reserve_price}"
}else{
holder.id_tv_yhq_value?.visibility =View.VISIBLE
holder.id_tv_yhq_value?.text = "${bean.coupon_amount}元券"
var r_price = bean.reserve_price?.toDoubleOrNull() ?: 0 as Double
var c_price = bean.coupon_amount?.toDoubleOrNull() ?: 0 as Double
holder.id_tv_goods_price?.text = Utils.getNoMoreThanTwoDigits(
Utils.sub(
r_price,
c_price
)
)
}
if (bean.coupon_info.isNullOrEmpty()){
holder.id_tv_manjian_value?.visibility =View.GONE
}else{
holder.id_tv_manjian_value?.visibility =View.VISIBLE
holder.id_tv_manjian_value?.text = "${bean.coupon_info}"
}
holder.id_rl_goods_item_view?.setOnClickListener {
listener.onItemClick(it, position, bean)
......
package com.zxbw.modulemain.contract
import com.zxhl.cms.net.model.qy.ConvertLinkEntity
import com.zxhl.cms.net.model.qy.TbGoodsItemEntity
/**
......@@ -13,6 +14,8 @@ class TbGoodsDetailContract {
fun setConvertLink(result: ConvertLinkEntity?)
fun setGoodsDetail()
fun setTjGoodsList(isRefresh: Boolean, result: List<TbGoodsItemEntity>?)
}
interface Presenter {
......@@ -20,6 +23,8 @@ class TbGoodsDetailContract {
fun getConvertLink(link: String)
fun getGoodsDetail(productId: String)
fun getTjGoodsList()
}
}
\ No newline at end of file
......@@ -97,13 +97,13 @@ class HomeFragment : BaseFragment(), HomeContract.View {
id_fragment_home_tab.textSelectColor = Color.parseColor("#333333")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FC333333")
id_fragment_home_tab.indicatorColor = Color.parseColor("#333333")
toolbar_layout.setContentScrimColor(Color.parseColor("#FFFFFFFF"))
toolbar_layout.setContentScrimColor(Color.parseColor("#8B3AFE"))
} else if (result[position].bannerType.equals("H5")) {
id_fragment_home_tab.textSelectColor = Color.parseColor("#333333")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FC333333")
id_fragment_home_tab.indicatorColor = Color.parseColor("#333333")
toolbar_layout.setContentScrimColor(Color.parseColor("#FFFFFFFF"))
toolbar_layout.setContentScrimColor(Color.parseColor("#628E43"))
} else {
id_fragment_home_tab.textSelectColor = Color.parseColor("#FFFFFF")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FCFFFFFF")
......@@ -121,12 +121,12 @@ class HomeFragment : BaseFragment(), HomeContract.View {
id_fragment_home_tab.textSelectColor = Color.parseColor("#333333")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FC333333")
id_fragment_home_tab.indicatorColor = Color.parseColor("#333333")
toolbar_layout.setContentScrimColor(Color.parseColor("#FFFFFFFF"))
toolbar_layout.setContentScrimColor(Color.parseColor("#8B3AFE"))
} else if (result[0].bannerType.equals("H5")) {
id_fragment_home_tab.textSelectColor = Color.parseColor("#333333")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FC333333")
id_fragment_home_tab.indicatorColor = Color.parseColor("#333333")
toolbar_layout.setContentScrimColor(Color.parseColor("#FFFFFFFF"))
toolbar_layout.setContentScrimColor(Color.parseColor("#628E43"))
} else {
id_fragment_home_tab.textSelectColor = Color.parseColor("#FFFFFF")
id_fragment_home_tab.textUnselectColor = Color.parseColor("#FCFFFFFF")
......
......@@ -66,4 +66,22 @@ class TbGoodsDetailPresenter : TbGoodsDetailContract.Presenter {
})
}
override fun getTjGoodsList() {
ApiClient.homeApi.getGoodsGuessLike(1, 20)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<TbGoodsEntity>() {
override fun onSuccess(result: TbGoodsEntity?) {
if (result != null) {
mView.setTjGoodsList(true, result.data)
} else {
mView.setTjGoodsList(true, null)
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView.setTjGoodsList(true, null)
}
})
}
}
\ No newline at end of file
......@@ -13,7 +13,8 @@
<View
android:id="@+id/id_rights_detail_title_sys_bar_view"
android:layout_width="match_parent"
android:layout_height="40dp" />
android:layout_height="40dp"
android:layout_marginBottom="15dp" />
<ImageView
android:id="@+id/id_img_back"
......@@ -31,7 +32,7 @@
android:includeFontPadding="false"
android:text="权益详情"
android:textColor="#FFF5E9"
android:textSize="16sp"
android:textSize="18sp"
android:textStyle="bold" />
......@@ -61,7 +62,7 @@
android:layout_toRightOf="@id/id_rl_logo_bg"
android:text=""
android:textColor="#EECAB2"
android:textSize="16sp"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
......@@ -73,7 +74,7 @@
android:layout_toRightOf="@id/id_rl_logo_bg"
android:text=""
android:textColor="#BDA18B"
android:textSize="12sp"
android:textSize="14sp"
android:textStyle="bold" />
......@@ -94,7 +95,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:layout_marginTop="20dp"
android:gravity="center_vertical"
android:orientation="horizontal">
......
......@@ -5,16 +5,10 @@
android:layout_height="match_parent"
android:background="#F6F6F6">
<View
android:id="@+id/id_tb_goods_detail_title_sys_bar_view"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/white" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/id_tb_goods_detail_title_sys_bar_view">
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
......@@ -128,13 +122,17 @@
android:textColor="@color/white"
android:textSize="14sp" />
</RelativeLayout>
<View
android:id="@+id/id_tb_goods_detail_title_sys_bar_view"
android:layout_width="match_parent"
android:layout_height="40dp" />
<ImageView
android:id="@+id/id_img_close_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="24dp"
android:layout_marginTop="10dp"
android:layout_below="@id/id_tb_goods_detail_title_sys_bar_view"
android:src="@drawable/img_tb_goods_detail_fanhui" />
<!-- 商品价格信息-->
<RelativeLayout
......@@ -289,7 +287,7 @@
android:maxLines="2"
android:text="商品名称 商品名称商品名称商商品名称商品名称商品名称商品名称商品名称商品名商品名商品名称商品名称商品名称商品名称商品名称商品名商品名称商品名商品名称商品名称商品名称商品名称商品名称商品名称商品名商品名称商品名商品名称称商品名商品名称品名称商品名称商品名称商品名商品名商品名称商品名称商品名称商品名称商品名称商品名商品名称商品名商品名称商品名称商品名称商品名称商品名称商品名称商品名商品名称商品名商品名称称商品名商品名称"
android:textColor="@color/color_333333"
android:textSize="16sp"
android:textSize="18sp"
android:textStyle="bold" />
</RelativeLayout>
<!--VIP开通提示-->
......@@ -351,10 +349,7 @@
android:id="@+id/id_rcl_recommend_goods_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/id_tv_recommend_desc"
android:layout_marginLeft="16dp"
android:layout_marginTop="10dp"
android:layout_marginRight="16dp" />
android:layout_below="@id/id_tv_recommend_desc" />
<View
android:layout_width="match_parent"
......
......@@ -24,7 +24,7 @@
<RelativeLayout
android:id="@+id/id_home_top_banner_view"
android:layout_width="match_parent"
android:layout_height="280dp">
android:layout_height="260dp">
<androidx.viewpager.widget.ViewPager
android:id="@+id/id_home_top_banner"
......@@ -103,17 +103,16 @@
android:layout_height="30dp"
android:layout_below="@+id/id_rl_search_view"
android:layout_marginTop="17dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
tl:tl_indicator_color="@color/white"
tl:tl_indicator_corner_radius="1dp"
tl:tl_indicator_height="2dp"
tl:tl_indicator_style="NORMAL"
tl:tl_indicator_width="14dp"
tl:tl_tab_padding="5dp"
tl:tl_tab_space_equal="true"
tl:tl_tab_padding="10dp"
tl:tl_textBold="SELECT"
tl:tl_textsize="14sp" />
tl:tl_textsize="18sp" />
</RelativeLayout>
......
......@@ -9,7 +9,6 @@
android:id="@+id/id_img_detail_banner_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY" />
android:scaleType="fitCenter" />
</LinearLayout>
......@@ -29,7 +29,7 @@
android:maxLines="2"
android:text="商品名称商品名称品名称商品名称商品名称品名称商"
android:textColor="@color/color_333333"
android:textSize="14dp"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
......@@ -117,8 +117,9 @@
android:drawableLeft="@drawable/icon_vip_price"
android:drawablePadding="3dp"
android:text="会员到手价"
android:textStyle="bold"
android:textColor="#F8E8CC"
android:textSize="10sp" />
android:textSize="11sp" />
</LinearLayout>
</LinearLayout>
......
......@@ -8,7 +8,7 @@
<ImageView
android:id="@+id/id_img_banner_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/img_banner_ms_bg" />
......
......@@ -17,7 +17,7 @@
android:layout_height="wrap_content"
android:text="爱奇艺黄金"
android:textColor="@color/color_999999"
android:textSize="12sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/id_tv_rights_desc"
......@@ -27,7 +27,7 @@
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:textColor="@color/color_999999"
android:textSize="12sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/id_tv_rights_price"
......@@ -42,7 +42,7 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:layout_marginTop="2dp"
android:gravity="center"
android:orientation="horizontal">
......
......@@ -7,7 +7,7 @@
<LinearLayout
android:id="@+id/id_layout_navigation_layout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="64dp"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:orientation="horizontal">
......@@ -25,7 +25,7 @@
android:includeFontPadding="false"
android:text="@string/bottom_vip"
android:textColor="@color/color_333333"
android:textSize="11sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/id_view_navigation_bottom_user"
......@@ -39,6 +39,6 @@
android:gravity="center"
android:text="@string/mine"
android:textColor="@color/color_999999"
android:textSize="11sp" />
android:textSize="14sp" />
</LinearLayout>
</merge>
\ 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