From db2e408f6c2eddc363ed76e0f5fd1e59a02aa175 Mon Sep 17 00:00:00 2001 From: zhujie <leon.zhu@cloudroam.com.cn> Date: 星期四, 03 四月 2025 09:12:37 +0800 Subject: [PATCH] 邀请有礼 --- app/src/main/java/com/example/firstapp/ui/notifications/NotificationsFragment.kt | 69 ++++++++++++++++++---------------- 1 files changed, 36 insertions(+), 33 deletions(-) diff --git a/app/src/main/java/com/example/firstapp/ui/notifications/NotificationsFragment.kt b/app/src/main/java/com/example/firstapp/ui/notifications/NotificationsFragment.kt index d7494f4..38a6f08 100644 --- a/app/src/main/java/com/example/firstapp/ui/notifications/NotificationsFragment.kt +++ b/app/src/main/java/com/example/firstapp/ui/notifications/NotificationsFragment.kt @@ -31,7 +31,9 @@ import com.google.android.material.snackbar.Snackbar import kotlinx.coroutines.launch import com.bumptech.glide.Glide +import com.example.firstapp.MainActivity import com.example.firstapp.database.response.UserInfo +import com.example.firstapp.ui.invitation.InvitationActivity class NotificationsFragment : Fragment() { @@ -130,37 +132,37 @@ private fun setupClickListeners() { // 支付插件 - binding.payPlugin.setOnClickListener { - // 跳转到支付插件页面 - lifecycleScope.launch { - try { - val response = RetrofitClient.apiService.getPayOrderInfo() - var orderInfo=response.data - Log.d("AliPayHelper","获取订单信息时: ${response}") - // 这里调用支付宝 - PayAbility.aliPay(requireActivity(), orderInfo, Observer { - when (it.resultStatus) { - "9000" -> { -// Snackbar.make(binding.root, "支付成功", Snackbar.LENGTH_LONG).show() - requireActivity().runOnUiThread { - Toast.makeText(requireContext(), "支付成功", Toast.LENGTH_LONG).show() - } - } - else -> { -// Snackbar.make(binding.root, "支付失败", Snackbar.LENGTH_LONG).show() - requireActivity().runOnUiThread { - Toast.makeText(requireContext(), "支付失败", Toast.LENGTH_LONG).show() - } - - } - } - }) - - } catch (e: Exception) { - Log.d("AliPayHelper","获取订单信息时发生错误: ${e.message}") - } - } - } +// binding.payPlugin.setOnClickListener { +// // 跳转到支付插件页面 +// lifecycleScope.launch { +// try { +// val response = RetrofitClient.apiService.getPayOrderInfo() +// var orderInfo=response.data +// Log.d("AliPayHelper","获取订单信息时: ${response}") +// // 这里调用支付宝 +// PayAbility.aliPay(requireActivity(), orderInfo, Observer { +// when (it.resultStatus) { +// "9000" -> { +//// Snackbar.make(binding.root, "支付成功", Snackbar.LENGTH_LONG).show() +// requireActivity().runOnUiThread { +// Toast.makeText(requireContext(), "支付成功", Toast.LENGTH_LONG).show() +// } +// } +// else -> { +//// Snackbar.make(binding.root, "支付失败", Snackbar.LENGTH_LONG).show() +// requireActivity().runOnUiThread { +// Toast.makeText(requireContext(), "支付失败", Toast.LENGTH_LONG).show() +// } +// +// } +// } +// }) +// +// } catch (e: Exception) { +// Log.d("AliPayHelper","获取订单信息时发生错误: ${e.message}") +// } +// } +// } // 设置提醒 @@ -176,7 +178,9 @@ // 好友邀请 binding.layoutInvite.setOnClickListener { - shareToWechat() + // 跳转到邀请活动页面 + val intent = Intent(requireActivity(), InvitationActivity::class.java) + startActivity(intent) } // AI助手 @@ -210,7 +214,6 @@ // 隐私协议 binding.layoutPrivacy.setOnClickListener { startContentActivity("privacy_policy", "隐私协议") - startActivity(intent) } // 使用教程 -- Gitblit v1.9.3