小程序
小游戏
企业微信
微信支付
扫描小程序码分享
开发中工具中实现都是正常的,
iphoneX调用showToast组件,写在当前页面的toast可调起,写在app.js中的toast无法被调起。
相同的调起方法,在iphone其他机型中可调起。
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
现在不是不让直接授权了吗?
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
你好,麻烦提供出现问题的iphoneX的微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
signin:
function
(cb) {
var
that =
this
wx.login({
success(data) {
if
(data.code) {
wx.getUserInfo({
success(res) {
// that.globalData.code = data.code;
// that.globalData.encrypted = res.encryptedData;
// that.globalData.iv = res.iv
wx.request({
url: that.globalData.apiHost +
'/code_session'
,
data: {
code: data.code,
appid: that.globalData.appId
},
header: {
'Accept'
:
'application/json'
success(seres) {
'/code_login'
appid: that.globalData.appId,
encrypted: res.encryptedData,
iv: res.iv
method:
'POST'
'content-type'
'application/x-www-form-urlencoded'
success:
(res) {
wx.showToast({
icon:
'none'
title:
'授权成功'
duration: 2000
})
// console.log(res);
(res.data.code == 100000) {
cached.set(
'user'
, {
uid: res.data.data.id,
token: res.data.data.token
});
cached.get(
);
that.globalData.user = cached.get(
setTimeout(
() {
cb && cb()
}, 500);
}
//wx.reLaunch({ url: '/pages/index/index' });
fail:
console.log(
'fail'
)
//发起网络请求
else
{
'登录失败!'
+ res.errMsg)
麻烦提供这种格式的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
现在不是不让直接授权了吗?
麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
你好,麻烦提供出现问题的iphoneX的微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
signin:function(cb) {varthat =thiswx.login({success(data) {if(data.code) {wx.getUserInfo({success(res) {// that.globalData.code = data.code;// that.globalData.encrypted = res.encryptedData;// that.globalData.iv = res.ivwx.request({url: that.globalData.apiHost +'/code_session',data: {code: data.code,appid: that.globalData.appId},header: {'Accept':'application/json'},success(seres) {wx.request({url: that.globalData.apiHost +'/code_login',data: {code: data.code,appid: that.globalData.appId,encrypted: res.encryptedData,iv: res.iv},method:'POST',header: {'Accept':'application/json','content-type':'application/x-www-form-urlencoded'},success:function(res) {wx.showToast({icon:'none',title:'授权成功',duration: 2000})// console.log(res);if(res.data.code == 100000) {cached.set('user', {uid: res.data.data.id,token: res.data.data.token});cached.get('user');that.globalData.user = cached.get('user');setTimeout(function() {cb && cb()}, 500);}//wx.reLaunch({ url: '/pages/index/index' });},fail:function() {console.log('fail')}})}})},fail:function() {console.log('fail')}})//发起网络请求}else{console.log('登录失败!'+ res.errMsg)}}})},麻烦提供这种格式的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)