timeLine.vue 8.8 KB

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