最好放到app.js中,作爲公共函數
//title(標題),
//icon(圖標), success,loading,none
//duration(延時) 0爲不關閉, 毫秒數
//options(其它參數),
toast(title, icon = 'none', duration, options) {
wx.showToast({
title: title || '',
icon: icon,
image: (options && options.image) || '',
duration: duration || 1500,
mask: (options && options.mask) || true,
});
}