index.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097
  1. <template>
  2. <view class="container Index-container">
  3. <view class="top-content-box">
  4. <view class="nav-bar-wrap" :style="{ height: navBarStyle.height, paddingTop: navBarStyle.paddingTop, paddingBottom: navBarStyle.paddingBottom }">
  5. <view class="content" @click="goSearch">
  6. <icon type="search" size="15" class="search_ico" />
  7. <text class="sea_ipt">{{ searchPlaceholderList.SummarySearch || "" }}</text>
  8. </view>
  9. </view>
  10. <view class="top-tabs">
  11. <block v-for="item in topTabBars" :key="item.Id">
  12. <view v-if="item.IsShow" :class="['item', item.val == topTabsActive && 'tabs-active']" @click="topTabsChange(item)">
  13. {{ item.Name }}
  14. <block v-if="(item.Id === 3||item.Name == '图表') && wholeShowListData.IsShowChart">
  15. <image class="limit-img tabs-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/limit_icon.png" mode=""></image>
  16. </block>
  17. <view class="active" v-if="item.Id == topTabsActive"></view>
  18. </view>
  19. </block>
  20. </view>
  21. <view class="tabs-content">
  22. <view class="second-tabs" v-if="topTabsActive == '2' || topTabsActive == '3'">
  23. <view :class="['item', item.ChartPermissionId == secondActive && 'tabs-active']" v-for="(item, index) in secondBars" :key="item.ChartPermissionId" @click="handleClickTopSub(item)">
  24. {{ item.PermissionName }}
  25. <block v-if="wholeShowListData.IsShowResearch && index === secondBars.length - 1 && topTabsActive == '2'">
  26. <image class="limit-img tabs-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/limit_icon.png" mode=""></image>
  27. </block>
  28. <view class="active" v-if="item.ChartPermissionId == secondActive"></view>
  29. </view>
  30. </view>
  31. <block v-if="topTabsActive == '3'">
  32. <view class="children-ul">
  33. <view :class="['chart-children', chartChildrenActive == item.CtagId ? 'children-active' : '']" v-for="item in chartChildren" :key="item.CtagId" @click="handleChartChildren(item)">{{
  34. item.Name
  35. }}</view>
  36. </view>
  37. </block>
  38. </view>
  39. </view>
  40. <block v-if="haveData">
  41. <view class="audio-video-content" v-if="topTabsActive == 4">
  42. <view :class="item.Type == 1 ? 'audio-item' : 'video-item'" v-for="item in videoAudioList" :key="item.Id">
  43. <view class="cover-item" :style="{ 'background-image': 'url(' + item.BackgroundImg + ')' }">
  44. <block v-if="item.Type == 2">
  45. <video
  46. :id="item.Id"
  47. :src="item.ResourceUrl"
  48. :poster="item.BackgroundImg"
  49. enable-play-gesture
  50. object-fit="contain"
  51. show-mute-btn
  52. autoplay
  53. @ended="handleVideoEnd"
  54. v-if="item.Id == curVideoId"
  55. ></video>
  56. <image v-else class="img-bg" @click="handelPlay(item)" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/play_icon_index.png"></image>
  57. </block>
  58. <block v-else>
  59. <image
  60. class="img-bg"
  61. @click.stop="handelPlay(item)"
  62. :src="
  63. curVoiceId === item.ActivityId && !curAudioPaused
  64. ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_stop_index.png'
  65. : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_group_index.png'
  66. "
  67. ></image>
  68. </block>
  69. <text class="time">{{ item.PublishTime }}</text>
  70. </view>
  71. <view class="title-share">
  72. <view class="title text_twoLine">{{ item.Title }}</view>
  73. <view class="share">
  74. <view class="share-text" :style="[classifyColor(item.ChartPermissionName)]">
  75. <image :src="classifyIcon(item)"></image>
  76. {{ item.Type == 1 ? "音频" : "视频" }}|{{ item.ChartPermissionName }}
  77. </view>
  78. <button class="share-icon" open-type="share" :data-item="item">
  79. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/share-btn-icon.png"></image>
  80. </button>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="data-cont" v-else>
  86. <view class="report-ul">
  87. <view class="report-item" v-for="(report, index) in dataList" :key="index" v-if="index % 2 === 0" @click="goDetail(report)">
  88. <block v-if="report.HomeType === 1">
  89. <view class="audio-video-content">
  90. <view class="audio-item">
  91. <view class="cover-item" :style="{ 'background-image': 'url(' + report.MicroAudio.AudioImgUrl + ')' }">
  92. <image
  93. class="img-bg"
  94. @click.stop="handelPlay(report.MicroAudio)"
  95. :src="
  96. curVoiceId === report.MicroAudio.AudioActivityId && !curAudioPaused
  97. ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_stop_index.png'
  98. : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_group_index.png'
  99. "
  100. ></image>
  101. <text class="time">{{ report.MicroAudio.AudioPublishTime }}</text>
  102. </view>
  103. <view class="title-share">
  104. <view class="title text_twoLine">{{ report.MicroAudio.AudioTitle }}</view>
  105. <view class="share">
  106. <view class="share-text" :style="[classifyColor(report.MicroAudio.AudioChartPermissionName)]">
  107. <image :src="classifyIcon(report.MicroAudio)"></image>
  108. 音频|{{ report.MicroAudio.AudioChartPermissionName }}
  109. </view>
  110. <button class="share-icon" open-type="share" :data-item="report.MicroAudio">
  111. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/share-btn-icon.png"></image>
  112. </button>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. </block>
  118. <block v-else>
  119. <view class="item-content-img" v-if="report.BodyHtml">
  120. <image :src="report.BodyHtml" mode=""></image>
  121. </view>
  122. <view class="item-content" v-else>{{ report.Body }}</view>
  123. <view class="line"></view>
  124. <text :class="['item-title', report.Source != 1 && 'chart-title text_twoLine']">{{ report.Title }}</text>
  125. <view class="item-abstract text_twoLine" v-if="report.ExpertBackground">
  126. {{ report.ExpertBackground }}
  127. </view>
  128. <block v-if="report.Source == 1">
  129. <view class="item-createtime">
  130. <text>{{ report.PublishDate }}</text>
  131. <view class="item-examine" v-if="report.IsResearch">
  132. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/examine_icon.png"></image>
  133. <text>{{ report.Pv }}</text>
  134. </view>
  135. </view>
  136. </block>
  137. <block v-else>
  138. <view class="item-createtime chart-tag">
  139. <text class="tag-item" v-if="report.PtagName">{{ report.PtagName }}</text>
  140. <text class="tag-item" v-if="report.CtagName">{{ report.CtagName }}</text>
  141. </view>
  142. <view class="chart-collect" v-if="topTabsActive == 3 && secondActive == 0">
  143. <text class="cancel" @click.stop="myChartIsTop(report.ChartId)">{{ report.IsTop ? "取消置顶" : "置顶" }}</text>
  144. <text class="remove" @click.stop="myChartCollect(report.ChartId)">移除</text>
  145. </view>
  146. <view class="my-chart-collect" v-if="topTabsActive == 3 && secondActive == 0 && report.IsTop"></view>
  147. </block>
  148. </block>
  149. </view>
  150. </view>
  151. <view class="report-ul">
  152. <view class="report-item" v-for="(report, index) in dataList" :key="index" v-if="index % 2 !== 0" @click="goDetail(report)">
  153. <block v-if="report.HomeType === 1">
  154. <view class="audio-video-content">
  155. <view class="audio-item">
  156. <view class="cover-item" :style="{ 'background-image': 'url(' + report.MicroAudio.AudioImgUrl + ')' }">
  157. <image
  158. class="img-bg"
  159. @click.stop="handelPlay(report.MicroAudio)"
  160. :src="
  161. curVoiceId === report.MicroAudio.AudioActivityId && !curAudioPaused
  162. ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_stop_index.png'
  163. : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/back_group_index.png'
  164. "
  165. ></image>
  166. <text class="time">{{ report.MicroAudio.AudioPublishTime }}</text>
  167. </view>
  168. <view class="title-share">
  169. <view class="title text_twoLine">{{ report.MicroAudio.AudioTitle }}</view>
  170. <view class="share">
  171. <view class="share-text" :style="[classifyColor(report.MicroAudio.AudioChartPermissionName)]">
  172. <image :src="classifyIcon(report.MicroAudio)"></image>
  173. 音频|{{ report.MicroAudio.AudioChartPermissionName }}
  174. </view>
  175. <button class="share-icon" open-type="share" :data-item="report">
  176. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/share-btn-icon.png"></image>
  177. </button>
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. </block>
  183. <block v-else>
  184. <view class="item-content-img" v-if="report.BodyHtml">
  185. <image :src="report.BodyHtml"></image>
  186. </view>
  187. <view class="item-content" v-else>{{ report.Body }}</view>
  188. <view class="line"></view>
  189. <text :class="['item-title', report.Source != 1 && 'chart-title text_twoLine']">{{ report.Title }}</text>
  190. <view class="item-abstract text_twoLine" v-if="report.ExpertBackground">
  191. {{ report.ExpertBackground }}
  192. </view>
  193. <block v-if="report.Source == 1">
  194. <view class="item-createtime">
  195. <text>{{ report.PublishDate }}</text>
  196. <view class="item-examine" v-if="report.IsResearch">
  197. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/examine_icon.png"></image>
  198. <text>{{ report.Pv }}</text>
  199. </view>
  200. </view>
  201. </block>
  202. <block v-else>
  203. <view class="item-createtime chart-tag">
  204. <text class="tag-item" v-if="report.PtagName">{{ report.PtagName }}</text>
  205. <text class="tag-item" v-if="report.CtagName">{{ report.CtagName }}</text>
  206. </view>
  207. <view class="chart-collect" v-if="topTabsActive == 3 && secondActive == 0">
  208. <text class="cancel" @click.stop="myChartIsTop(report.ChartId)">{{ report.IsTop ? "取消置顶" : "置顶" }}</text>
  209. <text class="remove" @click.stop="myChartCollect(report.ChartId)">移除</text>
  210. </view>
  211. <view class="my-chart-collect" v-if="topTabsActive == 3 && secondActive == 0 && report.IsTop"></view>
  212. </block>
  213. </block>
  214. </view>
  215. </view>
  216. </view>
  217. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="pageNum > 1" />
  218. </block>
  219. <view class="nodata" v-else-if="haveData === false" style="padding-top: 400rpx">
  220. <block class="nodata" v-if="!isBindingMobile && secondActive == 0">
  221. <text>请先绑定联系方式</text>
  222. <view class="bind-mobile" @click="bindingMobile">绑定联系方式</view>
  223. </block>
  224. <block v-else>
  225. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  226. <text>{{ topTabsActive == 3 && secondActive == 0 ? "暂无收藏的图表" : "暂时没有数据" }}</text>
  227. </block>
  228. </view>
  229. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  230. <view v-if="showAudioBox">
  231. <audioModule :showAudioPop.sync="showAudioPop" />
  232. </view>
  233. <suspenButton v-if="wholeShowListData.IsShow" />
  234. <modalDialog :isShowhasPermission="isShowhasPermission" :applyForIsShow="applyForIsShow" :jurisdictionList="jurisdictionList" :hasPermission="hasPermission" />
  235. </view>
  236. </template>
  237. <script>
  238. import { Home, Reports, Chart, activity } from "@/config/api.js";
  239. import { Throttle, deepCopy } from "@/config/util.js";
  240. import freeCharge from "@/components/freeCharge";
  241. import suspenButton from "@/components/suspen_button.vue";
  242. import { color_word_bg, MultimediaIcon } from "@/utils/styleClassify";
  243. import audioModule from "@/components/audioModule/index";
  244. import modalDialog from "@/components/modalDialog.vue";
  245. let app = getApp();
  246. export default {
  247. data() {
  248. return {
  249. topTabBars: [],
  250. topTabsActive: 1, //一级top的tabs
  251. secondActive: "", //二级的tabs
  252. secondBars: [], //二级的tabs数组
  253. chartChildren: [], //二级的tabs下的标签
  254. chartChildrenActive: 0,
  255. refresh: false,
  256. pageSize: 10, //条数
  257. pageNum: 1, //页码
  258. haveMore: true, //是否有更多数据
  259. haveData: null, //是否有数据
  260. //数据列表
  261. dataList: [],
  262. status: "loadmore",
  263. loadText: {
  264. loadmore: "上拉加载更多",
  265. loading: "加载中",
  266. nomore: "已经到底了",
  267. },
  268. showTransition: false, //点击绝密后的隐现
  269. isBindingMobile: true, //图表我的收藏是否绑定手机号
  270. videoContext: null,
  271. showAudioPop: false, //播放音频
  272. isShowhasPermission: false, // 联系销售的提交申请
  273. applyForIsShow: false, // 提交申请
  274. jurisdictionList: {},
  275. hasPermission: "", //权限
  276. audioShareId: "", //通过分享单个音频点进页面时使用
  277. videoShareId: "", //通过分享单个视频点进页面时使用
  278. videoAudioList: [], //音频 视频 list
  279. curVideoId: 0, //音频Id
  280. videoPlayTime: 0, //
  281. };
  282. },
  283. components: {
  284. freeCharge,
  285. suspenButton,
  286. modalDialog,
  287. audioModule,
  288. },
  289. watch: {},
  290. onLoad(optios) {
  291. this.getHeaderTab();
  292. uni.getSystemInfo({
  293. success: function (res) {
  294. if (res.windowWidth > 700) {
  295. uni.reLaunch({
  296. url: "/pages/pcWebViev/pcWebViev",
  297. });
  298. }
  299. },
  300. });
  301. if (optios.topTabsActive) {
  302. this.topTabsActive = optios.topTabsActive;
  303. this.secondActive = optios.secondActive;
  304. this.chartChildrenActive = optios.childrenActive;
  305. this.videoShareId = optios.videoShareId;
  306. this.audioShareId = optios.audioShareId;
  307. this.getTabs();
  308. }
  309. this.initNavBar();
  310. this.getReportList();
  311. this.$store.dispatch("checkHandle", "noGO");
  312. },
  313. onShow() {
  314. //进入页面的记录
  315. this.$store.dispatch("statistics", { PageType: "Activit" });
  316. // #ifdef MP-WEIXIN
  317. uni.hideHomeButton();
  318. // #endif
  319. this.$store.commit("audioBg/parseIntAudio", true);
  320. },
  321. computed: {
  322. curVoiceId() {
  323. //当前正在播放的音频id
  324. return this.$store.state.audioBg.indexId;
  325. },
  326. curAudioPaused() {
  327. //当前音频是否暂停状态
  328. return this.$store.state.audioBg.paused;
  329. },
  330. showAudioBox() {
  331. return this.$store.state.audioBg.parseIntShow;
  332. },
  333. },
  334. methods: {
  335. //获取胶囊位置
  336. initNavBar() {
  337. let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
  338. this.navBarStyle = {
  339. height: menuButtonInfo.height + menuButtonInfo.top + 8 + "px",
  340. paddingTop: menuButtonInfo.top - 4 + "px",
  341. paddingBottom: "4px",
  342. };
  343. },
  344. //点击顶部一级分类
  345. topTabsChange(item) {
  346. this.topTabsActive = item.Id;
  347. this.chartChildren = [];
  348. this.chartChildrenActive = 0;
  349. this.secondActive = "";
  350. this.pageNum = 1;
  351. this.dataList = [];
  352. this.audioShareId = "";
  353. this.videoShareId = "";
  354. uni.pageScrollTo({
  355. scrollTop: 0,
  356. duration: 0,
  357. });
  358. if (this.topTabsActive == "2" || this.topTabsActive == "3") {
  359. this.getTabs();
  360. } else {
  361. this.initData();
  362. }
  363. },
  364. //点击顶部二级分类
  365. handleClickTopSub(item) {
  366. this.secondActive = item.ChartPermissionId;
  367. this.chartChildren = [];
  368. this.chartChildrenActive = 0;
  369. this.childrenChartData();
  370. this.initData();
  371. },
  372. //点击图标的二级分类 处理数据
  373. childrenChartData() {
  374. if (this.topTabsActive == 3 && this.secondActive != 0) {
  375. let arr = [];
  376. this.secondBars &&
  377. this.secondBars.forEach((item) => {
  378. if (this.secondActive == item.ChartPermissionId) {
  379. deepCopy(arr, item.List);
  380. arr.unshift({
  381. CtagId: 0,
  382. Name: "全部",
  383. });
  384. this.chartChildren = arr;
  385. }
  386. });
  387. this.chartChildrenActive > 0 ? "" : (this.chartChildrenActive = 0);
  388. }
  389. },
  390. //点击图标的三级分类
  391. handleChartChildren(item) {
  392. this.chartChildrenActive = item.CtagId;
  393. this.initData();
  394. },
  395. //点击
  396. initData() {
  397. this.pageNum = 1;
  398. this.dataList = [];
  399. uni.pageScrollTo({
  400. scrollTop: 0,
  401. duration: 0,
  402. });
  403. this.getReportList();
  404. },
  405. /* 获取tab分类 */
  406. getTabs() {
  407. this.secondBars = [];
  408. this.topTabsActive == "2"
  409. ? Home.Tab().then((res) => {
  410. if (res.Ret === 200) {
  411. this.secondBars = res.Data.List;
  412. this.secondActive > 0 ? "" : (this.secondActive = this.secondBars[0].ChartPermissionId);
  413. this.getReportList();
  414. }
  415. })
  416. : this.topTabsActive == "3"
  417. ? Chart.getChartPatg().then((res) => {
  418. if (res.Ret === 200) {
  419. let arr = res.Data;
  420. arr.unshift({
  421. ChartPermissionId: 0,
  422. PermissionName: "我的收藏",
  423. });
  424. this.secondBars = arr;
  425. this.secondActive ? "" : (this.secondActive = 0);
  426. this.secondActive > 0 && this.childrenChartData();
  427. this.getReportList();
  428. }
  429. })
  430. : "";
  431. },
  432. /* 获取列表 */
  433. async getReportList() {
  434. if (this.topTabsActive == "3" && this.secondActive == 0) {
  435. const res = await Chart.getChartcollection({
  436. PageSize: this.pageSize,
  437. CurrentIndex: this.pageNum,
  438. });
  439. if (res.Ret === 200) {
  440. this.status = this.pageNum < res.Data.Paging.Pages ? "loadmore" : "nomore";
  441. this.isBindingMobile = res.Data.IsBindingMobile;
  442. if (this.pageNum === 1) {
  443. this.dataList = res.Data.List || [];
  444. this.haveData = this.dataList.length > 0 ? true : false;
  445. } else {
  446. this.dataList = this.dataList.concat(res.Data.List);
  447. }
  448. }
  449. } else if (this.topTabsActive == 4) {
  450. const res = await Home.microRoadshowList({
  451. PageSize: this.pageSize,
  452. CurrentIndex: this.pageNum,
  453. AudioId: this.audioShareId,
  454. VideoId: this.videoShareId,
  455. });
  456. if (res.Ret === 200) {
  457. this.status = this.pageNum < res.Data.Paging.Pages ? "loadmore" : "nomore";
  458. if (this.pageNum == 1) {
  459. this.videoAudioList = res.Data.List || [];
  460. this.haveData = this.videoAudioList.length > 0 ? true : false;
  461. if (this.refresh) {
  462. uni.stopPullDownRefresh();
  463. this.refresh = false;
  464. }
  465. } else {
  466. this.videoAudioList = this.videoAudioList.concat(res.Data.List);
  467. }
  468. }
  469. } else {
  470. const res = await Home.getList({
  471. PageSize: this.pageSize,
  472. CurrentIndex: this.pageNum,
  473. ChartPermissionId: this.secondActive,
  474. CtagId: this.chartChildrenActive,
  475. ListType: this.topTabsActive,
  476. });
  477. if (res.Ret === 200) {
  478. this.processingData(res);
  479. }
  480. }
  481. },
  482. //处理数据
  483. processingData(res) {
  484. if (!res.Data.HaveResearch) {
  485. this.$util.modalShow("", "您暂无查看买方研选权限", "", () => {
  486. uni.reLaunch({
  487. url: "/pages/index/index",
  488. });
  489. });
  490. }
  491. this.status = this.pageNum < res.Data.Paging.Pages ? "loadmore" : "nomore";
  492. res.Data.List &&
  493. res.Data.List.forEach((item) => {
  494. if (item.BodyHtml) {
  495. item.BodyHtml = item.BodyHtml.replace(/'\'/g, "");
  496. }
  497. });
  498. if (this.topTabsActive == "2") {
  499. if (this.pageNum === 1) {
  500. this.dataList = res.Data.List || [];
  501. this.haveData = this.dataList.length ? true : false;
  502. } else {
  503. this.dataList = this.dataList.concat(res.Data.List);
  504. }
  505. } else {
  506. if (this.pageNum === 1) {
  507. this.haveData = res.Data.List ? true : res.Data.ChartList ? true : false;
  508. }
  509. if (!res.Data.List) {
  510. this.dataList = this.dataList.concat(res.Data.ChartList);
  511. } else if (!res.Data.ChartList) {
  512. this.dataList = this.dataList.concat(res.Data.List);
  513. } else {
  514. this.dataList.push(res.Data.List.shift());
  515. let newArr = [];
  516. let newArrTwo = [];
  517. for (let i = 0; i < res.Data.List.length; i += 2) {
  518. newArr.push(res.Data.List.slice(i, i + 2));
  519. }
  520. for (let i = 0; i < res.Data.ChartList.length; i += 2) {
  521. newArrTwo.push(res.Data.ChartList.slice(i, i + 2));
  522. }
  523. let arr = [];
  524. newArr.forEach((item, index) => {
  525. if (newArrTwo[index]) {
  526. arr.push(newArrTwo[index], item);
  527. } else {
  528. arr.push(item);
  529. }
  530. });
  531. this.dataList = this.dataList.concat(arr.flat(Infinity));
  532. }
  533. }
  534. if (this.refresh) {
  535. uni.stopPullDownRefresh();
  536. this.refresh = false;
  537. }
  538. },
  539. //我的收藏的删除
  540. myChartCollect(id) {
  541. uni.showModal({
  542. content: "确认要将该图表移除我的收藏吗?",
  543. confirmColor: "#3385FF",
  544. cancelColor: "#606266",
  545. success: async (res) => {
  546. if (res.confirm) {
  547. const res = await Chart.myChartCollect({
  548. ChartId: id,
  549. });
  550. if (res.Ret === 200) {
  551. this.initData();
  552. this.$util.toast("已取消收藏");
  553. }
  554. }
  555. },
  556. });
  557. },
  558. //我的收藏 置顶
  559. async myChartIsTop(id) {
  560. const res = await Chart.myChartTop({
  561. ChartId: id,
  562. });
  563. if (res.Ret === 200) {
  564. this.initData();
  565. this.$util.toast(res.Msg);
  566. }
  567. },
  568. /* 进入详情 校验是否有该品种权限 */
  569. goDetail(item) {
  570. if (item.HomeType !== 1) {
  571. if (item.Source == 2) {
  572. /* 无需授权且已绑定 检验是或否有权限 */
  573. this.$store.dispatch("checkHandle", "/pageMy/chartPage/chartPage?id=" + item.ChartId);
  574. } else {
  575. /* 无需授权且已绑定 检验是或否有权限 */
  576. this.$store.dispatch("checkHandle", "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId);
  577. }
  578. }
  579. },
  580. /* 搜索 */
  581. goSearch() {
  582. this.$store.dispatch("checkHandle", "/pages-search/indedxSearch/indedxSearch?isType=" + this.topTabsActive);
  583. },
  584. /* 绑定联系方式 */
  585. bindingMobile() {
  586. uni.navigateTo({
  587. url: "/pageMy/login/login",
  588. });
  589. },
  590. //视频播放结束
  591. handleVideoEnd() {
  592. // 此处因为如果不调用退出全屏方法 安卓和ios页面均会表现异常,安卓横屏不恢复竖屏,ios底部tabbar渲染异常
  593. this.videoContext.exitFullScreen();
  594. Home.microAideoHistoryAdd({ VideoId: this.curVideoId, PlaySeconds: Number(this.videoPlayTime) });
  595. setTimeout(() => {
  596. this.curVideoId = 0;
  597. this.videoContext = null;
  598. }, 200);
  599. },
  600. //播放的权限判断
  601. handelPlay(item) {
  602. let content_item = null;
  603. if (item.AudioActivityId) {
  604. content_item = {
  605. ActivityId: item.AudioActivityId,
  606. PlaySeconds: item.AudioPlaySeconds,
  607. ResourceUrl: item.AudioResourceUrl,
  608. Title: item.AudioTitle,
  609. Type: item.AudioType,
  610. };
  611. }
  612. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  613. if (item.AuthInfo.HasPermission == 1) {
  614. item.Type == 1 || item.AudioType == 1 ? this.audioPlayBack(content_item ? content_item : item) : this.handelVideoPlay(item);
  615. } else {
  616. this.hasPermission = item.AuthInfo.HasPermission;
  617. this.jurisdictionList.ActivityId = item.Id;
  618. this.jurisdictionList.isAudioVideo = item.Type;
  619. if (this.hasPermission == 2) {
  620. this.jurisdictionList.SellerMobile = item.AuthInfo.SellerMobile;
  621. this.jurisdictionList.SellerName = item.AuthInfo.SellerName;
  622. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  623. this.isShowhasPermission = true;
  624. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  625. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  626. this.applyForIsShow = true;
  627. }
  628. }
  629. } else {
  630. this.$store.dispatch("checkHandle");
  631. }
  632. },
  633. //视频的播放事件
  634. handelVideoPlay(item) {
  635. this.curVideoId = item.Id;
  636. this.videoPlayTime = item.PlaySeconds;
  637. this.globalBgAudioManager.stop();
  638. setTimeout(() => {
  639. this.videoContext = wx.createVideoContext(item.Id.toString());
  640. }, 300);
  641. Home.microAideoHistoryAdd({ VideoId: item.Id, PlaySeconds: 0 });
  642. },
  643. //音频的播放事件
  644. async audioPlayBack(item) {
  645. this.curVideoId = 0;
  646. this.videoContext && this.videoContext.stop;
  647. this.$store.commit("audioBg/parseIntAudio", true);
  648. // 判断是否为同一个音频
  649. if (this.$store.state.audioBg.indexId == item.ActivityId) {
  650. if (this.globalBgAudioManager.paused) {
  651. this.globalBgAudioManager.play();
  652. } else {
  653. this.globalBgAudioManager.pause();
  654. }
  655. } else {
  656. let VoiceList = {
  657. Url: item.ResourceUrl,
  658. Name: item.Title,
  659. PlaySeconds: item.PlaySeconds,
  660. };
  661. this.$store.commit("audioBg/addAudio", { list: VoiceList, indexId: item.ActivityId, activityTitle: item.Title });
  662. }
  663. this.showAudioPop = true;
  664. },
  665. //音视频的背景色 文字颜色
  666. classifyColor(item) {
  667. let text_color = color_word_bg.color_word.find((key) => key.name == item).color;
  668. let back_ground = color_word_bg.color_bg.find((key) => key.name == item).color;
  669. let _isColor = { color: text_color, "background-color": back_ground };
  670. return _isColor;
  671. },
  672. //音视频的图标
  673. classifyIcon(item) {
  674. let srcItem = MultimediaIcon.find((key) => key.name == (item.AudioChartPermissionName || item.ChartPermissionName));
  675. let imgSrc = item.Type == 1 || item.AudioType == 1 ? srcItem.audio : srcItem.video;
  676. return imgSrc;
  677. },
  678. //获取顶部导航
  679. async getHeaderTab() {
  680. const res = await Home.headerTab();
  681. if (res.Ret === 200) {
  682. this.topTabBars = res.Data || [];
  683. }
  684. },
  685. },
  686. onHide() {
  687. this.$store.commit("audioBg/parseIntAudio", false);
  688. this.curVideoId = 0;
  689. },
  690. mounted() {
  691. uni.$on("updateAudioVideo", (data) => {
  692. console.log("执行了");
  693. this.$store.dispatch("checkHandle", "noGO");
  694. this.getReportList();
  695. });
  696. },
  697. /* 下拉刷新 */
  698. onPullDownRefresh: Throttle(function () {
  699. this.audioShareId = "";
  700. this.videoShareId = "";
  701. this.status = "loadmore";
  702. this.refresh = true;
  703. this.dataList = [];
  704. this.pageNum = 1;
  705. this.getReportList();
  706. }),
  707. // 上拉加载
  708. onReachBottom: Throttle(function () {
  709. if (this.status === "nomore") return;
  710. this.status = "loading";
  711. this.pageNum++;
  712. this.getReportList();
  713. }),
  714. /** 用户点击分享*/
  715. onShareAppMessage: function ({ from, target }) {
  716. if (from === "button") {
  717. let item = target.dataset.item;
  718. let audio_id = item.Type == 1 || item.AudioType == 1 ? item.Id : "";
  719. let video_id = item.Type == 2 ? item.Id : "";
  720. console.log(item);
  721. let title_share = item.AudioTitle || item.Title;
  722. return {
  723. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : title_share,
  724. path: "/pages/index/index?topTabsActive=4" + "&audioShareId=" + audio_id + "&videoShareId=" + video_id,
  725. imageUrl: item.AudioShareImg || item.ShareImg,
  726. };
  727. } else {
  728. return {
  729. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "您手边的弘则研究素材检索库",
  730. path: "/pages/index/index?topTabsActive=" + this.topTabsActive + "&secondActive=" + this.secondActive + "&childrenActive=" + this.chartChildrenActive,
  731. imageUrl: this.topTabsActive == 1 ? "https://hzstatic.hzinsights.com/cygx/czbk/home_share.png" : "",
  732. success: (res) => {},
  733. fail: (err) => {},
  734. };
  735. }
  736. },
  737. };
  738. </script>
  739. <style lang="scss">
  740. .Index-container {
  741. background-color: #f7f7f7;
  742. font-size: 30rpx;
  743. .top-content-box {
  744. position: sticky;
  745. top: 0;
  746. left: 0;
  747. width: 100%;
  748. z-index: 9;
  749. .top-tabs {
  750. width: 100%;
  751. display: flex;
  752. align-items: center;
  753. justify-content: center;
  754. font-size: 34rpx;
  755. background-color: #fff;
  756. padding: 35rpx 0 10rpx;
  757. &::-webkit-scrollbar {
  758. width: 0;
  759. height: 0;
  760. display: none;
  761. }
  762. .item {
  763. position: relative;
  764. padding-bottom: 8rpx;
  765. margin-right: 60rpx;
  766. flex-shrink: 0;
  767. .limit-img {
  768. position: absolute;
  769. top: -15rpx;
  770. right: -50rpx;
  771. z-index: 99;
  772. }
  773. .active {
  774. position: absolute;
  775. left: 0;
  776. bottom: 0;
  777. height: 4rpx;
  778. width: 100%;
  779. border-radius: 1rpx;
  780. background: linear-gradient(90deg, #2e85ff 0%, #7eeaf6 100%);
  781. }
  782. }
  783. .tabs-active {
  784. color: #3385ff;
  785. font-weight: 500;
  786. }
  787. }
  788. }
  789. .nav-bar-wrap {
  790. background-color: #fff;
  791. width: 100%;
  792. padding-left: 35rpx;
  793. display: flex;
  794. align-items: center;
  795. .content {
  796. position: relative;
  797. display: flex;
  798. align-items: center;
  799. width: 70%;
  800. height: 63rpx;
  801. font-size: 30rpx;
  802. color: #8D8D8D;
  803. background-color: #f6f6f6;
  804. padding-left: 33rpx;
  805. border-radius: 70rpx;
  806. // border: 1rpx solid #e5e5e5;
  807. .sea_ipt {
  808. padding-left: 15rpx;
  809. }
  810. }
  811. }
  812. .tabs-content {
  813. padding: 0 30rpx;
  814. background-color: #fff;
  815. .children-ul {
  816. display: flex;
  817. flex-wrap: wrap;
  818. .children-active {
  819. background-color: #3385ff;
  820. color: #fff;
  821. }
  822. }
  823. .chart-children {
  824. padding: 10rpx 20rpx;
  825. margin: 0rpx 20rpx 20rpx 0;
  826. background-color: #f9f9f9;
  827. color: #666666;
  828. font-size: 26rpx;
  829. border-radius: 4rpx;
  830. }
  831. }
  832. .second-tabs {
  833. width: 100%;
  834. display: flex;
  835. overflow-x: auto;
  836. background-color: #fff;
  837. font-size: 30rpx;
  838. color: #999999;
  839. padding: 20rpx 0;
  840. &::-webkit-scrollbar {
  841. width: 0;
  842. height: 0;
  843. display: none;
  844. }
  845. .item {
  846. position: relative;
  847. padding-bottom: 16rpx;
  848. margin-right: 50rpx;
  849. flex-shrink: 0;
  850. .limit-img {
  851. position: absolute;
  852. top: -15rpx;
  853. right: -50rpx;
  854. z-index: 99;
  855. }
  856. .active {
  857. position: absolute;
  858. left: 0;
  859. bottom: 0;
  860. height: 4rpx;
  861. width: 100%;
  862. border-radius: 1rpx;
  863. background: linear-gradient(90deg, #2e85ff 0%, #7eeaf6 100%);
  864. }
  865. }
  866. .tabs-active {
  867. color: #3385ff;
  868. font-weight: 500;
  869. }
  870. }
  871. .data-cont {
  872. padding: 28rpx 20rpx 10rpx;
  873. display: flex;
  874. .report-ul {
  875. width: 50%;
  876. &:first-child {
  877. margin-right: 10rpx;
  878. }
  879. .report-item {
  880. padding: 20rpx 20rpx 24rpx 20rpx;
  881. margin-bottom: 20rpx;
  882. border-radius: 8rpx;
  883. box-shadow: 0 3rpx 6rpx rgba($color: #000000, $alpha: 0.16);
  884. background: #fff;
  885. position: relative;
  886. overflow: hidden;
  887. .audio-video-content {
  888. width: calc(100% + 40rpx);
  889. height: calc(100% + 25rpx);
  890. margin: -20rpx 0 0 -20rpx;
  891. padding: 0 !important;
  892. .audio-item {
  893. width: 100%;
  894. height: auto;
  895. box-shadow: none;
  896. }
  897. }
  898. .my-chart-collect {
  899. content: "";
  900. display: block;
  901. position: absolute;
  902. top: 0;
  903. left: 0;
  904. width: 0;
  905. height: 0;
  906. border-top: 60rpx solid #3385ff;
  907. border-right: 60rpx solid transparent;
  908. }
  909. .item-content-img {
  910. display: flex;
  911. align-items: center;
  912. width: 330rpx;
  913. margin-left: -6rpx;
  914. margin-bottom: -20rpx;
  915. image {
  916. width: 100%;
  917. height: 262rpx;
  918. vertical-align: middle;
  919. }
  920. }
  921. .item-content {
  922. height: 273rpx;
  923. font-size: 24rpx;
  924. line-height: 40rpx;
  925. color: #7f7f7f;
  926. overflow: hidden;
  927. text-overflow: ellipsis;
  928. display: -webkit-box;
  929. -webkit-line-clamp: 7;
  930. -webkit-box-orient: vertical;
  931. image {
  932. width: 100% !important;
  933. }
  934. }
  935. .line {
  936. margin: 18rpx 0;
  937. content: "";
  938. width: 100%;
  939. height: 1px;
  940. padding: 0 32rpx;
  941. box-sizing: border-box;
  942. background-color: #e5e5e5;
  943. -webkit-transform: scale(1, 0.5);
  944. transform: scale(1, 0.5);
  945. -webkit-transform-origin: center bottom;
  946. transform-origin: center bottom;
  947. }
  948. .item-title {
  949. font-size: 28rpx;
  950. color: #4a4a4a;
  951. margin-bottom: 10rpx;
  952. position: relative;
  953. text-indent: 0.5em;
  954. &::before {
  955. content: "";
  956. position: absolute;
  957. top: 5rpx;
  958. left: 0;
  959. width: 6rpx;
  960. height: 31rpx;
  961. background-color: #3385ff;
  962. }
  963. }
  964. .chart-title {
  965. height: 72rpx;
  966. padding-bottom: 10rpx;
  967. text-indent: 0em;
  968. &::before {
  969. display: none;
  970. }
  971. }
  972. .item-abstract {
  973. font-size: 26rpx;
  974. color: #6a6a6a;
  975. margin-bottom: 10rpx;
  976. .report_ico {
  977. width: 32rpx;
  978. height: 26rpx;
  979. margin-right: 20rpx;
  980. display: inline-block;
  981. }
  982. }
  983. .item-createtime {
  984. display: flex;
  985. align-items: center;
  986. justify-content: space-between;
  987. color: #acacac;
  988. font-size: 24rpx;
  989. .item-examine {
  990. display: flex;
  991. align-items: center;
  992. image {
  993. width: 30rpx;
  994. height: 24rpx;
  995. margin: 0 10rpx 0 15rpx;
  996. }
  997. }
  998. }
  999. .chart-tag {
  1000. padding-top: 1rpx;
  1001. height: 36rpx;
  1002. .tag-item {
  1003. width: 148rpx;
  1004. border-radius: 28rpx;
  1005. border: 2rpx solid rgba(49, 137, 255, 1);
  1006. overflow: hidden;
  1007. color: #3385ff;
  1008. text-align: center;
  1009. line-height: 30rpx;
  1010. }
  1011. }
  1012. .chart-collect {
  1013. margin-top: 20rpx;
  1014. padding-top: 20rpx;
  1015. padding: 20rpx 0 0 20rpx;
  1016. border-top: 1rpx solid #dcdfe6;
  1017. display: flex;
  1018. align-items: center;
  1019. .cancel {
  1020. background: #3385ff;
  1021. margin-right: 20rpx;
  1022. color: #ffffff;
  1023. }
  1024. .remove {
  1025. border: 1px solid #3385ff;
  1026. color: #3385ff;
  1027. }
  1028. text {
  1029. width: 130rpx;
  1030. height: 46rpx;
  1031. line-height: 46rpx;
  1032. border-radius: 4rpx;
  1033. text-align: center;
  1034. font-size: 24rpx;
  1035. }
  1036. }
  1037. }
  1038. }
  1039. }
  1040. .content-intimate {
  1041. position: fixed;
  1042. display: flex;
  1043. align-items: center;
  1044. bottom: 96rpx;
  1045. right: 41rpx;
  1046. height: 156rpx;
  1047. .content {
  1048. width: 432rpx;
  1049. height: 112rpx;
  1050. background-color: #fff;
  1051. display: flex;
  1052. border-radius: 56rpx;
  1053. overflow: hidden;
  1054. .cont-border {
  1055. margin: 0 2rpx;
  1056. }
  1057. view {
  1058. flex: 1;
  1059. background-color: #3385ff;
  1060. font-size: 30rpx;
  1061. color: #fff;
  1062. padding-top: 15rpx;
  1063. text-align: center;
  1064. }
  1065. }
  1066. image {
  1067. width: 156rpx;
  1068. height: 100%;
  1069. z-index: 99;
  1070. }
  1071. }
  1072. .tabs-img {
  1073. width: 46rpx;
  1074. height: 26rpx;
  1075. }
  1076. .nodata {
  1077. font-size: 40rpx;
  1078. .bind-mobile {
  1079. width: 244rpx;
  1080. height: 58rpx;
  1081. background: #3385ff;
  1082. border-radius: 8rpx;
  1083. font-size: 28rpx;
  1084. line-height: 58rpx;
  1085. text-align: center;
  1086. color: #fff;
  1087. margin: 50rpx auto;
  1088. }
  1089. }
  1090. @import "@/components/audioVideo.scss";
  1091. }
  1092. </style>