// home.js
Page({
/**
* 页面的初始数据
*/
data: {
banners: [],
books: [
{ header: {name: "精品图书"}, books: [] },
{ header: {name: "随便看看"}, books: [] },
{ header: {name: "最新上架"}, books: [] },
],
menus: [
{ "imgUrl": "/images/menu/rank.png", "name": "榜单" },
{ "imgUrl": "/images/menu/category.png", "name": "分类" },
{ "imgUrl": "/images/menu/list.png", "name": "书单" },
{ "imgUrl": "/images/menu/active.png", "name": "活动" }
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.requestData();
},
requestData: function () {
var that = this;
wx.request({
url: 'http://www.kindlepush.com/app/getIndexInfo',
success: function (res) {
//console.log(res.data.hotBookList);
// that.data.banners = res.data.pictureList;
// that.data.books[0].books = res.data.goodBookList;
// that.data.books[1].books = res.data.hotBookList;
// that.data.books[2].books = res.data.newBookList;
//以上方式不可以
that.setData({
banners: res.data.pictureList,
'books[0].books': res.data.goodBookList,//注意加引号
'books[1].books': res.data.hotBookList,
'books[2].books': res.data.newBookList,
});
},
fail: function (err) {
console.log(err);
}
});
},
toDetail:function(event){
var book = event.currentTarget.dataset.book;
wx.navigateTo({
url: '/pages/bookDetail/bookDetail?book='+JSON.stringify(book),
})
},
toHotPush: function(event){
var index=event.currentTarget.dataset.index;
if (index==0){
wx.navigateTo({
url: '/pages/hotPush/hotPush',
})
}else{
wx.showToast({
title: '暂无此功能!',
duration: 1000,
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
没有合适的资源?快使用搜索试试~ 我知道了~
微信小程序精选源码亲测可用_kindle图书商城小程序.zip
共103个文件
png:50个
wxss:15个
wxml:14个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 111 浏览量
2023-06-29
20:40:26
上传
评论
收藏 2.64MB ZIP 举报
温馨提示
微信小程序精选源码亲测可用_kindle图书商城小程序.zip
资源推荐
资源详情
资源评论
收起资源包目录
微信小程序精选源码亲测可用_kindle图书商城小程序.zip (103个子文件)
1.gif 1.47MB
2.jpg 38KB
3.jpg 31KB
home.js 3KB
bookMall.js 2KB
bookDetail.js 2KB
login.js 2KB
allBook.js 2KB
hotPush.js 1KB
mine.js 1KB
bookList.js 1KB
app.js 669B
util.js 460B
app.json 1KB
hotPush.json 43B
home.json 41B
bookMall.json 40B
bookList.json 40B
mine.json 40B
login.json 38B
bookDetail.json 2B
allBook.json 2B
yarn.lock 86B
[email protected] 309KB
[email protected] 34KB
[email protected] 32KB
[email protected] 31KB
[email protected] 31KB
[email protected] 31KB
[email protected] 30KB
[email protected] 30KB
[email protected] 29KB
[email protected] 29KB
[email protected] 28KB
[email protected] 28KB
[email protected] 28KB
[email protected] 28KB
[email protected] 28KB
[email protected] 27KB
[email protected] 27KB
[email protected] 27KB
[email protected] 26KB
[email protected] 25KB
[email protected] 24KB
[email protected] 24KB
[email protected] 22KB
[email protected] 22KB
[email protected] 20KB
[email protected] 19KB
[email protected] 18KB
[email protected] 14KB
[email protected] 12KB
[email protected] 10KB
star.png 5KB
icon.png 4KB
rank.png 2KB
tab_book_store_pre.png 2KB
tab_book_store_nor.png 2KB
hot.png 2KB
list.png 2KB
star_green.png 2KB
account.png 2KB
tab_book_mine_pre.png 1KB
tab_book_mine_nor.png 1KB
password.png 1KB
active.png 1KB
tab_book_comment_pre.png 998B
tab_book_comment_nor.png 985B
category.png 869B
tab_book_shelf_pre.png 591B
tab_book_shelf_nor.png 591B
more.png 407B
bookDetail.wxml 1KB
home.wxml 968B
bookMall.wxml 616B
hotPush.wxml 559B
login.wxml 545B
list-template.wxml 514B
allBook.wxml 509B
mine.wxml 469B
book-template.wxml 237B
bookList.wxml 192B
menu-template.wxml 189B
header-template.wxml 178B
cell-template.wxml 168B
mall-template.wxml 163B
bookDetail.wxss 2KB
home.wxss 802B
list-template.wxss 714B
login.wxss 706B
hotPush.wxss 689B
mine.wxss 635B
allBook.wxss 633B
bookMall.wxss 570B
cell-template.wxss 410B
mall-template.wxss 378B
book-template.wxss 303B
header-template.wxss 301B
menu-template.wxss 211B
共 103 条
- 1
- 2
资源评论
HappyGirl快乐女孩
- 粉丝: 1w+
- 资源: 4156
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功