my_learn.vue 9.1 KB

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