my_learn.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <template>
  2. <view class="safeArea">
  3. <view style="width: 100%;text-align: center;position: fixed;height: 96rpx;z-index: 999;">
  4. <u-tabs :list="list" sticky :current="current" @change="change" active-color="#333" inactive-color="#999"></u-tabs>
  5. </view>
  6. <view class="learnWrap">
  7. <template v-if="current === 0">
  8. <view class="noData" v-if="listData.length == 0">您暂无相关学时审核记录哦~</view>
  9. <view class="learnItem" v-for="(item, index) in listData" :key="index">
  10. <view class="title">{{ item.goodsName }}</view>
  11. <view class="status">
  12. <view class="label">审核状态:</view>
  13. <view
  14. class="val"
  15. :class="item.periodStatus === -1 || item.periodStatus === 3 ? 'red' : item.periodStatus === 1 ? 'green' : item.periodStatus === 2 ? 'blue' : ''"
  16. >
  17. <text>
  18. {{
  19. item.periodStatus === -1
  20. ? '不可审核'
  21. : item.periodStatus === 1
  22. ? '机构审核通过'
  23. : item.periodStatus === 2
  24. ? '等待审核'
  25. : item.periodStatus === 3
  26. ? '机构审核不通过'
  27. : ''
  28. }}
  29. </text>
  30. <view v-if="item.periodStatus === 3" style="font-size: 24rpx;color:#666;">
  31. <text style="color:#FF3B30;">{{ item.rebuild }}节</text>
  32. 需要重修
  33. </view>
  34. </view>
  35. </view>
  36. <view class="tip" v-if="item.periodStatus === 1">
  37. <view class="label">审核提示:</view>
  38. <view>
  39. 机构已审核通过,需等待注册中心复审后即可获得继续教育学时。审核时间约15个工作日,届时请前往官网申请证书延期。
  40. <view class="copySty" @tap="copyText">复制官网链接</view>
  41. </view>
  42. </view>
  43. <view class="tip" v-else>
  44. <view class="label">审核提示:</view>
  45. <view class="val color666" v-if="item.periodStatus === -1">您的学时还未修完,请尽快完成课程学习</view>
  46. <view class="val color666" v-if="item.periodStatus === 2">学习完成后7-15个工作日完成学时审核。</view>
  47. <view class="val color666" v-if="item.periodStatus === 3">请查看需重学记录,并及时重学对应课程,以免延误学时审核进度。</view>
  48. </view>
  49. <view v-if="item.periodStatus !== 2">
  50. <u-line color="#EEEEEE" />
  51. <view v-if="item.periodStatus === -1">
  52. <view class="btnBox"><view class="btn" @click="jumpPage(item, 1,index)">课程学习</view></view>
  53. </view>
  54. <view>
  55. <view v-if="item.periodStatus === 1 && item.applyStatus === 1">
  56. <view class="subTitle">{{ item.applyName }}</view>
  57. <view class="btnBox"><view class="btn" @click="jumpPage(item, 2,index)">预约考试</view></view>
  58. </view>
  59. <u-line color="#EEEEEE" v-if="item.periodStatus === 1 && item.applyStatus === 1" />
  60. <view v-if="item.periodStatus === 1 && item.beforeStatus === 1">
  61. <view class="subTitle">{{ item.beforeName }}</view>
  62. <view class="btnBox"><view class="btn" @click="jumpPage(item, 3,index)">进入刷题</view></view>
  63. </view>
  64. </view>
  65. <view v-if="item.periodStatus === 3 && item.rebuildStatus === 0">
  66. <view class="btnBox"><view class="btn" @click="jumpPage(item, 4,index)">查看详情</view></view>
  67. </view>
  68. <view v-if="item.periodStatus === 3 && item.rebuildStatus === 1">
  69. <view class="btnBox"><view class="btn" @click="jumpPage(item, 5,index)">重修目录</view></view>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <template v-if="current === 1">
  75. <view class="noData" v-if="listData.length == 0">您暂无相关学习凭证记录哦~</view>
  76. <view class="learnItem card" v-for="(item,index) in listData" :key="index">
  77. <view class="title">{{item.title}}</view>
  78. <view class="number">
  79. <text class="label">编号:</text>
  80. {{item.certificateCode}}
  81. </view>
  82. <view class="btnBox">
  83. <view class="btn" @click="showPhoto(item)">电子照片</view>
  84. <!-- <view class="btn" @click="downloadCard(item)">下载凭证</view> -->
  85. </view>
  86. </view>
  87. </template>
  88. </view>
  89. </view>
  90. </template>
  91. <script>
  92. import { mapGetters } from 'vuex';
  93. export default {
  94. components: {},
  95. data() {
  96. return {
  97. loading:false,
  98. current: 0,
  99. list: [
  100. {
  101. name: '学时审核'
  102. },
  103. {
  104. name: '学习凭证'
  105. }
  106. ],
  107. param:{
  108. pageNum:1,
  109. pageSize:10
  110. },
  111. total:0,
  112. itemIndex:'',
  113. listData: []
  114. };
  115. },
  116. onLoad(option) {
  117. this.getcourseperiodlistGoods();
  118. },
  119. onShow() {
  120. if(this.itemIndex !== '') {
  121. if(this.current == 0) {
  122. this.refreshByIndex();
  123. }
  124. }
  125. },
  126. onReachBottom() {
  127. if(this.listData.length < this.total) {
  128. this.param.pageNum++;
  129. if(this.current == 0) {
  130. this.getcourseperiodlistGoods();
  131. } else if(this.current == 1){
  132. this.getUserCertificateList();
  133. }
  134. }
  135. },
  136. methods: {
  137. refreshByIndex() {
  138. this.$api.getcourseperiodlistGoods({
  139. pageNum:this.itemIndex + 1,
  140. pageSize:1
  141. }).then(res => {
  142. if (res.data.code === 200) {
  143. this.$set(this.listData,this.itemIndex,res.data.rows[0])
  144. }
  145. });
  146. },
  147. copyText() {
  148. uni.setClipboardData({
  149. data: 'http://gdzczx.gdcic.net/',
  150. success: () => {
  151. //复制成功的回调函数
  152. uni.showToast({
  153. //提示
  154. title: '复制成功'
  155. });
  156. }
  157. });
  158. },
  159. jumpPage(v, int,index) {
  160. this.itemIndex = index;
  161. //int 1.课程学习 2.预约考试 3.进入刷题 4.查看详情 5.重修目录
  162. if (int === 1) {
  163. this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}`);
  164. }
  165. if (int === 2) {
  166. this.$navTo.togo(`/pages2/appointment/index?goodsId=${v.goodsId}&gradeId=${v.gradeId}`);
  167. }
  168. if (int === 3) {
  169. this.appBeforeAddress(v.goodsId)
  170. }
  171. if (int === 4) {
  172. this.$navTo.togo(`/pages2/learn/details?goodsId=${v.goodsId}&gradeId=${v.gradeId}`);
  173. }
  174. if (int === 5) {
  175. this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}`);
  176. }
  177. },
  178. getUserCertificateList() {
  179. this.loading = true;
  180. this.$api.getUserCertificateList(this.param).then(res => {
  181. this.loading = false;
  182. if (res.data.code === 200) {
  183. this.listData = [...this.listData,...res.data.rows];
  184. this.total = res.data.total;
  185. }
  186. }).catch(err => {
  187. this.loading = false;
  188. })
  189. },
  190. getcourseperiodlistGoods() {
  191. this.loading = true;
  192. this.$api.getcourseperiodlistGoods(this.param).then(res => {
  193. this.loading = false;
  194. if (res.data.code === 200) {
  195. this.listData = [...this.listData,...res.data.rows];
  196. this.total = res.data.total;
  197. }
  198. }).catch(err => {
  199. this.loading = false;
  200. })
  201. },
  202. appBeforeAddress(goodsId) {
  203. this.$api.appBeforeAddress({
  204. goodsId
  205. }).then(res => {
  206. if(res.data.code == 200) {
  207. uni.navigateToMiniProgram({
  208. appId: res.data.data.url,
  209. success(res) {
  210. // 打开成功
  211. }
  212. })
  213. } else {
  214. uni.showToast({
  215. title: res.data.msg,
  216. icon: 'none',
  217. })
  218. }
  219. })
  220. },
  221. change(index) {
  222. if(this.loading) {
  223. return;
  224. }
  225. this.current = index;
  226. this.listData = [];
  227. this.total = 0;
  228. this.param = {
  229. pageNum:1,
  230. pageSize:10
  231. };
  232. if(this.current == 0) {
  233. this.getcourseperiodlistGoods();
  234. } else if(this.current == 1){
  235. this.getUserCertificateList();
  236. }
  237. },
  238. showPhoto(item) {
  239. // 预览图片
  240. uni.previewImage({
  241. urls: [this.$method.splitImgHost(item.certificatePath,true,1000)],
  242. longPressActions: {
  243. itemList: ['发送给朋友', '保存图片', '收藏'],
  244. success: function(data) {
  245. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  246. },
  247. fail: function(err) {
  248. console.log(err.errMsg);
  249. }
  250. }
  251. });
  252. },
  253. downloadCard(item) {
  254. console.log(this.$method.splitImgHost(item.certificatePath,true))
  255. uni.downloadFile({
  256. url: this.$method.splitImgHost(item.certificatePath,true),
  257. success: function (res) {
  258. console.log(res,'res')
  259. var filePath = res.tempFilePath;
  260. uni.openDocument({
  261. filePath: filePath,
  262. showMenu: true,
  263. success: function (res) {
  264. console.log(res,'打开文档成功');
  265. },
  266. fail:function(err) {
  267. console.log(err)
  268. }
  269. });
  270. }
  271. });
  272. }
  273. },
  274. computed: { ...mapGetters(['userInfo']) }
  275. };
  276. </script>
  277. <style>
  278. page {
  279. background: #eaeef1;
  280. }
  281. </style>
  282. <style scoped lang="scss">
  283. .copySty {
  284. color: #007aff;
  285. text-decoration: underline;
  286. }
  287. .color666 {
  288. color: #666;
  289. }
  290. .learnWrap {
  291. padding: 98rpx 8rpx 8rpx;
  292. }
  293. .noData {
  294. font-size: 32rpx;
  295. font-family: PingFang SC;
  296. font-weight: 500;
  297. color: #999999;
  298. margin: 160rpx auto;
  299. text-align: center;
  300. }
  301. .learnItem {
  302. position: relative;
  303. background: #ffffff;
  304. border-radius: 16rpx;
  305. padding: 32rpx 32rpx 0;
  306. font-family: PingFang SC;
  307. margin-bottom: 16rpx;
  308. overflow: hidden;
  309. &.card {
  310. &::before {
  311. content:'';
  312. width:20rpx;
  313. height:20rpx;
  314. position:absolute;
  315. background:#eaeef1;
  316. left:-10rpx;
  317. bottom:80rpx;
  318. border-radius: 50%;
  319. }
  320. &::after {
  321. content:'';
  322. width:20rpx;
  323. height:20rpx;
  324. position:absolute;
  325. background:#eaeef1;
  326. right:-10rpx;
  327. bottom:80rpx;
  328. border-radius: 50%;
  329. }
  330. }
  331. .red {
  332. color: #ff3b30 !important;
  333. }
  334. .blue {
  335. color: #007aff !important;
  336. }
  337. .green {
  338. color: #34c759 !important;
  339. }
  340. .title {
  341. font-size: 30rpx;
  342. font-weight: bold;
  343. color: #333333;
  344. margin-bottom:68rpx;
  345. }
  346. .status {
  347. font-size: 24rpx;
  348. font-weight: 500;
  349. color: #666666;
  350. margin-bottom: 26rpx;
  351. display: flex;
  352. }
  353. .number {
  354. font-size: 24rpx;
  355. font-weight: 500;
  356. color: #666666;
  357. margin-bottom: 26rpx;
  358. font-size: 30rpx;
  359. font-weight: bold;
  360. font-family: PingFang SC;
  361. color: #333;
  362. .label {
  363. font-size: 24rpx;
  364. font-weight: 500;
  365. color: #666666;
  366. }
  367. }
  368. .val {
  369. font-size: 30rpx;
  370. font-weight: bold;
  371. color: #333;
  372. .remark {
  373. font-size: 24rpx;
  374. font-family: PingFang SC;
  375. font-weight: 500;
  376. color: #666666;
  377. }
  378. .link {
  379. font-size: 30rpx;
  380. font-family: PingFang SC;
  381. font-weight: 500;
  382. text-decoration: underline;
  383. color: #007aff;
  384. margin-top: 36rpx;
  385. text-decoration: underline;
  386. }
  387. }
  388. .tip {
  389. font-size: 24rpx;
  390. font-weight: 500;
  391. color: #666666;
  392. margin: 30rpx 0 27rpx;
  393. display: flex;
  394. }
  395. .label {
  396. width: 120rpx;
  397. flex-shrink: 0;
  398. margin-top: 5rpx;
  399. }
  400. .subTitle {
  401. font-size: 30rpx;
  402. font-weight: bold;
  403. color: #333333;
  404. margin: 15rpx 0 40rpx;
  405. }
  406. .btnBox {
  407. height: 88rpx;
  408. display: flex;
  409. align-items: center;
  410. justify-content: flex-end;
  411. .btn {
  412. width: 224rpx;
  413. height: 56rpx;
  414. line-height: 56rpx;
  415. text-align: center;
  416. background: #007aff;
  417. border-radius: 16rpx;
  418. font-size: 30rpx;
  419. font-family: PingFang SC;
  420. font-weight: 500;
  421. color: #ffffff;
  422. margin-left: 16rpx;
  423. }
  424. }
  425. }
  426. </style>