app-no-goods.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="app-no-goods dir-top-nowrap main-center cross-center bor" :class="{'fixed':fixed}" :style="{'backgroundColor': background}">
  3. <image class="icon" v-if="icon" :src="icon"></image>
  4. <image class="icon" v-if="is_image === 0 && !icon" src="https://shop.9026.com/web/statics/img/mall/static/no-goods.png"></image>
  5. <image class="icon" v-else-if="is_image === 1 && !icon" src="https://shop.9026.com/web/statics/img/mall/static/order-empty.png"></image>
  6. <text class="text" :style="{'color': color}">{{title}}</text>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: "app-no-goods",
  12. props: {
  13. fixed:{
  14. type:Boolean,
  15. default(){
  16. return false
  17. }
  18. },
  19. background: {
  20. type: String,
  21. default() {
  22. return '#ffffff';
  23. }
  24. },
  25. color: {
  26. type: String,
  27. default() {
  28. return '#666666';
  29. }
  30. },
  31. title: {
  32. type: String,
  33. default() {
  34. return '没有任何商品哦~';
  35. }
  36. },
  37. icon:{
  38. type:String,
  39. default(){
  40. return ''
  41. }
  42. },
  43. is_image: {
  44. type: Number,
  45. default() {
  46. return 0;
  47. }
  48. },
  49. },
  50. }
  51. </script>
  52. <style scoped lang="scss">
  53. .bor{
  54. border-top: 20rpx;
  55. overflow: hidden;
  56. }
  57. .app-no-goods {
  58. width: 100%;
  59. height: #{400upx};
  60. .icon {
  61. width: #{240upx};
  62. height: #{240upx};
  63. }
  64. .text {
  65. font-size: #{24upx};
  66. line-height: 1;
  67. margin-top: #{25upx};
  68. }
  69. }
  70. .fixed{
  71. position: fixed;top: 37%;left:50%;transform: translate(-50%,-50%);
  72. }
  73. </style>