certificateDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <page-meta :root-font-size="fontsize+'px'" style="display: block;">
  3. <view v-if="isPc">
  4. <Headers></Headers>
  5. <view class="project">
  6. <view style="width: 1200px;margin: auto;">证书查询系统</view>
  7. </view>
  8. <view class="project-content ddflex">
  9. <!-- 成绩区域 -->
  10. <view class="test-box">
  11. <view class="test-title">证书查询结果</view>
  12. <!-- 表格 -->
  13. <view class="ddflex border table" style="">
  14. <!-- 右边 -->
  15. <view class="fflex">
  16. <view class="height56 ddflex padding-left" style="color: #fff;background-color: #2e68d8;">● 基本信息</view>
  17. <view class="dflex" style="align-items: stretch;">
  18. <view>
  19. <view>
  20. <view class="ddflex">
  21. <view class="height56 ddflex-jc width140 bg-color border-bottom border-top-none">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</view>
  22. <view class="height56 ddflex padding-left width200 border border-right-none border-top-none">{{info.userName?info.userName:'*'}}</view>
  23. <view class="height56 ddflex-jc width140 bg-color border-bottom border-left">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</view>
  24. <view class="height56 ddflex padding-left width200 border border-right-none border-top-none">{{info.sex==1?'男':info.sex==2?'女':'*'}}</view>
  25. </view>
  26. <view class="ddflex">
  27. <view class="height56 ddflex-jc width140 bg-color">身份证号</view>
  28. <view class="height56 ddflex fflex padding-left border border-bottom-none border-right-none border-top-none">{{info.idNumber?info.idNumber:'*'}}</view>
  29. </view>
  30. <view class="ddflex">
  31. <view class="height56 ddflex-jc width140 bg-color border border-right-none border-left-none">培训时间</view>
  32. <view class="height56 ddflex fflex padding-left border border-right-none">{{info.trainingDate?dateYM(info.trainingDate):'*'}}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="border fflex ddflex border-right-none border-top-none" style="box-sizing: border-box;padding: 20px;">
  37. <image style="max-width: 100%;max-height: 125px;" :src="info.avatar" mode="widthFix"></image>
  38. </view>
  39. </view>
  40. <view class="height56 ddflex padding-left" style="color: #fff;background-color: #2e68d8;">● 证书信息</view>
  41. <view class="ddflex">
  42. <view class="height56 ddflex-jc width140 bg-color border-top-none">职业名称</view>
  43. <view class="height56 ddflex padding-left width200 border border-right-none border-top-none border-bottom-none">{{info.cateName?info.cateName:'*'}}</view>
  44. <view class="height56 ddflex-jc width140 bg-color border-left">培训等级</view>
  45. <view class="height56 ddflex padding-left width200 border border-right-none border-top-none border-bottom-none">{{info.trainingLevel?info.trainingLevel:'*'}}</view>
  46. </view>
  47. <view class="ddflex">
  48. <view class="height56 ddflex-jc width140 bg-color border-bottom border-top">发证单位</view>
  49. <view class="height56 ddflex fflex padding-left border border-right-none">湖南现代职业培训学校</view>
  50. </view>
  51. <view class="ddflex">
  52. <view class="height56 ddflex-jc width140 bg-color border-bottom border-top-none border-bottom-none">发证日期</view>
  53. <view class="height56 ddflex fflex padding-left border border-right-none border-top-none border-bottom-none">{{info.issueDate?info.issueDate:'*'}}</view>
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 声明 -->
  58. <view style="margin-top: 34px;">
  59. <view style="font-size: 16px;font-weight: bold;">声明:</view>
  60. <view style="font-size: 14px;line-height: 30px">
  61. 1、未经证书信息权属人同意,不得将本材料用于违背权属人意愿之用途。证书信息内容标注“*”号,表示该项内容不详。证书信息如有修改,请以网站在线查询内容为准。<br>
  62. 2、本材料是打印的证书查询结果凭证,仅供查询人使用,不具有再验证功能。
  63. </view>
  64. </view>
  65. </view>
  66. <!-- 答题卡区域 -->
  67. <view class="test-info ddflex">
  68. <view class="note-title ddflex">
  69. <image class="note-title-icon" src="/static/images/cjwt.png"</image>
  70. <view>所有证书</view>
  71. </view>
  72. <view class="note-box" style="margin-top: 0;">
  73. <!-- <view class="note-title ddflex">
  74. <image class="note-title-icon" src="/static/images/cjwt.png"</image>
  75. <view>所有证书</view>
  76. </view> -->
  77. <view>
  78. <view class="note-item ddflex" v-for="item,index in infoList" :key="index" @click="changeItem(item)">
  79. <view :class="'note-item-content '+(item.selected?'note-item-selected':'')">{{index+1}}. {{item.cateName}} {{item.selected}}</view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <Foot></Foot>
  86. </view>
  87. <!-- 移动端 -->
  88. <view v-else style="font-size: 28rpx;background-color: #fff;">
  89. <view class="m-project">
  90. <view style="margin: auto;">证书查询系统</view>
  91. </view>
  92. <view class="ddflex" style="justify-content: space-between;padding: 30rpx;color: #1AA1E6;font-weight: bold;">
  93. <view >证书查询结果</view>
  94. <button type="primary" @click="toggle('right')" style="border-radius: 10rpx;font-size: 24rpx;padding: 10rpx 30rpx">
  95. <text>查看全部证书</text>
  96. </button>
  97. </view>
  98. <view style="border-left: 20rpx solid #fff;border-right: 20rpx solid #fff;">
  99. <view class="m-height56 ddflex m-padding-left" style="color: #fff;background-color: #2e68d8;">● 基本信息</view>
  100. <view class="dflex" style="align-items: stretch;">
  101. <view>
  102. <view class="ddflex">
  103. <view class="ddflex-jc m-height56 m-width150 bg-color border border-right-none border-bottom-none">姓名</view>
  104. <view class="m-height56 ddflex m-width200 m-padding-left border border-right-none border-bottom-none">{{info.userName?info.userName:'*'}}</view>
  105. </view>
  106. <view class="ddflex">
  107. <view class="ddflex-jc m-height56 m-width150 bg-color border border-right-none border-bottom-none">性别</view>
  108. <view class="m-height56 ddflex m-width200 m-padding-left border border-right-none border-bottom-none">{{info.sex==1?'男':info.sex==2?'女':'*'}}</view>
  109. </view>
  110. <view class="ddflex">
  111. <view class="ddflex-jc m-height56 m-width150 bg-color border border-right-none border-bottom-none">培训时间</view>
  112. <view class="m-height56 ddflex m-width200 m-padding-left border border-right-none border-bottom-none">{{info.trainingDate?dateYM(info.trainingDate):'*'}}</view>
  113. </view>
  114. </view>
  115. <view class="border fflex border-bottom-none ddflex" style="box-sizing: border-box;padding: 20rpx;">
  116. <image style="max-width: 100%;max-height: 250rpx;" :src="info.avatar" mode="widthFix"></image>
  117. </view>
  118. </view>
  119. <view class="ddflex">
  120. <view class="ddflex-jc m-height56 m-width150 bg-color border border-right-none">身份证号</view>
  121. <view class="m-height56 ddflex fflex m-padding-left border">{{info.idNumber?info.idNumber:'*'}}</view>
  122. </view>
  123. <view class="m-height56 ddflex m-padding-left" style="color: #fff;background-color: #2e68d8;">● 证件信息</view>
  124. <view class="ddflex">
  125. <view class="ddflex-jc m-height56 m-width150 bg-color border border-right-none border-bottom-none">职业名称</view>
  126. <view class="m-height56 ddflex fflex m-padding-left border border-bottom-none">{{info.cateName?info.cateName:'*'}}</view>
  127. </view>
  128. <view class="ddflex">
  129. <view class="ddflex-jc m-height56 m-width150 bg-color border border-right-none border-bottom-none">培训等级</view>
  130. <view class="m-height56 ddflex fflex m-padding-left border border-bottom-none">{{info.trainingLevel?info.trainingLevel:'*'}}</view>
  131. </view>
  132. <view class="ddflex">
  133. <view class="ddflex-jc m-height56 m-width150 bg-color border border-right-none border-bottom-none">发证单位</view>
  134. <view class="m-height56 ddflex fflex m-padding-left border border-bottom-none">湖南现代职业培训学校</view>
  135. </view>
  136. <view class="ddflex">
  137. <view class="ddflex-jc m-height56 m-width150 bg-color border border-right-none">发证日期</view>
  138. <view class="m-height56 ddflex fflex m-padding-left border">{{info.issueDate?info.issueDate:'*'}}</view>
  139. </view>
  140. </view>
  141. <!-- 声明 -->
  142. <view style="margin: 10rpx 0;padding: 20rpx;">
  143. <view style="font-size: 16rpx;font-weight: bold;">声明:</view>
  144. <view style="font-size: 14rpx;line-height: 1.5">
  145. 1、未经证书信息权属人同意,不得将本材料用于违背权属人意愿之用途。证书信息内容标注“*”号,表示该项内容不详。证书信息如有修改,请以网站在线查询内容为准。<br>
  146. 2、本材料是打印的证书查询结果凭证,仅供查询人使用,不具有再验证功能。
  147. </view>
  148. </view>
  149. <view>
  150. <uni-popup ref="popup" background-color="#fff">
  151. <view class="popup-content popup-height">
  152. <view class="m-title" style="margin-bottom: 10rpx;font-size: 30rpx;font-weight: bold">所有证书</view>
  153. <view style="overflow-y: scroll;max-height: 85%">
  154. <view class="m-note-item ddflex" v-for="item,index in infoList" :key="index" @click="changeItem(item)">
  155. <view class="m-note-item-content" :style="item.selected?'color:#007aff':''">{{index+1}}. {{item.cateName}}</view>
  156. </view>
  157. </view>
  158. </view>
  159. </uni-popup>
  160. </view>
  161. </view>
  162. </page-meta>
  163. </template>
  164. <script>
  165. const app = getApp();
  166. const req = require('../../utils/request.js');
  167. const utils = require('../../utils/util.js');
  168. const api = require('../../utils/api.js')
  169. export default {
  170. data() {
  171. return {
  172. options:{},
  173. infoList:[],
  174. info:{},
  175. isPc:true,
  176. systemInfo:{},
  177. fontsize:'100px'
  178. }
  179. },
  180. onReady() {},
  181. onLoad() {
  182. let srceenNunber = 19.2; //因设计图是1920所有把设计图分为19.2份,所以html字体大小为100px
  183. let that = this;
  184. //窗体改变大小触发事件
  185. uni.onWindowResize((res) => {
  186. console.log('变化后的窗口宽度=', res.size.windowWidth);
  187. that.fontsize = parseFloat(res.size.windowWidth) / srceenNunber;
  188. })
  189. //打开获取屏幕大小
  190. uni.getSystemInfo({
  191. success(res) {
  192. console.log('设备信息:', res);
  193. that.fontsize = res.screenWidth / srceenNunber;
  194. console.log('字体大小:', that.fontsize);
  195. }
  196. })
  197. this.systemInfo = uni.getSystemInfoSync()
  198. this.isPc = this.IsPC()
  199. if(!req.getStorage('options')){
  200. uni.reLaunch({
  201. url:'/pages/certificateQuery/certificateQuery'
  202. })
  203. return false
  204. }
  205. this.options = req.getStorage('options')
  206. this.getDetail()
  207. },
  208. onUnload() {
  209. req.removeStorage('options')
  210. },
  211. methods: {
  212. IsPC() {
  213. var userAgentInfo = navigator.userAgent;
  214. var Agents = ["Android", "iPhone",
  215. "SymbianOS", "Windows Phone",
  216. "iPad", "iPod"];
  217. var flag = true;
  218. for (var v = 0; v < Agents.length; v++) {
  219. if (userAgentInfo.indexOf(Agents[v]) > 0) {
  220. flag = false;
  221. break;
  222. }
  223. }
  224. return flag;
  225. },
  226. jumpUrl(url){
  227. uni.navigateTo({
  228. url:url
  229. })
  230. },
  231. getDetail(){
  232. req.getRequest('/api/v3/exam/user/manager/certificate',this.options,res=>{
  233. res.map(item=>{item.selected = false})
  234. this.infoList = res
  235. res[0].selected = true
  236. this.info = res[0]
  237. })
  238. },
  239. changeItem(item){
  240. uni.showLoading({
  241. title:'加载中...'
  242. })
  243. if(!this.isPc){
  244. this.$refs.popup.close()
  245. }
  246. setTimeout(()=>{
  247. this.infoList.map(item=>{
  248. item.selected = false
  249. })
  250. item.selected = true
  251. this.info = item
  252. uni.hideLoading()
  253. },500)
  254. },
  255. // 时间格式化
  256. dateYM(date){
  257. return req.dateFormat(date).v6
  258. },
  259. // 移动端
  260. toggle(type) {
  261. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  262. this.$refs.popup.open(type)
  263. },
  264. }
  265. }
  266. </script>
  267. <style>
  268. @import url('./certificateDetail.css');
  269. </style>