stuff.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <template>
  2. <view>
  3. <nav-logo title="我的资料"></nav-logo>
  4. <view v-if="goodsList.length" class="my_courses">
  5. <view v-for="(item, index) in goodsList" :key="index" class="course_item">
  6. <view class="c_downs">
  7. <view class="lefts">
  8. <image
  9. class="lefet_img"
  10. :src="$method.splitImgHost(item.coverUrl, true)"
  11. mode=""
  12. ></image>
  13. </view>
  14. <view class="rights">
  15. <view class="learn_progress">
  16. <view class="progress_up">
  17. <view class="cou_titles line2">{{ item.goodsName }}</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="course_item_info" v-if="item.goodsType !== 6">
  23. <view>
  24. <text>商品有效期:</text>
  25. <template v-if="item.validityEndTime">
  26. <text
  27. :class="{
  28. 'line-through':
  29. sysTime <= item.validityStartTime ||
  30. sysTime >= item.validityEndTime,
  31. }"
  32. >
  33. {{ $method.formDate(item.validityStartTime, "yyyy/mm/dd") }}至{{
  34. $method.formDate(item.validityEndTime, "yyyy/mm/dd")
  35. }}</text
  36. >
  37. </template>
  38. <text v-else>——</text>
  39. </view>
  40. </view>
  41. <view class="study_btns">
  42. <view @click="studyIn(item)" class="exam_word intos">进入学习</view>
  43. </view>
  44. </view>
  45. </view>
  46. <view v-else class="no_datas">
  47. <image class="courses" src="/static/learn/no_course.png" mode=""></image>
  48. <view class="no_learns">您目前没有可学习的课程</view>
  49. <view class="choose" @click="toChoose()">立即去选购</view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. name: "SaasMiniprogramStuff",
  56. data() {
  57. return {
  58. param: {},
  59. goodsList: [],
  60. total: 0,
  61. sysTime: "",
  62. };
  63. },
  64. onLoad() {
  65. this.init();
  66. },
  67. onReachBottom() {
  68. if (this.goodsList.length < this.total) {
  69. this.param.pageNum++;
  70. this.getGoodsHandoutsList();
  71. }
  72. },
  73. methods: {
  74. init() {
  75. this.param = {
  76. pageNum: 1,
  77. pageSize: 10,
  78. };
  79. this.sysTime = +this.$method.timest();
  80. this.goodsList = [];
  81. this.getGoodsHandoutsList();
  82. },
  83. getGoodsHandoutsList() {
  84. this.$api.goodsHandoutsList(this.param).then((res) => {
  85. this.goodsList.push(...res.data.rows);
  86. this.total = res.data.total;
  87. });
  88. },
  89. studyIn(item) {
  90. if (
  91. item.validityStartTime &&
  92. (this.sysTime <= item.validityStartTime ||
  93. this.sysTime >= item.validityEndTime)
  94. ) {
  95. uni.showToast({
  96. icon: "none",
  97. title: "不在商品有效期,不能进入学习",
  98. });
  99. return;
  100. }
  101. },
  102. toChoose() {
  103. uni.reLaunch({
  104. url: "/pages/information/index",
  105. });
  106. },
  107. },
  108. };
  109. </script>
  110. <style>
  111. page {
  112. background: #eaeef1;
  113. }
  114. </style>
  115. <style lang="scss" scoped>
  116. .my_courses {
  117. padding: 24rpx;
  118. .titles {
  119. font-size: 32rpx;
  120. color: #333333;
  121. margin: 44rpx 0rpx 24rpx 43rpx;
  122. font-weight: bold;
  123. display: block;
  124. }
  125. .course_item {
  126. width: 100%;
  127. // height: 278rpx;
  128. background: #ffffff;
  129. box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1, 99, 235, 0.1);
  130. border-radius: 24rpx;
  131. padding: 29rpx 29rpx 20rpx 24rpx;
  132. margin-bottom: 20rpx;
  133. .course_item_info {
  134. border-radius: 16rpx;
  135. background: #f8f8f8;
  136. padding: 24rpx 24rpx 10rpx;
  137. margin-top: 24rpx;
  138. & > view {
  139. margin-bottom: 10rpx;
  140. }
  141. view {
  142. text {
  143. font-size: 24rpx;
  144. &:nth-of-type(1) {
  145. color: #969696;
  146. }
  147. &:nth-of-type(2) {
  148. color: #4b4b4b;
  149. }
  150. }
  151. .eb {
  152. color: #eb5757 !important;
  153. }
  154. }
  155. }
  156. .titlews {
  157. padding-bottom: 24rpx;
  158. }
  159. .cou_titles {
  160. color: #222222;
  161. font-size: 28rpx;
  162. font-weight: bold;
  163. width: 100%;
  164. }
  165. .learn_ranges {
  166. color: #666;
  167. font-size: 24rpx;
  168. .l_range {
  169. width: 20rpx;
  170. height: 24rpx;
  171. margin-right: 9rpx;
  172. }
  173. .l_time {
  174. color: #333;
  175. }
  176. }
  177. .c_downs {
  178. display: flex;
  179. align-items: center;
  180. }
  181. // 状态
  182. .all_status {
  183. width: 654rpx;
  184. background: #f8f8f8;
  185. border-radius: 16rpx;
  186. }
  187. .class-warm {
  188. display: flex;
  189. align-items: flex-start;
  190. &__icon {
  191. margin-right: 10rpx;
  192. }
  193. &__text {
  194. .date {
  195. color: #ff3b30;
  196. font-size: 22rpx;
  197. font-weight: 400;
  198. }
  199. }
  200. }
  201. .box_progress {
  202. display: flex;
  203. justify-content: space-between;
  204. align-items: center;
  205. margin-top: 20rpx;
  206. // .disabled {
  207. // opacity: 0.6;
  208. // }
  209. }
  210. .study_tips {
  211. color: #eb5757;
  212. font-size: 24rpx;
  213. margin-top: 20rpx;
  214. }
  215. .study_btns {
  216. width: 100%;
  217. margin-top: 40rpx;
  218. display: flex;
  219. align-items: center;
  220. justify-content: flex-end;
  221. .exam_btns {
  222. // width: 64%;
  223. display: flex;
  224. justify-content: flex-end;
  225. align-items: center;
  226. }
  227. }
  228. .box_appoint {
  229. // width: 35%;
  230. display: flex;
  231. align-items: center;
  232. justify-content: flex-end;
  233. .img {
  234. width: 32rpx;
  235. height: 32rpx;
  236. margin-right: 10rpx;
  237. }
  238. }
  239. .exam_word {
  240. font-size: 24rpx;
  241. font-weight: 500;
  242. width: 144rpx;
  243. height: 56rpx;
  244. line-height: 56rpx;
  245. text-align: center;
  246. background: #ffffff;
  247. border-radius: 66rpx;
  248. margin-left: 32rpx;
  249. }
  250. .ones {
  251. color: #484848;
  252. border: 2rpx solid #b9b9b9;
  253. }
  254. .intos {
  255. color: #498afe;
  256. border: 2rpx solid #498afe;
  257. }
  258. }
  259. .lefts {
  260. width: 204rpx;
  261. height: 120rpx;
  262. border-radius: 12rpx;
  263. margin-right: 26rpx;
  264. position: relative;
  265. top: 0;
  266. left: 0;
  267. .lefet_img {
  268. width: 100%;
  269. height: 100%;
  270. display: block;
  271. border-radius: 16rpx;
  272. }
  273. .live_icon {
  274. width: 65rpx;
  275. height: 35rpx;
  276. line-height: 35rpx;
  277. border-radius: 12rpx 0rpx 12rpx 0rpx;
  278. background-color: #ffb102;
  279. color: #fff;
  280. font-size: 20rpx;
  281. text-align: center;
  282. position: absolute;
  283. top: 0;
  284. left: 0;
  285. }
  286. }
  287. .rights {
  288. width: 400rpx;
  289. height: 120rpx;
  290. display: flex;
  291. flex-direction: column;
  292. justify-content: space-between;
  293. .learn_progress {
  294. width: 100%;
  295. height: 100%;
  296. display: flex;
  297. align-items: center;
  298. justify-content: space-between;
  299. }
  300. .progress_up {
  301. width: 100%;
  302. .classHour {
  303. padding-top: 16rpx;
  304. font-size: 24rpx;
  305. color: #666666;
  306. }
  307. .scheduling {
  308. display: flex;
  309. align-items: center;
  310. }
  311. .sche_bar {
  312. font-size: 24rpx;
  313. color: #999999;
  314. margin-right: 20rpx;
  315. }
  316. .progress_bar {
  317. flex: 1;
  318. }
  319. }
  320. .progress_down {
  321. // width: 100%;
  322. display: flex;
  323. justify-content: space-between;
  324. align-items: center;
  325. }
  326. .enter_into {
  327. width: 144rpx;
  328. height: 52rpx;
  329. line-height: 52rpx;
  330. background: #ffb102;
  331. border-radius: 16rpx;
  332. font-size: 26rpx;
  333. font-weight: 500;
  334. color: #ffffff;
  335. text-align: center;
  336. }
  337. }
  338. // 收藏集,做题记录
  339. .bottoms {
  340. display: flex;
  341. justify-content: space-between;
  342. margin-bottom: 32rpx;
  343. .item {
  344. width: 335rpx;
  345. &.collect {
  346. position: relative;
  347. font-size: 32rpx;
  348. color: #ffffff;
  349. height: 240rpx;
  350. border-radius: 24rpx;
  351. padding: 32rpx;
  352. .text {
  353. position: relative;
  354. z-index: 10;
  355. font-size: 32rpx;
  356. font-weight: bold;
  357. color: #ffffff;
  358. }
  359. .img {
  360. position: absolute;
  361. left: 0;
  362. top: 0;
  363. width: 100%;
  364. height: 100%;
  365. }
  366. }
  367. &.list {
  368. .list-in {
  369. position: relative;
  370. width: 335rpx;
  371. height: 112rpx;
  372. background: #007aff;
  373. border-radius: 24rpx;
  374. display: flex;
  375. align-items: center;
  376. font-size: 32rpx;
  377. color: #fff;
  378. &:first-of-type {
  379. margin-bottom: 16rpx;
  380. }
  381. .text {
  382. padding-left: 91rpx;
  383. position: relative;
  384. z-index: 10;
  385. font-size: 32rpx;
  386. font-weight: bold;
  387. color: #ffffff;
  388. }
  389. .img {
  390. position: absolute;
  391. left: 0;
  392. top: 0;
  393. width: 100%;
  394. height: 100%;
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. .no_datas {
  402. margin-top: 70rpx;
  403. display: flex;
  404. flex-direction: column;
  405. align-items: center;
  406. .courses {
  407. width: 360rpx;
  408. height: 349rpx;
  409. }
  410. .no_learns {
  411. font-size: 32rpx;
  412. color: #999;
  413. margin: 46rpx 0rpx 56rpx;
  414. }
  415. .choose {
  416. width: 280rpx;
  417. height: 64rpx;
  418. line-height: 62rpx;
  419. border-radius: 32rpx;
  420. background-color: #007aff;
  421. color: #fff;
  422. font-size: 30rpx;
  423. text-align: center;
  424. }
  425. }
  426. </style>