app-my-service.vue 2.9 KB

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