playBack.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  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="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 v-if="showAudioBox">
  74. <audioModule :showAudioPop.sync="showAudioPop" />
  75. </view>
  76. <videoModule :showVideoPop="showVideoPop" :videoPopList="videoPopList" />
  77. <!-- 所有自定义弹框 -->
  78. <modalDialog :isShowhasPermission="isShowhasPermission" :applyForIsShow="applyForIsShow" :jurisdictionList="jurisdictionList" :hasPermission="hasPermission" />
  79. </view>
  80. </template>
  81. <script>
  82. import { activity, User } from "@/config/api.js";
  83. import { Throttle } from "@/config/util.js";
  84. import audioModule from "@/components/audioModule/index";
  85. import modalDialog from "@/components/modalDialog.vue";
  86. import videoModule from "@/components/videoModule/index";
  87. import mediaMixins from "@/components/activity/mediaMixins";
  88. export default {
  89. data() {
  90. return {
  91. page_no: 1,
  92. pageSize: 10,
  93. collectList: [],
  94. status: "loadmore",
  95. refresh: false, //正在下拉
  96. isShowJurisdiction: false,
  97. isGetJurisdiction: 0,
  98. listChartPermission: [],
  99. chartPermissionName: "所有行业",
  100. chartPermissionIds: "",
  101. loadText: {
  102. loadmore: "上拉加载更多",
  103. loading: "加载中",
  104. nomore: "已经到底了",
  105. },
  106. totalPage: "",
  107. isShowhasPermission: false, // 联系销售的提交申请
  108. applyForIsShow: false, // 提交申请
  109. jurisdictionList: {},
  110. hasPermission: "", //权限
  111. };
  112. },
  113. mixins: [mediaMixins],
  114. components: { audioModule, modalDialog, videoModule },
  115. methods: {
  116. // 获取活动
  117. async getActivityList() {
  118. const res = await activity.getActivityListNew({
  119. PageSize: this.pageSize,
  120. CurrentIndex: this.page_no,
  121. ActiveState: "3",
  122. PlayBack: 1,
  123. IsShowJurisdiction: this.isGetJurisdiction,
  124. ChartPermissionIds: this.chartPermissionIds,
  125. });
  126. if (res.Ret === 200) {
  127. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  128. this.totalPage = res.Data.Paging.Pages; //总页数
  129. if (this.page_no === 1) {
  130. this.collectList = res.Data.List || [];
  131. this.haveData = this.collectList.length ? true : false;
  132. if (this.refresh) {
  133. uni.stopPullDownRefresh();
  134. this.refresh = false;
  135. }
  136. } else {
  137. this.collectList = this.collectList.concat(res.Data.List);
  138. }
  139. }
  140. },
  141. // 获取权限 、行业的接口
  142. async getUserSearchContent() {
  143. const res = await activity.getUserSearchContent({
  144. IsShowJurisdiction: this.isGetJurisdiction,
  145. });
  146. if (res.Ret === 200) {
  147. this.isShowJurisdiction = res.Data.IsShowJurisdiction;
  148. this.listChartPermission = res.Data.ListChartPermission;
  149. this.clickPermission();
  150. }
  151. },
  152. // 是否有权限的点击事件
  153. async permissioActivity() {
  154. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  155. this.selectComponent("#industry").toggle(false);
  156. this.isShowJurisdiction = !this.isShowJurisdiction;
  157. this.isGetJurisdiction = this.isShowJurisdiction ? 1 : 2;
  158. await this.getUserSearchContent();
  159. if (this.isShowJurisdiction) {
  160. this.getActivityList();
  161. this.replacementConfirm();
  162. } else {
  163. this.replacementBtn();
  164. }
  165. } else {
  166. //已授权未绑定
  167. uni.navigateTo({
  168. url: "/pageMy/login/login",
  169. });
  170. }
  171. },
  172. // 点击后有权限的
  173. clickPermission() {
  174. if (this.isShowJurisdiction) {
  175. const arr = [];
  176. this.listChartPermission &&
  177. this.listChartPermission.forEach((key) => {
  178. if (key.IsChoose) {
  179. arr.push(key.ChartPermissionId);
  180. }
  181. });
  182. this.chartPermissionIds = arr.join(",");
  183. }
  184. },
  185. // 去往详情页面
  186. goDetail(item) {
  187. this.$store.dispatch("checkHandle", "/activityPages/activityDetail/activityDetail?id=" + item.ActivityId);
  188. },
  189. // 下拉选择的确定事件
  190. replacementConfirm() {
  191. const arr = [];
  192. const str = [];
  193. this.listChartPermission &&
  194. this.listChartPermission.forEach((key) => {
  195. if (key.IsChoose) {
  196. arr.push(key.ChartPermissionId);
  197. str.push(key.PermissionName);
  198. }
  199. });
  200. if ((str.length == 6 && this.listChartPermission.length == 6) || str.length <= 0) {
  201. this.chartPermissionName = "所有行业";
  202. } else {
  203. this.chartPermissionName = str.join(",");
  204. }
  205. this.chartPermissionIds = arr.join(",");
  206. this.getActivityList();
  207. this.selectComponent("#industry").toggle(false);
  208. },
  209. // 下拉的选择的重置事件
  210. replacementBtn() {
  211. this.chartPermissionIds = "";
  212. this.isShowJurisdiction = false;
  213. this.listChartPermission.map((item) => (item.IsChoose = false));
  214. this.chartPermissionName = "所有行业";
  215. this.getActivityList();
  216. },
  217. // 选择的选中事件
  218. overallClick(item) {
  219. if (this.isShowJurisdiction) return;
  220. item.IsChoose = !item.IsChoose;
  221. },
  222. },
  223. onLoad() {
  224. this.getActivityList();
  225. this.getUserSearchContent();
  226. },
  227. async onShow() {
  228. this.$store.commit("audioBg/parseIntAudio", true);
  229. },
  230. onHide() {
  231. this.$store.commit("audioBg/parseIntAudio", false);
  232. },
  233. /* 触底 */
  234. onReachBottom: Throttle(function () {
  235. if (this.status === "nomore") return;
  236. this.status = "loading";
  237. this.page_no++;
  238. this.getActivityList();
  239. }),
  240. /* 用户点击分享 */
  241. onShareAppMessage: function (res) {
  242. return {
  243. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "活动回放",
  244. path: "/activityPages/playBack/playBack",
  245. success: (res) => {},
  246. fail: (err) => {},
  247. };
  248. },
  249. };
  250. </script>
  251. <style lang="scss" scoped>
  252. .container-play-back {
  253. background: #f7f7f7;
  254. padding-bottom: 30rpx;
  255. .title-date {
  256. position: relative;
  257. .audio-back {
  258. position: absolute;
  259. right: 0;
  260. top: 50%;
  261. transform: translateY(-50%);
  262. width: 125rpx;
  263. height: 90rpx;
  264. font-size: 24rpx;
  265. display: flex;
  266. align-items: center;
  267. justify-content: flex-end;
  268. color: #fff;
  269. .audio-box {
  270. width: 99rpx;
  271. height: 39rpx;
  272. display: flex;
  273. align-items: center;
  274. border-radius: 20rpx;
  275. padding-left: 4rpx;
  276. background-color: #3385ff;
  277. .audio-img {
  278. width: 30rpx;
  279. height: 30rpx;
  280. margin: 0 5rpx;
  281. }
  282. }
  283. }
  284. }
  285. .screen-item {
  286. position: sticky;
  287. top: 0;
  288. left: 0;
  289. z-index: 9;
  290. background-color: #fff;
  291. height: 111rpx;
  292. padding: 0 34rpx;
  293. font-size: 24rpx;
  294. color: #333;
  295. display: flex;
  296. align-items: center;
  297. .text-item {
  298. width: 150rpx;
  299. text-align: center;
  300. line-height: 51rpx;
  301. box-sizing: border-box;
  302. border-radius: 26rpx;
  303. background-color: #f8f8fa;
  304. margin-right: 20rpx;
  305. }
  306. .active {
  307. background-color: #3385ff;
  308. color: #fff;
  309. }
  310. }
  311. .select-conyent {
  312. .items-box {
  313. width: 40rpx;
  314. }
  315. .menu-items {
  316. background-color: #f8f8fa;
  317. width: 100%;
  318. display: flex;
  319. flex-wrap: wrap;
  320. padding: 30rpx 30rpx 0;
  321. .menu-items-box {
  322. display: flex;
  323. width: 50%;
  324. font-size: 28rpx;
  325. font-weight: 400;
  326. margin-bottom: 40rpx;
  327. }
  328. }
  329. .replacement {
  330. margin: 0rpx 30rpx 20rpx;
  331. display: flex;
  332. background-color: #2c83ff;
  333. height: 60rpx;
  334. line-height: 58rpx;
  335. font-size: 28rpx;
  336. font-weight: 400;
  337. color: #ffffff;
  338. border-radius: 30rpx;
  339. text {
  340. flex: 1;
  341. text-align: center;
  342. line-height: 60rpx;
  343. }
  344. .replacement-box {
  345. border: 1rpx solid #2c83ff;
  346. line-height: 58rpx;
  347. color: #2c83ff;
  348. background: #ffffff;
  349. border-radius: 28rpx 0rpx 28rpx 28rpx;
  350. }
  351. }
  352. }
  353. @import "@/components/activity/indexActivity.scss";
  354. }
  355. /deep/.van-dropdown-menu {
  356. background-color: #fff;
  357. box-shadow: none !important;
  358. display: flex;
  359. align-items: center;
  360. }
  361. /deep/.van-dropdown-menu__item {
  362. box-sizing: border-box;
  363. width: 190rpx;
  364. margin-right: 40rpx;
  365. padding-right: 20rpx;
  366. height: 51rpx;
  367. border-radius: 26rpx;
  368. background: #f8f8fa;
  369. }
  370. /deep/.van-dropdown-item {
  371. margin-top: -10rpx;
  372. }
  373. /deep/[data-index="2"] {
  374. margin-right: 0rpx;
  375. }
  376. /deep/ .van-ellipsis {
  377. font-size: 24rpx;
  378. }
  379. </style>