fac.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="container">
  3. <view class="box">
  4. <u-form :model="form" ref="uForm">
  5. <u-form-item label="姓名"><u-input v-model="form.realName" /></u-form-item>
  6. <u-form-item label="身份证号"><u-input v-model="form.idCard" /></u-form-item>
  7. </u-form>
  8. <button @click="toFac()">人脸识别</button>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import uniWeb from '../static/uni.webview.1.5.4.js'
  14. export default {
  15. data() {
  16. return {
  17. form: {
  18. realName: '',
  19. idCard: '',
  20. }
  21. }
  22. },
  23. onLoad(options) {
  24. console.log('options===>', options)
  25. },
  26. methods: {
  27. toFac() {
  28. if (!this.form.realName) {
  29. uni.$u.toast('请先输入真实姓名');
  30. }
  31. if (!this.form.idCard) {
  32. uni.$u.toast('请先输入身份证号');
  33. }
  34. this.$http.post('/auth/build_fac', this.form).then(res => {
  35. try {
  36. uniWeb.webView.postMessage({
  37. data: res.data
  38. })
  39. } catch (err) {
  40. console.log('err==>', err)
  41. }
  42. })
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. .container {
  49. width: 100vw;
  50. height: 100vh;
  51. overflow: hidden;
  52. // background: url('../static/img/loginBg.png');
  53. background-size: contain;
  54. position: relative;
  55. .box {
  56. padding: 30rpx;
  57. padding-top: 200rpx;
  58. word-break: break-all;
  59. }
  60. }
  61. </style>