playBack.vue 13 KB

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