showCertificate.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="box position-relative">
  3. <image class="bg" src="../../static/img/zgxy.png" mode="widthFix"></image>
  4. <view class="content">
  5. <view class="flex">
  6. <image class="avImg" :src="info.photo" mode="scaleToFill"></image>
  7. <view class="title padding-b-10">
  8. <view class="item flex">
  9. <view class="name">
  10. 姓<text class="jg1"></text>名:
  11. </view>
  12. <view class="text">
  13. {{info.name}}
  14. </view>
  15. </view>
  16. <view class="item flex">
  17. <view class="name">
  18. 性<text class="jg1"></text>别:
  19. </view>
  20. <view class="text">
  21. {{info.gender_name}}
  22. </view>
  23. </view>
  24. <view class="item flex">
  25. <view class="name">
  26. 证件号:
  27. </view>
  28. <view class="text">
  29. {{info.idcard}}
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="according">
  35. <view class="indentation padding-t-20">
  36. 依据 Q /ZG2001-2018和 Q /ZG3001-2018评价标准及母婴健康专委会服务网人才入库规定,经母婴健康专委会服务网审核,您的信息符合入库条件,同意加入人才库,特此证明。
  37. </view>
  38. <view class="indentation padding-t-30">
  39. According to the O/ZG2001-2018 and G3001-2018evaluation standards and the talent pool regulationsof
  40. Zhonggong Credit Service Network,after thereview of Zhonggong Credit Service Network,yourinformation
  41. meets the requirements,Agree to jointhe talent pool, Hereby certify.
  42. </view>
  43. </view>
  44. <view class="lsbox margin-b-30 padding-t-20 padding-b-10">
  45. <view class="item flex">
  46. <view class="name">
  47. 岗位职业:
  48. </view>
  49. <view class="text">
  50. {{info.job}}
  51. </view>
  52. </view>
  53. <view class="item flex">
  54. <view class="name">
  55. 入库登记:
  56. </view>
  57. <view class="text">
  58. {{info.level_name}}
  59. </view>
  60. </view>
  61. <view class="item flex">
  62. <view class="name">
  63. 入库编号:
  64. </view>
  65. <view class="text">
  66. {{info.code}}
  67. </view>
  68. </view>
  69. <view class="item flex">
  70. <view class="name">
  71. 入库日期:
  72. </view>
  73. <view class="text">
  74. {{info.date}}
  75. </view>
  76. </view>
  77. </view>
  78. <div class="qrCode" ref="qrCodeDiv"></div>
  79. <view class="tip">
  80. 扫码可查看在线版本证书
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. import {
  87. cert
  88. } from '@/api/certificate.js'
  89. import {
  90. getUserInfo
  91. } from '@/api/login.js'
  92. import QRCode from 'qrcodejs2';
  93. export default {
  94. data() {
  95. return {
  96. id:1,
  97. typeList: [{
  98. type: 0,
  99. name: '男'
  100. }, {
  101. type: 1,
  102. name: '女'
  103. }],
  104. info:{},
  105. }
  106. },
  107. onLoad(res) {
  108. const that = this;
  109. if(!res.id){
  110. getUserInfo().then((res)=>{
  111. that.id = res.data.uid;
  112. that.$nextTick(
  113. () => {
  114. that.bindQRCode();
  115. }
  116. )
  117. }).catch((res)=>{
  118. console.log(res);
  119. });
  120. }else{
  121. that.id = res.id;
  122. that.cert();
  123. that.$nextTick(
  124. () => {
  125. that.bindQRCode();
  126. }
  127. )
  128. }
  129. },
  130. methods: {
  131. bindQRCode() {
  132. new QRCode(this.$refs.qrCodeDiv, {
  133. render: "canvas",
  134. text:this.$store.state.baseURL+this.$store.state.urlFile+'/pages/certificate/showCertificate?id=' +this.id,
  135. width: 100,
  136. height: 100,
  137. colorDark: "#333333", //二维码颜色
  138. colorLight: "#ffffff", //二维码背景色
  139. correctLevel: QRCode.CorrectLevel.L //容错率,L/M/H
  140. })
  141. },
  142. cert(){
  143. cert({
  144. id:this.id
  145. }).then((e)=>{
  146. this.info = e.data.info;
  147. }).catch((e)=>{
  148. })
  149. }
  150. }
  151. }
  152. </script>
  153. <style lang="scss">
  154. .box {
  155. .bg {
  156. width: 750rpx;
  157. }
  158. .content {
  159. position: absolute;
  160. top: 0;
  161. left: 0;
  162. right: 0;
  163. padding: 0 80rpx;
  164. padding-top: 150rpx;
  165. .title {
  166. padding-left: 20rpx;
  167. flex-grow: 1;
  168. align-self: flex-end;
  169. .jg1 {
  170. width: 1em;
  171. display: inline-block;
  172. }
  173. }
  174. .according {
  175. padding-top: 100rpx;
  176. .indentation {
  177. text-indent: 2em;
  178. }
  179. }
  180. .avImg {
  181. width: 160rpx;
  182. height: 215rpx;
  183. background-color: red;
  184. }
  185. }
  186. }
  187. .item {
  188. font-weight: bold;
  189. padding-top: 20rpx;
  190. .name {
  191. font-size: 28rpx;
  192. }
  193. .text {
  194. flex-grow: 1;
  195. border-bottom: 1px solid rgb(90, 90, 86);
  196. }
  197. }
  198. .qrCode{
  199. margin: 0 auto;
  200. width: 200rpx;
  201. height: 200rpx;
  202. }
  203. .tip{
  204. text-align: center;
  205. margin-top: 10rpx;
  206. }
  207. </style>