all.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039
  1. <template>
  2. <div class="bookCity">
  3. <Header
  4. :headerBg="'#00ADEF'"
  5. :headerBorder="'#5C5C5C'"
  6. :userBg="'rgba(0, 0, 0, 0.24)'"
  7. :LoginNavIndex="this.$route.query.from ? 0 : 1"
  8. />
  9. <div class="banner">
  10. <el-image
  11. class="image"
  12. :src="require('../../assets/banner3.png')"
  13. :fit="'cover'"
  14. style="
  15. width: 1200px;
  16. height: 308px;
  17. margin: 0 auto;
  18. border-radius: 16px;
  19. "
  20. >
  21. </el-image>
  22. </div>
  23. <div class="filt-box">
  24. <div class="filt-inner">
  25. <el-breadcrumb separator="/">
  26. <el-breadcrumb-item :to="{ path: '/' }">{{
  27. this.$route.query.from ? "精读课堂" : "商城"
  28. }}</el-breadcrumb-item>
  29. <el-breadcrumb-item>{{ nameTypeCn }}</el-breadcrumb-item>
  30. </el-breadcrumb>
  31. <h2>筛选:</h2>
  32. <template v-if="itemType === 'kecheng'">
  33. <div class="filt-item">
  34. <label>学段</label>
  35. <ul>
  36. <li
  37. :class="[
  38. items.study_phase === courseForm.studyValue ? 'active' : '',
  39. courseForm.categoryValue === 'ZB' ? 'not-allow' : '',
  40. ]"
  41. v-for="(items, indexs) in studyList"
  42. :key="indexs"
  43. @click="
  44. handleClick('courseForm', 'studyValue', items.study_phase)
  45. "
  46. >
  47. <i
  48. v-if="items.study_phase === courseForm.studyValue"
  49. class="el-icon-success"
  50. ></i>
  51. {{ items.study_phase_name }}
  52. </li>
  53. </ul>
  54. </div>
  55. <div class="filt-item">
  56. <label>类别</label>
  57. <ul>
  58. <li
  59. :class="[
  60. itemt.value === courseForm.categoryValue ? 'active' : '',
  61. ]"
  62. v-for="(itemt, indext) in categoryList"
  63. :key="indext"
  64. @click="handleClick('courseForm', 'categoryValue', itemt.value)"
  65. >
  66. <i
  67. v-if="itemt.value === courseForm.categoryValue"
  68. class="el-icon-success"
  69. ></i>
  70. {{ itemt.label }}
  71. </li>
  72. </ul>
  73. </div>
  74. </template>
  75. <template v-else-if="itemType === 'baozhi'">
  76. <div class="filt-item">
  77. <label>年份</label>
  78. <ul>
  79. <li
  80. :class="[itemy.value === baozhiForm.yearValue ? 'active' : '']"
  81. v-for="(itemy, indexy) in yearList"
  82. :key="indexy"
  83. @click="handleClick('baozhiForm', 'yearValue', itemy.value)"
  84. >
  85. <i
  86. v-if="itemy.value === baozhiForm.yearValue"
  87. class="el-icon-success"
  88. ></i>
  89. {{ itemy.label }}
  90. </li>
  91. </ul>
  92. </div>
  93. <div class="filt-item">
  94. <label>学段</label>
  95. <ul>
  96. <li
  97. :class="[
  98. items.study_phase === baozhiForm.studyValue ? 'active' : '',
  99. ]"
  100. v-for="(items, indexs) in baozhiStudyList"
  101. :key="indexs"
  102. @click="
  103. handleClick(
  104. 'baozhiForm',
  105. 'studyValue',
  106. items.study_phase,
  107. items.study_phase_name
  108. )
  109. "
  110. >
  111. <i
  112. v-if="items.study_phase === baozhiForm.studyValue"
  113. class="el-icon-success"
  114. ></i>
  115. {{ items.study_phase_name }}
  116. </li>
  117. </ul>
  118. </div>
  119. <!-- <div class="filt-item">
  120. <label>类型</label>
  121. <ul>
  122. <li
  123. :class="[itemt.value === baozhiForm.typeValue ? 'active' : '']"
  124. v-for="(itemt, indext) in typeList"
  125. :key="indext"
  126. @click="handleClick('baozhiForm', 'typeValue', itemt.value)"
  127. >
  128. <i
  129. v-if="itemt.value === baozhiForm.typeValue"
  130. class="el-icon-success"
  131. ></i>
  132. {{ itemt.label }}
  133. </li>
  134. </ul>
  135. </div> -->
  136. </template>
  137. <template v-else-if="itemType === 'huakan'">
  138. <div class="filt-item">
  139. <label>年份</label>
  140. <ul>
  141. <li
  142. :class="[itemy.value === huakanForm.yearValue ? 'active' : '']"
  143. v-for="(itemy, indexy) in yearList"
  144. :key="indexy"
  145. @click="handleClick('huakanForm', 'yearValue', itemy.value)"
  146. >
  147. <i
  148. v-if="itemy.value === huakanForm.yearValue"
  149. class="el-icon-success"
  150. ></i>
  151. {{ itemy.label }}
  152. </li>
  153. </ul>
  154. </div>
  155. <!-- <div class="filt-item">
  156. <label>学段</label>
  157. <ul>
  158. <li :class="[items.study_phase===huakanForm.studyValue?'active':'']" v-for="(items,indexs) in baozhiStudyList" :key="indexs" @click="handleClick('huakanForm','studyValue',items.study_phase,items.study_phase_name)">
  159. <i v-if="items.study_phase===huakanForm.studyValue" class="el-icon-success"></i>
  160. {{items.study_phase_name}}
  161. </li>
  162. </ul>
  163. </div> -->
  164. <!-- <div class="filt-item">
  165. <label>类型</label>
  166. <ul>
  167. <li
  168. :class="[itemt.value === huakanForm.typeValue ? 'active' : '']"
  169. v-for="(itemt, indext) in typeList"
  170. :key="indext"
  171. @click="handleClick('huakanForm', 'typeValue', itemt.value)"
  172. >
  173. <i
  174. v-if="itemt.value === huakanForm.typeValue"
  175. class="el-icon-success"
  176. ></i>
  177. {{ itemt.label }}
  178. </li>
  179. </ul>
  180. </div> -->
  181. </template>
  182. <template v-if="itemType === 'jingdu'">
  183. <div class="filt-item" v-if="!this.$route.query.from">
  184. <label>学段</label>
  185. <ul>
  186. <li
  187. :class="[
  188. items.study_phase === jingduForm.studyValue ? 'active' : '',
  189. ]"
  190. v-for="(items, indexs) in jingduStudyList"
  191. :key="indexs"
  192. @click="
  193. handleClick(
  194. 'jingduForm',
  195. 'studyValue',
  196. items.study_phase,
  197. items.study_phase_name
  198. )
  199. "
  200. >
  201. <i
  202. v-if="items.study_phase === jingduForm.studyValue"
  203. class="el-icon-success"
  204. ></i>
  205. {{ items.study_phase_name }}
  206. </li>
  207. </ul>
  208. </div>
  209. <div class="filt-item">
  210. <label>主题</label>
  211. <ul>
  212. <li
  213. :class="[
  214. itemy.value === jingduForm.categoryValue ? 'active' : '',
  215. ]"
  216. v-for="(itemy, indexy) in themeList"
  217. :key="indexy"
  218. @click="handleClick('jingduForm', 'categoryValue', itemy.value)"
  219. >
  220. <i
  221. v-if="itemy.value === baozhiForm.categoryValue"
  222. class="el-icon-success"
  223. ></i>
  224. {{ itemy.label }}
  225. </li>
  226. </ul>
  227. </div>
  228. </template>
  229. <template v-if="itemType === 'zhuanji'">
  230. <div class="filt-item">
  231. <label>年份</label>
  232. <ul>
  233. <li
  234. :class="[itemy.value === zhuanjiForm.yearValue ? 'active' : '']"
  235. v-for="(itemy, indexy) in yearList"
  236. :key="indexy"
  237. @click="handleClick('zhuanjiForm', 'yearValue', itemy.value)"
  238. >
  239. <i
  240. v-if="itemy.value === zhuanjiForm.yearValue"
  241. class="el-icon-success"
  242. ></i>
  243. {{ itemy.label }}
  244. </li>
  245. </ul>
  246. </div>
  247. <div class="filt-item">
  248. <label>学段</label>
  249. <ul>
  250. <li
  251. :class="[
  252. items.study_phase === zhuanjiForm.studyValue ? 'active' : '',
  253. ]"
  254. v-for="(items, indexs) in studyList"
  255. :key="indexs"
  256. @click="
  257. handleClick('zhuanjiForm', 'studyValue', items.study_phase)
  258. "
  259. >
  260. <i
  261. v-if="items.study_phase === zhuanjiForm.studyValue"
  262. class="el-icon-success"
  263. ></i>
  264. {{ items.study_phase_name }}
  265. </li>
  266. </ul>
  267. </div>
  268. </template>
  269. <div class="filt-item">
  270. <label>搜索</label>
  271. <el-input placeholder="搜索" v-model="searchValue" maxlength="20">
  272. <el-button
  273. slot="append"
  274. icon="el-icon-search"
  275. @click="handleData(1)"
  276. ></el-button>
  277. </el-input>
  278. </div>
  279. </div>
  280. </div>
  281. <div class="main">
  282. <BookListModule
  283. :Bookinfo="Bookinfo"
  284. :showAll="false"
  285. @changeStudy="changeStudy"
  286. :headerBg="'#00ADEF'"
  287. :headerBorder="'#5C5C5C'"
  288. :userBg="'rgba(0, 0, 0, 0.24)'"
  289. :LoginNavIndex="this.$route.query.from ? 0 : 1"
  290. />
  291. <el-pagination
  292. background
  293. :current-page="currentPages"
  294. :page-size="page_capacitys"
  295. :page-sizes="[8, 16, 24, 32, 40]"
  296. :total="Bookinfo.number"
  297. layout="total, prev, pager, next, sizes, jumper"
  298. @size-change="
  299. (val) => handleSizeChange(val, 'page_capacitys', 'currentPages')
  300. "
  301. @current-change="(val) => handleCurrentChange(val, 'currentPages')"
  302. v-if="Bookinfo.number > 0 && Bookinfo.bookType === 'ZB'"
  303. />
  304. <el-pagination
  305. background
  306. :current-page="currentPage"
  307. :page-size="page_capacity"
  308. :page-sizes="[10, 20, 30, 40, 50]"
  309. :total="Bookinfo.number"
  310. layout="total, prev, pager, next, sizes, jumper"
  311. @size-change="
  312. (val) => handleSizeChange(val, 'page_capacity', 'currentPage')
  313. "
  314. @current-change="(val) => handleCurrentChange(val, 'currentPage')"
  315. v-else-if="Bookinfo.number > 0 && Bookinfo.bookType !== 'ZB'"
  316. />
  317. </div>
  318. </div>
  319. </template>
  320. <script>
  321. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  322. //例如:import 《组件名称》from ‘《组件路径》';
  323. import Header from "../../components/Header.vue";
  324. import BookListModule from "@/components/common/BookAllListModule.vue";
  325. import { getLogin } from "@/api/ajax";
  326. export default {
  327. //import引入的组件需要注入到对象中才能使用
  328. components: { Header, BookListModule },
  329. props: {},
  330. data() {
  331. //这里存放数据
  332. return {
  333. Bookinfo: {
  334. BookList: [
  335. {
  336. skeleton: true,
  337. },
  338. {
  339. skeleton: true,
  340. },
  341. {
  342. skeleton: true,
  343. },
  344. {
  345. skeleton: true,
  346. },
  347. {
  348. skeleton: true,
  349. },
  350. {
  351. skeleton: true,
  352. },
  353. {
  354. skeleton: true,
  355. },
  356. {
  357. skeleton: true,
  358. },
  359. {
  360. skeleton: true,
  361. },
  362. {
  363. skeleton: true,
  364. },
  365. ],
  366. name: "",
  367. number: 0,
  368. numberstr: "",
  369. bookType: null,
  370. },
  371. nameTypeCn: this.$route.query.name
  372. ? decodeURIComponent(this.$route.query.name)
  373. : "全部画刊",
  374. itemType: this.$route.query.type ? this.$route.query.type : "huakan",
  375. yearList: [
  376. {
  377. value: -1,
  378. label: "全部",
  379. },
  380. ],
  381. studyList: [
  382. {
  383. study_phase_name: "全部",
  384. study_phase: -1,
  385. },
  386. {
  387. study_phase_name: "全学段",
  388. study_phase: 100,
  389. },
  390. {
  391. study_phase_name: "小学",
  392. study_phase: 11,
  393. },
  394. {
  395. study_phase_name: "初中",
  396. study_phase: 20,
  397. },
  398. {
  399. study_phase_name: "初一",
  400. study_phase: 21,
  401. },
  402. {
  403. study_phase_name: "初二",
  404. study_phase: 22,
  405. },
  406. {
  407. study_phase_name: "初三",
  408. study_phase: 23,
  409. },
  410. {
  411. study_phase_name: "高中",
  412. study_phase: 30,
  413. },
  414. {
  415. study_phase_name: "高一",
  416. study_phase: 31,
  417. },
  418. {
  419. study_phase_name: "高二",
  420. study_phase: 32,
  421. },
  422. {
  423. study_phase_name: "高三",
  424. study_phase: 33,
  425. },
  426. ],
  427. baozhiStudyList: [],
  428. categoryList: [
  429. {
  430. value: "LB",
  431. label: "录播",
  432. },
  433. {
  434. value: "ZB",
  435. label: "直播",
  436. },
  437. ],
  438. typeList: [
  439. {
  440. value: 0,
  441. label: "单本",
  442. },
  443. {
  444. value: 1,
  445. label: "专辑",
  446. },
  447. ],
  448. courseForm: {
  449. studyValue: window.localStorage.getItem("courseFormstudyValue")
  450. ? window.localStorage.getItem("courseFormstudyValue") * 1
  451. : -1,
  452. categoryValue:
  453. this.$route.query.type && this.$route.query.type === "kecheng"
  454. ? window.localStorage.getItem("courseFormcategoryValue")
  455. ? window.localStorage.getItem("courseFormcategoryValue")
  456. : "LB"
  457. : "LB",
  458. },
  459. baozhiForm: {
  460. yearValue: window.localStorage.getItem("baozhiFormyearValue")
  461. ? window.localStorage.getItem("baozhiFormyearValue") * 1
  462. : -1,
  463. studyValue: window.localStorage.getItem("baozhiFormstudyValue")
  464. ? window.localStorage.getItem("baozhiFormstudyValue") * 1
  465. : -1,
  466. typeValue: window.localStorage.getItem("baozhiFormtypeValue")
  467. ? window.localStorage.getItem("baozhiFormtypeValue") * 1
  468. : 0,
  469. },
  470. huakanForm: {
  471. yearValue: window.localStorage.getItem("huakanFormyearValue")
  472. ? window.localStorage.getItem("huakanFormyearValue") * 1
  473. : -1,
  474. studyValue: -1,
  475. typeValue: window.localStorage.getItem("huakanFormtypeValue")
  476. ? window.localStorage.getItem("huakanFormtypeValue") * 1
  477. : 0,
  478. },
  479. jingduForm: {
  480. studyValue: this.$route.query.from
  481. ? this.$route.query.from * 1
  482. : window.localStorage.getItem("jingduFormstudyValue")
  483. ? window.localStorage.getItem("jingduFormstudyValue") * 1
  484. : 11,
  485. categoryValue: window.localStorage.getItem("jingduFormcategoryValue")
  486. ? window.localStorage.getItem("jingduFormcategoryValue")
  487. : "",
  488. },
  489. zhuanjiForm: {
  490. studyValue: this.$route.query.from
  491. ? this.$route.query.from * 1
  492. : window.localStorage.getItem("zhuanjiFormstudyValue")
  493. ? window.localStorage.getItem("zhuanjiFormstudyValue") * 1
  494. : 11,
  495. yearValue: window.localStorage.getItem("zhuanjiFormyearValue")
  496. ? window.localStorage.getItem("zhuanjiFormyearValue") * 1
  497. : -1,
  498. },
  499. currentPage: 1, // 当前页码
  500. page_capacity: 10, // 每页条数
  501. currentPages: 1,
  502. page_capacitys: 8, // 每页条数
  503. searchValue: "",
  504. titleName:
  505. this.itemType === "jingdu"
  506. ? window.localStorage.getItem("jingduFormstudyValueName")
  507. ? window.localStorage.getItem("jingduFormstudyValueName")
  508. : this.itemType === "baozhi"
  509. ? window.localStorage.getItem("baozhiFormstudyValueName")
  510. : this.itemType === "huakan"
  511. ? window.localStorage.getItem("huakanFormstudyValueName")
  512. ? window.localStorage.getItem("baozhiFormstudyValueName")
  513. : ""
  514. : ""
  515. : "",
  516. themeList: [],
  517. jingduStudyList: [
  518. {
  519. study_phase: 11,
  520. study_phase_name: "小学",
  521. },
  522. {
  523. study_phase: 21,
  524. study_phase_name: "初一",
  525. },
  526. {
  527. study_phase: 22,
  528. study_phase_name: "初二",
  529. },
  530. {
  531. study_phase: 23,
  532. study_phase_name: "初三",
  533. },
  534. ],
  535. };
  536. },
  537. //计算属性 类似于data概念
  538. computed: {},
  539. //监控data中数据变化
  540. watch: {},
  541. //方法集合
  542. methods: {
  543. handleClick(form, file, value, name) {
  544. window.localStorage.setItem(form + file, value);
  545. if (form === "courseForm" && file === "categoryValue" && value === "ZB") {
  546. this.courseForm.studyValue = -1;
  547. } else if (
  548. form === "courseForm" &&
  549. file === "categoryValue" &&
  550. value === "LB"
  551. ) {
  552. this.courseForm.studyValue = window.localStorage.getItem(
  553. "courseFormstudyValue"
  554. )
  555. ? window.localStorage.getItem("courseFormstudyValue") * 1
  556. : -1;
  557. }
  558. if (
  559. form === "courseForm" &&
  560. file === "studyValue" &&
  561. this.courseForm.categoryValue === "ZB"
  562. ) {
  563. return false;
  564. }
  565. if (name) {
  566. this.titleName = name;
  567. window.localStorage.setItem(form + "studyValueName", name);
  568. }
  569. this[form][file] = value;
  570. this.currentPage = 1;
  571. this.currentPages = 1;
  572. this.handleData();
  573. },
  574. handleData(val) {
  575. if (val) {
  576. if (this.courseForm.categoryValue === "ZB") {
  577. this.currentPages = val;
  578. } else {
  579. this.currentPage = val;
  580. }
  581. // this.pageNumber = val
  582. }
  583. let MethodName = "/ShopServer/Client/ShopHomeQuery/PageQueryCourseList";
  584. let data = {
  585. page_capacity:
  586. this.courseForm.categoryValue === "ZB"
  587. ? this.page_capacitys
  588. : this.page_capacity,
  589. cur_page:
  590. this.courseForm.categoryValue === "ZB"
  591. ? this.currentPages
  592. : this.currentPage,
  593. search_content: this.searchValue.trim(),
  594. };
  595. if (this.itemType === "kecheng") {
  596. (data.course_type = this.courseForm.categoryValue),
  597. (data.study_phase = this.courseForm.studyValue);
  598. getLogin(MethodName, data)
  599. .then((res) => {
  600. if (res.status === 1) {
  601. this.Bookinfo = {
  602. name: this.courseForm.categoryValue === "LB" ? "课程" : "直播",
  603. number: res.total_count,
  604. numberstr: "共" + res.total_count + "期",
  605. study: this.courseForm.studyValue,
  606. BookList: res.course_list,
  607. bookType: this.courseForm.categoryValue,
  608. };
  609. }
  610. })
  611. .catch(() => {});
  612. } else if (this.itemType === "baozhi") {
  613. MethodName = "/ShopServer/Client/ShopHomeQuery/PageQueryIssueList";
  614. data.year_label = this.baozhiForm.yearValue;
  615. data.study_phase = this.baozhiForm.studyValue;
  616. data.comb_flag = -1;
  617. data.album_flag = this.baozhiForm.typeValue;
  618. data.goods_type = 2;
  619. getLogin(MethodName, data)
  620. .then((res) => {
  621. if (res.status === 1) {
  622. res.issue_list.forEach((item) => {
  623. item.course_type = "baozhi";
  624. });
  625. this.Bookinfo = {
  626. name: this.titleName,
  627. number: res.total_count,
  628. numberstr: "共" + res.total_count + "期",
  629. study: this.baozhiForm.studyValue,
  630. BookList: res.issue_list,
  631. bookType: "baozhi",
  632. };
  633. }
  634. })
  635. .catch(() => {});
  636. } else if (this.itemType === "huakan") {
  637. MethodName = "/ShopServer/Client/ShopHomeQuery/PageQueryIssueList";
  638. data.year_label = this.huakanForm.yearValue;
  639. data.study_phase = -1;
  640. data.comb_flag = -1;
  641. data.album_flag = this.huakanForm.typeValue;
  642. data.goods_type = 4;
  643. getLogin(MethodName, data)
  644. .then((res) => {
  645. if (res.status === 1) {
  646. res.issue_list.forEach((item) => {
  647. item.course_type = "huakan";
  648. });
  649. this.Bookinfo = {
  650. name: "",
  651. number: res.total_count,
  652. numberstr: "共" + res.total_count + "期",
  653. study: this.huakanForm.studyValue,
  654. BookList: res.issue_list,
  655. bookType: "huakan",
  656. };
  657. }
  658. })
  659. .catch(() => {});
  660. } else if (this.itemType === "jingdu") {
  661. if (this.$route.query.form) {
  662. MethodName =
  663. "/ShopServer/Client/BookshelfQuery/PageQueryMyIreadArticleList_UsePeriod";
  664. data.label = this.jingduForm.categoryValue;
  665. data.study_phase = this.$route.query.form * 1;
  666. getLogin(MethodName, data)
  667. .then((res) => {
  668. if (res.status === 1) {
  669. this.Bookinfo = {
  670. name: this.titleName,
  671. number: res.total_count,
  672. numberstr: "共" + res.total_count + "期",
  673. study: this.jingduForm.studyValue,
  674. BookList: res.iread_article_list,
  675. bookType: "jingdu",
  676. };
  677. }
  678. })
  679. .catch(() => {});
  680. } else {
  681. MethodName =
  682. "/ShopServer/Client/ShopHomeQuery/PageQueryIreadArticleList";
  683. data.label = this.jingduForm.categoryValue;
  684. data.study_phase = this.jingduForm.studyValue;
  685. getLogin(MethodName, data)
  686. .then((res) => {
  687. if (res.status === 1) {
  688. this.Bookinfo = {
  689. name: this.titleName,
  690. number: res.total_count,
  691. numberstr: "共" + res.total_count + "期",
  692. study: this.jingduForm.studyValue,
  693. BookList: res.iread_article_list,
  694. bookType: "jingdu",
  695. };
  696. }
  697. })
  698. .catch(() => {});
  699. }
  700. } else if (this.itemType === "zhuanji") {
  701. MethodName = "/ShopServer/Client/ShopHomeQuery/PageQueryAlbumList";
  702. data.year_label = this.zhuanjiForm.yearValue;
  703. data.study_phase = this.zhuanjiForm.studyValue;
  704. getLogin(MethodName, data)
  705. .then((res) => {
  706. if (res.status === 1) {
  707. res.album_list.forEach((item) => {
  708. item.course_type = "zhuanji";
  709. item.type = 20;
  710. });
  711. this.Bookinfo = {
  712. name: "专辑",
  713. number: res.total_count,
  714. numberstr: "共" + res.total_count + "期",
  715. study: this.zhuanjiForm.studyValue,
  716. BookList: res.album_list,
  717. bookType: "zhuanji",
  718. };
  719. }
  720. })
  721. .catch(() => {});
  722. }
  723. },
  724. handleSizeChange(val, type, page) {
  725. this[type] = val;
  726. this[page] = 1;
  727. this.handleData();
  728. },
  729. handleCurrentChange(val, type) {
  730. this[type] = val;
  731. this.handleData();
  732. },
  733. changeStudy(form, value) {
  734. this.currentPage = 1;
  735. this.currentPages = 1;
  736. this[form].studyValue = value;
  737. this.handleData();
  738. },
  739. // 学段列表
  740. getStudyList() {
  741. let MethodName = "/OrgServer/DictManager/GetStudyPhaseList";
  742. getLogin(MethodName, {})
  743. .then((res) => {
  744. if (res.status === 1) {
  745. this.baozhiStudyList = res.study_phase_list;
  746. this.baozhiForm.studyValue = window.localStorage.getItem(
  747. "baozhiFormstudyValue"
  748. )
  749. ? window.localStorage.getItem("baozhiFormstudyValue") * 1
  750. : res.study_phase_list[0]
  751. ? res.study_phase_list[0].study_phase
  752. : -1;
  753. this.huakanForm.studyValue = window.localStorage.getItem(
  754. "huakanFormstudyValue"
  755. )
  756. ? window.localStorage.getItem("huakanFormstudyValue") * 1
  757. : res.study_phase_list[0]
  758. ? res.study_phase_list[0].study_phase
  759. : -1;
  760. if (this.itemType === "baozhi") {
  761. this.titleName = window.localStorage.getItem(
  762. "baozhiFormstudyValueName"
  763. )
  764. ? window.localStorage.getItem("baozhiFormstudyValueName")
  765. : res.study_phase_list[0]
  766. ? res.study_phase_list[0].study_phase_name
  767. : "";
  768. } else if (this.itemType === "huakan") {
  769. this.titleName = window.localStorage.getItem(
  770. "huakanFormstudyValueName"
  771. )
  772. ? window.localStorage.getItem("huakanFormstudyValueName")
  773. : res.study_phase_list[0]
  774. ? res.study_phase_list[0].study_phase_name
  775. : "";
  776. } else if (this.itemType === "jingdu") {
  777. this.titleName = window.localStorage.getItem(
  778. "jingduFormstudyValueName"
  779. )
  780. ? window.localStorage.getItem("jingduFormstudyValueName")
  781. : res.study_phase_list[0]
  782. ? res.study_phase_list[0].study_phase_name
  783. : "";
  784. } else if (this.itemType === "kecheng") {
  785. this.titleName = window.localStorage.getItem(
  786. "courseFormstudyValueName"
  787. )
  788. ? window.localStorage.getItem("courseFormstudyValueName")
  789. : res.study_phase_list[0]
  790. ? res.study_phase_list[0].study_phase_name
  791. : "";
  792. }
  793. }
  794. })
  795. .catch(() => {});
  796. },
  797. // 获取年份列表
  798. getYearList() {
  799. this.yearList = [
  800. {
  801. value: -1,
  802. label: "全部",
  803. },
  804. ];
  805. let yearList = [];
  806. let MethodName = "/ShopServer/Client/ShopHomeQuery/GetIssueYearLabelList";
  807. getLogin(MethodName, {
  808. goods_type: this.itemType === "baozhi" ? 2 : 4,
  809. })
  810. .then((res) => {
  811. if (res.status === 1) {
  812. res.year_label_list.forEach((nowYear) => {
  813. let obj = {
  814. value: nowYear,
  815. label: nowYear,
  816. };
  817. yearList.push(obj);
  818. });
  819. this.yearList = this.yearList.concat(yearList);
  820. }
  821. })
  822. .catch(() => {
  823. this.loading = false;
  824. });
  825. },
  826. getLabelList() {
  827. this.themeList = [
  828. {
  829. value: "",
  830. label: "全部",
  831. },
  832. ];
  833. let yearList = [];
  834. let MethodName =
  835. "/ShopServer/Client/ShopHomeQuery/GetIreadArticleLabelList";
  836. getLogin(MethodName, {})
  837. .then((res) => {
  838. if (res.status === 1) {
  839. res.label_list.forEach((nowYear) => {
  840. let obj = {
  841. value: nowYear,
  842. label: nowYear,
  843. };
  844. yearList.push(obj);
  845. });
  846. this.themeList = this.themeList.concat(yearList);
  847. }
  848. })
  849. .catch(() => {
  850. this.loading = false;
  851. });
  852. },
  853. },
  854. //生命周期 - 创建完成(可以访问当前this实例)
  855. created() {
  856. if (this.itemType === "jingdu") {
  857. this.getLabelList();
  858. }
  859. this.getStudyList();
  860. this.getYearList();
  861. this.handleData();
  862. },
  863. //生命周期 - 挂载完成(可以访问DOM元素)
  864. mounted() {
  865. let _this = this;
  866. let input = document.querySelector("input");
  867. input.addEventListener("keyup", function (event) {
  868. // 判断是否按下回车键
  869. if (event.keyCode === 13) {
  870. // 回车键被按下,执行你想要的操作
  871. _this.handleData(1);
  872. }
  873. });
  874. },
  875. //生命周期-创建之前
  876. beforeCreated() {},
  877. //生命周期-挂载之前
  878. beforeMount() {},
  879. //生命周期-更新之前
  880. beforUpdate() {},
  881. //生命周期-更新之后
  882. updated() {},
  883. //生命周期-销毁之前
  884. beforeDestory() {},
  885. //生命周期-销毁完成
  886. destoryed() {},
  887. //如果页面有keep-alive缓存功能,这个函数会触发
  888. activated() {},
  889. };
  890. </script>
  891. <style lang="scss" scoped>
  892. /* @import url(); 引入css类 */
  893. .bookCity {
  894. min-height: 100%;
  895. padding-bottom: 50px;
  896. .banner {
  897. width: 100%;
  898. margin-bottom: 40px;
  899. font-size: 0;
  900. padding-top: 32px;
  901. background: linear-gradient(180deg, #00adef 0%, rgba(0, 173, 239, 0) 100%);
  902. img {
  903. max-width: 100%;
  904. }
  905. .image {
  906. width: 100%;
  907. height: 100%;
  908. display: block;
  909. }
  910. }
  911. .filt-box {
  912. border-bottom: 1px solid #e5e6eb;
  913. background: #ffffff;
  914. .filt-inner {
  915. width: 1200px;
  916. margin: 0 auto;
  917. padding: 40px 0;
  918. h2 {
  919. font-weight: 600;
  920. font-size: 16px;
  921. line-height: 24px;
  922. color: #2f3742;
  923. padding: 28px 0;
  924. margin: 0;
  925. }
  926. .filt-item {
  927. display: flex;
  928. margin-bottom: 8px;
  929. label {
  930. width: 52px;
  931. font-weight: 400;
  932. font-size: 16px;
  933. line-height: 32px;
  934. color: #2f3742;
  935. flex-shrink: 0;
  936. }
  937. ul {
  938. list-style: none;
  939. display: flex;
  940. flex-flow: wrap;
  941. padding: 0;
  942. margin: 0;
  943. li {
  944. margin: 0 8px 16px 0;
  945. background: #f2f3f5;
  946. border-radius: 2px;
  947. padding: 3px 11px;
  948. font-weight: 500;
  949. font-size: 16px;
  950. line-height: 24px;
  951. color: #2f3742;
  952. cursor: pointer;
  953. border: 1px solid #f2f3f5;
  954. height: 32px;
  955. box-sizing: border-box;
  956. display: flex;
  957. align-items: center;
  958. &:hover {
  959. color: #165dff;
  960. }
  961. &.not-allow {
  962. cursor: not-allowed;
  963. background: #f2f3f5;
  964. color: #c1c5cd;
  965. }
  966. &.active {
  967. color: #165dff;
  968. border-color: #165dff;
  969. background: #ffffff;
  970. .el-icon-success {
  971. margin-right: 4px;
  972. font-size: 12px;
  973. margin-top: 2px;
  974. }
  975. }
  976. &.not-allow.active {
  977. color: #cedcfe;
  978. border-color: #cedcfe;
  979. }
  980. }
  981. }
  982. .el-input {
  983. width: 240px;
  984. height: 32px;
  985. background: #f2f3f5;
  986. border-radius: 2px;
  987. }
  988. }
  989. }
  990. }
  991. .main {
  992. width: 1200px;
  993. margin: 52px auto;
  994. }
  995. }
  996. </style>
  997. <style lang="scss">
  998. .bookCity {
  999. .el-breadcrumb__inner.is-link {
  1000. color: #4e5969;
  1001. &:hover {
  1002. color: #165dff;
  1003. }
  1004. }
  1005. .el-breadcrumb__separator {
  1006. color: #c9cdd4;
  1007. }
  1008. .el-breadcrumb__item:last-child .el-breadcrumb__inner {
  1009. color: #1d2129;
  1010. font-weight: 500;
  1011. }
  1012. .filt-box {
  1013. input {
  1014. height: 32px;
  1015. line-height: 32px;
  1016. background: #f2f3f5;
  1017. border: none;
  1018. }
  1019. .el-input__icon {
  1020. line-height: 32px;
  1021. cursor: pointer;
  1022. color: #4e5969 !important;
  1023. }
  1024. .el-input-group__append {
  1025. background: #f2f3f5;
  1026. border: none;
  1027. }
  1028. .el-button {
  1029. padding: 9px 12px;
  1030. }
  1031. }
  1032. .el-pagination {
  1033. text-align: left;
  1034. }
  1035. }
  1036. </style>