123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333 |
- p
- <template>
- <view class="time-line">
- <view class="line-item" v-for="(item, index) in dataList" :key="index" @click="goDetailFromTimeLine(item, index)">
- <view class="time">{{ item.date }}</view>
- <view class="morning-meeting-content" v-if="item.Resource == 3">
- <view class="title-morning" @click="morningReportHandler(item)">
- {{ item.Title }}
- </view>
- <view class="subject-name-morning" v-for="key in item.ListSubject" :key="key.IndustrialSubjectId"> #{{ key.SubjectName }} </view>
- </view>
- <view class="content" v-if="item.Content.length">
- <text class="content-reg" v-if="item.IsRed"></text>
- <rich-text :data-index="index" :key="index" :class="['rich-text', (item.ArticleId || item.ChartId) && 'texe-color']" :nodes="textNumProcessing(item)"> </rich-text>
- <view class="expan-btn" :class="[{ pos: !item.isExpand }, (item.ArticleId || item.ChartId) && 'expan-btn-padding']" @click.stop="handleExpand(item, index)" v-if="item.isShowBtn">{{
- item.isExpand ? "收起" : "展开"
- }}</view>
- </view>
- <view class="title" v-else>
- <text class="content-reg" v-if="item.IsRed"></text>
- {{ item.Title }}
- <block v-if="item.ListSubject && item.ListSubject.length">
- <view class="title-tag" v-for="key in item.ListSubject" :key="key.IndustrialSubjectId"> #{{ key.SubjectName }} </view>
- </block>
- </view>
- </view>
- <view v-show="loadTimeLine" class="loadTimeLine"></view>
- <!-- 视频模块 -->
- <videoModule :showVideoPop.sync="showVideoPop" :videoPopList="videoPopList" />
- <audioModule ref="timeLineAudio" :showAudioPop.sync="showAudioPop" />
- </view>
- </template>
- <script>
- import { Reports } from "@/config/api.js";
- import videoModule from "@/components/videoModule/index";
- import audioModule from "@/components/audioModule/index";
- export default {
- name: "",
- components: { videoModule, audioModule },
- props: {
- dataList: {
- type: Array,
- default: [],
- },
- },
- data() {
- return {
- richTextHeight: 10000,
- loadTimeLine: false, //时间线的遮罩
- showVideoPop: false,
- videoPopList: {},
- showAudioPop: false,
- };
- },
- computed: {},
- watch: {},
- created() {},
- mounted() {},
- methods: {
- async goDetailFromTimeLine(item, index) {
- item.TimeLineId &&
- (item.ChartPermissionName && item.ChartPermissionName == "固收"
- ? await Reports.postGushouHistory({
- TimeLineId: item.TimeLineId,
- })
- : await Reports.postTacticsHistory({
- TimeLineId: item.TimeLineId,
- }));
- if (item.Content.length !== 0 && !item.ArticleId && !item.ChartId) return;
- if (item.SubCategoryName === "路演精华") {
- //跳转路演精华
- uni.navigateTo({
- url: "/reportPages/roadEssence/roadEssence?id=" + item.Id,
- });
- } else if (item.Resource == 4) {
- if (!item.VideoUrl) return;
- this.showVideoPop = true;
- this.videoPopList = {
- Id: item.Id,
- ResourceUrl: item.VideoUrl,
- Title: item.Title,
- ActivityId: item.Id,
- };
- } else if (item.Resource == 5) {
- if (!item.VoiceUrl) return;
- this.$store.commit("audioBg/parseIntAudio", true);
- // 判断是否为同一个音频
- if (this.$store.state.audioBg.indexId == item.Id) {
- if (this.globalBgAudioManager.paused) {
- this.globalBgAudioManager.play();
- }
- } else {
- let VoiceList = {
- Url: item.VoiceUrl,
- Name: item.Title,
- PlaySeconds: item.VoicePlaySeconds,
- };
- this.$store.commit("audioBg/addAudio", { list: VoiceList, indexId: item.Id, activityTitle: item.Title, recordList: item });
- }
- this.showAudioPop = true;
- } else {
- !item.ArticleId && !item.ChartId && this.$emit("setRouter");
- if (item.Resource === 2) {
- // 跳转产品内测详情
- uni.navigateTo({
- url: "/reportPages/internalDetials/internalDetials?id=" + item.Id,
- });
- } else if (item.Resource === 1) {
- if (item.Id || item.ArticleId) {
- uni.navigateTo({
- url: "/pageMy/reportDetail/reportDetail?id=" + (item.Id || item.ArticleId),
- });
- } else if (item.ChartId) {
- uni.navigateTo({
- url: "/pageMy/chartPage/chartPage?id=" + item.ChartId,
- });
- }
- }
- }
- }, //展开收起晨会内容
- // 去往文章详情的
- async handleExpand(item, index) {
- if (item.TimeLineId) {
- item.ChartPermissionName && item.ChartPermissionName == "固收"
- ? await Reports.postGushouHistory({
- TimeLineId: item.TimeLineId,
- })
- : await Reports.postTacticsHistory({
- TimeLineId: item.TimeLineId,
- });
- } else {
- await Reports.morning_meeting_history({ Id: item.Id, SourcePage: "展开" });
- this.getRecordTracking("展开收起", { Id: item.Id });
- }
- item.isExpand = !item.isExpand;
- this.$parent.timeLine.splice(index, 1, item);
- },
- getConentsHeight() {
- setTimeout(() => {
- this.loadTimeLine = false;
- }, 200);
- },
- textNumProcessing(item) {
- console.log(item, this.dataList);
- let str = !item.isExpand ? item.Content.substring(0, 60) + "...." : item.Content;
- console.log(str);
- let strText = str;
- return strText;
- },
- morningReportHandler(item) {
- uni.navigateTo({
- url: "/pageMy/reportDetail/reportDetail?id=" + item.LinkArticleId,
- });
- },
- },
- };
- </script>
- <style scoped lang="scss">
- .time-line {
- padding: 30rpx 40rpx 20rpx 40rpx;
- min-height: calc(100vh - 390rpx);
- background-color: #ffffff;
- position: relative;
- .texe-color {
- color: #376cbb;
- }
- .loadTimeLine {
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- position: absolute;
- background-color: #fff;
- z-index: 6;
- }
- .line-item {
- position: relative;
- padding: 0 0 50rpx 40rpx;
- /* border-left:1rpx solid #DAE9FD; */
- &:last-child {
- padding-bottom: 0;
- &::after {
- height: calc(100% - 25rpx);
- }
- }
- &:first-child {
- .time {
- &::after {
- background-color: #376cbb;
- }
- }
- }
- &::before,
- &::after {
- position: absolute;
- content: "";
- }
- &::before {
- width: 24rpx;
- height: 24rpx;
- background-color: #dae9fd;
- z-index: 1;
- left: 0;
- top: 27rpx;
- transform: translate(-50%, -50%);
- border-radius: 50%;
- }
- &::after {
- top: 17rpx;
- left: 0;
- width: 1rpx;
- height: calc(100%);
- background-color: #dae9fd;
- z-index: 2;
- }
- .time {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 185rpx;
- height: 50rpx;
- background-color: #e5efff;
- border-radius: 64rpx;
- color: $uni-color-new;
- font-size: 28rpx;
- font-weight: 600;
- margin-bottom: 20rpx;
- position: relative;
- &::before,
- &::after {
- position: absolute;
- content: "";
- left: -36rpx;
- top: 27rpx;
- width: 24rpx;
- height: 1rpx;
- background-color: #e5efff;
- z-index: 1;
- }
- &::after {
- left: -40rpx;
- top: 27rpx;
- width: 12rpx;
- height: 12rpx;
- border-radius: 50%;
- transform: translate(-50%, -50%);
- background-color: $uni-color-new;
- z-index: 3;
- }
- }
- .content {
- color: #666666;
- position: relative;
- .rich-text {
- // overflow: hidden;
- // text-overflow: ellipsis;
- // text-align: justify;
- // display: -webkit-box;
- // -webkit-line-clamp: 3;
- // -webkit-box-orient: vertical;
- position: relative;
- &.expand {
- -webkit-line-clamp: 999;
- height: auto;
- }
- }
- .expan-btn {
- color: $uni-color-new;
- text-align: right;
- &.pos {
- padding: 0 0 0 40rpx;
- background-color: rgba(255, 255, 255, 0.882);
- position: absolute;
- right: 0;
- bottom: 0;
- }
- }
- .expan-btn-padding {
- &.pos {
- padding: 0 0 0 80rpx;
- }
- }
- .content-reg {
- position: absolute;
- top: 10rpx;
- left: -20rpx;
- width: 14rpx;
- height: 14rpx;
- background-color: #ff0000;
- border-radius: 50%;
- }
- }
- .title {
- position: relative;
- color: $uni-color-new;
- .content-reg {
- position: absolute;
- top: 10rpx;
- left: -20rpx;
- width: 14rpx;
- height: 14rpx;
- background-color: #ff0000;
- border-radius: 50%;
- }
- .title-tag {
- display: inline-block;
- color: #90aeda;
- margin-left: 5rpx;
- }
- }
- }
- .morning-meeting-content {
- display: flex;
- flex-wrap: wrap;
- color: $uni-color-new;
- font-size: 28rpx;
- margin-bottom: 15rpx;
- .title-morning {
- font-weight: 600;
- text-decoration: underline;
- }
- .subject-name-morning {
- margin-left: 10rpx;
- }
- }
- }
- </style>
|