xiangQing.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" title="精彩内容" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
  4. <view style="width: 92%; margin: auto">
  5. <u-swiper
  6. @click="clickImg"
  7. :list="list.images"
  8. imgMode="aspectFill"
  9. :height="160"
  10. :indicator="true"
  11. radius="5"
  12. :autoplay="true"
  13. :circular="true"
  14. indicatorStyle="bottom: 10px"
  15. indicatorMode="dot"
  16. indicatorActiveColor="#fff"
  17. indicatorInactiveColor="rgba(255, 255, 255, 0.35)"
  18. ></u-swiper>
  19. </view>
  20. <view class="" style="width: 92%; margin: auto">
  21. <view style="display: flex; justify-content: space-between; align-items: center; margin-top: 30rpx">
  22. <view lines="1" class="text_4">详情介绍</view>
  23. <view class="text_25">{{ list.publish_at }}</view>
  24. </view>
  25. <view v-if="list.content != null" class="text_5">
  26. <u-parse :content="list.content"></u-parse>
  27. </view>
  28. <view v-else class="">
  29. <u-empty text="暂无介绍" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. let that;
  36. export default {
  37. data() {
  38. return {
  39. list: {}
  40. };
  41. },
  42. onLoad(o) {
  43. that = this;
  44. this.getContentDetail(o.id);
  45. },
  46. methods: {
  47. getContentDetail(id) {
  48. this.$api.getContentDetail({ main_body_id: 1, id: id }, function (res) {
  49. console.log(res, '风采详情');
  50. if (res.code == 1) {
  51. that.list = res.data;
  52. }
  53. });
  54. },
  55. // 图片预览
  56. clickImg(index) {
  57. // console.log(index, 555);
  58. var imgs = this.list.images;
  59. let temp = [imgs[index]];
  60. // console.log('temp', temp);
  61. uni.previewImage({
  62. urls: imgs,
  63. current: index,
  64. success: function (data) {
  65. console.log(data);
  66. },
  67. fail: function (err) {
  68. console.log(err.errMsg);
  69. }
  70. });
  71. }
  72. }
  73. };
  74. </script>
  75. <style>
  76. .box {
  77. width: 100%;
  78. padding-bottom: 50rpx;
  79. background-image: url('https://huli-app.wenlvti.net/app_static/wuyuan/static/shouhu/wyj-feiyi3-001.png');
  80. background-size: 100% 100%;
  81. background-attachment: fixed;
  82. background-repeat: repeat-y;
  83. min-height: 100%;
  84. height: auto;
  85. /* background-color: #fff9e9; */
  86. }
  87. .text_4 {
  88. width: 112rpx;
  89. height: 28rpx;
  90. overflow-wrap: break-word;
  91. color: rgba(49, 37, 32, 1);
  92. font-size: 32rpx;
  93. font-family: SourceHanSansCN-Bold;
  94. font-weight: 700;
  95. text-align: left;
  96. white-space: nowrap;
  97. line-height: 28rpx;
  98. }
  99. .text_5 {
  100. font-size: 28rpx;
  101. font-family: SourceHanSansCN-Regular;
  102. font-weight: normal;
  103. text-align: justifyLeft;
  104. line-height: 48rpx;
  105. margin: 44rpx 0 0 16rpx;
  106. text-indent: 2rem;
  107. }
  108. /deep/.u-swiper-indicator__wrapper__dot--active {
  109. width: 5px !important;
  110. }
  111. .text_25 {
  112. font-size: 26rpx;
  113. color: #727070;
  114. margin-top: 10rpx;
  115. font-weight: 400;
  116. }
  117. </style>