index.vue 31 KB

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