index.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  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="!hideBuyState && 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="!hideBuyState && 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: 12rpx 0 12rpx 30rpx;">
  199. <div class="checkBtn" @click="goLearnPage">进入学习</div>
  200. <div class="checkBtn cancelBtn" @click="checkDialogVisible = false">取 消</div>
  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. this.checkTenClassGradeUser()
  414. if (option.show === '1') {
  415. console.log(option, '--------show---------')
  416. this.checkTenClassGradeUser()
  417. }
  418. let self = this
  419. uni.hideTabBar();
  420. // #ifdef H5
  421. uni.setNavigationBarTitle({
  422. title: this.header.companyName,
  423. });
  424. // #endif
  425. // #ifdef MP-WEIXIN
  426. wx.getSystemInfo({
  427. success: function(res) {
  428. self.version = res.SDKVersion;
  429. self.appCommonConfig({
  430. version: self.version,
  431. });
  432. },
  433. });
  434. // #endif
  435. this.getLocation();
  436. this.recommendList()
  437. this.dictObj;
  438. if (this.$method.isLogin()) {
  439. try {
  440. await this.getUserInfo();
  441. } catch (err) {}
  442. } else {
  443. if (uni.getStorageSync("needToLogin")) {
  444. uni.removeStorageSync("needToLogin");
  445. uni.navigateTo({
  446. url: "/pages4/login/login",
  447. });
  448. }
  449. }
  450. },
  451. onShow() {
  452. this.getInfo(); // 判断有没有关注公众号
  453. this.isClickOff(); //关注公众号,每天最多显示1次;当天学员关闭弹窗后,无需再显示
  454. },
  455. onShareAppMessage(res) {
  456. return {
  457. title: "中正",
  458. path: `/pages/index/index?inviteCode=` + userInfo == null ?
  459. "" : userInfo.userAccount,
  460. };
  461. },
  462. onPageScroll(e) {
  463. if (e.scrollTop > 100) {
  464. this.backTopBtn = true
  465. } else {
  466. this.backTopBtn = false
  467. }
  468. },
  469. computed: {
  470. ...mapGetters(["header", "other", "dictObj", "userInfo", "tenantId", "hideBuyState"]),
  471. filterNum: function() {
  472. return function(list) {
  473. if (list && list.length > 0) {
  474. return list.filter((i, k) => k < 3)
  475. } else {
  476. return []
  477. }
  478. }
  479. }
  480. },
  481. methods: {
  482. ...mapActions(["getUserInfo", "appCommonConfig"]),
  483. changeCurren(index, i) {
  484. this[i] = index
  485. },
  486. // 每天最多显示1次;当天学员关闭弹窗后,无需再显示
  487. isClickOff() {
  488. //当天23:59:59秒 转换成的毫秒数
  489. const end = new Date(
  490. new Date(new Date().toLocaleDateString()).getTime() +
  491. 24 * 60 * 60 * 1000 -
  492. 1
  493. ).getTime();
  494. const start = new Date().getTime(); //当前时间的毫秒数
  495. if (uni.getStorageSync("endTime")) {
  496. //首先判断本地有没有存入当天23:59:59秒的毫秒数
  497. if (start > uni.getStorageSync("endTime")) {
  498. //当前时间毫秒数大于当天23:59:59秒
  499. this.curClose = true;
  500. uni.removeStorageSync("curClose");
  501. uni.removeStorageSync("endTime");
  502. } else {
  503. this.curClose = uni.getStorageSync("curClose") ? false : true;
  504. }
  505. } else {
  506. uni.setStorageSync("endTime", end); //存入当天晚上23:59:59秒的毫秒数
  507. }
  508. },
  509. closeOff() {
  510. this.curClose = false;
  511. uni.setStorageSync("curClose", "1");
  512. },
  513. getInfo() {
  514. if (!this.$method.isLogin()) {
  515. return;
  516. }
  517. // /app/user/getInfo 登录用户信息 // fromPlat来源平台 1小程序 2PC网站
  518. this.$api.getInfo({
  519. fromPlat: 1
  520. }).then((res) => {
  521. if (res.data.code == 200) {
  522. this.$store.state.userInfo = res.data.data;
  523. this.isFollow = res.data.data.userFollowWx; // 不是1就是没关注
  524. console.log(this.isFollow, 'llow')
  525. }
  526. });
  527. },
  528. tabListFunc(item) {
  529. // let a = "http://192.168.1.213:8080/pages3/polyv/detail?id=214618&goodsId=490909&orderGoodsId=5535&gradeId=1854&periodWaitTime=1&isQ="
  530. // uni.navigateTo({
  531. // url:`/pages5/webview/sdlink?url=${a}`
  532. // })
  533. // return
  534. if (item.type == 1) {
  535. this.$store.state.current = item.url
  536. uni.switchTab({
  537. url: '/pages/course/index'
  538. });
  539. }
  540. if (item.type == 2) {
  541. uni.navigateTo({
  542. url: item.url
  543. });
  544. }
  545. },
  546. openImg(index) {
  547. uni.previewImage({
  548. urls: this.certificate.map(i => i.imgUrl),
  549. current: index
  550. })
  551. },
  552. /**
  553. * @param {Object} swiper
  554. * 点击轮播图
  555. */
  556. swiperClick(index) {
  557. let swiper = this.list[index]
  558. if (swiper.jumpType == 1) {
  559. //无跳转
  560. return;
  561. } else if (swiper.jumpType == 2) {
  562. //url
  563. let url = encodeURIComponent(swiper.jumpUrl);
  564. uni.navigateTo({
  565. url: "/pages5/webview/index?url=" + swiper.jumpUrl,
  566. });
  567. } else if (swiper.jumpType == 3) {
  568. //内部接口
  569. const {
  570. jumpUrl
  571. } = swiper;
  572. const map = [
  573. "pages/index/index",
  574. "pages/course/index",
  575. "pages/learn/index",
  576. "pages/questionBank/index",
  577. "pages/wd/index",
  578. "pages/information/index",
  579. ];
  580. const isSwitch = map.find((e) => jumpUrl.includes(e));
  581. // tab页
  582. if (isSwitch) {
  583. // 解决携带参数问题
  584. uni.reLaunch({
  585. url: jumpUrl,
  586. });
  587. return;
  588. }
  589. uni.navigateTo({
  590. url: jumpUrl,
  591. });
  592. } else if (swiper.jumpType == 4) {
  593. //外部接口
  594. uni.navigateToMiniProgram({
  595. appId: swiper.remarks,
  596. path: swiper.jumpUrl,
  597. extraData: {},
  598. success(res) {
  599. // 打开成功
  600. },
  601. fail(err) {
  602. // console.log(err)
  603. },
  604. });
  605. }
  606. },
  607. //获取轮播列表
  608. getLocation() {
  609. this.$api
  610. .advertisingLocation({
  611. platform: 1,
  612. status: 1,
  613. locationKey: "home-banner",
  614. })
  615. .then((res) => {
  616. if (res.data.code == 200) {
  617. let locationId =
  618. (res.data.data && res.data.data[0].locationId) || 1;
  619. this.interval = res.data.data[0].intervalTime * 1000;
  620. this.$api.advertisingList({
  621. locationId: locationId
  622. }).then((result) => {
  623. if (result.data && result.data.rows.length > 0) {
  624. this.list = result.data.rows.map(item => {
  625. return {
  626. ...item,
  627. image: this.$method.splitImgHost(item
  628. .adverUrl),
  629. title: item.advName
  630. }
  631. })
  632. }
  633. });
  634. }
  635. });
  636. },
  637. //推荐列表
  638. recommendList() {
  639. this.$http({
  640. url: "/app/common/activity/recommend/list",
  641. method: "get",
  642. data: {
  643. platform: 1,
  644. status: 1,
  645. },
  646. noToken: true,
  647. }).then((res) => {
  648. if (res.data && res.data.rows.length > 0) {
  649. this.recommendCourse = res.data.rows.filter(i => i.status == 1 && i.type ==
  650. 1) || []
  651. this.recommendBank = res.data.rows.filter(i => i.status == 1 && i.type ==
  652. 2) || []
  653. }
  654. })
  655. },
  656. tobuy(item) {
  657. if (item.goodsType == 2) {
  658. uni.navigateTo({
  659. url: "/pages2/bank/detail?id=" + item.goodsId,
  660. });
  661. } else {
  662. // 视频、直播 /pages5/liveDetail/index
  663. uni.navigateTo({
  664. url: "/pages3/course/detail?id=" +
  665. item.goodsId +
  666. "&goodsType=" +
  667. item.goodsType,
  668. });
  669. }
  670. },
  671. jumpPage(index) {
  672. this.$store.state.current = index
  673. uni.switchTab({
  674. url: '/pages/course/index'
  675. });
  676. },
  677. // 检查是否有二建班级15天过期
  678. checkTenClassGradeUser() {
  679. this.$api
  680. .checkTenClassGradeUser()
  681. .then((res) => {
  682. console.log(res, 'res')
  683. if (res.data.code == 200) {
  684. if (res.data.data && res.data.data.length > 0) {
  685. let ary = uni.getStorageSync("loaclCheckClass") || []
  686. let orderGoodsIds = []
  687. if (ary && ary.length > 0) {
  688. ary.forEach(i => {
  689. if (i.userId == this.userInfo.userId) {
  690. orderGoodsIds = i.orderGoodsIds || []
  691. }
  692. })
  693. this.checkTwoClassList = res.data.data.filter(i => orderGoodsIds.indexOf(i
  694. .orderGoodsId) == -1)
  695. } else {
  696. this.checkTwoClassList = res.data.data
  697. }
  698. this.checkDialogVisible = true;
  699. if (!this.checkTwoClassList.length) this.checkDialogVisible = false;
  700. }
  701. }
  702. })
  703. .catch(() => {
  704. this.checkDialogVisible = false;
  705. });
  706. },
  707. // 跳转学习页面
  708. goLearnPage() {
  709. uni.switchTab({
  710. url: "/pages/learn/index",
  711. });
  712. this.checkDialogVisible = false;
  713. },
  714. },
  715. };
  716. </script>
  717. <style>
  718. page {
  719. background: #f1f4f7;
  720. }
  721. </style>
  722. <style lang="scss" scoped>
  723. .checkBtn {
  724. display: inline;
  725. padding: 2% 5%;
  726. margin-right: 15rpx;
  727. background: #2979ff;
  728. color: white;
  729. border-radius: 8rpx;
  730. }
  731. .cancelBtn {
  732. background: white;
  733. color: #333;
  734. border: 1px solid #d7d7d7;
  735. }
  736. .noGoods {
  737. padding: 20rpx;
  738. background-color: #fff;
  739. border-radius: 8rpx;
  740. height: 80%;
  741. display: flex;
  742. flex-direction: column;
  743. align-items: center;
  744. &>img {
  745. width: 300rpx;
  746. height: 300rpx;
  747. }
  748. &>view {
  749. font-size: 34rpx;
  750. margin-top: 30rpx;
  751. color: #666;
  752. }
  753. }
  754. .swiper_cer {
  755. height: 500rpx;
  756. .boxs_cer {
  757. height: 100%;
  758. display: flex;
  759. align-items: center;
  760. justify-content: center;
  761. &>image {
  762. height: 100%;
  763. }
  764. }
  765. }
  766. .swiper {
  767. height: 500rpx;
  768. .boxs_tec {
  769. margin: 0rpx 20rpx;
  770. height: 100%;
  771. background-color: #fff;
  772. border: 1rpx solid #007aff;
  773. border-radius: 8rpx;
  774. display: flex;
  775. flex-direction: column;
  776. .header {
  777. display: flex;
  778. align-items: center;
  779. flex-shrink: 0;
  780. padding: 20rpx;
  781. .imgs {
  782. width: 80rpx;
  783. height: 80rpx;
  784. border-radius: 50%;
  785. overflow: hidden;
  786. margin-right: 20rpx;
  787. &>img {
  788. width: 100%;
  789. height: 100%;
  790. }
  791. }
  792. .right_s {
  793. display: flex;
  794. flex-direction: column;
  795. justify-content: space-between;
  796. .h_name {
  797. font-size: 32rpx;
  798. color: #333;
  799. font-weight: 600;
  800. }
  801. .c_ {
  802. color: #333;
  803. font-size: 28rpx;
  804. }
  805. }
  806. }
  807. .bodys {
  808. font-size: 28rpx;
  809. padding: 30rpx 20rpx;
  810. color: #fff;
  811. flex: 1;
  812. background-color: rgb(0, 122, 255);
  813. &>view {
  814. line-height: 42rpx;
  815. }
  816. }
  817. }
  818. }
  819. .header_box {
  820. padding: 20rpx;
  821. background: linear-gradient(180deg, rgba(0, 122, 255, 1) 0%, #f1f4f7 100%);
  822. .getStudy {
  823. display: flex;
  824. align-items: center;
  825. justify-content: space-between;
  826. background-color: #fff;
  827. margin-top: 24rpx;
  828. padding: 30rpx 26rpx;
  829. border-radius: 8rpx;
  830. .left {
  831. display: flex;
  832. align-items: center;
  833. img {
  834. width: 46rpx;
  835. height: 46rpx;
  836. margin-right: 14rpx;
  837. }
  838. text {
  839. font-size: 32rpx;
  840. font-weight: 600;
  841. }
  842. }
  843. .btn {
  844. font-size: 24rpx;
  845. border-radius: 28rpx;
  846. padding: 14rpx 28rpx;
  847. background-color: #007aff;
  848. color: #fff;
  849. }
  850. }
  851. .jumpList {
  852. display: flex;
  853. flex-wrap: wrap;
  854. background: #fff;
  855. margin-top: 24rpx;
  856. padding: 20rpx 0rpx;
  857. border-radius: 8rpx;
  858. .list_li {
  859. width: 25%;
  860. display: flex;
  861. flex-direction: column;
  862. align-items: center;
  863. margin-bottom: 20rpx;
  864. &>img {
  865. width: 76rpx;
  866. height: 76rpx;
  867. margin-bottom: 6rpx;
  868. }
  869. &>text {}
  870. }
  871. }
  872. }
  873. .content {
  874. padding: 20rpx;
  875. .header_top {
  876. display: flex;
  877. align-items: center;
  878. justify-content: space-between;
  879. margin-bottom: 20rpx;
  880. .left {
  881. color: #333;
  882. font-weight: 600;
  883. font-size: 36rpx;
  884. flex-shrink: 0;
  885. &:before {
  886. content: ""; // 必须
  887. display: inline-block; // 必须
  888. width: 6rpx;
  889. height: 26rpx;
  890. margin-right: 20rpx;
  891. background: #409eff !important;
  892. }
  893. }
  894. .u-tabs {
  895. flex: 1;
  896. width: 1rpx;
  897. margin: 0rpx 10rpx;
  898. /deep/ .u-scroll-box {
  899. height: 50rpx;
  900. }
  901. }
  902. .right {
  903. font-size: 28rpx;
  904. color: #7f7f7f;
  905. flex-shrink: 0;
  906. }
  907. }
  908. .content_box {
  909. background-color: #fff;
  910. border-radius: 8rpx;
  911. padding: 20rpx;
  912. margin-bottom: 20rpx;
  913. &>.title {
  914. padding-top: 10rpx;
  915. margin-bottom: 30rpx;
  916. color: #333;
  917. font-weight: 600;
  918. font-size: 28rpx;
  919. }
  920. &>.f_x {
  921. display: flex;
  922. &>.img_goods {
  923. width: 235rpx;
  924. height: 138rpx;
  925. overflow: hidden;
  926. border-radius: 8rpx;
  927. margin-right: 20rpx;
  928. flex-shrink: 0;
  929. &>img {
  930. width: 100%;
  931. height: 100%;
  932. }
  933. }
  934. &>.content_goods {
  935. flex: 1;
  936. width: 1rpx;
  937. display: flex;
  938. flex-direction: column;
  939. justify-content: space-between;
  940. &>.top_bus {
  941. text-overflow: ellipsis;
  942. white-space: nowrap;
  943. overflow: hidden;
  944. &>text {
  945. background-color: #f5f7f9;
  946. border-radius: 4rpx;
  947. padding: 6rpx 10rpx;
  948. &:first-child {
  949. margin-right: 14rpx;
  950. }
  951. }
  952. }
  953. &>.price {
  954. display: flex;
  955. align-items: center;
  956. flex-wrap: wrap;
  957. justify-content: space-between;
  958. &>.price1 {
  959. font-size: 36rpx;
  960. font-weight: 700;
  961. color: red;
  962. }
  963. &>.price2 {
  964. text-decoration: line-through;
  965. color: #aaaaaa;
  966. font-size: 24rpx;
  967. }
  968. }
  969. }
  970. }
  971. }
  972. }
  973. .officials {
  974. width: 100%;
  975. height: 104rpx;
  976. position: fixed;
  977. bottom: 100rpx;
  978. left: 0;
  979. z-index: 999;
  980. display: flex;
  981. align-items: center;
  982. justify-content: center;
  983. }
  984. .weixin_official_account {
  985. position: fixed;
  986. bottom: 100rpx;
  987. left: 0;
  988. display: flex;
  989. align-items: center;
  990. // justify-content: space-between;
  991. width: 718rpx;
  992. height: 104rpx;
  993. padding: 0 32rpx;
  994. margin-left: 16rpx;
  995. background: #3a3f54;
  996. border-radius: 16rpx;
  997. .off_logo {
  998. width: 48rpx;
  999. height: 48rpx;
  1000. margin-right: 24rpx;
  1001. }
  1002. .one {
  1003. color: #fff;
  1004. font-size: 24rpx;
  1005. font-weight: 500;
  1006. }
  1007. .two {
  1008. color: #bcbec7;
  1009. font-size: 20rpx;
  1010. }
  1011. .btn {
  1012. position: relative;
  1013. top: 0;
  1014. left: 35rpx;
  1015. width: 128rpx;
  1016. height: 56rpx;
  1017. line-height: 56rpx;
  1018. padding: 0;
  1019. background: linear-gradient(274deg, #408bf6 0%, #40b4f6 100%);
  1020. border-radius: 156rpx;
  1021. overflow: hidden;
  1022. text-align: center;
  1023. font-size: 24rpx;
  1024. color: #fff;
  1025. .official-account {
  1026. position: absolute;
  1027. z-index: 1000;
  1028. right: -9px;
  1029. top: -38px;
  1030. opacity: 0;
  1031. }
  1032. }
  1033. .close_icon {
  1034. width: 40rpx;
  1035. height: 40rpx;
  1036. background: #ffffff;
  1037. opacity: 0.2;
  1038. display: flex;
  1039. align-items: center;
  1040. position: absolute;
  1041. top: 0;
  1042. right: 0;
  1043. color: #fff;
  1044. border-radius: 0rpx 16rpx;
  1045. }
  1046. .icon-close {
  1047. display: flex;
  1048. align-items: center;
  1049. justify-content: center;
  1050. width: 50rpx;
  1051. height: 68rpx;
  1052. font-size: 22rpx;
  1053. color: #7b8284;
  1054. }
  1055. }
  1056. </style>