success.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="fetchPacket">
  3. <view class="nav-box">
  4. <text>取件成功</text>
  5. <view class="countdown">{{timer}}s</view>
  6. </view>
  7. <view class="header">
  8. <image class="icon" :src="require('../../static/images/icon-success-fetch.png')"></image>
  9. <view class="label">主人取件成功啦~</view>
  10. <view class="message">记得把格口关上哦~</view>
  11. <view class="btn" @click="toIndexPage">返回主页</view>
  12. </view>
  13. <view class="center-banner">
  14. <swiper style="height: 40vw;" autoplay>
  15. <block v-for="(item, i) in centerBanner" :key="i">
  16. <swiper-item>
  17. <image class="banner-img" :src="item.image" mode="aspectFill"></image>
  18. </swiper-item>
  19. </block>
  20. </swiper>
  21. </view>
  22. <view class="btn-box">
  23. <view class="btn" @click="bagStorage">
  24. <image class="bg" :src="require('../../static/images/icon-storage-bg.png')"></image>
  25. <image class="icon" :src="require('../../static/images/icon-storage.png')"></image>
  26. <view class="label">存物</view>
  27. </view>
  28. <view class="btn" @click="fetchPacket">
  29. <image class="bg" :src="require('../../static/images/icon-fetch-bg.png')"></image>
  30. <image class="icon" :src="require('../../static/images/icon-fetch.png')"></image>
  31. <view class="label">取物</view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. let timer;
  38. export default {
  39. data() {
  40. return {
  41. centerBanner: [],
  42. date: {},
  43. timer: 60
  44. }
  45. },
  46. onLoad() {
  47. this.countdown()
  48. this.getCenterBanner();
  49. },
  50. onHide() {
  51. clearInterval(timer);
  52. },
  53. methods: {
  54. countdown() {
  55. const $this = this;
  56. timer = setInterval(function() {
  57. $this.timer--
  58. if ($this.timer == 0) {
  59. clearInterval(timer);
  60. uni.reLaunch({
  61. url: '/pages/index/index'
  62. });
  63. return;
  64. }
  65. }, 1000)
  66. },
  67. getCenterBanner() {
  68. this.$api.bannerList({
  69. type: 3
  70. }).then(res => {
  71. console.log(res);
  72. this.centerBanner = res.data;
  73. })
  74. },
  75. bagStorage() {
  76. uni.redirectTo({
  77. url: '/pages/bagStorage/login'
  78. })
  79. },
  80. fetchPacket() {
  81. uni.redirectTo({
  82. url: '/pages/fetchPacket/index'
  83. })
  84. },
  85. toIndexPage() {
  86. uni.reLaunch({
  87. url: '/pages/index/index'
  88. });
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="scss">
  94. .fetchPacket {
  95. min-height: 100vh;
  96. background-color: #F4F4F4;
  97. .nav-box {
  98. position: relative;
  99. display: flex;
  100. align-items: center;
  101. justify-content: center;
  102. height: 9.8vw;
  103. font-weight: 500;
  104. color: #666666;
  105. font-size: 3.8vw;
  106. .countdown {
  107. position: absolute;
  108. // top: 3.8vw;
  109. right: 5.2vw;
  110. color: #666666;
  111. font-size: 3.3vw;
  112. }
  113. }
  114. .header {
  115. display: flex;
  116. align-items: center;
  117. flex-direction: column;
  118. padding: 11.3vw 0 4.6vw;
  119. background-color: #FFFFFF;
  120. .icon {
  121. width: 33.8vw;
  122. height: 11.3vw;
  123. }
  124. .label {
  125. margin-top: 5.2vw;
  126. font-weight: 500;
  127. font-size: 4.2vw;
  128. line-height: 4.2vw;
  129. }
  130. .message {
  131. margin-top: 1.9vw;
  132. color: #999999;
  133. font-size: 2.9vw;
  134. }
  135. .btn {
  136. display: flex;
  137. align-items: center;
  138. justify-content: center;
  139. width: 22.9vw;
  140. height: 7.1vw;
  141. border-radius: 1.7vw;
  142. background-color: #FDD002;
  143. margin-top: 5.4vw;
  144. font-size: 2.5vw;
  145. }
  146. }
  147. .center-banner {
  148. // width: 100vw;
  149. padding: 2.5vw 2.1vw;
  150. .banner-img {
  151. width: calc(100vw - 4.2vw);
  152. height: 40vw;
  153. border-radius: .8vw;
  154. vertical-align: top;
  155. }
  156. }
  157. .btn-box {
  158. display: flex;
  159. align-items: center;
  160. justify-content: space-between;
  161. padding: 0 2.1vw;
  162. .btn {
  163. position: relative;
  164. display: flex;
  165. align-items: center;
  166. flex-direction: column;
  167. justify-content: center;
  168. width: 46.7vw;
  169. height: 55.8vw;
  170. .bg {
  171. position: absolute;
  172. top: 0;
  173. width: 100%;
  174. height: 100%;
  175. }
  176. .icon {
  177. position: relative;
  178. width: 19.2vw;
  179. height: 17.3vw;
  180. margin-bottom: 4.2vw;
  181. }
  182. .label {
  183. position: relative;
  184. color: #182B10;
  185. font-size: 6.3vw;
  186. }
  187. }
  188. }
  189. }
  190. </style>