You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
9.0 KiB

4 weeks ago
  1. <template>
  2. <div id="aCoursesList" class="bg-fa of">
  3. <section class="container">
  4. <section class="i-article">
  5. <div class=" col-club" style="white-space: nowrap;">
  6. <section style="background: linear-gradient(to right,bisque,sandybrown);height: 360px;margin-top: 60px;">
  7. <div style="position: absolute;">
  8. <img :src="imgUrl" alt="大图标" style="display: inline-block;margin-top: 20px; margin-left: 15px;width: 190px;">
  9. <button style="background-color:peru; margin-top: 60px; margin-left: 750px; font-size: 23px;color:sienna;height: 35px; width: 115px;position: absolute;" > 查看更多</button>
  10. <p style="font-size: clamp(1rem, 2vw, 24px); margin-left: 45px;margin-right: 60px; font-weight: 500; margin-top: -10px;position: absolute;width: 100%; height: 100%;">
  11. 博股国际投资论坛(Bogulnternational InvestmentForum)立足中国面向全球聚集了国际
  12. 政要<br>投资大师经济学家和高端投资人士该论坛旨在为一小部分高端投资人士提供深度学习
  13. 解读<br>国际经济形势并研判经济发展机遇博股会员是博股国际投资论坛的终身会员我们注重
  14. 知识<br>体系的深度与大师为伍强调价值投资并利用大波段进行盈利
  15. </p>
  16. </div>
  17. </section>
  18. <section class="mr30">
  19. <header class="comm-title all-article-title">
  20. <h2 class="fl tac">
  21. <span class="c-333" style="color:cornflowerblue;text-decoration: underline;text-underline-offset: 9px;">专题</span>
  22. </h2>
  23. <section class="c-tab-title">
  24. <a href="javascript: void(0)">&nbsp;</a>
  25. </section>
  26. </header>
  27. <!-- / -->
  28. <!-- / -->
  29. <article class="i-article-list" style="background: linear-gradient(cornsilk,white); ">
  30. <!-- / -->
  31. <div>
  32. <p style="font-size: 23px; margin-left: 40px; margin-bottom: 30px; display: inline-block;margin-top: 20px;" >前言股市投资分享之左侧交易</p>
  33. <p style="margin-left: 635px; font-size: 18px;margin-top: 20px;position: absolute;display: inline-block;" >查看更多</p>
  34. </div>
  35. <ul>
  36. <li v-for="Subject in SubjectList" :key="Subject.id">
  37. <aside class="i-article-pic" style="margin-left: 40px;">
  38. <img :src="Subject.coverImg" :alt="1">
  39. </aside>
  40. <img :src="imgjinUrl" alt="" width="35px" height="35px" style="margin-left: 30px; display: inline-block;">
  41. <span class="hLh30 txtOf" style="margin-left: 10px; display: inline-block;">
  42. <a :title="Subject.sectionTitle" href="/club/1" class="i-art-title">{{ Subject.sectionTitle }}</a>
  43. </span>
  44. <!-- <img style="margin-left: 40px;" src="/assets/img/jinbi.jpg"> -->
  45. <section class="i-q-txt mt5 i-q-txt2" style="margin-left: 30px;">
  46. <img :src="Subject.club" alt="" >
  47. </section>
  48. <section class="hLh30 txtOf mt5 pr10 a-list-extrainfo">
  49. <div
  50. class="fl"
  51. style="margin-left: 30px;">
  52. <img :src="Subject.head" alt="" style="display: inline-block; width: 20px; height: 20px;border-radius: 80px;" >&nbsp;&nbsp;&nbsp;
  53. <span class="c-999 f-fM">{{ Subject.author }}</span>&nbsp;
  54. <span class="c-999 f-fM">{{ Subject.publishTime }}</span>&nbsp;
  55. <span class="el-icon-view">&nbsp;{{ Subject.viewCount }}</span>&nbsp;&nbsp;
  56. <!-- <span> <a class="noter-dy vam" title="回答" href="http://127.0.0.1:81/front/articleinfo/23.html">
  57. <em class="icon18">&nbsp;</em><span>{{ Subject.commentCount }}</span>
  58. </a> <tt title="赞一下" class="noter-zan vam ml10 f-fM" onclick="addPraise('23',3)">
  59. <em class="icon18">&nbsp;</em><span class="addPraise23_3 praiseCount">{{ Subject.likeCount }}</span>
  60. </tt>
  61. </span> -->
  62. <span class="el-icon-chat-dot-square">&nbsp;{{ Subject.commentCount }}</span>&nbsp;&nbsp;
  63. <span>
  64. <i
  65. :id="'like-count'+Subject.id"
  66. :style="{color: Subject.isLiked==0 ? '#f56c6c' : '#c0c4cc'}"
  67. class="el-icon-thumb "
  68. @click="praise(Subject.id,Subject.isLiked,index)"
  69. >&nbsp;{{ Subject.likeCount }}</i>
  70. <!-- <i v-if="recommendation.isLiked==0" class="el-icon-thumb">&nbsp;{{ recommendation.likes }}</i>&nbsp;&nbsp;
  71. <i class="el-icon-thumb" style="color: aqua;">&nbsp;{{ recommendation.likes }}</i> -->
  72. </span>
  73. </div>
  74. </section>
  75. </li>
  76. </ul>
  77. <!-- / -->
  78. </article>
  79. <!-- 公共分页 开始 -->
  80. <!-- <div>
  81. <div class="paging">
  82. <a class="undisable" title></a>
  83. <a id="backpage" class="undisable" href="#" title>&lt;</a>
  84. <a href="#" title class="current undisable">1</a>
  85. <a href="#" title>2</a>
  86. <a id="nextpage" href="#" title>&gt;</a>
  87. <a href="#" title></a>
  88. <div class="clear"/>
  89. </div>
  90. </div> -->
  91. <!-- 公共分页 结束 -->
  92. </section>
  93. </div>
  94. </section></section></div>
  95. </template>
  96. <script>
  97. import indexApi from '~/api/club'
  98. import service from '../../utils/request'
  99. export default {
  100. async asyncData() {
  101. // 获取课程和讲师数据
  102. const SubjectResponse = await indexApi.getSubject()
  103. const SubjectList = SubjectResponse.data
  104. const mainTitle = SubjectList.mainTitle
  105. // var time = recommendationList.publishTime
  106. // var d = new Date(time)
  107. // var times = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds()
  108. return {
  109. SubjectList,
  110. mainTitle,
  111. imgjinUrl: require('@/assets/img/jin.jpg'),
  112. imgUrl: require('@/assets/img/da.jpg')
  113. // imgUrl: '/assets/img/1.jpg'
  114. // currentMonth: new Date().getMonth() + 1
  115. }
  116. },
  117. methods: {
  118. praise(id, index) {
  119. service.post('special-topic/api/isLikedById/' + id)
  120. // .then(response => response.json())
  121. .then(Response => {
  122. // console.log(id)
  123. // console.log(status)
  124. // console.log(response)
  125. // window.location.reload()
  126. // console.log(this.RecommendationResponse)
  127. // console.log(id)
  128. // document.getElementById(`like-count`).textContent = data.data.likes
  129. // document.getElementById(`like-isLiked`).className = data.isLiked ? 'liked' : ''
  130. service.post('special-topic/api/selectSpecialTopic')
  131. .then(Response => {
  132. const data = Response.data
  133. // console.log(data)
  134. for (var i = 0; i < data.length; i++) {
  135. // console.log(data[i])
  136. if (data[i].id === id) {
  137. console.log(data[i].id)
  138. // console.log(id)
  139. document.getElementById(`like-count` + id).textContent = data[i].likeCount
  140. if (data[i].isLiked === 0) {
  141. // console.log(data[i].isLiked)
  142. document.getElementById(`like-count` + id).style.color = '#f56c6c'
  143. } else {
  144. document.getElementById(`like-count` + id).style.color = '#c0c4cc'
  145. }
  146. }
  147. }
  148. // const isLikd = data.isLiked
  149. // document.getElementById(`like-count`).textContent = data.likes
  150. // const i = document.getElementById(`like-count`)
  151. // // '#f56c6c' : '#c0c4cc'
  152. // if (isLikd) {
  153. // i.style.color = '#f56c6c'
  154. // } else {
  155. // i.style.color = '#c0c4cc'
  156. // }
  157. // console.log(Response)
  158. })
  159. // console.log(data)
  160. })
  161. .catch(error => {
  162. console.log(error)
  163. console.log('error')
  164. })
  165. },
  166. formatDateTime(isoString) {
  167. const date = new Date(isoString)
  168. const month = (date.getMonth() + 1).toString().padStart(2, 0)
  169. const day = date.getDate().toString().padStart(2, 0)
  170. const hours = date.getHours().toString().padStart
  171. const minutes = date.getMinutes().toString().padStart(2, '0')
  172. return `${month}-${day} ${hours}:${minutes}`
  173. }
  174. }
  175. }
  176. </script>