index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <template>
  2. <div class="goods_topic">
  3. <Header></Header>
  4. <section class="section">
  5. <div class="section__header">
  6. <div class="container">
  7. <el-breadcrumb separator="/">
  8. <el-breadcrumb-item :to="{ path: '/index' }">首页</el-breadcrumb-item>
  9. <el-breadcrumb-item>商品专题</el-breadcrumb-item>
  10. </el-breadcrumb>
  11. </div>
  12. </div>
  13. <div class="course_btns">
  14. <div class="meun_btns">
  15. <div class="btns" @click="changeCouMeun()">
  16. 课程导航
  17. </div>
  18. <div class="slide-list">
  19. <div
  20. class="slide-list__item"
  21. v-for="(type, typeItem) in typeList"
  22. :key="'type' + typeItem"
  23. >
  24. <div class="title" @click="goCourse(type)">
  25. {{ type.educationName }}
  26. </div>
  27. <ul class="nav">
  28. <li
  29. v-for="(slideItem, slideIndex) in slideList[typeItem]"
  30. :key="'item' + slideIndex"
  31. @click="goCourse(slideItem)"
  32. >
  33. <div class="text">
  34. {{ slideItem.aliasName }}
  35. </div>
  36. </li>
  37. </ul>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="mains">
  43. <div class="content_up">
  44. <div class="banner_one">
  45. <div class="one_bg">
  46. <img class="bgimg" src="@/assets/topic/one_bg.png" alt="" />
  47. </div>
  48. </div>
  49. <div class="banner_two">
  50. <catalogue :goodsId='goodsId' :topicId="topicId"></catalogue>
  51. </div>
  52. </div>
  53. <div class="topic_detail">
  54. <div class="titles">
  55. <img src="@/assets/topic/icon_left.png" alt="" />
  56. <span class="scheme">通关方案</span>
  57. <img src="@/assets/topic/icon_right.png" alt="" />
  58. </div>
  59. <div class="min_title">2023年二级建造师考前培训</div>
  60. <div class="details">
  61. <div class="detail_one">
  62. <div class="deatil_titles">黄金基础班</div>
  63. <div class="detail_mid">
  64. <div class="mid_item">
  65. <div class="lefts">全科</div>
  66. <div class="rights">
  67. <span class="price">¥980</span>
  68. <div class="right_buy" @click="togoBuy(1, 1)">立即购买</div>
  69. </div>
  70. </div>
  71. <div class="mid_item">
  72. <div class="lefts">公共单科</div>
  73. <div class="rights">
  74. <span class="price">¥350</span>
  75. <div class="right_buy" @click="togoBuy(2, 1)">立即购买</div>
  76. </div>
  77. </div>
  78. <div class="mid_item">
  79. <div class="lefts">实务单科</div>
  80. <div class="rights">
  81. <span class="price">¥500</span>
  82. <div class="right_buy" @click="togoBuy(3, 1)">立即购买</div>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="down_img">
  87. <img class="l_img" src="@/assets/topic/detail_one.png" alt="" />
  88. </div>
  89. </div>
  90. <div class="detail_one">
  91. <div class="deatil_titles two">钻石强化班</div>
  92. <div class="detail_mid">
  93. <div class="mid_item">
  94. <div class="lefts">全科</div>
  95. <div class="rights">
  96. <span class="price">¥1280</span>
  97. <div class="right_buy" @click="togoBuy(1, 2)">立即购买</div>
  98. </div>
  99. </div>
  100. <div class="mid_item">
  101. <div class="lefts">公共单科</div>
  102. <div class="rights">
  103. <span class="price">¥450</span>
  104. <div class="right_buy" @click="togoBuy(2, 2)">立即购买</div>
  105. </div>
  106. </div>
  107. <div class="mid_item">
  108. <div class="lefts">实务单科</div>
  109. <div class="rights">
  110. <span class="price">¥700</span>
  111. <div class="right_buy" @click="togoBuy(3, 2)">立即购买</div>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="down_img">
  116. <img class="l_img" src="@/assets/topic/detail_two.png" alt="" />
  117. </div>
  118. </div>
  119. <div class="detail_one">
  120. <div class="deatil_titles three">至尊私塾班</div>
  121. <div class="detail_mid">
  122. <div class="mid_item">
  123. <div class="lefts">全科</div>
  124. <div class="rights">
  125. <span class="price">¥1980</span>
  126. <div class="right_buy" @click="togoBuy(1, 3)">立即购买</div>
  127. </div>
  128. </div>
  129. <div class="mid_item">
  130. <div class="lefts">公共单科</div>
  131. <div class="rights">
  132. <span class="price">¥700</span>
  133. <div class="right_buy" @click="togoBuy(2, 3)">立即购买</div>
  134. </div>
  135. </div>
  136. <div class="mid_item">
  137. <div class="lefts">实务单科</div>
  138. <div class="rights">
  139. <span class="price">¥900</span>
  140. <div class="right_buy" @click="togoBuy(3, 3)">立即购买</div>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="down_img">
  145. <img class="l_img" src="@/assets/topic/detail_three.png" alt="" />
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. </section>
  152. <!-- 弹窗 -->
  153. <buy-dialog :buyModal.sync="buyModal" :topicId="topicId" :subjectType="subjectType" :type="type"></buy-dialog>
  154. <ToolBar></ToolBar>
  155. <Footer></Footer>
  156. </div>
  157. </template>
  158. <script>
  159. import Header from "@/components/header/index.vue";
  160. import Footer from "@/components/footer/index.vue";
  161. import ToolBar from "@/components/toolbar/index.vue";
  162. import buyDialog from './components/buyDialog.vue'
  163. import catalogue from './components/catalogue.vue'
  164. export default {
  165. name: '',
  166. components: { Header, Footer, ToolBar, buyDialog, catalogue },
  167. data() {
  168. return {
  169. buyModal: false,
  170. topicId: '',
  171. subjectType: 0,
  172. type: 0,
  173. goodsInfo: {},
  174. // goodsData: {},
  175. vid: '',
  176. vidzb: '',
  177. vodPlayerJs: "https://player.polyv.net/script/player.js",
  178. playerJs: "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
  179. uidzb: "egsxlptzdq",
  180. menuTab: [
  181. {
  182. name: "1",
  183. label: "章节目录",
  184. }
  185. ],
  186. courseTabIndex: "1",
  187. courseId: "",
  188. goodsId: "",
  189. gradeId: "",
  190. orderGoodsId: "",
  191. needOpen: true, //是否需要一进来展开第一章节
  192. menuIndex: [], //需要展开的章节索引值
  193. courseList: [],
  194. s_courseList: [],
  195. goodsAuditionConfigIdList: [],
  196. listenConfigList: [],
  197. courserIndex: 0,
  198. goodsDetail: {},
  199. goodsExamConfig: [],
  200. subList: [],
  201. subIndex: 0,
  202. typeList: [],
  203. slideList: [],
  204. showMeun: false,
  205. }
  206. },
  207. created() {
  208. this.topicId = this.$route.query.topicId || 1
  209. this.getgoodsInfo()
  210. this.educationTypeList()
  211. },
  212. methods: {
  213. educationTypeList() {
  214. this.$request.educationTypeList().then((res) => {
  215. this.typeList = res.rows.slice(0, 5);
  216. this.typeList.forEach((typeItem, index) => {
  217. this.businessList(typeItem.id, index);
  218. });
  219. });
  220. },
  221. businessList(educationId, index) {
  222. this.$request
  223. .businessList({ educationId })
  224. .then((res) => {
  225. let rows = res.rows.filter((item) => item.aliasName)
  226. this.$set(this.slideList, index, rows);
  227. if (rows.length >= 2) {
  228. let newRows = rows.slice(0, 2);
  229. let length = 0;
  230. newRows.forEach((row) => {
  231. let str = row.projectName + "-" + row.businessName;
  232. length = length + str.length;
  233. });
  234. if (length >= 17) {
  235. this.$set(this.typeList[index], "list", rows.slice(0, 1));
  236. } else {
  237. this.$set(this.typeList[index], "list", rows.slice(0, 2));
  238. }
  239. } else {
  240. this.$set(this.typeList[index], "list", rows);
  241. }
  242. console.log('this.typeList:',this.slideList, this.typeList)
  243. })
  244. .catch((err) => {
  245. console.log(err, "err");
  246. });
  247. },
  248. changeCouMeun() {
  249. this.showMeun = !this.showMeun
  250. },
  251. goCourse(item) {
  252. if (item.topicId) {
  253. this.topicId = item.topicId
  254. return
  255. }
  256. this.$router.push({
  257. path: "/course-list",
  258. query: {
  259. educationId: item.educationId ? item.educationId : item.id || "",
  260. projectId: item.projectId || "",
  261. businessId: item.educationId ? item.id : "",
  262. },
  263. });
  264. },
  265. getgoodsInfo() {
  266. this.$axios({
  267. url: `/app/common/get/goodsInfo/${this.topicId}`,
  268. method: 'get',
  269. noToken: true
  270. }).then(async(res) => {
  271. if (res.code == 200) {
  272. this.goodsInfo = res.data
  273. this.goodsId = res.data.goodsId
  274. }
  275. })
  276. },
  277. togoBuy(subjectType, type) {
  278. this.subjectType = subjectType
  279. this.type = type
  280. this.buyModal = true
  281. },
  282. }
  283. }
  284. </script>
  285. <style lang="scss" scoped>
  286. .goods_topic {
  287. width: 100%;
  288. .section {
  289. &__header {
  290. height: 40px;
  291. display: flex;
  292. align-items: center;
  293. padding: 0 20px;
  294. }
  295. }
  296. .course_btns {
  297. padding: 10px 10px 10px 115px;
  298. .meun_btns {
  299. width: 100px;
  300. .btns {
  301. width: 96px;
  302. height: 32px;
  303. line-height: 32px;
  304. text-align: center;
  305. background: #3F8DFD;
  306. border-radius: 4px;
  307. color: #fff;
  308. font-size: 14px;
  309. cursor: pointer;
  310. }
  311. &:hover {
  312. .slide-list {
  313. display: block;
  314. }
  315. }
  316. .slide-list {
  317. display: none;
  318. transition: all 0.3s;
  319. width: 672px;
  320. background: #F8F8F8;
  321. position: absolute;
  322. top: 163px;
  323. left: 115px;
  324. padding-left: 24px;
  325. z-index: 10;
  326. border-radius: 4px;
  327. &__item {
  328. min-height: 80px;
  329. display: flex;
  330. align-items: center;
  331. border-bottom: 1px solid #ddd;
  332. &:nth-last-of-type(1) {
  333. border: 0;
  334. }
  335. .title {
  336. cursor: pointer;
  337. color: #fff;
  338. width: 120px;
  339. height: 28px;
  340. border: 1px solid #ffffff;
  341. border-radius: 14px;
  342. background: #3f8dfd;
  343. line-height: 26px;
  344. text-align: center;
  345. border-radius: 15px;
  346. margin-right: 10px;
  347. }
  348. .nav {
  349. flex: 1;
  350. display: flex;
  351. flex-wrap: wrap;
  352. li {
  353. margin: 9px 24px 9px 0;
  354. display: flex;
  355. .text {
  356. cursor: pointer;
  357. font-size: 14px;
  358. font-family: Microsoft YaHei;
  359. font-weight: 400;
  360. color: #666;
  361. }
  362. }
  363. }
  364. }
  365. }
  366. }
  367. }
  368. .mains {
  369. // width: 100%;
  370. // padding: 0px 116px;
  371. .content_up {
  372. width: 100%;
  373. height: 808px;
  374. .banner_one {
  375. width: 100%;
  376. height: 280px;
  377. background: url('../../assets/topic/banner_one.png') center center no-repeat;
  378. // background-size: 100% 100%;
  379. // display: flex;
  380. // align-items: center;
  381. // justify-content: center;
  382. .one_bg {
  383. width: 1056px;
  384. height: 280px;
  385. margin: 0 auto;
  386. >img {
  387. width: 100%;
  388. height: 100%;
  389. }
  390. }
  391. }
  392. .banner_two {
  393. width: 100%;
  394. height: 528px;
  395. background: url('../../assets/topic/banner_two.png') center center no-repeat;
  396. background-size: 100% 100%;
  397. }
  398. }
  399. .topic_detail {
  400. display: flex;
  401. flex-direction: column;
  402. align-items: center;
  403. width: 100%;
  404. // height: 3444px;
  405. height: 3100px;
  406. background: url('../../assets/topic/topic_bg.png') center center no-repeat;
  407. background-size: 100% 100%;
  408. .titles {
  409. margin-top: 109px;
  410. >img {
  411. width: 32px;
  412. height: 20px;
  413. }
  414. .scheme {
  415. font-size: 48px;
  416. font-weight: bold;
  417. color: #363543;
  418. margin: 0px 40px;
  419. }
  420. }
  421. .min_title {
  422. margin: 13px 0px 50px;
  423. font-size: 28px;
  424. font-weight: 500;
  425. color: #363543;
  426. }
  427. }
  428. .details {
  429. display: flex;
  430. justify-content: center;
  431. align-items: center;
  432. margin-right: -20px;
  433. .detail_one {
  434. width: 358px;
  435. height: 2753px;
  436. background-color: #fff;
  437. border-radius: 8px;
  438. margin-right: 20px;
  439. @media screen and (max-width: 1370px){
  440. width: 300px;
  441. }
  442. }
  443. .deatil_titles {
  444. width: 100%;
  445. height: 110px;
  446. line-height: 110px;
  447. text-align: center;
  448. border-radius: 8px 8px 0px 0px;
  449. background: linear-gradient(45deg, #71A9F6 0%, #1658DA 100%);
  450. font-size: 32px;
  451. font-weight: bold;
  452. color: #FFFFFF;
  453. &.two {
  454. background: linear-gradient(45deg, #FE8D6D 0%, #ED3531 100%);
  455. }
  456. &.three {
  457. background: linear-gradient(45deg, #E3BC79 0%, #BF7D2E 100%);
  458. }
  459. }
  460. .detail_mid {
  461. width: 100%;
  462. padding: 0px 24px;
  463. .mid_item {
  464. width: 100%;
  465. height: 74px;
  466. border-bottom: 1px solid #EAEAEA;
  467. display: flex;
  468. align-items: center;
  469. justify-content: space-between;
  470. }
  471. .lefts {
  472. font-size: 18px;
  473. font-weight: bold;
  474. color: #363543;
  475. }
  476. .rights {
  477. display: flex;
  478. }
  479. .price {
  480. font-size: 18px;
  481. font-weight: 500;
  482. color: #FC3F3F;
  483. margin-right: 20px;
  484. }
  485. .right_buy {
  486. width: 76px;
  487. height: 28px;
  488. line-height: 28px;
  489. text-align: center;
  490. background: #FC3F3F;
  491. border-radius: 50px;
  492. font-size: 13px;
  493. font-weight: 500;
  494. color: #FFFFFF;
  495. cursor: pointer;
  496. }
  497. }
  498. .down_img {
  499. width: 100%;
  500. height: 2369px;
  501. >.l_img {
  502. width: 100%;
  503. height: 100%;
  504. display: block;
  505. }
  506. }
  507. }
  508. }
  509. }
  510. </style>