微信小程式之----載入中提示框loading
阿新 • • 發佈:2018-11-28
微信小程式之----載入中提示框loading
wx.json
Page({
/**
* 頁面的初始資料
*/
data: {
},
onLoad: function (options) {
// 欄目分類請求介面
var lanmu = this;
wx.showLoading({
title: '載入中',
})
// 請求介面
wx.request({
url: 'category_list.php',
// 傳輸格式json
header: {
'content-type': 'application/json'
},
success
// 載入完畢
wx.hideLoading();
// 返回介面資料
console.log(res.data)
// 將資料賦值給變數
lanmu.setData(
{
lanmu: res.data
}
)
}
})
// --欄目分類請求介面
},
/**
* 使用者點選右上角分享
*/
onShareAppMessage: function () {
}
})