edit-child.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. // onShow 可能重复触发,且与按钮的 redirectTo 叠加时会并发发起跳转,
  15. // 让框架对已销毁的 webview 调用 routeDone,报
  16. // "routeDone with a webviewId N is not found"。统一走一次性守卫。
  17. this.redirectOnce()
  18. },
  19. methods: {
  20. redirectOnce() {
  21. if (this._redirected) return
  22. this._redirected = true
  23. uni.redirectTo({ url: '/pages/profile-extra/family-members' })
  24. },
  25. goToFamilyMembers() {
  26. this.redirectOnce()
  27. }
  28. }
  29. }
  30. </script>
  31. <style scoped>
  32. .redirect-container {
  33. display: flex;
  34. justify-content: center;
  35. align-items: center;
  36. min-height: 100vh;
  37. background: #f5f5f5;
  38. padding: 40rpx;
  39. }
  40. .redirect-card {
  41. background: #fff;
  42. border-radius: 20rpx;
  43. padding: 60rpx 40rpx;
  44. text-align: center;
  45. width: 100%;
  46. }
  47. .redirect-icon {
  48. font-size: 80rpx;
  49. display: block;
  50. margin-bottom: 24rpx;
  51. }
  52. .redirect-title {
  53. font-size: 32rpx;
  54. font-weight: bold;
  55. color: #333;
  56. display: block;
  57. margin-bottom: 16rpx;
  58. }
  59. .redirect-desc {
  60. font-size: 28rpx;
  61. color: #666;
  62. display: block;
  63. margin-bottom: 40rpx;
  64. }
  65. .redirect-btn {
  66. background: #07c160;
  67. color: #fff;
  68. border-radius: 44rpx;
  69. font-size: 30rpx;
  70. padding: 20rpx 60rpx;
  71. }
  72. </style>