index.vue 30 KB

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