Commit 22623dfa authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :1.1.8
[实现方案] :加入话费充值确认弹窗
parent c364f2a8
PACKAGE_NAME=com.zxhl.shop
VERSION_CODE=18
VERSION_NAME=1.1.7
\ No newline at end of file
VERSION_CODE=19
VERSION_NAME=1.1.8
\ No newline at end of file
package com.zxhl.cms.pay
/**
* @author (wangXuewei)
* @datetime 2022-08-15 14:16 GMT+8
* @detail :
*/
class PayUtil {
interface PayCallBack {
fun paySuccess()
fun payFail(errorMsg: String)
fun payCancel()
}
fun payInit() {
}
fun payShop() {
}
private fun loadPay() {
}
}
\ No newline at end of file
package com.zxhl.cms.widget;
import android.graphics.Rect;
import android.util.Log;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
import java.util.HashMap;
public class RecyclerViewSpacesItemDecoration2 extends RecyclerView.ItemDecoration {
public RecyclerViewSpacesItemDecoration2() {
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
Log.d("wxw", "adapterPos" + parent.getChildAdapterPosition(view));
Log.d("wxw", "layoutPos" + parent.getChildLayoutPosition(view));
int pos = parent.getChildAdapterPosition(view);
if (pos > 1) {
if (pos % 2 == 0) {
outRect.left = 40;
}else {
outRect.right = 40;
}
}
}
}
......@@ -206,6 +206,7 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
showToast("请选择运营商")
return
}
DialogUtils.showRechargeTips(this, phoneNumber) {
isClickPayBtn = true
mLoading?.setLoading("请稍后...")
mLoading?.show()
......@@ -222,6 +223,8 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
)
}
}
private var mCouponsResult: List<CouponsEntity>? = null
override fun setCouponsList(result: List<CouponsEntity>?) {
mCouponsResult = result
......@@ -282,7 +285,7 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
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) {
} 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)
......@@ -295,7 +298,7 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
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) {
if (pay_type == PaymentConfig.ZFB_H5_PAY || pay_type == PaymentConfig.HUI_FU_H5_PAY1) {
mLoading?.setResult(false, "支付失败,请安装支付宝后重试", 1000)
} else {
mLoading?.setResult(false, "支付失败,请安装微信后重试", 1000)
......@@ -508,7 +511,7 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
override fun onResume() {
super.onResume()
if (isPause && isClickPayBtn) {
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 == 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支付
mPresenter?.verifyPay(SettingPreference.getOutTradeNo(), pay_type!!)
} else {
......
......@@ -20,6 +20,7 @@ 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 com.zxhl.cms.widget.RecyclerViewSpacesItemDecoration2
import kotlinx.android.synthetic.main.fragment_layout_recommend.*
/**
......@@ -54,6 +55,7 @@ class ShopRecommendFragment : BaseFragment, ShopRecommendContract.View,
}
}
id_rcl_goods_list?.layoutManager = gridLayoutManager
id_rcl_goods_list?.addItemDecoration(RecyclerViewSpacesItemDecoration2())
id_rcl_goods_list.adapter = mGoodsAdapter
id_refresh_view.setRefreshHeader(ClassicsHeader(activity))
......
......@@ -385,6 +385,33 @@ object DialogUtils {
mDialog.show()
}
//显示充话费提示弹窗
fun showRechargeTips(
context: Activity?,
phone: String,
makeSureListener: View.OnClickListener
) {
if (context == null) return
val mDialog = Dialog(context, R.style.CenterCompatDialogTheme)
val mDialogView =
showBottomDialog(
R.layout.dialog_layout_recharge_tips,
context,
mDialog,
0,
Gravity.CENTER
)
mDialogView.findViewById<TextView>(R.id.id_tv_phone).text = "本次充值号码为:${phone}"
mDialogView.findViewById<TextView>(R.id.id_btn_ok).setOnClickListener {
mDialog.dismiss()
makeSureListener.onClick(it)
}
mDialog.setCanceledOnTouchOutside(true)
mDialog.setCancelable(true)
mDialog.show()
}
//显示删除用户提示弹窗
fun showDeleteUserIdTips(context: Activity?, deleteListener: View.OnClickListener) {
if (context == null) return
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="40dp"
android:background="@drawable/shape_ffffff_r10"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="15dp">
<TextView
android:id="@+id/id_tv_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="本次充值号码为:"
android:textColor="@color/color_333333"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="我已阅读并知悉温馨提示中所有规则。"
android:textColor="@color/color_999999"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_btn_ok"
android:layout_width="150dp"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:background="@drawable/shape_333333_r20"
android:gravity="center"
android:text="确定"
android:textColor="#F8E8CC"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
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