登录

1. 调起弹窗

    <button
                        class="wxLoginBtn u-m-t-30"
                        open-type="getUserInfo"
                        @getuserinfo="bindGetUserInfo"
                    >
          登录/注册
        </button>

方法:

        bindGetUserInfo(data){
                this.$store.dispatch('user/bindGetUserInfo', data)
            },

vuex :

        bindGetUserInfo ({ dispatch }, data) {
            console.log(data, 1111)
            if (data.detail.errMsg !== 'getUserInfo:ok') { // 拒绝了授权
                console.log('进来')
                uni.showModal({
                  title: '提示',
                  content: '需要通过授权才能继续,请重新点击并授权',
                  showCancel: false,
                  confirmText: '确定',
                  confirmColor: '#0768AC'
                })
              } else {
                    console.log('进来')
                    dispatch('comfirmAuth', data)
              }
        },

这个时候弹窗调起来 

2. 扫码登录

wei'x

越努力越幸运
原文地址:https://www.cnblogs.com/guangzhou11/p/14513354.html