stuff.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  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. uni.navigateTo({
  102. url: "/pages3/course/jydetail?id=" + item.goodsId,
  103. });
  104. },
  105. toChoose() {
  106. uni.reLaunch({
  107. url: "/pages/information/index",
  108. });
  109. },
  110. },
  111. };
  112. </script>
  113. <style>
  114. page {
  115. background: #eaeef1;
  116. }
  117. </style>
  118. <style lang="scss" scoped>
  119. .my_courses {
  120. padding: 24rpx;
  121. .titles {
  122. font-size: 32rpx;
  123. color: #333333;
  124. margin: 44rpx 0rpx 24rpx 43rpx;
  125. font-weight: bold;
  126. display: block;
  127. }
  128. .course_item {
  129. width: 100%;
  130. // height: 278rpx;
  131. background: #ffffff;
  132. box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1, 99, 235, 0.1);
  133. border-radius: 24rpx;
  134. padding: 29rpx 29rpx 20rpx 24rpx;
  135. margin-bottom: 20rpx;
  136. .course_item_info {
  137. border-radius: 16rpx;
  138. background: #f8f8f8;
  139. padding: 24rpx 24rpx 10rpx;
  140. margin-top: 24rpx;
  141. & > view {
  142. margin-bottom: 10rpx;
  143. }
  144. view {
  145. text {
  146. font-size: 24rpx;
  147. &:nth-of-type(1) {
  148. color: #969696;
  149. }
  150. &:nth-of-type(2) {
  151. color: #4b4b4b;
  152. }
  153. }
  154. .eb {
  155. color: #eb5757 !important;
  156. }
  157. }
  158. }
  159. .titlews {
  160. padding-bottom: 24rpx;
  161. }
  162. .cou_titles {
  163. color: #222222;
  164. font-size: 28rpx;
  165. font-weight: bold;
  166. width: 100%;
  167. }
  168. .learn_ranges {
  169. color: #666;
  170. font-size: 24rpx;
  171. .l_range {
  172. width: 20rpx;
  173. height: 24rpx;
  174. margin-right: 9rpx;
  175. }
  176. .l_time {
  177. color: #333;
  178. }
  179. }
  180. .c_downs {
  181. display: flex;
  182. align-items: center;
  183. }
  184. // 状态
  185. .all_status {
  186. width: 654rpx;
  187. background: #f8f8f8;
  188. border-radius: 16rpx;
  189. }
  190. .class-warm {
  191. display: flex;
  192. align-items: flex-start;
  193. &__icon {
  194. margin-right: 10rpx;
  195. }
  196. &__text {
  197. .date {
  198. color: #ff3b30;
  199. font-size: 22rpx;
  200. font-weight: 400;
  201. }
  202. }
  203. }
  204. .box_progress {
  205. display: flex;
  206. justify-content: space-between;
  207. align-items: center;
  208. margin-top: 20rpx;
  209. // .disabled {
  210. // opacity: 0.6;
  211. // }
  212. }
  213. .study_tips {
  214. color: #eb5757;
  215. font-size: 24rpx;
  216. margin-top: 20rpx;
  217. }
  218. .study_btns {
  219. width: 100%;
  220. margin-top: 40rpx;
  221. display: flex;
  222. align-items: center;
  223. justify-content: flex-end;
  224. .exam_btns {
  225. // width: 64%;
  226. display: flex;
  227. justify-content: flex-end;
  228. align-items: center;
  229. }
  230. }
  231. .box_appoint {
  232. // width: 35%;
  233. display: flex;
  234. align-items: center;
  235. justify-content: flex-end;
  236. .img {
  237. width: 32rpx;
  238. height: 32rpx;
  239. margin-right: 10rpx;
  240. }
  241. }
  242. .exam_word {
  243. font-size: 24rpx;
  244. font-weight: 500;
  245. width: 144rpx;
  246. height: 56rpx;
  247. line-height: 56rpx;
  248. text-align: center;
  249. background: #ffffff;
  250. border-radius: 66rpx;
  251. margin-left: 32rpx;
  252. }
  253. .ones {
  254. color: #484848;
  255. border: 2rpx solid #b9b9b9;
  256. }
  257. .intos {
  258. color: #498afe;
  259. border: 2rpx solid #498afe;
  260. }
  261. }
  262. .lefts {
  263. width: 204rpx;
  264. height: 120rpx;
  265. border-radius: 12rpx;
  266. margin-right: 26rpx;
  267. position: relative;
  268. top: 0;
  269. left: 0;
  270. .lefet_img {
  271. width: 100%;
  272. height: 100%;
  273. display: block;
  274. border-radius: 16rpx;
  275. }
  276. .live_icon {
  277. width: 65rpx;
  278. height: 35rpx;
  279. line-height: 35rpx;
  280. border-radius: 12rpx 0rpx 12rpx 0rpx;
  281. background-color: #ffb102;
  282. color: #fff;
  283. font-size: 20rpx;
  284. text-align: center;
  285. position: absolute;
  286. top: 0;
  287. left: 0;
  288. }
  289. }
  290. .rights {
  291. width: 400rpx;
  292. height: 120rpx;
  293. display: flex;
  294. flex-direction: column;
  295. justify-content: space-between;
  296. .learn_progress {
  297. width: 100%;
  298. height: 100%;
  299. display: flex;
  300. align-items: center;
  301. justify-content: space-between;
  302. }
  303. .progress_up {
  304. width: 100%;
  305. .classHour {
  306. padding-top: 16rpx;
  307. font-size: 24rpx;
  308. color: #666666;
  309. }
  310. .scheduling {
  311. display: flex;
  312. align-items: center;
  313. }
  314. .sche_bar {
  315. font-size: 24rpx;
  316. color: #999999;
  317. margin-right: 20rpx;
  318. }
  319. .progress_bar {
  320. flex: 1;
  321. }
  322. }
  323. .progress_down {
  324. // width: 100%;
  325. display: flex;
  326. justify-content: space-between;
  327. align-items: center;
  328. }
  329. .enter_into {
  330. width: 144rpx;
  331. height: 52rpx;
  332. line-height: 52rpx;
  333. background: #ffb102;
  334. border-radius: 16rpx;
  335. font-size: 26rpx;
  336. font-weight: 500;
  337. color: #ffffff;
  338. text-align: center;
  339. }
  340. }
  341. // 收藏集,做题记录
  342. .bottoms {
  343. display: flex;
  344. justify-content: space-between;
  345. margin-bottom: 32rpx;
  346. .item {
  347. width: 335rpx;
  348. &.collect {
  349. position: relative;
  350. font-size: 32rpx;
  351. color: #ffffff;
  352. height: 240rpx;
  353. border-radius: 24rpx;
  354. padding: 32rpx;
  355. .text {
  356. position: relative;
  357. z-index: 10;
  358. font-size: 32rpx;
  359. font-weight: bold;
  360. color: #ffffff;
  361. }
  362. .img {
  363. position: absolute;
  364. left: 0;
  365. top: 0;
  366. width: 100%;
  367. height: 100%;
  368. }
  369. }
  370. &.list {
  371. .list-in {
  372. position: relative;
  373. width: 335rpx;
  374. height: 112rpx;
  375. background: #007aff;
  376. border-radius: 24rpx;
  377. display: flex;
  378. align-items: center;
  379. font-size: 32rpx;
  380. color: #fff;
  381. &:first-of-type {
  382. margin-bottom: 16rpx;
  383. }
  384. .text {
  385. padding-left: 91rpx;
  386. position: relative;
  387. z-index: 10;
  388. font-size: 32rpx;
  389. font-weight: bold;
  390. color: #ffffff;
  391. }
  392. .img {
  393. position: absolute;
  394. left: 0;
  395. top: 0;
  396. width: 100%;
  397. height: 100%;
  398. }
  399. }
  400. }
  401. }
  402. }
  403. }
  404. .no_datas {
  405. margin-top: 70rpx;
  406. display: flex;
  407. flex-direction: column;
  408. align-items: center;
  409. .courses {
  410. width: 360rpx;
  411. height: 349rpx;
  412. }
  413. .no_learns {
  414. font-size: 32rpx;
  415. color: #999;
  416. margin: 46rpx 0rpx 56rpx;
  417. }
  418. .choose {
  419. width: 280rpx;
  420. height: 64rpx;
  421. line-height: 62rpx;
  422. border-radius: 32rpx;
  423. background-color: #007aff;
  424. color: #fff;
  425. font-size: 30rpx;
  426. text-align: center;
  427. }
  428. }
  429. </style>