title.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="diy-notice pr"
  3. :style="{ padding: itemData.style.paddingTop + 'px' + ' 10px', background: itemData.style.background }"
  4. @click="gotoPages(item)">
  5. <view class="notice-icon pr" :style="{background: itemData.style.background }"
  6. v-if="itemData.params.show_icon=='yes'">
  7. <image :src="itemData.params.icon" mode="aspectFill"></image>
  8. </view>
  9. <text class="pr notice-text text-ellipsisss f38 fb"
  10. :style="{background: itemData.style.background, color: itemData.style.textColor }">
  11. {{ itemData.params.title }}
  12. </text>
  13. <view class="center-line"></view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {};
  20. },
  21. props: ['itemData'],
  22. created() {},
  23. methods: {
  24. /*跳转页面*/
  25. gotoPages(e) {
  26. this.gotoPage(e.linkUrl);
  27. }
  28. }
  29. };
  30. </script>
  31. <style>
  32. .diy-notice {
  33. display: flex;
  34. justify-content: center;
  35. align-items: center;
  36. }
  37. .diy-notice .notice-icon {
  38. width: 26px;
  39. height: 26px;
  40. background-color: #FFFFFF;
  41. padding: 0 10rpx;
  42. z-index: 1;
  43. }
  44. .diy-notice .notice-icon image {
  45. width: 100%;
  46. height: 100%;
  47. }
  48. .diy-notice .notice-text {
  49. overflow: hidden;
  50. white-space: nowrap;
  51. background-color: #FFFFFF;
  52. padding: 0 10rpx;
  53. z-index: 1;
  54. }
  55. .center-line{
  56. width: 490rpx;
  57. height: 2rpx;
  58. background-color: #c7c7c7;
  59. border-radius: 2rpx;
  60. position: absolute;
  61. left: 0;
  62. bottom: 0;
  63. top: 0;
  64. right: 0;
  65. margin: auto;
  66. z-index: 0;
  67. }
  68. </style>