countdown.vue 712 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <view class="time-box">
  3. 交易取消{{s}}s
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data(){
  9. return{
  10. s:360
  11. }
  12. },
  13. mounted() {
  14. this.timeFun()
  15. },
  16. methods:{
  17. timeFun(){
  18. let timeServer = setInterval(() => {
  19. --this.s;
  20. if (this.s <= 0) {
  21. clearInterval(timeServer);
  22. window.localStorage.clear()
  23. uni.clearStorageSync()
  24. uni.reLaunch({
  25. url:'/pages/login/index'
  26. })
  27. }
  28. }, 1000);
  29. },
  30. },
  31. }
  32. </script>
  33. <style scoped lang="scss">
  34. .time-box{
  35. width: 223rpx;
  36. height: 57rpx;
  37. line-height: 57rpx;
  38. text-align: center;
  39. border-radius: 104rpx;
  40. border: 2rpx solid #CCCCCC;
  41. font-size: 28rpx;
  42. color: #666;
  43. }
  44. </style>