Status.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view class="container flex-center">
  3. <view class="no-pos flex-center" >
  4. <image :src="`${assetsUrl}status-no-data.png`" mode="aspectFit" class="no-pos-img" v-if="type==='noData'"></image>
  5. <image :src="`${assetsUrl}status-authing.png`" mode="aspectFit" class="no-pos-img" v-else-if="type==='authing'"></image>
  6. <image :src="`${assetsUrl}status-deleted.png`" mode="aspectFit" class="no-pos-img" v-else-if="type==='deleted'"></image>
  7. <image :src="`${assetsUrl}status-frozen.png`" mode="aspectFit" class="no-pos-img" v-else-if="type==='frozen'"></image>
  8. <image :src="`${assetsUrl}status-no-msg.png`" mode="aspectFit" class="no-pos-img" v-else-if="type==='noMsg'"></image>
  9. <image :src="`${assetsUrl}status-no-pos.png`" mode="aspectFit" class="no-pos-img" v-else-if="type==='noPos'"></image>
  10. <image :src="`${assetsUrl}status-no-net.png`" mode="aspectFit" class="no-pos-img" v-else-if="type==='noNet'"></image>
  11. <text class="no-pos-text font24 fw400" v-if="text">{{text}}</text>
  12. <view class="no-pos-btn font24 fw400" @click="btnClick" v-if="btnText">
  13. {{btnText}}
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. /**
  20. * "noData":无数据,
  21. * "noNet":无网络
  22. * "authing":审核中
  23. * "deleted":已删除
  24. * "frozen":已冻结
  25. * "noMsg":无消息
  26. * "noPos":无定位
  27. */
  28. export default {
  29. name:"Status",
  30. props:{
  31. type:{
  32. type:String,
  33. default:"noData"
  34. },
  35. text:{
  36. type:String,
  37. default:""
  38. },
  39. btnText:{
  40. type:String,
  41. default:""
  42. }
  43. },
  44. data() {
  45. return {
  46. assetsUrl: this.$util.assetsUrl,
  47. };
  48. },
  49. methods:{
  50. btnClick(){
  51. this.$emit('btnEvent');
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .container{
  58. width: 100%;
  59. height: 500rpx;
  60. .no-pos{
  61. flex-direction: column;
  62. .no-pos-img{
  63. width: 400rpx;
  64. height: 400rpx;
  65. }
  66. .no-pos-text{
  67. color: $fontcolor3;
  68. margin-top: -30rpx;
  69. }
  70. .no-pos-btn{
  71. width: 136rpx;
  72. height: 48rpx;
  73. background: $primary;
  74. border-radius: 24rpx;
  75. line-height: 48rpx;
  76. text-align: center;
  77. color: $fontcolor5;
  78. margin-top: 50rpx;
  79. }
  80. }
  81. }
  82. </style>