| | |
| | | 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 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() |
| | | } |
| | | } |
| | | |
| | | // 待办 |