index.vue 31 KB

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