index.vue 32 KB

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