graceFullLoading.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template name="graceFullLoading">
  2. <view class="grace-full-loading"
  3. :style="{
  4. background:background,
  5. height:graceFullLoading?'100%':'0px',
  6. opacity:graceFullLoading?1:0}"
  7. @tap.stop="stopFun" @touchmove.stop.prevent="stopFun">
  8. <view class="content">
  9. <view class="image"><image :src="logoUrl" mode="widthFix" :style="{width:size, height:size}"></image></view>
  10. <view class="text" :style="{fontSize:fontSize, color:textColor}">{{text}}</view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. name: "graceFullLoading",
  17. props: {
  18. graceFullLoading: {
  19. type : Boolean,
  20. default : false
  21. },
  22. logoUrl : {
  23. type : String,
  24. default : ""
  25. },
  26. text : {
  27. type : String,
  28. default : "Loading ..."
  29. },
  30. size : {
  31. type : String,
  32. default : "138rpx"
  33. },
  34. fontSize : {
  35. type : String,
  36. default : "22rpx"
  37. },
  38. textColor : {
  39. type : String,
  40. default : "#999999"
  41. },
  42. background : {
  43. type : String,
  44. default : 'rgba(255,255,255,1)'
  45. }
  46. },
  47. methods:{
  48. stopFun : function(){return false;}
  49. }
  50. }
  51. </script>
  52. <style scoped>
  53. @keyframes grace-fade{0%{opacity:0.6;} 25%{opacity:1;} 50%{opacity:0.6;} 75%{opacity:1;} 100%{opacity:0.6;}}
  54. .grace-full-loading{width:100%; background:#FFFFFF; position:fixed; z-index:9999; top:0; left:0; bottom:0; overflow:hidden;}
  55. .grace-full-loading .content{width:300rpx; height:auto; position:absolute; z-index:100; left:50%; top:50%; transform:translate(-50%, -50%); animation:grace-fade 3500ms infinite linear; opacity:0.6; padding:10rpx;}
  56. .grace-full-loading .image{text-align:center; font-size:0;}
  57. .grace-full-loading .image image{width:138rpx; height:138rpx; border-radius:138rpx;}
  58. .grace-full-loading .text{line-height:1.5em; font-size:22rpx; margin-top:6px; text-align:center;}
  59. </style>