my_learn.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  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">您暂无相关学时审核记录哦~</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">您暂无相关学习凭证记录哦~</view>
  76. <!-- <view class="learnItem card">
  77. <view class="title">2020年二建建筑工程管理与实补这是商品名称</view>
  78. <view class="number">
  79. <text class="label">编号:</text>
  80. GZXY123456789
  81. </view>
  82. <view class="btnBox">
  83. <view class="btn" @click="showPhoto">电子照片</view>
  84. <view class="btn" @click="downloadCard">下载凭证</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. current: 0,
  98. list: [
  99. {
  100. name: '学时审核'
  101. },
  102. {
  103. name: '学习凭证'
  104. }
  105. ],
  106. param:{
  107. pageNum:1,
  108. pageSize:10
  109. },
  110. total:0,
  111. itemIndex:'',
  112. listData: []
  113. };
  114. },
  115. onLoad(option) {
  116. this.getcourseperiodlistGoods();
  117. },
  118. onShow() {
  119. if(this.itemIndex !== '') {
  120. this.refreshByIndex();
  121. }
  122. },
  123. onReachBottom() {
  124. console.log(111)
  125. if(this.listData.length < this.total) {
  126. this.param.pageNum++;
  127. this.getcourseperiodlistGoods();
  128. }
  129. },
  130. methods: {
  131. refreshByIndex() {
  132. this.$api.getcourseperiodlistGoods({
  133. pageNum:this.itemIndex + 1,
  134. pageSize:1
  135. }).then(res => {
  136. if (res.data.code === 200) {
  137. this.$set(this.listData,this.itemIndex,res.data.rows[0])
  138. }
  139. });
  140. },
  141. copyText() {
  142. uni.setClipboardData({
  143. data: 'http://gdzczx.gdcic.net/',
  144. success: () => {
  145. //复制成功的回调函数
  146. uni.showToast({
  147. //提示
  148. title: '复制成功'
  149. });
  150. }
  151. });
  152. },
  153. jumpPage(v, int,index) {
  154. this.itemIndex = index;
  155. //int 1.课程学习 2.预约考试 3.进入刷题 4.查看详情 5.重修目录
  156. if (int === 1) {
  157. this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}`);
  158. }
  159. if (int === 2) {
  160. this.$navTo.togo(`/pages2/appointment/index?goodsId=${v.goodsId}&gradeId=${v.gradeId}`);
  161. }
  162. if (int === 3) {
  163. this.appBeforeAddress(v.goodsId)
  164. }
  165. if (int === 4) {
  166. this.$navTo.togo(`/pages2/learn/details?goodsId=${v.goodsId}&gradeId=${v.gradeId}`);
  167. }
  168. if (int === 5) {
  169. this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}`);
  170. }
  171. },
  172. getcourseperiodlistGoods() {
  173. this.$api.getcourseperiodlistGoods(this.param).then(res => {
  174. if (res.data.code === 200) {
  175. this.listData = [...this.listData,...res.data.rows];
  176. this.total = res.data.total;
  177. }
  178. });
  179. },
  180. appBeforeAddress(goodsId) {
  181. this.$api.appBeforeAddress({
  182. goodsId
  183. }).then(res => {
  184. if(res.data.code == 200) {
  185. uni.navigateToMiniProgram({
  186. appId: res.data.data.url,
  187. success(res) {
  188. // 打开成功
  189. }
  190. })
  191. } else {
  192. uni.showToast({
  193. title: res.data.msg,
  194. icon: 'none',
  195. })
  196. }
  197. })
  198. },
  199. change(index) {
  200. this.current = index;
  201. },
  202. showPhoto() {
  203. // 预览图片
  204. uni.previewImage({
  205. urls: ['https://file.xyyxt.net/oss/images/file/20220111.jpg'],
  206. longPressActions: {
  207. itemList: ['发送给朋友', '保存图片', '收藏'],
  208. success: function(data) {
  209. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  210. },
  211. fail: function(err) {
  212. console.log(err.errMsg);
  213. }
  214. }
  215. });
  216. },
  217. downloadCard() {
  218. uni.downloadFile({
  219. url: 'https://gw.alipayobjects.com/os/bmw-prod/c134022a-1088-47e2-bb76-a33ec0519101.pdf?spm=a2c4g.11186623.0.0.cf863d1fUcFiPN&file=c134022a-1088-47e2-bb76-a33ec0519101.pdf',
  220. success: function (res) {
  221. console.log(999)
  222. var filePath = res.tempFilePath;
  223. uni.openDocument({
  224. filePath: filePath,
  225. showMenu: true,
  226. success: function (res) {
  227. console.log(res,'打开文档成功');
  228. },
  229. fail:function(err) {
  230. console.log(err)
  231. }
  232. });
  233. }
  234. });
  235. }
  236. },
  237. computed: { ...mapGetters(['userInfo']) }
  238. };
  239. </script>
  240. <style>
  241. page {
  242. background: #eaeef1;
  243. }
  244. </style>
  245. <style scoped lang="scss">
  246. .copySty {
  247. color: #007aff;
  248. text-decoration: underline;
  249. }
  250. .color666 {
  251. color: #666;
  252. }
  253. .learnWrap {
  254. padding: 98rpx 8rpx 8rpx;
  255. }
  256. .noData {
  257. font-size: 32rpx;
  258. font-family: PingFang SC;
  259. font-weight: 500;
  260. color: #999999;
  261. margin: 160rpx auto;
  262. text-align: center;
  263. }
  264. .learnItem {
  265. position: relative;
  266. background: #ffffff;
  267. border-radius: 16rpx;
  268. padding: 32rpx 32rpx 0;
  269. font-family: PingFang SC;
  270. margin-bottom: 16rpx;
  271. overflow: hidden;
  272. &.card {
  273. &::before {
  274. content:'';
  275. width:20rpx;
  276. height:20rpx;
  277. position:absolute;
  278. background:#eaeef1;
  279. left:-10rpx;
  280. bottom:80rpx;
  281. border-radius: 50%;
  282. }
  283. &::after {
  284. content:'';
  285. width:20rpx;
  286. height:20rpx;
  287. position:absolute;
  288. background:#eaeef1;
  289. right:-10rpx;
  290. bottom:80rpx;
  291. border-radius: 50%;
  292. }
  293. }
  294. .red {
  295. color: #ff3b30 !important;
  296. }
  297. .blue {
  298. color: #007aff !important;
  299. }
  300. .green {
  301. color: #34c759 !important;
  302. }
  303. .title {
  304. font-size: 30rpx;
  305. font-weight: bold;
  306. color: #333333;
  307. margin-bottom:68rpx;
  308. }
  309. .status {
  310. font-size: 24rpx;
  311. font-weight: 500;
  312. color: #666666;
  313. margin-bottom: 26rpx;
  314. display: flex;
  315. }
  316. .number {
  317. font-size: 24rpx;
  318. font-weight: 500;
  319. color: #666666;
  320. margin-bottom: 26rpx;
  321. font-size: 30rpx;
  322. font-weight: bold;
  323. font-family: PingFang SC;
  324. color: #333;
  325. .label {
  326. font-size: 24rpx;
  327. font-weight: 500;
  328. color: #666666;
  329. }
  330. }
  331. .val {
  332. font-size: 30rpx;
  333. font-weight: bold;
  334. color: #333;
  335. .remark {
  336. font-size: 24rpx;
  337. font-family: PingFang SC;
  338. font-weight: 500;
  339. color: #666666;
  340. }
  341. .link {
  342. font-size: 30rpx;
  343. font-family: PingFang SC;
  344. font-weight: 500;
  345. text-decoration: underline;
  346. color: #007aff;
  347. margin-top: 36rpx;
  348. text-decoration: underline;
  349. }
  350. }
  351. .tip {
  352. font-size: 24rpx;
  353. font-weight: 500;
  354. color: #666666;
  355. margin: 30rpx 0 27rpx;
  356. display: flex;
  357. }
  358. .label {
  359. width: 120rpx;
  360. flex-shrink: 0;
  361. margin-top: 5rpx;
  362. }
  363. .subTitle {
  364. font-size: 30rpx;
  365. font-weight: bold;
  366. color: #333333;
  367. margin: 15rpx 0 40rpx;
  368. }
  369. .btnBox {
  370. height: 88rpx;
  371. display: flex;
  372. align-items: center;
  373. justify-content: flex-end;
  374. .btn {
  375. width: 224rpx;
  376. height: 56rpx;
  377. line-height: 56rpx;
  378. text-align: center;
  379. background: #007aff;
  380. border-radius: 16rpx;
  381. font-size: 30rpx;
  382. font-family: PingFang SC;
  383. font-weight: 500;
  384. color: #ffffff;
  385. margin-left: 16rpx;
  386. }
  387. }
  388. }
  389. </style>