|
[BUG]
api.openWin 在iOS上的BUG
[复制链接]
本帖最后由 流风回雪 于 2015-3-26 02:22 编辑
- <div onclick="reload()">刷新</div>
- <script>
- function reload(){
- api.openWin({name: 'root', reload:true});//这样没问题
- }
- </script>
复制代码- <div onclick="login()">登录</div>
- <script>
- function login(){
- api.openWidget({
- id: 'xxx',
- animation: {
- type: 'flip',
- subType: 'from_left'
- }
- }, function(ret, err){
- if (ret && ret.state == 'xxx') {
- getToken(ret.code);
- }else{
- api.toast({
- msg: '取消登录',
- duration:2000,
- location: 'top'
- });
- }
- if(err && err.msg){
- api.alert({msg: err.msg});
- }
-
- });
- }
- function getToken(code){
- api.ajax({
- url: 'http://www.xxxxxxx',
- method: 'get',
- timeout: 30,
- dataType: 'json',
- returnAll:false,
- data:{
- values: {code: code},
- }
- },function(ret,err){
- if (ret) {
- //console.log('登录成功');
- $api.setStorage('access_token',ret.access_token);
- $api.setStorage('refresh_token',ret.refresh_token);
- $api.setStorage('token_type',ret.token_type);
- $api.setStorage('expires_in',ret.expires_in);
- $api.setStorage('uid',ret.uid);
- api.openWin({name: 'root',reload:true}); //这样,在iOS上不起作用
- }else {
- api.toast({
- msg: '登录失败',
- duration:2000,
- location: 'top'
- });
- };
- });
- }
- </script>
复制代码
在 5S ios7、6+ ios8 上有问踢
在 海马玩模拟器 上能正常执行
|
|