NavBarItem.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="menu-item" @click="$emit('click', data)">
  3. <image class="menu-icon" :src="data.picUrl ? common.seamingImgUrl(data.picUrl) : data.iconUrl"></image>
  4. <text>{{ data.storeName }}</text>
  5. <img v-if="data.tag && data.tag === 'phone-bill'" class="phone-bil" :src="data.tagUrl" alt="">
  6. <img v-else-if="data.tag && data.tag === 'fix'" class="fix" :src="data.tagUrl" alt="">
  7. <img v-else-if="data.tag && data.tag === 'sheng'" class="sheng" :src="data.tagUrl" alt="">
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. name: 'NavBarItem',
  13. props: {
  14. data: {
  15. type: Object,
  16. required: true
  17. }
  18. },
  19. data() {
  20. return {
  21. }
  22. },
  23. methods: {
  24. }
  25. }
  26. </script>
  27. <style lang="less" scoped>
  28. .menu-item {
  29. position: relative;
  30. display: flex;
  31. align-items: center;
  32. justify-content: center;
  33. flex-direction: column;
  34. width: 20%;
  35. font-size: 28upx;
  36. color: #222229;
  37. .menu-icon {
  38. width: 80upx;
  39. height: 80upx;
  40. margin-bottom: 15upx;
  41. }
  42. .phone-bil {
  43. position: absolute;
  44. width: 80upx;
  45. height: 28upx;
  46. top: -4upx;
  47. right: -26upx;
  48. }
  49. .fix {
  50. position: absolute;
  51. width: 38upx;
  52. height: 38upx;
  53. top: -14upx;
  54. right: 14upx;
  55. }
  56. .sheng {
  57. position: absolute;
  58. width: 42upx;
  59. height: 42upx;
  60. top: -14upx;
  61. right: -14upx;
  62. }
  63. }
  64. </style>