index.vue 31 KB

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