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

[提交人]:王雪伟

[提交简述] :1.1.7
[实现方案] :加入新的H5支付类型
parent 060a6f50
...@@ -15,6 +15,7 @@ import com.umeng.analytics.MobclickAgent; ...@@ -15,6 +15,7 @@ import com.umeng.analytics.MobclickAgent;
import com.umeng.socialize.UMShareAPI; import com.umeng.socialize.UMShareAPI;
import com.zxbw.modulemain.fragment.CashCheckFragment; import com.zxbw.modulemain.fragment.CashCheckFragment;
import com.zxbw.modulemain.fragment.HomeFragment; import com.zxbw.modulemain.fragment.HomeFragment;
import com.zxbw.modulemain.fragment.ShoppingMallFragment;
import com.zxbw.modulemain.fragment.UserCenterFragment; import com.zxbw.modulemain.fragment.UserCenterFragment;
import com.zxbw.modulemain.view.NavigationBottomView; import com.zxbw.modulemain.view.NavigationBottomView;
import com.zxhl.cms.utils.ClipboardManagerUtil; import com.zxhl.cms.utils.ClipboardManagerUtil;
...@@ -106,7 +107,6 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N ...@@ -106,7 +107,6 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
} }
}); });
boolean firstLoginApp = SettingPreference.getFirstLoginApp(); boolean firstLoginApp = SettingPreference.getFirstLoginApp();
if (firstLoginApp) { if (firstLoginApp) {
UserInfo userInfoData = SettingPreference.getUserInfoData(); UserInfo userInfoData = SettingPreference.getUserInfoData();
...@@ -126,6 +126,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N ...@@ -126,6 +126,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
private void initFragment() { private void initFragment() {
fragments.add(new HomeFragment()); fragments.add(new HomeFragment());
fragments.add(new ShoppingMallFragment());
fragments.add(new CashCheckFragment()); fragments.add(new CashCheckFragment());
fragments.add(new UserCenterFragment()); fragments.add(new UserCenterFragment());
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
...@@ -166,11 +167,14 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N ...@@ -166,11 +167,14 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
if (vId == com.zxbw.modulemain.R.id.id_view_navigation_bottom_box) { if (vId == com.zxbw.modulemain.R.id.id_view_navigation_bottom_box) {
switchFragment(0); switchFragment(0);
EventUtils.INSTANCE.onEvent("tab_imp", "home"); EventUtils.INSTANCE.onEvent("tab_imp", "home");
} else if (vId == com.zxbw.modulemain.R.id.id_view_navigation_bottom_cash) { } else if (vId == com.zxbw.modulemain.R.id.id_view_navigation_bottom_shop) {
switchFragment(1); switchFragment(1);
EventUtils.INSTANCE.onEvent("tab_imp", "shop");
} else if (vId == com.zxbw.modulemain.R.id.id_view_navigation_bottom_cash) {
switchFragment(2);
EventUtils.INSTANCE.onEvent("tab_imp", "cash_check"); EventUtils.INSTANCE.onEvent("tab_imp", "cash_check");
} if (vId == com.zxbw.modulemain.R.id.id_view_navigation_bottom_user) { } if (vId == com.zxbw.modulemain.R.id.id_view_navigation_bottom_user) {
switchFragment(2); switchFragment(3);
EventUtils.INSTANCE.onEvent("tab_imp", "user"); EventUtils.INSTANCE.onEvent("tab_imp", "user");
} }
} }
......
PACKAGE_NAME=com.zxhl.shop PACKAGE_NAME=com.zxhl.shop
VERSION_CODE=16 VERSION_CODE=18
VERSION_NAME=1.1.5 VERSION_NAME=1.1.7
\ No newline at end of file \ No newline at end of file
package com.zxhl.cms.net.model.shop package com.zxhl.cms.net.model.shop
import java.io.Serializable
/** /**
* @author (wangXuewei) * @author (wangXuewei)
* @datetime 2022-03-01 15:17 GMT+8 * @datetime 2022-03-01 16:40 GMT+8
* @detail : * @detail :
*/ */
class ShopListEntity : Serializable { class ShopGoodsEntity {
var id: String ="" var id: String =""
var boxId: Int = 0 var boxId: Int = 0
var productName: String = "" var productName: String = ""
......
package com.zxhl.cms.net.model.shop package com.zxhl.cms.net.model.shop
import java.io.Serializable
/** /**
* @author (wangXuewei) * @author (wangXuewei)
* @datetime 2022-03-01 16:40 GMT+8 * @datetime 2022-03-01 15:17 GMT+8
* @detail : * @detail :
*/ */
class ShopEntity { class ShopGoodsListEntity : Serializable {
var list: List<ShopListEntity>? = null var list: List<ShopGoodsEntity>? = null
var bannerImg: String = "" var bannerImg: String = ""
} }
\ No newline at end of file
...@@ -24,7 +24,9 @@ import java.util.* ...@@ -24,7 +24,9 @@ import java.util.*
* @detail : * @detail :
*/ */
class H5PayUtil { class H5PayUtil {
interface SdPayCallBack { interface H5AppPayCallBack {
// fun jumpAppSuc(payType: Int);
fun jumpAppException(e: Exception);
} }
interface H5PayCallBack { interface H5PayCallBack {
...@@ -130,10 +132,26 @@ class H5PayUtil { ...@@ -130,10 +132,26 @@ class H5PayUtil {
} }
fun loadH5AppPay(mActivity: Activity, payType: Int, url: String, callBack: H5AppPayCallBack) {
try {
mActivity.startActivity(Intent(Intent.ACTION_VIEW,Uri.parse(url)))
// callBack.jumpAppSuc(payType)
} catch (e: Exception) {
//防止crash (如果手机上没有安装处理某个scheme开头的url的APP, 会导致crash)
callBack.jumpAppException(e)
}
}
fun loadZfbPay(mActivity: Activity) { fun loadZfbPay(mActivity: Activity) {
// cashierPay(mActivity, "MD5", "16938552", "02020006") // cashierPay(mActivity, "MD5", "16938552", "02020006")
cashierPay(mActivity, "MD5", "16938552", "02020004") // cashierPay(mActivity, "MD5", "16938552", "02020004")
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse("alipays://platformapi/startapp?appId=20000067&url=https%3A%2F%2Fmtest.dinpay.com%2Fippapi%2Fgateway%2Fapi%2Fh5ToPay%3Ftoken%3DC4E166EC5C66D7A699EA7D9B2FCEC492")
)
mActivity.startActivity(intent)
} }
...@@ -292,17 +310,17 @@ class H5PayUtil { ...@@ -292,17 +310,17 @@ class H5PayUtil {
}) })
} }
fun sdPayUtil(mActivity: Activity, orderJson: String, callBack: SdPayCallBack) { // fun sdPayUtil(mActivity: Activity, orderJson: String, callBack: SdPayCallBack) {
Log.e("PayUtil", "orderJson:${orderJson}") // Log.e("PayUtil", "orderJson:${orderJson}")
PayUtil.CashierPaySingle(mActivity, orderJson, object : OnPayResultListener { // PayUtil.CashierPaySingle(mActivity, orderJson, object : OnPayResultListener {
override fun onSuccess(p0: OrderInfo?) { // override fun onSuccess(p0: OrderInfo?) {
//
} // }
//
override fun onError(p0: String?) { // override fun onError(p0: String?) {
Log.e("PayUtil", "payError:${p0}") // Log.e("PayUtil", "payError:${p0}")
} // }
//
}) // })
} // }
} }
\ No newline at end of file
package com.zxhl.cms.pay package com.zxhl.cms.pay
import android.annotation.SuppressLint
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Handler import android.os.Handler
...@@ -63,13 +62,13 @@ class PayActivity : BaseActivity(), PayContract.View, ...@@ -63,13 +62,13 @@ class PayActivity : BaseActivity(), PayContract.View,
private var mPayFunAdapter: PaymentFunAdapter? = null; private var mPayFunAdapter: PaymentFunAdapter? = null;
companion object { // companion object {
const val ALI_PAY = 1 //支付宝支付类型 // const val ALI_PAY = 1 //支付宝支付类型
const val WECHAT_PAY = 2 //微信支付类型 // const val WECHAT_PAY = 2 //微信支付类型
const val MINI_PROGRAM = 11 //微信支付类型 // const val MINI_PROGRAM = 11 //微信支付类型
const val MIN_PAY_PROGRAM = 13 //敏付 // const val MIN_PAY_PROGRAM = 13 //敏付
const val H5_PAY = 21 //h5支付 // const val H5_PAY = 21 //h5支付
} // }
private var pay_type: Int? = 0 private var pay_type: Int? = 0
override fun before() { override fun before() {
...@@ -169,17 +168,17 @@ class PayActivity : BaseActivity(), PayContract.View, ...@@ -169,17 +168,17 @@ class PayActivity : BaseActivity(), PayContract.View,
EventUtils.onEvent("pay_page_pay_btn", product?.cash + "") EventUtils.onEvent("pay_page_pay_btn", product?.cash + "")
EventUtils.onEvent("pay_page_pay_type", "payType$pay_type") EventUtils.onEvent("pay_page_pay_type", "payType$pay_type")
if (ifChooseNeedPrice!!) { if (ifChooseNeedPrice!!) {
if (pay_type == ALI_PAY) { if (pay_type == PaymentConfig.ALI_PAY) {
mPresenter?.requestAliPay( mPresenter?.requestAliPay(
this, this,
id_tv_need_price.text.toString(), id_tv_need_price.text.toString(),
pay_type.toString(), pay_type.toString(),
"6" "6"
) )
} else if (pay_type == WECHAT_PAY) { } else if (pay_type == PaymentConfig.WECHAT_PAY) {
Log.e("MXL", "微信原生支付") Log.e("MXL", "微信原生支付")
mPresenter?.requestWechatPayOrder("", pay_type.toString()) mPresenter?.requestWechatPayOrder("", pay_type.toString())
} else if (pay_type == MINI_PROGRAM) { } else if (pay_type == PaymentConfig.MINI_PROGRAM) {
Log.e("MXL", "微信连连支付") Log.e("MXL", "微信连连支付")
mPresenter?.requestWechatPayOrder("", pay_type.toString()) mPresenter?.requestWechatPayOrder("", pay_type.toString())
} else { } else {
...@@ -192,20 +191,20 @@ class PayActivity : BaseActivity(), PayContract.View, ...@@ -192,20 +191,20 @@ class PayActivity : BaseActivity(), PayContract.View,
} }
} else { } else {
if (pay_type == ALI_PAY) { if (pay_type == PaymentConfig.ALI_PAY) {
mPresenter?.requestAliPay( mPresenter?.requestAliPay(
this, this,
product?.goodsId ?: "", product?.goodsId ?: "",
pay_type.toString(), pay_type.toString(),
"6" "6"
) )
} else if (pay_type == WECHAT_PAY) { } else if (pay_type == PaymentConfig.WECHAT_PAY) {
Log.e("MXL", "2微信原生支付") Log.e("MXL", "2微信原生支付")
mPresenter?.requestWechatPayOrder( mPresenter?.requestWechatPayOrder(
product?.goodsId ?: "", product?.goodsId ?: "",
pay_type.toString() pay_type.toString()
) )
} else if (pay_type == MINI_PROGRAM) { } else if (pay_type == PaymentConfig.MINI_PROGRAM) {
Log.e("MXL", "2微信连连支付") Log.e("MXL", "2微信连连支付")
mPresenter?.requestWechatPayOrder( mPresenter?.requestWechatPayOrder(
product?.goodsId ?: "", product?.goodsId ?: "",
...@@ -365,7 +364,24 @@ class PayActivity : BaseActivity(), PayContract.View, ...@@ -365,7 +364,24 @@ class PayActivity : BaseActivity(), PayContract.View,
onEvent("h5_pay_error") onEvent("h5_pay_error")
showResultLoading(false) showResultLoading(false)
} else { } else {
if (pay_type == PaymentConfig.H5_PAY) {
loadH5Pay(form) loadH5Pay(form)
} else {
H5PayUtil().loadH5AppPay(
this,
pay_type!!,
form ?: "",
object : H5PayUtil.H5AppPayCallBack {
override fun jumpAppException(e: Exception) {
EventUtils.onEvent("H5AppPayError", "error:${pay_type}")
if (pay_type == PaymentConfig.ZFB_H5_PAY||pay_type == PaymentConfig.HUI_FU_H5_PAY1) {
mLoading?.setResult(false, "支付失败,请安装支付宝后重试", 1000)
} else {
mLoading?.setResult(false, "支付失败,请安装微信后重试", 1000)
}
}
})
}
} }
} }
...@@ -415,7 +431,7 @@ class PayActivity : BaseActivity(), PayContract.View, ...@@ -415,7 +431,7 @@ class PayActivity : BaseActivity(), PayContract.View,
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (isPause) { if (isPause) {
if (pay_type == MIN_PAY_PROGRAM || pay_type == H5_PAY) { if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY || pay_type == PaymentConfig.ZFB_H5_PAY || pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
//如果是敏支付或者H5支付 //如果是敏支付或者H5支付
mPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!) mPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!)
} else { } else {
...@@ -516,7 +532,7 @@ class PayActivity : BaseActivity(), PayContract.View, ...@@ -516,7 +532,7 @@ class PayActivity : BaseActivity(), PayContract.View,
private fun loadH5Pay(form: String) { private fun loadH5Pay(form: String) {
// id_pay_web_view.visibility = View.VISIBLE // id_pay_web_view.visibility = View.VISIBLE
Log.d("wxw","startTime"+System.currentTimeMillis()) Log.d("wxw", "startTime" + System.currentTimeMillis())
val webSettings = id_pay_web_view.settings val webSettings = id_pay_web_view.settings
//如果访问的页面中要与Javascript交互,则webview必须设置支持Javascript //如果访问的页面中要与Javascript交互,则webview必须设置支持Javascript
webSettings.javaScriptEnabled = true webSettings.javaScriptEnabled = true
...@@ -556,7 +572,7 @@ class PayActivity : BaseActivity(), PayContract.View, ...@@ -556,7 +572,7 @@ class PayActivity : BaseActivity(), PayContract.View,
override fun onPageFinished(view: WebView?, url: String?) { override fun onPageFinished(view: WebView?, url: String?) {
Log.e("WXW", "cURL" + url.toString()) Log.e("WXW", "cURL" + url.toString())
Log.d("wxw","EndTime"+System.currentTimeMillis()) Log.d("wxw", "EndTime" + System.currentTimeMillis())
super.onPageFinished(view, url) super.onPageFinished(view, url)
if (url?.contains(NetConfig.H5.WEB_URL_H5_PAY) == true) { if (url?.contains(NetConfig.H5.WEB_URL_H5_PAY) == true) {
id_pay_web_view?.loadUrl("javascript:loadPayHtml('$form')"); id_pay_web_view?.loadUrl("javascript:loadPayHtml('$form')");
......
...@@ -151,14 +151,15 @@ object PayDialog : PayContract.View { ...@@ -151,14 +151,15 @@ object PayDialog : PayContract.View {
pay_type.toString(), pay_type.toString(),
"6" "6"
) )
} else if (pay_type == 13 || pay_type == 21) { } else if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY || pay_type == PaymentConfig.ZFB_H5_PAY || pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
mPresenter?.requestMiniProgrom( mPresenter?.requestMiniProgrom(
payPrice, payPrice,
pay_type.toString(), pay_type.toString(),
"6" "6"
) )
} else if (pay_type == PaymentConfig.SD_PAY) { } else if (pay_type == PaymentConfig.SD_PAY) {
mPresenter?.requestSdPay("xxsqshop://goodsdetail", mPresenter?.requestSdPay(
"xxsqshop://goodsdetail",
context, context,
payPrice, payPrice,
pay_type.toString(), pay_type.toString(),
...@@ -166,6 +167,7 @@ object PayDialog : PayContract.View { ...@@ -166,6 +167,7 @@ object PayDialog : PayContract.View {
) )
} else { } else {
Utils.showToast(context, "暂不支持") Utils.showToast(context, "暂不支持")
mLoading?.setLoading("支付取消")
} }
} }
...@@ -267,6 +269,7 @@ object PayDialog : PayContract.View { ...@@ -267,6 +269,7 @@ object PayDialog : PayContract.View {
if (mActivity?.isDestroyed == true) { if (mActivity?.isDestroyed == true) {
return return
} }
if (pay_type == PaymentConfig.H5_PAY) {
mHandler.sendEmptyMessageDelayed(1, 8000) mHandler.sendEmptyMessageDelayed(1, 8000)
H5PayUtil().loadH5PayWeb( H5PayUtil().loadH5PayWeb(
mActivity!!, mActivity!!,
...@@ -293,6 +296,23 @@ object PayDialog : PayContract.View { ...@@ -293,6 +296,23 @@ object PayDialog : PayContract.View {
EventUtils.onEvent("h5_pay_error2", errorStr) EventUtils.onEvent("h5_pay_error2", errorStr)
} }
}) })
} else {
H5PayUtil().loadH5AppPay(
mActivity!!,
pay_type!!,
form ?: "",
object : H5PayUtil.H5AppPayCallBack {
override fun jumpAppException(e: Exception) {
EventUtils.onEvent("H5AppPayError", "error:${pay_type}")
if (pay_type == PaymentConfig.ZFB_H5_PAY||pay_type == PaymentConfig.HUI_FU_H5_PAY1) {
mLoading?.setResult(false, "支付失败,请安装支付宝后重试", 1000)
} else {
mLoading?.setResult(false, "支付失败,请安装微信后重试", 1000)
}
}
})
}
} }
} }
...@@ -343,7 +363,7 @@ object PayDialog : PayContract.View { ...@@ -343,7 +363,7 @@ object PayDialog : PayContract.View {
mLoading?.setResult(false, "取消支付", 1000) mLoading?.setResult(false, "取消支付", 1000)
} else { } else {
if (mDialog?.isShowing == true) { if (mDialog?.isShowing == true) {
if (pay_type == PayActivity.MIN_PAY_PROGRAM || pay_type == PayActivity.H5_PAY) { if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY || pay_type == PaymentConfig.ZFB_H5_PAY || pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
//如果是敏支付 //如果是敏支付
mPresenter?.verifyPay( mPresenter?.verifyPay(
SettingPreference.getOutTradeNo(), SettingPreference.getOutTradeNo(),
......
...@@ -150,6 +150,9 @@ class PayPresenter : PayContract.Presenter { ...@@ -150,6 +150,9 @@ class PayPresenter : PayContract.Presenter {
}else if (payType == PaymentConfig.SD_PAY.toString()) { }else if (payType == PaymentConfig.SD_PAY.toString()) {
SettingPreference.setOutTradeNo(result?.outTradeNo) SettingPreference.setOutTradeNo(result?.outTradeNo)
PayUtil.CashierPaySingle(activity,result.wakeup) PayUtil.CashierPaySingle(activity,result.wakeup)
}else if (payType == PaymentConfig.ZFB_H5_PAY.toString()||payType == PaymentConfig.WX_H5_PAY.toString()|| payType == PaymentConfig.HUI_FU_H5_PAY1.toString()|| payType == PaymentConfig.HUI_FU_H5_PAY2.toString()) {
SettingPreference.setOutTradeNo(result?.outTradeNo)
mView.requestH5OrderSuc(result.wakeup ?: "")
} else { } else {
AlipayServer.payV2(activity, result.wakeup!!) AlipayServer.payV2(activity, result.wakeup!!)
} }
...@@ -180,6 +183,9 @@ class PayPresenter : PayContract.Presenter { ...@@ -180,6 +183,9 @@ class PayPresenter : PayContract.Presenter {
JumpUtils.h5Jump("https://api.minpayment.com/pay.do?sendMsg=" + result.wakeup) JumpUtils.h5Jump("https://api.minpayment.com/pay.do?sendMsg=" + result.wakeup)
} else if (payType == "21") { } else if (payType == "21") {
mView.requestH5OrderSuc(result.outTradeNo ?: "") mView.requestH5OrderSuc(result.outTradeNo ?: "")
}else if (payType == PaymentConfig.ZFB_H5_PAY.toString()||payType == PaymentConfig.WX_H5_PAY.toString()|| payType == PaymentConfig.HUI_FU_H5_PAY1.toString()|| payType == PaymentConfig.HUI_FU_H5_PAY2.toString()) {
SettingPreference.setOutTradeNo(result?.outTradeNo)
mView.requestH5OrderSuc(result.wakeup ?: "")
} }
//WeChatPay.startWeChatProgromPay(result, payType) //WeChatPay.startWeChatProgromPay(result, payType)
mView?.requestOrderSuc() mView?.requestOrderSuc()
...@@ -322,7 +328,11 @@ class PayPresenter : PayContract.Presenter { ...@@ -322,7 +328,11 @@ class PayPresenter : PayContract.Presenter {
if (!TextUtils.isEmpty(order)) { if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType) requestVerify(order ?: "", "", payType)
} }
} else { } else if (payType == PaymentConfig.ZFB_H5_PAY||payType == PaymentConfig.WX_H5_PAY|| payType == PaymentConfig.HUI_FU_H5_PAY1|| payType == PaymentConfig.HUI_FU_H5_PAY2) {
if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType)
}
}else {
mView.verifyOrderFail("支付成功后 开始校验订单异常 e:支付方式异常$payType") mView.verifyOrderFail("支付成功后 开始校验订单异常 e:支付方式异常$payType")
} }
} catch (e: Exception) { } catch (e: Exception) {
......
...@@ -13,5 +13,9 @@ class PaymentConfig { ...@@ -13,5 +13,9 @@ class PaymentConfig {
const val MIN_PAY_PROGRAM = 13 //敏付 const val MIN_PAY_PROGRAM = 13 //敏付
const val H5_PAY = 21 //h5支付 const val H5_PAY = 21 //h5支付
const val SD_PAY = 15 //杉德支付 const val SD_PAY = 15 //杉德支付
const val ZFB_H5_PAY = 17 //支付宝H5
const val WX_H5_PAY = 19 //微信H5
const val HUI_FU_H5_PAY1 = 31 //汇付支付宝
const val HUI_FU_H5_PAY2 = 33 //汇付微信
} }
} }
\ No newline at end of file
...@@ -35,6 +35,7 @@ public class RecycleImageView extends AppCompatImageView { ...@@ -35,6 +35,7 @@ public class RecycleImageView extends AppCompatImageView {
private RequestBuilder mBitmapRequestBuilder; private RequestBuilder mBitmapRequestBuilder;
private RequestOptions mRequestOptions; private RequestOptions mRequestOptions;
private Context mContext; private Context mContext;
private boolean exceptLeftTop, exceptRightTop, exceptLeftBottom, exceptRightBotoom;
public RecycleImageView(Context context) { public RecycleImageView(Context context) {
super(context); super(context);
...@@ -74,6 +75,10 @@ public class RecycleImageView extends AppCompatImageView { ...@@ -74,6 +75,10 @@ public class RecycleImageView extends AppCompatImageView {
imageUrl = url; imageUrl = url;
mHolderResId = -1; mHolderResId = -1;
this.isRound = false; this.isRound = false;
this.exceptLeftTop = false;
this.exceptRightTop = false;
this.exceptLeftBottom = false;
this.exceptRightBotoom = false;
this.isCenterCrop = isCenterCrop; this.isCenterCrop = isCenterCrop;
dp = 0; dp = 0;
if (imageUrl == null) { if (imageUrl == null) {
...@@ -92,6 +97,10 @@ public class RecycleImageView extends AppCompatImageView { ...@@ -92,6 +97,10 @@ public class RecycleImageView extends AppCompatImageView {
imageUrl = url; imageUrl = url;
mHolderResId = holderResId; mHolderResId = holderResId;
this.isRound = isRound; this.isRound = isRound;
this.exceptLeftTop = false;
this.exceptRightTop = false;
this.exceptLeftBottom = false;
this.exceptRightBotoom = false;
dp = 0; dp = 0;
if (imageUrl == null) { if (imageUrl == null) {
return; return;
...@@ -110,6 +119,33 @@ public class RecycleImageView extends AppCompatImageView { ...@@ -110,6 +119,33 @@ public class RecycleImageView extends AppCompatImageView {
mHolderResId = holderResId; mHolderResId = holderResId;
this.isRound = true; this.isRound = true;
this.dp = dp; this.dp = dp;
this.exceptLeftTop = false;
this.exceptRightTop = false;
this.exceptLeftBottom = false;
this.exceptRightBotoom = false;
this.isResize = isResize;
if (imageUrl == null) {
return;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (isAttachedToWindow()) {
loadImage();
}
} else {
loadImage();
}
}
public void setLoadImageUrl(Object url, int holderResId, int dp, boolean LeftTop, boolean RightTop, boolean LeftBottom, boolean RightBottom) {
imageUrl = url;
mHolderResId = holderResId;
this.isRound = true;
this.dp = dp;
this.exceptLeftTop = !LeftTop;
this.exceptRightTop = !RightTop;
this.exceptLeftBottom = !LeftBottom;
this.exceptRightBotoom = !RightBottom;
this.dp = dp;
this.isResize = isResize; this.isResize = isResize;
if (imageUrl == null) { if (imageUrl == null) {
return; return;
...@@ -151,7 +187,7 @@ public class RecycleImageView extends AppCompatImageView { ...@@ -151,7 +187,7 @@ public class RecycleImageView extends AppCompatImageView {
} }
if (isRound) { if (isRound) {
CornerTransform transform = new CornerTransform(mContext, Utils.dip2px(dp)); CornerTransform transform = new CornerTransform(mContext, Utils.dip2px(dp));
transform.setExceptCorner(false, false, false, false); transform.setExceptCorner(exceptLeftTop, exceptRightTop, exceptLeftBottom, exceptRightBotoom);
mRequestOptions.transform(transform); mRequestOptions.transform(transform);
mBitmapRequestBuilder.apply(mRequestOptions).into(this); mBitmapRequestBuilder.apply(mRequestOptions).into(this);
} else { } else {
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<string name="shop_order">商城订单</string> <string name="shop_order">商城订单</string>
<string name="magic_box_order">魔盒订单</string> <string name="magic_box_order">魔盒订单</string>
//底部 //底部
<string name="shop">商城</string> <string name="shop">会员商城</string>
<string name="box">盲盒</string> <string name="box">盲盒</string>
<string name="bottom_vip">会员权益</string> <string name="bottom_vip">会员权益</string>
<string name="recycle_center">回收中心</string> <string name="recycle_center">回收中心</string>
......
...@@ -45,6 +45,7 @@ dependencies { ...@@ -45,6 +45,7 @@ dependencies {
implementation 'com.contrarywind:Android-PickerView:4.1.9' implementation 'com.contrarywind:Android-PickerView:4.1.9'
implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.github.loperSeven:tablayout-ext:0.1.4'
//banner //banner
implementation 'com.github.zhpanvip:viewpagerindicator:1.2.1' implementation 'com.github.zhpanvip:viewpagerindicator:1.2.1'
// implementation 'com.github.zhpanvip:bannerviewpager:3.5.5' // implementation 'com.github.zhpanvip:bannerviewpager:3.5.5'
......
...@@ -211,34 +211,32 @@ ...@@ -211,34 +211,32 @@
android:host="receiveaddress" android:host="receiveaddress"
android:scheme="xxsqshop" /> android:scheme="xxsqshop" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".box.activity.OrderDetailActivity"> <activity android:name=".box.activity.OrderDetailActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="orderdetail" android:host="orderdetail"
android:scheme="xxsqshop" /> android:scheme="xxsqshop" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".activity.ToPaySkillGoodsActivity"> <activity android:name=".activity.ToPaySkillGoodsActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
android:host="topayskill" android:host="topayskill"
android:scheme="xxsqshop" /> android:scheme="xxsqshop" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".activity.SettingActivity"> <activity android:name=".activity.SettingActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
...@@ -248,12 +246,12 @@ ...@@ -248,12 +246,12 @@
android:host="setting" android:host="setting"
android:scheme="xxsqshop" /> android:scheme="xxsqshop" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".activity.OpenMemberOrderActivity"> <activity android:name=".activity.OpenMemberOrderActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
...@@ -261,10 +259,10 @@ ...@@ -261,10 +259,10 @@
android:scheme="xxsqshop" /> android:scheme="xxsqshop" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".activity.OpenMemberActivity"> <activity android:name=".activity.OpenMemberActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
...@@ -275,7 +273,8 @@ ...@@ -275,7 +273,8 @@
<activity android:name=".activity.ShopOrderActivity"> <activity android:name=".activity.ShopOrderActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
...@@ -308,7 +307,8 @@ ...@@ -308,7 +307,8 @@
<activity android:name=".activity.SkillShopActivity"> <activity android:name=".activity.SkillShopActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
...@@ -328,10 +328,10 @@ ...@@ -328,10 +328,10 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".activity.RechargeActivity"> <activity android:name=".activity.RechargeActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data <data
...@@ -352,8 +352,6 @@ ...@@ -352,8 +352,6 @@
android:scheme="xxsqshop" /> android:scheme="xxsqshop" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".activity.SearchActivity" android:name=".activity.SearchActivity"
android:launchMode="singleTop"> android:launchMode="singleTop">
...@@ -367,7 +365,6 @@ ...@@ -367,7 +365,6 @@
android:scheme="xxsqshop" /> android:scheme="xxsqshop" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".activity.UserQuestionActivity" android:name=".activity.UserQuestionActivity"
android:launchMode="singleTop"> android:launchMode="singleTop">
...@@ -381,7 +378,6 @@ ...@@ -381,7 +378,6 @@
android:scheme="xxsqshop" /> android:scheme="xxsqshop" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".activity.GrabRedEnvelopeActivity" android:name=".activity.GrabRedEnvelopeActivity"
android:launchMode="singleTop"> android:launchMode="singleTop">
...@@ -395,8 +391,6 @@ ...@@ -395,8 +391,6 @@
android:scheme="xxsqshop" /> android:scheme="xxsqshop" />
</intent-filter> </intent-filter>
</activity> </activity>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -296,7 +296,7 @@ class CardDetailActivity : BaseActivity(), CardDetailContract.View { ...@@ -296,7 +296,7 @@ class CardDetailActivity : BaseActivity(), CardDetailContract.View {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (isPause && isClickPayBtn) { if (isPause && isClickPayBtn) {
if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY) { if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY|| pay_type == PaymentConfig.ZFB_H5_PAY|| pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
//如果是敏支付或者H5支付 //如果是敏支付或者H5支付
mPayPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!) mPayPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!)
} else { } else {
......
...@@ -206,6 +206,7 @@ class OpenMemberOrderActivity : BaseActivity(), PayContract.View { ...@@ -206,6 +206,7 @@ class OpenMemberOrderActivity : BaseActivity(), PayContract.View {
EventUtils.onEvent("h5_pay_error") EventUtils.onEvent("h5_pay_error")
showResultLoading(false) showResultLoading(false)
} else { } else {
if (pay_type==PaymentConfig.H5_PAY){
mHandler.sendEmptyMessageDelayed(1, 8000) mHandler.sendEmptyMessageDelayed(1, 8000)
H5PayUtil().loadH5PayWeb( H5PayUtil().loadH5PayWeb(
this, this,
...@@ -232,6 +233,23 @@ class OpenMemberOrderActivity : BaseActivity(), PayContract.View { ...@@ -232,6 +233,23 @@ class OpenMemberOrderActivity : BaseActivity(), PayContract.View {
EventUtils.onEvent("h5_pay_error2", errorStr) EventUtils.onEvent("h5_pay_error2", errorStr)
} }
}) })
}else{
H5PayUtil().loadH5AppPay(
this,
pay_type!!,
form ?: "",
object : H5PayUtil.H5AppPayCallBack {
override fun jumpAppException(e: Exception) {
EventUtils.onEvent("H5AppPayError", "error:${pay_type}")
if (pay_type == PaymentConfig.ZFB_H5_PAY||pay_type == PaymentConfig.HUI_FU_H5_PAY1) {
mLoading?.setResult(false, "支付失败,请安装支付宝后重试", 1000)
} else {
mLoading?.setResult(false, "支付失败,请安装微信后重试", 1000)
}
}
})
}
} }
} }
...@@ -309,7 +327,7 @@ class OpenMemberOrderActivity : BaseActivity(), PayContract.View { ...@@ -309,7 +327,7 @@ class OpenMemberOrderActivity : BaseActivity(), PayContract.View {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (isPause) { if (isPause) {
if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY) { if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY|| pay_type == PaymentConfig.ZFB_H5_PAY|| pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
//如果是敏支付或者H5支付 //如果是敏支付或者H5支付
mPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!) mPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!)
} else { } else {
......
...@@ -29,7 +29,6 @@ import com.zxhl.cms.net.model.uc.AliPayEntity ...@@ -29,7 +29,6 @@ import com.zxhl.cms.net.model.uc.AliPayEntity
import com.zxhl.cms.net.model.uc.PayResultEntity import com.zxhl.cms.net.model.uc.PayResultEntity
import com.zxhl.cms.net.model.video.MemberEntity import com.zxhl.cms.net.model.video.MemberEntity
import com.zxhl.cms.pay.H5PayUtil import com.zxhl.cms.pay.H5PayUtil
import com.zxhl.cms.pay.PayActivity
import com.zxhl.cms.pay.PaymentConfig import com.zxhl.cms.pay.PaymentConfig
import com.zxhl.cms.pay.alipay.AlipayServer import com.zxhl.cms.pay.alipay.AlipayServer
import com.zxhl.cms.utils.* import com.zxhl.cms.utils.*
...@@ -283,6 +282,27 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity ...@@ -283,6 +282,27 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
mLoading?.setResult(false, "支付异常", 1000) mLoading?.setResult(false, "支付异常", 1000)
} }
}); });
} else if (pay_type == PaymentConfig.ZFB_H5_PAY || pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
if (result.outTradeNo.isNullOrEmpty()) {
EventUtils.onEvent("h5_pay_error")
showResultLoading(false)
} else {
SettingPreference.setOutTradeNo(result.outTradeNo)
H5PayUtil().loadH5AppPay(
this,
pay_type!!,
result.wakeup ?: "",
object : H5PayUtil.H5AppPayCallBack {
override fun jumpAppException(e: Exception) {
EventUtils.onEvent("H5AppPayError", "error:${pay_type}")
if (pay_type == PaymentConfig.ZFB_H5_PAY||pay_type == PaymentConfig.HUI_FU_H5_PAY1) {
mLoading?.setResult(false, "支付失败,请安装支付宝后重试", 1000)
} else {
mLoading?.setResult(false, "支付失败,请安装微信后重试", 1000)
}
}
})
}
} else { } else {
showToast("暂不支持") showToast("暂不支持")
EventUtils.onEvent("payment_error", "$pay_type") EventUtils.onEvent("payment_error", "$pay_type")
...@@ -488,7 +508,7 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity ...@@ -488,7 +508,7 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (isPause && isClickPayBtn) { if (isPause && isClickPayBtn) {
if (pay_type == PayActivity.MIN_PAY_PROGRAM || pay_type == PayActivity.H5_PAY) { if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY|| pay_type == PaymentConfig.ZFB_H5_PAY|| pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
//如果是敏支付或者H5支付 //如果是敏支付或者H5支付
mPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!) mPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!)
} else { } else {
......
...@@ -26,7 +26,6 @@ import com.zxhl.cms.net.model.qy.RightsDetailEntity ...@@ -26,7 +26,6 @@ import com.zxhl.cms.net.model.qy.RightsDetailEntity
import com.zxhl.cms.net.model.uc.AliPayEntity import com.zxhl.cms.net.model.uc.AliPayEntity
import com.zxhl.cms.net.model.uc.PayResultEntity import com.zxhl.cms.net.model.uc.PayResultEntity
import com.zxhl.cms.pay.H5PayUtil import com.zxhl.cms.pay.H5PayUtil
import com.zxhl.cms.pay.PayActivity
import com.zxhl.cms.pay.PaymentConfig import com.zxhl.cms.pay.PaymentConfig
import com.zxhl.cms.pay.alipay.AlipayServer import com.zxhl.cms.pay.alipay.AlipayServer
import com.zxhl.cms.utils.* import com.zxhl.cms.utils.*
...@@ -213,7 +212,6 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa ...@@ -213,7 +212,6 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
for (i in result.pay_config_v2!!.indices) { for (i in result.pay_config_v2!!.indices) {
if (result?.pay_config_v2!![i].open == 1) { if (result?.pay_config_v2!![i].open == 1) {
pay_type = result?.pay_config_v2!![i].type pay_type = result?.pay_config_v2!![i].type
// pay_type = PaymentConfig.SD_PAY
break break
} }
} }
...@@ -296,6 +294,27 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa ...@@ -296,6 +294,27 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
mLoading?.setResult(false, "支付异常", 1000) mLoading?.setResult(false, "支付异常", 1000)
} }
}); });
}else if (pay_type == PaymentConfig.ZFB_H5_PAY || pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
if (result.outTradeNo.isNullOrEmpty()) {
EventUtils.onEvent("H5AppPayError","error:outTradeNo null")
showResultLoading(false)
} else {
SettingPreference.setOutTradeNo(result.outTradeNo)
H5PayUtil().loadH5AppPay(
this,
pay_type!!,
result.wakeup ?: "",
object : H5PayUtil.H5AppPayCallBack {
override fun jumpAppException(e: Exception) {
EventUtils.onEvent("H5AppPayError", "error:${pay_type}")
if (pay_type == PaymentConfig.ZFB_H5_PAY||pay_type == PaymentConfig.HUI_FU_H5_PAY1) {
mLoading?.setResult(false, "支付失败,请安装支付宝后重试", 1000)
} else {
mLoading?.setResult(false, "支付失败,请安装微信后重试", 1000)
}
}
})
}
} else { } else {
showToast("暂不支持") showToast("暂不支持")
} }
...@@ -354,12 +373,10 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa ...@@ -354,12 +373,10 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
super.onResume() super.onResume()
Log.d("wxw", "OnResume") Log.d("wxw", "OnResume")
if (isPause && isClickPayBtn) { if (isPause && isClickPayBtn) {
Log.d("wxw", "1onResume" + pay_type) if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY|| pay_type == PaymentConfig.ZFB_H5_PAY|| pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
if (pay_type == PayActivity.MIN_PAY_PROGRAM || pay_type == PayActivity.H5_PAY) {
//如果是敏支付或者H5支付 //如果是敏支付或者H5支付
mPayPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!) mPayPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!)
} else { } else {
Log.d("wxw", "2OnResume" + pay_type)
mHandler?.sendEmptyMessageDelayed(0, 2000) mHandler?.sendEmptyMessageDelayed(0, 2000)
} }
} }
......
...@@ -384,7 +384,24 @@ class ShopOrderActivity : BaseActivity(), ShopOrderContract.View, PayContract.Vi ...@@ -384,7 +384,24 @@ class ShopOrderActivity : BaseActivity(), ShopOrderContract.View, PayContract.Vi
EventUtils.onEvent("h5_pay_error") EventUtils.onEvent("h5_pay_error")
showResultLoading(false) showResultLoading(false)
} else { } else {
if (pay_type == PaymentConfig.H5_PAY) {
loadH5Pay(form) loadH5Pay(form)
} else {
H5PayUtil().loadH5AppPay(
this,
pay_type!!,
form ?: "",
object : H5PayUtil.H5AppPayCallBack {
override fun jumpAppException(e: Exception) {
EventUtils.onEvent("H5AppPayError", "error:${pay_type}")
if (pay_type == PaymentConfig.ZFB_H5_PAY||pay_type == PaymentConfig.HUI_FU_H5_PAY1) {
mLoading?.setResult(false, "支付失败,请安装支付宝后重试", 1000)
} else {
mLoading?.setResult(false, "支付失败,请安装微信后重试", 1000)
}
}
})
}
} }
} }
...@@ -490,7 +507,7 @@ class ShopOrderActivity : BaseActivity(), ShopOrderContract.View, PayContract.Vi ...@@ -490,7 +507,7 @@ class ShopOrderActivity : BaseActivity(), ShopOrderContract.View, PayContract.Vi
mHandler?.sendEmptyMessageDelayed(0, 2000) mHandler?.sendEmptyMessageDelayed(0, 2000)
} }
if (isPause) { if (isPause) {
if (pay_type == PayActivity.MIN_PAY_PROGRAM || pay_type == PayActivity.H5_PAY) { if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY|| pay_type == PaymentConfig.ZFB_H5_PAY|| pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
//如果是敏支付或者H5支付 //如果是敏支付或者H5支付
mPayresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type) mPayresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type)
} else { } else {
......
...@@ -27,11 +27,9 @@ import com.zxhl.cms.net.SettingPreference ...@@ -27,11 +27,9 @@ 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.AddressEntity import com.zxhl.cms.net.model.box.AddressEntity
import com.zxhl.cms.net.model.box.GoodList import com.zxhl.cms.net.model.box.GoodList
import com.zxhl.cms.net.model.box.OrderEntity
import com.zxhl.cms.net.model.uc.AliPayEntity import com.zxhl.cms.net.model.uc.AliPayEntity
import com.zxhl.cms.net.model.uc.PayResultEntity import com.zxhl.cms.net.model.uc.PayResultEntity
import com.zxhl.cms.pay.H5PayUtil import com.zxhl.cms.pay.H5PayUtil
import com.zxhl.cms.pay.PayActivity
import com.zxhl.cms.pay.PaymentConfig import com.zxhl.cms.pay.PaymentConfig
import com.zxhl.cms.pay.alipay.AlipayServer import com.zxhl.cms.pay.alipay.AlipayServer
import com.zxhl.cms.utils.EventUtils import com.zxhl.cms.utils.EventUtils
...@@ -348,6 +346,27 @@ class SkillShopActivity : BaseActivity(), CardDetailContract.View { ...@@ -348,6 +346,27 @@ class SkillShopActivity : BaseActivity(), CardDetailContract.View {
mLoading?.setResult(false, "支付异常", 1000) mLoading?.setResult(false, "支付异常", 1000)
} }
}); });
}else if (pay_type == PaymentConfig.ZFB_H5_PAY || pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
if (result.outTradeNo.isNullOrEmpty()) {
EventUtils.onEvent("H5AppPayError","error:outTradeNo null")
showResultLoading(false)
} else {
SettingPreference.setOutTradeNo(result.outTradeNo)
H5PayUtil().loadH5AppPay(
this,
pay_type!!,
result.wakeup ?: "",
object : H5PayUtil.H5AppPayCallBack {
override fun jumpAppException(e: Exception) {
EventUtils.onEvent("H5AppPayError", "error:${pay_type}")
if (pay_type == PaymentConfig.ZFB_H5_PAY||pay_type == PaymentConfig.HUI_FU_H5_PAY1) {
mLoading?.setResult(false, "支付失败,请安装支付宝后重试", 1000)
} else {
mLoading?.setResult(false, "支付失败,请安装微信后重试", 1000)
}
}
})
}
} else { } else {
showToast("暂不支持") showToast("暂不支持")
EventUtils.onEvent("payment_error", "$pay_type") EventUtils.onEvent("payment_error", "$pay_type")
...@@ -408,7 +427,7 @@ class SkillShopActivity : BaseActivity(), CardDetailContract.View { ...@@ -408,7 +427,7 @@ class SkillShopActivity : BaseActivity(), CardDetailContract.View {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (isPause && isClickPayBtn) { if (isPause && isClickPayBtn) {
if (pay_type == PayActivity.MIN_PAY_PROGRAM || pay_type == PayActivity.H5_PAY) { if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY|| pay_type == PaymentConfig.ZFB_H5_PAY|| pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
//如果是敏支付或者H5支付 //如果是敏支付或者H5支付
mPayPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!) mPayPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!)
} else { } else {
......
...@@ -16,11 +16,9 @@ import com.zxbw.modulemain.contract.TbGoodsDetailContract ...@@ -16,11 +16,9 @@ import com.zxbw.modulemain.contract.TbGoodsDetailContract
import com.zxbw.modulemain.presenter.TbGoodsDetailPresenter import com.zxbw.modulemain.presenter.TbGoodsDetailPresenter
import com.zxhl.cms.AppContext import com.zxhl.cms.AppContext
import com.zxhl.cms.common.Constant import com.zxhl.cms.common.Constant
import com.zxhl.cms.common.NetConfig
import com.zxhl.cms.common.base.BaseActivity import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.net.model.qy.ConvertLinkEntity import com.zxhl.cms.net.model.qy.ConvertLinkEntity
import com.zxhl.cms.net.model.qy.TbGoodsItemEntity import com.zxhl.cms.net.model.qy.TbGoodsItemEntity
import com.zxhl.cms.net.model.shop.ShopListEntity
import com.zxhl.cms.utils.EventUtils import com.zxhl.cms.utils.EventUtils
import com.zxhl.cms.utils.JumpUtils import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.OnRecycleItemClickListener import com.zxhl.cms.utils.OnRecycleItemClickListener
......
...@@ -22,7 +22,6 @@ import com.zxhl.cms.net.model.qy.SkillGoodsEntity ...@@ -22,7 +22,6 @@ import com.zxhl.cms.net.model.qy.SkillGoodsEntity
import com.zxhl.cms.net.model.uc.AliPayEntity import com.zxhl.cms.net.model.uc.AliPayEntity
import com.zxhl.cms.net.model.uc.PayResultEntity import com.zxhl.cms.net.model.uc.PayResultEntity
import com.zxhl.cms.pay.H5PayUtil import com.zxhl.cms.pay.H5PayUtil
import com.zxhl.cms.pay.PayActivity
import com.zxhl.cms.pay.PaymentConfig import com.zxhl.cms.pay.PaymentConfig
import com.zxhl.cms.pay.alipay.AlipayServer import com.zxhl.cms.pay.alipay.AlipayServer
import com.zxhl.cms.utils.EventUtils import com.zxhl.cms.utils.EventUtils
...@@ -248,6 +247,27 @@ class ToPaySkillGoodsActivity : BaseActivity(), CardDetailContract.View { ...@@ -248,6 +247,27 @@ class ToPaySkillGoodsActivity : BaseActivity(), CardDetailContract.View {
mLoading?.setResult(false, "支付异常", 1000) mLoading?.setResult(false, "支付异常", 1000)
} }
}); });
}else if (pay_type == PaymentConfig.ZFB_H5_PAY || pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
if (result.outTradeNo.isNullOrEmpty()) {
EventUtils.onEvent("H5AppPayError","error:outTradeNo null")
showResultLoading(false)
} else {
SettingPreference.setOutTradeNo(result.outTradeNo)
H5PayUtil().loadH5AppPay(
this,
pay_type!!,
result.wakeup ?: "",
object : H5PayUtil.H5AppPayCallBack {
override fun jumpAppException(e: Exception) {
EventUtils.onEvent("H5AppPayError", "error:${pay_type}")
if (pay_type == PaymentConfig.ZFB_H5_PAY||pay_type == PaymentConfig.HUI_FU_H5_PAY1) {
mLoading?.setResult(false, "支付失败,请安装支付宝后重试", 1000)
} else {
mLoading?.setResult(false, "支付失败,请安装微信后重试", 1000)
}
}
})
}
} else { } else {
showToast("暂不支持") showToast("暂不支持")
EventUtils.onEvent("payment_error", "$pay_type") EventUtils.onEvent("payment_error", "$pay_type")
...@@ -305,7 +325,7 @@ class ToPaySkillGoodsActivity : BaseActivity(), CardDetailContract.View { ...@@ -305,7 +325,7 @@ class ToPaySkillGoodsActivity : BaseActivity(), CardDetailContract.View {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (isPause && isClickPayBtn) { if (isPause && isClickPayBtn) {
if (pay_type == PayActivity.MIN_PAY_PROGRAM || pay_type == PayActivity.H5_PAY) { if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY|| pay_type == PaymentConfig.ZFB_H5_PAY|| pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
//如果是敏支付或者H5支付 //如果是敏支付或者H5支付
mPayPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!) mPayPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!)
} else { } else {
......
...@@ -34,6 +34,9 @@ class MyOrderAdapter : BaseRecyclerAdapter<ShopOrderEntity, RecyclerView.ViewHol ...@@ -34,6 +34,9 @@ class MyOrderAdapter : BaseRecyclerAdapter<ShopOrderEntity, RecyclerView.ViewHol
override fun getItemViewType(position: Int): Int { override fun getItemViewType(position: Int): Int {
if (mList[position].orderType == "50" || mList[position].orderType == "8080") { if (mList[position].orderType == "50" || mList[position].orderType == "8080") {
if (mList[position].orderType=="50"&&mList[position].phone.isNullOrEmpty()){
return VIEW_TYPE_CARD_VIEW
}
return VIEW_TYPE_VIP_VIEW return VIEW_TYPE_VIP_VIEW
} else if (mList[position].orderType == "51") { } else if (mList[position].orderType == "51") {
return VIEW_TYPE_CARD_VIEW return VIEW_TYPE_CARD_VIEW
......
package com.zxbw.modulemain.adapter
import android.app.Activity
import android.text.Spannable
import android.text.SpannableString
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.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager.widget.ViewPager
import com.zxbw.modulemain.R
import com.zxbw.modulemain.view.CenterImageSpan
import com.zxbw.modulemain.view.UIndicator
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.TbGoodsItemEntity
import com.zxhl.cms.utils.OnRecycleItemClickListener
import com.zxhl.cms.widget.RecycleImageView
/**
* @author (wangXuewei)
* @datetime 2022-05-26 21:05 GMT+8
* @detail :
*/
class ShopRecommendAdapter : BaseRecyclerAdapter<TbGoodsItemEntity, RecyclerView.ViewHolder> {
private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<TbGoodsItemEntity>
private val VIEW_TYPE_CATE_VIEW = 1
private val VIEW_TYPE_ACTION_VIEW = 2
private val VIEW_TYPE_GOODS_VIEW = 3
constructor(
content: Activity?,
listener: OnRecycleItemClickListener<TbGoodsItemEntity>
) : super() {
mContext = content
this.listener = listener
}
private var mCateDataList: List<JgqQyEntity>? = null
fun updateShopCategoryData(qyDataList: List<JgqQyEntity>) {
mCateDataList = qyDataList
notifyDataSetChanged()
}
override fun getItemViewType(position: Int): Int {
var realPos = position - 1;
if (position == 0) {
return VIEW_TYPE_CATE_VIEW
} else if (position ==1) {
return VIEW_TYPE_ACTION_VIEW
} else {
return VIEW_TYPE_GOODS_VIEW
}
}
override fun getItemCount(): Int {
return mList.size + 1
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
var viewNum = 1;
if (holder is GoodsViewHolder) {
val bean = mList[position - viewNum]
setImgText(mContext, holder.id_tv_goods_name!!, bean.title)
if (mContext?.isFinishing == false) {
if (bean.pict_url?.startsWith("//img") == true) {
holder.id_item_goods_img?.setLoadImageUrl("https:" + bean.pict_url, R.drawable.img_goods_error, 10)
} else {
holder.id_item_goods_img?.setLoadImageUrl(bean.pict_url, R.drawable.img_goods_error, 10)
}
// if (bean.pict_url?.startsWith("//img") == true) {
// holder.id_item_goods_img?.setLoadImageUrl(
// "https:" + bean.pict_url,
// R.drawable.img_goods_error,
// 10,
// true,
// true,
// false,
// false
// )
// } else {
// holder.id_item_goods_img?.setLoadImageUrl(
// bean.pict_url,
// R.drawable.img_goods_error,
// 10,
// true,
// true,
// false,
// false
// )
// }
}
holder.id_ll_goods_item_view?.setOnClickListener {
listener.onItemClick(it, position, bean)
}
} else if (holder is QyViewHolder) {
if (!mCateDataList.isNullOrEmpty()) {
holder.qy_item_view?.visibility = View.VISIBLE
var splitItemNum = 10;
val result = ArrayList<List<JgqQyEntity>>()
if (mCateDataList?.size!! <= splitItemNum) {
result.add(mCateDataList!!)
} else {
//
val splitNum = if (mCateDataList?.size!! % splitItemNum == 0) {
mCateDataList?.size!! / splitItemNum
} else {
mCateDataList?.size!! / splitItemNum + 1
}
var value: List<JgqQyEntity>? = null
for (i in 0 until splitNum) {
if (i < splitNum - 1) {
value = mCateDataList?.subList(i * splitItemNum, (i + 1) * splitItemNum)
} else {
value = mCateDataList?.subList(i * splitItemNum, mCateDataList?.size!!)
}
if (value != null) {
result.add(value)
}
}
}
var mQyBannerAdapter = HomeQyBannerAdapter(result, mContext)
holder.qy_vp?.adapter = mQyBannerAdapter;
mQyBannerAdapter.notifyDataSetChanged()
holder.id_qy_indicator_view?.setIndicatorCount(result.size)
holder.qy_vp?.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrolled(
position: Int,
positionOffset: Float,
positionOffsetPixels: Int
) {
}
override fun onPageSelected(position: Int) {
holder.id_qy_indicator_view?.setSelectPos(position)
}
override fun onPageScrollStateChanged(state: Int) {
}
})
} else {
holder.qy_item_view?.visibility = View.GONE
}
} else if (holder is ActionGoodsViewHolder) {
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if (viewType == VIEW_TYPE_CATE_VIEW) {
return QyViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_home_qy_view, parent, false)
)
} else if (viewType == VIEW_TYPE_ACTION_VIEW) {
return ActionGoodsViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_shop_action_goods_view, parent, false)
)
} else {
return GoodsViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_shop_goods_view, parent, false)
)
}
}
//商品
class GoodsViewHolder : RecyclerView.ViewHolder {
var id_ll_goods_item_view: LinearLayout?
var id_item_goods_img: RecycleImageView?
var id_tv_goods_name: TextView?
var id_tv_original_price: TextView?
var id_tv_vip_price: TextView?
var id_tv_sale_num: TextView?
constructor(
itemView: View
) : super(itemView) {
id_ll_goods_item_view =
itemView.findViewById<LinearLayout>(R.id.id_ll_goods_item_view)
id_item_goods_img = itemView.findViewById<RecycleImageView>(R.id.id_item_goods_img)
id_tv_goods_name = itemView.findViewById<TextView>(R.id.id_tv_goods_name)
id_tv_original_price = itemView.findViewById<TextView>(R.id.id_tv_goods_original_price)
id_tv_vip_price = itemView.findViewById<TextView>(R.id.id_tv_goods_vip_price)
id_tv_sale_num = itemView.findViewById<TextView>(R.id.id_tv_goods_sale_num)
}
}
//权益
class QyViewHolder : RecyclerView.ViewHolder {
var qy_item_view: RelativeLayout?
var qy_vp: ViewPager?
var id_qy_indicator_view: UIndicator?
constructor(
itemView: View
) : super(itemView) {
qy_item_view = itemView.findViewById<RelativeLayout>(R.id.id_rl_home_qy_item_view)
qy_vp = itemView.findViewById<ViewPager>(R.id.id_vp_home_jgq_qy_list)
id_qy_indicator_view = itemView.findViewById<UIndicator>(R.id.id_qy_indicator_view)
}
}
//活动商品
class ActionGoodsViewHolder : RecyclerView.ViewHolder {
constructor(
itemView: View
) : super(itemView) {
}
}
private fun setImgText(content: Activity?, tv: TextView, str: String?) {
tv.text = "";
if (content == null) {
tv.text = str;
} else {
val d = ContextCompat.getDrawable(content, R.drawable.icon_shop_goods_label)
d?.setBounds(0, 0, d.minimumWidth, d.minimumHeight)
val span = d?.let { CenterImageSpan(it) }
val spanStr = SpannableString("custom$0")
spanStr.setSpan(span, 0, spanStr.length, Spannable.SPAN_INCLUSIVE_EXCLUSIVE)
tv.append(spanStr)
tv.append(" ")
tv.append(str)
}
}
}
\ No newline at end of file
...@@ -290,9 +290,9 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac ...@@ -290,9 +290,9 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
pay_type.toString(), pay_type.toString(),
"7" "7"
) )
} else if (pay_type ==WECHAT_PAY) { } else if (pay_type == WECHAT_PAY) {
mPayresenter?.requestWechatPayOrder( mPayresenter?.requestWechatPayOrder(
payGoodsId?: "", payGoodsId ?: "",
pay_type.toString() pay_type.toString()
) )
} else if (pay_type == MINI_PROGRAM) { } else if (pay_type == MINI_PROGRAM) {
...@@ -301,14 +301,15 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac ...@@ -301,14 +301,15 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
pay_type.toString() pay_type.toString()
) )
} else if (pay_type == PaymentConfig.SD_PAY) { } else if (pay_type == PaymentConfig.SD_PAY) {
mPayresenter?.requestSdPay("xxsqshop://member_order", mPayresenter?.requestSdPay(
"xxsqshop://member_order",
this, this,
payGoodsId ?: "", payGoodsId ?: "",
pay_type.toString(), pay_type.toString(),
"7" "7"
) )
} else { } else {
Log.d("wxw","goodsID"+payGoodsId) Log.d("wxw", "goodsID" + payGoodsId)
mPayresenter?.requestMiniProgrom( mPayresenter?.requestMiniProgrom(
payGoodsId ?: "", payGoodsId ?: "",
pay_type.toString(), pay_type.toString(),
...@@ -411,6 +412,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac ...@@ -411,6 +412,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
EventUtils.onEvent("h5_pay_error") EventUtils.onEvent("h5_pay_error")
showResultLoading(false) showResultLoading(false)
} else { } else {
if (pay_type == PaymentConfig.H5_PAY) {
mHandler.sendEmptyMessageDelayed(1, 8000) mHandler.sendEmptyMessageDelayed(1, 8000)
H5PayUtil().loadH5PayWeb( H5PayUtil().loadH5PayWeb(
this, this,
...@@ -437,6 +439,22 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac ...@@ -437,6 +439,22 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
EventUtils.onEvent("h5_pay_error2", errorStr) EventUtils.onEvent("h5_pay_error2", errorStr)
} }
}) })
} else {
H5PayUtil().loadH5AppPay(
this,
pay_type!!,
form ?: "",
object : H5PayUtil.H5AppPayCallBack {
override fun jumpAppException(e: Exception) {
EventUtils.onEvent("H5AppPayError", "error:${pay_type}")
if (pay_type == PaymentConfig.ZFB_H5_PAY||pay_type == PaymentConfig.HUI_FU_H5_PAY1) {
mLoading?.setResult(false, "支付失败,请安装支付宝后重试", 1000)
} else {
mLoading?.setResult(false, "支付失败,请安装微信后重试", 1000)
}
}
})
}
} }
} }
...@@ -468,7 +486,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac ...@@ -468,7 +486,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
mPayFunAdapter?.appendToList(result.pay_config_v2) mPayFunAdapter?.appendToList(result.pay_config_v2)
for (i in result.pay_config_v2!!.indices) { for (i in result.pay_config_v2!!.indices) {
if (result?.pay_config_v2!![i].open == 1) { if (result?.pay_config_v2!![i].open == 1) {
pay_type = result?.pay_config_v2!![i].type?:0 pay_type = result?.pay_config_v2!![i].type ?: 0
mPayFunAdapter?.setPosition(i) mPayFunAdapter?.setPosition(i)
break break
} }
...@@ -489,7 +507,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac ...@@ -489,7 +507,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
mHandler?.sendEmptyMessageDelayed(0, 2000) mHandler?.sendEmptyMessageDelayed(0, 2000)
} }
if (isPause) { if (isPause) {
if (pay_type == PayActivity.MIN_PAY_PROGRAM || pay_type == PayActivity.H5_PAY) { if (pay_type == PaymentConfig.MIN_PAY_PROGRAM || pay_type == PaymentConfig.H5_PAY || pay_type == PaymentConfig.ZFB_H5_PAY || pay_type == PaymentConfig.WX_H5_PAY|| pay_type == PaymentConfig.HUI_FU_H5_PAY1|| pay_type == PaymentConfig.HUI_FU_H5_PAY2) {
//如果是敏支付或者H5支付 //如果是敏支付或者H5支付
mPayresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!) mPayresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!)
} else { } else {
......
package com.zxbw.modulemain.contract package com.zxbw.modulemain.contract
import com.zxhl.cms.net.model.qy.TbGoodsItemEntity import com.zxhl.cms.net.model.qy.TbGoodsItemEntity
import com.zxhl.cms.net.model.shop.ShopListEntity
class SearchContract { class SearchContract {
......
package com.zxbw.modulemain.contract package com.zxbw.modulemain.contract
import com.zxhl.cms.net.model.box.ShopOrderEntity import com.zxhl.cms.net.model.box.ShopOrderEntity
import com.zxhl.cms.net.model.shop.ShopListEntity
class ShopOrderListContract { class ShopOrderListContract {
......
package com.zxbw.modulemain.contract
import com.zxhl.cms.net.model.box.TabEntity
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.qy.TbGoodsItemEntity
/**
* 商城分类
*
*/
class ShopRecommendContract {
interface View {
fun setCategoryList(result: List<JgqQyEntity>?)
fun setShopGoodsList(isRefresh: Boolean, result: List<TbGoodsItemEntity>?)
}
interface Presenter {
fun getCategoryList(tabName: String)
fun getShopGoodsList(isRefresh: Boolean, tabEntity: TabEntity)
}
}
\ No newline at end of file
package com.zxbw.modulemain.contract
import com.zxhl.cms.net.model.box.TabEntity
import com.zxhl.cms.net.model.qy.CouponsEntity
import com.zxhl.cms.net.model.qy.HomeBannerEntity
/**
* 商城
*/
class ShoppingMallContract {
interface View {
fun setTabList(list: List<TabEntity>?)
fun setCouponsList(result: List<CouponsEntity>?)
}
interface Presenter {
fun getTabList()
fun getFetchCard()
}
}
\ No newline at end of file
...@@ -42,7 +42,6 @@ class HomeFragment : BaseFragment(), HomeContract.View, UpdateCallback { ...@@ -42,7 +42,6 @@ class HomeFragment : BaseFragment(), HomeContract.View, UpdateCallback {
if (isInitial && isVisible) { if (isInitial && isVisible) {
} }
} }
override fun init(view: View?) { override fun init(view: View?) {
......
package com.zxbw.modulemain.fragment
import android.content.Intent
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.scwang.smart.refresh.footer.ClassicsFooter
import com.scwang.smart.refresh.header.ClassicsHeader
import com.zxbw.modulemain.R
import com.zxbw.modulemain.activity.TbGoodsDetailActivity
import com.zxbw.modulemain.adapter.*
import com.zxbw.modulemain.contract.HomeRecommendContract
import com.zxbw.modulemain.contract.ShopRecommendContract
import com.zxbw.modulemain.presenter.HomeRecommendPresenter
import com.zxbw.modulemain.presenter.ShopRecommendPresenter
import com.zxhl.cms.common.Constant
import com.zxhl.cms.common.base.BaseFragment
import com.zxhl.cms.net.model.box.TabEntity
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.qy.TbGoodsItemEntity
import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.OnRecycleItemClickListener
import kotlinx.android.synthetic.main.fragment_layout_recommend.*
/**
* @author (wangXuewei)
* @datetime 2022-05-20 19:01 GMT+8
* @detail : 商城推荐
*/
class ShopRecommendFragment : BaseFragment, ShopRecommendContract.View,
OnRecycleItemClickListener<TbGoodsItemEntity> {
private val tabEntity: TabEntity
private var mPresenter: ShopRecommendPresenter? = null
private var mGoodsAdapter: ShopRecommendAdapter? = null;
override fun layoutID(): Int {
return R.layout.fragment_layout_recommend
}
override fun init(view: View?) {
mPresenter = ShopRecommendPresenter(this)
mGoodsAdapter = ShopRecommendAdapter(activity, this)
//底部商品列表
val gridLayoutManager = GridLayoutManager(activity, 2)
gridLayoutManager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
override fun getSpanSize(position: Int): Int {
if (position == 0||position == 1) {
return 2
}
return 1
}
}
id_rcl_goods_list?.layoutManager = gridLayoutManager
id_rcl_goods_list.adapter = mGoodsAdapter
id_refresh_view.setRefreshHeader(ClassicsHeader(activity))
id_refresh_view.setRefreshFooter(ClassicsFooter(activity))
id_refresh_view.setOnRefreshListener {
mPresenter?.getCategoryList(tabEntity.name)
mPresenter?.getShopGoodsList(true, tabEntity)
}
id_refresh_view.setOnLoadMoreListener {
mPresenter?.getShopGoodsList(false, tabEntity)
}
mPresenter?.getCategoryList(tabEntity.name)
mPresenter?.getShopGoodsList(true, tabEntity)
}
companion object {
fun newInstance(tab: TabEntity): ShopRecommendFragment {
return ShopRecommendFragment(tab)
}
}
constructor(tab: TabEntity) : super() {
this.tabEntity = tab
}
constructor() : super() {
this.tabEntity = TabEntity()
}
override fun onItemClick(view: View?, position: Int, data: TbGoodsItemEntity?) {
// JumpUtils.TbGoodsDetailJump()
if (data?.bannerType.equals("blindBox")) {
if (!Constant.Switch.isOpenVip) {
JumpUtils.MemberOrderJump()
} else {
JumpUtils.goodsDetailJump(data?.boxId)
}
} else {
var intent = Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putExtra("goods", data)
intent.setClass(activity!!, TbGoodsDetailActivity().javaClass)
activity?.startActivity(intent)
}
}
override fun setCategoryList(result: List<JgqQyEntity>?) {
if (!result.isNullOrEmpty()) {
mGoodsAdapter?.updateShopCategoryData(result)
}
}
override fun setShopGoodsList(isRefresh: Boolean, result: List<TbGoodsItemEntity>?) {
if (isRefresh) {
id_refresh_view.finishRefresh(!result.isNullOrEmpty());//传入false表示加载失败
} else {
id_refresh_view.finishLoadMore(!result.isNullOrEmpty());//传入false表示加载失败
}
if (isRefresh && !result.isNullOrEmpty()) {
mGoodsAdapter?.clear()
}
if (!result.isNullOrEmpty()) {
mGoodsAdapter?.appendToList(result)
}
}
}
\ No newline at end of file
package com.zxbw.modulemain.fragment package com.zxbw.modulemain.fragment
import android.graphics.Color
import android.view.View import android.view.View
import androidx.core.content.ContextCompat
import com.loper7.tab_expand.ext.buildIndicator
import com.loper7.tab_expand.ext.buildText
import com.loper7.tab_expand.ext.toPx
import com.loper7.tab_expand.indicator.CustomIndicator
import com.loper7.tab_expand.text.BaseText
import com.zxbw.modulemain.R import com.zxbw.modulemain.R
import com.zxbw.modulemain.contract.ShoppingMallContract
import com.zxbw.modulemain.presenter.ShoppingMallPresenter
import com.zxhl.cms.common.FragmentAdapter
import com.zxhl.cms.common.base.BaseFragment import com.zxhl.cms.common.base.BaseFragment
import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.model.box.TabEntity
import com.zxhl.cms.net.model.qy.CouponsEntity
import com.zxhl.cms.utils.JumpUtils
import kotlinx.android.synthetic.main.fragment_layout_shoppimg_mall.*
import me.jessyan.autosize.utils.ScreenUtils
/** /**
* @author (wangXuewei) * @author (wangXuewei)
* @datetime 2022-08-05 13:39 GMT+8 * @datetime 2022-08-05 13:39 GMT+8
* @detail : * @detail :
*/ */
class ShoppingMallFragment :BaseFragment() { class ShoppingMallFragment : BaseFragment(), ShoppingMallContract.View {
override fun layoutID(): Int = R.layout.fragment_layout_shoppimg_mall override fun layoutID(): Int = R.layout.fragment_layout_shoppimg_mall
private var mPresenter: ShoppingMallPresenter? = null
override fun init(view: View?) { override fun init(view: View?) {
var statusBarHeight = ScreenUtils.getStatusBarHeight()
if (statusBarHeight <= 0) {
statusBarHeight = 40;
}
id_sys_bar_view.layoutParams.height = statusBarHeight
mPresenter = ShoppingMallPresenter(this)
id_ll_search_view.setOnClickListener {
JumpUtils.SearchJump()
}
id_img_kefu.setOnClickListener {
JumpUtils.UserQuestion()
}
val config = SettingPreference.getConfig();
if (config != null && !config.tabs.isNullOrEmpty()) {
setTabList(config.tabs!!)
}
}
override fun setTabList(result: List<TabEntity>?) {
if (result.isNullOrEmpty()) {
showToast("加载失败,请重试")
return
}
val adapter = FragmentAdapter(childFragmentManager)
for (i in 0 until (result.size)) {
val title = result[i].name
adapter.addFrag(ShopRecommendFragment.newInstance(result[i]), title)
}
shop_viewPager?.adapter = adapter
id_tab_shop?.setupWithViewPager(shop_viewPager)
id_tab_shop?.overScrollMode = View.OVER_SCROLL_NEVER
id_tab_shop.buildText<BaseText>()
.setNormalTextBold(false)
.setNormalTextSize(20f)
.setSelectTextSize(22f)
.setSelectTextBold(true).bind()
}
override fun setCouponsList(result: List<CouponsEntity>?) {
} }
} }
\ No newline at end of file
package com.zxbw.modulemain.fragment package com.zxbw.modulemain.fragment
import android.content.Intent
import android.net.Uri
import android.text.TextUtils import android.text.TextUtils
import android.util.Log import android.util.Log
import android.view.View import android.view.View
...@@ -16,6 +18,7 @@ import com.zxhl.cms.net.ApiClient ...@@ -16,6 +18,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.pay.H5PayUtil
import com.zxhl.cms.utils.* import com.zxhl.cms.utils.*
import kotlinx.android.synthetic.main.fragment_layout_user_center.* import kotlinx.android.synthetic.main.fragment_layout_user_center.*
......
...@@ -78,11 +78,11 @@ class CardDetailPresenter : CardDetailContract.Presenter { ...@@ -78,11 +78,11 @@ class CardDetailPresenter : CardDetailContract.Presenter {
if (!TextUtils.isEmpty(order)) { if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType) requestVerify(order ?: "", "", payType)
} }
} else if (payType == 13) { } else if (payType == PaymentConfig.MIN_PAY_PROGRAM) {
if (!TextUtils.isEmpty(order)) { if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType) requestVerify(order ?: "", "", payType)
} }
} else if (payType == 21) { } else if (payType == PaymentConfig.H5_PAY) {
if (!TextUtils.isEmpty(order)) { if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType) requestVerify(order ?: "", "", payType)
} else { } else {
...@@ -92,6 +92,10 @@ class CardDetailPresenter : CardDetailContract.Presenter { ...@@ -92,6 +92,10 @@ class CardDetailPresenter : CardDetailContract.Presenter {
if (!TextUtils.isEmpty(order)) { if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType) requestVerify(order ?: "", "", payType)
} }
}else if (payType == PaymentConfig.ZFB_H5_PAY||payType == PaymentConfig.WX_H5_PAY|| payType == PaymentConfig.HUI_FU_H5_PAY1|| payType == PaymentConfig.HUI_FU_H5_PAY2) {
if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType)
}
} else { } else {
mView.verifyOrderFail("支付成功后 开始校验订单异常 e:支付方式异常$payType") mView.verifyOrderFail("支付成功后 开始校验订单异常 e:支付方式异常$payType")
} }
......
...@@ -126,6 +126,10 @@ class RechargePresenter : RechargeContract.Presenter { ...@@ -126,6 +126,10 @@ class RechargePresenter : RechargeContract.Presenter {
if (!TextUtils.isEmpty(order)) { if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType) requestVerify(order ?: "", "", payType)
} }
} else if (payType == PaymentConfig.ZFB_H5_PAY||payType == PaymentConfig.WX_H5_PAY|| payType == PaymentConfig.HUI_FU_H5_PAY1|| payType == PaymentConfig.HUI_FU_H5_PAY2) {
if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType)
}
} else { } else {
mView.verifyOrderFail("支付成功后 开始校验订单异常 e:支付方式异常$payType") mView.verifyOrderFail("支付成功后 开始校验订单异常 e:支付方式异常$payType")
} }
......
...@@ -82,6 +82,10 @@ class RightsPayPresenter : RightsPayContract.Presenter { ...@@ -82,6 +82,10 @@ class RightsPayPresenter : RightsPayContract.Presenter {
if (!TextUtils.isEmpty(order)) { if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType) requestVerify(order ?: "", "", payType)
} }
} else if (payType == PaymentConfig.ZFB_H5_PAY||payType == PaymentConfig.WX_H5_PAY|| payType == PaymentConfig.HUI_FU_H5_PAY1|| payType == PaymentConfig.HUI_FU_H5_PAY2) {
if (!TextUtils.isEmpty(order)) {
requestVerify(order ?: "", "", payType)
}
} else { } else {
mView.verifyOrderFail("支付成功后 开始校验订单异常 e:支付方式异常$payType") mView.verifyOrderFail("支付成功后 开始校验订单异常 e:支付方式异常$payType")
} }
......
...@@ -6,7 +6,6 @@ import com.zxhl.cms.net.ApiClient ...@@ -6,7 +6,6 @@ import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.callback.BaseObserver import com.zxhl.cms.net.callback.BaseObserver
import com.zxhl.cms.net.model.qy.TbGoodsEntity import com.zxhl.cms.net.model.qy.TbGoodsEntity
import com.zxhl.cms.net.model.shop.ShopListEntity
class SearchResultPresenter : SearchReslutContract.Presenter { class SearchResultPresenter : SearchReslutContract.Presenter {
private val mView: SearchReslutContract.View private val mView: SearchReslutContract.View
......
package com.zxbw.modulemain.presenter
import com.zxbw.modulemain.contract.ShopRecommendContract
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.box.TabEntity
import com.zxhl.cms.net.model.qy.JgqQyEntity
import com.zxhl.cms.net.model.qy.TbGoodsEntity
/**
* 商城分类
*/
class ShopRecommendPresenter : ShopRecommendContract.Presenter {
private val mView: ShopRecommendContract.View
constructor(mView: ShopRecommendContract.View) {
this.mView = mView
}
override fun getCategoryList(tabName: String) {
ApiClient.homeApi.getQyJgqCardList().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<JgqQyEntity>>() {
override fun onSuccess(result: List<JgqQyEntity>?) {
mView.setCategoryList(result)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView.setCategoryList(null)
}
})
}
private var searchPage = 1;
private var pageSize = 20;
override fun getShopGoodsList(isRefresh: Boolean, tabEntity: TabEntity) {
if (isRefresh && tabEntity.name == "推荐") {
searchPage = 1;
}
var cate = ""
var keyword = ""
if (tabEntity.use == "cate") {
cate = tabEntity.value
} else {
keyword = tabEntity.name
}
ApiClient.homeApi.getGoodsListSearch(cate, keyword, searchPage, pageSize)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<TbGoodsEntity>() {
override fun onSuccess(result: TbGoodsEntity?) {
if (result != null) {
searchPage++;
mView.setShopGoodsList(isRefresh, result.result_list)
} else {
mView.setShopGoodsList(isRefresh, null)
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView.setShopGoodsList(isRefresh, null)
}
})
}
}
\ No newline at end of file
package com.zxbw.modulemain.presenter
import com.zxbw.modulemain.contract.ShoppingMallContract
/**
* @author (wangXuewei)
* @datetime 2022-08-08 16:00 GMT+8
* @detail :
*/
class ShoppingMallPresenter: ShoppingMallContract.Presenter {
private val mView: ShoppingMallContract.View
constructor(mView: ShoppingMallContract.View) {
this.mView = mView
}
override fun getTabList() {
}
override fun getFetchCard() {
}
}
\ No newline at end of file
...@@ -364,6 +364,7 @@ object BoxResultDialog : LotteryContract.View, PopupWidowCloseCallBack { ...@@ -364,6 +364,7 @@ object BoxResultDialog : LotteryContract.View, PopupWidowCloseCallBack {
EventUtils.onEvent("select_lottery_boxid", "" + boxId) EventUtils.onEvent("select_lottery_boxid", "" + boxId)
this.page = page this.page = page
mRePumpingCardNum = cardNum mRePumpingCardNum = cardNum
goodsNum = selectNum.toString();
this.mActivity = mActivity this.mActivity = mActivity
this.boxId = boxId this.boxId = boxId
this.onePrice = onePrice this.onePrice = onePrice
...@@ -468,7 +469,7 @@ object BoxResultDialog : LotteryContract.View, PopupWidowCloseCallBack { ...@@ -468,7 +469,7 @@ object BoxResultDialog : LotteryContract.View, PopupWidowCloseCallBack {
this.fivePrice = fivePrice this.fivePrice = fivePrice
showPayDialog( showPayDialog(
mActivity, mActivity,
(onePrice ).toString(), (onePrice).toString(),
AdCallback { _, result -> AdCallback { _, result ->
if (result == 0) { if (result == 0) {
mPresenter.epicCardLottery(boxId) mPresenter.epicCardLottery(boxId)
......
package com.zxbw.modulemain.view;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.text.style.ImageSpan;
import androidx.annotation.NonNull;
/**
* @author (wangXuewei)
* @datetime 2022-08-09 14:39 GMT+8
* @detail :
*/
public class CenterImageSpan extends ImageSpan {
public CenterImageSpan(@NonNull Drawable drawable) {
super(drawable);
}
@Override
public void draw(@NonNull Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, @NonNull Paint paint) {
Drawable b = getDrawable();
Paint.FontMetricsInt fm = paint.getFontMetricsInt();
int transY = (y + fm.descent + y + fm.ascent)/ 2- b.getBounds().bottom/2;
canvas.save();
canvas.translate(x,transY);
b.draw(canvas);
canvas.restore();
}
}
\ No newline at end of file
package com.zxbw.modulemain.view;
import android.graphics.Bitmap;
import androidx.annotation.NonNull;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
import java.security.MessageDigest;
/**
* @author (wangXuewei)
* @datetime 2022-08-09 15:17 GMT+8
* @detail :
*/
public class CornerTransform extends BitmapTransformation {
@Override
protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) {
return null;
}
@Override
public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
}
}
...@@ -29,113 +29,95 @@ class NavigationBottomView : RelativeLayout { ...@@ -29,113 +29,95 @@ class NavigationBottomView : RelativeLayout {
private var mUserText: TextView? = null private var mUserText: TextView? = null
private var mCashCheckText: TextView? = null private var mCashCheckText: TextView? = null
private var mRightText: TextView? = null
private var mShopText: TextView? = null private var mShopText: TextView? = null
private var navifationCallback: NavifationCallback? = null private var navifationCallback: NavifationCallback? = null
private fun init() { private fun init() {
LayoutInflater.from(context).inflate(R.layout.view_navigation_bottom, this) LayoutInflater.from(context).inflate(R.layout.view_navigation_bottom, this)
mShopText = findViewById(R.id.id_view_navigation_bottom_box) mRightText = findViewById(R.id.id_view_navigation_bottom_box)
mShopText = findViewById(R.id.id_view_navigation_bottom_shop)
mCashCheckText = findViewById(R.id.id_view_navigation_bottom_cash) mCashCheckText = findViewById(R.id.id_view_navigation_bottom_cash)
mUserText = findViewById(R.id.id_view_navigation_bottom_user) mUserText = findViewById(R.id.id_view_navigation_bottom_user)
mRightText?.setOnClickListener {
setBottomDraw(0)
navifationCallback?.onNavigationClick(it.id)
}
mShopText?.setOnClickListener { mShopText?.setOnClickListener {
mUserText?.setTextColor(resources.getColor(R.color.color_999999)) setBottomDraw(1)
navifationCallback?.onNavigationClick(it.id)
}
mCashCheckText?.setOnClickListener {
setBottomDraw(2)
navifationCallback?.onNavigationClick(it.id)
}
mUserText?.setOnClickListener {
setBottomDraw(3)
navifationCallback?.onNavigationClick(it.id)
}
}
private fun setBottomDraw(index: Int) {
mRightText?.setTextColor(resources.getColor(R.color.color_999999))
mCashCheckText?.setTextColor(resources.getColor(R.color.color_999999)) mCashCheckText?.setTextColor(resources.getColor(R.color.color_999999))
mShopText?.setTextColor(resources.getColor(R.color.color_333333)) mUserText?.setTextColor(resources.getColor(R.color.color_999999))
val userDrawable = getResources().getDrawable(R.drawable.icon_bottom_my_default) mShopText?.setTextColor(resources.getColor(R.color.color_999999))
userDrawable.setBounds( var rightDrawable = resources.getDrawable(R.drawable.icon_bottom_right_default)
0,
0,
userDrawable.getMinimumWidth(),
userDrawable.getMinimumHeight()
);
val cashDrawable = getResources().getDrawable(R.drawable.icon_bottom_cash_default) var shopDrawable = resources.getDrawable(R.drawable.icon_bottom_shop_default)
cashDrawable.setBounds(
0,
0,
cashDrawable.getMinimumWidth(),
cashDrawable.getMinimumHeight()
);
val shopDrawable = getResources().getDrawable(R.drawable.icon_bottom_shop_click) var cashDrawable = resources.getDrawable(R.drawable.icon_bottom_cash_default)
shopDrawable.setBounds(
0,
0,
shopDrawable.getMinimumWidth(),
shopDrawable.getMinimumHeight()
)
mUserText?.setCompoundDrawables(null, userDrawable, null, null) var userDrawable = resources.getDrawable(R.drawable.icon_bottom_my_default)
mCashCheckText?.setCompoundDrawables(null, cashDrawable, null, null)
mShopText?.setCompoundDrawables(null, shopDrawable, null, null) when (index) {
navifationCallback?.onNavigationClick(it.id) 0 -> {
mRightText?.setTextColor(resources.getColor(R.color.color_333333))
rightDrawable = resources.getDrawable(R.drawable.icon_bottom_right_click)
} }
mCashCheckText?.setOnClickListener { 1 -> {
mShopText?.setTextColor(resources.getColor(R.color.color_999999)) mShopText?.setTextColor(resources.getColor(R.color.color_333333))
mUserText?.setTextColor(resources.getColor(R.color.color_333333)) shopDrawable = resources.getDrawable(R.drawable.icon_bottom_shop_click)
}
2 -> {
mCashCheckText?.setTextColor(resources.getColor(R.color.color_333333)) mCashCheckText?.setTextColor(resources.getColor(R.color.color_333333))
val userDrawable = getResources().getDrawable(R.drawable.icon_bottom_my_default) cashDrawable = resources.getDrawable(R.drawable.icon_bottom_cash_click)
userDrawable.setBounds( }
0, 3 -> {
0, mUserText?.setTextColor(resources.getColor(R.color.color_333333))
userDrawable.getMinimumWidth(), userDrawable = resources.getDrawable(R.drawable.icon_bottom_my_click)
userDrawable.getMinimumHeight() }
); }
val cashDrawable = getResources().getDrawable(R.drawable.icon_bottom_cash_click) rightDrawable.setBounds(
cashDrawable.setBounds(
0, 0,
0, 0,
cashDrawable.getMinimumWidth(), rightDrawable.minimumWidth,
cashDrawable.getMinimumHeight() rightDrawable.minimumHeight
); )
val shopDrawable = getResources().getDrawable(R.drawable.icon_bottom_shop_default)
shopDrawable.setBounds( shopDrawable.setBounds(
0, 0,
0, 0,
shopDrawable.getMinimumWidth(), shopDrawable.minimumWidth,
shopDrawable.getMinimumHeight() shopDrawable.minimumHeight
) )
mUserText?.setCompoundDrawables(null, userDrawable, null, null)
mCashCheckText?.setCompoundDrawables(null, cashDrawable, null, null)
mShopText?.setCompoundDrawables(null, shopDrawable, null, null)
navifationCallback?.onNavigationClick(it.id)
}
mUserText?.setOnClickListener {
mShopText?.setTextColor(resources.getColor(R.color.color_999999))
mCashCheckText?.setTextColor(resources.getColor(R.color.color_999999))
mUserText?.setTextColor(resources.getColor(R.color.color_333333))
val userDrawable = getResources().getDrawable(R.drawable.icon_bottom_my_click)
userDrawable.setBounds(
0,
0,
userDrawable.getMinimumWidth(),
userDrawable.getMinimumHeight()
);
val cashDrawable = getResources().getDrawable(R.drawable.icon_bottom_cash_default)
cashDrawable.setBounds( cashDrawable.setBounds(
0, 0,
0, 0,
cashDrawable.getMinimumWidth(), cashDrawable.minimumWidth,
cashDrawable.getMinimumHeight() cashDrawable.minimumHeight
); )
userDrawable.setBounds(
val shopDrawable = getResources().getDrawable(R.drawable.icon_bottom_shop_default)
shopDrawable.setBounds(
0, 0,
0, 0,
shopDrawable.getMinimumWidth(), userDrawable.minimumWidth,
shopDrawable.getMinimumHeight() userDrawable.minimumHeight
) )
mRightText?.setCompoundDrawables(null, rightDrawable, null, null)
mUserText?.setCompoundDrawables(null, userDrawable, null, null)
mCashCheckText?.setCompoundDrawables(null, cashDrawable, null, null)
mShopText?.setCompoundDrawables(null, shopDrawable, null, null) mShopText?.setCompoundDrawables(null, shopDrawable, null, null)
navifationCallback?.onNavigationClick(it.id) mCashCheckText?.setCompoundDrawables(null, cashDrawable, null, null)
} mUserText?.setCompoundDrawables(null, userDrawable, null, null)
} }
......
...@@ -332,7 +332,7 @@ public class SlidingTabLayout2 extends HorizontalScrollView implements ViewPager ...@@ -332,7 +332,7 @@ public class SlidingTabLayout2 extends HorizontalScrollView implements ViewPager
if (tv_tab_title != null) { if (tv_tab_title != null) {
tv_tab_title.setTextColor(i == mCurrentTab ? mTextSelectColor : mTextUnselectColor); tv_tab_title.setTextColor(i == mCurrentTab ? mTextSelectColor : mTextUnselectColor);
// tv_tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextsize); // tv_tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextsize);
tv_tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX,i == mCurrentTab ? mTextSelectSize : mTextUnselectSize); tv_tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, i == mCurrentTab ? mTextSelectSize : mTextUnselectSize);
tv_tab_title.setPadding((int) mTabPadding, 0, (int) mTabPadding, 0); tv_tab_title.setPadding((int) mTabPadding, 0, (int) mTabPadding, 0);
if (mTextAllCaps) { if (mTextAllCaps) {
tv_tab_title.setText(tv_tab_title.getText().toString().toUpperCase()); tv_tab_title.setText(tv_tab_title.getText().toString().toUpperCase());
...@@ -342,6 +342,8 @@ public class SlidingTabLayout2 extends HorizontalScrollView implements ViewPager ...@@ -342,6 +342,8 @@ public class SlidingTabLayout2 extends HorizontalScrollView implements ViewPager
tv_tab_title.getPaint().setFakeBoldText(true); tv_tab_title.getPaint().setFakeBoldText(true);
} else if (mTextBold == TEXT_BOLD_NONE) { } else if (mTextBold == TEXT_BOLD_NONE) {
tv_tab_title.getPaint().setFakeBoldText(false); tv_tab_title.getPaint().setFakeBoldText(false);
} else if (mTextBold == TEXT_BOLD_WHEN_SELECT) {
tv_tab_title.getPaint().setFakeBoldText(i == mCurrentTab);
} }
} }
} }
...@@ -405,7 +407,7 @@ public class SlidingTabLayout2 extends HorizontalScrollView implements ViewPager ...@@ -405,7 +407,7 @@ public class SlidingTabLayout2 extends HorizontalScrollView implements ViewPager
if (tab_title != null) { if (tab_title != null) {
tab_title.setTextColor(isSelect ? mTextSelectColor : mTextUnselectColor); tab_title.setTextColor(isSelect ? mTextSelectColor : mTextUnselectColor);
tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX,isSelect? mTextSelectSize : mTextUnselectSize); tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, isSelect ? mTextSelectSize : mTextUnselectSize);
if (mTextBold == TEXT_BOLD_WHEN_SELECT) { if (mTextBold == TEXT_BOLD_WHEN_SELECT) {
tab_title.getPaint().setFakeBoldText(isSelect); tab_title.getPaint().setFakeBoldText(isSelect);
} }
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="24dp"
android:height="9dp"
android:drawable="@drawable/icon_tab_select_img"
android:gravity="center">
<shape>
<gradient
android:angle="90"
android:endColor="#FFF28D85"
android:startColor="#FFFFD1D1"
android:type="linear" />
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="180"
android:endColor="#FFF28D85"
android:startColor="#FFFFD1D1"
android:type="linear" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#F4F4F4" android:background="#F1F1F1"
android:orientation="vertical"> android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/img_shop_title_bg" />
<LinearLayout <LinearLayout
android:id="@+id/id_ll_shop_top_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/img_shop_title_bg"
android:orientation="vertical"> android:orientation="vertical">
<View <View
android:id="@+id/id_sys_bar_view" android:id="@+id/id_sys_bar_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp" />
android:layout_marginBottom="10dp" />
<LinearLayout <LinearLayout
android:id="@+id/id_ll_search_title" android:id="@+id/id_ll_search_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <LinearLayout
android:id="@+id/id_ll_search_view" android:id="@+id/id_ll_search_view"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="36dp" android:layout_height="36dp"
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" android:layout_weight="1"
android:background="@drawable/shape_white_r25" android:background="@drawable/shape_white_r25"
android:gravity="center_vertical"> android:gravity="center_vertical">
...@@ -37,7 +42,7 @@ ...@@ -37,7 +42,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:drawableLeft="@drawable/icon_search" android:drawableLeft="@drawable/icon_search_red"
android:drawablePadding="4dp" android:drawablePadding="4dp"
android:text="搜索商品" android:text="搜索商品"
android:textColor="@color/color_999999" android:textColor="@color/color_999999"
...@@ -45,35 +50,39 @@ ...@@ -45,35 +50,39 @@
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/id_img_kefu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="16dp"
android:src="@drawable/icon_shop_kefu" />
</LinearLayout> </LinearLayout>
<!-- <com.zxhl.main.page.view.SlidingTabLayout2--> <com.google.android.material.tabs.TabLayout
<!-- android:id="@+id/id_fragment_shop_tab"--> android:id="@+id/id_tab_shop"
<!-- android:layout_width="match_parent"--> android:layout_width="wrap_content"
<!-- android:layout_height="38dp"--> android:layout_height="wrap_content"
<!-- android:layout_marginTop="10dp"--> android:layout_marginTop="10dp"
<!-- android:layout_marginBottom="5dp"--> app:tabIndicatorFullWidth="false"
<!-- android:paddingLeft="5dp"--> app:tabRippleColor="#00000000"
<!-- android:paddingRight="5dp"--> app:tabMode="auto"
<!-- app:tl_indicator_color="@color/white"--> app:tabIndicatorColor="#F28D85"
<!-- app:tl_indicator_corner_radius="2dp"--> app:tabIndicator="@drawable/indicator"
<!-- app:tl_indicator_height="4dp"--> app:tabTextColor="@color/color_999999"
<!-- app:tl_indicator_style="NORMAL"--> app:tabSelectedTextColor="@color/color_333333"
<!-- app:tl_indicator_width="14dp"--> android:layout_gravity="center_horizontal"
<!-- app:tl_tab_padding="10dp"--> android:layout_marginBottom="10dp" />
<!-- app:tl_tab_space_equal="true"-->
<!-- app:tl_textBold="SELECT"-->
<!-- app:tl_textSelectColor="@color/white"-->
<!-- app:tl_textUnselectColor="@color/white"-->
<!-- app:tl_textsize="18sp" />-->
</LinearLayout> </LinearLayout>
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/shop_viewPager" android:id="@+id/shop_viewPager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/id_ll_shop_top_view"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</LinearLayout> </RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_rl_home_zero_buy_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="16dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<ImageView
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/id_ll_zero_buy_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:background="@drawable/img_shop_activon_bg"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_img_goods"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/img_shop_activon_bg"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
\ 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_goods_item_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
android:background="@drawable/shape_ffffff_r10"
android:orientation="vertical">
<com.zxhl.cms.widget.RecycleImageView
android:id="@+id/id_item_goods_img"
android:layout_width="match_parent"
android:scaleType="fitXY"
android:layout_height="143dp"
android:layout_gravity="center"/>
<!--商品名称-->
<TextView
android:id="@+id/id_tv_goods_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="6dp"
android:ellipsize="end"
android:maxLines="2"
android:text="商品名称商品名称品名称商品名称商品名称品名称商"
android:textColor="@color/color_333333"
android:textSize="18sp"
android:textStyle="bold" />
<!--原价-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="6dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:text="¥"
android:textColor="#E24029"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_goods_original_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:text="0"
android:textColor="#E24029"
android:textSize="20sp"
android:textStyle="bold" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/icon_shop_vip_price" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="6dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:text="¥"
android:textColor="#D09A3C"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_goods_vip_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:text="0"
android:textColor="#D09A3C"
android:textSize="20sp"
android:textStyle="bold" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/icon_shop_vip_price" />
</LinearLayout>
<TextView
android:id="@+id/id_tv_goods_sale_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:text="已售:2564" />
</LinearLayout>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp" android:visibility="gone"
android:background="@drawable/shape_ffffff_r5" android:background="@drawable/shape_ffffff_r5"
android:orientation="vertical"> android:orientation="vertical">
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@drawable/icon_bottom_shop_click" android:drawableTop="@drawable/icon_bottom_right_click"
android:drawablePadding="2dp" android:drawablePadding="2dp"
android:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:includeFontPadding="false"
...@@ -27,6 +27,21 @@ ...@@ -27,6 +27,21 @@
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView
android:id="@+id/id_view_navigation_bottom_shop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:drawableTop="@drawable/icon_bottom_shop_default"
android:drawablePadding="2dp"
android:gravity="center"
android:text="@string/shop"
android:textColor="@color/color_999999"
android:textSize="14sp"
android:textStyle="bold"
android:visibility="gone" />
<TextView <TextView
android:id="@+id/id_view_navigation_bottom_cash" android:id="@+id/id_view_navigation_bottom_cash"
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
<string name="user_question_5">Q6:关于退款</string> <string name="user_question_5">Q6:关于退款</string>
<string name="user_question_6">Q5:客服电话</string> <string name="user_question_6">Q5:客服电话</string>
<string name="user_answer_1">注意需用支付的支付宝账号关联的手机号进行登录,即付款时的手机号进行登录,非在广告页面充值时填写的手机号码,如有疑问可联系在线客服</string> <string name="user_answer_1">注意需用广告页面充值时填写的手机号码登录,如有疑问可联系在线客服</string>
<string name="user_answer_2">查看:{我的}-{话费券}中查看即可\n使用:{会员权益}-{话费充值}选择充值100/200 优惠券会自动抵扣</string> <string name="user_answer_2">查看:{我的}-{话费券}中查看即可\n使用:{会员权益}-{话费充值}选择充值100/200 优惠券会自动抵扣</string>
<string name="user_answer_3">充值后会在72小时内到账,如未到账可在线咨询客服处理。</string> <string name="user_answer_3">充值后会在72小时左右到账,如未到账可联系在线客服咨询处理。</string>
<string name="user_answer_4">各大影视平台会员折扣权益,每日秒杀权益,淘宝、外卖优惠券权益</string> <string name="user_answer_4">各大影视平台会员折扣权益,每日秒杀权益,淘宝、外卖优惠券权益</string>
<!-- <string name="user_answer_5"><Data><![CDATA[如需退款,可直接点击链接进行自助退款,退款链接:<font color="#03A9F4">http://h5.zxhuichuan.com/xiaoxiang_refund</font>(最快10分钟-72小时)]]></Data></string>--> <!-- <string name="user_answer_5"><Data><![CDATA[如需退款,可直接点击链接进行自助退款,退款链接:<font color="#03A9F4">http://h5.zxhuichuan.com/xiaoxiang_refund</font>(最快10分钟-72小时)]]></Data></string>-->
<string name="user_answer_5">如权益未到账 可退款,填写自助退款链接后,会在72小时内操作到账(工作日),如已产生用户id 权益已到账,不支持退款。</string> <string name="user_answer_5">如权益未到账 可退款,填写自助退款链接后,会在72小时内操作到账(工作日),如已产生用户id 权益已到账,不支持退款。</string>
......
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