ios提示更新版本

plus.runtime.getProperty(plus.runtime.appid,function(inf){
                                         var  curVersion = inf.version;
                                         $.ajax({
                                            type:"get",
                                            dataType:'json',
                                            url:"https://itunes.apple.com/CN/lookup?id=1407594076",//获取当前上架APPStore版本信息
                                            data:{            
                                                id:1407594076 //APP唯一标识ID
                                            },
                                            success:function(data){
                                                var storeVersion = data.results[0].version
                                                var upGradeContent = data.results[0].releaseNotes
                                                if(curVersion < storeVersion && VM.temp =='0'){
                                                     var btnArray = ['下次再说', '现在升级'];
                                                    mui.confirm('你当前的版本是V'+ curVersion + ","+  '发现新版本V' + storeVersion +"," + '是否下载新版本?', '升级提示', btnArray, function(e) {
                                                        if (e.index == 1) {
                                                           document.location.href='https://itunes.apple.com/cn/app/dai-li-lian-bang/id1407594076?mt=8'
                                                        } else{
                                                            VM.temp = '1'
                                                        }
                                                    }) 
                                                }
                                             }
                                            })
                                                               
                                   });

猜你喜欢

转载自blog.csdn.net/MercedesCc/article/details/84294536