index.vue 31 KB

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