123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420 |
- <template>
- <view class="container container-play-back">
- <!-- 筛选部分 -->
- <view class="screen-item">
- <text :class="[isShowJurisdiction ? 'active' : '', 'text-item']" @click="permissioActivity">有权限行业</text>
- <!-- 各种状态选择 -->
- <view class="select-conyent">
- <van-dropdown-menu active-color="#333333">
- <van-dropdown-item id="industry" :title="chartPermissionName">
- <view class="menu-items">
- <view class="menu-items-box" v-for="item in listChartPermission" :key="item.ChartPermissionId" @click="overallClick(item)">
- <view class="items-box">
- <u-icon v-if="item.IsChoose" name="checkbox-mark" :color="isShowJurisdiction ? '#ccc' : '#2C83FF'" size="24"></u-icon>
- </view>
- <text>{{ item.PermissionName }}</text>
- </view>
- </view>
- <view class="replacement">
- <text @click="replacementBtn" class="replacement-box">重置</text>
- <text @click="replacementConfirm">确定</text>
- </view>
- </van-dropdown-item>
- </van-dropdown-menu>
- </view>
- <text v-for="item in activityTimeList" :key="item.Id" :class="item.IsChoose ? 'active' : ''" @click="isActivityDate(item.Id)">{{ item.StatusName }}</text>
- </view>
- <!-- 活动列表 -->
- <view class="collect-ul">
- <view class="collect-ltem" v-for="(item, index) in collectList" :key="index">
- <view class="title-date" @click="goDetail(item)">
- <text :class="item.ActivityType == 1 ? '' : 'xianxia'">{{ item.ActivityType == 1 ? "线上" : "线下" }}</text>
- {{ item.ActivityTimeText }}
- <view class="audio-back" v-if="item.AudioLink" @click.stop="audioPlayBack(item)">
- <view class="audio-box">
- <image
- class="audio-img"
- :src="
- curVoiceId === item.ActivityId && !curAudioPaused
- ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_stop.png'
- : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_group.png'
- "
- ></image>
- {{ curVoiceId === item.ActivityId && !curAudioPaused ? "暂停" : "回放" }}
- </view>
- </view>
- </view>
- <view class="item-li">
- <view class="item-img" @click="goDetail(item)">
- <image :src="item.ImgUrl"> </image>
- <text v-if="item.ActiveState == 1" class="img-status begin">未开始</text>
- <text v-else-if="item.ActiveState == 2" class="img-status proceed">进行中</text>
- <text v-else class="img-status">已结束</text>
- <view class="img-type">
- <image :src="item.ImgUrlText" mode=""></image>
- </view>
- </view>
- <view class="item">
- <view class="item-text" @click="goDetail(item)">
- <text class="activity-title"> {{ item.ActivityName }} </text>
- <text class="text_twoLine" v-if="item.Expert">专家背景:{{ item.Expert }} </text>
- <text class="text_twoLine" v-if="item.DistinguishedGuest">嘉宾:{{ item.DistinguishedGuest }} </text>
- <text class="text_twoLine" v-if="item.Speaker">主讲人:{{ item.Speaker }}</text>
- </view>
- </view>
- </view>
- </view>
- <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
- </view>
- <view v-if="showAudioBox">
- <audioModule :showAudioPop.sync="showAudioPop" />
- </view>
- <!-- 所有自定义弹框 -->
- <modalDialog :isShowhasPermission="isShowhasPermission" :applyForIsShow="applyForIsShow" :jurisdictionList="jurisdictionList" :hasPermission="hasPermission" />
- </view>
- </template>
- <script>
- import { activity, User } from "@/config/api.js";
- import { Throttle } from "@/config/util.js";
- import audioModule from "@/components/audioModule/index";
- import modalDialog from "@/components/modalDialog.vue";
- export default {
- data() {
- return {
- page_no: 1,
- pageSize: 10,
- collectList: [],
- status: "loadmore",
- refresh: false, //正在下拉
- isShowJurisdiction: false,
- isGetJurisdiction: 0,
- listChartPermission: [],
- chartPermissionName: "所有行业",
- chartPermissionIds: "",
- loadText: {
- loadmore: "上拉加载更多",
- loading: "加载中",
- nomore: "已经到底了",
- },
- showAudioPop: false,
- isShowhasPermission: false, // 联系销售的提交申请
- applyForIsShow: false, // 提交申请
- jurisdictionList: {},
- hasPermission: "", //权限
- };
- },
- components: { audioModule, modalDialog },
- methods: {
- //获取活动
- async getActivityList() {
- const res = await activity.getActivityListNew({
- PageSize: this.pageSize,
- CurrentIndex: this.page_no,
- ActiveState: "3",
- PlayBack: 1,
- IsShowJurisdiction: this.isGetJurisdiction,
- ChartPermissionIds: this.chartPermissionIds,
- });
- if (res.Ret === 200) {
- this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
- if (this.page_no === 1) {
- this.collectList = res.Data.List || [];
- this.haveData = this.collectList.length ? true : false;
- if (this.refresh) {
- uni.stopPullDownRefresh();
- this.refresh = false;
- }
- } else {
- this.collectList = this.collectList.concat(res.Data.List);
- }
- }
- },
- async getUserSearchContent() {
- const res = await activity.getUserSearchContent({
- IsShowJurisdiction: this.isGetJurisdiction,
- });
- if (res.Ret === 200) {
- this.isShowJurisdiction = res.Data.IsShowJurisdiction;
- this.listChartPermission = res.Data.ListChartPermission;
- this.clickPermission();
- }
- },
- //是否有权限的点击事件
- async permissioActivity() {
- if (!this.$store.state.isAuth && !this.$store.state.isBind) {
- this.selectComponent("#industry").toggle(false);
- this.isShowJurisdiction = !this.isShowJurisdiction;
- this.isGetJurisdiction = this.isShowJurisdiction ? 1 : 2;
- await this.getUserSearchContent();
- if (this.isShowJurisdiction) {
- this.getActivityList();
- this.replacementConfirm();
- } else {
- this.replacementBtn();
- }
- } else {
- //已授权未绑定
- uni.navigateTo({
- url: "/pageMy/login/login",
- });
- }
- },
- //点击后有权限的
- clickPermission() {
- if (this.isShowJurisdiction) {
- const arr = [];
- this.listChartPermission &&
- this.listChartPermission.forEach((key) => {
- if (key.IsChoose) {
- arr.push(key.ChartPermissionId);
- }
- });
- this.chartPermissionIds = arr.join(",");
- }
- },
- //去往详情页面
- goDetail(item) {
- this.$store.dispatch("checkHandle", "/activityPages/activityDetail/activityDetail?id=" + item.ActivityId);
- },
- //下拉选择的确定事件
- replacementConfirm() {
- const arr = [];
- const str = [];
- this.listChartPermission &&
- this.listChartPermission.forEach((key) => {
- if (key.IsChoose) {
- arr.push(key.ChartPermissionId);
- str.push(key.PermissionName);
- }
- });
- if ((str.length == 6 && this.listChartPermission.length == 6) || str.length <= 0) {
- this.chartPermissionName = "所有行业";
- } else {
- this.chartPermissionName = str.join(",");
- }
- this.chartPermissionIds = arr.join(",");
- this.getActivityList();
- this.selectComponent("#industry").toggle(false);
- },
- // 下拉的选择的重置事件
- replacementBtn() {
- this.chartPermissionIds = "";
- this.isShowJurisdiction = false;
- this.listChartPermission.map((item) => (item.IsChoose = false));
- this.chartPermissionName = "所有行业";
- this.getActivityList();
- },
- // 选择的选中事件
- overallClick(item) {
- if (this.isShowJurisdiction) return;
- item.IsChoose = !item.IsChoose;
- },
- //点击了回放
- async audioPlayBack(item) {
- if (!item.BackAudioPlay) {
- const res = await activity.getActivityDetail({
- ActivityId: item.ActivityId,
- });
- if (res.Ret === 200) {
- item.BackAudioPlay = res.Data;
- }
- }
- this.hasPermission = item.BackAudioPlay.HasPermission;
- this.jurisdictionList.ActivityId = item.ActivityId;
- if (this.hasPermission == 1) {
- this.$store.commit("audioBg/parseIntAudio", true);
- // 判断是否为同一个音频
- if (this.$store.state.audioBg.activityId == item.ActivityId) {
- if (this.globalBgAudioManager.paused) {
- this.globalBgAudioManager.play();
- } else {
- this.globalBgAudioManager.pause();
- }
- } else {
- this.$store.commit("audioBg/addAudio", { list: item.VoiceList, activityId: item.ActivityId, activityTitle: item.ActivityName });
- }
- this.showAudioPop = true;
- } else if (this.hasPermission == 2) {
- this.jurisdictionList.SellerMobile = item.BackAudioPlay.SellerMobile;
- this.jurisdictionList.SellerName = item.BackAudioPlay.SellerName;
- this.jurisdictionList.PopupMsg = item.BackAudioPlay.PopupMsg;
- this.isShowhasPermission = true;
- } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
- this.jurisdictionList.PopupMsg = item.BackAudioPlay.PopupMsg;
- this.applyForIsShow = true;
- }
- },
- },
- computed: {
- curVoiceId() {
- //当前正在播放的音频id
- return this.$store.state.audioBg.activityId;
- },
- curAudioPaused() {
- //当前音频是否暂停状态
- return this.$store.state.audioBg.paused;
- },
- showAudioBox() {
- return this.$store.state.audioBg.parseIntShow;
- },
- },
- onLoad() {
- this.getActivityList();
- this.getUserSearchContent();
- },
- async onShow() {
- this.$store.commit("audioBg/parseIntAudio", true);
- },
- onHide() {
- this.$store.commit("audioBg/parseIntAudio", false);
- },
- /* 触底 */
- onReachBottom: Throttle(function () {
- if (this.status === "nomore") return;
- this.status = "loading";
- this.page_no++;
- this.getActivityList();
- }),
- /* 用户点击分享 */
- onShareAppMessage: function (res) {
- return {
- title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "活动回放",
- path: "/activityPages/playBack/playBack",
- success: (res) => {},
- fail: (err) => {},
- };
- },
- };
- </script>
- <style lang="scss" scoped>
- .container-play-back {
- background: #f7f7f7;
- padding-bottom: 30rpx;
- .title-date {
- position: relative;
- .audio-back {
- position: absolute;
- right: 0;
- top: 50%;
- transform: translateY(-50%);
- width: 125rpx;
- height: 90rpx;
- font-size: 24rpx;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- color: #fff;
- .audio-box {
- width: 99rpx;
- height: 39rpx;
- display: flex;
- align-items: center;
- border-radius: 20rpx;
- padding-left: 4rpx;
- background-color: #3385ff;
- .audio-img {
- width: 30rpx;
- height: 30rpx;
- margin: 0 5rpx;
- }
- }
- }
- }
- .screen-item {
- position: sticky;
- top: 0;
- left: 0;
- z-index: 9;
- background-color: #fff;
- height: 111rpx;
- padding: 0 34rpx;
- font-size: 24rpx;
- color: #333;
- display: flex;
- align-items: center;
- .text-item {
- width: 150rpx;
- text-align: center;
- line-height: 51rpx;
- box-sizing: border-box;
- border-radius: 26rpx;
- background-color: #f8f8fa;
- margin-right: 20rpx;
- }
- .active {
- background-color: #3385ff;
- color: #fff;
- }
- }
- .select-conyent {
- .items-box {
- width: 40rpx;
- }
- .menu-items {
- background-color: #f8f8fa;
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- padding: 30rpx 30rpx 0;
- .menu-items-box {
- display: flex;
- width: 50%;
- font-size: 28rpx;
- font-weight: 400;
- margin-bottom: 40rpx;
- }
- }
- .replacement {
- margin: 0rpx 30rpx 20rpx;
- display: flex;
- background-color: #2c83ff;
- height: 60rpx;
- line-height: 58rpx;
- font-size: 28rpx;
- font-weight: 400;
- color: #ffffff;
- border-radius: 30rpx;
- text {
- flex: 1;
- text-align: center;
- line-height: 60rpx;
- }
- .replacement-box {
- border: 1rpx solid #2c83ff;
- line-height: 58rpx;
- color: #2c83ff;
- background: #ffffff;
- border-radius: 28rpx 0rpx 28rpx 28rpx;
- }
- }
- }
- @import "@/components/activity/indexActivity.scss";
- }
- /deep/.van-dropdown-menu {
- background-color: #fff;
- box-shadow: none !important;
- display: flex;
- align-items: center;
- }
- /deep/.van-dropdown-menu__item {
- box-sizing: border-box;
- width: 190rpx;
- margin-right: 40rpx;
- padding-right: 20rpx;
- height: 51rpx;
- border-radius: 26rpx;
- background: #f8f8fa;
- }
- /deep/.van-dropdown-item {
- margin-top: -10rpx;
- }
- /deep/[data-index="2"] {
- margin-right: 0rpx;
- }
- /deep/ .van-ellipsis {
- font-size: 24rpx;
- }
- </style>
|