wx.hideTabBar is not a function;at pages/index/index page lifeCycleMethod onShow function
wx.showTabBar is not a function;at pages/index/index setIsLogined function;at api request success callback function
代码片段:
wywx.js文件
function hideTabBar(success, fail) {
wx.hideTabBar({
aniamtion: false,
success: typeof success == “function” ? success() : function (res) {
console.log(“wx.hideTabBar.success”);
},
fail: typeof fail == “function” ? fail() : function (res) {
console.log(“wx.hideTabBar.fail”);
},
complete: function (res) { },
})
}
function showTabBar(success, fail) {
wx.showTabBar({
aniamtion: false,
success: typeof success == “function” ? success() : function (res) {
console.log(“wx.showTabBar.success”);
},
fail: typeof fail == “function” ? fail() : function (res) {
console.log(“wx.showTabBar.fail”);
},
complete: function (res) { },
});
}
index.js文件中调用
var w = require("…/…/utils/mywx.js");
w.showTabBar(function () {
console.log(“w.showTabBar”)
});
w.hideTabBar();