index.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102
  1. <template>
  2. <view class="index">
  3. <nav-logo :isShowLogo="true"></nav-logo>
  4. <view class="header_box">
  5. <u-swiper :list="list" :autoplay="autoplay" :interval="interval" :duration="duration" :height="swiperHeight"
  6. img-mode="scaleToFill" @click="swiperClick"></u-swiper>
  7. <view class="getStudy" v-if="other.tagH5 == 1">
  8. <view class="left">
  9. <img src="@/static/modIcon/plan.png" alt="">
  10. <text>获取定制学习规划</text>
  11. </view>
  12. <view class="btn" @click="tabListFunc({type:2,url:'/pages5/counselor/index'})">
  13. 立即获取
  14. </view>
  15. </view>
  16. <view class="jumpList" v-if="other.entranceH5 == 1">
  17. <view class="list_li" v-for="(item,index) in jumpList" :key="index" @click="tabListFunc(item)">
  18. <img :src="item.imgName" alt="">
  19. <text>{{item.label}}</text>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="content" v-if="other.courseH5 == 1 && recommendCourse.length > 0">
  24. <view class="header_top">
  25. <text class="left">推荐课程</text>
  26. <u-tabs class="u-tabs" :list="recommendCourse" :current="currentCourse" bg-color="transparent"
  27. :show-bar="false" :height="50" @change="changeCurren($event,'currentCourse')"></u-tabs>
  28. <text class="right" @click="jumpPage(0)">更多></text>
  29. </view>
  30. <view class="noGoods" v-if="recommendCourse[currentCourse].goodsList.length == 0">
  31. <img src="https://file.xyyxt.net/web/static/img/no-content.png" alt="">
  32. <view class="">
  33. 暂无数据
  34. </view>
  35. </view>
  36. <view class="content_box" v-for="(item,index) in filterNum(recommendCourse[currentCourse].goodsList)"
  37. :key="index" @click="tobuy(item)">
  38. <view class="title">
  39. {{item.goodsName}}
  40. </view>
  41. <view class="f_x">
  42. <view class="img_goods">
  43. <img :src="$method.splitImgHost(item.coverUrl)" alt="">
  44. </view>
  45. <view class="content_goods">
  46. <view class="top_bus">
  47. <text>{{recommendCourse[currentCourse].educationName}}</text>
  48. <text>{{recommendCourse[currentCourse].aliasName}}</text>
  49. </view>
  50. <view class="price">
  51. <text class="price1" v-if="!item.specTemplateId ||
  52. (!item.maxPrice && !item.minPrice)"><text v-if="item.standPrice"
  53. style="font-size: 28rpx;font-weight: 400;">¥</text><text
  54. v-if="item.standPrice">{{item.standPrice | formatPrice}}</text><text
  55. v-else>免费</text></text>
  56. <text class="price1" v-else><text
  57. style="font-size: 28rpx;font-weight: 400;">¥</text>{{item.minPrice | formatPrice}}
  58. <template v-if="item.minPrice != item.maxPrice">
  59. <text>-</text>
  60. <text
  61. style="font-size: 28rpx;font-weight: 400;">¥</text>{{ item.maxPrice | formatPrice }}
  62. </template></text>
  63. <text class="price2" v-if="item.linePrice">原价:¥{{item.linePrice | formatPrice}}</text>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="content" v-if="other.bankH5 == 1 &&recommendBank.length > 0">
  70. <view class="header_top">
  71. <text class="left">推荐题库</text>
  72. <u-tabs class="u-tabs" :list="recommendBank" :current="currentBank" bg-color="transparent"
  73. :show-bar="false" :height="50" @change="changeCurren($event,'currentBank')"></u-tabs>
  74. <text class="right" @click="jumpPage(2)">更多></text>
  75. </view>
  76. <view class="noGoods" v-if="recommendBank[currentBank].goodsList.length == 0">
  77. <img src="https://file.xyyxt.net/web/static/img/no-content.png" alt="">
  78. <view class="">
  79. 暂无数据
  80. </view>
  81. </view>
  82. <view class="content_box" v-for="(item,index) in filterNum(recommendBank[currentBank].goodsList)"
  83. :key="index" @click="tobuy(item)">
  84. <view class="title">
  85. {{item.goodsName}}
  86. </view>
  87. <view class="f_x">
  88. <view class="img_goods">
  89. <img :src="$method.splitImgHost(item.coverUrl)" alt="">
  90. </view>
  91. <view class="content_goods">
  92. <view class="top_bus">
  93. <text>{{recommendBank[currentBank].educationName}}</text>
  94. <text>{{recommendBank[currentBank].aliasName}}</text>
  95. </view>
  96. <view class="price">
  97. <text class="price1" v-if="!item.specTemplateId ||
  98. (!item.maxPrice && !item.minPrice)"><text v-if="item.standPrice"
  99. style="font-size: 28rpx;font-weight: 400;">¥</text>{{item.standPrice || '免费'}}</text>
  100. <text class="price1" v-else><text
  101. style="font-size: 28rpx;font-weight: 400;">¥</text>{{item.minPrice}}
  102. <template v-if="item.minPrice != item.maxPrice">
  103. <text>-</text>
  104. <text style="font-size: 28rpx;font-weight: 400;">¥</text>{{ item.maxPrice }}
  105. </template></text>
  106. <text class="price2" v-if="item.linePrice">原价:¥{{item.linePrice}}</text>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="content" v-if="other.teamH5 == 1">
  113. <view class="header_top">
  114. <text class="left">师资团队</text>
  115. <text class="right">左右滑动</text>
  116. </view>
  117. <view class="content_box" style="padding: 30rpx 0rpx;">
  118. <swiper class="swiper" circular autoplay>
  119. <swiper-item v-for="(item,index) in teacher" :key="index">
  120. <view class="boxs_tec">
  121. <view class="header">
  122. <view class="imgs">
  123. <img :src="item.imgUrl" alt="">
  124. </view>
  125. <view class="right_s">
  126. <view class="h_name">
  127. {{item.name}}
  128. </view>
  129. <view class="c_">
  130. {{item.occupation}}
  131. </view>
  132. </view>
  133. </view>
  134. <view class="bodys">
  135. <view class="" v-for="(items,indexs) in item.remark">
  136. {{items}}
  137. </view>
  138. </view>
  139. </view>
  140. </swiper-item>
  141. </swiper>
  142. </view>
  143. </view>
  144. <view class="content" v-if="other.certificateH5 == 1">
  145. <view class="header_top">
  146. <text class="left">资质证书</text>
  147. <text class="right">左右滑动</text>
  148. </view>
  149. <view class="content_box">
  150. <swiper class="swiper_cer" circular autoplay>
  151. <swiper-item v-for="(item,index) in certificate" :key="index">
  152. <view class="boxs_cer">
  153. <image mode="aspectFit" :src="item.imgUrl" @click="openImg(index)"></image>
  154. </view>
  155. </swiper-item>
  156. </swiper>
  157. </view>
  158. </view>
  159. <!-- #ifdef MP-WEIXIN -->
  160. <view class="officials"
  161. v-if="$method.isLogin() && isFollow !== 1 && !curClose && tenantId == '867735392558919680'">
  162. <view class="weixin_official_account">
  163. <image class="off_logo" src="@/static/index/official.png"></image>
  164. <view>
  165. <view class="one">关注 “祥粤学校” 公众号</view>
  166. <view class="two">学习提醒、 报考通知不会错过</view>
  167. </view>
  168. <button type="default" class="btn btn-official">
  169. 去关注
  170. <official-account class="official-account" id="official_account"></official-account>
  171. </button>
  172. <view class="close_icon">
  173. <u-icon name="close" class="icon-close" @click="closeOff"></u-icon>
  174. </view>
  175. </view>
  176. </view>
  177. <!-- #endif -->
  178. <u-popup v-model="checkDialogVisible" mode="center" :mask-close-able="false" border-radius="15" width="500">
  179. <view style="padding: 20rpx; max-height: 500px">
  180. <div style="color: #000; display: flex">
  181. <div>
  182. <u-icon name="error-circle-fill" style="color: #f59a23; margin: 8rpx 5rpx 0 0"></u-icon>
  183. </div>
  184. <div>
  185. 尊敬的用户:您购买的课程
  186. <span v-for="item, index in checkTwoClassList" :key="index">
  187. 【{{ item.gradeName }}】班级有效期还剩 {{
  188. $method.GetRTime(item.classEndTime) > 0
  189. ? $method.GetRTime(item.classEndTime)
  190. : 0
  191. }}天,请在
  192. {{
  193. $method.timestampToTime(item.classEndTime, true, true)
  194. }}前完成学习及考试,到期未完成学时清零,需重新学习。<br>
  195. </span>
  196. </div>
  197. </div>
  198. <div style="margin-left: 30rpx;">
  199. <u-button class="checkBtn" type="primary" size="medium" @click="goLearnPage">进入学习</u-button>
  200. <u-button class="checkBtn" plain size="medium" @click="checkDialogVisible = false">取 消</u-button>
  201. </div>
  202. </view>
  203. </u-popup>
  204. <!-- tabbar -->
  205. <myTabbar :backTopBtn="backTopBtn"></myTabbar>
  206. </view>
  207. </template>
  208. <script>
  209. import {
  210. mapGetters,
  211. mapActions
  212. } from "vuex";
  213. export default {
  214. data() {
  215. return {
  216. checkDialogVisible: false, // 检查是否有二建班级10天过期
  217. checkTwoClassList: [], // 检查是否有二建班级10天过期
  218. backTopBtn: false,
  219. currentCourse: 0,
  220. currentBank: 0,
  221. certificate: [{
  222. imgUrl: "https://file.xyyxt.net/web/static/img/bxxkz-zb.jpg",
  223. },
  224. {
  225. imgUrl: "https://file.xyyxt.net/web/static/img/djz.jpg",
  226. },
  227. {
  228. imgUrl: "https://file.xyyxt.net/web/static/img/hjgltxrz.jpg",
  229. },
  230. {
  231. imgUrl: "https://file.xyyxt.net/web/static/img/zyhjaqgktxrz.jpg",
  232. width: "147px"
  233. },
  234. {
  235. imgUrl: "https://file.xyyxt.net/web/static/img/zlgltxrz.jpg",
  236. },
  237. {
  238. imgUrl: "https://file.xyyxt.net/web/static/img/zzqyzhjyxtrzzs.jpg",
  239. },
  240. {
  241. imgUrl: "https://file.xyyxt.net/web/static/img/facesbrzzs.jpg",
  242. },
  243. {
  244. imgUrl: "https://file.xyyxt.net/web/static/img/zzyxtptrzzs1.jpg",
  245. },
  246. {
  247. imgUrl: "https://file.xyyxt.net/web/static/img/zzyxtptrzzs2.jpg",
  248. },
  249. {
  250. imgUrl: "https://file.xyyxt.net/web/static/img/zzzhkcrzzs1.jpg",
  251. },
  252. {
  253. imgUrl: "https://file.xyyxt.net/web/static/img/zzzhkcrzzs3.jpg",
  254. },
  255. {
  256. imgUrl: "https://file.xyyxt.net/web/static/img/zzzhkcrzzs2.jpg",
  257. },
  258. {
  259. imgUrl: "https://file.xyyxt.net/web/static/img/zzzhkcrzzs3-3.jpg",
  260. },
  261. {
  262. imgUrl: "https://file.xyyxt.net/web/static/img/zzzhkcrzzs.jpg",
  263. },
  264. {
  265. imgUrl: "https://file.xyyxt.net/web/static/img/2018A1.jpg",
  266. },
  267. {
  268. imgUrl: "https://file.xyyxt.net/web/static/img/2018A2.jpg",
  269. },
  270. {
  271. imgUrl: "https://file.xyyxt.net/web/static/img/2018A3.jpg",
  272. },
  273. {
  274. imgUrl: "https://file.xyyxt.net/web/static/img/2018A4.jpg",
  275. },
  276. {
  277. imgUrl: "https://file.xyyxt.net/web/static/img/2018A5.jpg",
  278. },
  279. {
  280. imgUrl: "https://file.xyyxt.net/web/static/img/2018A6.jpg",
  281. },
  282. {
  283. imgUrl: "https://file.xyyxt.net/web/static/img/2018A7.jpg",
  284. },
  285. {
  286. imgUrl: "https://file.xyyxt.net/web/static/img/2018A8.jpg",
  287. },
  288. {
  289. imgUrl: "https://file.xyyxt.net/web/static/img/2019A1.jpg",
  290. },
  291. ],
  292. teacher: [{
  293. imgUrl: "https://file.xyyxt.net/web/static/img/ch.png",
  294. name: "陈红",
  295. occupation: "教授、高级工程师",
  296. remark: [
  297. "国务院安委会、咨询、建筑施工专业委员会专家",
  298. "中国模板手脚架协会副秘书长",
  299. "原中国建筑一局 (集团)有限公司工程技术部经理参编国家标准:",
  300. "《建筑施工脚手架安全技术统一标准》",
  301. "《建筑施工扣件式钢管脚手架安全技术规范》",
  302. "《建筑施工临时支撑技术规范》"
  303. ]
  304. },
  305. {
  306. imgUrl: "https://file.xyyxt.net/web/static/img/xfk.png",
  307. name: "徐福康",
  308. occupation: "教授、高级工程师",
  309. remark: [
  310. "上海市施工现场安全生产保证体系第一审核认证中心副主任、总工程师",
  311. "上海市建设工程安全质量监督总站高级工程师",
  312. "国家标准《建筑施工企业安全生产管理规范》主要起草人"
  313. ]
  314. },
  315. {
  316. imgUrl: "https://file.xyyxt.net/web/static/img/mym.png",
  317. name: "马英明",
  318. occupation: "教授、高级工程师",
  319. remark: [
  320. "中国矿业大学博士生导师",
  321. "国家住建部全国地铁与轻轨建设专家组专家",
  322. "广东省人民政府科技专家顾问委员会委员",
  323. "原中国地下工程学会副主任"
  324. ]
  325. },
  326. {
  327. imgUrl: "https://file.xyyxt.net/web/static/img/khc.png",
  328. name: "邝穗春",
  329. occupation: "工程师、高级讲师",
  330. remark: [
  331. "广州市建筑置业有限公司",
  332. "生产技术部/工程部/资料管理部副部长",
  333. "广州市市政集团培训中心高级讲师",
  334. "广州大学市政技术学院特聘讲师",
  335. "专业从事建筑工程竣工验收/技术资料管理",
  336. "建筑工程施工安全资料管理"
  337. ]
  338. },
  339. {
  340. imgUrl: "https://file.xyyxt.net/web/static/img/hxx.png",
  341. name: "胡欣欣",
  342. occupation: "教授、硕士生导师",
  343. remark: [
  344. "二建考前名师",
  345. "广东工业大学土木与交通工程学员硕士生导师",
  346. "广东省工程造价协会专家库成员",
  347. "广东省工程咨询协会专家库成员"
  348. ]
  349. },
  350. {
  351. imgUrl: "https://file.xyyxt.net/web/static/img/zzhteacher.png",
  352. name: "朱培浩",
  353. occupation: "博士、教材主编",
  354. remark: ["机电实务全国名师", "建造师相关教材主编、参编"]
  355. }
  356. ],
  357. jumpList: [{
  358. label: "课程选购",
  359. imgName: require("@/static/modIcon/purchase.png"),
  360. type: 1, //1 tab类型 2 nav类型
  361. url: 0
  362. }, {
  363. label: "直播课程",
  364. imgName: require("@/static/modIcon/live.png"),
  365. type: 1, //1 tab类型 2 nav类型
  366. url: 1
  367. }, {
  368. label: "题库购买",
  369. imgName: require("@/static/modIcon/QuestionBank.png"),
  370. type: 1, //1 tab类型 2 nav类型
  371. url: 2
  372. }, {
  373. label: "讲义资料",
  374. imgName: require("@/static/modIcon/handout.png"),
  375. type: 1, //1 tab类型 2 nav类型
  376. url: 3
  377. }
  378. // , {
  379. // label: "课程试听",
  380. // imgName: "",
  381. // type: 1, //1 tab类型 2 nav类型
  382. // url: ""
  383. // }, {
  384. // label: "考试日历",
  385. // imgName: "",
  386. // type: 1, //1 tab类型 2 nav类型
  387. // url: ""
  388. // }, {
  389. // label: "常见问题",
  390. // imgName: "",
  391. // type: 1, //1 tab类型 2 nav类型
  392. // url: ""
  393. // }, {
  394. // label: "会员商城",
  395. // imgName: "",
  396. // type: 1, //1 tab类型 2 nav类型
  397. // url: ""
  398. // },
  399. ],
  400. autoplay: true,
  401. interval: 2000,
  402. duration: 500,
  403. swiperHeight: (uni.getWindowInfo().screenWidth - 40) * 0.42 * 2, //轮播图高度计算
  404. list: [],
  405. recommendCourse: [],
  406. recommendBank: [],
  407. isFollow: null, //是否关注过,不是1就是没关注
  408. curClose: true, // 当天时是否关闭过
  409. version: null, //当前版本号
  410. };
  411. },
  412. async onLoad(option) {
  413. if (option.show === '1') {
  414. console.log(option, '--------show---------')
  415. this.checkTenClassGradeUser()
  416. }
  417. let self = this
  418. uni.hideTabBar();
  419. // #ifdef H5
  420. uni.setNavigationBarTitle({
  421. title: this.header.companyName,
  422. });
  423. // #endif
  424. this.getLocation();
  425. this.recommendList()
  426. this.dictObj;
  427. if (this.$method.isLogin()) {
  428. try {
  429. await this.getUserInfo();
  430. } catch (err) {}
  431. } else {
  432. if (uni.getStorageSync("needToLogin")) {
  433. uni.removeStorageSync("needToLogin");
  434. uni.navigateTo({
  435. url: "/pages4/login/login",
  436. });
  437. }
  438. }
  439. wx.getSystemInfo({
  440. success: function(res) {
  441. self.version = res.SDKVersion;
  442. console.log("该版本号为: ", self.version);
  443. },
  444. });
  445. },
  446. onShow() {
  447. this.getInfo(); // 判断有没有关注公众号
  448. this.isClickOff(); //关注公众号,每天最多显示1次;当天学员关闭弹窗后,无需再显示
  449. this.appCommonConfig({
  450. version: this.version,
  451. });
  452. },
  453. onShareAppMessage(res) {
  454. return {
  455. title: "中正",
  456. path: `/pages/index/index?inviteCode=` + userInfo == null ?
  457. "" : userInfo.userAccount,
  458. };
  459. },
  460. onPageScroll(e) {
  461. if (e.scrollTop > 100) {
  462. this.backTopBtn = true
  463. } else {
  464. this.backTopBtn = false
  465. }
  466. },
  467. computed: {
  468. ...mapGetters(["header", "other", "dictObj", "userInfo", "tenantId"]),
  469. filterNum: function() {
  470. return function(list) {
  471. if (list && list.length > 0) {
  472. return list.filter((i, k) => k < 3)
  473. } else {
  474. return []
  475. }
  476. }
  477. }
  478. },
  479. methods: {
  480. ...mapActions(["getUserInfo", "appCommonConfig"]),
  481. changeCurren(index, i) {
  482. this[i] = index
  483. },
  484. // 每天最多显示1次;当天学员关闭弹窗后,无需再显示
  485. isClickOff() {
  486. //当天23:59:59秒 转换成的毫秒数
  487. const end = new Date(
  488. new Date(new Date().toLocaleDateString()).getTime() +
  489. 24 * 60 * 60 * 1000 -
  490. 1
  491. ).getTime();
  492. const start = new Date().getTime(); //当前时间的毫秒数
  493. if (uni.getStorageSync("endTime")) {
  494. //首先判断本地有没有存入当天23:59:59秒的毫秒数
  495. if (start > uni.getStorageSync("endTime")) {
  496. //当前时间毫秒数大于当天23:59:59秒
  497. this.curClose = true;
  498. uni.removeStorageSync("curClose");
  499. uni.removeStorageSync("endTime");
  500. } else {
  501. this.curClose = uni.getStorageSync("curClose") ? false : true;
  502. }
  503. } else {
  504. uni.setStorageSync("endTime", end); //存入当天晚上23:59:59秒的毫秒数
  505. }
  506. },
  507. closeOff() {
  508. this.curClose = false;
  509. uni.setStorageSync("curClose", "1");
  510. },
  511. getInfo() {
  512. if (!this.$method.isLogin()) {
  513. return;
  514. }
  515. // /app/user/getInfo 登录用户信息 // fromPlat来源平台 1小程序 2PC网站
  516. this.$api.getInfo({
  517. fromPlat: 1
  518. }).then((res) => {
  519. if (res.data.code == 200) {
  520. this.$store.state.userInfo = res.data.data;
  521. this.isFollow = res.data.data.userFollowWx; // 不是1就是没关注
  522. console.log(this.isFollow, 'llow')
  523. }
  524. });
  525. },
  526. tabListFunc(item) {
  527. if (item.type == 1) {
  528. this.$store.state.current = item.url
  529. uni.switchTab({
  530. url: '/pages/course/index'
  531. });
  532. }
  533. if (item.type == 2) {
  534. uni.navigateTo({
  535. url: item.url
  536. });
  537. }
  538. },
  539. openImg(index) {
  540. uni.previewImage({
  541. urls: this.certificate.map(i => i.imgUrl),
  542. current: index
  543. })
  544. },
  545. /**
  546. * @param {Object} swiper
  547. * 点击轮播图
  548. */
  549. swiperClick(index) {
  550. let swiper = this.list[index]
  551. if (swiper.jumpType == 1) {
  552. //无跳转
  553. return;
  554. } else if (swiper.jumpType == 2) {
  555. //url
  556. let url = encodeURIComponent(swiper.jumpUrl);
  557. uni.navigateTo({
  558. url: "/pages5/webview/index?url=" + swiper.jumpUrl,
  559. });
  560. } else if (swiper.jumpType == 3) {
  561. //内部接口
  562. const {
  563. jumpUrl
  564. } = swiper;
  565. const map = [
  566. "pages/index/index",
  567. "pages/course/index",
  568. "pages/learn/index",
  569. "pages/questionBank/index",
  570. "pages/wd/index",
  571. "pages/information/index",
  572. ];
  573. const isSwitch = map.find((e) => jumpUrl.includes(e));
  574. // tab页
  575. if (isSwitch) {
  576. // 解决携带参数问题
  577. uni.reLaunch({
  578. url: jumpUrl,
  579. });
  580. return;
  581. }
  582. uni.navigateTo({
  583. url: jumpUrl,
  584. });
  585. } else if (swiper.jumpType == 4) {
  586. //外部接口
  587. uni.navigateToMiniProgram({
  588. appId: swiper.remarks,
  589. path: swiper.jumpUrl,
  590. extraData: {},
  591. success(res) {
  592. // 打开成功
  593. },
  594. fail(err) {
  595. // console.log(err)
  596. },
  597. });
  598. }
  599. },
  600. //获取轮播列表
  601. getLocation() {
  602. this.$api
  603. .advertisingLocation({
  604. platform: 1,
  605. status: 1,
  606. locationKey: "home-banner",
  607. })
  608. .then((res) => {
  609. if (res.data.code == 200) {
  610. let locationId =
  611. (res.data.data && res.data.data[0].locationId) || 1;
  612. this.interval = res.data.data[0].intervalTime * 1000;
  613. this.$api.advertisingList({
  614. locationId: locationId
  615. }).then((result) => {
  616. if (result.data && result.data.rows.length > 0) {
  617. this.list = result.data.rows.map(item => {
  618. return {
  619. ...item,
  620. image: this.$method.splitImgHost(item
  621. .adverUrl),
  622. title: item.advName
  623. }
  624. })
  625. }
  626. });
  627. }
  628. });
  629. },
  630. //推荐列表
  631. recommendList() {
  632. this.$http({
  633. url: "/app/common/activity/recommend/list",
  634. method: "get",
  635. data: {
  636. platform: 1,
  637. status: 1,
  638. },
  639. noToken: true,
  640. }).then((res) => {
  641. if (res.data && res.data.rows.length > 0) {
  642. this.recommendCourse = res.data.rows.filter(i => i.status == 1 && i.type ==
  643. 1) || []
  644. this.recommendBank = res.data.rows.filter(i => i.status == 1 && i.type ==
  645. 2) || []
  646. }
  647. })
  648. },
  649. tobuy(item) {
  650. if (item.goodsType == 2) {
  651. uni.navigateTo({
  652. url: "/pages2/bank/detail?id=" + item.goodsId,
  653. });
  654. } else {
  655. // 视频、直播 /pages5/liveDetail/index
  656. uni.navigateTo({
  657. url: "/pages3/course/detail?id=" +
  658. item.goodsId +
  659. "&goodsType=" +
  660. item.goodsType,
  661. });
  662. }
  663. },
  664. jumpPage(index) {
  665. this.$store.state.current = index
  666. uni.switchTab({
  667. url: '/pages/course/index'
  668. });
  669. },
  670. // 检查是否有二建班级15天过期
  671. checkTenClassGradeUser() {
  672. this.$api
  673. .checkTenClassGradeUser()
  674. .then((res) => {
  675. console.log(res, 'res')
  676. if (res.data.code == 200) {
  677. if (res.data.data && res.data.data.length > 0) {
  678. let ary = uni.getStorageSync("loaclCheckClass") || []
  679. let orderGoodsIds = []
  680. if (ary && ary.length > 0) {
  681. ary.forEach(i => {
  682. if (i.userId == this.userInfo.userId) {
  683. orderGoodsIds = i.orderGoodsIds || []
  684. }
  685. })
  686. this.checkTwoClassList = res.data.data.filter(i => orderGoodsIds.indexOf(i
  687. .orderGoodsId) == -1)
  688. } else {
  689. this.checkTwoClassList = res.data.data
  690. }
  691. this.checkDialogVisible = true;
  692. if (!this.checkTwoClassList.length) this.checkDialogVisible = false;
  693. }
  694. }
  695. })
  696. .catch(() => {
  697. this.checkDialogVisible = false;
  698. });
  699. },
  700. // 跳转学习页面
  701. goLearnPage() {
  702. uni.switchTab({
  703. url: "/pages/learn/index",
  704. });
  705. this.checkDialogVisible = false;
  706. },
  707. },
  708. };
  709. </script>
  710. <style>
  711. page {
  712. background: #f1f4f7;
  713. }
  714. </style>
  715. <style lang="scss" scoped>
  716. .checkBtn {
  717. display: inline;
  718. padding: 10rpx 20rpx;
  719. margin-right: 15rpx;
  720. }
  721. .noGoods {
  722. padding: 20rpx;
  723. background-color: #fff;
  724. border-radius: 8rpx;
  725. height: 80%;
  726. display: flex;
  727. flex-direction: column;
  728. align-items: center;
  729. &>img {
  730. width: 300rpx;
  731. height: 300rpx;
  732. }
  733. &>view {
  734. font-size: 34rpx;
  735. margin-top: 30rpx;
  736. color: #666;
  737. }
  738. }
  739. .swiper_cer {
  740. height: 500rpx;
  741. .boxs_cer {
  742. height: 100%;
  743. display: flex;
  744. align-items: center;
  745. justify-content: center;
  746. &>image {
  747. height: 100%;
  748. }
  749. }
  750. }
  751. .swiper {
  752. height: 500rpx;
  753. .boxs_tec {
  754. margin: 0rpx 20rpx;
  755. height: 100%;
  756. background-color: #fff;
  757. border: 1rpx solid #007aff;
  758. border-radius: 8rpx;
  759. display: flex;
  760. flex-direction: column;
  761. .header {
  762. display: flex;
  763. align-items: center;
  764. flex-shrink: 0;
  765. padding: 20rpx;
  766. .imgs {
  767. width: 80rpx;
  768. height: 80rpx;
  769. border-radius: 50%;
  770. overflow: hidden;
  771. margin-right: 20rpx;
  772. &>img {
  773. width: 100%;
  774. height: 100%;
  775. }
  776. }
  777. .right_s {
  778. display: flex;
  779. flex-direction: column;
  780. justify-content: space-between;
  781. .h_name {
  782. font-size: 32rpx;
  783. color: #333;
  784. font-weight: 600;
  785. }
  786. .c_ {
  787. color: #333;
  788. font-size: 28rpx;
  789. }
  790. }
  791. }
  792. .bodys {
  793. font-size: 28rpx;
  794. padding: 30rpx 20rpx;
  795. color: #fff;
  796. flex: 1;
  797. background-color: rgb(0, 122, 255);
  798. &>view {
  799. line-height: 42rpx;
  800. }
  801. }
  802. }
  803. }
  804. .header_box {
  805. padding: 20rpx;
  806. background: linear-gradient(180deg, rgba(0, 122, 255, 1) 0%, #f1f4f7 100%);
  807. .getStudy {
  808. display: flex;
  809. align-items: center;
  810. justify-content: space-between;
  811. background-color: #fff;
  812. margin-top: 24rpx;
  813. padding: 30rpx 26rpx;
  814. border-radius: 8rpx;
  815. .left {
  816. display: flex;
  817. align-items: center;
  818. img {
  819. width: 46rpx;
  820. height: 46rpx;
  821. margin-right: 14rpx;
  822. }
  823. text {
  824. font-size: 32rpx;
  825. font-weight: 600;
  826. }
  827. }
  828. .btn {
  829. font-size: 24rpx;
  830. border-radius: 28rpx;
  831. padding: 14rpx 28rpx;
  832. background-color: #007aff;
  833. color: #fff;
  834. }
  835. }
  836. .jumpList {
  837. display: flex;
  838. flex-wrap: wrap;
  839. background: #fff;
  840. margin-top: 24rpx;
  841. padding: 20rpx 0rpx;
  842. border-radius: 8rpx;
  843. .list_li {
  844. width: 25%;
  845. display: flex;
  846. flex-direction: column;
  847. align-items: center;
  848. margin-bottom: 20rpx;
  849. &>img {
  850. width: 76rpx;
  851. height: 76rpx;
  852. margin-bottom: 6rpx;
  853. }
  854. &>text {}
  855. }
  856. }
  857. }
  858. .content {
  859. padding: 20rpx;
  860. .header_top {
  861. display: flex;
  862. align-items: center;
  863. justify-content: space-between;
  864. margin-bottom: 20rpx;
  865. .left {
  866. color: #333;
  867. font-weight: 600;
  868. font-size: 36rpx;
  869. flex-shrink: 0;
  870. &:before {
  871. content: ""; // 必须
  872. display: inline-block; // 必须
  873. width: 6rpx;
  874. height: 26rpx;
  875. margin-right: 20rpx;
  876. background: #409eff !important;
  877. }
  878. }
  879. .u-tabs {
  880. flex: 1;
  881. width: 1rpx;
  882. margin: 0rpx 10rpx;
  883. /deep/ .u-scroll-box {
  884. height: 50rpx;
  885. }
  886. }
  887. .right {
  888. font-size: 28rpx;
  889. color: #7f7f7f;
  890. flex-shrink: 0;
  891. }
  892. }
  893. .content_box {
  894. background-color: #fff;
  895. border-radius: 8rpx;
  896. padding: 20rpx;
  897. margin-bottom: 20rpx;
  898. &>.title {
  899. padding-top: 10rpx;
  900. margin-bottom: 30rpx;
  901. color: #333;
  902. font-weight: 600;
  903. font-size: 28rpx;
  904. }
  905. &>.f_x {
  906. display: flex;
  907. &>.img_goods {
  908. width: 235rpx;
  909. height: 138rpx;
  910. overflow: hidden;
  911. border-radius: 8rpx;
  912. margin-right: 20rpx;
  913. flex-shrink: 0;
  914. &>img {
  915. width: 100%;
  916. height: 100%;
  917. }
  918. }
  919. &>.content_goods {
  920. flex: 1;
  921. width: 1rpx;
  922. display: flex;
  923. flex-direction: column;
  924. justify-content: space-between;
  925. &>.top_bus {
  926. text-overflow: ellipsis;
  927. white-space: nowrap;
  928. overflow: hidden;
  929. &>text {
  930. background-color: #f5f7f9;
  931. border-radius: 4rpx;
  932. padding: 6rpx 10rpx;
  933. &:first-child {
  934. margin-right: 14rpx;
  935. }
  936. }
  937. }
  938. &>.price {
  939. display: flex;
  940. align-items: center;
  941. flex-wrap: wrap;
  942. justify-content: space-between;
  943. &>.price1 {
  944. font-size: 36rpx;
  945. font-weight: 700;
  946. color: red;
  947. }
  948. &>.price2 {
  949. text-decoration: line-through;
  950. color: #aaaaaa;
  951. font-size: 24rpx;
  952. }
  953. }
  954. }
  955. }
  956. }
  957. }
  958. .officials {
  959. width: 100%;
  960. height: 104rpx;
  961. position: fixed;
  962. bottom: 100rpx;
  963. left: 0;
  964. z-index: 999;
  965. display: flex;
  966. align-items: center;
  967. justify-content: center;
  968. }
  969. .weixin_official_account {
  970. position: fixed;
  971. bottom: 100rpx;
  972. left: 0;
  973. display: flex;
  974. align-items: center;
  975. // justify-content: space-between;
  976. width: 718rpx;
  977. height: 104rpx;
  978. padding: 0 32rpx;
  979. margin-left: 16rpx;
  980. background: #3a3f54;
  981. border-radius: 16rpx;
  982. .off_logo {
  983. width: 48rpx;
  984. height: 48rpx;
  985. margin-right: 24rpx;
  986. }
  987. .one {
  988. color: #fff;
  989. font-size: 24rpx;
  990. font-weight: 500;
  991. }
  992. .two {
  993. color: #bcbec7;
  994. font-size: 20rpx;
  995. }
  996. .btn {
  997. position: relative;
  998. top: 0;
  999. left: 35rpx;
  1000. width: 128rpx;
  1001. height: 56rpx;
  1002. line-height: 56rpx;
  1003. padding: 0;
  1004. background: linear-gradient(274deg, #408bf6 0%, #40b4f6 100%);
  1005. border-radius: 156rpx;
  1006. overflow: hidden;
  1007. text-align: center;
  1008. font-size: 24rpx;
  1009. color: #fff;
  1010. .official-account {
  1011. position: absolute;
  1012. z-index: 1000;
  1013. right: -9px;
  1014. top: -38px;
  1015. opacity: 0;
  1016. }
  1017. }
  1018. .close_icon {
  1019. width: 40rpx;
  1020. height: 40rpx;
  1021. background: #ffffff;
  1022. opacity: 0.2;
  1023. display: flex;
  1024. align-items: center;
  1025. position: absolute;
  1026. top: 0;
  1027. right: 0;
  1028. color: #fff;
  1029. border-radius: 0rpx 16rpx;
  1030. }
  1031. .icon-close {
  1032. display: flex;
  1033. align-items: center;
  1034. justify-content: center;
  1035. width: 50rpx;
  1036. height: 68rpx;
  1037. font-size: 22rpx;
  1038. color: #7b8284;
  1039. }
  1040. }
  1041. </style>