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

[提交人]:王雪伟

[提交简述] :小象省钱
[实现方案] :加入淘宝商品详情页
parent 10beb9c2
......@@ -228,7 +228,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
@Override
public void onFailure(Throwable e, String code, String errorMsg) {
exitActivity();
}
});
}
......
......@@ -6,10 +6,10 @@
<item name="windowActionBar">false</item>
<item name="android:textColorPrimary">@color/color_000000</item>
<item name="windowNoTitle">true</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="android:windowBackground">@color/colorPrimary</item>
<item name="colorPrimary">@color/white</item>
<item name="colorPrimaryDark">@color/white</item>
<item name="colorAccent">@color/white</item>
<item name="android:windowBackground">@color/white</item>
</style>
</resources>
\ No newline at end of file
......@@ -8,4 +8,5 @@ package com.zxhl.cms.net.model.qy
class JgqQyEntity {
var brand: String? = ""
var sort: String? = ""
var icon: String? = ""
}
\ No newline at end of file
......@@ -203,6 +203,12 @@ interface RounterApi {
@RounterParam("brandUrl") brandUrl: String
): Intent
@RounterUri(Constant.scheme + "://zero_buy")
fun getIntentZeroBuyList(): Intent
@RounterUri(Constant.scheme + "://tb_goods_detail")
fun getIntentTbGoodsDetail(): Intent
@RounterUri(Constant.scheme + "://after_login")
fun getIntentAfterLogin(
@RounterParam("boxid") boxid: String,
......
......@@ -41,6 +41,28 @@ public class JumpUtils {
}
}
//零元购
public static void ZeroBuyJump() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentZeroBuyList();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppContext.get().startActivity(intent);
} catch (Exception e) {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
//tb商品详情
public static void TbGoodsDetailJump() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentTbGoodsDetail();
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) {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentAfterLogin(boxid, needprice, type, onePrice, fivePrice, newPeople, page);
......@@ -327,6 +349,7 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void CardVoucherJump() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentCardVoucher();
......@@ -336,6 +359,7 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void CardDetailJump() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentCardDetail();
......
......@@ -71,6 +71,32 @@
</intent-filter>
</activity>
<activity android:name=".activity.ZeroBuyListActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="zero_buy"
android:scheme="xxsq" />
</intent-filter>
</activity>
<activity
android:name=".activity.TbGoodsDetailActivity"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="tb_goods_detail"
android:scheme="xxsq" />
</intent-filter>
</activity>
</application>
......
package com.zxbw.modulemain.activity
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import com.zxbw.modulemain.R
import com.zxbw.modulemain.adapter.GoodsListAdapter
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.OnRecycleItemClickListener
import kotlinx.android.synthetic.main.activity_layout_tb_goods_detail.*
import me.jessyan.autosize.utils.ScreenUtils
/**
* @author (wangXuewei)
* @datetime 2022-05-24 17:12 GMT+8
* @detail : 淘宝商品详情
*/
class TbGoodsDetailActivity : BaseActivity() {
private var mGoodsAdapter: GoodsListAdapter? = null;
override fun before() {
super.before()
setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
}
override fun layoutID(): Int {
return R.layout.activity_layout_tb_goods_detail
}
override fun init() {
var statusBarHeight = ScreenUtils.getStatusBarHeight()
if (statusBarHeight <= 0) {
statusBarHeight = 40;
}
id_tb_goods_detail_title_sys_bar_view.layoutParams.height = statusBarHeight
mGoodsAdapter = GoodsListAdapter(this,
OnRecycleItemClickListener<Any> { view, position, data ->
showToast("postion" + position)
JumpUtils.TbGoodsDetailJump()
})
id_rcl_recommend_goods_list?.layoutManager = LinearLayoutManager(this)
id_rcl_recommend_goods_list.adapter = mGoodsAdapter
id_img_close_btn?.setOnClickListener(this)
}
override fun onClick(v: View?) {
when (v) {
id_img_close_btn -> {
finish()
}
}
}
}
\ No newline at end of file
package com.zxbw.modulemain.activity
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import com.zxbw.modulemain.R
import com.zxbw.modulemain.adapter.GoodsListAdapter
import com.zxbw.modulemain.contract.ZeroBuyListContract
import com.zxbw.modulemain.presenter.ZeroBuyListPresenter
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.utils.OnRecycleItemClickListener
import kotlinx.android.synthetic.main.activity_layout_zero_buy_list.*
/**
* @author (wangXuewei)
* @datetime 2022-05-24 14:08 GMT+8
* @detail :零元购列表
*/
class ZeroBuyListActivity : BaseActivity(), ZeroBuyListContract.View,
OnRecycleItemClickListener<Any> {
private var mPresenter: ZeroBuyListPresenter? = null
private var mAdapter: GoodsListAdapter? = null;
override fun layoutID(): Int {
return R.layout.activity_layout_zero_buy_list
}
override fun before() {
super.before()
setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
}
override fun onClick(v: View?) {
when (v) {
id_img_back -> {
finish()
}
}
}
override fun init() {
mPresenter = ZeroBuyListPresenter(this)
id_img_back?.setOnClickListener(this)
mAdapter = GoodsListAdapter(this, this)
id_rcl_zero_buy_list?.layoutManager = LinearLayoutManager(this)
id_rcl_zero_buy_list.adapter = mAdapter
id_zero_buy_refreshLayout.setOnRefreshListener{
mPresenter?.getZeroBuyList()
}
mPresenter?.getZeroBuyList()
}
override fun onItemClick(view: View?, position: Int, data: Any?) {
}
override fun setZeroBuyList(isRefresh: Boolean, result: List<Any>?) {
id_zero_buy_refreshLayout?.isRefreshing = false
}
}
\ No newline at end of file
......@@ -36,7 +36,7 @@ class JgqQyAdapter : BaseRecyclerAdapter<JgqQyEntity, JgqQyAdapter.ViewHolder> {
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")
Glide.with(mContext!!).load(bean.icon)
.apply(RequestOptions.bitmapTransform(CircleCrop()))
.into(holder?.id_icon!!)
holder.id_name?.text = bean.brand
......
package com.zxbw.modulemain.contract
/**
* 推荐
*
*/
class ZeroBuyListContract {
interface View {
fun setZeroBuyList(isRefresh: Boolean, result: List<Any>?)
}
interface Presenter {
fun getZeroBuyList()
}
}
\ No newline at end of file
......@@ -37,17 +37,19 @@ class RecommendFragment : BaseFragment, HomeRecommendContract.View {
mJgqQyAdapter = JgqQyAdapter(activity,
OnRecycleItemClickListener<JgqQyEntity> { view, position, data ->
JumpUtils.RightsDetailJump(data.brand, "")
JumpUtils.RightsDetailJump(data.brand, data.icon)
})
mZeroBuyAdapter = ZeroBuyGoodsListAdapter(activity,
OnRecycleItemClickListener<Any> { view, position, data ->
showToast("零元购")
JumpUtils.ZeroBuyJump()
})
mGoodsAdapter = GoodsListAdapter(activity,
OnRecycleItemClickListener<Any> { view, position, data ->
showToast("postion" + position)
JumpUtils.TbGoodsDetailJump()
})
//金刚区权益
val gridLayoutManager = GridLayoutManager(activity, 3)
gridLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
......@@ -60,6 +62,11 @@ class RecommendFragment : BaseFragment, HomeRecommendContract.View {
id_rcl_goods_list?.layoutManager = LinearLayoutManager(activity)
id_rcl_goods_list.adapter = mGoodsAdapter
id_ll_zero_buy_view.setOnClickListener {
JumpUtils.ZeroBuyJump()
}
mPresenter?.getQyCardList()
}
......
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.ZeroBuyListContract
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.uc.UserInfo
import com.zxhl.cms.utils.EventUtils
import com.zxhl.cms.utils.UserDataUtils
/**
* 零元购
*/
class ZeroBuyListPresenter : ZeroBuyListContract.Presenter {
private val mView: ZeroBuyListContract.View
constructor(mView: ZeroBuyListContract.View) {
this.mView = mView
}
override fun getZeroBuyList() {
mView?.setZeroBuyList(false, null)
}
}
\ 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="#323233" />
<corners android:radius="6dp" />
</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="#918782" />
<corners android:radius="15dp" />
</shape>
\ No newline at end of file
......@@ -40,10 +40,11 @@
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_below="@+id/id_img_back"
android:layout_marginLeft="35dp"
android:layout_marginStart="35dp"
android:layout_marginTop="45dp"
android:layout_marginRight="10dp"
android:background="@drawable/img_rights_logo_bg">
android:layout_marginEnd="10dp"
android:background="@drawable/img_rights_logo_bg"
android:gravity="center">
<ImageView
android:id="@+id/id_img_bread_logo"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#DD453C">
<ImageView
android:id="@+id/id_img_zero_bug_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/img_zero_bug_banner_bg" />
<RelativeLayout
android:id="@+id/id_rl_title"
android:layout_width="match_parent"
android:layout_height="68dp">
<ImageView
android:id="@+id/id_img_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:padding="16dp"
android:src="@drawable/img_rights_fanhui" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="15dp"
android:text=""
android:textColor="@color/color_333333"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/id_zero_buy_refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_below="@id/id_img_zero_bug_banner">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rcl_zero_buy_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</RelativeLayout>
......@@ -21,6 +21,7 @@
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/id_ll_zero_buy_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
......
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