index.vue 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184
  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.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. console.log(res,'res')
  375. self.paramList[0].total = res.data.total;
  376. self.list1 = res.data.rows;
  377. if (self.list1.length === res.data.total) {
  378. self.paramList[0].showStatus = true;
  379. }
  380. });
  381. },
  382. //题库
  383. bankList() {
  384. var self = this;
  385. var param = this.paramList[1];
  386. this.$api.goodsList(param).then(res => {
  387. self.paramList[1].total = res.data.total;
  388. self.list2 = res.data.rows
  389. if (self.list2.length === res.data.total) {
  390. self.paramList[1].showStatus = true;
  391. }
  392. });
  393. },
  394. /**
  395. * @param {Object} item
  396. * 跳转课程详情
  397. */
  398. async jumpGoodsDetail(item){
  399. uni.navigateTo({
  400. url:'/pages2/wd/class'
  401. })
  402. // let currentTime = this.$method.getZeroTime();
  403. // if(currentTime < item.studyStartTime || currentTime > item.studyEndTime) {
  404. // uni.showToast({
  405. // title:'不在学习有效期,不可以学习了哦',
  406. // icon:'none'
  407. // })
  408. // return;
  409. // }
  410. // if( (item.classStartTime && currentTime <= item.classStartTime) || (item.classEndTime && currentTime >= item.classEndTime) ) {
  411. // uni.showToast({
  412. // title:'不在班级有效期,不能进入学习',
  413. // icon:'none'
  414. // })
  415. // return;
  416. // }
  417. // if(item.learningStatus == 2) {
  418. // uni.showToast({
  419. // title:'开放学习时间待定,不能进入学习',
  420. // icon:'none'
  421. // })
  422. // return;
  423. // }
  424. // if(item.classStatus == 0 ) {
  425. // uni.showToast({
  426. // title:'尚未开班,不能进入学习',
  427. // icon:'none'
  428. // })
  429. // return;
  430. // }
  431. // if(item.learningStatus == 3 && (currentTime < item.learningTimeStart) ) {
  432. // uni.showToast({
  433. // title:'不在开放学习时间,不能进入学习',
  434. // icon:'none'
  435. // })
  436. // return;
  437. // }
  438. // if(item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > currentTime) && (item.classEndTime && (item.classEndTime < currentTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0) {
  439. // uni.showModal({
  440. // title:'提示',
  441. // content:'班级已过期,需要重新选班',
  442. // showCancel:false,
  443. // success:() => {
  444. // uni.navigateTo({
  445. // url:"/pages2/wd/class"
  446. // })
  447. // }
  448. // })
  449. // return;
  450. // }
  451. // let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId,item.gradeId);
  452. // if(rebuildStatus == 0) {
  453. // this.$navTo.togo('/pages2/learn/details', {
  454. // gradeId:item.gradeId,
  455. // goodsId: item.goodsId
  456. // })
  457. // return;
  458. // }
  459. // if(item.courseNum == 1 ) {
  460. // this.$api.courseCourseList({
  461. // pageNum:1,
  462. // pageSize:1,
  463. // goodsId:item.goodsId,
  464. // gradeId:item.gradeId
  465. // }).then(res => {
  466. // if(res.data.code == 200) {
  467. // uni.navigateTo({
  468. // url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
  469. // })
  470. // }
  471. // });
  472. // return;
  473. // }
  474. // this.$navTo.togo('/pages2/wd/course', {
  475. // id: item.goodsId,
  476. // gid:item.gradeId
  477. // });
  478. },
  479. /**
  480. * @param {Object} goodsId 商品id
  481. * 查询商品重修状态
  482. */
  483. courseGoodsRebuildStatus(goodsId,gradeId) {
  484. return new Promise(resolve => {
  485. this.$api.courseGoodsRebuildStatus({
  486. goodsId:goodsId,
  487. gradeId:gradeId
  488. }).then(res => {
  489. resolve(res.data.data)
  490. })
  491. })
  492. },
  493. preveItem() {
  494. if (this.goodsIndex > 0) {
  495. this.goodsIndex = this.goodsIndex - 1;
  496. this.planGoodsList =this.workList[this.goodsIndex].goodsVos
  497. this.goodsItem = this.planGoodsList[0];
  498. this.dealRL(this.workList[this.goodsIndex].calendarStudyVo)
  499. }
  500. },
  501. nextItem() {
  502. if (this.goodsIndex < this.workList.length - 1) {
  503. this.goodsIndex = this.goodsIndex + 1;
  504. this.planGoodsList =this.workList[this.goodsIndex].goodsVos
  505. this.goodsItem = this.planGoodsList[0];
  506. this.dealRL(this.workList[this.goodsIndex].calendarStudyVo)
  507. }
  508. },
  509. jumpPlan() {
  510. if (!this.$method.isLogin()) {
  511. this.$navTo.togo('/pages4/login/login');
  512. } else {
  513. this.$navTo.togo('/pages2/plan/index', {});
  514. }
  515. },
  516. async init() {
  517. if (!this.$method.isLogin()) {
  518. //未登录
  519. this.date_num = [];
  520. this.workList = [];
  521. this.planGoodsList = [];
  522. this.initDay();
  523. } else {
  524. this.date_num = [];
  525. this.workList = [];
  526. this.planGoodsList = [];
  527. await this.userPlanSeven();
  528. await this.getUserSubscribeRecentExam();
  529. }
  530. },
  531. getMonDate() {
  532. var d = new Date(),
  533. day = d.getDay(),
  534. date = d.getDate();
  535. if (day == 0) return d;
  536. else d.setDate(date - day);
  537. return d;
  538. },
  539. initDay() {
  540. // d是当前星期一的日期对象
  541. var d = this.getMonDate();
  542. var arr = [];
  543. let date = new Date();
  544. let num = date.getDate();
  545. this.date_num = []
  546. for (var i = 0; i < 7; i++) {
  547. let item = { date: d.getDate() };
  548. item.color = 0;
  549. if (d.getDate() == num) {
  550. item.color = 3;
  551. }
  552. this.date_num.push(item);
  553. d.setDate(d.getDate() + 1);
  554. }
  555. },
  556. dealRL(calendarStudyVo){
  557. let self = this
  558. self.date_num = []
  559. let date = new Date();
  560. let num = date.getDate();
  561. let month = date.getMonth() + 1;
  562. let list = [];
  563. for (let j = 0; j < calendarStudyVo.length; j++) {
  564. let item = calendarStudyVo[j];
  565. list = item.dayStudyList;
  566. for (let i = 0; i < list.length; i++) {
  567. let item = list[i];
  568. item.color = 0;
  569. if (item.date == num) {
  570. item.color = 3;
  571. }
  572. if (item.perform == 1) {
  573. item.color = 1;
  574. }
  575. if (item.perform == 2) {
  576. item.color = 2;
  577. }
  578. item.note = item.studyCourseKnob;
  579. if (item.note > 0) {
  580. item.dot = true;
  581. }
  582. self.date_num.push(item);
  583. }
  584. }
  585. },
  586. userPlanSeven() {
  587. return new Promise(resolve => {
  588. let self = this;
  589. this.$api.userPlanSeven().then(result => {
  590. if (result.data.data && result.data.data.length>0) {
  591. self.workList = result.data.data
  592. self.planGoodsList = self.workList[0].goodsVos;
  593. if (self.planGoodsList != null && self.planGoodsList.length > 0) {
  594. self.goodsItem = self.planGoodsList[0];
  595. }
  596. self.dealRL(result.data.data[0].calendarStudyVo)
  597. /* let date = new Date();
  598. let num = date.getDate();
  599. let month = date.getMonth() + 1;
  600. let list = [];
  601. for (let i = 0; i < result.data.data[0].calendarStudyVo.length; i++) {
  602. let item = result.data.data[0].calendarStudyVo[i];
  603. if (item.month == month) {
  604. list = item.dayStudyList;
  605. }
  606. }
  607. for (let i = 0; i < list.length; i++) {
  608. let item = list[i];
  609. item.color = 0;
  610. if (item.date == num) {
  611. item.color = 3;
  612. }
  613. if (item.perform == 1) {
  614. item.color = 1;
  615. }
  616. if (item.perform == 2) {
  617. item.color = 2;
  618. }
  619. item.note = item.studyCourseKnob;
  620. if (item.note > 0) {
  621. item.dot = true;
  622. }
  623. self.date_num.push(item);
  624. } */
  625. } else {
  626. self.initDay();
  627. }
  628. resolve()
  629. });
  630. })
  631. },
  632. swiperChange(e) {
  633. this.current = e.detail.current;
  634. },
  635. tab(e) {
  636. this.tabCurrent = e;
  637. },
  638. updateHomePlan() {
  639. this.$refs.home.init();
  640. },
  641. beforeSwitch(index) {
  642. let that = this;
  643. if (index == 1) {
  644. this.isClick1 = true;
  645. }
  646. if (index == this.current) {
  647. return false;
  648. }
  649. if (!this.$method.isLogin()) {
  650. if (index == 0 || index == 1) {
  651. return true;
  652. } else {
  653. this.$navTo.togo('/pages4/login/login');
  654. return false;
  655. }
  656. } else {
  657. if (index == 2) {
  658. this.$refs.refMy.init();
  659. }
  660. return true;
  661. }
  662. }
  663. },
  664. onReachBottom() {},
  665. computed: { ...mapGetters(['userInfo']) }
  666. };
  667. </script>
  668. <style lang="scss" scoped>
  669. .index {
  670. .navbar {
  671. /deep/ .u-navbar-inner {
  672. margin-right:0!important;
  673. }
  674. .slot-wrap {
  675. width:100%;
  676. display: flex;
  677. align-items: center;
  678. justify-content: center;
  679. image {
  680. width: 178rpx;
  681. height: 31rpx;
  682. }
  683. }
  684. }
  685. .swiper {
  686. width:100%;
  687. position: relative;
  688. .dots {
  689. position:absolute;
  690. left:0;
  691. bottom:8rpx;
  692. width:100%;
  693. display: flex;
  694. justify-content: center;
  695. .dot {
  696. width: 8rpx;
  697. height: 8rpx;
  698. background: #FFFFFF;
  699. border-radius: 50%;
  700. margin:0 4rpx;
  701. transition: all 0.3s;
  702. &.active {
  703. width: 24rpx;
  704. height: 8rpx;
  705. background: #007AFF;
  706. border-radius: 4rpx;
  707. }
  708. }
  709. }
  710. image {
  711. width:100%;
  712. }
  713. }
  714. .content {
  715. overflow: hidden;
  716. padding:0 16rpx 16rpx;
  717. background: rgba(234, 238, 241, 1);
  718. .notice {
  719. background:#fff;
  720. border-radius: 16rpx;
  721. margin-top:32rpx;
  722. overflow: hidden;
  723. &__content {
  724. padding:0 8rpx;
  725. height: 56rpx;
  726. background: linear-gradient(-90deg, rgba(255, 209, 0, 0.3), rgba(255, 255, 255, 0.3));
  727. display: flex;
  728. align-items: center;
  729. }
  730. .icon {
  731. width: 40rpx;
  732. height: 40rpx;
  733. margin-right: 8rpx;
  734. }
  735. .text {
  736. flex:1;
  737. font-size: 24rpx;
  738. color: #333333;
  739. position: relative;
  740. }
  741. .btn {
  742. font-size: 24rpx;
  743. color: #007AFF;
  744. }
  745. }
  746. .date-list {
  747. margin-top:16rpx;
  748. width: 718rpx;
  749. height: 330rpx;
  750. background: #FFFFFF;
  751. border-radius: 16rpx;
  752. padding:18rpx 27rpx;
  753. .title {
  754. font-size: 30rpx;
  755. font-weight: bold;
  756. color: #007AFF;
  757. }
  758. .list {
  759. margin-top:40rpx;
  760. display: flex;
  761. justify-content: space-around;
  762. .item {
  763. .top {
  764. text-align: center;
  765. font-size: 26rpx;
  766. color: rgba(102, 102, 102, 0.6);
  767. }
  768. .bottom {
  769. text-align: center;
  770. line-height: 48rpx;
  771. margin-top:30rpx;
  772. width: 48rpx;
  773. height: 48rpx;
  774. border-radius: 50%;
  775. color:rgba(51, 51, 51, 1);
  776. font-size: 26rpx;
  777. position:relative;
  778. &.red {
  779. color:#FF3B30;
  780. }
  781. &.green {
  782. color:#36C75A;
  783. }
  784. &.blue {
  785. background: #007AFF;
  786. color:#fff;
  787. }
  788. .note {
  789. width: 30rpx;
  790. height: 30rpx;
  791. border: 2rpx solid #FF9500;
  792. border-radius: 50%;
  793. position:absolute;
  794. top:-20rpx;
  795. right:-20rpx;
  796. line-height: 28rpx;
  797. text-align: center;
  798. color:#FF9500;
  799. font-size: 26rpx;
  800. }
  801. .point {
  802. margin:0 auto;
  803. width: 8rpx;
  804. height: 8rpx;
  805. background: #FF9500;
  806. border-radius: 50%;
  807. }
  808. }
  809. }
  810. }
  811. .btns {
  812. margin-top:50rpx;
  813. display: flex;
  814. align-items: center;
  815. justify-content: center;
  816. .left,.right {
  817. width: 40rpx;
  818. height: 40rpx;
  819. }
  820. .center{
  821. width: 440rpx;
  822. height: 56rpx;
  823. background: #FFFFFF;
  824. box-shadow: 0px 0px 9rpx 1rpx rgba(47, 67, 121, 0.1);
  825. border-radius: 28rpx;
  826. color:rgba(255, 149, 0, 1);
  827. line-height: 56rpx;
  828. text-align: center;
  829. font-size: 30rpx;
  830. margin:0 30rpx;
  831. }
  832. }
  833. }
  834. .tabs {
  835. /deep/ .u-tabs {
  836. background:none!important;
  837. }
  838. }
  839. .course-list {
  840. background:#fff;
  841. padding:0 8rpx;
  842. box-shadow: 0px 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  843. border-radius: 16rpx ;
  844. .item {
  845. padding:24rpx 0;
  846. border-bottom:1rpx solid #eeeeee;
  847. display: flex;
  848. .img {
  849. position:relative;
  850. margin-right:10rpx;
  851. border-radius: 16rpx ;
  852. overflow: hidden;
  853. width: 320rpx;
  854. height: 180rpx;
  855. image {
  856. width:100%;
  857. height:100%;
  858. }
  859. .time {
  860. position:absolute;
  861. bottom:0;
  862. right:0;
  863. width: 80rpx;
  864. height: 32rpx;
  865. background: rgba(1, 25, 45, 0.4);
  866. color:#fff;
  867. text-align: center;
  868. line-height: 32rpx;
  869. font-size: 24rpx;
  870. border-radius: 10rpx 0px 10rpx 0px;
  871. }
  872. }
  873. .text {
  874. flex:1;
  875. padding-right:10rpx;
  876. position: relative;
  877. .title {
  878. font-size: 30rpx;
  879. color: #333333;
  880. }
  881. .desc {
  882. margin-top:40rpx;
  883. display: flex;
  884. position: absolute;
  885. bottom: 0;
  886. width: 100%;
  887. .left {
  888. flex:1;
  889. color:#333;
  890. font-size: 26rpx;
  891. text {
  892. font-size: 24rpx;
  893. color:#999;
  894. }
  895. }
  896. .right {
  897. font-size: 24rpx;
  898. font-weight: bold;
  899. color: #FF2D55;
  900. }
  901. }
  902. }
  903. }
  904. }
  905. }
  906. .my-list {
  907. margin:32rpx 0;
  908. display:flex;
  909. justify-content: space-between;
  910. &__item {
  911. width:351rpx;
  912. height:96rpx;
  913. position:relative;
  914. padding:25rpx 0 0 25rpx;
  915. font-size: 32rpx;
  916. &--bank {
  917. text {
  918. position: relative;
  919. z-index: 2;
  920. color:#00998A;
  921. }
  922. }
  923. &--course {
  924. text {
  925. position: relative;
  926. z-index: 2;
  927. color:#0062D9;
  928. }
  929. }
  930. image {
  931. width:100%;
  932. height:100%;
  933. left:0;
  934. top:0;
  935. position:absolute;
  936. z-index: 1;
  937. }
  938. }
  939. }
  940. }
  941. .date_dot {
  942. width: 6rpx;
  943. height: 6rpx;
  944. background: #ffcc00;
  945. border-radius: 50%;
  946. margin: 0 auto;
  947. }
  948. .date_note {
  949. border-radius: 50%;
  950. width: 29rpx;
  951. height: 29rpx;
  952. border: 1px solid #ffcc00;
  953. font-size: 18rpx;
  954. color: #ffcc00;
  955. text-align: center;
  956. display: inline-block;
  957. position: absolute;
  958. top: -19rpx;
  959. right: 9rpx;
  960. }
  961. .circle_num {
  962. border-radius: 50%;
  963. width: 29rpx;
  964. height: 29rpx;
  965. border: 1px solid #ffcc00;
  966. font-size: 18rpx;
  967. color: #ffcc00;
  968. text-align: center;
  969. display: inline-block;
  970. margin: 5rpx;
  971. }
  972. .date_num {
  973. width: 14%;
  974. text-align: center;
  975. position: relative;
  976. display: inline-block;
  977. margin-top: 20rpx;
  978. }
  979. .course_title {
  980. color: #2f4379;
  981. box-shadow: 0rpx 0rpx 9rpx 1rpx rgba(47, 67, 121, 0.1);
  982. border-radius: 28rpx;
  983. width: 100%;
  984. height: 48rpx;
  985. line-height: 48rpx;
  986. overflow: hidden;
  987. text-overflow:ellipsis;
  988. white-space: nowrap;
  989. }
  990. .arr-icon {
  991. width: 40rpx;
  992. height: 40rpx;
  993. }
  994. .date_num_color0 {
  995. color: #32467b;
  996. }
  997. .date_num_color1 {
  998. color: #34c759;
  999. }
  1000. .date_num_color2 {
  1001. color: #ff3b30;
  1002. }
  1003. .date_num_color3 {
  1004. color: #ffffff;
  1005. background-color: #ffcc00;
  1006. border-radius: 50%;
  1007. width: 40rpx;
  1008. height: 40rpx;
  1009. display: inline-block;
  1010. }
  1011. .card_date {
  1012. width: 14%;
  1013. text-align: center;
  1014. color: #7f8caf;
  1015. }
  1016. page {
  1017. background: #ffffff;
  1018. font-size: 28rpx;
  1019. }
  1020. .calendar_card {
  1021. width: 100%;
  1022. background: #ffffff;
  1023. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(47, 67, 121, 0.1);
  1024. border-radius: 22rpx;
  1025. margin-top: 16rpx;
  1026. padding-bottom: 15rpx;
  1027. }
  1028. .calendar_card .card_box {
  1029. height: 60rpx;
  1030. line-height: 60rpx;
  1031. margin-left: 20rpx;
  1032. }
  1033. .calendar_card .t1 {
  1034. color: #007AFF;
  1035. font-size: 24rpx;
  1036. }
  1037. .img_more {
  1038. width: 26rpx;
  1039. height: 26rpx;
  1040. }
  1041. .flex-d {
  1042. display: flex;
  1043. flex-direction: column;
  1044. justify-content: space-between;
  1045. height: 100%;
  1046. }
  1047. .contentZ {
  1048. flex: 1;
  1049. overflow-y: auto;
  1050. padding-left: 35rpx;
  1051. display: flex;
  1052. justify-content: space-around;
  1053. }
  1054. .contentZ::-webkit-scrollbar {
  1055. display: none;
  1056. }
  1057. .fots {
  1058. height: 100rpx;
  1059. display: flex;
  1060. align-items: center;
  1061. justify-content: space-around;
  1062. border-top: 1rpx solid #eee;
  1063. }
  1064. .leftBtns {
  1065. font-size: 30rpx;
  1066. color: #32467b;
  1067. font-weight: 500;
  1068. }
  1069. .right_Btns {
  1070. font-size: 30rpx;
  1071. color: #fff;
  1072. background-color: #32467b;
  1073. border-radius: 24rpx;
  1074. height: 60rpx;
  1075. line-height: 60rpx;
  1076. text-align: center;
  1077. padding: 0rpx 23rpx;
  1078. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1079. }
  1080. .lzs {
  1081. width: 31%;
  1082. margin: 0rpx 1%;
  1083. max-width: 31%;
  1084. }
  1085. .tylsz{
  1086. margin-top: 23rpx;
  1087. color: #666;
  1088. font-weight: 400;
  1089. font-size: 24rpx;
  1090. }
  1091. .tylsz:first-child{
  1092. text-align: center;
  1093. }
  1094. .activeStys{
  1095. font-weight: bold;
  1096. color: #32467B;
  1097. }
  1098. </style>