DoggyZhang 3 місяців тому
батько
коміт
65c7ae0f07

+ 2 - 1
app/build.gradle

@@ -131,7 +131,8 @@ android {
             keyAlias "gami"
             keyPassword "gami654321"
             storePassword "gami654321"
-            storeFile file('../keystore/debug/gami-debug.jks')
+            storeFile file("../keystore/release/gami.jks")
+            //storeFile file('../keystore/debug/gami-debug.jks')
         }
         release {
             keyAlias "gami"

+ 8 - 2
app/src/main/java/com/adealink/weparty/module/profile/viewmodel/IFollowViewModel.kt

@@ -3,14 +3,16 @@ package com.adealink.weparty.module.profile.viewmodel
 import androidx.lifecycle.LiveData
 import com.adealink.frame.base.Rlt
 import com.adealink.frame.mvvm.livedata.ExtLiveData
-import com.adealink.frame.mvvm.livedata.ExtMutableLiveData
 import com.adealink.weparty.module.profile.data.FollowStatus
-import com.adealink.weparty.module.profile.data.UserInfo
 
 interface IFollowViewModel {
 
     val isFollowLD: ExtLiveData<Map<String, FollowStatus>>
 
+    val followCountLD: ExtLiveData<Long>
+
+    val fansCountLD: ExtLiveData<Long>
+
     fun isFollow(uid: String): LiveData<Rlt<FollowStatus>>
 
     fun isFollow(uids: List<String>): LiveData<Rlt<Map<String, FollowStatus>>>
@@ -18,4 +20,8 @@ interface IFollowViewModel {
     fun follow(uid: String): LiveData<Rlt<Any>>
 
     fun unFollow(uid: String): LiveData<Rlt<Any>>
+
+    fun getFollowCount()
+
+    fun getFansCount()
 }

+ 1 - 1
gradle.properties

@@ -29,7 +29,7 @@ OFFICIAL=false
 
 IS_RELEASE=true
 
-VERSION_CODE=7
+VERSION_CODE=9
 VERSION_NAME=1.0.0(ahpha 9)
 
 OFFICIAL_UID=10000

+ 11 - 0
keystore/release/encryption_public_key.pem

@@ -0,0 +1,11 @@
+-----BEGIN PUBLIC KEY-----
+MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEArATwsIAB249yp/maQt5B
+ZF6xG2XAXRYPb3Hu5u0NIlgZaULW1jTeIpUWrLQ9T0+EPACfsSABlmu+PszrBjKm
+heVFw1SyxcjiFqH6vRVgjZyrwKfBne7VoOvMtLuniQFCBoTTmRfzjPfnPAPCWdj7
+pB6xk7eVQb4es3e/AVaeAYgABhGdsZqSsnuAPCEgnAXkL1xtAlc55rt/MXZQ3v4f
+sFMZgsabJNLW9VKvV2IJLtvWWI53oVQHohHjX23TUHZf7mPiJ0aLysvQ5TrBcYjm
+cKT8nHjm1kYA0+f40PmmfNWe+Vt78FdUEp3/he2zSHHWqVaGxxhvCO+Abyqd9nyg
+o803/8FDEllGPQudGKu9dcB1DHArJmWjvB6kB2u5zciSMSgUeyXxGXf6yHq0qLKk
+xrksp2zWwCAjGtidO0A/Hu2pmNSh1QYa6ruhySO9vhrED/sEW6V81OEy2eJNKdwD
+ohS9ZXAkxKRtM/+llP1OF6xkaAFESsbIA/F3Cv8o9wqlAgMBAAE=
+-----END PUBLIC KEY-----

+ 4 - 3
module/account/src/main/java/com/adealink/weparty/account/register/fragment/SelectGenderFragment.kt

@@ -12,6 +12,7 @@ import com.adealink.weparty.account.databinding.FragmentRegisterSelectGenderBind
 import com.adealink.weparty.account.register.viewmodel.RegisterProfileViewModel
 import com.adealink.weparty.account.viewModel.AccountViewModelFactory
 import com.adealink.weparty.commonui.BaseFragment
+import com.adealink.weparty.module.account.AccountModule
 import com.adealink.weparty.module.profile.data.Gender
 import com.adealink.weparty.R as APP_R
 
@@ -22,11 +23,11 @@ class SelectGenderFragment : BaseFragment(R.layout.fragment_register_select_gend
 
     override fun initViews() {
         super.initViews()
-        binding.topBar.updateLayoutParams <ConstraintLayout.LayoutParams>{
+        binding.topBar.updateLayoutParams<ConstraintLayout.LayoutParams> {
             topMargin = activity.statusBarHeight()
         }
         binding.topBar.backCallback = {
-            activity?.onBackPressed()
+            AccountModule.logout(true)
         }
         binding.clMale.onClick {
             viewModel.selectGender(Gender.MALE)
@@ -40,7 +41,7 @@ class SelectGenderFragment : BaseFragment(R.layout.fragment_register_select_gend
 
         viewModel.genderLD.value?.let {
             selectGender(it)
-        }
+        } ?: selectGender(Gender.UNKNOWN)
     }
 
     override fun observeViewModel() {

+ 2 - 0
module/account/src/main/res/values/strings.xml

@@ -33,6 +33,8 @@
    <string name="account_copy_device_id_fail">Failed to obtain device ID</string>
    <string name="account_register_select_gender">Select gender</string>
    <string name="account_register_select_gender_tips">Registration cannot be modified after registration.</string>
+   <string name="account_register_select_category">Select gender</string>
+   <string name="account_register_select_category_tips">Select gender</string>
    <string name="account_register_next">Next Step</string>
    <string name="account_register_nice">Nice</string>
    <string name="account_register_complete_userinfo">Continue to enrich your image</string>

+ 2 - 2
module/profile/src/main/java/com/adealink/weparty/profile/datasource/remote/FollowHttpService.kt

@@ -27,13 +27,13 @@ interface FollowHttpService {
 
 
     @POST("user/relateion/myFollows")
-    suspend fun pullFollow(
+    suspend fun pullFollowList(
         @Body req: FollowListReq
     ): Rlt<Res<FollowListRes>>
 
 
     @POST("user/relateion/fans")
-    suspend fun pullFans(
+    suspend fun pullFansList(
         @Body req: FansListReq
     ): Rlt<Res<FansListRes>>
 

+ 8 - 1
module/profile/src/main/java/com/adealink/weparty/profile/me/comp/MeHeaderComp.kt

@@ -58,13 +58,20 @@ class MeHeaderComp(
     override fun onResume() {
         super.onResume()
         updateHeader(ProfileModule.getMyUserInfo())
-
+        followViewModel.getFollowCount()
+        followViewModel.getFansCount()
     }
 
     private fun observeViewModel() {
         profileViewModel.userInfoLD.observe(viewLifecycleOwner) { user ->
             updateHeader(user)
         }
+        followViewModel.followCountLD.observe(viewLifecycleOwner) {
+            binding.tvFollowCount.text = it.toString()
+        }
+        followViewModel.fansCountLD.observe(viewLifecycleOwner) {
+            binding.tvFansCount.text = it.toString()
+        }
     }
 
     private fun loadData() {

+ 24 - 5
module/profile/src/main/java/com/adealink/weparty/profile/relation/RelationShipActivity.kt

@@ -18,10 +18,10 @@ import com.adealink.weparty.commonui.ext.gone
 import com.adealink.weparty.commonui.ext.show
 import com.adealink.weparty.commonui.recycleview.adapter.BaseActivityTabFragmentStateAdapter
 import com.adealink.weparty.commonui.widget.EmptyFragment
-import com.adealink.weparty.databinding.LayoutHomeTabBinding
 import com.adealink.weparty.module.profile.Profile
 import com.adealink.weparty.profile.R
 import com.adealink.weparty.profile.databinding.ActivityProfileRelationshipBinding
+import com.adealink.weparty.profile.databinding.LayoutRelationshipTabBinding
 import com.adealink.weparty.profile.relation.viewmodel.FollowViewModel
 import com.adealink.weparty.profile.relation.viewmodel.RELATIONSHIP_TABS
 import com.adealink.weparty.profile.relation.viewmodel.RelationShipTab
@@ -67,9 +67,9 @@ class RelationShipActivity : BaseActivity() {
             true,
             false
         ) { tabLayout, position ->
-            tabLayout.setCustomView(com.adealink.weparty.R.layout.layout_home_tab)
+            tabLayout.setCustomView(R.layout.layout_relationship_tab)
             tabLayout.customView?.let { tabView ->
-                val tabViewBinding = LayoutHomeTabBinding.bind(tabView)
+                val tabViewBinding = LayoutRelationshipTabBinding.bind(tabView)
                 onConfigureTab(tabViewBinding, position)
                 updateTabView(
                     tabLayout,
@@ -94,7 +94,7 @@ class RelationShipActivity : BaseActivity() {
         binding.vpContent.currentItem = tabIndex
     }
 
-    private fun onConfigureTab(binding: LayoutHomeTabBinding, position: Int) {
+    private fun onConfigureTab(binding: LayoutRelationshipTabBinding, position: Int) {
         binding.tvTab.text = pageAdapter.getTabName(position)
     }
 
@@ -103,7 +103,7 @@ class RelationShipActivity : BaseActivity() {
         isSelected: Boolean
     ) {
         tabView?.customView?.let { tabView ->
-            val tabViewBinding = LayoutHomeTabBinding.bind(tabView)
+            val tabViewBinding = LayoutRelationshipTabBinding.bind(tabView)
             if (isSelected) {
                 tabViewBinding.ivTabBg.show()
                 tabViewBinding.tvTab.setTextColor(getCompatColor(com.adealink.weparty.R.color.color_FF1D2129))
@@ -118,7 +118,26 @@ class RelationShipActivity : BaseActivity() {
 
     override fun observeViewModel() {
         super.observeViewModel()
+        viewModel.followCountLD.observe(this) {
+            binding.tlTab.getTabAt(0)?.let { tab ->
+                updateCount(tab, it)
+            }
+        }
+        viewModel.fansCountLD.observe(this) {
+            binding.tlTab.getTabAt(1)?.let { tab ->
+                updateCount(tab, it)
+            }
+        }
+    }
 
+    private fun updateCount(
+        tabView: TabLayout.Tab?,
+        count: Long,
+    ) {
+        tabView?.customView?.let { tabView ->
+            val tabViewBinding = LayoutRelationshipTabBinding.bind(tabView)
+            tabViewBinding.tvCount.text = count.toString()
+        }
     }
 
     internal inner class PageAdapter : BaseActivityTabFragmentStateAdapter(this) {

+ 4 - 2
module/profile/src/main/java/com/adealink/weparty/profile/relation/data/RelationShipData.kt

@@ -33,7 +33,8 @@ data class FollowListReq(
 data class FollowListRes(
     @SerializedName("list") val list: List<FollowData>,
     @GsonNullable
-    @SerializedName("next") val next: String?
+    @SerializedName("next") val next: String?,
+    @SerializedName("total") val total: Long
 )
 
 data class FollowData(
@@ -59,7 +60,8 @@ data class FansListReq(
 data class FansListRes(
     @SerializedName("list") val list: List<FansData>,
     @GsonNullable
-    @SerializedName("next") val next: String?
+    @SerializedName("next") val next: String?,
+    @SerializedName("total") val total: Long
 )
 
 data class FansData(

+ 36 - 2
module/profile/src/main/java/com/adealink/weparty/profile/relation/viewmodel/FollowViewModel.kt

@@ -3,6 +3,7 @@ package com.adealink.weparty.profile.relation.viewmodel
 import androidx.lifecycle.LiveData
 import androidx.lifecycle.MutableLiveData
 import com.adealink.frame.base.Rlt
+import com.adealink.frame.mvvm.livedata.ExtLiveData
 import com.adealink.frame.mvvm.livedata.ExtMutableLiveData
 import com.adealink.frame.mvvm.livedata.OnceMutableLiveData
 import com.adealink.frame.mvvm.viewmodel.BaseViewModel
@@ -27,6 +28,8 @@ class FollowViewModel : BaseViewModel(), IFollowViewModel {
 
     private val followStatusMap = mutableMapOf<String, FollowStatus>()
     override val isFollowLD = ExtMutableLiveData<Map<String, FollowStatus>>()
+    override val followCountLD: ExtLiveData<Long> = ExtMutableLiveData()
+    override val fansCountLD: ExtLiveData<Long> = ExtMutableLiveData()
     override fun isFollow(uid: String): LiveData<Rlt<FollowStatus>> {
         val liveData = OnceMutableLiveData<Rlt<FollowStatus>>()
         viewModelScope.launch {
@@ -106,6 +109,35 @@ class FollowViewModel : BaseViewModel(), IFollowViewModel {
         return liveData
     }
 
+    override fun getFollowCount() {
+        viewModelScope.launch {
+            val rlt = followHttpService.pullFollowList(FollowListReq(1, null))
+            when (rlt) {
+                is Rlt.Failed -> {
+                    followCountLD.send(0)
+                }
+
+                is Rlt.Success -> {
+                    followCountLD.send(rlt.data.data?.total ?: 0)
+                }
+            }
+        }
+    }
+
+    override fun getFansCount() {
+        viewModelScope.launch {
+            val rlt = followHttpService.pullFansList(FansListReq(1, null))
+            when (rlt) {
+                is Rlt.Failed -> {
+                    fansCountLD.send(0)
+                }
+
+                is Rlt.Success -> {
+                    fansCountLD.send(rlt.data.data?.total ?: 0)
+                }
+            }
+        }
+    }
 
     private fun onFollowStatusChanged(uid: String, follow: Boolean) {
         val currentStatus = followStatusMap[uid]
@@ -162,7 +194,7 @@ class FollowViewModel : BaseViewModel(), IFollowViewModel {
 
     fun loadMoreFollowList() {
         viewModelScope.launch {
-            val rlt = followHttpService.pullFollow(
+            val rlt = followHttpService.pullFollowList(
                 FollowListReq(
                     size = followPageHandler.pageSize,
                     next = followPageHandler.currentPage
@@ -181,6 +213,7 @@ class FollowViewModel : BaseViewModel(), IFollowViewModel {
                             followUids.add(it.uid)
                         }
                     }
+                    followCountLD.send(rlt.data.data?.total ?: 0)
                     followListRltLD.send(rlt)
                     followListLD.send(followList)
                 }
@@ -203,7 +236,7 @@ class FollowViewModel : BaseViewModel(), IFollowViewModel {
 
     fun loadMoreFansList() {
         viewModelScope.launch {
-            val rlt = followHttpService.pullFans(
+            val rlt = followHttpService.pullFansList(
                 FansListReq(
                     size = fansPageHandler.pageSize,
                     next = fansPageHandler.currentPage
@@ -222,6 +255,7 @@ class FollowViewModel : BaseViewModel(), IFollowViewModel {
                             fansUids.add(it.uid)
                         }
                     }
+                    fansCountLD.send(rlt.data.data?.total ?: 0)
                     fansListRltLD.send(rlt)
                     fansListLD.send(fansList)
                 }

+ 6 - 3
module/profile/src/main/res/layout/layout_me_header.xml

@@ -55,11 +55,12 @@
             android:layout_height="wrap_content"
             android:layout_marginTop="4dp"
             android:includeFontPadding="false"
+            android:text="ID"
             android:textColor="@color/color_FF4E5969"
             android:textSize="14sp"
             app:layout_constraintStart_toStartOf="@id/tv_user_name"
             app:layout_constraintTop_toBottomOf="@id/tv_user_name"
-            tools:text="ID" />
+            tools:ignore="HardcodedText" />
 
         <androidx.appcompat.widget.AppCompatTextView
             android:id="@+id/tv_user_id"
@@ -108,12 +109,13 @@
                 android:layout_height="wrap_content"
                 android:fontFamily="@font/poppins_semibold"
                 android:includeFontPadding="false"
+                android:text="0"
                 android:textColor="@color/color_FF1D2129"
                 android:textSize="18sp"
                 app:layout_constraintEnd_toEndOf="parent"
                 app:layout_constraintStart_toStartOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
-                tools:text="18" />
+                tools:ignore="HardcodedText" />
 
             <androidx.appcompat.widget.AppCompatTextView
                 android:layout_width="wrap_content"
@@ -152,12 +154,13 @@
                 android:layout_height="wrap_content"
                 android:fontFamily="@font/poppins_semibold"
                 android:includeFontPadding="false"
+                android:text="0"
                 android:textColor="@color/color_FF1D2129"
                 android:textSize="18sp"
                 app:layout_constraintEnd_toEndOf="parent"
                 app:layout_constraintStart_toStartOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
-                tools:text="18" />
+                tools:ignore="HardcodedText" />
 
             <androidx.appcompat.widget.AppCompatTextView
                 android:layout_width="wrap_content"

+ 47 - 0
module/profile/src/main/res/layout/layout_relationship_tab.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
+
+    <androidx.appcompat.widget.AppCompatImageView
+        android:id="@+id/iv_tab_bg"
+        android:layout_width="42dp"
+        android:layout_height="22dp"
+        app:layout_constraintBottom_toBottomOf="@id/tv_tab"
+        app:layout_constraintEnd_toEndOf="@id/tv_tab"
+        app:layout_constraintStart_toStartOf="@id/tv_tab"
+        app:layout_constraintTop_toTopOf="@id/tv_tab"
+        app:srcCompat="@drawable/common_home_main_tab_selected_ic" />
+
+    <androidx.appcompat.widget.AppCompatTextView
+        android:id="@+id/tv_count"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:fontFamily="@font/poppins_semibold"
+        android:includeFontPadding="false"
+        android:textColor="@color/color_FF4E5969"
+        android:textSize="16sp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toStartOf="@id/tv_tab"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        tools:text="0" />
+
+    <androidx.appcompat.widget.AppCompatTextView
+        android:id="@+id/tv_tab"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="4dp"
+        android:fontFamily="@font/poppins_semibold"
+        android:includeFontPadding="false"
+        android:textColor="@color/color_FF4E5969"
+        android:textSize="16sp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toEndOf="@id/tv_count"
+        app:layout_constraintTop_toTopOf="parent"
+        tools:text="Online Play" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 44 - 16
module/wallet/src/main/java/com/adealink/weparty/wallet/pay/GooglePayUtil.kt

@@ -5,6 +5,7 @@ import android.content.Context
 import android.os.Handler
 import android.os.Message
 import android.util.Log
+import com.adealink.weparty.wallet.data.TAG_GOOGLE_BILLING
 import com.android.billingclient.api.AcknowledgePurchaseParams
 import com.android.billingclient.api.AcknowledgePurchaseResponseListener
 import com.android.billingclient.api.BillingClient
@@ -57,7 +58,10 @@ class GooglePayUtil(context: Context, private var listener: OnPurchasesListener)
 
     //购买状态监听器
     private var mPurchasesUpdatedListener = PurchasesUpdatedListener { result, purchases ->
-        log("PurchasesUpdatedListener result:${result.responseCode}  purchases:$purchases")
+        Log.i(
+            TAG_GOOGLE_BILLING,
+            "PurchasesUpdatedListener result:${result.responseCode}  purchases:$purchases"
+        )
         if (result.responseCode == BillingResponseCode.OK && purchases != null) {
             listener.onPurchasesSuccess(purchases)
         } else if (result.responseCode == BillingResponseCode.USER_CANCELED) {
@@ -68,19 +72,25 @@ class GooglePayUtil(context: Context, private var listener: OnPurchasesListener)
     }
 
     private var mPurchaseResponseListener = PurchasesResponseListener { result, purchases ->
-        log("mPurchaseResponseListener result:${result.responseCode}  p1:$purchases")
+        Log.i(
+            TAG_GOOGLE_BILLING,
+            "mPurchaseResponseListener result:${result.responseCode}  p1:$purchases"
+        )
         listener.onQueryPurchasesResponse(result, purchases)
     }
 
     //连接状态监听器
     private var mConnectListener = object : BillingClientStateListener {
         override fun onBillingServiceDisconnected() {
-            log("onBillingServiceDisconnected")
+            Log.i(TAG_GOOGLE_BILLING, "onBillingServiceDisconnected")
             mHandler?.sendEmptyMessageDelayed(0, 1000)
         }
 
         override fun onBillingSetupFinished(result: BillingResult) {
-            log("onBillingSetupFinished --> ${result.responseCode}   ${result.debugMessage}")
+            Log.i(
+                TAG_GOOGLE_BILLING,
+                "onBillingSetupFinished --> ${result.responseCode}   ${result.debugMessage}"
+            )
             if (result.responseCode == BillingResponseCode.OK) {
                 listener.onSetupFinish()
             }
@@ -121,8 +131,12 @@ class GooglePayUtil(context: Context, private var listener: OnPurchasesListener)
      * @param productId     Google Play 管理中心配置的商品 id
      * @param type  ProductType.SUBS | ProductType.INAPP
      */
-    fun queryProductDetails(productId: String, type: String, listener: ProductDetailsResponseListener) {
-        log("queryProductDetails productId:$productId   type:$type")
+    fun queryProductDetails(
+        productId: String,
+        type: String,
+        listener: ProductDetailsResponseListener
+    ) {
+        Log.i(TAG_GOOGLE_BILLING, "queryProductDetails productId:$productId   type:$type")
         val params = QueryProductDetailsParams.newBuilder()
             .setProductList(
                 arrayListOf(
@@ -142,15 +156,29 @@ class GooglePayUtil(context: Context, private var listener: OnPurchasesListener)
      * @param product       从google 获取的商品信息
      * @param personalized  是否自动化决策进行了个性化设置
      */
-    fun purchases(activity: Activity, product: ProductDetails, userId: String, selfOrderId: String, offerToken: String? = null, personalized: Boolean? = null) {
-        log("purchases\nproduct:${product.name}\nid:${product.productId}\ntype:${product.productType}")
+    fun purchases(
+        activity: Activity,
+        product: ProductDetails,
+        userId: String,
+        selfOrderId: String,
+        offerToken: String? = null,
+        personalized: Boolean? = null
+    ) {
+        Log.i(
+            TAG_GOOGLE_BILLING,
+            "purchases\nproduct:${product.name}\nid:${product.productId}\ntype:${product.productType}"
+        )
         val list = arrayListOf(
             ProductDetailsParams.newBuilder()
                 .setProductDetails(product)
                 .apply {
                     if (product.productType == ProductType.SUBS) {
                         if (offerToken == null) {
-                            throw Exception("purchases error, product -> ${product.productId} is type ProductType.SUBS, offerToken is request!!")
+                            Log.e(
+                                TAG_GOOGLE_BILLING,
+                                "purchases error, product -> ${product.productId} is type ProductType.SUBS, offerToken is request!!"
+                            )
+                            return
                         }
                         setOfferToken(offerToken)
                     }
@@ -172,7 +200,7 @@ class GooglePayUtil(context: Context, private var listener: OnPurchasesListener)
      * @param   type ProductType.SUBS | ProductType.INAPP
      */
     suspend fun queryPurchaseAsync(type: String) {
-        log("queryPurchaseAsync type:$type")
+        Log.i(TAG_GOOGLE_BILLING, "queryPurchaseAsync type:$type")
         val params = QueryPurchasesParams.newBuilder().setProductType(type)
         mClient?.queryPurchasesAsync(params.build(), mPurchaseResponseListener)
     }
@@ -200,9 +228,13 @@ class GooglePayUtil(context: Context, private var listener: OnPurchasesListener)
     suspend fun acknowledgePurchases(purchase: Purchase) {
         if (purchase.purchaseState == Purchase.PurchaseState.PURCHASED) {
             if (!purchase.isAcknowledged) {
-                val acknowledgePurchaseParams = AcknowledgePurchaseParams.newBuilder().setPurchaseToken(purchase.purchaseToken)
+                val acknowledgePurchaseParams =
+                    AcknowledgePurchaseParams.newBuilder().setPurchaseToken(purchase.purchaseToken)
                 val ackPurchaseResult = withContext(Dispatchers.IO) {
-                    mClient?.acknowledgePurchase(acknowledgePurchaseParams.build(), mAcknowledgeListener)
+                    mClient?.acknowledgePurchase(
+                        acknowledgePurchaseParams.build(),
+                        mAcknowledgeListener
+                    )
                 }
             }
         }
@@ -256,8 +288,4 @@ class GooglePayUtil(context: Context, private var listener: OnPurchasesListener)
         mClient?.endConnection()
         mClient = null
     }
-
-    private fun log(msg: String) {
-        Log.e("GooglePayUtil", msg)
-    }
 }

+ 1 - 1
module/wallet/src/main/java/com/adealink/weparty/wallet/recharge/data/WalletData.kt

@@ -17,7 +17,7 @@ data class RechargeProduct(
     @SerializedName("coinRechargeAmount") val amount: Int, //充值数量
     @SerializedName("amount") val price: Double, //价格
     @SerializedName("currency") val currency: String, //法币名称
-    @SerializedName("code") val productId: String, //用作查询Google充值档位
+    @SerializedName("code") val productId: String, //用作查询Google充值档位(eg: com.jiehe.gami.3000)
 ){
     companion object{
         val INVALID_PRODUCT = RechargeProduct(

+ 3 - 5
module/wallet/src/main/java/com/adealink/weparty/wallet/viewmodel/WalletViewModel.kt

@@ -12,7 +12,6 @@ import com.adealink.frame.base.Rlt
 import com.adealink.frame.data.json.toJsonErrorNull
 import com.adealink.frame.mvvm.livedata.OnceMutableLiveData
 import com.adealink.frame.mvvm.viewmodel.BaseViewModel
-import com.adealink.frame.util.PackageUtil
 import com.adealink.weparty.App
 import com.adealink.weparty.commonui.ext.isFailure
 import com.adealink.weparty.commonui.toast.util.showToast
@@ -192,8 +191,7 @@ class WalletViewModel : BaseViewModel(), IWalletViewModel, IWalletListener,
                 return@suspendCancellableCoroutine
             }
 
-            payClient?.queryProductDetails(
-                "${PackageUtil.getPackageName().replace(".debug", "")}.$productId",
+            payClient?.queryProductDetails(productId,
                 GooglePayUtil.TYPE_IN_APP
             ) { result, list ->
                 Log.i(
@@ -216,12 +214,12 @@ class WalletViewModel : BaseViewModel(), IWalletViewModel, IWalletListener,
                 if (AppBase.isRelease) {
                     Log.i(
                         TAG_WALLET,
-                        "queryProductDetails:\nresult:$result\n productDetail:${toJsonErrorNull(list)}"
+                        "queryProductDetails:\n result:$result\n productDetail:${toJsonErrorNull(list)}"
                     )
                 } else {
                     Log.i(
                         TAG_WALLET,
-                        "queryProductDetails:\nresult:$result\n productDetail:${toJsonErrorNull(list)}"
+                        "queryProductDetails:\n result:$result\n productDetail:${toJsonErrorNull(list)}"
                     )
                 }