feat: 增加优惠码界面
This commit is contained in:
@@ -34,6 +34,7 @@ import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
public class ActivationActivity extends BaseMvvmActivity<ActivationViewModel, ActivityActivationBinding> {
|
||||
|
||||
private Disposable pollingDisposable;
|
||||
private String mCoupons;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -75,10 +76,10 @@ public class ActivationActivity extends BaseMvvmActivity<ActivationViewModel, Ac
|
||||
};
|
||||
|
||||
// 设置仅允许输入指定字符
|
||||
mViewDataBinding.etCoupons.setFilters(new InputFilter[]{
|
||||
englishNumberFilter,
|
||||
new InputFilter.LengthFilter(20)
|
||||
});
|
||||
// mViewDataBinding.etCoupons.setFilters(new InputFilter[]{
|
||||
// englishNumberFilter,
|
||||
// new InputFilter.LengthFilter(20)
|
||||
// });
|
||||
mViewDataBinding.etKey.setFilters(new InputFilter[]{
|
||||
englishNumberFilter,
|
||||
new InputFilter.LengthFilter(20)
|
||||
@@ -94,7 +95,7 @@ public class ActivationActivity extends BaseMvvmActivity<ActivationViewModel, Ac
|
||||
if (optional.isPresent()) {
|
||||
VipInfo vipInfo = optional.get();
|
||||
mViewDataBinding.tvPrice.setText("¥" + vipInfo.getPrice());
|
||||
mViewDataBinding.tvVipName.setText("¥" + vipInfo.getOrigin_price());
|
||||
mViewDataBinding.tvVipOriginPrice.setText("¥" + vipInfo.getOrigin_price());
|
||||
mViewDataBinding.tvVipPrice.setText("¥" + vipInfo.getPrice());
|
||||
mViewModel.getPayInfo(vipInfo.getId());
|
||||
}
|
||||
@@ -151,6 +152,64 @@ public class ActivationActivity extends BaseMvvmActivity<ActivationViewModel, Ac
|
||||
}
|
||||
});
|
||||
startPolling();
|
||||
|
||||
mViewModel.mCouponsData.observe(this, new Observer<String>() {
|
||||
@Override
|
||||
public void onChanged(String s) {
|
||||
mViewDataBinding.llCouponsInput.setVisibility(View.GONE);
|
||||
mViewDataBinding.llCouponsQrcode.setVisibility(View.VISIBLE);
|
||||
mCoupons = s;
|
||||
}
|
||||
});
|
||||
mViewModel.mCouponsLegalData.observe(this, new Observer<Boolean>() {
|
||||
@Override
|
||||
public void onChanged(Boolean aBoolean) {
|
||||
if (aBoolean) {
|
||||
mViewModel.getCouponsVipList();
|
||||
}
|
||||
}
|
||||
});
|
||||
mViewModel.mCouponsVipInfoListData.observe(this, new Observer<List<VipInfo>>() {
|
||||
@Override
|
||||
public void onChanged(List<VipInfo> vipInfos) {
|
||||
Optional<VipInfo> optional = vipInfos.stream().findFirst();
|
||||
if (optional.isPresent()) {
|
||||
VipInfo vipInfo = optional.get();
|
||||
mViewDataBinding.tvCouponsVipOriginPrice.setText("¥" + vipInfo.getOrigin_price());
|
||||
// mViewDataBinding.tvCouponsVipPrice.setText("¥" + vipInfo.getPrice());
|
||||
mViewModel.getCouponsPayInfo(vipInfo.getId(), mCoupons);
|
||||
}
|
||||
}
|
||||
});
|
||||
mViewModel.mCouponsOrderInfoData.observe(this, new Observer<OrderInfo>() {
|
||||
@Override
|
||||
public void onChanged(OrderInfo orderInfo) {
|
||||
if (orderInfo != null) {
|
||||
mViewModel.getCouponsQrCodeUrl(orderInfo.getOrder_sn());
|
||||
}
|
||||
}
|
||||
});
|
||||
mViewModel.mCouponsAlreadyActivatedData.observe(this, new Observer<Boolean>() {
|
||||
@Override
|
||||
public void onChanged(Boolean aBoolean) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
mViewModel.mCouponsPayInfoData.observe(this, new Observer<PayInfo>() {
|
||||
@Override
|
||||
public void onChanged(PayInfo payInfo) {
|
||||
if (payInfo != null) {
|
||||
String url = payInfo.getCode_url();
|
||||
long expireTime = payInfo.getTime_expire();
|
||||
// initWechatCountdown(expireTime);
|
||||
mViewDataBinding.tvCouponsVipPrice.setText("¥" + payInfo.getPrice());
|
||||
Bitmap bitmap = BitmapUtils.createQRImage(url, 400, getColor(R.color.black), getColor(R.color.white));
|
||||
mViewDataBinding.ivCouponsQrcode.setImageBitmap(bitmap);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -197,6 +256,8 @@ public class ActivationActivity extends BaseMvvmActivity<ActivationViewModel, Ac
|
||||
public void useCoupons(View view) {
|
||||
mViewDataBinding.clQrcode.setVisibility(View.GONE);
|
||||
mViewDataBinding.clCoupons.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.llCouponsInput.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.llCouponsQrcode.setVisibility(View.GONE);
|
||||
mViewDataBinding.clKey.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@@ -219,6 +280,16 @@ public class ActivationActivity extends BaseMvvmActivity<ActivationViewModel, Ac
|
||||
}
|
||||
mViewModel.codeActivation(code);
|
||||
}
|
||||
|
||||
public void checkCoupons(View view) {
|
||||
Editable editable = mViewDataBinding.etCoupons.getText();
|
||||
if (TextUtils.isEmpty(editable)) {
|
||||
Toaster.show("请输入优惠券码");
|
||||
return;
|
||||
}
|
||||
String coupons = editable.toString();
|
||||
mViewModel.checkCoupons(coupons);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
public class ActivationViewModel extends BaseViewModel<ActivityActivationBinding, ActivityEvent> {
|
||||
private static final String TAG = "ActivationViewModel";
|
||||
|
||||
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
@@ -82,12 +84,12 @@ public class ActivationViewModel extends BaseViewModel<ActivityActivationBinding
|
||||
.subscribe(new Observer<BaseResponse<OrderInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getPayUrl", "onSubscribe: ");
|
||||
Log.e("getPayInfo", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<OrderInfo> baseResponse) {
|
||||
Log.e("getPayUrl", "onNext: " + baseResponse);
|
||||
Log.e("getPayInfo", "onNext: " + baseResponse);
|
||||
if (baseResponse.code == 200) {
|
||||
OrderInfo orderInfo = baseResponse.data;
|
||||
mOrderInfoData.setValue(orderInfo);
|
||||
@@ -102,12 +104,12 @@ public class ActivationViewModel extends BaseViewModel<ActivityActivationBinding
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getPayUrl", "onError: " + e.getMessage());
|
||||
Log.e("getPayInfo", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getPayUrl", "onComplete: ");
|
||||
Log.e("getPayInfo", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -130,7 +132,7 @@ public class ActivationViewModel extends BaseViewModel<ActivityActivationBinding
|
||||
PayInfo payInfo = baseResponse.data;
|
||||
mPayInfoData.setValue(payInfo);
|
||||
} else {
|
||||
Toaster.show(baseResponse.data);
|
||||
Toaster.show(baseResponse.msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,4 +215,146 @@ public class ActivationViewModel extends BaseViewModel<ActivityActivationBinding
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public MutableLiveData<Boolean> mCouponsLegalData = new MutableLiveData<>();
|
||||
public MutableLiveData<String> mCouponsData = new MutableLiveData<>();
|
||||
|
||||
public void checkCoupons(String coupons) {
|
||||
NetInterfaceManager.getInstance().getCheckCouponsControl(coupons)
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("checkCoupons", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse baseResponse) {
|
||||
Log.e("checkCoupons", "onNext: " + baseResponse);
|
||||
if (baseResponse.code == 200) {
|
||||
mCouponsLegalData.setValue(true);
|
||||
mCouponsData.setValue(coupons);
|
||||
} else {
|
||||
Toaster.show(baseResponse.msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("checkCoupons", "onError: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("checkCoupons", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public MutableLiveData<List<VipInfo>> mCouponsVipInfoListData = new MutableLiveData<>();
|
||||
|
||||
public void getCouponsVipList() {
|
||||
NetInterfaceManager.getInstance().getVipListControl()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<VipInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getCouponsVipList", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<VipInfo>> listBaseResponse) {
|
||||
Log.e("getCouponsVipList", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
List<VipInfo> vipInfos = listBaseResponse.data;
|
||||
mCouponsVipInfoListData.setValue(vipInfos);
|
||||
} else {
|
||||
Toaster.show(listBaseResponse.msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getCouponsVipList", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getCouponsVipList", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public MutableLiveData<OrderInfo> mCouponsOrderInfoData = new MutableLiveData<>();
|
||||
public MutableLiveData<Boolean> mCouponsAlreadyActivatedData = new MutableLiveData<>();
|
||||
|
||||
public void getCouponsPayInfo(String vipId, String coupons) {
|
||||
NetInterfaceManager.getInstance().getBuyVipControl(vipId, coupons)
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<OrderInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getCouponsPayInfo", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<OrderInfo> baseResponse) {
|
||||
Log.e("getCouponsPayInfo", "onNext: " + baseResponse);
|
||||
if (baseResponse.code == 200) {
|
||||
OrderInfo orderInfo = baseResponse.data;
|
||||
mCouponsOrderInfoData.setValue(orderInfo);
|
||||
} else if (baseResponse.code == 4009) {
|
||||
ActivationUtil.getInstance().setActivation(1);
|
||||
|
||||
mCouponsAlreadyActivatedData.setValue(true);
|
||||
} else {
|
||||
Toaster.show(baseResponse.msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getCouponsPayInfo", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getCouponsPayInfo", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public MutableLiveData<PayInfo> mCouponsPayInfoData = new MutableLiveData<>();
|
||||
|
||||
public void getCouponsQrCodeUrl(String orderSn) {
|
||||
NetInterfaceManager.getInstance().getPayQrcodeControl(orderSn)
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<PayInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getQrCodeUrl", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<PayInfo> baseResponse) {
|
||||
Log.e("getQrCodeUrl", "onNext: " + baseResponse);
|
||||
if (baseResponse.code == 200) {
|
||||
PayInfo payInfo = baseResponse.data;
|
||||
mCouponsPayInfoData.setValue(payInfo);
|
||||
} else {
|
||||
Toaster.show(baseResponse.data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getQrCodeUrl", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getQrCodeUrl", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -109,9 +109,9 @@ public class HomeworkDetailsActivity extends BaseMvvmActivity<HomeworkDetailsVie
|
||||
|
||||
public void updateHomework(View v) {
|
||||
// mViewModel.updateHomework(mId);
|
||||
Intent intent = new Intent(HomeworkDetailsActivity.this, UpdateActivity.class);
|
||||
intent.putExtra("HomeworkBeanID", mId);
|
||||
startActivity(intent);
|
||||
// Intent intent = new Intent(HomeworkDetailsActivity.this, UpdateActivity.class);
|
||||
// intent.putExtra("HomeworkBeanID", mId);
|
||||
// startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.xwad.os.BuildConfig;
|
||||
import com.xwad.os.R;
|
||||
import com.xwad.os.activity.debug.DebugActivity;
|
||||
import com.xwad.os.activity.edit.EditActivity;
|
||||
import com.xwad.os.activity.home.HomeActivity;
|
||||
import com.xwad.os.activity.permission.PermissionActivity;
|
||||
import com.xwad.os.activity.service.ServiceActivity;
|
||||
import com.xwad.os.activity.update.UpdateActivity;
|
||||
@@ -169,14 +168,10 @@ public class UserActivity extends BaseMvvmActivity<UserViewModel, ActivityUserBi
|
||||
// Toaster.show("已是最新版本");
|
||||
} else {
|
||||
if (ApkUtils.isUpdate(UserActivity.this, appInfo)) {
|
||||
if (appInfo.getIs_forcedown() == 1) {
|
||||
ApkUtils.checkAppUpdate(UserActivity.this, appInfo);
|
||||
} else {
|
||||
Intent intent = new Intent(UserActivity.this, UpdateActivity.class);
|
||||
intent.putExtra("appInfo", appInfo);
|
||||
startActivity(intent);
|
||||
Toaster.show("有新的版本需要更新");
|
||||
}
|
||||
Intent intent = new Intent(UserActivity.this, UpdateActivity.class);
|
||||
intent.putExtra("appUpdateInfo", appInfo);
|
||||
startActivity(intent);
|
||||
Toaster.show("有新的版本需要更新");
|
||||
} else {
|
||||
// Toaster.show("已是最新版本");
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import androidx.lifecycle.Observer;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.xwad.os.BuildConfig;
|
||||
import com.xwad.os.R;
|
||||
import com.xwad.os.activity.home.HomeActivity;
|
||||
import com.xwad.os.activity.permission.PermissionActivity;
|
||||
import com.xwad.os.activity.service.ServiceActivity;
|
||||
import com.xwad.os.activity.update.UpdateActivity;
|
||||
@@ -59,14 +58,10 @@ public class DeviceFragment extends BaseMvvmFragment<DeviceViewModel, FragmentDe
|
||||
Toaster.show("已是最新版本");
|
||||
} else {
|
||||
if (ApkUtils.isUpdate(mContext, appInfo)) {
|
||||
if (appInfo.getIs_forcedown() == 1) {
|
||||
ApkUtils.checkAppUpdate(mContext, appInfo);
|
||||
} else {
|
||||
Intent intent = new Intent(mContext, UpdateActivity.class);
|
||||
intent.putExtra("appInfo", appInfo);
|
||||
startActivity(intent);
|
||||
Toaster.show("有新的版本需要更新");
|
||||
}
|
||||
Intent intent = new Intent(mContext, UpdateActivity.class);
|
||||
intent.putExtra("appUpdateInfo", appInfo);
|
||||
startActivity(intent);
|
||||
Toaster.show("有新的版本需要更新");
|
||||
} else {
|
||||
Toaster.show("已是最新版本");
|
||||
}
|
||||
|
||||
@@ -521,6 +521,20 @@ public class NetInterfaceManager {
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<OrderInfo>> getBuyVipControl(String vipId, String coupons) {
|
||||
return mRetrofit.create(UserApi.class)
|
||||
.buyVip(getToken(), LenovoCsdkUtil.getInstance().getSerial(), vipId, coupons)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getCheckCouponsControl(String coupons) {
|
||||
return mRetrofit.create(UserApi.class)
|
||||
.checkCoupons(getToken(), coupons)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getCodeActivationControl(String code) {
|
||||
return mRetrofit.create(UserApi.class)
|
||||
.codeActivation(getToken(), LenovoCsdkUtil.getInstance().getSerial(), code)
|
||||
@@ -1051,8 +1065,8 @@ public class NetInterfaceManager {
|
||||
|
||||
public void updateAdminInfo() {
|
||||
String address = String.valueOf(mMMKV.decodeString(CommonConfig.MAP_ADDRESS_KEY, "-"));
|
||||
String longitude = String.valueOf(mMMKV.decodeDouble(CommonConfig.MAP_LONGITUDE_KEY, 0L));
|
||||
String latitude = String.valueOf(mMMKV.decodeDouble(CommonConfig.MAP_LATITUDE_KEY, 0L));
|
||||
String longitude = String.valueOf(mMMKV.decodeString(CommonConfig.MAP_LONGITUDE_KEY, "0"));
|
||||
String latitude = String.valueOf(mMMKV.decodeString(CommonConfig.MAP_LATITUDE_KEY, "0"));
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("address", address);
|
||||
jsonObject.addProperty("longitude", longitude);
|
||||
|
||||
@@ -24,6 +24,9 @@ public class UrlAddress {
|
||||
public static final String VIP_LIST = "user/vip-list";
|
||||
/*购买VIP下订单*/
|
||||
public static final String BUY = "user/buy";
|
||||
/*优惠口令查询*/
|
||||
public static final String DISCOUNT_CODE_QUERY = "user/discount-code-query";
|
||||
|
||||
/*激活码激活*/
|
||||
public static final String activation_code = "activation/code";
|
||||
/*获取激活码(激活成功后才有)*/
|
||||
|
||||
@@ -38,6 +38,21 @@ public interface UserApi {
|
||||
@Field("vip_level_id") String vip_level_id
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.BUY)
|
||||
Observable<BaseResponse<OrderInfo>> buyVip(
|
||||
@Header("token") String token,
|
||||
@Field("sn") String sn,
|
||||
@Field("vip_level_id") String vip_level_id,
|
||||
@Field("discount_code") String coupons
|
||||
);
|
||||
|
||||
@GET(UrlAddress.DISCOUNT_CODE_QUERY)
|
||||
Observable<BaseResponse> checkCoupons(
|
||||
@Header("token") String token,
|
||||
@Query("discount_code") String discount_code
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.activation_code)
|
||||
Observable<BaseResponse> codeActivation(
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 18 KiB |
@@ -162,7 +162,7 @@
|
||||
android:textSize="9sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_vip_name"
|
||||
android:id="@+id/tv_vip_origin_price"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
@@ -345,8 +345,8 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="63dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::useCoupons}"
|
||||
@@ -357,8 +357,8 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="63dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::useKey}"
|
||||
@@ -386,6 +386,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_coupons_input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="32dp"
|
||||
@@ -440,13 +441,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="25dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::checkCoupons}"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_activation_confirm"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -489,8 +490,8 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="63dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::useQrCode}"
|
||||
@@ -501,8 +502,272 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="63dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::useKey}"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_activation_use_key"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_coupons_qrcode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="订购-学王365软终端许可证"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="商品价格"
|
||||
android:textColor="@color/activation_text_color"
|
||||
android:textSize="9sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_coupons_vip_origin_price"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="#000000"
|
||||
android:textSize="11sp"
|
||||
tools:text="¥980.00" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="使用优惠券价格"
|
||||
android:textColor="@color/activation_text_color"
|
||||
android:textSize="9sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_coupons_vip_price"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="14sp"
|
||||
tools:text="¥980.00" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_coupons_qrcode"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_qrcode_empty"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="支持"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="4dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_wechat_pay" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_alipay"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="4dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="扫码支付"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="11sp" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="请在15分钟内完成支付,超时二维码将失效"
|
||||
android:textColor="#9bb2cc"
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="247dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_activation_divider_line"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::useQrCode}"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_activation_use_qrcode"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::useKey}"
|
||||
@@ -672,8 +937,8 @@
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="63dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::useCoupons}"
|
||||
@@ -684,8 +949,8 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="63dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::useQrCode}"
|
||||
|
||||
Reference in New Issue
Block a user