index.vue 30 KB

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