playBack.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <template>
  2. <view class="container container-play-back">
  3. <!-- 筛选部分 -->
  4. <view class="screen-item">
  5. <text :class="[isShowJurisdiction ? 'active' : '', 'text-item']" @click="permissioActivity">有权限行业</text>
  6. <!-- 各种状态选择 -->
  7. <view class="select-conyent">
  8. <van-dropdown-menu active-color="#333333">
  9. <van-dropdown-item id="industry" :title="chartPermissionName">
  10. <view class="menu-items">
  11. <view class="menu-items-box" v-for="item in listChartPermission" :key="item.ChartPermissionId" @click="overallClick(item)">
  12. <view class="items-box">
  13. <u-icon v-if="item.IsChoose" name="checkbox-mark" :color="isShowJurisdiction ? '#ccc' : '#2C83FF'" size="24"></u-icon>
  14. </view>
  15. <text>{{ item.PermissionName }}</text>
  16. </view>
  17. </view>
  18. <view class="replacement">
  19. <text @click="replacementBtn" class="replacement-box">重置</text>
  20. <text @click="replacementConfirm">确定</text>
  21. </view>
  22. </van-dropdown-item>
  23. </van-dropdown-menu>
  24. </view>
  25. <text @click="mediumClickHandler(item)" v-for="item in mediumSelect" :key="item.value" :class="[item.IsChoose ? 'active' : '', 'text-item', 'medium-item']">{{ item.name }}</text>
  26. </view>
  27. <!-- 活动列表 -->
  28. <view class="collect-ul" v-if="haveData">
  29. <view class="collect-ltem" v-for="(item, index) in collectList" :key="index">
  30. <view class="title-date" @click="goDetail(item)">
  31. <text :class="item.ActivityType == 1 ? '' : 'xianxia'">{{ item.ActivityType == 1 ? "线上" : "线下" }}</text>
  32. {{ item.ActivityTimeText }}
  33. <view class="audio-back" v-if="item.AudioLink" @click.stop="PlayBackAll(item)">
  34. <view class="audio-box">
  35. <block v-if="item.FileType == 2">
  36. <image class="audio-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/video_play.png"></image>
  37. </block>
  38. <image
  39. v-else
  40. class="audio-img"
  41. :src="
  42. curVoiceId === item.ActivityId && !curAudioPaused
  43. ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/stop_play.png'
  44. : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/audio_play.png'
  45. "
  46. ></image>
  47. {{ curVoiceId === item.ActivityId && !curAudioPaused ? "暂停" : "回放" }}
  48. </view>
  49. </view>
  50. </view>
  51. <view class="item-li">
  52. <view class="item-img" @click="goDetail(item)">
  53. <image :src="item.ImgUrl"> </image>
  54. <text v-if="item.ActiveState == 1" class="img-status begin">未开始</text>
  55. <text v-else-if="item.ActiveState == 2" class="img-status proceed">进行中</text>
  56. <text v-else class="img-status">已结束</text>
  57. <view class="img-type">
  58. <image :src="item.ImgUrlText" mode=""></image>
  59. </view>
  60. </view>
  61. <view class="item">
  62. <view class="item-text" @click="goDetail(item)">
  63. <text class="activity-title"> {{ item.ActivityName }} </text>
  64. <text class="text_twoLine" v-if="item.Expert">专家背景:{{ item.Expert }} </text>
  65. <text class="text_twoLine" v-if="item.DistinguishedGuest">嘉宾:{{ item.DistinguishedGuest }} </text>
  66. <text class="text_twoLine" v-if="item.Speaker">主讲人:{{ item.Speaker }}</text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  72. </view>
  73. <view class="nodata" v-else>
  74. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  75. <text>暂无活动</text>
  76. </view>
  77. <view v-if="showAudioBox">
  78. <audioModule :showAudioPop.sync="showAudioPop" />
  79. </view>
  80. <videoModule :showVideoPop="showVideoPop" :videoPopList="videoPopList" />
  81. <!-- 所有自定义弹框 -->
  82. <modalDialog :isShowhasPermission="isShowhasPermission" :applyForIsShow="applyForIsShow" :jurisdictionList="jurisdictionList" :hasPermission="hasPermission" />
  83. </view>
  84. </template>
  85. <script>
  86. import { activity, User } from "@/config/api.js";
  87. import { Throttle } from "@/config/util.js";
  88. import audioModule from "@/components/audioModule/index";
  89. import modalDialog from "@/components/modalDialog.vue";
  90. import videoModule from "@/components/videoModule/index";
  91. import mediaMixins from "@/components/activity/mediaMixins";
  92. export default {
  93. data() {
  94. return {
  95. page_no: 1,
  96. pageSize: 10,
  97. collectList: [],
  98. status: "loadmore",
  99. refresh: false, //正在下拉
  100. isShowJurisdiction: false,
  101. isGetJurisdiction: 0,
  102. listChartPermission: [],
  103. chartPermissionName: "所有行业",
  104. chartPermissionIds: "",
  105. loadText: {
  106. loadmore: "上拉加载更多",
  107. loading: "加载中",
  108. nomore: "已经到底了",
  109. },
  110. totalPage: "",
  111. isShowhasPermission: false, // 联系销售的提交申请
  112. applyForIsShow: false, // 提交申请
  113. jurisdictionList: {},
  114. hasPermission: "", //权限
  115. mediumSelect: [
  116. { name: "视频", value: 1, IsChoose: false },
  117. { name: "音频", value: 2, IsChoose: false },
  118. ],
  119. mediumActive: "",
  120. haveData: true,
  121. };
  122. },
  123. mixins: [mediaMixins],
  124. components: { audioModule, modalDialog, videoModule },
  125. methods: {
  126. // 获取活动
  127. async getActivityList() {
  128. const res = await activity.getActivityListNew({
  129. PageSize: this.pageSize,
  130. CurrentIndex: this.page_no,
  131. ActiveState: "3",
  132. PlayBack: 1,
  133. IsShowJurisdiction: this.isGetJurisdiction,
  134. ChartPermissionIds: this.chartPermissionIds,
  135. Filter: this.mediumActive == "1,2" || !this.mediumActive ? 0 : Number(this.mediumActive),
  136. });
  137. if (res.Ret === 200) {
  138. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  139. this.totalPage = res.Data.Paging.Pages; //总页数
  140. if (this.page_no === 1) {
  141. this.collectList = res.Data.List || [];
  142. this.haveData = this.collectList.length ? true : false;
  143. if (this.refresh) {
  144. uni.stopPullDownRefresh();
  145. this.refresh = false;
  146. }
  147. } else {
  148. this.collectList = this.collectList.concat(res.Data.List);
  149. }
  150. }
  151. },
  152. // 获取权限 、行业的接口
  153. async getUserSearchContent() {
  154. const res = await activity.getUserSearchContent({
  155. IsShowJurisdiction: this.isGetJurisdiction,
  156. });
  157. if (res.Ret === 200) {
  158. this.isShowJurisdiction = res.Data.IsShowJurisdiction;
  159. this.listChartPermission = res.Data.ListChartPermission;
  160. this.clickPermission();
  161. }
  162. },
  163. // 是否有权限的点击事件
  164. async permissioActivity() {
  165. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  166. this.selectComponent("#industry").toggle(false);
  167. this.isShowJurisdiction = !this.isShowJurisdiction;
  168. this.isGetJurisdiction = this.isShowJurisdiction ? 1 : 2;
  169. await this.getUserSearchContent();
  170. if (this.isShowJurisdiction) {
  171. this.getActivityList();
  172. this.replacementConfirm();
  173. } else {
  174. this.replacementBtn();
  175. }
  176. } else {
  177. //已授权未绑定
  178. uni.navigateTo({
  179. url: "/pageMy/login/login",
  180. });
  181. }
  182. },
  183. // 点击后有权限的
  184. clickPermission() {
  185. if (this.isShowJurisdiction) {
  186. const arr = [];
  187. this.listChartPermission &&
  188. this.listChartPermission.forEach((key) => {
  189. if (key.IsChoose) {
  190. arr.push(key.ChartPermissionId);
  191. }
  192. });
  193. this.chartPermissionIds = arr.join(",");
  194. }
  195. },
  196. // 去往详情页面
  197. goDetail(item) {
  198. this.$store.dispatch("checkHandle", "/activityPages/activityDetail/activityDetail?id=" + item.ActivityId);
  199. },
  200. // 下拉选择的确定事件
  201. replacementConfirm() {
  202. const arr = [];
  203. const str = [];
  204. this.listChartPermission &&
  205. this.listChartPermission.forEach((key) => {
  206. if (key.IsChoose) {
  207. arr.push(key.ChartPermissionId);
  208. str.push(key.PermissionName);
  209. }
  210. });
  211. if ((str.length == 6 && this.listChartPermission.length == 6) || str.length <= 0) {
  212. this.chartPermissionName = "所有行业";
  213. } else {
  214. this.chartPermissionName = str.join(",");
  215. }
  216. this.chartPermissionIds = arr.join(",");
  217. this.getActivityList();
  218. this.selectComponent("#industry").toggle(false);
  219. },
  220. // 下拉的选择的重置事件
  221. replacementBtn() {
  222. this.chartPermissionIds = "";
  223. this.isShowJurisdiction = false;
  224. this.listChartPermission.map((item) => (item.IsChoose = false));
  225. this.chartPermissionName = "所有行业";
  226. this.getActivityList();
  227. },
  228. // 选择的选中事件
  229. overallClick(item) {
  230. if (this.isShowJurisdiction) return;
  231. item.IsChoose = !item.IsChoose;
  232. },
  233. // 点击视频 、音频 的筛选
  234. mediumClickHandler(item) {
  235. item.IsChoose = !item.IsChoose;
  236. let arr = [];
  237. this.mediumSelect.forEach((item) => {
  238. if (item.IsChoose) {
  239. arr.push(item.value);
  240. }
  241. });
  242. this.mediumActive = arr.join(",");
  243. console.log(this.mediumActive);
  244. this.page_no = 1;
  245. this.getActivityList();
  246. },
  247. },
  248. onLoad() {
  249. this.getActivityList();
  250. this.getUserSearchContent();
  251. },
  252. async onShow() {
  253. this.$store.commit("audioBg/parseIntAudio", true);
  254. },
  255. onHide() {
  256. this.$store.commit("audioBg/parseIntAudio", false);
  257. },
  258. /* 触底 */
  259. onReachBottom: Throttle(function () {
  260. if (this.status === "nomore") return;
  261. this.status = "loading";
  262. this.page_no++;
  263. this.getActivityList();
  264. }),
  265. /* 用户点击分享 */
  266. onShareAppMessage: function (res) {
  267. return {
  268. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "活动回放",
  269. path: "/activityPages/playBack/playBack",
  270. success: (res) => {},
  271. fail: (err) => {},
  272. };
  273. },
  274. };
  275. </script>
  276. <style lang="scss" scoped>
  277. .container-play-back {
  278. background: #f7f7f7;
  279. padding-bottom: 30rpx;
  280. .title-date {
  281. position: relative;
  282. .audio-back {
  283. position: absolute;
  284. right: 0;
  285. top: 50%;
  286. transform: translateY(-50%);
  287. width: 125rpx;
  288. height: 90rpx;
  289. font-size: 24rpx;
  290. display: flex;
  291. align-items: center;
  292. justify-content: flex-end;
  293. color: #fff;
  294. .audio-box {
  295. width: 99rpx;
  296. height: 39rpx;
  297. display: flex;
  298. align-items: center;
  299. border-radius: 20rpx;
  300. padding-left: 4rpx;
  301. background-color: #3385ff;
  302. .audio-img {
  303. width: 30rpx;
  304. height: 30rpx;
  305. margin: 0 5rpx;
  306. }
  307. }
  308. }
  309. }
  310. .screen-item {
  311. position: sticky;
  312. top: 0;
  313. left: 0;
  314. z-index: 9;
  315. background-color: #fff;
  316. height: 111rpx;
  317. padding: 0 34rpx;
  318. font-size: 24rpx;
  319. color: #333;
  320. display: flex;
  321. align-items: center;
  322. justify-content: space-between;
  323. .text-item {
  324. width: 150rpx;
  325. text-align: center;
  326. line-height: 51rpx;
  327. box-sizing: border-box;
  328. border-radius: 26rpx;
  329. background-color: #f8f8fa;
  330. // margin-right: 20rpx;
  331. }
  332. .medium-item {
  333. width: 135rpx;
  334. }
  335. .active {
  336. background-color: #3385ff;
  337. color: #fff;
  338. }
  339. }
  340. .select-conyent {
  341. .items-box {
  342. width: 40rpx;
  343. }
  344. .menu-items {
  345. background-color: #f8f8fa;
  346. width: 100%;
  347. display: flex;
  348. flex-wrap: wrap;
  349. padding: 30rpx 30rpx 0;
  350. .menu-items-box {
  351. display: flex;
  352. width: 50%;
  353. font-size: 28rpx;
  354. font-weight: 400;
  355. margin-bottom: 40rpx;
  356. }
  357. }
  358. .replacement {
  359. margin: 0rpx 30rpx 20rpx;
  360. display: flex;
  361. background-color: #2c83ff;
  362. height: 60rpx;
  363. line-height: 58rpx;
  364. font-size: 28rpx;
  365. font-weight: 400;
  366. color: #ffffff;
  367. border-radius: 30rpx;
  368. text {
  369. flex: 1;
  370. text-align: center;
  371. line-height: 60rpx;
  372. }
  373. .replacement-box {
  374. border: 1rpx solid #2c83ff;
  375. line-height: 58rpx;
  376. color: #2c83ff;
  377. background: #ffffff;
  378. border-radius: 28rpx 0rpx 28rpx 28rpx;
  379. }
  380. }
  381. }
  382. @import "@/components/activity/indexActivity.scss";
  383. }
  384. /deep/.van-dropdown-menu {
  385. background-color: #fff;
  386. box-shadow: none !important;
  387. display: flex;
  388. align-items: center;
  389. }
  390. /deep/.van-dropdown-menu__item {
  391. box-sizing: border-box;
  392. width: 190rpx;
  393. // margin-right: 20rpx;
  394. padding-right: 20rpx;
  395. height: 51rpx;
  396. border-radius: 26rpx;
  397. background: #f8f8fa;
  398. }
  399. /deep/.van-dropdown-item {
  400. margin-top: -10rpx;
  401. }
  402. /deep/[data-index="2"] {
  403. margin-right: 0rpx;
  404. }
  405. /deep/ .van-ellipsis {
  406. font-size: 24rpx;
  407. }
  408. </style>