index.vue 32 KB

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