1:在充值的地方,添加充值协议提示
This commit is contained in:
@@ -15,7 +15,9 @@ import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.adapter.BalanceRechargeAdapter;
|
||||
@@ -29,6 +31,7 @@ import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.databinding.FragmentRechargeDialogBinding;
|
||||
import com.xscm.moduleutil.presenter.RechargeDialogContacts;
|
||||
import com.xscm.moduleutil.presenter.RechargeDialogPresenter;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.PaymentUtil;
|
||||
@@ -105,7 +108,7 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.tv_payment) {
|
||||
if (money.equals("0")) {
|
||||
money=mBinding.etCustomAmount.getText().toString().trim();
|
||||
money = mBinding.etCustomAmount.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(money)) {
|
||||
ToastUtils.showShort("请选择充值金额");
|
||||
return;
|
||||
@@ -116,16 +119,24 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (!mBinding.cbPrivacy.isChecked()) {
|
||||
ToastUtils.showShort("请先勾选服务条款");
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedItem == null) {
|
||||
ToastUtils.showShort("请选择支付方式");
|
||||
return;
|
||||
}
|
||||
MvpPre.appPay(SpUtil.getUserId() + "", money, coin, selectedItem.getType(),type_params,gift_bag_id);
|
||||
MvpPre.appPay(SpUtil.getUserId() + "", money, coin, selectedItem.getType(), type_params, gift_bag_id);
|
||||
} else if (view.getId() == R.id.tv_czxy) {//充值协议
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"/api/Page/page_show?id=37").withString("title", "充值协议").navigation();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.tvPayment.setOnClickListener(this::onClick);
|
||||
mBinding.tvCzxy.setOnClickListener(this::onClick);
|
||||
mBinding.recycleView1.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
bindTypeAdapter = new PayMethodAdapter(R.layout.item_bind_type);
|
||||
mBinding.recycleView1.setAdapter(bindTypeAdapter);
|
||||
|
||||
@@ -217,6 +217,46 @@
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_agreement"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_payment"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginVertical="@dimen/dp_10"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_privacy"
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:checked="false"
|
||||
android:background="@drawable/selector_login_agreement"
|
||||
android:button="@null" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="我已阅读并同意"
|
||||
android:textColor="@color/color_FFA8A8A8"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_czxy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="《充值协议》"
|
||||
android:textColor="#22BB79"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
@@ -15,9 +15,11 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.modulemain.R;
|
||||
import com.xscm.modulemain.activity.WebViewActivity;
|
||||
import com.xscm.modulemain.databinding.ActivityRechargeBinding;
|
||||
import com.tencent.liteav.base.Log;
|
||||
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
||||
@@ -80,6 +82,8 @@ public class RechargeActivity extends BaseMvpActivity<RechargePresenter, Activit
|
||||
|
||||
// mBinding.rlThreePay.setOnClickListener(this::onClick);
|
||||
|
||||
mBinding.tvCzxy.setOnClickListener(this::onClick);
|
||||
|
||||
mBinding.recycleView1.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
|
||||
bindTypeAdapter = new PayMethodAdapter(com.xscm.moduleutil.R.layout.item_bind_type);
|
||||
mBinding.recycleView1.setAdapter(bindTypeAdapter);
|
||||
@@ -115,6 +119,12 @@ public class RechargeActivity extends BaseMvpActivity<RechargePresenter, Activit
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mBinding.cbPrivacy.isChecked()) {
|
||||
ToastUtils.showShort("请先勾选服务条款");
|
||||
return;
|
||||
}
|
||||
|
||||
// if (Double.valueOf(money) < 6) {
|
||||
// ToastUtils.showShort("最低充值6元以上");
|
||||
// return;
|
||||
@@ -128,6 +138,11 @@ public class RechargeActivity extends BaseMvpActivity<RechargePresenter, Activit
|
||||
|
||||
LogUtils.d(TAG,"onClick,=--3------"+money);
|
||||
MvpPre.appPay(SpUtil.getUserId() + "", money, coin, selectedItem.getType(),"","");
|
||||
}else if (view.getId() == R.id.tv_czxy) {
|
||||
Intent intent = new Intent(ActivityUtils.getTopActivity(), WebViewActivity.class);
|
||||
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=37");
|
||||
intent.putExtra("title", "充值协议");
|
||||
ActivityUtils.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="@dimen/dp_38"
|
||||
android:layout_marginRight="@dimen/dp_38"
|
||||
android:layout_marginBottom="@dimen/dp_27"
|
||||
android:layout_marginBottom="@dimen/dp_47"
|
||||
android:background="@drawable/cs"
|
||||
android:gravity="center"
|
||||
android:text="确认支付"
|
||||
@@ -185,6 +185,46 @@
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_agreement"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_payment"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginVertical="@dimen/dp_10"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_privacy"
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:checked="false"
|
||||
android:background="@drawable/selector_login_agreement"
|
||||
android:button="@null" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="我已阅读并同意"
|
||||
android:textColor="@color/color_FFA8A8A8"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_czxy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="《充值协议》"
|
||||
android:textColor="#22BB79"
|
||||
android:textSize="@dimen/sp_11"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user