index.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379
  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. total2: 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. uni.removeStorageSync('goPath')
  297. this.courseList();
  298. // this.bankList();
  299. if (uni.getStorageSync('updateHome')){
  300. this.init()
  301. uni.removeStorageSync('updateHome'); //消费首页刷新事件
  302. }
  303. this.appCommonConfig({
  304. version
  305. });
  306. if(this.$method.isLogin()){
  307. this.$store.state.allowLoading = false;
  308. this.$api.getinfoAttached().then(res => {
  309. if(res.data.code ===200){
  310. this.infoNums = res.data.data.informSum
  311. const nums = res.data.data.informSum + res.data.data.orderSum + res.data.data.periodSum + res.data.data.planSum + res.data.data.subscribeSum;
  312. this.$store.commit('tabNum', nums);
  313. }
  314. })
  315. this.$store.state.allowLoading = true;
  316. }else{
  317. this.$store.commit('tabNum', 0);
  318. }
  319. },
  320. onShareAppMessage(res) {
  321. return {
  322. title: '中正',
  323. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  324. };
  325. },
  326. computed: {
  327. ...mapGetters(['dictObj','userInfo', 'hideBuyState']),
  328. opacitys() {
  329. const value = [1011,1017,1025,1047,1124].includes(this.$store.state.scene) && this.isLogin && (this.isFollow != 1) && this.curClose ? 1 : 0
  330. 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. }
  342. })
  343. },
  344. // 每天最多显示1次;当天学员关闭弹窗后,无需再显示
  345. isClickOff() {
  346. //当天23:59:59秒 转换成的毫秒数
  347. const end = new Date(new Date(new Date().toLocaleDateString()).getTime()+24*60*60*1000-1).getTime()
  348. const start = new Date().getTime() //当前时间的毫秒数
  349. if(uni.getStorageSync('endTime')){ //首先判断本地有没有存入当天23:59:59秒的毫秒数
  350. if(start > uni.getStorageSync('endTime')){ //当前时间毫秒数大于当天23:59:59秒
  351. this.curClose = true
  352. uni.removeStorageSync('curClose')
  353. uni.removeStorageSync('endTime')
  354. } else {
  355. this.curClose = uni.getStorageSync('curClose') ? false : true
  356. }
  357. }else{
  358. uni.setStorageSync("endTime", end) //存入当天晚上23:59:59秒的毫秒数
  359. }
  360. },
  361. closeOff() {
  362. this.curClose = false
  363. uni.setStorageSync("curClose", '1')
  364. },
  365. toFixed(number) {
  366. if(number > 0) {
  367. return number.toFixed(2)
  368. } else {
  369. return '0.00'
  370. }
  371. },
  372. /**
  373. * @param {Object} swiper
  374. * 点击轮播图
  375. */
  376. swiperClick(swiper) {
  377. if(swiper.jumpType == 1) { //无跳转
  378. return;
  379. } else if(swiper.jumpType == 2) { //url
  380. let url = encodeURIComponent(swiper.jumpUrl)
  381. uni.navigateTo({
  382. url:'/pages/webview/index?url='+swiper.jumpUrl
  383. })
  384. } else if(swiper.jumpType == 3) { //内部接口
  385. uni.navigateTo({
  386. url:swiper.jumpUrl
  387. })
  388. } else if(swiper.jumpType == 4) { //外部接口
  389. uni.navigateToMiniProgram({
  390. appId: swiper.remarks,
  391. path: swiper.jumpUrl,
  392. extraData: {
  393. },
  394. success(res) {
  395. // 打开成功
  396. },
  397. fail(err) {
  398. // console.log(err)
  399. }
  400. })
  401. }
  402. },
  403. /**
  404. * banner图片加载完成
  405. */
  406. imageLoad(e) {
  407. let winW = 750;
  408. let imgW = e.detail.width;
  409. let imgH = e.detail.height;
  410. this.swiperHeight = 750 * imgH / imgW;
  411. },
  412. async getAdvertising() {
  413. await this.advertisingHomeLocation();
  414. await this.advertisingList();
  415. },
  416. getUserSubscribeRecentExam() {
  417. return new Promise(resolve => {
  418. this.$api.getUserSubscribeRecentExam().then(res => {
  419. if(res.data.code == 200) {
  420. if(res.data.data) {
  421. let day = this.$method.timestampToTime(res.data.data.applySiteExamTime,true).replace(/-/g,'/')
  422. let dayTime = day + ' ' + res.data.data.applySiteStartTime
  423. let NowTime = new Date(); //考试时间
  424. let examTime = new Date(dayTime); //考试时间
  425. let t = (examTime.getTime() / 1000) - (NowTime.getTime() / 1000).toFixed(0);
  426. if(t > 0) {
  427. let day = +this.$method.GetRTime(examTime.getTime() / 1000,true)
  428. this.nearByDay = day;
  429. }
  430. }
  431. resolve()
  432. }
  433. })
  434. })
  435. },
  436. advertisingHomeLocation() {
  437. return new Promise(resolve => {
  438. this.$api.advertisingHomeLocation().then(res => {
  439. this.interval = res.data.data.intervalTime * 1000
  440. resolve()
  441. })
  442. })
  443. },
  444. advertisingList() {
  445. return new Promise(resolve => {
  446. this.$api.advertisingList({locationId:1}).then(res => {
  447. this.list = res.data.rows;
  448. resolve()
  449. })
  450. })
  451. },
  452. jumpPage(){
  453. this.$navTo.togo('/pages4/msg/index')
  454. },
  455. go(type) {
  456. if (!this.$method.isLogin()) {
  457. if(type == 'course') {
  458. uni.setStorageSync('goPath','course')
  459. } else if(type == 'bank' ) {
  460. uni.setStorageSync('goPath','bank')
  461. }
  462. this.$navTo.togo('/pages4/login/login');
  463. } else {
  464. if(type == 'course') {
  465. uni.navigateTo({
  466. url:'/pages2/wd/class'
  467. })
  468. } else if(type == 'bank') {
  469. this.$api.lockLockStatus({
  470. action:'bank'
  471. }).then(res => {
  472. if(res.data.code == 200) { //有其他端在操作,不能学习
  473. uni.showToast({
  474. icon:'none',
  475. title:res.data.msg,
  476. duration:3000,
  477. })
  478. } else if(res.data.code == 500) { //可以学习
  479. uni.navigateTo({
  480. url:'/pages2/wd/question_bank'
  481. })
  482. }
  483. })
  484. }
  485. }
  486. },
  487. //课程
  488. courseList() {
  489. // var param = this.paramList[0];
  490. // /app/common/goods/list
  491. this.$http({
  492. url: '/app/common/activity/recommend/list',
  493. method: 'get',
  494. data: {
  495. platform: 1,
  496. status: 1
  497. },
  498. noToken: true
  499. }).then((res) => {
  500. if (res.data.code == 200) {
  501. let goodsList1 = []; //推荐视频商品
  502. let goodsList2 = []; //推荐题库商品
  503. res.data.rows.forEach((item) => {
  504. if (item.type === 1) {
  505. goodsList1 = goodsList1.concat(item.goodsList)
  506. }
  507. if (item.type === 2) {
  508. goodsList2 = goodsList2.concat(item.goodsList)
  509. }
  510. });
  511. this.list1 = goodsList1.sort((a, b) => a.sort - b.sort);
  512. this.list2 = goodsList2.sort((a, b) => a.sort - b.sort);
  513. console.log(this.list1, this.list2)
  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>