摘要:// pages/index/index.jsvar com = require("../../utils/util.js");const app = getApp();Page({ /** * 页面的初始数据 */ data: { img: [], li
// pages/index/index.js
var com = require("../../utils/util.js");
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
img: [],
list: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
com.post('Api/Home/index', {}, "setContent", this);
},
setContent: function (e) {
this.setData({
img: e.img,
list: e.product
});
},
/**
* 跳转到订单详情
*/
goDetails : function(e){
wx.navigateTo({
url: '../goods/details?id=' + e.currentTarget.dataset.id
})
}
})
批改老师:韦小宝批改时间:2018-12-14 13:08:00
老师总结:写的很不错!小程序的文档一定要多看!继续加油吧!