index.vue 26 KB

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