index.vue 31 KB

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