timeLine.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. p
  2. <template>
  3. <view class="time-line">
  4. <view class="line-item" v-for="(item, index) in dataList" :key="index" @click="goDetailFromTimeLine(item, index)">
  5. <view class="time">{{ item.date }}</view>
  6. <view class="morning-meeting-content" v-if="item.Resource == 3">
  7. <view class="title-morning" @click="morningReportHandler(item)">
  8. {{ item.Title }}
  9. </view>
  10. <view class="subject-name-morning" v-for="key in item.ListSubject" :key="key.IndustrialSubjectId"> #{{ key.SubjectName }} </view>
  11. </view>
  12. <view class="content" v-if="item.Content.length">
  13. <text class="content-reg" v-if="item.IsRed"></text>
  14. <rich-text :data-index="index" :key="index" :class="['rich-text', (item.ArticleId || item.ChartId) && 'texe-color']" :nodes="textNumProcessing(item)"> </rich-text>
  15. <view class="expan-btn" :class="[{ pos: !item.isExpand }, (item.ArticleId || item.ChartId) && 'expan-btn-padding']" @click.stop="handleExpand(item, index)" v-if="item.isShowBtn">{{
  16. item.isExpand ? "收起" : "展开"
  17. }}</view>
  18. </view>
  19. <view class="title" v-else>
  20. <text class="content-reg" v-if="item.IsRed"></text>
  21. {{ item.Title }}
  22. <block v-if="item.ListSubject && item.ListSubject.length">
  23. <view class="title-tag" v-for="key in item.ListSubject" :key="key.IndustrialSubjectId"> #{{ key.SubjectName }} </view>
  24. </block>
  25. </view>
  26. </view>
  27. <view v-show="loadTimeLine" class="loadTimeLine"></view>
  28. <!-- 视频模块 -->
  29. <videoModule :showVideoPop.sync="showVideoPop" :videoPopList="videoPopList" />
  30. <audioModule ref="timeLineAudio" :showAudioPop.sync="showAudioPop" />
  31. </view>
  32. </template>
  33. <script>
  34. import { Reports } from "@/config/api.js";
  35. import videoModule from "@/components/videoModule/index";
  36. import audioModule from "@/components/audioModule/index";
  37. export default {
  38. name: "",
  39. components: { videoModule, audioModule },
  40. props: {
  41. dataList: {
  42. type: Array,
  43. default: [],
  44. },
  45. },
  46. data() {
  47. return {
  48. richTextHeight: 10000,
  49. loadTimeLine: false, //时间线的遮罩
  50. showVideoPop: false,
  51. videoPopList: {},
  52. showAudioPop: false,
  53. };
  54. },
  55. computed: {},
  56. watch: {},
  57. created() {},
  58. mounted() {},
  59. methods: {
  60. async goDetailFromTimeLine(item, index) {
  61. item.TimeLineId &&
  62. (item.ChartPermissionName && item.ChartPermissionName == "固收"
  63. ? await Reports.postGushouHistory({
  64. TimeLineId: item.TimeLineId,
  65. })
  66. : await Reports.postTacticsHistory({
  67. TimeLineId: item.TimeLineId,
  68. }));
  69. if (item.Content.length !== 0 && !item.ArticleId && !item.ChartId) return;
  70. if (item.SubCategoryName === "路演精华") {
  71. //跳转路演精华
  72. uni.navigateTo({
  73. url: "/reportPages/roadEssence/roadEssence?id=" + item.Id,
  74. });
  75. } else if (item.Resource == 4) {
  76. if (!item.VideoUrl) return;
  77. this.showVideoPop = true;
  78. this.videoPopList = {
  79. Id: item.Id,
  80. ResourceUrl: item.VideoUrl,
  81. Title: item.Title,
  82. ActivityId: item.Id,
  83. };
  84. } else if (item.Resource == 5) {
  85. if (!item.VoiceUrl) return;
  86. this.$store.commit("audioBg/parseIntAudio", true);
  87. // 判断是否为同一个音频
  88. if (this.$store.state.audioBg.indexId == item.Id) {
  89. if (this.globalBgAudioManager.paused) {
  90. this.globalBgAudioManager.play();
  91. }
  92. } else {
  93. let VoiceList = {
  94. Url: item.VoiceUrl,
  95. Name: item.Title,
  96. PlaySeconds: item.VoicePlaySeconds,
  97. };
  98. this.$store.commit("audioBg/addAudio", { list: VoiceList, indexId: item.Id, activityTitle: item.Title, recordList: item });
  99. }
  100. this.showAudioPop = true;
  101. } else {
  102. !item.ArticleId && !item.ChartId && this.$emit("setRouter");
  103. if (item.Resource === 2) {
  104. // 跳转产品内测详情
  105. uni.navigateTo({
  106. url: "/reportPages/internalDetials/internalDetials?id=" + item.Id,
  107. });
  108. } else if (item.Resource === 1) {
  109. if (item.Id || item.ArticleId) {
  110. uni.navigateTo({
  111. url: "/pageMy/reportDetail/reportDetail?id=" + (item.Id || item.ArticleId),
  112. });
  113. } else if (item.ChartId) {
  114. uni.navigateTo({
  115. url: "/pageMy/chartPage/chartPage?id=" + item.ChartId,
  116. });
  117. }
  118. }
  119. }
  120. }, //展开收起晨会内容
  121. // 去往文章详情的
  122. async handleExpand(item, index) {
  123. if (item.TimeLineId) {
  124. item.ChartPermissionName && item.ChartPermissionName == "固收"
  125. ? await Reports.postGushouHistory({
  126. TimeLineId: item.TimeLineId,
  127. })
  128. : await Reports.postTacticsHistory({
  129. TimeLineId: item.TimeLineId,
  130. });
  131. } else {
  132. await Reports.morning_meeting_history({ Id: item.Id, SourcePage: "展开" });
  133. this.getRecordTracking("展开收起", { Id: item.Id });
  134. }
  135. item.isExpand = !item.isExpand;
  136. this.$parent.timeLine.splice(index, 1, item);
  137. },
  138. getConentsHeight() {
  139. setTimeout(() => {
  140. this.loadTimeLine = false;
  141. }, 200);
  142. },
  143. textNumProcessing(item) {
  144. console.log(item, this.dataList);
  145. let str = !item.isExpand ? item.Content.substring(0, 60) + "...." : item.Content;
  146. console.log(str);
  147. let strText = str;
  148. return strText;
  149. },
  150. morningReportHandler(item) {
  151. uni.navigateTo({
  152. url: "/pageMy/reportDetail/reportDetail?id=" + item.LinkArticleId,
  153. });
  154. },
  155. },
  156. };
  157. </script>
  158. <style scoped lang="scss">
  159. .time-line {
  160. padding: 30rpx 40rpx 20rpx 40rpx;
  161. min-height: calc(100vh - 390rpx);
  162. background-color: #ffffff;
  163. position: relative;
  164. .texe-color {
  165. color: #376cbb;
  166. }
  167. .loadTimeLine {
  168. top: 0;
  169. bottom: 0;
  170. left: 0;
  171. right: 0;
  172. position: absolute;
  173. background-color: #fff;
  174. z-index: 6;
  175. }
  176. .line-item {
  177. position: relative;
  178. padding: 0 0 50rpx 40rpx;
  179. /* border-left:1rpx solid #DAE9FD; */
  180. &:last-child {
  181. padding-bottom: 0;
  182. &::after {
  183. height: calc(100% - 25rpx);
  184. }
  185. }
  186. &:first-child {
  187. .time {
  188. &::after {
  189. background-color: #376cbb;
  190. }
  191. }
  192. }
  193. &::before,
  194. &::after {
  195. position: absolute;
  196. content: "";
  197. }
  198. &::before {
  199. width: 24rpx;
  200. height: 24rpx;
  201. background-color: #dae9fd;
  202. z-index: 1;
  203. left: 0;
  204. top: 27rpx;
  205. transform: translate(-50%, -50%);
  206. border-radius: 50%;
  207. }
  208. &::after {
  209. top: 17rpx;
  210. left: 0;
  211. width: 1rpx;
  212. height: calc(100%);
  213. background-color: #dae9fd;
  214. z-index: 2;
  215. }
  216. .time {
  217. display: flex;
  218. align-items: center;
  219. justify-content: center;
  220. width: 185rpx;
  221. height: 50rpx;
  222. background-color: #e5efff;
  223. border-radius: 64rpx;
  224. color: $uni-color-new;
  225. font-size: 28rpx;
  226. font-weight: 600;
  227. margin-bottom: 20rpx;
  228. position: relative;
  229. &::before,
  230. &::after {
  231. position: absolute;
  232. content: "";
  233. left: -36rpx;
  234. top: 27rpx;
  235. width: 24rpx;
  236. height: 1rpx;
  237. background-color: #e5efff;
  238. z-index: 1;
  239. }
  240. &::after {
  241. left: -40rpx;
  242. top: 27rpx;
  243. width: 12rpx;
  244. height: 12rpx;
  245. border-radius: 50%;
  246. transform: translate(-50%, -50%);
  247. background-color: $uni-color-new;
  248. z-index: 3;
  249. }
  250. }
  251. .content {
  252. color: #666666;
  253. position: relative;
  254. .rich-text {
  255. // overflow: hidden;
  256. // text-overflow: ellipsis;
  257. // text-align: justify;
  258. // display: -webkit-box;
  259. // -webkit-line-clamp: 3;
  260. // -webkit-box-orient: vertical;
  261. position: relative;
  262. &.expand {
  263. -webkit-line-clamp: 999;
  264. height: auto;
  265. }
  266. }
  267. .expan-btn {
  268. color: $uni-color-new;
  269. text-align: right;
  270. &.pos {
  271. padding: 0 0 0 40rpx;
  272. background-color: rgba(255, 255, 255, 0.882);
  273. position: absolute;
  274. right: 0;
  275. bottom: 0;
  276. }
  277. }
  278. .expan-btn-padding {
  279. &.pos {
  280. padding: 0 0 0 80rpx;
  281. }
  282. }
  283. .content-reg {
  284. position: absolute;
  285. top: 10rpx;
  286. left: -20rpx;
  287. width: 14rpx;
  288. height: 14rpx;
  289. background-color: #ff0000;
  290. border-radius: 50%;
  291. }
  292. }
  293. .title {
  294. position: relative;
  295. color: $uni-color-new;
  296. .content-reg {
  297. position: absolute;
  298. top: 10rpx;
  299. left: -20rpx;
  300. width: 14rpx;
  301. height: 14rpx;
  302. background-color: #ff0000;
  303. border-radius: 50%;
  304. }
  305. .title-tag {
  306. display: inline-block;
  307. color: #90aeda;
  308. margin-left: 5rpx;
  309. }
  310. }
  311. }
  312. .morning-meeting-content {
  313. display: flex;
  314. flex-wrap: wrap;
  315. color: $uni-color-new;
  316. font-size: 28rpx;
  317. margin-bottom: 15rpx;
  318. .title-morning {
  319. font-weight: 600;
  320. text-decoration: underline;
  321. }
  322. .subject-name-morning {
  323. margin-left: 10rpx;
  324. }
  325. }
  326. }
  327. </style>