<button
open-type="getUserInfo"
:disabled="disabled_"
class="c-btn"
:loading="loading_"
:class="[
plain_ ? `c-btn--${type}__plain`: '',
disabled_ ? 'c-btn--disabled': '',
`c-btn--${type}`,
`c-btn--${shape}`,
`c-btn--${size}`
]"
:style="[ style_ ]"
@click="handleClick"
@getphonenumber="handleGetphonenumber"
@getuserinfo="handleGetuserinfo"
@error="handleError"
@opensetting="handleOpensetting"
@launchapp="handleLaunchapp"
>
<text
v-if="plain_"
class="c-btn__border"
:style="[ borderStyle_ ]"
></text>
<slot></slot>
</button>
async getUserInfo() { // 获取用户信息 微信
if (this.btnLoading) return
this.btnLoading = true
const data = await this.getwxUserInfo()
this.btnLoading = false
this.$emit('getuserinfoencry', {
type: 'getuserinfo',
detail: data ? {
encryptedData: data.encryptedData,
iv: data.iv
} : {}
})
},
async getwxUserInfo() { // 获取微信授权个人信息
let res = false
try {
res = await wx.getUserProfile({
desc: '用于完善会员资料'
})
} catch (error) {
res = false
}
return res
}
同一个小程序,一个商家可以,一个商家不可以...这是为啥?