首页功能分为4个文件,详情说明如下:
1、index.js 接口数据交互
var app = getApp();
Page({
data: {
indicatorDots: false,
autoplay: true,
interval: 2500,
duration: 1000,
SwiperData: [],
},
onLoad: function (options) {
var openid = wx.getStorageSync('openid');
var that = this;
if (openid) {
this.setData({
openid: openid
})
}
app.util.footer(this);
this.adver();
this.getData();
},
onShow: function () {
app.pageConfig(this)
},
adver: function () {
var that = this;
app.util.request({
url: 'entry/wxapp/GetAdver',
data: {},
cachetime: 0,
success: function (res) {
//console.log(res.data);
that.setData({
SwiperData: res.data.data
})
}
})
},
shopFind: function () {
wx.navigateTo({
url: '../shops/shops