index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <view class="box">
  3. <u-navbar title="厦门文物跑" :placeholder="true" bgColor="#ffe1b8" autoBack></u-navbar>
  4. <view class="ban">
  5. <view @click="goSignup" class="" style="margin-bottom: 30rpx">
  6. <u-swiper :list="bannerlist" imgMode="aspectFill" :height="150" :autoplay="true" :circular="true"></u-swiper>
  7. </view>
  8. <!-- 报名按钮 -->
  9. <view class="bm_box" @click="goSignup">
  10. <view class="">
  11. <view class="bm_js">文物跑,聆听历史的声音</view>
  12. <view class="bm_js2">跑出文化 跑出健康、跑出生态、跑出...</view>
  13. </view>
  14. <!-- <view class="goto">立即报名</view> -->
  15. </view>
  16. <!-- 简介 -->
  17. <view class="ld">活动简介</view>
  18. <view class="jj_box">
  19. 厦门文物跑活动旨在打造一场具有文化认同感的跑步之旅,号召公众关注及保护珍贵文物古迹,用脚步丈量城市历史,打造全民守护历史记忆的社会正能量。迎着第一缕曙光,从各自文物游线路起点出发,按照规划路线,跑..
  20. </view>
  21. <!-- 亮点 -->
  22. <view class="ld">活动亮点</view>
  23. <view class="list_box">
  24. <view @click="$common.navigateTo('/index_fenbao/XuanJiangYuan/xq_page?id=' + item.id)" class="list_item" v-for="item in activityList" :key="item">
  25. <img
  26. style="width: 100%; height: 200rpx; border-radius: 10rpx"
  27. :src="item.image"
  28. />
  29. <view class="item_tit">{{item.title}}</view>
  30. </view>
  31. </view>
  32. <!-- 优秀讲员 -->
  33. <view class="xjy" @click="gdxjyBtn">
  34. <view class="ld">优秀宣讲员</view>
  35. <view class="gd">更多</view>
  36. </view>
  37. <view class="list_box">
  38. <view @click="$common.navigateTo('/index_fenbao/XuanJiangYuan/xjy_XiangQing?id=' + item.id)" class="list_item" v-for="item in xuangjiangyuanList" :key="item">
  39. <img
  40. style="width: 100%; height: 200rpx; border-radius: 10rpx"
  41. :src="item.image"
  42. />
  43. <view class="item_name">{{ item.name }}</view>
  44. </view>
  45. </view>
  46. <!-- 优秀讲员 -->
  47. <view class="xjy" @click="activityReviewBtn">
  48. <view class="ld">精彩回顾</view>
  49. <view class="gd">更多</view>
  50. </view>
  51. <scroll-view scroll-x enable-flex class="scroll-view_H" type="list">
  52. <view @click="$common.navigateTo('/index_fenbao/XuanJiangYuan/activity-review-details?id=' + item.id)" class="goods-item" v-for="item in activityReviewList" :key="item">
  53. <image class="img" style="" :src="item.image" />
  54. <view style="margin-left: 20rpx">
  55. <view>{{item.title}}</view>
  56. <view class="gs_js">{{item.desc}}</view>
  57. </view>
  58. </view>
  59. </scroll-view>
  60. <!-- 底部logo -->
  61. <view class="btm_box">
  62. <view class="">
  63. <image src="/static/img/wx.png" class="btn_img" />
  64. <image src="/static/img/wx1.png" class="btn_img" />
  65. <image src="/static/img/wx2.png" class="btn_img" />
  66. </view>
  67. <view class="">
  68. @ 2025 厦门文物管家 保留所有权利
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. let that;
  76. export default {
  77. onLoad(option) {
  78. that = this;
  79. },
  80. onShow(option) {
  81. that.getActivityList();
  82. that.themeDetails();
  83. that.getActivityReviewList();
  84. that.getXuanjiangList();
  85. },
  86. data() {
  87. return {
  88. bannerlist: [],
  89. activityList: [],
  90. activityReviewList: [],
  91. xuangjiangyuanList: []
  92. };
  93. },
  94. /* 页面触底 */
  95. onReachBottom() {
  96. console.log('触底了');
  97. },
  98. methods: {
  99. themeDetails() {
  100. this.$api.activityThemeDetails(
  101. {
  102. id: 3
  103. },
  104. data => {
  105. if (data.code == 0) {
  106. that.$common.errorToShow(data.msg);
  107. return;
  108. } else {
  109. that.bannerlist = data.data.images;
  110. // console.log(that.bannerlist);
  111. }
  112. }
  113. );
  114. },
  115. getActivityList() {
  116. this.$api.activityLists(
  117. {
  118. type: 3
  119. },
  120. data => {
  121. if (data.code == 0) {
  122. that.$common.errorToShow(data.msg);
  123. return;
  124. } else {
  125. that.activityList = data.data;
  126. // console.log(that.activityList);
  127. }
  128. }
  129. );
  130. },
  131. // 活动精彩
  132. getActivityReviewList() {
  133. this.$api.getContentList(
  134. {
  135. page: 1,
  136. pageSize: 4,
  137. model_id: 15,
  138. main_body_column_id: 186 ,
  139. },
  140. data => {
  141. if (data.code == 0) {
  142. that.$common.errorToShow(data.msg);
  143. return;
  144. } else {
  145. that.activityReviewList = data.data;
  146. console.log(that.activityReviewList, '文物跑活动宣传');
  147. }
  148. }
  149. );
  150. },
  151. getXuanjiangList() {
  152. this.$api.getXuanjiangList(
  153. {
  154. page: 1,
  155. pageSize: 4
  156. },
  157. data => {
  158. if (data.code == 0) {
  159. that.$common.errorToShow(data.msg);
  160. return;
  161. } else {
  162. that.xuangjiangyuanList = data.data;
  163. console.log(that.xuangjiangyuanList, '文物跑活动宣讲员');
  164. }
  165. }
  166. );
  167. },
  168. // 详情
  169. goSignup() {
  170. // uni.navigateTo({
  171. // url: '/index_fenbao/XuanJiangYuan/xq_page'
  172. // });
  173. },
  174. // 更多讲员
  175. gdxjyBtn() {
  176. uni.navigateTo({
  177. url: '/index_fenbao/XuanJiangYuan/XuanJiangYuan'
  178. });
  179. },
  180. activityReviewBtn() {
  181. uni.navigateTo({
  182. url: '/index_fenbao/XuanJiangYuan/activity-review-list'
  183. });
  184. },
  185. xqBtn() {
  186. uni.navigateTo({
  187. url: '/index_fenbao/XuanJiangYuan/xjy_XiangQing'
  188. });
  189. }
  190. }
  191. };
  192. </script>
  193. <style>
  194. /deep/.u-swiper-indicator__wrapper__dot--active {
  195. width: 5px !important;
  196. }
  197. .box {
  198. height: auto;
  199. width: 100%;
  200. padding-bottom: 50rpx;
  201. background-image: url('https://huli-app.wenlvti.net/app_static/minnanhun/image/gj_bg.png');
  202. background-repeat: repeat-y;
  203. background-size: 100%;
  204. }
  205. .ban {
  206. position: relative;
  207. width: 92%;
  208. margin: auto;
  209. }
  210. .bm_box {
  211. position: absolute;
  212. display: flex;
  213. width: 100%;
  214. top: 200rpx;
  215. justify-content: space-around;
  216. }
  217. .bm_js {
  218. font-size: 30rpx;
  219. color: #ffe1b8;
  220. }
  221. .bm_js2 {
  222. font-size: 26rpx;
  223. color: #ffe1b8;
  224. }
  225. .goto {
  226. width: 150rpx;
  227. height: 70rpx;
  228. line-height: 70rpx;
  229. color: #ffffff;
  230. text-align: center;
  231. border-radius: 10rpx;
  232. background-color: #fb5903;
  233. }
  234. .ld {
  235. font-size: 30rpx;
  236. font-weight: 700;
  237. margin-bottom: 20rpx;
  238. }
  239. .list_box {
  240. display: flex;
  241. flex-wrap: wrap;
  242. justify-content: space-between;
  243. margin-bottom: 30rpx;
  244. }
  245. .list_item {
  246. width: 330rpx;
  247. height: 270rpx;
  248. margin-bottom: 30rpx;
  249. border-radius: 10rpx;
  250. background-color: #ffe1b8;
  251. }
  252. .item_tit {
  253. margin-top: 8rpx;
  254. margin-left: 20rpx;
  255. }
  256. .jj_box {
  257. margin-top: 20rpx;
  258. font-size: 28rpx;
  259. height: 230rpx;
  260. overflow: scroll;
  261. }
  262. .item_name {
  263. text-align: center;
  264. margin-top: 8rpx;
  265. }
  266. .xjy {
  267. display: flex;
  268. margin-bottom: 20rpx;
  269. justify-content: space-between;
  270. }
  271. .xjy .gd {
  272. width: 110rpx;
  273. height: 60rpx;
  274. line-height: 60rpx;
  275. margin-top: -2rpx;
  276. text-align: center;
  277. border-radius: 30rpx;
  278. color: #ffffff;
  279. background-color: #f47a1a;
  280. }
  281. .good-hot {
  282. padding: 16rpx;
  283. }
  284. .scroll-view_H {
  285. width: 100%;
  286. white-space: nowrap;
  287. height: 480rpx;
  288. flex-direction: row;
  289. }
  290. ..scroll-view_H {
  291. white-space: nowrap; /* 确保子元素在同一行显示 */
  292. width: 100%; /* 设置 scroll-view 的宽度 */
  293. }
  294. .scroll-view_H .goods-item {
  295. display: inline-block; /* 使用 inline-block 确保子元素在同一行显示 */
  296. width: 450rpx;
  297. height: 400rpx;
  298. border-radius: 10rpx;
  299. flex-direction: column;
  300. background-color: #ffe1b8;
  301. margin-right: 20rpx; /* 添加右边距,最后一个子元素的右边距为 0 */
  302. }
  303. .scroll-view_H .goods-item:last-child {
  304. margin-right: 0;
  305. }
  306. .goods-item .img {
  307. width: 100%;
  308. height: 300rpx;
  309. border-radius: 10rpx;
  310. }
  311. .gs_js {
  312. font-size: 28rpx;
  313. color: #aba89a;
  314. margin-top: 10rpx;
  315. }
  316. .btm_box{
  317. text-align: center;
  318. font-size: 26rpx;
  319. }
  320. .btn_img{
  321. width: 40rpx;
  322. height: 40rpx;
  323. }
  324. </style>