<template>
  <view>
    <web-view :src="getOpenIDUrl"></web-view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      getOpenIDUrl: '',
    }
  },
  onLoad(options) {
    let { mobile } = options
    let origin = 'https://wx.jxc4.com'
    let jxcsWxApiUrl = `${origin}/v2/auth2/WeixinMPOAuth2`
    let redirectUrl = `${origin}/authorize`
    let url
    mobile
      ? (url = encodeURI(
          jxcsWxApiUrl + '?block=' + redirectUrl + '?mobile=' + mobile
        ))
      : (url = encodeURI(jxcsWxApiUrl + '?block=' + redirectUrl))
    this.getOpenIDUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx2bb99eb5d2c9b82c&redirect_uri=${url}&response_type=code&scope=snsapi_userinfo#wechat_redirect`
  },
}
</script>

<style>
</style>