wxLogin.vue 721 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <view class="">
  3. <image src="/static/images/login/login-bg.png" mode="widthFix" style="width: 100vw;"></image>
  4. <view class="login-box">
  5. <fs-button block type="success" radius @click="getUserProfile">微信登录</fs-button>
  6. </view>
  7. </view>
  8. </template>
  9. <script setup>
  10. import { useStore } from 'vuex'
  11. const store = useStore()
  12. const getUserProfile = () => {
  13. wx.getUserProfile({
  14. desc: '用于完善会员资料',
  15. success: res => {
  16. store.dispatch('wxLogin').then(res => {
  17. })
  18. }
  19. })
  20. }
  21. </script>
  22. <style>
  23. page{
  24. background-color: #fff;
  25. height: 100%;
  26. overflow: hidden;
  27. }
  28. </style>
  29. <style lang="scss" scoped>
  30. .login-box{
  31. position: fixed;
  32. bottom: 100rpx;
  33. left: 0;
  34. right: 0;
  35. }
  36. </style>