index.vue 27 KB

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