YanXue.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 v-for="item in research" :key="item.id" class="yx_box" @click="application(item.id)">
  5. <view style="position: absolute; left: 6rpx; top: 6rpx">
  6. <image style="width: 160rpx; height: 240rpx" :src="item.image"></image>
  7. </view>
  8. <view class="info">
  9. <view class="wwd">{{ item.title }}</view>
  10. <view class="time">活动时间:{{ (item.start_time || "").split(" ")[0] || "" }}</view>
  11. </view>
  12. <view class="baoming">
  13. <text>报名</text>
  14. <image style="margin-left: 10rpx; width: 32rpx; height: 32rpx" src="/static/img/arrow-right-line.png"></image>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. let that;
  21. export default {
  22. data() {
  23. return {
  24. research: []
  25. };
  26. },
  27. onLoad() {
  28. that = this;
  29. this.activityLists();
  30. },
  31. methods: {
  32. // 文物研学
  33. activityLists() {
  34. this.$api.activityLists({ main_body_id: 1, type: 1 }, function (res) {
  35. that.research = res.data;
  36. });
  37. },
  38. application(id) {
  39. uni.navigateTo({
  40. url: '/index_fenbao/HuoHuaLiYong/YanXue/XiangQing?id=' + id
  41. });
  42. }
  43. }
  44. };
  45. </script>
  46. <style>
  47. .box {
  48. width: 100%;
  49. padding-bottom: 50rpx;
  50. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xbg_2.png');
  51. background-size: 100% 100%;
  52. background-attachment: fixed;
  53. background-repeat: repeat-y;
  54. height: 100%;
  55. }
  56. .yx_box {
  57. position: relative;
  58. width: 670rpx;
  59. height: 252rpx;
  60. display: flex;
  61. align-items: center;
  62. /* keep children in a row and space for fixed button */
  63. margin: auto;
  64. margin-top: 34rpx;
  65. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/hh_item_bg.png');
  66. background-size: 100% 100%;
  67. }
  68. .info {
  69. margin-left: 200rpx;
  70. display: flex;
  71. flex-direction: column;
  72. flex: 1 1 auto;
  73. min-width: 0; /* allow text to shrink and ellipsis if needed */
  74. }
  75. .wwd {
  76. font-size: 28rpx;
  77. font-weight: 400;
  78. color: #444444;
  79. line-height: 52rpx;
  80. white-space: wrap;
  81. /* 限制两行 */
  82. display: -webkit-box;
  83. -webkit-line-clamp: 3;
  84. -webkit-box-orient: vertical;
  85. overflow: hidden;
  86. }
  87. .time {
  88. font-size: 28rpx;
  89. color: rgba(68, 68, 68, 0.6);
  90. line-height: 44rpx;
  91. margin-top: 12rpx;
  92. white-space: nowrap;
  93. overflow: hidden;
  94. text-overflow: ellipsis;
  95. }
  96. .baoming {
  97. display: flex;
  98. flex: 0 0 116rpx; /* do not grow/shrink, fixed basis */
  99. width: 116rpx;
  100. height: 56rpx;
  101. line-height: 56rpx;
  102. justify-content: center;
  103. align-items: center;
  104. margin: 0 20rpx;
  105. font-size: 28rpx;
  106. color: #eba869;
  107. border: 2rpx solid #eba869;
  108. box-sizing: border-box;
  109. overflow: hidden;
  110. white-space: nowrap;
  111. border-radius: 8rpx;
  112. }
  113. </style>