index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  1. <template>
  2. <view class="index">
  3. <u-navbar class="navbar" :is-back="false" :border-bottom="false" title-color="#333333" back-icon-color="#ffffff">
  4. <view class="slot-wrap">
  5. <image src="/static/logo2.png"></image>
  6. </view>
  7. </u-navbar>
  8. <view class="swiper">
  9. <swiper :indicator-dots="false" indicator-color="#fff" indicator-active-color="#007AFF" :style="{'height':swiperHeight+'rpx'}" @change="swiperChange" :interval="interval" :duration="duration" :autoplay="autoplay" :circular="true">
  10. <swiper-item v-for="(swiper,index) in list" :key="index" @click="swiperClick(swiper)">
  11. <image @load="imageLoad" :src="$method.splitImgHost(swiper.adverUrl)" mode="widthFix"></image>
  12. </swiper-item>
  13. </swiper>
  14. <view class="dots">
  15. <view class="dot" :class="{'active':index == current}" v-for="(swiper,index) in list" :key="index"></view>
  16. </view>
  17. </view>
  18. <view class="content">
  19. <!-- <view class="notice" v-if="infoNums">
  20. <view class="notice__content">
  21. <image src="/static/icon/msg_icon1.png" class="icon"></image>
  22. <view class="text">
  23. 您有{{infoNums}}条新的通知
  24. </view>
  25. <view class="btn" @click="jumpPage">立即查看</view>
  26. </view>
  27. </view>
  28. <view class="my-list">
  29. <view class="my-list__item my-list__item--course" @click="go('course')">
  30. <image src="../../static/mycourse.png"></image>
  31. <text>我的网课</text>
  32. </view>
  33. <view class="my-list__item my-list__item--bank" @click="go('bank')">
  34. <image src="../../static/mybank.png"></image>
  35. <text>我的题库</text>
  36. </view>
  37. </view> -->
  38. <!-- 日历-->
  39. <!-- <view>
  40. <view class="calendar_card">
  41. <view class="card_box">
  42. <u-row gutter="16">
  43. <u-col span="10" >
  44. <view style="height:60rpx;">
  45. <text class="t1" v-if="nearByDay !== '' && nearByDay !== null">距离最近一次考试还剩{{nearByDay}}天</text>
  46. </view>
  47. </u-col>
  48. <u-col offset="1" span="1">
  49. <view @click="jumpPlan"><image src="/static/more.png" class="img_more"></image></view>
  50. </u-col>
  51. </u-row>
  52. </view>
  53. <u-line color="#EEEEEE" />
  54. <view style="width: 100%;display: flex;justify-content:center;margin-top: 20rpx;">
  55. <view v-for="(item, index) in date" :key="index" class="card_date">{{ item }}</view>
  56. </view>
  57. <view style="width: 100%;display: flex;justify-content:center;margin-top: 40rpx;">
  58. <view v-for="(item, index) in date_num" :key="index" class="date_num">
  59. <view v-if="item.color == 0" class="date_num_color0" v-show="item.date > 0">
  60. {{ item.date }}
  61. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  62. <view v-if="item.dot" class="date_dot"></view>
  63. </view>
  64. <view v-if="item.color == 1" class="date_num_color1">
  65. {{ item.date }}
  66. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  67. <view v-if="item.dot" class="date_dot"></view>
  68. </view>
  69. <view v-if="item.color == 2" class="date_num_color2">
  70. {{ item.date }}
  71. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  72. <view v-if="item.dot" class="date_dot"></view>
  73. </view>
  74. <view v-if="item.color == 3" class="date_num_color3">
  75. {{ item.date }}
  76. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  77. <view v-if="item.dot" class="date_dot"></view>
  78. </view>
  79. </view>
  80. </view>
  81. <view style="width: 100%;margin-top: 20rpx;" v-if="workList.length > 0">
  82. <u-row gutter="16">
  83. <u-col span="2" text-align="center">
  84. <view><image src="/static/left.png" class="arr-icon" @click="preveItem"></image></view>
  85. </u-col>
  86. <u-col span="8" text-align="center">
  87. <view class="course_title" @click="jumpGoodsDetail(goodsItem)">{{ goodsItem.goodsName }}</view>
  88. </u-col>
  89. <u-col span="2" text-align="center">
  90. <view><image src="/static/right.png" class="arr-icon" @click="nextItem"></image></view>
  91. </u-col>
  92. </u-row>
  93. </view>
  94. </view>
  95. </view> -->
  96. <!-- <u-tabs class="tabs" :current="tabCurrent" @change="tab" :list="menu" :activeStyle="{fontSize:'36rpx'}" :inactiveStyle="{color:'#EAEEF1',fontSize:'30rpx'}" sticky></u-tabs> -->
  97. <view class="tabs">
  98. <view v-for="(item, index) in menu" :key="index" class="tab_item" :class="{nactive: tabNum == index}" @click="tab(index)">{{ item.name }}</view>
  99. </view>
  100. <view class="course-list" v-show="tabCurrent==0">
  101. <navigator hover-class="none" class="list_item" v-for="(item,index) in list1" :key="index" :url="'/pages3/course/detail?id='+item.goodsId">
  102. <view class="course_content">
  103. <view class="c_title">{{item.goodsName}}</view>
  104. <view class="c_downs">
  105. <view class="img">
  106. <image :src="$method.splitImgHost(item.coverUrl, true)"></image>
  107. <view class="time" v-if="item.year">{{item.year?item.year:''}}</view>
  108. </view>
  109. <view class="text">
  110. <view class="desc">
  111. <view class="left">
  112. <text class="mon_t">¥ {{toFixed(item.standPrice)}}</text>
  113. <text class="sale">/限时优惠</text>
  114. </view>
  115. <view class="right">
  116. <view class="regiser_row">立即购买</view>
  117. </view>
  118. </view>
  119. <view v-if="item.buyUserNum" class="joins">
  120. <!-- <image class="people" src="/static/index/people.png"></image> -->
  121. <!-- 为0时,不显示 -->
  122. <view class="people">{{ item.buyUserNum }}人参与</view>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </navigator>
  128. </view>
  129. <view class="course-list" v-show="tabCurrent==1">
  130. <navigator hover-class="none" class="list_item" v-for="(item,index) in list2" :key="index" :url="'/pages2/bank/detail?id='+item.goodsId">
  131. <!-- <view class="img">
  132. <image :src="$method.splitImgHost(item.coverUrl, true)"></image>
  133. <view class="time" v-if="item.year">{{item.year?item.year:''}}</view>
  134. </view>
  135. <view class="text">
  136. <view class="title">{{item.goodsName}}</view>
  137. <view class="desc">
  138. <view class="left" v-if="false">
  139. {{item.classHours || '-'}}
  140. <text>学时</text>
  141. </view>
  142. <view class="right">¥ {{toFixed(item.standPrice)}}</view>
  143. </view>
  144. </view> -->
  145. <view class="course_content">
  146. <view class="c_title">{{item.goodsName}}</view>
  147. <view class="c_downs">
  148. <view class="img">
  149. <image :src="$method.splitImgHost(item.coverUrl, true)"></image>
  150. <view class="time" v-if="item.year">{{item.year?item.year:''}}</view>
  151. </view>
  152. <view class="text">
  153. <view class="desc">
  154. <view class="left">
  155. <text class="mon_t">¥ {{toFixed(item.standPrice)}}</text>
  156. <text class="sale">/限时优惠</text>
  157. </view>
  158. <view class="right">
  159. <view class="regiser_row">立即购买</view>
  160. </view>
  161. </view>
  162. <!-- <view class="c_title">{{item.goodsName}}</view> -->
  163. <view v-if="item.buyUserNum" class="joins">
  164. <!-- <image class="people" src="/static/index/people.png"></image> -->
  165. <!-- 为0时,不显示 -->
  166. <view class="people">{{ item.buyUserNum }}人参与</view>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. </navigator>
  172. </view>
  173. </view>
  174. <tab-bar v-model="current" :list="tabbarlist" :mid-button="true" :mid-button-size="50" class="tab_items"></tab-bar>
  175. </view>
  176. </template>
  177. <script>
  178. import { mapGetters, mapActions } from 'vuex';
  179. import { socket_url, version} from '@/common/request.js';
  180. import TabBar from '@/components/u-tabbar/u-tabbar.vue';
  181. export default {
  182. components: { TabBar },
  183. data() {
  184. return {
  185. tabNum: 0,
  186. infoNums:0,
  187. list:[],
  188. tabCurrent:0,
  189. date:['日','一','二','三','四','五','六'],
  190. date_num: [],
  191. current:0,
  192. indicatorDots: true,
  193. autoplay: true,
  194. interval: 2000,
  195. duration: 500,
  196. swiperHeight:0,
  197. nearByDay:'', //距离最近一天考试
  198. menu: [{
  199. name: '推荐课程',
  200. }, {
  201. name: '推荐题库',
  202. }],
  203. goodsIndex: 0,
  204. goodsItem: 0,
  205. workList: [],
  206. workTextList: [],
  207. planGoodsList: [],
  208. paramList: [
  209. {
  210. pageNum: 1,
  211. pageSize: 10,
  212. // total: 0,
  213. // showStatus: 0,
  214. getUserNum: 1, //是否返回商品购买用户数量 1带 0不带 ,会返回个buyUserNum
  215. goodsType:1
  216. },
  217. {
  218. pageNum: 1,
  219. pageSize: 10,
  220. // total: 0,
  221. // showStatus: 0,
  222. getUserNum: 1,
  223. goodsType:2
  224. }
  225. ],
  226. total1: 0,
  227. showStatus1: 0,
  228. total2: 0,
  229. showStatus2: 0,
  230. list1: [],
  231. list2: [],
  232. isLogin:false,
  233. isOld:false,
  234. current: 0,
  235. tabbarlist: this.$store.state.tabLists
  236. };
  237. },
  238. onPullDownRefresh() {},
  239. async onLoad(option) {
  240. this.dictObj
  241. this.getAdvertising();
  242. if(this.$method.isLogin()) {
  243. try {
  244. await this.getUserInfo()
  245. // websocket.sokcet(socket_url+this.userInfo.userId+'-'+this.$method.getRandomString(6))
  246. // websocket.sokcet(socket_url+this.userInfo.userAccount)
  247. }catch(err) {
  248. }
  249. } else {
  250. if(uni.getStorageSync('needToLogin')) {
  251. uni.removeStorageSync('needToLogin');
  252. uni.navigateTo({
  253. url:'/pages4/login/login'
  254. })
  255. }
  256. }
  257. this.init()
  258. wx.getSystemInfo({
  259. success: function (res) {
  260. let version = res.SDKVersion
  261. console.log('该版本号为: ', version)
  262. }
  263. })
  264. },
  265. onShow() {
  266. uni.removeStorageSync('goPath')
  267. this.courseList();
  268. this.bankList();
  269. if (uni.getStorageSync('updateHome')){
  270. this.init()
  271. uni.removeStorageSync('updateHome'); //消费首页刷新事件
  272. }
  273. this.appCommonConfig({
  274. version
  275. });
  276. if(this.$method.isLogin()){
  277. this.$store.state.allowLoading = false;
  278. this.$api.getinfoAttached().then(res => {
  279. if(res.data.code ===200){
  280. this.infoNums = res.data.data.informSum
  281. const nums = res.data.data.informSum + res.data.data.orderSum + res.data.data.periodSum + res.data.data.planSum + res.data.data.subscribeSum;
  282. this.$store.commit('tabNum', nums);
  283. }
  284. })
  285. this.$store.state.allowLoading = true;
  286. }else{
  287. this.$store.commit('tabNum', 0);
  288. }
  289. },
  290. onShareAppMessage(res) {
  291. var self = this;
  292. return {
  293. title: '中正',
  294. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  295. };
  296. },
  297. methods: {
  298. ...mapActions(['getUserInfo','appCommonConfig']),
  299. toFixed(number) {
  300. if(number > 0) {
  301. return number.toFixed(2)
  302. } else {
  303. return '0.00'
  304. }
  305. },
  306. /**
  307. * @param {Object} swiper
  308. * 点击轮播图
  309. */
  310. swiperClick(swiper) {
  311. if(swiper.jumpType == 1) { //无跳转
  312. return;
  313. } else if(swiper.jumpType == 2) { //url
  314. let url = encodeURIComponent(swiper.jumpUrl)
  315. uni.navigateTo({
  316. url:'/pages/webview/index?url='+swiper.jumpUrl
  317. })
  318. } else if(swiper.jumpType == 3) { //内部接口
  319. uni.navigateTo({
  320. url:swiper.jumpUrl
  321. })
  322. } else if(swiper.jumpType == 4) { //外部接口
  323. uni.navigateToMiniProgram({
  324. appId: swiper.remarks,
  325. path: swiper.jumpUrl,
  326. extraData: {
  327. },
  328. success(res) {
  329. // 打开成功
  330. },
  331. fail(err) {
  332. console.log(err)
  333. }
  334. })
  335. }
  336. },
  337. /**
  338. * banner图片加载完成
  339. */
  340. imageLoad(e) {
  341. let winW = 750;
  342. let imgW = e.detail.width;
  343. let imgH = e.detail.height;
  344. this.swiperHeight = 750 * imgH / imgW;
  345. },
  346. async getAdvertising() {
  347. await this.advertisingHomeLocation();
  348. await this.advertisingList();
  349. },
  350. getUserSubscribeRecentExam() {
  351. return new Promise(resolve => {
  352. this.$api.getUserSubscribeRecentExam().then(res => {
  353. if(res.data.code == 200) {
  354. if(res.data.data) {
  355. let day = this.$method.timestampToTime(res.data.data.applySiteExamTime,true).replace(/-/g,'/')
  356. let dayTime = day + ' ' + res.data.data.applySiteStartTime
  357. let NowTime = new Date(); //考试时间
  358. let examTime = new Date(dayTime); //考试时间
  359. let t = (examTime.getTime() / 1000) - (NowTime.getTime() / 1000).toFixed(0);
  360. if(t > 0) {
  361. let day = +this.$method.GetRTime(examTime.getTime() / 1000,true)
  362. this.nearByDay = day;
  363. }
  364. }
  365. resolve()
  366. }
  367. console.log(res)
  368. })
  369. })
  370. },
  371. advertisingHomeLocation() {
  372. return new Promise(resolve => {
  373. this.$api.advertisingHomeLocation().then(res => {
  374. this.interval = res.data.data.intervalTime * 1000
  375. resolve()
  376. })
  377. })
  378. },
  379. advertisingList() {
  380. return new Promise(resolve => {
  381. this.$api.advertisingList({locationId:1}).then(res => {
  382. this.list = res.data.rows;
  383. resolve()
  384. })
  385. })
  386. },
  387. jumpPage(){
  388. this.$navTo.togo('/pages4/msg/index')
  389. },
  390. go(type) {
  391. if (!this.$method.isLogin()) {
  392. if(type == 'course') {
  393. uni.setStorageSync('goPath','course')
  394. } else if(type == 'bank' ) {
  395. uni.setStorageSync('goPath','bank')
  396. }
  397. this.$navTo.togo('/pages4/login/login');
  398. } else {
  399. if(type == 'course') {
  400. uni.navigateTo({
  401. url:'/pages2/wd/class'
  402. })
  403. } else if(type == 'bank') {
  404. this.$api.lockLockStatus({
  405. action:'bank'
  406. }).then(res => {
  407. if(res.data.code == 200) { //有其他端在操作,不能学习
  408. uni.showToast({
  409. icon:'none',
  410. title:res.data.msg,
  411. duration:3000,
  412. })
  413. } else if(res.data.code == 500) { //可以学习
  414. uni.navigateTo({
  415. url:'/pages2/wd/question_bank'
  416. })
  417. }
  418. })
  419. }
  420. }
  421. },
  422. //课程
  423. courseList() {
  424. var param = this.paramList[0];
  425. // /app/common/goods/list
  426. this.$api.goodsList(param).then(res => {
  427. console.log(res,'res')
  428. if (res.data.code == 200) {
  429. this.list1 = res.data.rows || []
  430. this.total1 = res.data.total
  431. if (this.list1.length === res.data.total) {
  432. this.showStatus1 = true
  433. }
  434. }
  435. });
  436. },
  437. //题库
  438. bankList() {
  439. var param = this.paramList[1];
  440. this.$api.goodsList(param).then(res => {
  441. // this.paramList[1].total = res.data.total;
  442. if (res.data.code == 200) {
  443. this.list2 = res.data.rows || []
  444. this.total2 = res.data.total
  445. if (this.list2.length === res.data.total) {
  446. // this.paramList[1].showStatus = true;
  447. this.showStatus2 = true
  448. }
  449. }
  450. });
  451. },
  452. /**
  453. * @param {Object} item
  454. * 跳转课程详情
  455. */
  456. async jumpGoodsDetail(item){
  457. uni.navigateTo({
  458. url:'/pages2/wd/class'
  459. })
  460. },
  461. /**
  462. * @param {Object} goodsId 商品id
  463. * 查询商品重修状态
  464. */
  465. courseGoodsRebuildStatus(goodsId,gradeId) {
  466. return new Promise(resolve => {
  467. this.$api.courseGoodsRebuildStatus({
  468. goodsId:goodsId,
  469. gradeId:gradeId
  470. }).then(res => {
  471. resolve(res.data.data)
  472. })
  473. })
  474. },
  475. preveItem() {
  476. if (this.goodsIndex > 0) {
  477. this.goodsIndex = this.goodsIndex - 1;
  478. this.planGoodsList =this.workList[this.goodsIndex].goodsVos
  479. this.goodsItem = this.planGoodsList[0];
  480. this.dealRL(this.workList[this.goodsIndex].calendarStudyVo)
  481. }
  482. },
  483. nextItem() {
  484. if (this.goodsIndex < this.workList.length - 1) {
  485. this.goodsIndex = this.goodsIndex + 1;
  486. this.planGoodsList =this.workList[this.goodsIndex].goodsVos
  487. this.goodsItem = this.planGoodsList[0];
  488. this.dealRL(this.workList[this.goodsIndex].calendarStudyVo)
  489. }
  490. },
  491. jumpPlan() {
  492. if (!this.$method.isLogin()) {
  493. this.$navTo.togo('/pages4/login/login');
  494. } else {
  495. this.$navTo.togo('/pages2/plan/index', {});
  496. }
  497. },
  498. async init() {
  499. if (!this.$method.isLogin()) {
  500. //未登录
  501. this.date_num = [];
  502. this.workList = [];
  503. this.planGoodsList = [];
  504. this.initDay();
  505. } else {
  506. this.date_num = [];
  507. this.workList = [];
  508. this.planGoodsList = [];
  509. await this.userPlanSeven();
  510. await this.getUserSubscribeRecentExam();
  511. }
  512. },
  513. getMonDate() {
  514. var d = new Date(),
  515. day = d.getDay(),
  516. date = d.getDate();
  517. if (day == 0) return d;
  518. else d.setDate(date - day);
  519. return d;
  520. },
  521. initDay() {
  522. // d是当前星期一的日期对象
  523. var d = this.getMonDate();
  524. var arr = [];
  525. let date = new Date();
  526. let num = date.getDate();
  527. this.date_num = []
  528. for (var i = 0; i < 7; i++) {
  529. let item = { date: d.getDate() };
  530. item.color = 0;
  531. if (d.getDate() == num) {
  532. item.color = 3;
  533. }
  534. this.date_num.push(item);
  535. d.setDate(d.getDate() + 1);
  536. }
  537. },
  538. dealRL(calendarStudyVo){
  539. let self = this
  540. self.date_num = []
  541. let date = new Date();
  542. let num = date.getDate();
  543. let month = date.getMonth() + 1;
  544. let list = [];
  545. for (let j = 0; j < calendarStudyVo.length; j++) {
  546. let item = calendarStudyVo[j];
  547. list = item.dayStudyList;
  548. for (let i = 0; i < list.length; i++) {
  549. let item = list[i];
  550. item.color = 0;
  551. if (item.date == num) {
  552. item.color = 3;
  553. }
  554. if (item.perform == 1) {
  555. item.color = 1;
  556. }
  557. if (item.perform == 2) {
  558. item.color = 2;
  559. }
  560. item.note = item.studyCourseKnob;
  561. if (item.note > 0) {
  562. item.dot = true;
  563. }
  564. self.date_num.push(item);
  565. }
  566. }
  567. },
  568. userPlanSeven() {
  569. return new Promise(resolve => {
  570. let self = this;
  571. this.$api.userPlanSeven().then(result => {
  572. if (result.data.data && result.data.data.length>0) {
  573. self.workList = result.data.data
  574. self.planGoodsList = self.workList[0].goodsVos;
  575. if (self.planGoodsList != null && self.planGoodsList.length > 0) {
  576. self.goodsItem = self.planGoodsList[0];
  577. }
  578. self.dealRL(result.data.data[0].calendarStudyVo)
  579. } else {
  580. self.initDay();
  581. }
  582. resolve()
  583. });
  584. })
  585. },
  586. swiperChange(e) {
  587. this.current = e.detail.current;
  588. },
  589. tab(e) {
  590. this.tabCurrent = e;
  591. this.tabNum = e
  592. },
  593. updateHomePlan() {
  594. this.$refs.home.init();
  595. },
  596. beforeSwitch(index) {
  597. let that = this;
  598. if (index == 1) {
  599. this.isClick1 = true;
  600. }
  601. if (index == this.current) {
  602. return false;
  603. }
  604. if (!this.$method.isLogin()) {
  605. if (index == 0 || index == 1) {
  606. return true;
  607. } else {
  608. this.$navTo.togo('/pages4/login/login');
  609. return false;
  610. }
  611. } else {
  612. if (index == 2) {
  613. this.$refs.refMy.init();
  614. }
  615. return true;
  616. }
  617. }
  618. },
  619. onReachBottom() {},
  620. computed: { ...mapGetters(['dictObj','userInfo']) },
  621. };
  622. </script>
  623. <style lang="scss" scoped>
  624. @mixin threeDot {
  625. overflow: hidden;
  626. text-overflow:ellipsis;
  627. white-space: nowrap;
  628. }
  629. .index {
  630. .navbar {
  631. /deep/ .u-navbar-inner {
  632. margin-right:0!important;
  633. }
  634. .slot-wrap {
  635. width:100%;
  636. display: flex;
  637. align-items: center;
  638. justify-content: center;
  639. image {
  640. width: 178rpx;
  641. height: 31rpx;
  642. }
  643. }
  644. }
  645. .swiper {
  646. width:100%;
  647. position: relative;
  648. .dots {
  649. position:absolute;
  650. left:0;
  651. bottom:8rpx;
  652. width:100%;
  653. display: flex;
  654. justify-content: center;
  655. .dot {
  656. width: 8rpx;
  657. height: 8rpx;
  658. background: #FFFFFF;
  659. border-radius: 50%;
  660. margin:0 4rpx;
  661. transition: all 0.3s;
  662. &.active {
  663. width: 24rpx;
  664. height: 8rpx;
  665. background: #007AFF;
  666. border-radius: 4rpx;
  667. }
  668. }
  669. }
  670. image {
  671. width:100%;
  672. }
  673. }
  674. .content {
  675. overflow: hidden;
  676. padding:0 16rpx 16rpx;
  677. background: rgba(234, 238, 241, 1);
  678. .notice {
  679. background:#fff;
  680. border-radius: 16rpx;
  681. margin-top:32rpx;
  682. overflow: hidden;
  683. &__content {
  684. padding:0 8rpx;
  685. height: 56rpx;
  686. background: linear-gradient(-90deg, rgba(255, 209, 0, 0.3), rgba(255, 255, 255, 0.3));
  687. display: flex;
  688. align-items: center;
  689. }
  690. .icon {
  691. width: 40rpx;
  692. height: 40rpx;
  693. margin-right: 8rpx;
  694. }
  695. .text {
  696. flex:1;
  697. font-size: 24rpx;
  698. color: #333333;
  699. position: relative;
  700. }
  701. .btn {
  702. font-size: 24rpx;
  703. color: #007AFF;
  704. }
  705. }
  706. .date-list {
  707. margin-top:16rpx;
  708. width: 718rpx;
  709. height: 330rpx;
  710. background: #FFFFFF;
  711. border-radius: 16rpx;
  712. padding:18rpx 27rpx;
  713. .title {
  714. font-size: 30rpx;
  715. font-weight: bold;
  716. color: #007AFF;
  717. }
  718. .list {
  719. margin-top:40rpx;
  720. display: flex;
  721. justify-content: space-around;
  722. .item {
  723. .top {
  724. text-align: center;
  725. font-size: 26rpx;
  726. color: rgba(102, 102, 102, 0.6);
  727. }
  728. .bottom {
  729. text-align: center;
  730. line-height: 48rpx;
  731. margin-top:30rpx;
  732. width: 48rpx;
  733. height: 48rpx;
  734. border-radius: 50%;
  735. color:rgba(51, 51, 51, 1);
  736. font-size: 26rpx;
  737. position:relative;
  738. &.red {
  739. color:#FF3B30;
  740. }
  741. &.green {
  742. color:#36C75A;
  743. }
  744. &.blue {
  745. background: #007AFF;
  746. color:#fff;
  747. }
  748. .note {
  749. width: 30rpx;
  750. height: 30rpx;
  751. border: 2rpx solid #FF9500;
  752. border-radius: 50%;
  753. position:absolute;
  754. top:-20rpx;
  755. right:-20rpx;
  756. line-height: 28rpx;
  757. text-align: center;
  758. color:#FF9500;
  759. font-size: 26rpx;
  760. }
  761. .point {
  762. margin:0 auto;
  763. width: 8rpx;
  764. height: 8rpx;
  765. background: #FF9500;
  766. border-radius: 50%;
  767. }
  768. }
  769. }
  770. }
  771. .btns {
  772. margin-top:50rpx;
  773. display: flex;
  774. align-items: center;
  775. justify-content: center;
  776. .left,.right {
  777. width: 40rpx;
  778. height: 40rpx;
  779. }
  780. .center{
  781. width: 440rpx;
  782. height: 56rpx;
  783. background: #FFFFFF;
  784. box-shadow: 0px 0px 9rpx 1rpx rgba(47, 67, 121, 0.1);
  785. border-radius: 28rpx;
  786. color:rgba(255, 149, 0, 1);
  787. line-height: 56rpx;
  788. text-align: center;
  789. font-size: 30rpx;
  790. margin:0 30rpx;
  791. }
  792. }
  793. }
  794. .tabs {
  795. width: 100%;
  796. height: 78rpx;
  797. display: flex;
  798. align-items: center;
  799. justify-content: space-between;
  800. background-color: #F2F7FF;
  801. border-radius: 38rpx;
  802. margin: 34rpx 0rpx 24rpx 0rpx;
  803. padding: 0rpx 5rpx;
  804. .tab_item {
  805. width: 345rpx;
  806. height: 65rpx;
  807. line-height: 65rpx;
  808. font-size: 28rpx;
  809. font-weight: bold;
  810. border-radius: 32rpx;
  811. text-align: center;
  812. color: #333;
  813. &.nactive {
  814. color: #fff;
  815. background-color: #3577E8;
  816. }
  817. }
  818. }
  819. .course-list {
  820. box-shadow: 0px 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  821. .list_item {
  822. padding: 24rpx;
  823. // height: 278rpx;
  824. background: #FFFFFF;
  825. box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1,99,235,0.1000);
  826. border-radius: 24rpx;
  827. background:#fff;
  828. margin-bottom: 32rpx;
  829. display: flex;
  830. align-items: center;
  831. .c_title {
  832. font-size: 32rpx;
  833. font-weight: bold;
  834. margin-bottom: 24rpx;
  835. font-weight: bold;
  836. color: #222222;
  837. }
  838. .c_downs {
  839. display: flex;
  840. }
  841. .img {
  842. position:relative;
  843. margin-right: 24rpx;
  844. border-radius: 16rpx ;
  845. overflow: hidden;
  846. width: 204rpx;
  847. height: 120rpx;
  848. image {
  849. width:100%;
  850. height:100%;
  851. }
  852. .time {
  853. position:absolute;
  854. bottom:0;
  855. right:0;
  856. width: 80rpx;
  857. height: 32rpx;
  858. background: rgba(1, 25, 45, 0.4);
  859. color:#fff;
  860. text-align: center;
  861. line-height: 32rpx;
  862. font-size: 24rpx;
  863. border-radius: 10rpx 0px 10rpx 0px;
  864. }
  865. }
  866. .text {
  867. width: 440rpx;
  868. position: relative;
  869. display: flex;
  870. flex-direction: column;
  871. justify-content: space-between;
  872. height: 120rpx;
  873. .joins {
  874. .people {
  875. width: 160rpx;
  876. font-size: 20rpx;
  877. color: #999999;
  878. padding: 0rpx 8rpx;
  879. text-align: center;
  880. height: 36rpx;
  881. line-height: 36rpx;
  882. background: #F6F7FB;
  883. border-radius: 4px;
  884. }
  885. }
  886. .desc {
  887. margin-top: 10rpx;
  888. display: flex;
  889. align-items: center;
  890. justify-content: space-between;
  891. width: 100%;
  892. .left {
  893. flex:1;
  894. color:#333;
  895. font-size: 26rpx;
  896. .mon_t {
  897. font-weight: bold;
  898. color: #FC3F3F;
  899. font-size: 36rpx;
  900. }
  901. .sale {
  902. color: #999999;
  903. font-size: 20rpx;
  904. margin-left: 4rpx;
  905. }
  906. }
  907. .right {
  908. font-size: 24rpx;
  909. font-weight: bold;
  910. .regiser_row {
  911. width: 144rpx;
  912. height: 52rpx;
  913. line-height: 52rpx;
  914. text-align: center;
  915. border-radius: 16rpx;
  916. background-color: #FC3F3F;
  917. color: #fff;
  918. font-weight: 500;
  919. font-size: 26rpx;
  920. }
  921. }
  922. }
  923. }
  924. }
  925. }
  926. }
  927. .my-list {
  928. margin:32rpx 0;
  929. display:flex;
  930. justify-content: space-between;
  931. &__item {
  932. width:351rpx;
  933. height:96rpx;
  934. position:relative;
  935. padding:25rpx 0 0 25rpx;
  936. font-size: 32rpx;
  937. &--bank {
  938. text {
  939. position: relative;
  940. z-index: 2;
  941. color:#00998A;
  942. }
  943. }
  944. &--course {
  945. text {
  946. position: relative;
  947. z-index: 2;
  948. color:#0062D9;
  949. }
  950. }
  951. image {
  952. width:100%;
  953. height:100%;
  954. left:0;
  955. top:0;
  956. position:absolute;
  957. z-index: 1;
  958. }
  959. }
  960. }
  961. }
  962. .date_dot {
  963. width: 6rpx;
  964. height: 6rpx;
  965. background: #ffcc00;
  966. border-radius: 50%;
  967. margin: 0 auto;
  968. }
  969. .date_note {
  970. border-radius: 50%;
  971. width: 29rpx;
  972. height: 29rpx;
  973. border: 1px solid #ffcc00;
  974. font-size: 18rpx;
  975. color: #ffcc00;
  976. text-align: center;
  977. display: inline-block;
  978. position: absolute;
  979. top: -19rpx;
  980. right: 9rpx;
  981. }
  982. .circle_num {
  983. border-radius: 50%;
  984. width: 29rpx;
  985. height: 29rpx;
  986. border: 1px solid #ffcc00;
  987. font-size: 18rpx;
  988. color: #ffcc00;
  989. text-align: center;
  990. display: inline-block;
  991. margin: 5rpx;
  992. }
  993. .date_num {
  994. width: 14%;
  995. text-align: center;
  996. position: relative;
  997. display: inline-block;
  998. margin-top: 20rpx;
  999. }
  1000. .course_title {
  1001. color: #2f4379;
  1002. box-shadow: 0rpx 0rpx 9rpx 1rpx rgba(47, 67, 121, 0.1);
  1003. border-radius: 28rpx;
  1004. width: 100%;
  1005. height: 48rpx;
  1006. line-height: 48rpx;
  1007. overflow: hidden;
  1008. text-overflow:ellipsis;
  1009. white-space: nowrap;
  1010. }
  1011. .arr-icon {
  1012. width: 40rpx;
  1013. height: 40rpx;
  1014. }
  1015. .date_num_color0 {
  1016. color: #32467b;
  1017. }
  1018. .date_num_color1 {
  1019. color: #34c759;
  1020. }
  1021. .date_num_color2 {
  1022. color: #ff3b30;
  1023. }
  1024. .date_num_color3 {
  1025. color: #ffffff;
  1026. background-color: #ffcc00;
  1027. border-radius: 50%;
  1028. width: 40rpx;
  1029. height: 40rpx;
  1030. display: inline-block;
  1031. }
  1032. .card_date {
  1033. width: 14%;
  1034. text-align: center;
  1035. color: #7f8caf;
  1036. }
  1037. page {
  1038. background: #ffffff;
  1039. font-size: 28rpx;
  1040. }
  1041. .calendar_card {
  1042. width: 100%;
  1043. background: #ffffff;
  1044. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(47, 67, 121, 0.1);
  1045. border-radius: 22rpx;
  1046. margin-top: 16rpx;
  1047. padding-bottom: 15rpx;
  1048. }
  1049. .calendar_card .card_box {
  1050. height: 60rpx;
  1051. line-height: 60rpx;
  1052. margin-left: 20rpx;
  1053. }
  1054. .calendar_card .t1 {
  1055. color: #007AFF;
  1056. font-size: 24rpx;
  1057. }
  1058. .img_more {
  1059. width: 26rpx;
  1060. height: 26rpx;
  1061. }
  1062. .flex-d {
  1063. display: flex;
  1064. flex-direction: column;
  1065. justify-content: space-between;
  1066. height: 100%;
  1067. }
  1068. .contentZ {
  1069. flex: 1;
  1070. overflow-y: auto;
  1071. padding-left: 35rpx;
  1072. display: flex;
  1073. justify-content: space-around;
  1074. }
  1075. .contentZ::-webkit-scrollbar {
  1076. display: none;
  1077. }
  1078. .fots {
  1079. height: 100rpx;
  1080. display: flex;
  1081. align-items: center;
  1082. justify-content: space-around;
  1083. border-top: 1rpx solid #eee;
  1084. }
  1085. .leftBtns {
  1086. font-size: 30rpx;
  1087. color: #32467b;
  1088. font-weight: 500;
  1089. }
  1090. .right_Btns {
  1091. font-size: 30rpx;
  1092. color: #fff;
  1093. background-color: #32467b;
  1094. border-radius: 24rpx;
  1095. height: 60rpx;
  1096. line-height: 60rpx;
  1097. text-align: center;
  1098. padding: 0rpx 23rpx;
  1099. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1100. }
  1101. .lzs {
  1102. width: 31%;
  1103. margin: 0rpx 1%;
  1104. max-width: 31%;
  1105. }
  1106. .tylsz{
  1107. margin-top: 23rpx;
  1108. color: #666;
  1109. font-weight: 400;
  1110. font-size: 24rpx;
  1111. }
  1112. .tylsz:first-child{
  1113. text-align: center;
  1114. }
  1115. .activeStys{
  1116. font-weight: bold;
  1117. color: #32467B;
  1118. }
  1119. </style>