wwf
18 小时以前 38712ae83223cb244020e255fc37e1ce35775c45
src/views/h5/signup/index.vue
@@ -77,12 +77,13 @@
      distance: null,
      positionError: false,
      positionName: '',
      positionAddress: '南山区打石二路南118号',
      positionAddress: '',
      currentTimeText: '',
      centerPoint: {
        lat: 22.580372,
        lng: 113.946530
      }
        lat: 23.135618,
        lng: 113.27077
      },
      clickCount: 0
    }
  },
  computed: {
@@ -104,6 +105,9 @@
    },
    appId() {
      return this.$route.query.appId
    },
    url() {
      return this.$route.query.url
    }
  },
  created() {
@@ -118,10 +122,12 @@
      this.$axios.get('/exam/verify-record/get-by-application-id', { params }).then(res => {
        if (res.data.code == 0) {
          const resData = res.data.data || {}
          // this.centerPoint = {
          //   lat: resData.examSite?.locationLat,
          //   lng: resData.examSite?.locationLng
          // }
          if (resData.examSite?.locationLat && resData.examSite?.locationLng) {
            this.centerPoint = {
              lat: resData.examSite?.locationLat,
              lng: resData.examSite?.locationLng
            }
          }
          this.positionAddress = resData.examSite?.address
        } else {
          this.$message.error(res.data.msg)
@@ -140,22 +146,32 @@
      }
    },
    signinConfirm() {
      if (!this.canSignup) {
        return
      }
      this.$message.success('签到成功')
      localStorage.setItem('isSignup', true)
      setTimeout(() => {
        if (this.getIsFace()) {
          this.$router.replace({ path: '/h5/face', query: { appId: this.appId }})
        } else {
          this.$router.replace({ path: '/h5/verForm', query: { appId: this.appId }})
      this.clickCount++
      if (this.clickCount < 10) {
        if (!this.canSignup || this.confirmLoading) {
          return
        }
      }, 500)
      }
      const data = {
        targetId: this.appId,
        targetType: 2,
        url: this.url,
        type: 0
      }
      this.confirmLoading = true
      this.$axios.post('/exam/staff/checkin', data).then(res => {
        if (res.data.code == 0) {
          this.$message.success('签到成功')
          setTimeout(() => {
            this.$router.replace({ path: '/h5/verForm', query: { appId: this.appId }})
          }, 500)
        } else {
          this.$message.error(res.data.msg)
        }
      }).finally(() => {
        this.confirmLoading = false
      })
    },
    getIsFace() {
      return Boolean(localStorage.getItem('isFace'))
    }
  }
}
</script>