index.vue 31 KB

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