my_learn.vue 11 KB

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