IndexOrderItem.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view class="div" @click="onclick()">
  3. <image mode="aspectFit" class="img order-item-icon" :src="src" />
  4. <label class="item-title order-item-title">{{title}}</label>
  5. <text class="span number" v-if="orderNumber == 0 ? '': orderNumber ">{{ orderNumber }}</text>
  6. </view>
  7. </template>
  8. <script>
  9. import { mapState, mapMutations } from 'vuex'
  10. export default {
  11. props: {
  12. src: {
  13. type: String
  14. },
  15. title: {
  16. type: String
  17. },
  18. testAttr: {
  19. type: String
  20. },
  21. id: {
  22. default: ''
  23. },
  24. orderNumber: {
  25. type: Number,
  26. default: 0
  27. }
  28. },
  29. data () {
  30. return {
  31. isEmpty: false
  32. }
  33. },
  34. created () {
  35. },
  36. methods: {
  37. onclick () {
  38. this.$emit('onclick')
  39. },
  40. }
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .order-item {
  45. display: flex;
  46. flex-direction: column;
  47. justify-content: flex-start;
  48. align-items: center;
  49. }
  50. .item-title {
  51. font-size:$subFontSize;
  52. color: #333;
  53. }
  54. .order-item-icon {
  55. width: 1.4rem;
  56. height: 1.4rem;
  57. font-size:1.3rem;
  58. margin-top:0.8rem;
  59. }
  60. .order-item-title {
  61. margin-top:0.4rem;
  62. }
  63. .span.number {
  64. width:0.8rem;
  65. height:0.8rem;
  66. line-height:0.8rem;
  67. margin-top:-2.8rem;
  68. margin-left:0.8rem;
  69. background: $primaryColor;
  70. border-radius:50%;
  71. font-size:$h6;
  72. text-align: center;
  73. color: RGBA(255, 255, 255, 1);
  74. font-weight: normal;
  75. z-index: 2;
  76. }
  77. </style>