美文网首页
iPhone判断

iPhone判断

作者: 在下高姓 | 来源:发表于2020-10-22 09:06 被阅读0次
isIos(){//iPhone判断
    return new Promise((a,b)=>{
      wx.getSystemInfo({
        success: function(t) {
         a(t.model.includes('iPhone'))
        },
        fail:err=>{
          b(err)
        }
      });
    })
   
  },
调用
async onLoad(options) {
      const t=this;
      try{
        t.setData({
          isIos:await a.isIos()
        })
      }catch(err){
        console.log(err)
      }
    },

相关文章

网友评论

      本文标题:iPhone判断

      本文链接:https://www.haomeiwen.com/subject/pzidmktx.html