index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961
  1. <template>
  2. <view >
  3. <nav-bar title="学习计划"></nav-bar>
  4. <view v-if="havePlan">
  5. <view class="card" v-if="havePlan">
  6. <swiper :style="{height:!isOpen?'550rpx':'260rpx'}" class="swiper" :current="swiperIndex" :duration="duration">
  7. <swiper-item v-for="(swiperItem,swiperIndex) in swiperList" :key="swiperIndex">
  8. <view class="date_t1">
  9. <!-- <u-icon name="arrow-left" size="28" v-if="havePreviousMonth" @click="swipeMonth(-1)"></u-icon> -->
  10. <text style="padding: 0 15rpx;">{{ swiperItem.year }}年 {{ swiperItem.month }}月</text>
  11. <!-- <u-icon name="arrow-right" size="28" v-if="haveNextMonth" @click="swipeMonth(1)"></u-icon> -->
  12. </view>
  13. <view style="width: 100%;margin-top: 20rpx;">
  14. <view v-for="(item, index) in date" :key="index" class="card_date">{{ item }}</view>
  15. </view>
  16. <view style="width: 100%;margin-top: 20rpx;">
  17. <view v-for="(item, index) in swiperItem.dayStudyList" :key="index" class="date_num">
  18. <view v-if="item.color == 0" @click="itemClick(item,index)" class="date_num_color0" :class="{active_color:item.date == activeDate}" v-show="item.date > 0">
  19. {{ item.date }}
  20. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  21. <view v-if="item.dot" class="date_dot"></view>
  22. </view>
  23. <view v-if="item.color == 1" @click="itemClick(item,index)" class="date_num_color1" :class="{active_color:item.date == activeDate}">
  24. {{ item.date }}
  25. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  26. <view v-if="item.dot" class="date_dot"></view>
  27. </view>
  28. <view v-if="item.color == 2" @click="itemClick(item,index)" class="date_num_color2" :class="{active_color:item.date == activeDate}">
  29. {{ item.date }}
  30. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  31. <view v-if="item.dot" class="date_dot"></view>
  32. </view>
  33. <view v-if="item.color == 3" @click="itemClick(item,index)" class="date_num_color3" :class="{active_color:item.date == activeDate}">
  34. {{ item.date }}
  35. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  36. <view v-if="item.dot" class="date_dot"></view>
  37. </view>
  38. </view>
  39. </view>
  40. <view style="width: 100%;display: flex;justify-content: center;" v-if="isOpen == false">
  41. <view @click="oepn_calendar" style="height: 20rpx;width: 40rpx;padding:20rpx 0;"><view class="date_line"></view></view>
  42. </view>
  43. <view style="width: 100%;display: flex;justify-content: center;" v-else>
  44. <image class="date_line_close" @click="close_calendar" src="/static/close_card.png"></image>
  45. </view>
  46. </swiper-item>
  47. </swiper>
  48. <!-- <view class="date_t1">
  49. <u-icon name="arrow-left" size="28" v-if="havePreviousMonth" @click="swipeMonth(-1)"></u-icon>
  50. <text style="padding: 0 15rpx;">{{ calendarStudyVo.year }}年 {{ calendarStudyVo.month }}月</text>
  51. <u-icon name="arrow-right" size="28" v-if="haveNextMonth" @click="swipeMonth(1)"></u-icon>
  52. </view>
  53. <view style="width: 100%;margin-top: 20rpx;">
  54. <view v-for="(item, index) in date" :key="index" class="card_date">{{ item }}</view>
  55. </view>
  56. <view style="width: 100%;margin-top: 20rpx;">
  57. <view v-for="(item, index) in showDayList" :key="index" class="date_num">
  58. <view v-if="item.color == 0" @click="itemClick(item,index)" class="date_num_color0" :class="{active_color:item.date == activeDate}" v-show="item.date > 0">
  59. {{ item.date }}
  60. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  61. <view v-if="item.dot" class="date_dot"></view>
  62. </view>
  63. <view v-if="item.color == 1" @click="itemClick(item,index)" class="date_num_color1" :class="{active_color:item.date == activeDate}">
  64. {{ item.date }}
  65. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  66. <view v-if="item.dot" class="date_dot"></view>
  67. </view>
  68. <view v-if="item.color == 2" @click="itemClick(item,index)" class="date_num_color2" :class="{active_color:item.date == activeDate}">
  69. {{ item.date }}
  70. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  71. <view v-if="item.dot" class="date_dot"></view>
  72. </view>
  73. <view v-if="item.color == 3" @click="itemClick(item,index)" class="date_num_color3" :class="{active_color:item.date == activeDate}">
  74. {{ item.date }}
  75. <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
  76. <view v-if="item.dot" class="date_dot"></view>
  77. </view>
  78. </view>
  79. </view>
  80. <view style="width: 100%;display: flex;justify-content: center;" v-if="isOpen == false">
  81. <view @click="oepn_calendar" style="height: 20rpx;width: 40rpx;padding:20rpx 0;"><view class="date_line"></view></view>
  82. </view>
  83. <view style="width: 100%;display: flex;justify-content: center;" v-else>
  84. <image class="date_line_close" @click="close_calendar" src="/static/close_card.png"></image>
  85. </view> -->
  86. <view v-for="(item, index) in workList" :key="index">
  87. <view style="padding-left: 30rpx;padding-top: 10rpx;display: flex;align-items: center;background:#fff;" @click="jumpDetail(item)">
  88. <text class="date_t2">{{ item.goodsName }}</text>
  89. <view class="circle_num" style="margin-left: 20rpx;">{{ item.classHours }}</view>
  90. </view>
  91. </view>
  92. </view>
  93. <!-- 列表-->
  94. <view>
  95. <uni-swipe-action>
  96. <uni-swipe-action-item :autoClose="false" @change="swipeChange($event, item)" :show="item.show" v-for="(item, index) in list" :key="index">
  97. <view class="list_item" :class="index % 2 == 0 ? 'list_item_bac1' : 'list_item_bac2'" @click.stop="openEdit(item)">
  98. <u-row>
  99. <u-col span="11">
  100. <text class="item_t1">
  101. {{ item.goodsVos[0].educationName + '-' + item.goodsVos[0].projectName + '-' + item.goodsVos[0].businessName }}:{{
  102. $method.timestampToTime(item.endTime)
  103. }}截止
  104. </text>
  105. </u-col>
  106. <u-col span="1"><image style="transform: rotate(180deg);" src="/static/icon/openSwith.png" class="img_more" @click.stop="openShow(item)"></image></u-col>
  107. </u-row>
  108. <scroll-view style="white-space: nowrap" class="scroll-view_H" scroll-x="true">
  109. <view style="margin-top: 30rpx;display: inline-block;width:296rpx;margin-right: 30rpx;" v-for="(items, indexs) in item.goodsVos" :key="indexs">
  110. <image :src="$method.splitImgHost(items.coverUrl)" class="r_image"></image>
  111. <view class="r_t2">{{ items.goodsName }}</view>
  112. </view>
  113. </scroll-view>
  114. <view style="display: flex;margin-top: 30rpx;">
  115. <text class="item_t2">学习频率:</text>
  116. <view style="display: flex;justify-content:center;">
  117. <view v-for="(item1, index) in item.studyCount" :key="index" class="item_date">{{ replay(item1) }}</view>
  118. </view>
  119. </view>
  120. <view style="display: flex;margin-top: 20rpx;">
  121. <text class="item_t2">学习进度:{{ item.studyNum }}/{{ item.pitchNum }}</text>
  122. </view>
  123. </view>
  124. <template v-slot:right>
  125. <view class="operate">
  126. <image src="/static/operate_1.png" class="operate_img operate_img1" @click="delWorker(item)"></image>
  127. <!-- <image src="/static/operate_2.png" class="operate_img operate_img2"></image> -->
  128. <image @click="edit(item)" src="/static/operate_3.png" class="operate_img operate_img3"></image>
  129. </view>
  130. </template>
  131. </uni-swipe-action-item>
  132. </uni-swipe-action>
  133. </view>
  134. <view class="newPlan" @click="newPlan()">新建计划</view>
  135. </view>
  136. <view v-else class="tipBox">
  137. <template v-if="isLoaded">
  138. <view class="dis_ffs" v-if="goodsList.length">
  139. <view class="tip">您暂无相关计划哦~</view>
  140. <view class="tipBtn" @click="newPlan()">马上制定</view>
  141. </view>
  142. <view class="dis_ffs" v-else>
  143. <view class="tip">您暂无课程可以制定计划哦~</view>
  144. <view class="tipBtn" @click="planNow()">马上选课</view>
  145. </view>
  146. </template>
  147. </view>
  148. </view>
  149. </template>
  150. <script>
  151. export default {
  152. data() {
  153. return {
  154. swiperIndex:0,
  155. isLoaded:false, //是否请求完毕
  156. monthIndex: 0,
  157. haveNextMonth: false,
  158. havePreviousMonth: false,
  159. showDayList: [],
  160. workList: [],
  161. swiperList:[],
  162. calendarStudyVo: {},
  163. index: 0,
  164. date: ['日', '一', '二', '三', '四', '五', '六'],
  165. list: [],
  166. isOpen: false,
  167. date_num: [
  168. {
  169. num: 20,
  170. color: 0,
  171. note: 0,
  172. dot: false
  173. },
  174. {
  175. num: 21,
  176. color: 1,
  177. note: 0,
  178. dot: false
  179. },
  180. {
  181. num: 22,
  182. color: 0,
  183. note: 0,
  184. dot: true
  185. },
  186. {
  187. num: 23,
  188. color: 2,
  189. note: 0,
  190. dot: false
  191. },
  192. {
  193. num: 24,
  194. color: 1,
  195. note: 0,
  196. dot: false
  197. },
  198. {
  199. num: 25,
  200. color: 3,
  201. note: 2,
  202. dot: false
  203. },
  204. {
  205. num: 26,
  206. color: 0,
  207. note: 1,
  208. dot: true
  209. }
  210. ],
  211. date_use: [],
  212. options: [
  213. {
  214. text: '取消',
  215. style: {
  216. backgroundColor: '#007aff'
  217. }
  218. },
  219. {
  220. text: '确认',
  221. style: {
  222. backgroundColor: '#dd524d'
  223. }
  224. }
  225. ],
  226. activeDate:'',
  227. dayStudyList: [],
  228. listItem: {},
  229. currentMonth: 0,
  230. havePlan: false,
  231. goodsList: [] //用户拥有的商品
  232. };
  233. },
  234. onLoad(option) {
  235. this.date_use = this.date_num;
  236. this.getUserGoodsList();
  237. },
  238. onShow() {
  239. this.workList = [];
  240. this.showDayList = [];
  241. // this.calendarStudyVo = {};
  242. this.isOpen = false;
  243. this.getList();
  244. },
  245. methods: {
  246. itemClick(item,index) {
  247. // console.log(item)
  248. this.activeDate = item.date;
  249. this.workList = this.getStudyCourseByDay();
  250. },
  251. /**
  252. * 根据选中日期获取需要学习的课程
  253. */
  254. getStudyCourseByDay() {
  255. let courseList = [];
  256. this.showDayList.forEach(day => {
  257. if(day.date == this.activeDate) {
  258. if(day.daySectionList) {
  259. day.daySectionList.forEach(section => {
  260. this.listItem.goodsVos.forEach(vos => {
  261. if(vos.goodsId == section.goodsId) {
  262. courseList.push(vos)
  263. }
  264. })
  265. })
  266. }
  267. }
  268. })
  269. return courseList;
  270. },
  271. planNow(){
  272. uni.switchTab({
  273. url: '/pages/course/index'
  274. });
  275. },
  276. getUserGoodsList() {
  277. this.$api.courseGoodsList().then(res => {
  278. if (res.data.code === 200) {
  279. this.isLoaded = true;
  280. this.goodsList = res.data.rows;
  281. }
  282. });
  283. },
  284. //删除计划
  285. delWorker(option) {
  286. var data = {
  287. planId: option.planId,
  288. status: -1
  289. };
  290. let self = this;
  291. this.$api.editsystemplan(data).then(res => {
  292. uni.setStorageSync('updateHome', 1);
  293. self.getList();
  294. });
  295. },
  296. swipeMonth(index) {
  297. this.swiperIndex = this.swiperIndex + index
  298. console.log(this.swiperIndex)
  299. // console.log(index,198)
  300. // this.isOpen = false;
  301. // this.haveNextMonth = false;
  302. // this.havePreviousMonth = false;
  303. // this.monthIndex = this.monthIndex + index;
  304. // this.currentMonth = this.currentMonth + index;
  305. // let item = this.listItem.calendarStudyVo[this.monthIndex];
  306. // this.calendarStudyVo = item;
  307. // this.activeDate = '';
  308. // // this.workList = this.calendarStudyVo.goodsVos;
  309. // this.workList = this.getStudyCourseByDay();
  310. // if (this.monthIndex > 0) {
  311. // this.havePreviousMonth = true;
  312. // }
  313. // if (this.monthIndex < this.listItem.calendarStudyVo.length - 1) {
  314. // this.haveNextMonth = true;
  315. // }
  316. // this.dealDayList();
  317. },
  318. dealMonth() {
  319. this.swiperList = []
  320. let date = new Date();
  321. let currentMonth = date.getMonth() + 1;
  322. this.haveNextMonth = false;
  323. this.havePreviousMonth = false;
  324. this.calendarStudyVo = {}
  325. this.workList = this.getStudyCourseByDay();
  326. // this.workList = this.listItem.goodsVos;
  327. if (this.listItem !== undefined) {
  328. for (let i = 0; i < this.listItem.calendarStudyVo.length; i++) {
  329. let item = this.listItem.calendarStudyVo[i];
  330. if (item.month == currentMonth) {
  331. this.monthIndex = i;
  332. this.calendarStudyVo = item;
  333. if (i > 0) {
  334. this.havePreviousMonth = true;
  335. }
  336. if (i < this.listItem.calendarStudyVo.length - 1) {
  337. this.haveNextMonth = true;
  338. }
  339. }
  340. this.swiperList.push(this.listItem.calendarStudyVo[i])
  341. }
  342. if(!this.calendarStudyVo.dayStudyList) { //计划没有当前月
  343. this.monthIndex = 0;
  344. this.calendarStudyVo = this.listItem.calendarStudyVo[0];
  345. if(this.listItem.calendarStudyVo.length > 1) {
  346. console.log('len')
  347. this.haveNextMonth = true;
  348. }
  349. }
  350. this.dealDayList();
  351. }
  352. },
  353. openEdit(item) {
  354. this.activeDate = '';
  355. this.listItem = item;
  356. this.isOpen = false;
  357. this.dealMonth();
  358. },
  359. dealDayList() {
  360. this.swiperList.forEach((swiper,index) => {
  361. let firstItem = swiper.dayStudyList[0]
  362. for (let i = 0; i < firstItem.studyDay; i++) {
  363. //补齐1号前的日数凑满一周
  364. swiper.dayStudyList.unshift({ date: 0 });
  365. }
  366. for (let i = 0; i < swiper.dayStudyList.length; i++) {
  367. let item = swiper.dayStudyList[i];
  368. item.color = 0;
  369. if (item.perform == 1) {
  370. item.color = 1;
  371. }
  372. if (item.perform == 2) {
  373. item.color = 2;
  374. }
  375. item.note = item.studyCourseKnob;
  376. if (item.note > 0) {
  377. item.dot = true;
  378. }
  379. }
  380. for (let i = 0; i < swiper.dayStudyList.length; i++) {
  381. let item = swiper.dayStudyList[i];
  382. if (item.note > 0) {
  383. item.note = 0;
  384. swiper.dayStudyList.forEach(day => {
  385. if(day.date == item.date) {
  386. if(day.daySectionList) {
  387. day.daySectionList.forEach(section => {
  388. this.listItem.goodsVos.forEach(vos => {
  389. if(vos.goodsId == section.goodsId) {
  390. item.note += vos.classHours
  391. }
  392. })
  393. })
  394. }
  395. }
  396. })
  397. }
  398. }
  399. })
  400. // let firstItem = this.calendarStudyVo.dayStudyList[0];
  401. // this.calendarStudyVo.miniDayStudyList = []; //创建缩放的数组
  402. // let date = new Date();
  403. // let num = date.getDate();
  404. // //如果不是当前月,默认显示第一周
  405. // if ((date.getMonth() + 1) != this.calendarStudyVo.month) {
  406. // num = 1;
  407. // }
  408. // for (let i = 0; i < firstItem.studyDay; i++) {
  409. // //补齐1号前的日数凑满一周
  410. // this.calendarStudyVo.dayStudyList.unshift({ date: 0 });
  411. // }
  412. // let todayIndex;
  413. // let todayItem;
  414. // for (let i = 0; i < this.calendarStudyVo.dayStudyList.length; i++) {
  415. // let item = this.calendarStudyVo.dayStudyList[i];
  416. // item.color = 0;
  417. // if (item.date == num) {
  418. // if (date.getMonth() + 1 == this.calendarStudyVo.month) {
  419. // item.color = 3;
  420. // }
  421. // todayIndex = i;
  422. // todayItem = item;
  423. // }
  424. // if (item.perform == 1) {
  425. // item.color = 1;
  426. // }
  427. // if (item.perform == 2) {
  428. // item.color = 2;
  429. // }
  430. // item.note = item.studyCourseKnob;
  431. // if (item.note > 0) {
  432. // item.dot = true;
  433. // }
  434. // }
  435. // let start
  436. // start = todayIndex - todayItem.studyDay;
  437. // /* if(todayItem){
  438. // }else{
  439. // //今天在下个月不存在,例如31号
  440. // todayIndex = this.calendarStudyVo.dayStudyList.length-1
  441. // todayItem = this.calendarStudyVo.dayStudyList[todayIndex]
  442. // start = todayIndex - todayItem.studyDay;
  443. // } */
  444. // /* if ((date.getMonth() + 1) != this.calendarStudyVo.month) {
  445. // todayIndex = 0
  446. // todayItem = this.calendarStudyVo.dayStudyList[todayIndex]
  447. // start = 0;
  448. // } */
  449. // console.log(start,689)
  450. // /* this.calendarStudyVo.miniDayStudyList = []
  451. // for(let i=start;i<start + 7;i++){
  452. // this.calendarStudyVo.miniDayStudyList.push(this.calendarStudyVo.dayStudyList[i])
  453. // } */
  454. // console.log(this.calendarStudyVo.miniDayStudyList,789)
  455. // this.calendarStudyVo.miniDayStudyList = this.calendarStudyVo.dayStudyList.slice(start, start + 7);
  456. // this.showDayList = this.calendarStudyVo.miniDayStudyList;
  457. // console.log(this.showDayList)
  458. // for (let i = 0; i < this.calendarStudyVo.dayStudyList.length; i++) {
  459. // let item = this.calendarStudyVo.dayStudyList[i];
  460. // if (item.note > 0) {
  461. // item.note = 0;
  462. // this.showDayList.forEach(day => {
  463. // if(day.date == item.date) {
  464. // if(day.daySectionList) {
  465. // day.daySectionList.forEach(section => {
  466. // this.listItem.goodsVos.forEach(vos => {
  467. // if(vos.goodsId == section.goodsId) {
  468. // item.note += vos.classHours
  469. // }
  470. // })
  471. // })
  472. // }
  473. // }
  474. // })
  475. // }
  476. // }
  477. },
  478. async jumpDetail(item) {
  479. let currentTime = this.$method.timest();
  480. if(currentTime < item.studyStartTime || currentTime > item.studyEndTime) {
  481. uni.showToast({
  482. title:'不在学习有效期,不可以学习了哦',
  483. icon:'none'
  484. })
  485. return;
  486. }
  487. if( (item.classStartTime && currentTime <= item.classStartTime) || (item.classEndTime && currentTime >= item.classEndTime) ) {
  488. uni.showToast({
  489. title:'不在班级有效期,不能进入学习',
  490. icon:'none'
  491. })
  492. return;
  493. }
  494. if(item.learningStatus == 2) {
  495. uni.showToast({
  496. title:'开放学习时间待定,不能进入学习',
  497. icon:'none'
  498. })
  499. return;
  500. }
  501. if(item.classStatus == 0 ) {
  502. uni.showToast({
  503. title:'尚未开班,不能进入学习',
  504. icon:'none'
  505. })
  506. return;
  507. }
  508. if(item.learningStatus == 3 && (currentTime < item.learningTimeStart) ) {
  509. uni.showToast({
  510. title:'不在开放学习时间,不能进入学习',
  511. icon:'none'
  512. })
  513. return;
  514. }
  515. if(item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > currentTime) && (item.classEndTime && (item.classEndTime < currentTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0) {
  516. uni.showModal({
  517. title:'提示',
  518. content:'班级已过期,需要重新选班',
  519. showCancel:false,
  520. success:() => {
  521. uni.navigateTo({
  522. url:"/pages2/wd/class"
  523. })
  524. }
  525. })
  526. return;
  527. }
  528. let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId,item.gradeId);
  529. if(rebuildStatus == 0) {
  530. this.$navTo.togo('/pages2/learn/details', {
  531. gradeId:item.gradeId,
  532. goodsId: item.goodsId
  533. })
  534. return;
  535. }
  536. if(item.courseNum == 1 ) {
  537. this.$api.courseCourseList({
  538. pageNum:1,
  539. pageSize:1,
  540. goodsId:item.goodsId,
  541. gradeId:item.gradeId
  542. }).then(res => {
  543. if(res.data.code == 200) {
  544. uni.navigateTo({
  545. url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
  546. })
  547. }
  548. });
  549. return;
  550. }
  551. this.$navTo.togo('/pages2/wd/course', {
  552. id: item.goodsId,
  553. gid:item.gradeId
  554. });
  555. return;
  556. },
  557. /**
  558. * @param {Object} goodsId 商品id
  559. * 查询商品重修状态
  560. */
  561. courseGoodsRebuildStatus(goodsId,gradeId) {
  562. return new Promise(resolve => {
  563. this.$api.courseGoodsRebuildStatus({
  564. goodsId:goodsId,
  565. gradeId:gradeId
  566. }).then(res => {
  567. resolve(res.data.data)
  568. })
  569. })
  570. },
  571. replay(index) {
  572. if (index == 0) {
  573. return '日';
  574. }
  575. if (index == 1) {
  576. return '一';
  577. }
  578. if (index == 2) {
  579. return '二';
  580. }
  581. if (index == 3) {
  582. return '三';
  583. }
  584. if (index == 4) {
  585. return '四';
  586. }
  587. if (index == 5) {
  588. return '五';
  589. }
  590. if (index == 6) {
  591. return '六';
  592. }
  593. },
  594. getList() {
  595. let self = this;
  596. this.$api.getsystemplanlist({ status: 1 }).then(result => {
  597. result.data.rows.forEach((item, index) => {
  598. item.show = 'none';
  599. item.studyNum = 0;
  600. item.pitchNum = 0;
  601. item.goodsVos.forEach(vos => {
  602. item.pitchNum += vos.secAllNum
  603. item.studyNum += vos.stuAllNum
  604. })
  605. });
  606. self.list = result.data.rows;
  607. if (result.data.rows.length > 0) {
  608. self.listItem = self.list[0];
  609. self.dealMonth();
  610. self.havePlan = true;
  611. // if (self.list.length > 0) {
  612. // self.listItem = self.list[0];
  613. // self.dealMonth();
  614. // self.havePlan = true;
  615. // }
  616. } else {
  617. self.havePlan = false;
  618. }
  619. self.updateHomePlan();
  620. });
  621. },
  622. updateHomePlan() {
  623. /* const pages = getCurrentPages(); //获取页面栈
  624. const beforePage = pages[pages.length - 2]; //前一个页面
  625. beforePage.$vm.updateHomePlan(); */
  626. },
  627. newPlan() {
  628. this.$navTo.togo('/pages2/plan/create');
  629. },
  630. edit(item) {
  631. this.$navTo.togo('/pages2/plan/edit', {
  632. id: item.planId
  633. });
  634. },
  635. swipeChange(e, item) {
  636. item.show = e;
  637. },
  638. openShow(item) {
  639. if (item.show == 'none') {
  640. item.show = 'right';
  641. } else {
  642. item.show = 'none';
  643. }
  644. },
  645. updateHomePlan() {
  646. const pages = getCurrentPages(); //获取页面栈
  647. const beforePage = pages[pages.length - 2]; //前一个页面
  648. // beforePage.$vm.updateHomePlan();
  649. },
  650. close_calendar() {
  651. this.isOpen = false;
  652. this.showDayList = this.calendarStudyVo.miniDayStudyList;
  653. },
  654. oepn_calendar() {
  655. this.isOpen = true;
  656. this.showDayList = this.calendarStudyVo.dayStudyList;
  657. },
  658. random(min, max) {
  659. return Math.floor(Math.random() * (max - min)) + min;
  660. }
  661. }
  662. };
  663. </script>
  664. <style scope lang="scss">
  665. .dis_ffs {
  666. display: flex;
  667. flex-direction: column;
  668. align-items: center;
  669. justify-content: center;
  670. }
  671. .tipBtn {
  672. width: 160rpx;
  673. height: 56rpx;
  674. background: #007aff;
  675. border-radius: 16rpx;
  676. color: #ffffff;
  677. text-align: center;
  678. line-height: 56rpx;
  679. margin-top: 30rpx;
  680. }
  681. .tipBox {
  682. display: flex;
  683. align-items: center; /*垂直居中*/
  684. justify-content: center; /*水平居中*/
  685. flex-direction: column;
  686. margin-top: 40%;
  687. }
  688. .tip {
  689. color: #999999;
  690. font-size: 32rpx;
  691. }
  692. .newPlan {
  693. width: 200rpx;
  694. height: 64rpx;
  695. background: #ffffff;
  696. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(47, 67, 121, 0.15);
  697. border-radius: 32rpx;
  698. font-size: 24rpx;
  699. font-family: PingFang SC;
  700. font-weight: bold;
  701. color: #32467b;
  702. text-align: center;
  703. line-height: 64rpx;
  704. position: fixed;
  705. bottom: 60rpx;
  706. left: 50%;
  707. transform: translateX(-50%);
  708. }
  709. .operate_img3 {
  710. background: #3478f6;
  711. }
  712. .operate_img2 {
  713. background: #f09a37;
  714. }
  715. .operate_img1 {
  716. background: #eb4d3d;
  717. }
  718. .operate_img {
  719. width: 64rpx;
  720. height: 64rpx;
  721. border-radius: 50%;
  722. padding:14rpx;
  723. box-sizing: border-box;
  724. margin: 10rpx 0;
  725. }
  726. .operate {
  727. margin-top:16rpx;
  728. width: 80rpx;
  729. display: flex;
  730. flex-direction: column;
  731. align-items: center;
  732. justify-content: center;
  733. }
  734. .item_t2 {
  735. font-size: 23rpx;
  736. color: #32467b;
  737. }
  738. .item_date {
  739. width: 26rpx;
  740. height: 26rpx;
  741. background: #007AFF;
  742. border-radius: 50%;
  743. margin-left: 20rpx;
  744. font-size: 18rpx;
  745. color: #fefeff;
  746. text-align: center;
  747. }
  748. .r_t2 {
  749. font-size: 20rpx;
  750. font-family: PingFang SC;
  751. font-weight: 400;
  752. color: #0c141f;
  753. white-space: pre-wrap;
  754. }
  755. .r_image {
  756. width: 278rpx;
  757. height: 134rpx;
  758. border-radius: 16rpx;
  759. }
  760. .img_more {
  761. width: 26rpx;
  762. height: 26rpx;
  763. }
  764. .item_t1 {
  765. font-size: 30rpx;
  766. font-family: PingFang SC;
  767. font-weight: 500;
  768. color: #32467b;
  769. }
  770. .list_item_bac1 {
  771. background: linear-gradient(45deg, rgba(172, 203, 238, 0.2), rgba(231, 240, 253, 0.2));
  772. }
  773. .list_item_bac2 {
  774. background: linear-gradient(45deg, rgba(255, 232, 206, 0.3), rgba(251, 184, 160, 0.3));
  775. }
  776. .list_item {
  777. width: 100%;
  778. min-height: 418rpx;
  779. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(47, 67, 121, 0.05);
  780. border-radius: 24rpx;
  781. margin-top: 16rpx;
  782. padding: 15rpx;
  783. background:#fff;
  784. }
  785. .date_dot {
  786. width: 6rpx;
  787. height: 6rpx;
  788. background: #ffcc00;
  789. border-radius: 50%;
  790. margin: 0 auto;
  791. }
  792. .date_note {
  793. border-radius: 15rpx;
  794. padding:0 5rpx;
  795. min-width:50rpx;
  796. height: 29rpx;
  797. line-height: 25rpx;
  798. border: 1px solid #ffcc00;
  799. font-size: 18rpx;
  800. color: #ffcc00;
  801. text-align: center;
  802. display: inline-block;
  803. position: absolute;
  804. top: -19rpx;
  805. left: 80%;
  806. }
  807. .circle_num {
  808. border-radius: 15rpx;
  809. padding:0 5rpx;
  810. min-width:50rpx;
  811. height: 29rpx;
  812. border: 1px solid #ffcc00;
  813. font-size: 18rpx;
  814. color: #ffcc00;
  815. text-align: center;
  816. display: inline-block;
  817. margin: 5rpx;
  818. }
  819. .date_t2 {
  820. font-size: 30rpx;
  821. font-family: PingFang SC;
  822. font-weight: 500;
  823. color: #2f4379;
  824. }
  825. .date_line_close {
  826. width: 40rpx;
  827. height: 20rpx;
  828. }
  829. .date_line {
  830. width: 40rpx;
  831. height: 6rpx;
  832. background: #7f8caf;
  833. border-radius: 2rpx;
  834. }
  835. .date_num {
  836. width: 14%;
  837. text-align: center;
  838. position: relative;
  839. display: inline-block;
  840. margin-top: 20rpx;
  841. }
  842. .date_num_color0 {
  843. position:relative;
  844. display: inline-block;
  845. width: 48rpx;
  846. height: 48rpx;
  847. line-height: 48rpx;
  848. text-align: center;
  849. color: #32467b;
  850. }
  851. .date_num_color1 {
  852. position:relative;
  853. display: inline-block;
  854. width: 48rpx;
  855. height: 48rpx;
  856. line-height: 48rpx;
  857. text-align: center;
  858. color: #34c759;
  859. }
  860. .date_num_color2 {
  861. position:relative;
  862. display: inline-block;
  863. width: 48rpx;
  864. height: 48rpx;
  865. line-height: 48rpx;
  866. text-align: center;
  867. color: #ff3b30;
  868. }
  869. .date_num_color3 {
  870. position:relative;
  871. color: #007AFF;
  872. background-color: rgba(229,241,255,1);
  873. border-radius: 50%;
  874. width: 48rpx;
  875. height: 48rpx;
  876. line-height: 48rpx;
  877. text-align: center;
  878. display: inline-block;
  879. }
  880. .active_color{
  881. color: #fff;
  882. background-color: #007AFF;
  883. border-radius: 50%;
  884. width: 48rpx;
  885. height: 48rpx;
  886. line-height: 48rpx;
  887. text-align: center;
  888. display: inline-block;
  889. }
  890. .card_date {
  891. width: 14%;
  892. text-align: center;
  893. color: #7f8caf;
  894. position: relative;
  895. display: inline-block;
  896. }
  897. .date_t1 {
  898. font-size: 24rpx;
  899. font-family: PingFang SC;
  900. font-weight: bold;
  901. color: #2f4379;
  902. width: 100%;
  903. text-align: center;
  904. padding: 20rpx 0;
  905. }
  906. .card {
  907. width: 100%;
  908. background: #ffffff;
  909. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(47, 67, 121, 0.05);
  910. border-radius: 24rpx;
  911. padding-bottom:20rpx;
  912. .swiper {
  913. height:550rpx;
  914. }
  915. }
  916. page {
  917. background: rgba(234,238,241,1);
  918. }
  919. </style>