certificates copy.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="content">
  3. <view class="bgimg"><image src="../../static/img/graduation.png"></image></view>
  4. <view class="box">
  5. <view class="name">
  6. <view class="name-left"><input type="text" v-model="name" /></view>
  7. <view class="name-right">先生/女士</view>
  8. </view>
  9. <view class="info">您已完成咸宁市红十字会普及培训,特发此证,以资鼓励。</view>
  10. <view class="signName">
  11. <view class="signName-left">
  12. <view class="signName-1">签发人</view>
  13. <view class="signName-2">Signer</view>
  14. </view>
  15. <view class="signName-right"><input type="text" v-model="people" class="list-input" /></view>
  16. </view>
  17. <view class="signDate">
  18. <view class="signName-left">
  19. <view class="signName-1">签发日期</view>
  20. <view class="signName-2">Signer</view>
  21. </view>
  22. <view class="signName-right">
  23. <view class="signDate">{{ getRecTime(signDate, 'yyyy.MM.dd') }}</view>
  24. <!-- <input type="text" v-model="signDate" class="list-input"/> -->
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue';
  32. export default {
  33. data() {
  34. return {
  35. name: '',
  36. people: '咸宁市红十字会',
  37. signDate: ''
  38. };
  39. },
  40. onLoad(option) {
  41. console.log(234, option);
  42. this.name = option.name;
  43. this.signDate = option.signDate;
  44. let a = this.getRecTime(this.signDate, 'yyyy.MM.dd');
  45. console.log(a, '?');
  46. // console.log('时间转化',getRecTime(111))
  47. },
  48. methods: {
  49. getRecTime(timestamp, fmt) {
  50. let d = new Date(timestamp * 1000),
  51. // f = fmt || 'yyyy/MM/dd',
  52. f = fmt || 'yyyy.MM.dd hh:mm:ss',
  53. o = {
  54. 'M+': d.getMonth() + 1, //月份
  55. 'd+': d.getDate(), //日
  56. 'h+': d.getHours(), //小时
  57. 'm+': d.getMinutes(), //分
  58. 's+': d.getSeconds(), //秒
  59. 'q+': Math.floor((d.getMonth() + 3) / 3), //季度
  60. S: d.getMilliseconds() //毫秒
  61. };
  62. if (/(y+)/.test(f)) {
  63. f = f.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length));
  64. }
  65. for (let k in o) {
  66. if (new RegExp('(' + k + ')').test(f)) {
  67. f = f.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length));
  68. }
  69. }
  70. return f;
  71. console.log(f);
  72. }
  73. }
  74. };
  75. </script>
  76. <style lang="scss">
  77. page {
  78. height: 100%;
  79. }
  80. .qrimg {
  81. position: absolute;
  82. left: -9999rpx;
  83. top: -9999rpx;
  84. }
  85. .content {
  86. width: 100%;
  87. height: 100%;
  88. position: relative;
  89. }
  90. .bgimg {
  91. width: 100%;
  92. height: 100%;
  93. image {
  94. width: 100%;
  95. height: 100%;
  96. }
  97. }
  98. .box {
  99. width: 100%;
  100. height: 100%;
  101. position: absolute;
  102. padding: 380rpx 94rpx 200rpx 94rpx;
  103. color: #333;
  104. left: 0;
  105. top: 0;
  106. display: flex;
  107. flex-direction: column;
  108. justify-content: center;
  109. // align-items: center;
  110. .name {
  111. display: flex;
  112. font-size: 32rpx;
  113. .name-left {
  114. text-align: center;
  115. // padding: 0 24rpx;
  116. width: 150rpx;
  117. border-bottom: 2rpx solid #333;
  118. }
  119. }
  120. .info {
  121. margin-top: 68rpx;
  122. text-indent: 64rpx;
  123. line-height: 58rpx;
  124. }
  125. .signName {
  126. margin-top: 32rpx;
  127. display: flex;
  128. .signName-left {
  129. line-height: 34rpx;
  130. .signName-1 {
  131. }
  132. .signName-2 {
  133. font-size: 28rpx;
  134. }
  135. }
  136. .signName-right {
  137. text-align: left;
  138. // width: 100%;
  139. padding: 0 12rpx;
  140. margin-left: 12rpx;
  141. // width: 288rpx;
  142. border-bottom: 2rpx solid #333;
  143. // margin-bottom: 12rpx;
  144. .list-input {
  145. width: 100%;
  146. padding: 0 12rpx;
  147. height: 70rpx;
  148. font-size: 32rpx;
  149. text-align: left;
  150. }
  151. .signDate {
  152. display: flex;
  153. align-items: center;
  154. }
  155. }
  156. }
  157. .signDate {
  158. margin-top: 22rpx;
  159. display: flex;
  160. .signName-left {
  161. line-height: 34rpx;
  162. .signName-1 {
  163. }
  164. .signName-2 {
  165. font-size: 28rpx;
  166. }
  167. }
  168. .signName-right {
  169. text-align: left;
  170. padding-left: 12rpx;
  171. margin-left: 12rpx;
  172. width: 288rpx;
  173. border-bottom: 2rpx solid #333;
  174. .list-input {
  175. height: 70rpx;
  176. font-size: 32rpx;
  177. text-align: left;
  178. }
  179. // margin-bottom: 12rpx;
  180. }
  181. }
  182. // background-color: pink;
  183. }
  184. </style>