playBack.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <template>
  2. <block>
  3. <view class="container container-play-back">
  4. <!-- 筛选部分 -->
  5. <view class="select-content-activity">
  6. <view class="screen-item" style="justify-content: flex-start">
  7. <text :class="[isShowJurisdiction ? 'active' : '', 'text-item']" @click="permissioActivity">有权限行业</text>
  8. <!-- 各种状态选择 -->
  9. <view class="select-conyent" ref="select-conyent" style="margin-left: 20rpx">
  10. <van-dropdown-menu active-color="#333333">
  11. <van-dropdown-item id="industry" :title="chartPermissionName">
  12. <view class="menu-items">
  13. <view class="menu-items-box" v-for="item in listChartPermission" :key="item.ChartPermissionId" @click="overallClick(item)">
  14. <view class="items-box">
  15. <u-icon v-if="item.IsChoose" name="checkbox-mark" :color="isShowJurisdiction ? '#ccc' : '#376cbb'" size="24"></u-icon>
  16. </view>
  17. <text>{{ item.PermissionName }}</text>
  18. </view>
  19. </view>
  20. <view class="replacement">
  21. <text @click="replacementBtn" class="replacement-box">重置</text>
  22. <text @click="replacementConfirm">确定</text>
  23. </view>
  24. </van-dropdown-item>
  25. </van-dropdown-menu>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 活动列表 -->
  30. <view class="collect-ul" v-if="haveData">
  31. <view class="collect-ltem global_card_content" v-for="(item, index) in collectList" :key="index">
  32. <image class="top-img-box" v-if="detailData.IsResearchPoints" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/research_points.png"></image>
  33. <image class="top-img-box" v-else-if="detailData.IsResearch" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/Research_normal.png"></image>
  34. <view class="title-date" @click="goDetail(item)">
  35. <text :class="item.ActivityType == 1 ? '' : 'xianxia'">{{ item.ActivityType == 1 ? "线上" : "线下" }}</text>
  36. {{ item.ActivityTimeText }}
  37. <view :class="['global_content_center', 'audio-back', item.FileType == 2 ? 'is-video-sing' : 'is-audio-sing']">
  38. <image v-if="item.FileType == 2" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/video_icon.png"></image>
  39. <image v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/audio_icon.png"></image>
  40. {{ totalSeconds(item) }}
  41. </view>
  42. </view>
  43. <view class="item-li">
  44. <view class="item-img" @click="goDetail(item)">
  45. <image :src="item.ImgUrl"> </image>
  46. <image v-if="item.ActiveState == 1" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/not_started_activity.png" class="img-status"></image>
  47. <image v-else-if="item.ActiveState == 2" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/in_progress_activity.png" class="img-status"></image>
  48. <image v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/end_activity.png" class="img-status"></image>
  49. <view class="img-type">
  50. <image :src="item.ImgUrlText" mode=""></image>
  51. </view>
  52. </view>
  53. <view class="item">
  54. <view class="item-text" @click="goDetail(item)">
  55. <text class="activity-title"> {{ item.ActivityName }} </text>
  56. <text class="text_twoLine" v-if="item.Expert">专家背景:{{ item.Expert }} </text>
  57. <text class="text_twoLine" v-if="item.DistinguishedGuest">嘉宾:{{ item.DistinguishedGuest }} </text>
  58. <text class="text_twoLine" v-if="item.Speaker">主讲人:{{ item.Speaker }}</text>
  59. </view>
  60. <view class="content-item-flex iten-buttom">
  61. <view class="global_content_center" @click.stop="playBack(item)">
  62. <image
  63. v-if="item.FileType == 1 && curVoiceId === item.ActivityId && !curAudioPaused"
  64. class="play-img"
  65. src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/suspend_play_list.png"
  66. ></image>
  67. <image v-else class="play-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/play-circle-filled.png"></image>
  68. {{ item.FileType == 1 && curVoiceId === item.ActivityId && !curAudioPaused ? "暂停" : "播放" }}
  69. </view>
  70. <view v-if="item.FileType == 1" class="global_content_center" @click="joinPlaylist(item)">
  71. <image class="play-list" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/paly_list.png"></image>
  72. 添加
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  79. </view>
  80. <view class="nodata" v-else>
  81. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  82. <text>暂无活动</text>
  83. </view>
  84. <view v-if="showAudioBox">
  85. <audioModule :showAudioPop.sync="showAudioPop" />
  86. </view>
  87. <videoModule :showVideoPop.sync="showVideoPop" :videoPopList="videoPopList" />
  88. <!-- 所有自定义弹框 -->
  89. <modalDialog :isShowhasPermission="isShowhasPermission" :applyForIsShow="applyForIsShow" :jurisdictionList="jurisdictionList" :hasPermission="hasPermission" />
  90. <view class="paly-list-image" v-if="playlistData.length > 0" @click="showAudioBoxPlayList">
  91. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/Joined_play_list.png"></image>
  92. </view>
  93. </view>
  94. <Loading />
  95. </block>
  96. </template>
  97. <script>
  98. import { activity, User } from "@/config/api.js";
  99. import { Throttle } from "@/config/util.js";
  100. import audioModule from "@/components/audioModule/index";
  101. import modalDialog from "@/components/modalDialog.vue";
  102. import videoModule from "@/components/videoModule/index";
  103. import mediaMixins from "@/components/activity/mediaMixins";
  104. import selectMixins from "../components/selectMixins.js";
  105. import NotHaveLogin from "../../components/notHaveLogin.vue";
  106. export default {
  107. data() {
  108. return {
  109. page_no: 1,
  110. pageSize: 10,
  111. collectList: [],
  112. status: "loadmore",
  113. refresh: false, //正在下拉
  114. loadText: {
  115. loadmore: "上拉加载更多",
  116. loading: "加载中",
  117. nomore: "已经到底了",
  118. },
  119. totalPage: "",
  120. isShowhasPermission: false, // 联系销售的提交申请
  121. applyForIsShow: false, // 提交申请
  122. jurisdictionList: {},
  123. hasPermission: "", //权限
  124. mediumSelect: [
  125. { name: "视频", value: 1, IsChoose: false },
  126. { name: "音频", value: 2, IsChoose: false },
  127. ],
  128. mediumActive: "",
  129. haveData: true,
  130. hideResearch: true,
  131. };
  132. },
  133. mixins: [mediaMixins, selectMixins],
  134. components: { audioModule, modalDialog, videoModule, NotHaveLogin },
  135. methods: {
  136. // 获取活动
  137. async getActivityList() {
  138. const res = await activity.getActivityListNew({
  139. PageSize: this.pageSize,
  140. CurrentIndex: this.page_no,
  141. ActiveState: "3",
  142. PlayBack: 1,
  143. IsShowJurisdiction: this.isGetJurisdiction,
  144. ChartPermissionIds: this.chartPermissionIds,
  145. Filter: this.mediumActive == "1,2" || !this.mediumActive ? 0 : Number(this.mediumActive),
  146. });
  147. if (res.Ret === 200) {
  148. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  149. this.totalPage = res.Data.Paging.Pages; //总页数
  150. if (this.page_no === 1) {
  151. this.collectList = res.Data.List || [];
  152. this.haveData = this.collectList.length ? true : false;
  153. if (this.refresh) {
  154. uni.stopPullDownRefresh();
  155. this.refresh = false;
  156. }
  157. } else {
  158. this.collectList = this.collectList.concat(res.Data.List);
  159. }
  160. }
  161. },
  162. // 去往详情页面
  163. goDetail(item) {
  164. uni.navigateTo({ url: "/activityPages/activityDetail/activityDetail?id=" + item.ActivityId + "&PageRouter=活动回放" });
  165. },
  166. // 点击视频 、音频 的筛选
  167. mediumClickHandler(item) {
  168. item.IsChoose = !item.IsChoose;
  169. let arr = [];
  170. this.mediumSelect.forEach((item) => {
  171. if (item.IsChoose) {
  172. arr.push(item.value);
  173. }
  174. });
  175. this.mediumActive = arr.join(",");
  176. this.page_no = 1;
  177. this.getActivityList();
  178. },
  179. async playBack(item) {
  180. await this.$store.dispatch("showLoginModal");
  181. this.PlayBackAll(item);
  182. },
  183. // 播放时长的转换
  184. totalSeconds(item) {
  185. let PlaySeconds = item.FileType == 2 ? item.VideoDetail.VideoDuration : item.VoiceList.PlaySeconds;
  186. let minutes = Math.floor(PlaySeconds / 60);
  187. let seconds = PlaySeconds % 60;
  188. let time = minutes.toString().padStart(2, "0") + ":" + seconds.toString().padStart(2, "0");
  189. return time;
  190. },
  191. // 加入播放列表
  192. async joinPlaylist(item) {
  193. if (!item.BackAudioPlay) {
  194. const res = await activity.getActivityDetail({
  195. ActivityId: item.ActivityId,
  196. });
  197. if (res.Ret === 200) {
  198. item.BackAudioPlay = res.Data;
  199. }
  200. }
  201. this.hasPermission = item.BackAudioPlay.HasPermission;
  202. this.jurisdictionList.ActivityId = item.ActivityId;
  203. if (this.hasPermission == 1) {
  204. let recordList = {
  205. Type: 1,
  206. SourceId: item.ActivityId,
  207. };
  208. let dataList = {
  209. Url: item.VoiceList.Url,
  210. Name: item.VoiceList.Name,
  211. PlaySeconds: item.VoiceList.PlaySeconds,
  212. indexId: item.ActivityId,
  213. activityTitle: item.ActivityName,
  214. recordList,
  215. };
  216. const playlist = this.$store.state.audioJoinPlaylist.playlist.some((key) => key.indexId === dataList.indexId);
  217. if (!playlist) {
  218. this.$store.commit("audioJoinPlaylist/addPlaylist", { dataList });
  219. }
  220. uni.showToast({
  221. title: "已加入播放列表",
  222. icon: "success",
  223. duration: 500,
  224. });
  225. } else if (this.hasPermission == 2) {
  226. this.jurisdictionList.SellerMobile = item.BackAudioPlay.SellerMobile;
  227. this.jurisdictionList.SellerName = item.BackAudioPlay.SellerName;
  228. this.jurisdictionList.PopupMsg = item.BackAudioPlay.PopupMsg;
  229. this.isShowhasPermission = true;
  230. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  231. this.jurisdictionList.PopupMsg = item.BackAudioPlay.PopupMsg;
  232. this.applyForIsShow = true;
  233. }
  234. },
  235. // 展示播放列表
  236. showAudioBoxPlayList() {
  237. this.$store.commit("audioBg/parseIntAudio", true);
  238. this.showAudioPop = true;
  239. uni.$emit("play-list-emit", {});
  240. },
  241. },
  242. onLoad() {
  243. this.getActivityList();
  244. },
  245. async onShow() {
  246. this.$store.commit("setRouterActivity", "活动回放");
  247. this.$store.commit("setRouterReport", "活动回放");
  248. this.$store.commit("audioBg/parseIntAudio", true);
  249. },
  250. onHide() {
  251. this.$store.commit("audioBg/parseIntAudio", false);
  252. },
  253. /* 触底 */
  254. onReachBottom: Throttle(function () {
  255. if (this.status === "nomore") return;
  256. this.status = "loading";
  257. this.page_no++;
  258. this.getActivityList();
  259. }),
  260. /* 用户点击分享 */
  261. onShareAppMessage: function (res) {
  262. return {
  263. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "活动回放",
  264. path: "/activityPages/playBack/playBack",
  265. success: (res) => {},
  266. fail: (err) => {},
  267. };
  268. },
  269. };
  270. </script>
  271. <style lang="scss" scoped>
  272. .container-play-back {
  273. background-color: $uni-bg-color;
  274. padding-bottom: 30rpx;
  275. .paly-list-image {
  276. position: fixed;
  277. right: 50rpx;
  278. bottom: 150rpx;
  279. z-index: 99;
  280. width: 100rpx;
  281. height: 100rpx;
  282. image {
  283. width: 100rpx;
  284. height: 100rpx;
  285. }
  286. }
  287. .title-date {
  288. position: relative;
  289. .audio-back {
  290. position: absolute;
  291. right: 0;
  292. top: 50%;
  293. transform: translateY(-50%);
  294. width: 132rpx;
  295. height: 42rpx;
  296. border-radius: 38rpx;
  297. font-size: 24rpx;
  298. image {
  299. width: 32rpx;
  300. height: 32rpx;
  301. margin-right: 8rpx;
  302. }
  303. }
  304. .is-video-sing {
  305. color: #e37318;
  306. background-color: #fff1e9;
  307. }
  308. .is-audio-sing {
  309. color: $uni-color-new;
  310. background-color: #e5efff;
  311. }
  312. }
  313. .content-item-flex {
  314. display: flex;
  315. align-items: center;
  316. justify-content: space-between;
  317. }
  318. .iten-buttom {
  319. flex-direction: row-reverse;
  320. view {
  321. height: 48rpx;
  322. border-radius: 8rpx;
  323. font-size: 24rpx;
  324. font-weight: 600;
  325. }
  326. view:nth-child(1) {
  327. width: 200rpx;
  328. background-color: $uni-color-new;
  329. color: #fff;
  330. }
  331. view:nth-child(2) {
  332. width: 200rpx;
  333. border-radius: 8rpx;
  334. background-color: #e5efff;
  335. color: $uni-color-new;
  336. }
  337. .play-img,
  338. .play-list {
  339. width: 30rpx;
  340. height: 30rpx;
  341. margin-right: 6rpx;
  342. }
  343. }
  344. @import "../components/selectCss.scss";
  345. @import "@/components/activity/indexActivity.scss";
  346. }
  347. </style>