index.vue 32 KB

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