index.vue 33 KB

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