index.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352
  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 class="price_line">/999</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 class="mon_t">¥ {{toFixed(item.standPrice)}}</text>
  149. <!-- <text class="sale">/限时优惠</text> -->
  150. <text class="price_line">/999</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. .sale {
  972. color: #999999;
  973. font-size: 20rpx;
  974. margin-left: 4rpx;
  975. }
  976. .price_line {
  977. color: #FC3F3F;
  978. font-size: 36rpx;
  979. text-decoration:line-through;
  980. }
  981. }
  982. .right {
  983. font-size: 24rpx;
  984. font-weight: bold;
  985. .regiser_row {
  986. width: 144rpx;
  987. height: 52rpx;
  988. line-height: 52rpx;
  989. text-align: center;
  990. border-radius: 16rpx;
  991. background-color: #FC3F3F;
  992. color: #fff;
  993. font-weight: 500;
  994. font-size: 26rpx;
  995. }
  996. }
  997. }
  998. }
  999. }
  1000. }
  1001. }
  1002. // .botms {
  1003. // padding-bottom: 100rpx;
  1004. // }
  1005. .my-list {
  1006. margin:32rpx 0;
  1007. display:flex;
  1008. justify-content: space-between;
  1009. &__item {
  1010. width:351rpx;
  1011. height:96rpx;
  1012. position:relative;
  1013. padding:25rpx 0 0 25rpx;
  1014. font-size: 32rpx;
  1015. &--bank {
  1016. text {
  1017. position: relative;
  1018. z-index: 2;
  1019. color:#00998A;
  1020. }
  1021. }
  1022. &--course {
  1023. text {
  1024. position: relative;
  1025. z-index: 2;
  1026. color:#0062D9;
  1027. }
  1028. }
  1029. image {
  1030. width:100%;
  1031. height:100%;
  1032. left:0;
  1033. top:0;
  1034. position:absolute;
  1035. z-index: 1;
  1036. }
  1037. }
  1038. }
  1039. }
  1040. .date_dot {
  1041. width: 6rpx;
  1042. height: 6rpx;
  1043. background: #ffcc00;
  1044. border-radius: 50%;
  1045. margin: 0 auto;
  1046. }
  1047. .date_note {
  1048. border-radius: 50%;
  1049. width: 29rpx;
  1050. height: 29rpx;
  1051. border: 1px solid #ffcc00;
  1052. font-size: 18rpx;
  1053. color: #ffcc00;
  1054. text-align: center;
  1055. display: inline-block;
  1056. position: absolute;
  1057. top: -19rpx;
  1058. right: 9rpx;
  1059. }
  1060. .circle_num {
  1061. border-radius: 50%;
  1062. width: 29rpx;
  1063. height: 29rpx;
  1064. border: 1px solid #ffcc00;
  1065. font-size: 18rpx;
  1066. color: #ffcc00;
  1067. text-align: center;
  1068. display: inline-block;
  1069. margin: 5rpx;
  1070. }
  1071. .date_num {
  1072. width: 14%;
  1073. text-align: center;
  1074. position: relative;
  1075. display: inline-block;
  1076. margin-top: 20rpx;
  1077. }
  1078. .course_title {
  1079. color: #2f4379;
  1080. box-shadow: 0rpx 0rpx 9rpx 1rpx rgba(47, 67, 121, 0.1);
  1081. border-radius: 28rpx;
  1082. width: 100%;
  1083. height: 48rpx;
  1084. line-height: 48rpx;
  1085. overflow: hidden;
  1086. text-overflow:ellipsis;
  1087. white-space: nowrap;
  1088. }
  1089. .arr-icon {
  1090. width: 40rpx;
  1091. height: 40rpx;
  1092. }
  1093. .date_num_color0 {
  1094. color: #32467b;
  1095. }
  1096. .date_num_color1 {
  1097. color: #34c759;
  1098. }
  1099. .date_num_color2 {
  1100. color: #ff3b30;
  1101. }
  1102. .date_num_color3 {
  1103. color: #ffffff;
  1104. background-color: #ffcc00;
  1105. border-radius: 50%;
  1106. width: 40rpx;
  1107. height: 40rpx;
  1108. display: inline-block;
  1109. }
  1110. .card_date {
  1111. width: 14%;
  1112. text-align: center;
  1113. color: #7f8caf;
  1114. }
  1115. .calendar_card {
  1116. width: 100%;
  1117. background: #ffffff;
  1118. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(47, 67, 121, 0.1);
  1119. border-radius: 22rpx;
  1120. margin-top: 16rpx;
  1121. padding-bottom: 15rpx;
  1122. }
  1123. .calendar_card .card_box {
  1124. height: 60rpx;
  1125. line-height: 60rpx;
  1126. margin-left: 20rpx;
  1127. }
  1128. .calendar_card .t1 {
  1129. color: #007AFF;
  1130. font-size: 24rpx;
  1131. }
  1132. .img_more {
  1133. width: 26rpx;
  1134. height: 26rpx;
  1135. }
  1136. .flex-d {
  1137. display: flex;
  1138. flex-direction: column;
  1139. justify-content: space-between;
  1140. height: 100%;
  1141. }
  1142. .contentZ {
  1143. flex: 1;
  1144. overflow-y: auto;
  1145. padding-left: 35rpx;
  1146. display: flex;
  1147. justify-content: space-around;
  1148. }
  1149. .contentZ::-webkit-scrollbar {
  1150. display: none;
  1151. }
  1152. .fots {
  1153. height: 100rpx;
  1154. display: flex;
  1155. align-items: center;
  1156. justify-content: space-around;
  1157. border-top: 1rpx solid #eee;
  1158. }
  1159. .leftBtns {
  1160. font-size: 30rpx;
  1161. color: #32467b;
  1162. font-weight: 500;
  1163. }
  1164. .right_Btns {
  1165. font-size: 30rpx;
  1166. color: #fff;
  1167. background-color: #32467b;
  1168. border-radius: 24rpx;
  1169. height: 60rpx;
  1170. line-height: 60rpx;
  1171. text-align: center;
  1172. padding: 0rpx 23rpx;
  1173. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1174. }
  1175. .lzs {
  1176. width: 31%;
  1177. margin: 0rpx 1%;
  1178. max-width: 31%;
  1179. }
  1180. .tylsz{
  1181. margin-top: 23rpx;
  1182. color: #666;
  1183. font-weight: 400;
  1184. font-size: 24rpx;
  1185. }
  1186. .tylsz:first-child{
  1187. text-align: center;
  1188. }
  1189. .activeStys{
  1190. font-weight: bold;
  1191. color: #32467B;
  1192. }
  1193. .officialsss {
  1194. position: fixed;
  1195. left: 0;
  1196. bottom: 100rpx;
  1197. width: 100%;
  1198. }
  1199. .officials {
  1200. width:100%;
  1201. height: 104rpx;
  1202. position:fixed;
  1203. bottom: 0;
  1204. left: 0;
  1205. z-index: 999;
  1206. display: flex;
  1207. align-items: center;
  1208. justify-content: center;
  1209. }
  1210. .weixin_official_account {
  1211. position: fixed;
  1212. bottom: 0;
  1213. left: 0;
  1214. display: flex;
  1215. align-items: center;
  1216. // justify-content: space-between;
  1217. width: 718rpx;
  1218. height: 104rpx;
  1219. padding: 0 32rpx;
  1220. margin-left: 16rpx;
  1221. background: #3A3F54;
  1222. border-radius: 16rpx;
  1223. .off_logo {
  1224. width: 48rpx;
  1225. height: 48rpx;
  1226. margin-right: 24rpx;
  1227. }
  1228. .one {
  1229. color: #fff;
  1230. font-size: 24rpx;
  1231. font-weight: 500;
  1232. }
  1233. .two {
  1234. color: #BCBEC7;
  1235. font-size: 20rpx;
  1236. }
  1237. .btn {
  1238. position: relative;
  1239. top: 0;
  1240. left: 35rpx;
  1241. width: 128rpx;
  1242. height: 56rpx;
  1243. line-height: 56rpx;
  1244. padding: 0;
  1245. background: linear-gradient(274deg, #408BF6 0%, #40B4F6 100%);
  1246. border-radius: 156rpx;
  1247. overflow: hidden;
  1248. text-align: center;
  1249. font-size: 24rpx;
  1250. color: #fff;
  1251. .official-account {
  1252. position: absolute;
  1253. z-index: 1000;
  1254. right: -9px;
  1255. top: -38px;
  1256. opacity: 0;
  1257. }
  1258. }
  1259. .close_icon {
  1260. width: 40rpx;
  1261. height: 40rpx;
  1262. background: #FFFFFF;
  1263. opacity: 0.2;
  1264. display: flex;
  1265. align-items: center;
  1266. position: absolute;
  1267. top: 0;
  1268. right: 0;
  1269. color: #fff;
  1270. border-radius: 0rpx 16rpx;
  1271. }
  1272. .icon-close {
  1273. display: flex;
  1274. align-items: center;
  1275. justify-content: center;
  1276. width: 50rpx;
  1277. height: 68rpx;
  1278. font-size: 22rpx;
  1279. color: #7B8284;
  1280. }
  1281. }
  1282. </style>