fac.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. methods: {
  24. toFac() {
  25. if (!this.form.realName) {
  26. uni.$u.toast('请先输入真实姓名');
  27. }
  28. if (!this.form.idCard) {
  29. uni.$u.toast('请先输入身份证号');
  30. }
  31. this.$http.post('/auth/build_fac', this.form).then(res => {
  32. try {
  33. uniWeb.webView.postMessage({
  34. data: res.data
  35. })
  36. } catch (err) {
  37. console.log('err==>', err)
  38. }
  39. })
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .container {
  46. width: 100vw;
  47. height: 100vh;
  48. overflow: hidden;
  49. // background: url('../static/img/loginBg.png');
  50. background-size: contain;
  51. position: relative;
  52. .box {
  53. padding: 30rpx;
  54. padding-top: 200rpx;
  55. word-break: break-all;
  56. }
  57. }
  58. </style>