app.js
ios: function(){ var that = this; wx.getSystemInfo({ success:function(res){ console.log(res) if(res.platform == "devtools"){ that.globalData.is_ios=false }else if(res.platform == "ios"){ }else if(res.platform == "android"){ that.globalData.is_ios=false } } }) },
onLaunch: function() { this.ios() }
wxjs:
tocharge: function () { if(app.globalData.is_ios){ wx.showModal({ title: '应IOS平台规范对小程序的要求,IOS用户暂时无法使用该功能。', }) }else{ wx.navigateTo({ url: '/pages/newPage/drawMon/index', }) } },
wxml:
<view class='padding_x30' catchtap='tocharge'> <view class='mon_ flex_ padding_x30 padding_y40'> <image src='/image/mine/mon.png' mode='widthFix'></image> <text class='flex_1 padding_x30'>充值送积分</text> <button hover-class='none'>去充值</button> </view> </view>