Service.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view v-if="list.length" class="service-wrapper">
  3. <!-- 服务简述 -->
  4. <view class="service-simple" @click="handlePopup">
  5. <view class="s-list">
  6. <view class="s-item" v-for="(item, index) in list" :key="index">
  7. <text class="item-icon iconfont icon-fuwu"></text>
  8. <text class="item-val">{{ item.name }}</text>
  9. </view>
  10. </view>
  11. <!-- 扩展箭头 -->
  12. <view class="s-arrow f-26 col-9 t-r">
  13. <text class="iconfont icon-arrow-right"></text>
  14. </view>
  15. </view>
  16. <!-- 详情内容弹窗 -->
  17. <u-popup v-model="showPopup" mode="bottom" :closeable="true" :border-radius="26">
  18. <view class="service-content">
  19. <view class="title">服务</view>
  20. <scroll-view class="content-scroll" :scroll-y="true">
  21. <view class="s-list clearfix">
  22. <view class="s-item" v-for="(item, index) in list" :key="index">
  23. <text class="item-icon iconfont icon-fuwu"></text>
  24. <view class="item-val">{{ item.name }}</view>
  25. <view class="item-summary">{{ item.summary }}</view>
  26. </view>
  27. </view>
  28. </scroll-view>
  29. </view>
  30. </u-popup>
  31. </view>
  32. </template>
  33. <script>
  34. import * as ServiceApi from '@/api/goods/service'
  35. export default {
  36. props: {
  37. // 商品ID
  38. goodsId: {
  39. type: Number,
  40. default: null
  41. }
  42. },
  43. data() {
  44. return {
  45. // 正在加载
  46. isLoading: true,
  47. // 显示详情内容弹窗
  48. showPopup: false,
  49. // 服务列表数据
  50. list: []
  51. }
  52. },
  53. created() {
  54. // 获取商品服务列表
  55. this.getServiceList()
  56. },
  57. methods: {
  58. // 获取商品服务列表
  59. getServiceList() {
  60. const app = this
  61. app.isLoading = true
  62. ServiceApi.list(app.goodsId)
  63. .then(result => app.list = result.data.list)
  64. .finally(() => app.isLoading = false)
  65. },
  66. // 显示弹窗
  67. handlePopup() {
  68. this.showPopup = !this.showPopup
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .service-wrapper {
  75. min-height: 24rpx;
  76. margin-bottom: -24rpx;
  77. }
  78. // 服务简述
  79. .service-simple {
  80. padding: 24rpx 30rpx;
  81. display: flex;
  82. align-items: center;
  83. .s-list {
  84. flex: 1;
  85. margin-left: -15rpx;
  86. }
  87. .s-item {
  88. float: left;
  89. font-size: 26rpx;
  90. margin: 8rpx 15rpx;
  91. .item-icon {
  92. color: #FA2209;
  93. }
  94. .item-val {
  95. margin-left: 12rpx;
  96. }
  97. }
  98. }
  99. // 服务详细内容
  100. .service-content {
  101. padding: 24rpx;
  102. .title {
  103. font-size: 30rpx;
  104. margin-bottom: 50rpx;
  105. font-weight: bold;
  106. text-align: center;
  107. }
  108. .content-scroll {
  109. min-height: 400rpx;
  110. max-height: 760rpx;
  111. }
  112. .s-list {
  113. padding: 0 30rpx 0 80rpx;
  114. }
  115. .s-item {
  116. position: relative;
  117. margin-bottom: 60rpx;
  118. .item-icon {
  119. position: absolute;
  120. top: 6rpx;
  121. left: -50rpx;
  122. color: #FA2209;
  123. }
  124. .item-val {
  125. font-size: 28rpx;
  126. }
  127. .item-summary {
  128. font-size: 26rpx;
  129. margin-top: 20rpx;
  130. color: #6d6d6d;
  131. }
  132. }
  133. }
  134. </style>