children.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="redirect-container">
  3. <view class="redirect-card">
  4. <text class="redirect-icon">👪</text>
  5. <text class="redirect-title">已将孩子管理整合到家庭成员</text>
  6. <text class="redirect-desc">孩子的信息请在「家庭成员」中添加和管理</text>
  7. <button class="redirect-btn" @click="goToFamilyMembers">前往家庭成员</button>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. onShow() {
  14. // 自动跳转到家庭成员页面。
  15. // onShow 可能重复触发,且与按钮的 redirectTo 叠加时会并发发起跳转,
  16. // 让框架对已销毁的 webview 调用 routeDone,报
  17. // "routeDone with a webviewId N is not found"。统一走一次性守卫。
  18. this.redirectOnce()
  19. },
  20. methods: {
  21. redirectOnce() {
  22. if (this._redirected) return
  23. this._redirected = true
  24. uni.redirectTo({ url: '/pages/profile-extra/family-members' })
  25. },
  26. goToFamilyMembers() {
  27. this.redirectOnce()
  28. }
  29. }
  30. }
  31. </script>
  32. <style scoped>
  33. .redirect-container {
  34. display: flex;
  35. justify-content: center;
  36. align-items: center;
  37. min-height: 100vh;
  38. background: #f5f5f5;
  39. padding: 40rpx;
  40. }
  41. .redirect-card {
  42. background: #fff;
  43. border-radius: 20rpx;
  44. padding: 60rpx 40rpx;
  45. text-align: center;
  46. width: 100%;
  47. }
  48. .redirect-icon {
  49. font-size: 80rpx;
  50. display: block;
  51. margin-bottom: 24rpx;
  52. }
  53. .redirect-title {
  54. font-size: 32rpx;
  55. font-weight: bold;
  56. color: #333;
  57. display: block;
  58. margin-bottom: 16rpx;
  59. }
  60. .redirect-desc {
  61. font-size: 28rpx;
  62. color: #666;
  63. display: block;
  64. margin-bottom: 40rpx;
  65. }
  66. .redirect-btn {
  67. background: #07c160;
  68. color: #fff;
  69. border-radius: 44rpx;
  70. font-size: 30rpx;
  71. padding: 20rpx 60rpx;
  72. }
  73. </style>