certificates copy.vue 4.2 KB

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