signCommit.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="sign_commit">
  3. <nav-bar title="签署承诺书"></nav-bar>
  4. <!-- 考试疫情承诺书 -->
  5. <view class="appointmentItem">
  6. <view class="title"><text class="star_red">*</text> 考试疫情承诺书</view>
  7. <view class="commitment">
  8. 本人参加“住房和城乡建设领域施工现场专业人员岗位”考试,愿意遵守疫情防控各项管理的相关要求,秉承对自己、对他人负责的原则,承担疫情防控社会责任,郑重作出以下承诺:<br/>
  9. 一、充分理解并遵守考试期间考点各项防疫安全的要求。<br/>
  10. 二、在考试前14天内,没有到过国内疫情中风险、高风险地区,未出境,不存在自境外回国情形。<br/>
  11. 三、在考试前14天内,每日自觉监测体温,体温均未出现高于37.3度的情形,无发热和呼吸道门诊就诊史。<br/>
  12. 四、在考试前14天内,未和新冠肺炎病例或疑似病例密切接触或间接接触,没有发烧、干咳、乏力、咳痰、气短、肌肉痛或关节痛、咽喉痛、头痛、寒颤、恶心或呕吐、鼻塞、腹泻、咳血、结膜充血等疑似新冠肺炎症状。<br/>
  13. 五、如出现与前述第二、三、四项任何一项不符的情形之一的,本人将及时在考前向相关管理机构报告,自觉配合采取隔离或其他防疫措施,并根据情况,自愿放弃参加考试。<br/>
  14. 六、考试当日自行做好防护工作,佩戴防护口罩。提前抵达考点,配合查验健康码、测量体温等。<br/>
  15. 七、考试期间,将严格遵守应考人员考场守则及疫情防控相关管理要求,完成考试后立即离场,不扎堆,不聚集。<br/>
  16. 八、本人承诺遵守《应考人员安全承诺书》中所有承诺内容,若因有瞒报、谎报造成新冠肺炎疫情传播的,一经查实,由本人承担相应的法律和经济责任。
  17. </view>
  18. </view>
  19. <view class="appointmentItem">
  20. <view class="title"><text class="star_red">*</text>签名板</view>
  21. <view class="dis_stys">
  22. <text style="color: #999999">请在下方签名区进行签名</text>
  23. <text @click="retDraw" mode="">清空</text>
  24. </view>
  25. <view class="handCenter">
  26. <!-- v-if="!form[item.fieldKey]" -->
  27. <canvas
  28. class="handWriting"
  29. disable-scroll="true"
  30. :catchtouchmove="true"
  31. @touchstart="uploadScaleStart"
  32. @touchmove="uploadScaleMove"
  33. @touchend="uploadScaleEnd"
  34. canvas-id="handWriting"
  35. ></canvas>
  36. <!-- <view
  37. v-else
  38. style="width: 100%; height: 100%; position: relative"
  39. >
  40. <view class="ctoples">图片</view>
  41. <image
  42. style="width: 100%; height: 100%"
  43. :src="$method.splitImgHost(form[item.fieldKey])"
  44. mode=""
  45. ></image>
  46. </view> -->
  47. </view>
  48. </view>
  49. <view class="finish_btn" @click="submits()">
  50. 完成签署
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import Handwriting from "@/common/signature.js";
  56. export default {
  57. name: 'sign_commit',
  58. data() {
  59. return {
  60. handwriting: '',
  61. lineColor: "black",
  62. slideValue: 50,
  63. commitment_electr_signature: '',
  64. isUploading: false,
  65. }
  66. },
  67. onReady(res) {
  68. this.handwriting = new Handwriting({
  69. lineColor: this.lineColor,
  70. slideValue: this.slideValue, // 0, 25, 50, 75, 100
  71. canvasName: "handWriting",
  72. });
  73. // this.$refs.uForm.setRules(this.rules);
  74. },
  75. methods: {
  76. retDraw() {
  77. this.handwriting.retDraw()
  78. this.commitment_electr_signature = ''
  79. // this.$set(this.form, "commitment_electr_signature", "");
  80. },
  81. uploadScaleStart(event) {
  82. this.handwriting.uploadScaleStart(event);
  83. },
  84. uploadScaleMove(event) {
  85. this.handwriting.uploadScaleMove(event);
  86. },
  87. uploadScaleEnd(event) {
  88. this.handwriting.uploadScaleEnd(event);
  89. },
  90. subCanvas() {
  91. console.log("签名-------");
  92. return new Promise((resolve, reject) => {
  93. if (this.commitment_electr_signature) {
  94. resolve();
  95. return;
  96. }
  97. this.handwriting.saveCanvas().then((res) => {
  98. if (this.handwriting.linePrack.length) {
  99. console.log('签名-----res', res)
  100. // this.$set(this.form, "commitment_electr_signature", res);
  101. this.commitment_electr_signature = res
  102. }
  103. resolve(res)
  104. })
  105. .catch((err) => {
  106. uni.showToast({
  107. title: "签名上传失败",
  108. icon: "error",
  109. });
  110. });
  111. this.isUploading = false
  112. });
  113. },
  114. async submits() {
  115. if (this.isUploading) {
  116. return;
  117. }
  118. this.isUploading = true
  119. await this.subCanvas()
  120. if (!this.commitment_electr_signature) {
  121. uni.showToast({
  122. title: "请签名",
  123. icon: "none",
  124. })
  125. return
  126. } else {
  127. await this.submitApi()
  128. }
  129. },
  130. //提交表单
  131. async submitApi() {
  132. if (this.commitment_electr_signature) {
  133. this.commitment_electr_signature = await this.$method.uploadFile(
  134. this.commitment_electr_signature,
  135. 0
  136. );
  137. console.log('----commitment_electr_signature', this.commitment_electr_signature)
  138. }
  139. },
  140. },
  141. }
  142. </script>
  143. <style>
  144. page {
  145. background-color: #eaeef1;
  146. }
  147. </style>
  148. <style lang="scss" scoped>
  149. .sign_commit {
  150. padding-bottom: 50rpx;
  151. .appointmentItem {
  152. margin: 24rpx 0 40rpx;
  153. .title {
  154. font-size: 30rpx;
  155. font-family: PingFang SC;
  156. font-weight: 500;
  157. color: #333333;
  158. line-height: 1;
  159. margin-bottom: 16rpx;
  160. padding-left: 24rpx;
  161. .star_red {
  162. color: red;
  163. }
  164. }
  165. .place {
  166. height: 80rpx;
  167. background: #ffffff;
  168. border-radius: 16rpx;
  169. display: flex;
  170. justify-content: space-between;
  171. align-items: center;
  172. padding: 0 24rpx;
  173. }
  174. .commitment {
  175. padding: 12rpx;
  176. height: 900rpx;
  177. background: #ffffff;
  178. overflow-y: auto;
  179. }
  180. .handCenter, .dis_stys, .commitment {
  181. margin: 0rpx 24rpx;
  182. }
  183. .dis_stys {
  184. display: flex;
  185. justify-content: space-between;
  186. align-items: center;
  187. margin-bottom: 16rpx;
  188. }
  189. .handCenter {
  190. .handWriting {
  191. width: 100%;
  192. height: 400rpx;
  193. background: #fff;
  194. }
  195. }
  196. }
  197. .finish_btn {
  198. // width: 100%;
  199. height: 100rpx;
  200. line-height: 100rpx;
  201. text-align: center;
  202. background-color:#1890ff;
  203. font-size: 32rpx;
  204. color: #fff;
  205. border-radius: 10rpx;
  206. margin: 20rpx 24rpx;
  207. }
  208. }
  209. </style>