| | |
| | | import com.google.android.material.dialog.MaterialAlertDialogBuilder |
| | | import com.example.firstapp.R |
| | | import com.example.firstapp.activity.ContentDetailActivity |
| | | import com.example.firstapp.activity.ReminderSettingsActivity |
| | | import com.example.firstapp.database.service.RetrofitClient |
| | | import com.example.firstapp.databinding.FragmentNotificationsBinding |
| | | import com.example.firstapp.pay.PayAbility |
| | |
| | | private val binding get() = _binding!! |
| | | |
| | | // 默认值 |
| | | private val DEFAULT_XIAOHONGSHU_URL = "https://www.xiaohongshu.com/user/profile/64978d5c000000001001ee26" |
| | | private val DEFAULT_EMAIL = "support@example.com" |
| | | private val DEFAULT_SHARE_TEXT = "推荐一个很棒的应用给你!\n下载地址:https://oia.xiaohongshu.com/oia" |
| | | private val DEFAULT_XIAOHONGSHU_URL = "https://www.xiaohongshu.com/user/profile/5812f5507fc5b818ce813383" |
| | | private val DEFAULT_EMAIL = "yuy@cloudroam.com.cn" |
| | | private val DEFAULT_SHARE_TEXT = "推荐一个很棒的应用给你!\n下载地址:http://14.103.144.28:8888/" |
| | | |
| | | // 存储从接口获取的值 |
| | | private var xiaohongshuUrl = "" |
| | |
| | | |
| | | private fun setupClickListeners() { |
| | | |
| | | |
| | | // 设置提醒 |
| | | binding.layoutReminder.setOnClickListener { |
| | | Toast.makeText(context, "设置功能开发中", Toast.LENGTH_SHORT).show() |
| | | // 判断是否是会员 |
| | | currentUserInfo?.let { user -> |
| | | if (user.isMember) { |
| | | // 是会员,跳转到提醒设置页面 |
| | | val intent = Intent(requireContext(), ReminderSettingsActivity::class.java) |
| | | startActivity(intent) |
| | | } else { |
| | | // 不是会员,跳转到VIP页面 |
| | | val intent = Intent(requireContext(), VipActivity::class.java) |
| | | intent.putExtra("source", "reminder") |
| | | startActivity(intent) |
| | | Toast.makeText(context, "开通会员后可使用提醒功能", Toast.LENGTH_SHORT).show() |
| | | } |
| | | } ?: run { |
| | | Toast.makeText(context, "正在加载用户信息,请稍后再试", Toast.LENGTH_SHORT).show() |
| | | } |
| | | } |
| | | |
| | | // 待办 |
| | |
| | | binding.btnRenew.setOnClickListener { |
| | | // Toast.makeText(context, "VIP续费功能开发中", Toast.LENGTH_SHORT).show() |
| | | // 跳转到vipActivity |
| | | val intent = Intent(requireContext(), VipActivity::class.java) |
| | | startActivity(intent) |
| | | //2025-04-24 取消续费跳转操作 |
| | | // val intent = Intent(requireContext(), VipActivity::class.java) |
| | | // startActivity(intent) |
| | | Toast.makeText(context, "免费体验,无需续费", Toast.LENGTH_SHORT).show() |
| | | } |
| | | |
| | | binding.cardVip.setOnClickListener { |
| | | // Toast.makeText(context, "VIP续费功能开发中", Toast.LENGTH_SHORT).show() |
| | | // 跳转到vipActivity |
| | | val intent = Intent(requireContext(), VipActivity::class.java) |
| | | startActivity(intent) |
| | | // val intent = Intent(requireContext(), VipActivity::class.java) |
| | | // startActivity(intent) |
| | | Toast.makeText(context, "免费体验,无需续费", Toast.LENGTH_SHORT).show() |
| | | } |
| | | |
| | | // 设置按钮点击 |
| | |
| | | val userInfo = response.data |
| | | |
| | | // 本地保存我的邀请码 |
| | | //PreferencesManager.setInviteCode(userInfo.intervialcode); |
| | | PreferencesManager.setInviteCode(userInfo.intervialcode); |
| | | // 设置头像 |
| | | Glide.with(this) |
| | | .load(userInfo.cover) |