app-my-service.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="app-view">
  3. <view class="app-my-service" :class="[!margin?'no-margin':'', !round?'no-round':'',]">
  4. <view class="title" v-if="title">{{title}}</view>
  5. <view class="list" :class="[listStyle]">
  6. <view class="item" v-for="(item, index) in menus" :key="index">
  7. <app-jump-button form
  8. :url="item.link_url"
  9. :open_type="item.open_type"
  10. :item="item"
  11. :arrangement="`${menu_style === '1' ? 'row' : menu_style === '2' ? 'column' : ''}`">
  12. <view style="width: 100%"
  13. class="item-container"
  14. :class="[
  15. menu_style=='1'?'dir-left-nowrap cross-center':'',
  16. menu_style=='2'?'dir-top-nowrap cross-center':'',
  17. ]">
  18. <view class="box-grow-0">
  19. <image :src="item.icon_url" class="icon"></image>
  20. </view>
  21. <view class="box-grow-1" style="max-width: 100%">
  22. <view class="name">{{item.name}}</view>
  23. </view>
  24. <view class="box-grow-0" v-if="menu_style=='1'">
  25. <image src="/static/image/icon/arrow-right.png" class="arrow"></image>
  26. </view>
  27. </view>
  28. </app-jump-button>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. name: "app-my-service",
  37. props: {
  38. title: {
  39. default: null,
  40. },
  41. menus: Array,
  42. menu_style: String,
  43. margin: {
  44. type: Boolean,
  45. default: false,
  46. },
  47. round: {
  48. type: Boolean,
  49. default: false,
  50. },
  51. },
  52. computed: {
  53. listStyle() {
  54. if (this.menu_style == 1) return 'row';
  55. if (this.menu_style == 2) return 'grid dir-left-wrap';
  56. return '';
  57. },
  58. },
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .app-my-service.no-margin {
  63. width: 100%;
  64. margin: 0 auto;
  65. box-shadow: none;
  66. }
  67. .app-my-service.no-round {
  68. border-radius: 0;
  69. }
  70. .app-my-service {
  71. width: #{702rpx};
  72. border-radius: #{16rpx};
  73. margin: #{24rpx} auto;
  74. box-shadow: 0 0 #{8rpx} rgba(0, 0, 0, .05);
  75. background: #fff;
  76. .title {
  77. padding: #{32rpx} #{32rpx} #{16rpx};
  78. }
  79. .list {
  80. .item {
  81. .icon {
  82. width: #{50rpx};
  83. height: #{50rpx};
  84. display: block;
  85. }
  86. .arrow {
  87. width: #{12rpx};
  88. height: #{22rpx};
  89. }
  90. }
  91. }
  92. .list.row {
  93. .item-container {
  94. padding: #{20rpx} #{32rpx};
  95. }
  96. .icon {
  97. margin-right: #{16rpx};
  98. }
  99. }
  100. .list.grid {
  101. .item {
  102. width: 25%;
  103. .icon {
  104. margin-bottom: #{28rpx};
  105. }
  106. .name {
  107. padding: 0 #{12rpx};
  108. font-size: $uni-font-size-weak-one;
  109. color: $uni-general-color-one;
  110. white-space: nowrap;
  111. overflow: hidden;
  112. text-overflow: ellipsis;
  113. line-height: 1;
  114. }
  115. }
  116. .item-container {
  117. padding: #{24rpx} 0;
  118. }
  119. }
  120. }
  121. </style>