1.修复开启订阅不能退款bug

This commit is contained in:
2026-09-23 18:12:11 +08:00
parent d7fb4e3a56
commit 69b91f8135
12 changed files with 53 additions and 36 deletions

View File

@@ -30,7 +30,7 @@ android {
targetSdkVersion 35 targetSdkVersion 35
versionCode 2600 versionCode 2600
// versionName "2.6.0" // versionName "2.6.0"
versionName "2.6.0-Beta1" versionName "2.6.0-Beta3"
4 4
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -4,6 +4,7 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import androidx.core.content.ContextCompat
import com.abbidot.baselibrary.list.BaseRecyclerAdapter import com.abbidot.baselibrary.list.BaseRecyclerAdapter
import com.abbidot.baselibrary.list.RecyclerViewHolder import com.abbidot.baselibrary.list.RecyclerViewHolder
import com.abbidot.tracker.R import com.abbidot.tracker.R
@@ -105,12 +106,18 @@ 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) var textColor: Int
val batteryBg = if (item.batteryCapacity >= 60) {
textColor = R.color.green_color4
R.drawable.icon_device_high_battery_bg R.drawable.icon_device_high_battery_bg
else if (item.batteryCapacity >= 20) } else if (item.batteryCapacity >= 20) {
textColor = R.color.orange_color7
R.drawable.icon_device_middle_battery_bg R.drawable.icon_device_middle_battery_bg
else } else {
textColor = R.color.red_color6
R.drawable.icon_device_low_battery_bg R.drawable.icon_device_low_battery_bg
}
batteryTextView.setTextColor(ContextCompat.getColor(mContext, textColor))
batteryTextView.setBackgroundResource(batteryBg) batteryTextView.setBackgroundResource(batteryBg)
} }
if (null == item.pet) { if (null == item.pet) {

View File

@@ -6,10 +6,8 @@ import android.view.View
import android.widget.TextView import android.widget.TextView
import androidx.appcompat.widget.AppCompatImageView import androidx.appcompat.widget.AppCompatImageView
import androidx.appcompat.widget.LinearLayoutCompat import androidx.appcompat.widget.LinearLayoutCompat
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.abbidot.baselibrary.util.LogUtil
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.bean.SubscriptionsOrderBean import com.abbidot.tracker.bean.SubscriptionsOrderBean
@@ -24,9 +22,7 @@ import com.abbidot.tracker.widget.TypefaceTextView
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.hjq.toast.Toaster import com.hjq.toast.Toaster
import com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView
import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButtonDrawable import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButtonDrawable
import com.stripe.android.core.AppInfo
/** /**
*Created by .yzq on 2024/8/19/019. *Created by .yzq on 2024/8/19/019.
@@ -125,13 +121,8 @@ class SubscriptionHistoryAdapter(
else { else {
visibility = View.VISIBLE visibility = View.VISIBLE
when (item.orderStatus) { when (item.orderStatus) {
1 -> { 1 ->
if (item.subscriptionStatus == ConstantInt.Type1) {
visibility = View.GONE
} else {
setRefundState(context, item.isRefundable, this) setRefundState(context, item.isRefundable, this)
}
}
4 -> setText(R.string.txt_waiting) 4 -> setText(R.string.txt_waiting)
5 -> setText(R.string.txt_refunding) 5 -> setText(R.string.txt_refunding)
@@ -183,8 +174,7 @@ class SubscriptionHistoryAdapter(
//orderStatus=0 支付取消 1支付成功 2支付失败 3待支付 4申请审核中 5退款中 6退款成功 7退款失败 8审核失败 //orderStatus=0 支付取消 1支付成功 2支付失败 3待支付 4申请审核中 5退款中 6退款成功 7退款失败 8审核失败
when (item.orderStatus) { when (item.orderStatus) {
1 -> { 1 -> {
if (item.subscriptionStatus == ConstantInt.Type1) context.getString(R.string.txt_unavailable) if (item.isRefundable == ConstantInt.Type1) context.getString(R.string.txt_available)
else if (item.isRefundable == ConstantInt.Type1) context.getString(R.string.txt_available)
else context.getString(R.string.txt_unavailable) else context.getString(R.string.txt_unavailable)
} }
@@ -203,10 +193,8 @@ class SubscriptionHistoryAdapter(
//orderStatus=0 支付取消 1支付成功 2支付失败 3待支付 4申请审核中 5退款中 6退款成功 7退款失败 8审核失败 //orderStatus=0 支付取消 1支付成功 2支付失败 3待支付 4申请审核中 5退款中 6退款成功 7退款失败 8审核失败
when (item.orderStatus) { when (item.orderStatus) {
1 -> { 1 -> {
if (item.subscriptionStatus == ConstantInt.Type1) null if (item.isRefundable == ConstantInt.Type1)
else if (item.isRefundable == ConstantInt.Type1)
Intent(context, RequestRefundActivity::class.java) Intent(context, RequestRefundActivity::class.java)
// Intent(context, RefundDetailsActivity::class.java)
else null else null
} }

View File

@@ -3,6 +3,7 @@ package com.abbidot.tracker.ui
import android.view.View import android.view.View
import androidx.activity.viewModels import androidx.activity.viewModels
import com.abbidot.baselibrary.constant.MMKVKey import com.abbidot.baselibrary.constant.MMKVKey
import com.abbidot.baselibrary.util.AppUtils
import com.abbidot.baselibrary.util.LogUtil 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
@@ -110,6 +111,10 @@ class DebugActivity : BaseActivity<ActivityDebugBinding>(ActivityDebugBinding::i
showToast("修改成功,下次刷新位置生效") showToast("修改成功,下次刷新位置生效")
} }
} }
mViewBinding.liDebugSystemRegion.let {
it.text = "系统地区"
it.detailText = "${AppUtils.getCountry()}-${AppUtils.getDisplayCountry()}"
}
} }
/** /**
@@ -152,10 +157,14 @@ class DebugActivity : BaseActivity<ActivityDebugBinding>(ActivityDebugBinding::i
val convertLatLon = val convertLatLon =
LonAndLatUtil.convertFromWGS84ToGCJ02(data.latitude, data.longitude) LonAndLatUtil.convertFromWGS84ToGCJ02(data.latitude, data.longitude)
ViewUtil.instance.addMenuBean( ViewUtil.instance.addMenuBean(
mMutableList, "longitude", "${data.longitude}(GPS)\n${convertLatLon[1]}" mMutableList,
"longitude",
"${data.longitude}(GPS)\n${convertLatLon[1]}"
) )
ViewUtil.instance.addMenuBean( ViewUtil.instance.addMenuBean(
mMutableList, "latitude", "${data.latitude}(GPS)\n${convertLatLon[0]}" mMutableList,
"latitude",
"${data.latitude}(GPS)\n${convertLatLon[0]}"
) )
} else { } else {
ViewUtil.instance.addMenuBean( ViewUtil.instance.addMenuBean(

View File

@@ -743,7 +743,7 @@ class HomeV2Activity : BaseActivity<ActivityHomeV2Binding>(ActivityHomeV2Binding
} }
override fun onChangeClick(position: Int) { override fun onChangeClick(position: Int) {
if (mPetList.size == 0) return if (mPetList.isEmpty()) return
mChangePetDialog?.dismiss() mChangePetDialog?.dismiss()
mSelectPetPosition = position mSelectPetPosition = position
mChangePetListDialogAdapter.setSelectPetPos(mSelectPetPosition) mChangePetListDialogAdapter.setSelectPetPos(mSelectPetPosition)

View File

@@ -22,7 +22,6 @@ import com.abbidot.tracker.bean.PetBean
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.database.MyDatabase
import com.abbidot.tracker.databinding.ActivityMyTrackerV2Binding import com.abbidot.tracker.databinding.ActivityMyTrackerV2Binding
import com.abbidot.tracker.ui.activity.pet.PetProfileActivity import com.abbidot.tracker.ui.activity.pet.PetProfileActivity
import com.abbidot.tracker.util.ViewUtil import com.abbidot.tracker.util.ViewUtil

View File

@@ -1,13 +1,7 @@
package com.abbidot.tracker.ui.activity.subscribe package com.abbidot.tracker.ui.activity.subscribe
import android.R.attr.visibility
import android.os.Bundle
import android.view.View import android.view.View
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
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.base.BaseActivity import com.abbidot.tracker.base.BaseActivity
@@ -17,7 +11,6 @@ import com.abbidot.tracker.databinding.ActivityRefundDetailsBinding
import com.abbidot.tracker.ui.fragment.subscribe.RefundPolicyBottomSheetFragment import com.abbidot.tracker.ui.fragment.subscribe.RefundPolicyBottomSheetFragment
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.qmuiteam.qmui.widget.QMUITopBar
class RefundDetailsActivity : class RefundDetailsActivity :
BaseActivity<ActivityRefundDetailsBinding>(ActivityRefundDetailsBinding::inflate) { BaseActivity<ActivityRefundDetailsBinding>(ActivityRefundDetailsBinding::inflate) {

View File

@@ -23,7 +23,7 @@
android:id="@+id/switch_only_google_map" android:id="@+id/switch_only_google_map"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_38" android:layout_height="@dimen/dp_38"
android:layout_marginBottom="@dimen/dp_6" android:layout_marginBottom="@dimen/dp_2"
android:background="@drawable/selector_shape6_gray_bg_pressed" android:background="@drawable/selector_shape6_gray_bg_pressed"
app:qmui_accessory_type="switcher" /> app:qmui_accessory_type="switcher" />
@@ -31,15 +31,23 @@
android:id="@+id/switch_google_lat_lon_conversion" android:id="@+id/switch_google_lat_lon_conversion"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_38" android:layout_height="@dimen/dp_38"
android:visibility="gone" android:layout_marginBottom="@dimen/dp_2"
android:layout_marginBottom="@dimen/dp_6"
android:background="@drawable/selector_shape6_gray_bg_pressed" android:background="@drawable/selector_shape6_gray_bg_pressed"
android:visibility="gone"
app:qmui_accessory_type="switcher" /> app:qmui_accessory_type="switcher" />
<com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView
android:id="@+id/li_debug_system_region"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_38"
android:layout_marginBottom="@dimen/dp_2"
android:background="@drawable/selector_shape6_gray_bg_pressed" />
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/ll_debug_pet" android:id="@+id/ll_debug_pet"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:layout_marginBottom="@dimen/dp_6" android:layout_marginBottom="@dimen/dp_6"
android:gravity="center"> android:gravity="center">

View File

@@ -23,7 +23,7 @@
android:layout_marginTop="@dimen/dp_8" android:layout_marginTop="@dimen/dp_8"
android:background="@drawable/icon_device_high_battery_bg" android:background="@drawable/icon_device_high_battery_bg"
android:text="0 " android:text="0 "
android:textColor="@color/select_color" android:textColor="@color/green_color4"
android:textSize="@dimen/textSize8" /> android:textSize="@dimen/textSize8" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView

View File

@@ -383,4 +383,7 @@
<color name="orange_color5">#FF996E</color> <color name="orange_color5">#FF996E</color>
<color name="orange_color6">#FEF6E4</color> <color name="orange_color6">#FEF6E4</color>
<color name="blue_color11">#0099CC</color> <color name="blue_color11">#0099CC</color>
<color name="green_color4">#00B3A6</color>
<color name="orange_color7">#FFB020</color>
<color name="red_color6">#E5484D</color>
</resources> </resources>

View File

@@ -1028,7 +1028,7 @@
<string name="txt_request_submit_dec">Your refund request has been submitted.</string> <string name="txt_request_submit_dec">Your refund request has been submitted.</string>
<string name="txt_request_submit">Request Submitted</string> <string name="txt_request_submit">Request Submitted</string>
<string name="txt_under_review_dec">Your refund request is being reviewed.</string> <string name="txt_under_review_dec">Your refund request is being reviewed.</string>
<string name="txt_refund_failed_dec">We couldn\'t complete your refund. Please try again or contact support.</string> <string name="txt_refund_failed_dec">We couldn\'t complete your refund. Please contact support.</string>
<string name="txt_refund_failed">Refund Failed</string> <string name="txt_refund_failed">Refund Failed</string>
<string name="txt_refund_declined">Refund Declined</string> <string name="txt_refund_declined">Refund Declined</string>
<string name="txt_refund_pending">Refund Pending</string> <string name="txt_refund_pending">Refund Pending</string>

View File

@@ -214,6 +214,16 @@ class AppUtils {
return locale.language return locale.language
} }
/**
* 获取系统国家地区
*/
fun getDisplayCountry(loc: Locale? = null): String {
val locale = Locale.getDefault()
//Locale.CHINA
return if (null == loc) locale.getDisplayCountry(locale)
else locale.getDisplayCountry(loc)
}
/** /**
* 判断是否是深色模式 * 判断是否是深色模式
*/ */