index.vue 26 KB

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