index.vue 32 KB

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