graceFullLoading.vue 1.7 KB

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