index.vue 669 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <view class="container">
  3. <button @click="wxLogin">登录</button>
  4. <button type="default" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">微信手机号一键登录</button>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {}
  11. },
  12. methods: {
  13. wxLogin() {
  14. uni.navigateTo({
  15. url: '/pages/login/login'
  16. })
  17. // uni.login({
  18. // provider: 'weixin', //使用微信登录
  19. // success: function(loginRes) {
  20. // console.log(loginRes);
  21. // }
  22. // });
  23. },
  24. getPhoneNumber(e) {
  25. console.log(e.detail);
  26. }
  27. }
  28. }
  29. </script>
  30. <style>
  31. .container {}
  32. </style>