
作用:检测IOS安卓
https://developers.weixin.qq.com/community/operate/detail/1006
.wxml
按钮禁止使用buy方法
<view><button bindtap="buy"disabled="{{db}}">{{create}}</button></view>
data: {systemInfo: {},create: "",db: true, //创建按钮},onShow: function() {//检查终端ios/安卓this.ios()},//检查终端ios/安卓ios() {var that = this;wx.getSystemInfo({success: function(res) {that.setData({systemInfo: res,})if (res.platform == "devtools") {that.setData({create: "购买",db: false //创建按钮//浏览器})} else if (res.platform == "ios") {that.setData({create: "IOS不阔以",})} else if (res.platform == "android") {that.setData({create: "购买",db: false //创建按钮})}}})},