index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <!-- 标题文本 -->
  3. <view class="diy-title" :style="{ padding: `${itemStyle.paddingY * 2}rpx 30rpx`, background: itemStyle.background }">
  4. <div class="title-content">
  5. <!-- 标题文字 -->
  6. <div class="title">
  7. <text
  8. :style="{ color: itemStyle.titleTextColor, fontSize: `${params.titleFontSize * 2}rpx`, fontWeight: params.titleFontWeight }">{{ params.title }}</text>
  9. </div>
  10. <!-- 查看更多 -->
  11. <div v-if="params.more.enable" class="more-content" :style="{ color: itemStyle.moreTextColor }" @click="onLink(params.more.link)">
  12. <text class="more-text">{{ params.more.text }}</text>
  13. <text v-if="params.more.enableIcon" class="more-icon">
  14. <text class="iconfont icon-arrow-right"></text>
  15. </text>
  16. </div>
  17. </div>
  18. <!-- 描述文字 -->
  19. <div class="desc-content">
  20. <text
  21. :style="{ color: itemStyle.descTextColor, fontSize: `${params.descFontSize * 2}rpx`, fontWeight: params.descFontWeight }">{{ params.desc }}</text>
  22. </div>
  23. </view>
  24. </template>
  25. <script>
  26. import mixin from '../mixin'
  27. export default {
  28. /**
  29. * 组件的属性列表
  30. * 用于组件自定义设置
  31. */
  32. props: {
  33. itemStyle: Object,
  34. params: Object
  35. },
  36. mixins: [mixin],
  37. /**
  38. * 组件的方法列表
  39. * 更新属性和数据的方法与更新页面数据的方法类似
  40. */
  41. methods: {
  42. }
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. .diy-title {
  47. padding: 10rpx 30rpx;
  48. .title-content {
  49. display: flex;
  50. justify-content: space-between;
  51. .title {
  52. color: #323233;
  53. font-size: 28rpx;
  54. flex: 1;
  55. }
  56. .more-content {
  57. color: #969799;
  58. font-size: 24rpx;
  59. margin-left: 40rpx;
  60. }
  61. }
  62. .desc-content {
  63. margin-top: 16rpx;
  64. color: #969799;
  65. font-size: 24rpx;
  66. }
  67. }
  68. </style>