index.vue 28 KB

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