// index.js
// 获取应用实例
const app = getApp()
import { getSwiperList, getCateList, getGoodsList } from './../../api/indexAPI'
//Page Object
Page({
data: {
swiperList: [],
cateList: [],
goodsList: []
},
//options(Object)
onLoad: function (options) {
/* var reqTask = wx.request({
// url: 'https://api.zbztb.cn/api/public/v1/banner/list',
url: 'https://api.it120.cc/kotoba/banner/list',
data: {},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
responseType: 'text',
success: (result) => {
console.log(result);
this.setData({
swiperList: result.data.data.slice(1).reverse()
})
},
fail: () => { },
complete: () => { }
});
*/
this.initSwiperList()
this.initCateList()
this.initGoodsList()
},
async initSwiperList() {
const { data: res } = await getSwiperList()
this.setData({
swiperList: res.data.slice(1).reverse()
})
},
async initCateList() {
const { data: res } = await getCateList()
let tempList = []
for (let i = res.data.length, j = 0; i > 0; i -= 8, j++) {
tempList[j] = res.data.slice(j * 8, (j + 1) * 8)
}
this.setData({
cateList: tempList
})
},
initGoodsList() {
getGoodsList().then(result => {
const { data: res } = result;
if (res.code === 0) {
this.setData({
goodsList: res.data
})
}
});
},
onReady: function () {
},
onShow: function () {
},
onHide: function () {
},
onUnload: function () {
},
onPullDownRefresh: function () {
},
onReachBottom: function () {
},
onShareAppMessage: function () {
},
onPageScroll: function () {
},
//item(index,pagePath,text)
onTabItemTap: function (item) {
}
});
没有合适的资源?快使用搜索试试~ 我知道了~
微信小程序在线购物商城
共147个文件
wxss:80个
js:19个
json:18个
2 下载量 136 浏览量
2023-02-10
10:18:07
上传
评论
收藏 192KB ZIP 举报
温馨提示
微信小程序在线购物商城
资源推荐
资源详情
资源评论
收起资源包目录
微信小程序在线购物商城 (147个子文件)
.gitignore 159B
index.js 2KB
index.js 2KB
index.js 760B
index.js 758B
index.js 758B
index.js 757B
index.js 756B
index.js 755B
index.js 755B
index.js 754B
index.js 754B
index.js 754B
index.js 753B
index.js 723B
.eslintrc.js 587B
indexAPI.js 494B
moment.js 460B
app.js 365B
SearchInput.js 231B
app.json 1KB
project.config.json 1KB
project.private.config.json 387B
sitemap.json 191B
index.json 135B
index.json 71B
index.json 64B
SearchInput.json 48B
index.json 27B
index.json 27B
index.json 27B
index.json 27B
index.json 27B
index.json 27B
index.json 27B
index.json 27B
index.json 27B
index.json 27B
index.less 1KB
SearchInput.less 343B
index.less 98B
my-o.png 14KB
my.png 13KB
category-o.png 12KB
category.png 12KB
cart-o.png 12KB
cart.png 11KB
home-o.png 11KB
home.png 10KB
nologin.png 9KB
1nologin.png 9KB
no-order.png 2KB
close.svg 640B
index.wxml 2KB
index.wxml 2KB
SearchInput.wxml 171B
index.wxml 76B
index.wxml 72B
index.wxml 72B
index.wxml 70B
index.wxml 68B
index.wxml 66B
index.wxml 66B
index.wxml 64B
index.wxml 64B
index.wxml 64B
index.wxml 62B
weui.wxss 45KB
weui-form.wxss 6KB
iconfont.wxss 6KB
weui-loading.wxss 4KB
weui-half-screen-dialog.wxss 4KB
weui-tab.wxss 3KB
weui-select.wxss 3KB
weui-form.wxss 3KB
weui-actionsheet.wxss 3KB
weui-dot-loading.wxss 3KB
weui-dialog.wxss 2KB
weui-navigation-bar.wxss 2KB
index.wxss 2KB
weui-form-preview.wxss 2KB
weui-cells__group.wxss 2KB
weui-msg.wxss 2KB
weui-uploader.wxss 2KB
weui-slideview.wxss 2KB
weui-navbar.wxss 2KB
weui-media-box.wxss 2KB
weui-cell.wxss 1KB
weui-searchbar.wxss 1KB
weui-tabbar.wxss 1KB
index.wxss 1KB
weui-animate.wxss 1KB
weui-form_common.wxss 1KB
weui-gallery.wxss 1KB
weui-toptips.wxss 853B
weui-footer.wxss 795B
weui-article.wxss 788B
weui-panel.wxss 756B
weui-btn_cell.wxss 744B
weui-loadmore.wxss 743B
共 147 条
- 1
- 2
资源评论
汀、人工智能
- 粉丝: 7w+
- 资源: 376
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功