myRenewOk.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="myRenewOk_main">
  3. <view class="myRenewOk_main-content">
  4. <image src="../../../static/bg3.png" mode=""></image>
  5. <view class="myRenewOk_main-text">
  6. 更新成功~
  7. <view class="myRenewOk_main-img">
  8. <image src="../../../static/home-1.png" mode=""></image>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="myRenewOk_main-time">
  13. {{countDown}}s 后返回
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. countDown: 10
  22. };
  23. },
  24. methods: {
  25. countDownFunc() {
  26. let count = this.countDown;
  27. if (count > 0) {
  28. this.timerId = setTimeout(() => {
  29. count--;
  30. this.countDown = count;
  31. this.countDownFunc();
  32. }, 1000);
  33. } else {
  34. // uni.navigateTo({
  35. // // url: `/pages/my/myRenew/myRenew?type=1`,
  36. // })
  37. uni.switchTab({
  38. url: "/pages/my/my"
  39. })
  40. // uni.navigateBack({
  41. // delta: 1
  42. // });
  43. // console.log(22);
  44. }
  45. }
  46. },
  47. onLoad() {
  48. this.countDownFunc()
  49. },
  50. onUnload() {
  51. // 清除定时器
  52. if (this.timerId) {
  53. clearTimeout(this.timerId);
  54. }
  55. },
  56. }
  57. </script>
  58. <style lang="scss">
  59. .myRenewOk_main {
  60. width: 100%;
  61. box-sizing: border-box;
  62. padding: 40px 0px;
  63. }
  64. .myRenewOk_main-content {
  65. width: 100%;
  66. height: 530px;
  67. image {
  68. width: 100%;
  69. height: 100%;
  70. object-fit: cover;
  71. }
  72. .myRenewOk_main-text {
  73. position: fixed;
  74. top: 170px;
  75. height: 180px;
  76. width: 100%;
  77. display: flex;
  78. flex-direction: column;
  79. align-items: center;
  80. justify-content: space-between;
  81. color: #1677FF;
  82. font-weight: 700;
  83. font-size: 24px;
  84. .myRenewOk_main-img {
  85. width: 120px;
  86. height: 120px;
  87. image {
  88. width: 100%;
  89. height: 100%;
  90. object-fit: cover;
  91. }
  92. }
  93. }
  94. // width: 100%;
  95. // height: 520px;
  96. // background-color: #fff;
  97. // opacity: 0.7;
  98. // border: 1px solid #fff;
  99. // border-radius: 20px;
  100. }
  101. .myRenewOk_main-time {
  102. width: 100%;
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. color: #57597C99;
  107. font-weight: 500;
  108. font-size: 14px;
  109. }
  110. </style>