作者:xiaochun365,来自原文地址
一:判断接口是否可用
-
//判断接口是否可用if (wx.openBluetoothAdapter) {
-
wx.openBluetoothAdapter()
-
} else {
-
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
-
wx.showModal({
-
title: '提示',
-
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
-
})
-
}
二:方法之间的值传递
-
onLoad: function () {
-
this.getExpress("123", function (e) {
-
console.log(e) //getExpress方法返回~
-
})},
-
-
getExpress: function (num, fn) {
-
fn("getExpress方法返回~")
-
}
|
|