1.增加支付宝微信支付
2.增加设备页不同电量图片背景 3.修复用户定位刷新,宠物和用户虚线没有及时更新bug
@@ -45,7 +45,7 @@ class CreditCardAdapter(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
holder.getView(R.id.iv_credit_card_edit_btn).setOnClickListener {
|
holder.getView(R.id.iv_credit_card_edit_btn).setOnClickListener {
|
||||||
(((mContext as PaymentMethodActivity).mFragments[0]) as CreditCardPaymentFragment).goEditCard(
|
(((mContext as PaymentMethodActivity).mPayFragments[0]) as CreditCardPaymentFragment).goEditCard(
|
||||||
item
|
item
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,13 @@ class MyTrackerV2Adapter(
|
|||||||
trackerName.text = item.deviceOutId
|
trackerName.text = item.deviceOutId
|
||||||
val battery = "${item.batteryCapacity} "
|
val battery = "${item.batteryCapacity} "
|
||||||
batteryTextView.text = battery
|
batteryTextView.text = battery
|
||||||
|
val batteryBg = if (item.batteryCapacity >= 60)
|
||||||
|
R.drawable.icon_device_high_battery_bg
|
||||||
|
else if (item.batteryCapacity >= 20)
|
||||||
|
R.drawable.icon_device_middle_battery_bg
|
||||||
|
else
|
||||||
|
R.drawable.icon_device_low_battery_bg
|
||||||
|
batteryTextView.setBackgroundResource(batteryBg)
|
||||||
}
|
}
|
||||||
if (null == item.pet) {
|
if (null == item.pet) {
|
||||||
addPetLayout.visibility = View.VISIBLE
|
addPetLayout.visibility = View.VISIBLE
|
||||||
|
|||||||
@@ -213,6 +213,8 @@ abstract class BaseActivity<T : ViewBinding>(val inflater: (inflater: LayoutInfl
|
|||||||
} else {
|
} else {
|
||||||
setStatusBarLight()
|
setStatusBarLight()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TopBar为空时不能适配状态栏,需要手动适配状态栏
|
||||||
mTopBar?.apply {
|
mTopBar?.apply {
|
||||||
//适配状态栏
|
//适配状态栏
|
||||||
this.parent?.let {
|
this.parent?.let {
|
||||||
@@ -936,6 +938,31 @@ abstract class BaseActivity<T : ViewBinding>(val inflater: (inflater: LayoutInfl
|
|||||||
|
|
||||||
/*****************************监听软键盘弹出,输入框上移end************************************/
|
/*****************************监听软键盘弹出,输入框上移end************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始定位
|
||||||
|
*/
|
||||||
|
fun startUpLocation() {
|
||||||
|
LogUtil.e("开始定位")
|
||||||
|
if (AppUtils.isChina()) {
|
||||||
|
//30秒定位一次,定位精度为高精度
|
||||||
|
BaiduLocationManager.startLocation(30)
|
||||||
|
} else {
|
||||||
|
GoogleLocationManager.startLocation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止定位
|
||||||
|
*/
|
||||||
|
private fun stopUpLocation() {
|
||||||
|
LogUtil.e("停止定位")
|
||||||
|
if (AppUtils.isChina()) {
|
||||||
|
BaiduLocationManager.stopLocation()
|
||||||
|
} else {
|
||||||
|
GoogleLocationManager.stopLocation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 释放定位服务
|
* 释放定位服务
|
||||||
*/
|
*/
|
||||||
@@ -954,6 +981,7 @@ abstract class BaseActivity<T : ViewBinding>(val inflater: (inflater: LayoutInfl
|
|||||||
//isFinishing:判断 Activity 是否正在被销毁。
|
//isFinishing:判断 Activity 是否正在被销毁。
|
||||||
//isTaskRoot:判断当前 Activity 是否为任务栈的根 Activity(避免其他 Activity 销毁时误触发)
|
//isTaskRoot:判断当前 Activity 是否为任务栈的根 Activity(避免其他 Activity 销毁时误触发)
|
||||||
if (isFinishing && isTaskRoot) {
|
if (isFinishing && isTaskRoot) {
|
||||||
|
stopUpLocation()
|
||||||
releaseLocationService()
|
releaseLocationService()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,4 @@ package com.abbidot.tracker.bean
|
|||||||
* @link
|
* @link
|
||||||
* @description:微信支付预支付订单
|
* @description:微信支付预支付订单
|
||||||
*/
|
*/
|
||||||
data class AlipayOrderBean(val orderString: String) {
|
data class AlipayOrderBean(val orderString: String, val payData: PayResultBean?)
|
||||||
constructor() : this("")
|
|
||||||
}
|
|
||||||
@@ -5,12 +5,13 @@ package com.abbidot.tracker.bean
|
|||||||
* @link
|
* @link
|
||||||
* @description:微信支付预支付订单
|
* @description:微信支付预支付订单
|
||||||
*/
|
*/
|
||||||
data class WXPayOrderBean(val appid: String,
|
data class WXPayOrderBean(
|
||||||
|
val appid: String,
|
||||||
val noncestr: String,
|
val noncestr: String,
|
||||||
val packageStr: String,
|
val packageStr: String,
|
||||||
val partnerid: String,
|
val partnerid: String,
|
||||||
val prepayid: String,
|
val prepayid: String,
|
||||||
val sign: String,
|
val sign: String,
|
||||||
val timestamp: String) {
|
val payData: PayResultBean?,
|
||||||
constructor() : this("", "", "", "", "", "", "")
|
val timestamp: String
|
||||||
}
|
)
|
||||||
@@ -19,10 +19,10 @@ import com.abbidot.tracker.bean.SetMealBean
|
|||||||
import com.abbidot.tracker.constant.ConstantString
|
import com.abbidot.tracker.constant.ConstantString
|
||||||
import com.abbidot.tracker.constant.GetResultCallback
|
import com.abbidot.tracker.constant.GetResultCallback
|
||||||
import com.abbidot.tracker.databinding.ActivityRechargeOrderDetailCnBinding
|
import com.abbidot.tracker.databinding.ActivityRechargeOrderDetailCnBinding
|
||||||
import com.abbidot.tracker.deprecated.ui.activity.vm.PayCNViewModel
|
|
||||||
import com.abbidot.tracker.util.ThirdPartyUtil
|
import com.abbidot.tracker.util.ThirdPartyUtil
|
||||||
import com.abbidot.tracker.util.Util
|
import com.abbidot.tracker.util.Util
|
||||||
import com.abbidot.tracker.util.ViewUtil
|
import com.abbidot.tracker.util.ViewUtil
|
||||||
|
import com.abbidot.tracker.vm.cn.PayCNViewModel
|
||||||
import com.alipay.sdk.app.PayTask
|
import com.alipay.sdk.app.PayTask
|
||||||
import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet
|
import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet
|
||||||
import com.tencent.mm.opensdk.modelpay.PayReq
|
import com.tencent.mm.opensdk.modelpay.PayReq
|
||||||
@@ -231,11 +231,11 @@ class RechargeOrderDetailCNActivity : BaseActivity<ActivityRechargeOrderDetailCn
|
|||||||
*/
|
*/
|
||||||
private fun goPay() {
|
private fun goPay() {
|
||||||
when (mPayWay) {
|
when (mPayWay) {
|
||||||
0 -> mPayCNViewModel.getWxPayOrder(this, mSetMealBean!!, mRechargeDeviceBean!!.deviceId)
|
// 0 -> mPayCNViewModel.getWxPayOrder(this, mSetMealBean!!, mRechargeDeviceBean!!.deviceId)
|
||||||
|
//
|
||||||
1 -> mPayCNViewModel.getAlipayOrder(
|
// 1 -> mPayCNViewModel.getAlipayOrder(
|
||||||
this, mSetMealBean!!, mRechargeDeviceBean!!.deviceId
|
// this, mSetMealBean!!, mRechargeDeviceBean!!.deviceId
|
||||||
)
|
// )
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,11 +64,11 @@ interface INetworkService {
|
|||||||
|
|
||||||
//测试服务器
|
//测试服务器
|
||||||
const val BASE_URL_TEST = "https://aws.abbidot.com:8443/abbidot/"
|
const val BASE_URL_TEST = "https://aws.abbidot.com:8443/abbidot/"
|
||||||
|
// const val BASE_URL_TEST = "https://192.168.0.72:8089/abbidot/"
|
||||||
|
|
||||||
//设备透传
|
//设备透传
|
||||||
const val BASE_URL_BLE = "https://ab-server.abbidot.com/"
|
const val BASE_URL_BLE = "https://ab-server.abbidot.com/"
|
||||||
// const val BASE_URL_TEST = "http://aws.abbidot.com:8089/abbidot/"
|
// const val BASE_URL_TEST = "http://aws.abbidot.com:8089/abbidot/"
|
||||||
// const val BASE_URL_ABROAD = "http://192.168.0.220:8080/abbidot/"
|
|
||||||
|
|
||||||
//亚马逊服务器(国内ip)
|
//亚马逊服务器(国内ip)
|
||||||
// const val BASE_URL_CN = "$IP_SERVER:8443/abbidotServer/"
|
// const val BASE_URL_CN = "$IP_SERVER:8443/abbidotServer/"
|
||||||
@@ -1464,12 +1464,35 @@ interface INetworkService {
|
|||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("order/getWxPayOrder")
|
@POST("order/getWxPayOrder")
|
||||||
suspend fun getWxPayOrder(
|
suspend fun getWxPayOrder(
|
||||||
@Field("feePackage") feePackage: String,
|
|
||||||
@Field("deviceId") deviceId: String,
|
|
||||||
@Field("payFee") payFee: Double,
|
|
||||||
@Field("period") period: Float,
|
|
||||||
@Field("userId") userId: String,
|
@Field("userId") userId: String,
|
||||||
@Field("username") username: String
|
@Field("deviceId") deviceId: String,
|
||||||
|
@Field("payMethod") payMethod: Int,
|
||||||
|
@Field("iccid") iccid: String,
|
||||||
|
@Field("deviceOutId") deviceOutId: String,
|
||||||
|
@Field("username") username: String,
|
||||||
|
@Field("mealName") mealName: String,
|
||||||
|
@Field("mealDesc") mealDesc: String,
|
||||||
|
@Field("mealId") mealId: String,
|
||||||
|
@Field("mealPeriod") mealPeriod: Int,
|
||||||
|
@Field("mealPrice") mealPrice: Double,
|
||||||
|
@Field("mealDiscountPrice") mealDiscountPrice: Double,
|
||||||
|
@Field("mealUnit") mealUnit: String,
|
||||||
|
@Field("annualCareType") annualCareType: Int,
|
||||||
|
@Field("annualCarePrice") annualCarePrice: Double,
|
||||||
|
// @Field("couponCode") couponCode: String,
|
||||||
|
@Field("reactivation") reactivation: Int,
|
||||||
|
@Field("reactivatePrice") reactivatePrice: Double,
|
||||||
|
@Field("totalAmountWithTax") totalAmountWithTax: Double,
|
||||||
|
@Field("planCategory") planCategory: String,
|
||||||
|
@Field("autoRenewPrice") autoRenewPrice: Double,
|
||||||
|
// @Field("couponPrice") couponPrice: Double,
|
||||||
|
// @Field("useCoupon") useCoupon: Int,
|
||||||
|
@Field("tax") tax: Double,
|
||||||
|
@Field("customerId") customerId: String,
|
||||||
|
@Field("orderNum") orderNum: String,
|
||||||
|
@Field("isUpdateOrder") isUpdateOrder: Int,
|
||||||
|
@Field("planTimeMonthsCount") planTimeMonthsCount: Int,
|
||||||
|
@Field("subscriptionId") subscriptionId: String
|
||||||
): BaseResponse<WXPayOrderBean>
|
): BaseResponse<WXPayOrderBean>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1478,12 +1501,35 @@ interface INetworkService {
|
|||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("order/getAlipayOrder")
|
@POST("order/getAlipayOrder")
|
||||||
suspend fun getAlipayOrder(
|
suspend fun getAlipayOrder(
|
||||||
@Field("feePackage") feePackage: String,
|
|
||||||
@Field("deviceId") deviceId: String,
|
|
||||||
@Field("payFee") payFee: Double,
|
|
||||||
@Field("period") period: Float,
|
|
||||||
@Field("userId") userId: String,
|
@Field("userId") userId: String,
|
||||||
@Field("username") username: String
|
@Field("deviceId") deviceId: String,
|
||||||
|
@Field("payMethod") payMethod: Int,
|
||||||
|
@Field("iccid") iccid: String,
|
||||||
|
@Field("deviceOutId") deviceOutId: String,
|
||||||
|
@Field("username") username: String,
|
||||||
|
@Field("mealName") mealName: String,
|
||||||
|
@Field("mealDesc") mealDesc: String,
|
||||||
|
@Field("mealId") mealId: String,
|
||||||
|
@Field("mealPeriod") mealPeriod: Int,
|
||||||
|
@Field("mealPrice") mealPrice: Double,
|
||||||
|
@Field("mealDiscountPrice") mealDiscountPrice: Double,
|
||||||
|
@Field("mealUnit") mealUnit: String,
|
||||||
|
@Field("annualCareType") annualCareType: Int,
|
||||||
|
@Field("annualCarePrice") annualCarePrice: Double,
|
||||||
|
// @Field("couponCode") couponCode: String,
|
||||||
|
@Field("reactivation") reactivation: Int,
|
||||||
|
@Field("reactivatePrice") reactivatePrice: Double,
|
||||||
|
@Field("totalAmountWithTax") totalAmountWithTax: Double,
|
||||||
|
@Field("planCategory") planCategory: String,
|
||||||
|
@Field("autoRenewPrice") autoRenewPrice: Double,
|
||||||
|
// @Field("couponPrice") couponPrice: Double,
|
||||||
|
// @Field("useCoupon") useCoupon: Int,
|
||||||
|
@Field("tax") tax: Double,
|
||||||
|
@Field("customerId") customerId: String,
|
||||||
|
@Field("orderNum") orderNum: String,
|
||||||
|
@Field("isUpdateOrder") isUpdateOrder: Int,
|
||||||
|
@Field("planTimeMonthsCount") planTimeMonthsCount: Int,
|
||||||
|
@Field("subscriptionId") subscriptionId: String
|
||||||
): BaseResponse<AlipayOrderBean>
|
): BaseResponse<AlipayOrderBean>
|
||||||
|
|
||||||
/*******************************************以上是国内版本接口end***********************************/
|
/*******************************************以上是国内版本接口end***********************************/
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ package com.abbidot.tracker.retrofit2
|
|||||||
|
|
||||||
import com.abbidot.baselibrary.network.base.BaseNetworkApi
|
import com.abbidot.baselibrary.network.base.BaseNetworkApi
|
||||||
import com.abbidot.baselibrary.util.AppUtils
|
import com.abbidot.baselibrary.util.AppUtils
|
||||||
|
import com.abbidot.tracker.bean.AlipayOrderBean
|
||||||
import com.abbidot.tracker.bean.FencesBean
|
import com.abbidot.tracker.bean.FencesBean
|
||||||
import com.abbidot.tracker.bean.PayResultBean
|
import com.abbidot.tracker.bean.PayResultBean
|
||||||
import com.abbidot.tracker.bean.SetMealBean
|
import com.abbidot.tracker.bean.SetMealBean
|
||||||
import com.abbidot.tracker.bean.SubscriptionsOrderBean
|
import com.abbidot.tracker.bean.SubscriptionsOrderBean
|
||||||
|
import com.abbidot.tracker.bean.WXPayOrderBean
|
||||||
import com.abbidot.tracker.constant.ConstantInt
|
import com.abbidot.tracker.constant.ConstantInt
|
||||||
import okhttp3.MultipartBody
|
import okhttp3.MultipartBody
|
||||||
import okhttp3.RequestBody
|
import okhttp3.RequestBody
|
||||||
@@ -1347,24 +1349,86 @@ object NetworkApi : BaseNetworkApi<INetworkService>(INetworkService.BASE_URL) {
|
|||||||
/**
|
/**
|
||||||
* 获取微信Prepay_id
|
* 获取微信Prepay_id
|
||||||
*/
|
*/
|
||||||
suspend fun getWxPayOrder(
|
suspend fun getWxPayOrder(subscriptionsOrder: SubscriptionsOrderBean): Result<WXPayOrderBean> {
|
||||||
setMealBean: SetMealBean, deviceId: String, userId: String, username: String
|
subscriptionsOrder.apply {
|
||||||
) = getResult {
|
if (isUpdateOrder == ConstantInt.Type0) {
|
||||||
|
orderNum = ""
|
||||||
|
subscriptionId = ""
|
||||||
|
}
|
||||||
|
return getResult {
|
||||||
service.getWxPayOrder(
|
service.getWxPayOrder(
|
||||||
setMealBean.name, deviceId, setMealBean.accountFee, setMealBean.period, userId, username
|
userId,
|
||||||
|
deviceId,
|
||||||
|
3,
|
||||||
|
iccid,
|
||||||
|
deviceOutId,
|
||||||
|
username,
|
||||||
|
mealName,
|
||||||
|
mealDesc,
|
||||||
|
mealId,
|
||||||
|
mealPeriod,
|
||||||
|
mealPrice,
|
||||||
|
mealDiscountPrice,
|
||||||
|
mealUnit,
|
||||||
|
annualCareType,
|
||||||
|
annualCarePrice,
|
||||||
|
reactivation,
|
||||||
|
reactivatePrice,
|
||||||
|
totalAmountWithTax,
|
||||||
|
planCategory,
|
||||||
|
autoRenewPrice,
|
||||||
|
tax,
|
||||||
|
"",
|
||||||
|
orderNum,
|
||||||
|
isUpdateOrder,
|
||||||
|
planTimeMonthsCount,
|
||||||
|
subscriptionId
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取支付宝支付订单
|
* 获取支付宝支付订单
|
||||||
*/
|
*/
|
||||||
suspend fun getAlipayOrder(
|
suspend fun getAlipayOrder(subscriptionsOrder: SubscriptionsOrderBean): Result<AlipayOrderBean> {
|
||||||
setMealBean: SetMealBean, deviceId: String, userId: String, username: String
|
subscriptionsOrder.apply {
|
||||||
) = getResult {
|
if (isUpdateOrder == ConstantInt.Type0) {
|
||||||
|
orderNum = ""
|
||||||
|
subscriptionId = ""
|
||||||
|
}
|
||||||
|
return getResult {
|
||||||
service.getAlipayOrder(
|
service.getAlipayOrder(
|
||||||
setMealBean.name, deviceId, setMealBean.accountFee, setMealBean.period, userId, username
|
userId,
|
||||||
|
deviceId,
|
||||||
|
4,
|
||||||
|
iccid,
|
||||||
|
deviceOutId,
|
||||||
|
username,
|
||||||
|
mealName,
|
||||||
|
mealDesc,
|
||||||
|
mealId,
|
||||||
|
mealPeriod,
|
||||||
|
mealPrice,
|
||||||
|
mealDiscountPrice,
|
||||||
|
mealUnit,
|
||||||
|
annualCareType,
|
||||||
|
annualCarePrice,
|
||||||
|
reactivation,
|
||||||
|
reactivatePrice,
|
||||||
|
totalAmountWithTax,
|
||||||
|
planCategory,
|
||||||
|
autoRenewPrice,
|
||||||
|
tax,
|
||||||
|
"",
|
||||||
|
orderNum,
|
||||||
|
isUpdateOrder,
|
||||||
|
planTimeMonthsCount,
|
||||||
|
subscriptionId
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************以上是国内版本接口end***********************************/
|
/*******************************************以上是国内版本接口end***********************************/
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,6 @@ import com.google.android.gms.location.LocationRequest
|
|||||||
import com.google.android.gms.location.LocationResult
|
import com.google.android.gms.location.LocationResult
|
||||||
import com.google.android.gms.location.LocationServices
|
import com.google.android.gms.location.LocationServices
|
||||||
import com.google.android.gms.location.Priority
|
import com.google.android.gms.location.Priority
|
||||||
import com.hjq.toast.Toaster
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 谷歌定位服务
|
* 谷歌定位服务
|
||||||
@@ -44,7 +43,6 @@ class GoogleLocationService : Service() {
|
|||||||
mLocationCallback = object : LocationCallback() {
|
mLocationCallback = object : LocationCallback() {
|
||||||
override fun onLocationResult(locationResult: LocationResult) {
|
override fun onLocationResult(locationResult: LocationResult) {
|
||||||
locationResult.lastLocation?.let {
|
locationResult.lastLocation?.let {
|
||||||
Toaster.show("谷歌定位成功")
|
|
||||||
LogUtil.e("谷歌定位成功: ${it.latitude}, ${it.longitude}")
|
LogUtil.e("谷歌定位成功: ${it.latitude}, ${it.longitude}")
|
||||||
setLocationData(it)
|
setLocationData(it)
|
||||||
XEventBus.post(EventName.LocationData, it)
|
XEventBus.post(EventName.LocationData, it)
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ import com.abbidot.tracker.ui.fragment.data.ActivityV2Fragment
|
|||||||
import com.abbidot.tracker.ui.fragment.data.RouteV3Fragment
|
import com.abbidot.tracker.ui.fragment.data.RouteV3Fragment
|
||||||
import com.abbidot.tracker.ui.fragment.map.MapV3Fragment
|
import com.abbidot.tracker.ui.fragment.map.MapV3Fragment
|
||||||
import com.abbidot.tracker.ui.fragment.pet.PetV2Fragment
|
import com.abbidot.tracker.ui.fragment.pet.PetV2Fragment
|
||||||
import com.abbidot.tracker.util.BaiduLocationManager
|
|
||||||
import com.abbidot.tracker.util.GoogleLocationManager
|
|
||||||
import com.abbidot.tracker.util.Util
|
import com.abbidot.tracker.util.Util
|
||||||
import com.abbidot.tracker.util.ViewUtil
|
import com.abbidot.tracker.util.ViewUtil
|
||||||
import com.abbidot.tracker.util.bluetooth.SRBleUtil
|
import com.abbidot.tracker.util.bluetooth.SRBleUtil
|
||||||
@@ -62,7 +60,6 @@ import com.abbidot.tracker.vm.FamilyViewModel
|
|||||||
import com.abbidot.tracker.vm.LogBleReportViewModel
|
import com.abbidot.tracker.vm.LogBleReportViewModel
|
||||||
import com.clj.fastble.BleManager
|
import com.clj.fastble.BleManager
|
||||||
import com.google.android.material.navigation.NavigationBarView
|
import com.google.android.material.navigation.NavigationBarView
|
||||||
import com.qmuiteam.qmui.widget.QMUITopBar
|
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@@ -127,7 +124,7 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
|||||||
// BleReportManage(mSocketSendMessageViewModel, mSocketUtilManage!!)
|
// BleReportManage(mSocketSendMessageViewModel, mSocketUtilManage!!)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
override fun getTopBar(): QMUITopBar? = null
|
override fun getTopBar() = null
|
||||||
|
|
||||||
override fun initData() {
|
override fun initData() {
|
||||||
isEdgeToEdgeAdapterNavigationBars = false
|
isEdgeToEdgeAdapterNavigationBars = false
|
||||||
@@ -802,32 +799,6 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始定位
|
|
||||||
*/
|
|
||||||
private fun startUpLocation() {
|
|
||||||
LogUtil.e("开始定位")
|
|
||||||
if (AppUtils.isChina()) {
|
|
||||||
//30秒定位一次,定位精度为高精度
|
|
||||||
BaiduLocationManager.startLocation(30)
|
|
||||||
} else {
|
|
||||||
GoogleLocationManager.startLocation()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 停止定位
|
|
||||||
*/
|
|
||||||
private fun stopUpLocation() {
|
|
||||||
LogUtil.e("停止定位")
|
|
||||||
if (AppUtils.isChina()) {
|
|
||||||
BaiduLocationManager.stopLocation()
|
|
||||||
} else {
|
|
||||||
GoogleLocationManager.stopLocation()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// override fun onTrimMemory(level: Int) {
|
// override fun onTrimMemory(level: Int) {
|
||||||
// super.onTrimMemory(level)
|
// super.onTrimMemory(level)
|
||||||
// LogUtil.e("系统级别:$level"+printLevel(level))
|
// LogUtil.e("系统级别:$level"+printLevel(level))
|
||||||
@@ -868,7 +839,6 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
|
|||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
LogUtil.e("HomeV2Activity---------------onDestroy")
|
LogUtil.e("HomeV2Activity---------------onDestroy")
|
||||||
stopUpLocation()
|
|
||||||
stopCountDownConBle()
|
stopCountDownConBle()
|
||||||
mBleListenerReceiver?.let {
|
mBleListenerReceiver?.let {
|
||||||
unregisterReceiver(it)
|
unregisterReceiver(it)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import androidx.activity.viewModels
|
|||||||
import com.abbidot.baselibrary.constant.EventName
|
import com.abbidot.baselibrary.constant.EventName
|
||||||
import com.abbidot.baselibrary.eventbus.XEventBus
|
import com.abbidot.baselibrary.eventbus.XEventBus
|
||||||
import com.abbidot.baselibrary.util.AppUtils
|
import com.abbidot.baselibrary.util.AppUtils
|
||||||
|
import com.abbidot.baselibrary.util.LogUtil
|
||||||
import com.abbidot.tracker.R
|
import com.abbidot.tracker.R
|
||||||
import com.abbidot.tracker.base.BaseActivity
|
import com.abbidot.tracker.base.BaseActivity
|
||||||
import com.abbidot.tracker.bean.FamilyBean
|
import com.abbidot.tracker.bean.FamilyBean
|
||||||
@@ -39,10 +40,13 @@ class AddNewTracker1Activity :
|
|||||||
mViewBinding.apply {
|
mViewBinding.apply {
|
||||||
// ivChargePowerOnGif.load(R.drawable.charge_power_on)
|
// ivChargePowerOnGif.load(R.drawable.charge_power_on)
|
||||||
|
|
||||||
if (!isFirstBind) {
|
if (isFirstBind) {
|
||||||
|
LogUtil.e("首次添加开始定位,添加wifi需要用到")
|
||||||
|
startUpLocation()
|
||||||
|
} else {
|
||||||
tvChargePowerOnBackLoginBtn.visibility = View.GONE
|
tvChargePowerOnBackLoginBtn.visibility = View.GONE
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setOnClickListenerViews(btnChargePowerOnNext, tvChargePowerOnBackLoginBtn)
|
setOnClickListenerViews(btnChargePowerOnNext, tvChargePowerOnBackLoginBtn)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,14 @@ package com.abbidot.tracker.ui.activity.map
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.PorterDuff
|
import android.graphics.PorterDuff
|
||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
|
import android.text.TextUtils
|
||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.RelativeLayout
|
import android.widget.RelativeLayout
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.graphics.drawable.DrawableCompat
|
import androidx.core.graphics.drawable.DrawableCompat
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
import androidx.core.view.isGone
|
import androidx.core.view.isGone
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
@@ -152,6 +154,7 @@ class LiveActivityV3 : BaseActivity<ActivityLiveV3Binding>(ActivityLiveV3Binding
|
|||||||
isShowAllPet = MMKVUtil.getBoolean(MMKVKey.ShowAllPet)
|
isShowAllPet = MMKVUtil.getBoolean(MMKVKey.ShowAllPet)
|
||||||
|
|
||||||
mViewBinding.apply {
|
mViewBinding.apply {
|
||||||
|
edgeToEdgeAdapterBars(root, WindowInsetsCompat.Type.statusBars())
|
||||||
ViewUtil.instance.viewRotationAnimator(
|
ViewUtil.instance.viewRotationAnimator(
|
||||||
ilLiveV2OperateLayout.ilLiveV2DataLightSwitch.ilDeviceLightBtnState.ivLedBtnState,
|
ilLiveV2OperateLayout.ilLiveV2DataLightSwitch.ilDeviceLightBtnState.ivLedBtnState,
|
||||||
true
|
true
|
||||||
@@ -302,6 +305,12 @@ class LiveActivityV3 : BaseActivity<ActivityLiveV3Binding>(ActivityLiveV3Binding
|
|||||||
3 -> mViewBinding.llLiveV2StateLayout.visibility = View.GONE
|
3 -> mViewBinding.llLiveV2StateLayout.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//接收地图刷新位置通知
|
||||||
|
XEventBus.observe(this, EventName.LocationData) { any: Any ->
|
||||||
|
if (isShowDashed) {
|
||||||
|
mHomeMapCommon.addUserAndPetLine()
|
||||||
|
}
|
||||||
|
}
|
||||||
//获取当前宠物位置和围栏信息
|
//获取当前宠物位置和围栏信息
|
||||||
mMapViewModel.mMapDeviceLiveData.observe(this) {
|
mMapViewModel.mMapDeviceLiveData.observe(this) {
|
||||||
dealRequestResult(it, object : GetResultCallback {
|
dealRequestResult(it, object : GetResultCallback {
|
||||||
@@ -1121,7 +1130,10 @@ class LiveActivityV3 : BaseActivity<ActivityLiveV3Binding>(ActivityLiveV3Binding
|
|||||||
YoYo.with(Techniques.BounceInUp).duration(800).delay(400).onEnd {
|
YoYo.with(Techniques.BounceInUp).duration(800).delay(400).onEnd {
|
||||||
//蓝牙图标按钮显示动画
|
//蓝牙图标按钮显示动画
|
||||||
ViewUtil.instance.viewShowFadeInAnimation(ivMapLiveV2BluetoothBtn)
|
ViewUtil.instance.viewShowFadeInAnimation(ivMapLiveV2BluetoothBtn)
|
||||||
ViewUtil.instance.viewShowFadeInAnimation(ilLiveV3MapPetLocation.root)
|
ilLiveV3MapPetLocation.let {
|
||||||
|
if (!TextUtils.isEmpty(it.tvPetLocationReverseGeocode.text))
|
||||||
|
ViewUtil.instance.viewShowFadeInAnimation(it.root)
|
||||||
|
}
|
||||||
//刷新定位按钮显示动画
|
//刷新定位按钮显示动画
|
||||||
ViewUtil.instance.viewShowFadeInAnimation(ivMapLiveV2RefreshBtn)
|
ViewUtil.instance.viewShowFadeInAnimation(ivMapLiveV2RefreshBtn)
|
||||||
}.playOn(ilLiveV2OperateLayout.root)
|
}.playOn(ilLiveV2OperateLayout.root)
|
||||||
@@ -1152,7 +1164,10 @@ class LiveActivityV3 : BaseActivity<ActivityLiveV3Binding>(ActivityLiveV3Binding
|
|||||||
YoYo.with(Techniques.SlideOutDown).duration(600).onEnd {
|
YoYo.with(Techniques.SlideOutDown).duration(600).onEnd {
|
||||||
ilMapLiveV2IssueLayout.root.visibility = View.GONE
|
ilMapLiveV2IssueLayout.root.visibility = View.GONE
|
||||||
YoYo.with(Techniques.BounceInUp).duration(600).onStart {
|
YoYo.with(Techniques.BounceInUp).duration(600).onStart {
|
||||||
ilLiveV3MapPetLocation.root.visibility = View.VISIBLE
|
ilLiveV3MapPetLocation.let {
|
||||||
|
if (!TextUtils.isEmpty(it.tvPetLocationReverseGeocode.text))
|
||||||
|
it.root.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
ilLiveV2OperateLayout.root.visibility = View.VISIBLE
|
ilLiveV2OperateLayout.root.visibility = View.VISIBLE
|
||||||
}.playOn(ilLiveV2OperateLayout.root)
|
}.playOn(ilLiveV2OperateLayout.root)
|
||||||
}.playOn(ilMapLiveV2IssueLayout.root)
|
}.playOn(ilMapLiveV2IssueLayout.root)
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ class ChoosePlanActivity :
|
|||||||
// else if (l.mealUnit != ConstantString.PackageUnitYear) iterator.remove()
|
// else if (l.mealUnit != ConstantString.PackageUnitYear) iterator.remove()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (list.size > 0) {
|
if (list.isNotEmpty()) {
|
||||||
list[0].selected = true
|
list[0].selected = true
|
||||||
mChoosePlanAdapter.setData(list, true)
|
mChoosePlanAdapter.setData(list, true)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class PaymentMethodActivity :
|
|||||||
|
|
||||||
//设备充值类型,0=首次设备充值激活,1=已添加设备再次添加设备充值,2=给当前的设备续费或者升级套餐
|
//设备充值类型,0=首次设备充值激活,1=已添加设备再次添加设备充值,2=给当前的设备续费或者升级套餐
|
||||||
var mRechargeType = ConstantInt.Type1
|
var mRechargeType = ConstantInt.Type1
|
||||||
var mFragments = mutableListOf<Fragment>()
|
val mPayFragments = mutableListOf<Fragment>()
|
||||||
|
|
||||||
//设备类型
|
//设备类型
|
||||||
var mType = ConstantInt.Type1
|
var mType = ConstantInt.Type1
|
||||||
@@ -52,8 +52,8 @@ class PaymentMethodActivity :
|
|||||||
mRechargeType = getInt(ConstantString.RechargeType, ConstantInt.Type1)
|
mRechargeType = getInt(ConstantString.RechargeType, ConstantInt.Type1)
|
||||||
}
|
}
|
||||||
|
|
||||||
mFragments.add(CreditCardPaymentFragment.newInstance(mContext))
|
mPayFragments.add(CreditCardPaymentFragment.newInstance(mContext))
|
||||||
mFragments.add(PaypalPaymentFragment.newInstance(mContext))
|
mPayFragments.add(PaypalPaymentFragment.newInstance(mContext))
|
||||||
|
|
||||||
mViewBinding.apply {
|
mViewBinding.apply {
|
||||||
rgSwitchPaymentMethod.setOnCheckedChangeListener { _, checkedId ->
|
rgSwitchPaymentMethod.setOnCheckedChangeListener { _, checkedId ->
|
||||||
@@ -64,7 +64,7 @@ class PaymentMethodActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
vp2SwitchPaymentMethod.let {
|
vp2SwitchPaymentMethod.let {
|
||||||
it.adapter = ViewPagerAdapter(mFragments, this@PaymentMethodActivity)
|
it.adapter = ViewPagerAdapter(mPayFragments, this@PaymentMethodActivity)
|
||||||
ViewUtil.instance.setViewPager2Config(
|
ViewUtil.instance.setViewPager2Config(
|
||||||
it, object : ViewPager2.OnPageChangeCallback() {
|
it, object : ViewPager2.OnPageChangeCallback() {
|
||||||
override fun onPageSelected(position: Int) {
|
override fun onPageSelected(position: Int) {
|
||||||
@@ -95,9 +95,9 @@ class PaymentMethodActivity :
|
|||||||
override fun onResult(any: Any) {
|
override fun onResult(any: Any) {
|
||||||
it.getOrNull()?.let { p ->
|
it.getOrNull()?.let { p ->
|
||||||
mPaymentIDBean = p
|
mPaymentIDBean = p
|
||||||
(mFragments[0] as CreditCardPaymentFragment).getCardData(p.stripeMethodInfo)
|
(mPayFragments[0] as CreditCardPaymentFragment).getCardData(p.stripeMethodInfo)
|
||||||
if (mFragments.size > 1) {
|
if (mPayFragments.size > 1) {
|
||||||
(mFragments[1] as PaypalPaymentFragment).showPaypalInfo()
|
(mPayFragments[1] as PaypalPaymentFragment).showPaypalInfo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,14 +136,12 @@ class PaymentSuccessActivity :
|
|||||||
//接收蓝牙返回数据
|
//接收蓝牙返回数据
|
||||||
XEventBus.observe(this, EventName.DeviceReceiveData) { receiveData: ReceiveDeviceData ->
|
XEventBus.observe(this, EventName.DeviceReceiveData) { receiveData: ReceiveDeviceData ->
|
||||||
if (TextUtils.isEmpty(mMac)) return@observe
|
if (TextUtils.isEmpty(mMac)) return@observe
|
||||||
mPayResult?.apply {
|
|
||||||
if (mMac == receiveData.mac) {
|
if (mMac == receiveData.mac) {
|
||||||
val data = receiveData.data
|
val data = receiveData.data
|
||||||
// setButtonEnabled(mViewBinding.btnPaymentSuccessContinue, ConstantInt.Type1)
|
// setButtonEnabled(mViewBinding.btnPaymentSuccessContinue, ConstantInt.Type1)
|
||||||
parseData(data)
|
parseData(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
mAddTrackerViewModel.mUpdatePayDeviceStateLiveData.observe(this) {
|
mAddTrackerViewModel.mUpdatePayDeviceStateLiveData.observe(this) {
|
||||||
|
|||||||
@@ -6,30 +6,40 @@ import android.view.Gravity
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.RadioGroup
|
import android.widget.RadioGroup
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.abbidot.baselibrary.constant.EventName
|
import com.abbidot.baselibrary.constant.EventName
|
||||||
import com.abbidot.baselibrary.constant.MMKVKey
|
import com.abbidot.baselibrary.constant.MMKVKey
|
||||||
import com.abbidot.baselibrary.eventbus.XEventBus
|
import com.abbidot.baselibrary.eventbus.XEventBus
|
||||||
import com.abbidot.baselibrary.util.AppUtils
|
import com.abbidot.baselibrary.util.AppUtils
|
||||||
|
import com.abbidot.baselibrary.util.LogUtil
|
||||||
import com.abbidot.baselibrary.util.MMKVUtil
|
import com.abbidot.baselibrary.util.MMKVUtil
|
||||||
import com.abbidot.baselibrary.util.Utils
|
import com.abbidot.baselibrary.util.Utils
|
||||||
import com.abbidot.tracker.R
|
import com.abbidot.tracker.R
|
||||||
import com.abbidot.tracker.adapter.SureSubscribeSummaryAdapter
|
import com.abbidot.tracker.adapter.SureSubscribeSummaryAdapter
|
||||||
|
import com.abbidot.tracker.alipay.PayResult
|
||||||
import com.abbidot.tracker.base.BaseActivity
|
import com.abbidot.tracker.base.BaseActivity
|
||||||
import com.abbidot.tracker.bean.MenuTxtBean
|
import com.abbidot.tracker.bean.MenuTxtBean
|
||||||
import com.abbidot.tracker.bean.PackageBean
|
import com.abbidot.tracker.bean.PackageBean
|
||||||
|
import com.abbidot.tracker.bean.PayResultBean
|
||||||
import com.abbidot.tracker.bean.SubscriptionsOrderBean
|
import com.abbidot.tracker.bean.SubscriptionsOrderBean
|
||||||
import com.abbidot.tracker.constant.ConstantInt
|
import com.abbidot.tracker.constant.ConstantInt
|
||||||
import com.abbidot.tracker.constant.ConstantString
|
import com.abbidot.tracker.constant.ConstantString
|
||||||
import com.abbidot.tracker.constant.GetResultCallback
|
import com.abbidot.tracker.constant.GetResultCallback
|
||||||
import com.abbidot.tracker.databinding.ActivitySureSubscriptionPlanBinding
|
import com.abbidot.tracker.databinding.ActivitySureSubscriptionPlanBinding
|
||||||
import com.abbidot.tracker.ui.activity.WebViewActivity
|
import com.abbidot.tracker.ui.activity.WebViewActivity
|
||||||
|
import com.abbidot.tracker.util.ThirdPartyUtil
|
||||||
import com.abbidot.tracker.util.Util
|
import com.abbidot.tracker.util.Util
|
||||||
import com.abbidot.tracker.util.ViewUtil
|
import com.abbidot.tracker.util.ViewUtil
|
||||||
import com.abbidot.tracker.vm.GeoCoderViewModel
|
import com.abbidot.tracker.vm.GeoCoderViewModel
|
||||||
import com.abbidot.tracker.vm.GoogleLocationViewModel
|
import com.abbidot.tracker.vm.GoogleLocationViewModel
|
||||||
import com.abbidot.tracker.vm.SubscriptionManageViewModel
|
import com.abbidot.tracker.vm.SubscriptionManageViewModel
|
||||||
|
import com.abbidot.tracker.vm.cn.PayCNViewModel
|
||||||
import com.abbidot.tracker.widget.TypefaceRoundButton
|
import com.abbidot.tracker.widget.TypefaceRoundButton
|
||||||
|
import com.alipay.sdk.app.PayTask
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||||
|
import com.tencent.mm.opensdk.modelpay.PayReq
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
|
|
||||||
class SureSubscriptionPlanActivity :
|
class SureSubscriptionPlanActivity :
|
||||||
@@ -39,6 +49,8 @@ class SureSubscriptionPlanActivity :
|
|||||||
private val mGoogleLocationViewModel: GoogleLocationViewModel by viewModels()
|
private val mGoogleLocationViewModel: GoogleLocationViewModel by viewModels()
|
||||||
private val mGeoCoderViewModel: GeoCoderViewModel by viewModels()
|
private val mGeoCoderViewModel: GeoCoderViewModel by viewModels()
|
||||||
|
|
||||||
|
private val mPayCNViewModel: PayCNViewModel by viewModels()
|
||||||
|
|
||||||
private var mPackageBean: PackageBean? = null
|
private var mPackageBean: PackageBean? = null
|
||||||
private var mOrderBean: SubscriptionsOrderBean? = null
|
private var mOrderBean: SubscriptionsOrderBean? = null
|
||||||
|
|
||||||
@@ -74,6 +86,7 @@ class SureSubscriptionPlanActivity :
|
|||||||
|
|
||||||
//国内支付方式
|
//国内支付方式
|
||||||
private var mPayCnOption = ConstantInt.Type0
|
private var mPayCnOption = ConstantInt.Type0
|
||||||
|
private var mPayResultBean: PayResultBean? = null
|
||||||
|
|
||||||
override fun getTopBar() = mViewBinding.sureSubscribePlan1TopBar.titleTopBar
|
override fun getTopBar() = mViewBinding.sureSubscribePlan1TopBar.titleTopBar
|
||||||
|
|
||||||
@@ -150,7 +163,8 @@ class SureSubscriptionPlanActivity :
|
|||||||
setOnClickListenerViews(
|
setOnClickListenerViews(
|
||||||
btnSureSubscribePlan1Continue,
|
btnSureSubscribePlan1Continue,
|
||||||
ilSubscribePlanDetail.tvSureSubscribePlanTermsConditions,
|
ilSubscribePlanDetail.tvSureSubscribePlanTermsConditions,
|
||||||
ilSubscribePlanInsurance.ivSureSubscribePlanInsurance
|
ilSubscribePlanInsurance.ivSureSubscribePlanInsurance,
|
||||||
|
svSubscribePlanLayout
|
||||||
)
|
)
|
||||||
|
|
||||||
if (AppUtils.isChina(AppUtils.SWITCH_MAP_TYPE)) {
|
if (AppUtils.isChina(AppUtils.SWITCH_MAP_TYPE)) {
|
||||||
@@ -158,7 +172,10 @@ class SureSubscriptionPlanActivity :
|
|||||||
} else {
|
} else {
|
||||||
showNoCancelableLoading(true)
|
showNoCancelableLoading(true)
|
||||||
setButtonEnabled(btnSureSubscribePlan1Continue, ConstantInt.Type0)
|
setButtonEnabled(btnSureSubscribePlan1Continue, ConstantInt.Type0)
|
||||||
mGoogleLocationViewModel.getLastLocation(mContext)
|
// mGoogleLocationViewModel.getLastLocation(mContext)
|
||||||
|
mSubscriptionViewModel.getTaxRateByRegionName(
|
||||||
|
mGeoCoderViewModel.mCountryCode, mGeoCoderViewModel.mRegion
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -329,15 +346,6 @@ class SureSubscriptionPlanActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun liveDataObserve() {
|
override fun liveDataObserve() {
|
||||||
XEventBus.observe(this, EventName.PayBack) {
|
|
||||||
if (isUpgrade) {
|
|
||||||
//升级套餐成功
|
|
||||||
MMKVUtil.putInt(MMKVKey.MealType, ConstantInt.PremiumPackage)
|
|
||||||
}
|
|
||||||
//通知首页刷新宠物信息,防止没有加载,显示Fragment使用老的套餐数据,升级套餐和套餐过期充值使用
|
|
||||||
XEventBus.post(EventName.RefreshPackage)
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
mSubscriptionViewModel.apply {
|
mSubscriptionViewModel.apply {
|
||||||
mReactivationFeeLiveData.observe(this@SureSubscriptionPlanActivity) {
|
mReactivationFeeLiveData.observe(this@SureSubscriptionPlanActivity) {
|
||||||
dealRequestResult(it, object : GetResultCallback {
|
dealRequestResult(it, object : GetResultCallback {
|
||||||
@@ -413,16 +421,98 @@ class SureSubscriptionPlanActivity :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mGoogleLocationViewModel.mGoogleLocationLiveData.observe(this) {
|
mGoogleLocationViewModel.mGoogleLocationLiveData.observe(this) {
|
||||||
// mGeoCoderViewModel.getLatLonAddress(it.latitude, it.longitude)
|
mGeoCoderViewModel.getLatLonAddress(it.latitude, it.longitude)
|
||||||
mSubscriptionViewModel.getTaxRateByRegionName(
|
|
||||||
mGeoCoderViewModel.mCountryCode, mGeoCoderViewModel.mRegion
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
mGeoCoderViewModel.mLatLonAddressLiveData.observe(this) {
|
mGeoCoderViewModel.mLatLonAddressLiveData.observe(this) {
|
||||||
mSubscriptionViewModel.getTaxRateByRegionName(
|
mSubscriptionViewModel.getTaxRateByRegionName(
|
||||||
mGeoCoderViewModel.mCountryCode, mGeoCoderViewModel.mRegion
|
mGeoCoderViewModel.mCountryCode, mGeoCoderViewModel.mRegion
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AppUtils.isChina()) {
|
||||||
|
//微信支付宝支付成功返回
|
||||||
|
XEventBus.observe(this, EventName.PaySuccessCn) {
|
||||||
|
mPayResultBean?.apply {
|
||||||
|
//通知首页刷新宠物信息,防止没有加载,显示Fragment使用老的套餐数据,升级套餐和套餐过期充值使用
|
||||||
|
XEventBus.post(EventName.RefreshPackage)
|
||||||
|
Intent(mContext, PaymentSuccessActivity::class.java).let { i ->
|
||||||
|
rechargeType = mRechargeType
|
||||||
|
mOrderBean?.let { o ->
|
||||||
|
deviceId = o.deviceId
|
||||||
|
}
|
||||||
|
deviceType = mType
|
||||||
|
i.putExtra(ConstantString.Amount, this)
|
||||||
|
startActivityFinish(i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mPayCNViewModel.apply {
|
||||||
|
mGetWxPayOrderLiveData.observe(this@SureSubscriptionPlanActivity) {
|
||||||
|
dealRequestResult(it, object : GetResultCallback {
|
||||||
|
override fun onResult(any: Any) {
|
||||||
|
showNoCancelableLoading(false)
|
||||||
|
val data = it.getOrNull()
|
||||||
|
data?.let { d ->
|
||||||
|
mPayResultBean = d.payData
|
||||||
|
val request = PayReq()
|
||||||
|
request.appId = d.appid
|
||||||
|
request.partnerId = d.partnerid
|
||||||
|
request.prepayId = d.prepayid
|
||||||
|
request.packageValue = d.packageStr
|
||||||
|
request.nonceStr = d.noncestr
|
||||||
|
request.timeStamp = d.timestamp
|
||||||
|
request.sign = d.sign
|
||||||
|
ThirdPartyUtil.mApi.sendReq(request)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onRequestError(exceptionCode: String?) {
|
||||||
|
showNoCancelableLoading(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
mGetAlipayOrderLiveData.observe(this@SureSubscriptionPlanActivity) {
|
||||||
|
dealRequestResult(it, object : GetResultCallback {
|
||||||
|
override fun onResult(any: Any) {
|
||||||
|
showNoCancelableLoading(false)
|
||||||
|
val data = it.getOrNull()
|
||||||
|
data?.let { d ->
|
||||||
|
mPayResultBean = d.payData
|
||||||
|
//支付宝支付必须异步调用
|
||||||
|
lifecycleScope.launch(Dispatchers.IO) {
|
||||||
|
val alipay = PayTask(mActivity)
|
||||||
|
//订单信息
|
||||||
|
val result = alipay.payV2(d.orderString, true)
|
||||||
|
val payResult = PayResult(result as Map<String, String>)
|
||||||
|
//同步返回需要验证的信息
|
||||||
|
LogUtil.e("支付宝支付结果回调:$payResult")
|
||||||
|
mPayCNViewModel.alipayResultCallback(
|
||||||
|
this@SureSubscriptionPlanActivity,
|
||||||
|
payResult.resultStatus,
|
||||||
|
mOrderBean?.totalAmountWithTax ?: mTotalWithTaxMoney
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onRequestError(exceptionCode: String?) {
|
||||||
|
showNoCancelableLoading(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
XEventBus.observe(this, EventName.PayBack) {
|
||||||
|
if (isUpgrade) {
|
||||||
|
//升级套餐成功
|
||||||
|
MMKVUtil.putInt(MMKVKey.MealType, ConstantInt.PremiumPackage)
|
||||||
|
}
|
||||||
|
//通知首页刷新宠物信息,防止没有加载,显示Fragment使用老的套餐数据,升级套餐和套餐过期充值使用
|
||||||
|
XEventBus.post(EventName.RefreshPackage)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateMoney() {
|
private fun updateMoney() {
|
||||||
@@ -479,7 +569,28 @@ class SureSubscriptionPlanActivity :
|
|||||||
mealDesc =
|
mealDesc =
|
||||||
mViewBinding.ilSubscribePlanDetail.tvSureSubscribePlanMoney.text.toString() + mViewBinding.ilSubscribePlanDetail.tvSureSubscribePlanPer.text.toString()
|
mViewBinding.ilSubscribePlanDetail.tvSureSubscribePlanMoney.text.toString() + mViewBinding.ilSubscribePlanDetail.tvSureSubscribePlanPer.text.toString()
|
||||||
}
|
}
|
||||||
totalAmountWithTax = Utils.formatDecimal(mTotalWithTaxMoney, 2).toDouble()
|
// totalAmountWithTax = Utils.formatDecimal(mTotalWithTaxMoney, 2).toDouble()
|
||||||
|
totalAmountWithTax = 0.01
|
||||||
|
|
||||||
|
if (AppUtils.isChina()) {
|
||||||
|
if (null == mRechargePayOptionsCn) {
|
||||||
|
mRechargePayOptionsCn = ViewUtil.instance.showBottomSheet(
|
||||||
|
mContext, R.layout.layout_recharge_pay_options_cn
|
||||||
|
).apply {
|
||||||
|
setCancelable(true)
|
||||||
|
setOnClickListenerViews(findViewById<TypefaceRoundButton>(R.id.btn_pay_cn_chose_sure))
|
||||||
|
findViewById<RadioGroup>(R.id.rg_pay_cn_chose)?.let {
|
||||||
|
it.setOnCheckedChangeListener { _, checkedId ->
|
||||||
|
when (checkedId) {
|
||||||
|
R.id.rb_pay_cn_chose_alipay -> mPayCnOption = ConstantInt.Type0
|
||||||
|
|
||||||
|
R.id.rb_pay_cn_chose_wxpay -> mPayCnOption = ConstantInt.Type1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else mRechargePayOptionsCn?.show()
|
||||||
|
} else {
|
||||||
Intent(mContext, PaymentMethodActivity::class.java).let {
|
Intent(mContext, PaymentMethodActivity::class.java).let {
|
||||||
it.putExtra(ConstantString.LkSetMeal, this)
|
it.putExtra(ConstantString.LkSetMeal, this)
|
||||||
it.putExtra(ConstantString.Type, mType)
|
it.putExtra(ConstantString.Type, mType)
|
||||||
@@ -488,38 +599,26 @@ class SureSubscriptionPlanActivity :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 去支付
|
||||||
|
*/
|
||||||
|
private fun goPayCn() {
|
||||||
|
mOrderBean?.apply {
|
||||||
|
showNoCancelableLoading(true)
|
||||||
|
when (mPayCnOption) {
|
||||||
|
0 -> mPayCNViewModel.getAlipayOrder(this)
|
||||||
|
1 -> mPayCNViewModel.getWxPayOrder(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onClick(v: View?) {
|
override fun onClick(v: View?) {
|
||||||
mViewBinding.apply {
|
mViewBinding.apply {
|
||||||
when (v!!) {
|
when (v!!) {
|
||||||
btnSureSubscribePlan1Continue -> {
|
btnSureSubscribePlan1Continue -> createOrder()
|
||||||
if (AppUtils.isChina()) {
|
ilSubscribePlanDetail.tvSureSubscribePlanTermsConditions -> ViewUtil.instance.goHtmlAssetContent(
|
||||||
if (null == mRechargePayOptionsCn) {
|
|
||||||
mRechargePayOptionsCn = ViewUtil.instance.showBottomSheet(
|
|
||||||
mContext,
|
|
||||||
R.layout.layout_recharge_pay_options_cn
|
|
||||||
).apply {
|
|
||||||
setOnClickListenerViews(findViewById<TypefaceRoundButton>(R.id.btn_pay_cn_chose_sure))
|
|
||||||
findViewById<RadioGroup>(R.id.rg_pay_cn_chose)?.let {
|
|
||||||
it.setOnCheckedChangeListener { _, checkedId ->
|
|
||||||
when (checkedId) {
|
|
||||||
R.id.rb_pay_cn_chose_alipay -> mPayCnOption =
|
|
||||||
ConstantInt.Type0
|
|
||||||
|
|
||||||
R.id.rb_pay_cn_chose_wxpay -> mPayCnOption =
|
|
||||||
ConstantInt.Type1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
createOrder()
|
|
||||||
}
|
|
||||||
|
|
||||||
ilSubscribePlanDetail.tvSureSubscribePlanTermsConditions ->
|
|
||||||
ViewUtil.instance.goHtmlAssetContent(
|
|
||||||
mActivity,
|
mActivity,
|
||||||
getString(R.string.txt_service_contract),
|
getString(R.string.txt_service_contract),
|
||||||
getString(R.string.txt_subscription_terms_conditions_html)
|
getString(R.string.txt_subscription_terms_conditions_html)
|
||||||
@@ -539,9 +638,12 @@ class SureSubscriptionPlanActivity :
|
|||||||
}
|
}
|
||||||
|
|
||||||
when (v!!.id) {
|
when (v!!.id) {
|
||||||
R.id.btn_pay_cn_chose_sure -> {
|
R.id.btn_pay_cn_chose_sure -> goPayCn()
|
||||||
showToast("$mPayCnOption")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
mRechargePayOptionsCn?.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,6 +89,10 @@ class AccountCnPhoneFragment :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onInterceptCode() {
|
||||||
|
setButtonEnabled(mViewBinding.btnAccountCnPhoneContinue, ConstantInt.Type1)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,11 +265,17 @@ class MapV3Fragment : BaseFragment<FragmentMapV3Binding>(FragmentMapV3Binding::i
|
|||||||
LogUtil.e("MapV2Fragment 地图加载好了${getHomeV2Activity()?.mPetList}")
|
LogUtil.e("MapV2Fragment 地图加载好了${getHomeV2Activity()?.mPetList}")
|
||||||
// mHomeV2Activity.mDataViewModel.getHomeBindPetList(mHomeV2Activity)
|
// mHomeV2Activity.mDataViewModel.getHomeBindPetList(mHomeV2Activity)
|
||||||
getHomeV2Activity()?.apply {
|
getHomeV2Activity()?.apply {
|
||||||
if (mPetList.size > 0) showPetNameAndHead(mSelectPetPosition)
|
if (mPetList.isNotEmpty()) showPetNameAndHead(mSelectPetPosition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun liveDataObserve() {
|
override fun liveDataObserve() {
|
||||||
|
//接收地图刷新位置通知
|
||||||
|
XEventBus.observe(viewLifecycleOwner, EventName.LocationData) { any: Any ->
|
||||||
|
if (isShowDashed) {
|
||||||
|
mHomeMapCommon.addUserAndPetLine()
|
||||||
|
}
|
||||||
|
}
|
||||||
//获取当前宠物位置和围栏信息
|
//获取当前宠物位置和围栏信息
|
||||||
mMapViewModel.apply {
|
mMapViewModel.apply {
|
||||||
mMapDeviceLiveData.observe(this@MapV3Fragment) {
|
mMapDeviceLiveData.observe(this@MapV3Fragment) {
|
||||||
@@ -1077,7 +1083,8 @@ class MapV3Fragment : BaseFragment<FragmentMapV3Binding>(FragmentMapV3Binding::i
|
|||||||
showToast(R.string.txt_pet_close, gravity = Gravity.CENTER)
|
showToast(R.string.txt_pet_close, gravity = Gravity.CENTER)
|
||||||
} else {
|
} else {
|
||||||
SRBleUtil.instance.isConnectBleSendCmdData(
|
SRBleUtil.instance.isConnectBleSendCmdData(
|
||||||
pet.macID, SRBleCmdUtil.instance.refreshLocation(0x2C, userGpsLat, userGpsLon)
|
pet.macID,
|
||||||
|
SRBleCmdUtil.instance.refreshLocation(0x2C, userGpsLat, userGpsLon)
|
||||||
)
|
)
|
||||||
refreshLocationAnim()
|
refreshLocationAnim()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,8 +215,8 @@ abstract class BaseBaiduMapFragment :
|
|||||||
.build()
|
.build()
|
||||||
setMyLocationData(locData)
|
setMyLocationData(locData)
|
||||||
val bdLocation = BDLocation()
|
val bdLocation = BDLocation()
|
||||||
bdLocation.latitude = userGpsLat
|
bdLocation.latitude =it.latitude
|
||||||
bdLocation.longitude = userGpsLon
|
bdLocation.longitude = it.longitude
|
||||||
locationSuccess(bdLocation)
|
locationSuccess(bdLocation)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -293,6 +293,9 @@ class HomeMapBaiduMapFragment : BaseBaiduMapFragment() {
|
|||||||
*/
|
*/
|
||||||
fun addUserAndPetLine() {
|
fun addUserAndPetLine() {
|
||||||
mBaiduMap?.apply {
|
mBaiduMap?.apply {
|
||||||
|
val userGpsLat = MMKVUtil.getDouble(MMKVKey.UserGpsLat)
|
||||||
|
val userGpsLon = MMKVUtil.getDouble(MMKVKey.UserGpsLon)
|
||||||
|
mUserLatLng = getBaiduMapLatLng(userGpsLat, userGpsLon)
|
||||||
mUserLatLng?.let { u ->
|
mUserLatLng?.let { u ->
|
||||||
mPetLatLng?.let { p ->
|
mPetLatLng?.let { p ->
|
||||||
mUserAndPetLine?.remove()
|
mUserAndPetLine?.remove()
|
||||||
|
|||||||
@@ -233,6 +233,9 @@ class HomeMapGoogleMapFragmentV3 : BaseGoogleMapFragment() {
|
|||||||
*/
|
*/
|
||||||
fun addUserAndPetLine() {
|
fun addUserAndPetLine() {
|
||||||
mGoogleMap?.apply {
|
mGoogleMap?.apply {
|
||||||
|
val userGpsLat = MMKVUtil.getDouble(MMKVKey.UserGpsLat)
|
||||||
|
val userGpsLon = MMKVUtil.getDouble(MMKVKey.UserGpsLon)
|
||||||
|
mUserLatLng = LatLng(userGpsLat, userGpsLon)
|
||||||
mUserLatLng?.let { u ->
|
mUserLatLng?.let { u ->
|
||||||
mPetLatLng?.let { p ->
|
mPetLatLng?.let { p ->
|
||||||
mUserAndPetLine?.remove()
|
mUserAndPetLine?.remove()
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ class CreditCardPaymentFragment : BaseFragment<FragmentCreditCardPaymentBinding>
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setCheckAndPrimaryState(list: MutableList<CreditCardBean>) {
|
private fun setCheckAndPrimaryState(list: MutableList<CreditCardBean>) {
|
||||||
if (list.size == 0) {
|
if (list.isEmpty()) {
|
||||||
mViewBinding.apply {
|
mViewBinding.apply {
|
||||||
tvCreditCardPaymentChoose.visibility = View.GONE
|
tvCreditCardPaymentChoose.visibility = View.GONE
|
||||||
btnCreditCardPaymentAdd.visibility = View.GONE
|
btnCreditCardPaymentAdd.visibility = View.GONE
|
||||||
|
|||||||
@@ -1,20 +1,16 @@
|
|||||||
package com.abbidot.tracker.deprecated.ui.activity.vm
|
package com.abbidot.tracker.vm.cn
|
||||||
|
|
||||||
import android.content.Intent
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.abbidot.baselibrary.constant.MMKVKey
|
import com.abbidot.baselibrary.constant.EventName
|
||||||
|
import com.abbidot.baselibrary.eventbus.XEventBus
|
||||||
import com.abbidot.baselibrary.util.LogUtil
|
import com.abbidot.baselibrary.util.LogUtil
|
||||||
import com.abbidot.baselibrary.util.MMKVUtil
|
|
||||||
import com.abbidot.tracker.R
|
import com.abbidot.tracker.R
|
||||||
import com.abbidot.tracker.base.BaseActivity
|
import com.abbidot.tracker.base.BaseActivity
|
||||||
import com.abbidot.tracker.bean.AlipayOrderBean
|
import com.abbidot.tracker.bean.AlipayOrderBean
|
||||||
import com.abbidot.tracker.bean.SetMealBean
|
import com.abbidot.tracker.bean.SubscriptionsOrderBean
|
||||||
import com.abbidot.tracker.bean.WXPayOrderBean
|
import com.abbidot.tracker.bean.WXPayOrderBean
|
||||||
import com.abbidot.tracker.constant.ConstantInt
|
|
||||||
import com.abbidot.tracker.constant.ConstantString
|
|
||||||
import com.abbidot.tracker.deprecated.ui.activity.profile.recharge.PaymentResultActivity
|
|
||||||
import com.abbidot.tracker.retrofit2.NetworkApi
|
import com.abbidot.tracker.retrofit2.NetworkApi
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@@ -31,12 +27,9 @@ class PayCNViewModel : ViewModel() {
|
|||||||
/**
|
/**
|
||||||
* 获取微信支付Prepay_id
|
* 获取微信支付Prepay_id
|
||||||
*/
|
*/
|
||||||
fun getWxPayOrder(activity: BaseActivity<*>, setMealBean: SetMealBean, deviceId: String) {
|
fun getWxPayOrder(subscriptionsOrder: SubscriptionsOrderBean) {
|
||||||
activity.showLoading(true)
|
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
val userId = MMKVUtil.getString(MMKVKey.UserId)
|
val result = NetworkApi.getWxPayOrder(subscriptionsOrder)
|
||||||
val userName = MMKVUtil.getString(MMKVKey.UserName)
|
|
||||||
val result = NetworkApi.getWxPayOrder(setMealBean, deviceId, userId, userName)
|
|
||||||
mGetWxPayOrderLiveData.value = result
|
mGetWxPayOrderLiveData.value = result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -44,12 +37,9 @@ class PayCNViewModel : ViewModel() {
|
|||||||
/**
|
/**
|
||||||
* 获取支付宝支付订单
|
* 获取支付宝支付订单
|
||||||
*/
|
*/
|
||||||
fun getAlipayOrder(activity: BaseActivity<*>, setMealBean: SetMealBean, deviceId: String) {
|
fun getAlipayOrder(subscriptionsOrder: SubscriptionsOrderBean) {
|
||||||
activity.showLoading(true)
|
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
val userId = MMKVUtil.getString(MMKVKey.UserId)
|
val result = NetworkApi.getAlipayOrder(subscriptionsOrder)
|
||||||
val userName = MMKVUtil.getString(MMKVKey.UserName)
|
|
||||||
val result = NetworkApi.getAlipayOrder(setMealBean, deviceId, userId, userName)
|
|
||||||
mGetAlipayOrderLiveData.value = result
|
mGetAlipayOrderLiveData.value = result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,11 +53,12 @@ class PayCNViewModel : ViewModel() {
|
|||||||
"9000" -> {
|
"9000" -> {
|
||||||
activity.showToast(R.string.txt_pay_success)
|
activity.showToast(R.string.txt_pay_success)
|
||||||
//支付成功
|
//支付成功
|
||||||
LogUtil.e("WXPayEntryActivity", "支付成功")
|
LogUtil.Companion.e("WXPayEntryActivity", "支付成功")
|
||||||
val intent = Intent(activity, PaymentResultActivity::class.java)
|
// val intent = Intent(activity, PaymentResultActivity::class.java)
|
||||||
intent.putExtra(ConstantString.Amount, price)
|
// intent.putExtra(ConstantString.Amount, price)
|
||||||
intent.putExtra(ConstantString.Type, ConstantInt.Type1)
|
// intent.putExtra(ConstantString.Type, ConstantInt.Type1)
|
||||||
activity.startActivity(intent)
|
// activity.startActivity(intent)
|
||||||
|
XEventBus.post(EventName.PaySuccessCn)
|
||||||
}
|
}
|
||||||
//"8000"代表支付结果因为支付渠道原因或者系统原因还在等待支付结果确认,最终交易是否成功以服务端异步通知为准
|
//"8000"代表支付结果因为支付渠道原因或者系统原因还在等待支付结果确认,最终交易是否成功以服务端异步通知为准
|
||||||
"8000" -> activity.showToast("支付结果确认中")
|
"8000" -> activity.showToast("支付结果确认中")
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
package com.abbidot.tracker.wxapi
|
package com.abbidot.tracker.wxapi
|
||||||
|
|
||||||
import android.content.Intent
|
import com.abbidot.baselibrary.constant.EventName
|
||||||
|
import com.abbidot.baselibrary.eventbus.XEventBus
|
||||||
import com.abbidot.baselibrary.util.LogUtil
|
import com.abbidot.baselibrary.util.LogUtil
|
||||||
import com.abbidot.tracker.R
|
import com.abbidot.tracker.R
|
||||||
import com.abbidot.tracker.constant.ConstantInt
|
|
||||||
import com.abbidot.tracker.constant.ConstantString
|
|
||||||
import com.abbidot.tracker.deprecated.ui.activity.profile.recharge.PaymentResultActivity
|
|
||||||
import com.hjq.toast.Toaster
|
import com.hjq.toast.Toaster
|
||||||
import com.tencent.mm.opensdk.modelbase.BaseResp
|
import com.tencent.mm.opensdk.modelbase.BaseResp
|
||||||
|
|
||||||
@@ -23,15 +21,18 @@ class WXPayEntryActivity : WXBaseActivity() {
|
|||||||
Toaster.show(R.string.txt_pay_success)
|
Toaster.show(R.string.txt_pay_success)
|
||||||
//支付成功
|
//支付成功
|
||||||
LogUtil.e("WXPayEntryActivity", "支付成功")
|
LogUtil.e("WXPayEntryActivity", "支付成功")
|
||||||
val intent = Intent(this, PaymentResultActivity::class.java)
|
// val intent = Intent(this, PaymentResultActivity::class.java)
|
||||||
intent.putExtra(ConstantString.Type, ConstantInt.Type1)
|
// intent.putExtra(ConstantString.Type, ConstantInt.Type1)
|
||||||
startActivity(intent)
|
// startActivity(intent)
|
||||||
|
XEventBus.post(EventName.PaySuccessCn)
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseResp.ErrCode.ERR_USER_CANCEL -> {
|
BaseResp.ErrCode.ERR_USER_CANCEL -> {
|
||||||
Toaster.show(R.string.txt_cancel_pay)
|
Toaster.show(R.string.txt_cancel_pay)
|
||||||
//取消支付
|
//取消支付
|
||||||
LogUtil.e("WXPayEntryActivity", "取消支付")
|
LogUtil.e("WXPayEntryActivity", "取消支付")
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
Toaster.show(R.string.txt_pay_fail)
|
Toaster.show(R.string.txt_pay_fail)
|
||||||
//支付失败
|
//支付失败
|
||||||
|
|||||||
BIN
app/src/main/res/drawable-xhdpi/icon_device_high_battery_bg.png
Normal file
|
After Width: | Height: | Size: 300 B |
BIN
app/src/main/res/drawable-xhdpi/icon_device_low_battery_bg.png
Normal file
|
After Width: | Height: | Size: 300 B |
|
After Width: | Height: | Size: 300 B |
BIN
app/src/main/res/drawable-xxhdpi/icon_device_high_battery_bg.png
Normal file
|
After Width: | Height: | Size: 438 B |
BIN
app/src/main/res/drawable-xxhdpi/icon_device_low_battery_bg.png
Normal file
|
After Width: | Height: | Size: 443 B |
|
After Width: | Height: | Size: 438 B |
|
After Width: | Height: | Size: 530 B |
BIN
app/src/main/res/drawable-xxxhdpi/icon_device_low_battery_bg.png
Normal file
|
After Width: | Height: | Size: 530 B |
|
After Width: | Height: | Size: 530 B |
@@ -1,18 +0,0 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24">
|
|
||||||
<path
|
|
||||||
android:strokeWidth="1"
|
|
||||||
android:pathData="M2,12C2,9.172 2,7.757 2.879,6.879C3.757,6 5.172,6 8,6H13C15.828,6 17.243,6 18.121,6.879C19,7.757 19,9.172 19,12C19,14.828 19,16.243 18.121,17.121C17.243,18 15.828,18 13,18H8C5.172,18 3.757,18 2.879,17.121C2,16.243 2,14.828 2,12Z"
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:strokeColor="#0F1719"
|
|
||||||
android:strokeLineCap="round"/>
|
|
||||||
<path
|
|
||||||
android:strokeWidth="1"
|
|
||||||
android:pathData="M19,9.5L20.027,9.671C20.708,9.785 21.049,9.842 21.308,10.007C21.562,10.169 21.761,10.404 21.88,10.682C22,10.964 22,11.309 22,12C22,12.691 22,13.036 21.88,13.318C21.761,13.596 21.562,13.831 21.308,13.993C21.049,14.158 20.708,14.215 20.027,14.329L19,14.5"
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:strokeColor="#0F1719"
|
|
||||||
android:strokeLineCap="round"/>
|
|
||||||
</vector>
|
|
||||||
@@ -7,6 +7,13 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context=".ui.activity.map.LiveActivityV3">
|
tools:context=".ui.activity.map.LiveActivityV3">
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/ll_live_v2_map_top_pet"
|
||||||
|
layout="@layout/layout_top_pet_data_small"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="@dimen/dp_8" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
@@ -28,19 +35,11 @@
|
|||||||
layout="@layout/layout_map_device_battery" />
|
layout="@layout/layout_map_device_battery" />
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<include
|
|
||||||
android:id="@+id/ll_live_v2_map_top_pet"
|
|
||||||
layout="@layout/layout_top_pet_data_small"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="@dimen/dp_8"
|
|
||||||
android:layout_marginTop="@dimen/dp_40" />
|
|
||||||
|
|
||||||
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
|
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
|
||||||
android:id="@+id/ll_live_v2_state_layout"
|
android:id="@+id/ll_live_v2_state_layout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_below="@id/ll_live_v2_map_top_pet"
|
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="@dimen/dp_8"
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
@@ -72,8 +71,7 @@
|
|||||||
layout="@layout/item_home_map_device_msg"
|
layout="@layout/item_home_map_device_msg"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/ll_live_v2_state_layout"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
@@ -81,7 +79,6 @@
|
|||||||
android:id="@+id/rv_map_live_v2_device_state"
|
android:id="@+id/rv_map_live_v2_device_state"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/ll_live_v2_map_top_pet"
|
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_marginTop="@dimen/dp_18"
|
android:layout_marginTop="@dimen/dp_18"
|
||||||
android:layout_marginEnd="@dimen/dp_12"
|
android:layout_marginEnd="@dimen/dp_12"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
style="@style/my_TextView_style_v2"
|
style="@style/my_TextView_style_v2"
|
||||||
android:layout_marginStart="@dimen/dp_12"
|
android:layout_marginStart="@dimen/dp_12"
|
||||||
android:layout_marginTop="@dimen/dp_8"
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
android:background="@drawable/icon_device_battery_bg_svg"
|
android:background="@drawable/icon_device_high_battery_bg"
|
||||||
android:text="0 "
|
android:text="0 "
|
||||||
android:textColor="@color/select_color"
|
android:textColor="@color/select_color"
|
||||||
android:textSize="@dimen/textSize8" />
|
android:textSize="@dimen/textSize8" />
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<string name="pet_manage_weight">%d lb</string>
|
<string name="pet_manage_weight">%d lb</string>
|
||||||
<string name="txt_about_version">Version%s</string>
|
<string name="txt_about_version">Version%s</string>
|
||||||
<string name="txt_service_contract">Allgemeine Geschäftsbedingungen</string>
|
<string name="txt_service_contract">Allgemeine Geschäftsbedingungen</string>
|
||||||
<string name="txt_read_and_accept">Datenschutzrichtlinie & Nutzungsbedingungen akzeptieren</string>
|
<string name="txt_read_and_accept">Ich akzeptiere die Datenschutzrichtlinie und Bedingungen.</string>
|
||||||
<string name="txt_device_has_bind">Der Tracker ist mit %s gekoppelt.</string>
|
<string name="txt_device_has_bind">Der Tracker ist mit %s gekoppelt.</string>
|
||||||
<string name="txt_activity_goal">Aktivitätsziel</string>
|
<string name="txt_activity_goal">Aktivitätsziel</string>
|
||||||
<string name="txt_end_time">Endzeit</string>
|
<string name="txt_end_time">Endzeit</string>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<string name="pet_manage_weight">%d lb</string>
|
<string name="pet_manage_weight">%d lb</string>
|
||||||
<string name="txt_about_version">Version%s</string>
|
<string name="txt_about_version">Version%s</string>
|
||||||
<string name="txt_service_contract">Conditions générales</string>
|
<string name="txt_service_contract">Conditions générales</string>
|
||||||
<string name="txt_read_and_accept">Accepter la politique de confidentialité & Tles conditions.</string>
|
<string name="txt_read_and_accept">J’accepte la Politique de confidentialité et les Conditions.</string>
|
||||||
<string name="txt_device_has_bind">Le traceur est associé à %s</string>
|
<string name="txt_device_has_bind">Le traceur est associé à %s</string>
|
||||||
<string name="txt_activity_goal">Objectif d’activité</string>
|
<string name="txt_activity_goal">Objectif d’activité</string>
|
||||||
<string name="txt_end_time">Heure de fin</string>
|
<string name="txt_end_time">Heure de fin</string>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import androidx.annotation.StringDef
|
|||||||
EventName.LiveAutoEnd,
|
EventName.LiveAutoEnd,
|
||||||
EventName.LiveOpenTimeOut,
|
EventName.LiveOpenTimeOut,
|
||||||
EventName.SetGoal,
|
EventName.SetGoal,
|
||||||
|
EventName.PaySuccessCn,
|
||||||
EventName.LocationData,
|
EventName.LocationData,
|
||||||
EventName.BluetoothSwitch,
|
EventName.BluetoothSwitch,
|
||||||
EventName.PostValue,
|
EventName.PostValue,
|
||||||
@@ -70,6 +71,7 @@ annotation class EventName {
|
|||||||
|
|
||||||
//支付成功返回
|
//支付成功返回
|
||||||
const val PayBack = "payBack"
|
const val PayBack = "payBack"
|
||||||
|
const val PaySuccessCn = "paySuccessCn"
|
||||||
const val HistoryDataSnapshot = "historyDataSnapshot"
|
const val HistoryDataSnapshot = "historyDataSnapshot"
|
||||||
const val ActiveGoal = "activeGoal"
|
const val ActiveGoal = "activeGoal"
|
||||||
const val UpdateReportInterval = "updateReportInterval"
|
const val UpdateReportInterval = "updateReportInterval"
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class AppUtils {
|
|||||||
* 是否是国内
|
* 是否是国内
|
||||||
*/
|
*/
|
||||||
fun isChina(type: String = SWITCH_PAGE_TYPE): Boolean {
|
fun isChina(type: String = SWITCH_PAGE_TYPE): Boolean {
|
||||||
return false
|
return true
|
||||||
if (isDebug()) {
|
if (isDebug()) {
|
||||||
if (type == SWITCH_MAP_TYPE && MMKVUtil.getBoolean(MMKVKey.OnlyGoogleMap, false)) {
|
if (type == SWITCH_MAP_TYPE && MMKVUtil.getBoolean(MMKVKey.OnlyGoogleMap, false)) {
|
||||||
//只启用谷歌地图
|
//只启用谷歌地图
|
||||||
|
|||||||