版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_39702981/article/details/84372879
微信小程序之----加载中提示框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: function (res) {
// 加载完毕
wx.hideLoading();
// 返回接口数据
console.log(res.data)
// 将数据赋值给变量
lanmu.setData(
{
lanmu: res.data
}
)
}
})
// --栏目分类请求接口
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})