certificateDetail.vue 12 KB

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