//index.js
//获取应用实例
var apiUtils = require('../../utils/apiUtils')
var types = require('../../utils/constant').MAIN_TYPE
var app = getApp()
Page({
data: {
tabs: ["那荐", "那展", "那言", "那书"],
activeIndex: "0",
sliderOffset: 0,
sliderLeft: 0,
swiper: [],
indicatorDots: true,
autoplay: true,
interval: 5000,
duration: 1000,
zhanxun: {
page: 1,
limit: 5
},
exhibition: {
page: 1,
limit: 5
},
book: {
page: 1,
limit: 5
},
content: {
page: 1,
limit: 5
},
zhanxunData: [],
exhibitionData: [],
bookData: [],
contentData: [],
},
//根据类型进入不同页面
click: function (e) {
console.log(JSON.stringify(e))
console.log(e.currentTarget.dataset.type)
var objectId = e.currentTarget.dataset.id
var url = ''
switch (e.currentTarget.dataset.type) {
case types.zhanxun:
url = '../main_page/zhanxun/index'
break;
case types.exhibition:
url = '../main_page/exhibition/index'
break;
case types.book:
url = '../main_page/book/index'
break;
case types.content:
url = '../main_page/content/index'
break;
}
// var url = ''
wx.navigateTo({
url: url + '?id=' + objectId
})
},
exhibition_item_click: function (e) {
console.log(e)
}
,
onLoad: function () {
var that = this;
wx.getSystemInfo({
success: function (res) {
that.setData({
sliderLeft: (res.windowWidth / that.data.tabs.length - res.sliderWidth) / 2
});
}
});
this.request_slide_image()
this.request_discover_data()
this.request_exhibition_data()
},
onShow: function () {
wx.setNavigationBarTitle({
title: '知亦行',
success: function (res) {
console.log(res)
}
})
}
,
tabClick: function (e) {
this.setData({
sliderOffset: e.currentTarget.offsetLeft,
activeIndex: e.currentTarget.id
});
if(e.currentTarget.id==2&&this.data.contentData.length==0){
this.request_book_content_data('content')
console.log('content')
}
if(e.currentTarget.id==3&&this.data.bookData.length==0){
this.request_book_content_data('book')
console.log('book')
}
},
//以下为scrollview
lower: function (e) {
console.log('滚动到底部了')
console.log(e)
var zhanxun = this.data.zhanxun;
zhanxun.page = zhanxun.page + 1;
this.setData({
zhanxun: zhanxun,
})
this.request_discover_data()
},
exhibition_lower: function (e) {
console.log('滚动到底部了')
console.log(e)
var exhibition = this.data.exhibition;
exhibition.page = exhibition.page + 1;
this.setData({
exhibition: exhibition,
})
this.request_exhibition_data()
},
content_lower: function (e) {
console.log('滚动到底部了')
console.log(e)
var content = this.data.content;
content.page = content.page + 1;
this.setData({
content: content,
})
this.request_book_content_data('content')
},
book_lower: function (e) {
console.log('滚动到底部了')
console.log(e)
var book = this.data.book;
book.page = book.page + 1;
this.setData({
book: book,
})
this.request_book_content_data('book')
}
,
request_slide_image: function () {
var that = this;
apiUtils.AJAX(apiUtils.API_V2 + "slider", function (res) {
console.log(res)
if (!res.data.status) {
return;
}
that.setData({
swiper: res.data.results
})
})
},
request_discover_data: function () {
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 10000
})
wx.showNavigationBarLoading()
var that = this;
apiUtils.AJAX(apiUtils.API_V1 + "discover" + "?page=" + this.data.zhanxun.page + "&limit=" + this.data.zhanxun.limit, function (res) {
console.log(res.data)
wx.hideToast()
wx.hideNavigationBarLoading()
that.setData({
zhanxunData: that.data.zhanxunData.concat(res.data.results)
})
})
},
request_exhibition_data: function () {
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 10000
})
wx.showNavigationBarLoading()
var that = this;
apiUtils.AJAX(apiUtils.API_V1 + "exhibition/recommend" + "?page=" + this.data.exhibition.page + "&limit=" + this.data.exhibition.limit, function (res) {
console.log(res.data)
wx.hideToast()
wx.hideNavigationBarLoading()
that.setData({
exhibitionData: that.data.exhibitionData.concat(res.data.results)
})
})
},
request_book_content_data: function (type) {
wx.showToast({
title: '加载中',
icon: 'loading',
duration: 10000
})
wx.showNavigationBarLoading()
var that = this;
apiUtils.AJAX(apiUtils.API_V1 + "archives" + "?page=" + this.data.exhibition.page + "&limit=" + this.data.exhibition.limit + "&type=" + type, function (res) {
console.log(res.data)
wx.hideToast()
wx.hideNavigationBarLoading()
if (type == 'book') {
that.setData({
bookData: that.data.bookData.concat(res.data.results)
})
}else{
that.setData({
contentData: that.data.contentData.concat(res.data.results)
})
}
})
}
,
//以上为scrollview
error: function (e) {
console.log(e)
}
}
)
没有合适的资源?快使用搜索试试~ 我知道了~
微信小程序demo:知亦行(适用1123)(源代码+截图)
共53个文件
js:13个
wxss:11个
json:9个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 156 浏览量
2022-06-19
18:35:38
上传
评论
收藏 56KB ZIP 举报
温馨提示
微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序demo:知亦行(适用1123)(源代码+截图)微信小程序de
资源推荐
资源详情
资源评论
收起资源包目录
微信小程序demo:知亦行(适用1123)(源代码+截图).zip (53个子文件)
微信小程序demo:知亦行(适用1123)
WechatApp-KnowWhere-master
utils
apiUtils.js 3KB
util.js 460B
constant.js 158B
config.js 61B
app.wxss 203B
app.js 719B
pages
detail
index.wxml 25B
index.js 14B
index.wxss 61B
index.json 2B
index
index.wxml 7KB
index.js 5KB
index.wxss 915B
index.json 2B
.DS_Store 6KB
setting
index.wxml 0B
index.js 446B
index.wxss 0B
index.json 2B
main_page
content
index.wxml 0B
index.js 467B
index.wxss 0B
index.json 2B
exhibition
index.wxml 0B
index.js 470B
index.wxss 0B
index.json 2B
book
index.wxml 0B
index.js 463B
index.wxss 0B
index.json 29B
.DS_Store 6KB
zhanxun
index.wxml 0B
index.js 468B
index.wxss 0B
index.json 2B
logs
logs.json 54B
logs.wxml 194B
logs.js 266B
logs.wxss 106B
app.json 1KB
images
time_home.png 1KB
me.png 2KB
tag_exhibition.png 3KB
location_home.png 1KB
shopping.png 2KB
home.png 2KB
photo_home.png 2KB
.DS_Store 6KB
.DS_Store 8KB
style
weui.wxss 21KB
app.wxss 194B
.DS_Store 6KB
共 53 条
- 1
资源评论
荣华富贵8
- 粉丝: 124
- 资源: 7649
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 微软常用运行库 游戏运行库 VC++各个版本
- 微信小程序开发教程.pptx
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- 锐捷网络认证中心网络管理.pdf
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- SD8233LF是一款用于单按键触摸及接近感应开关,其用途是替代传统的机械型开关芯片IC
- 基于YOLOv5的烟雾火焰检测算法研究
- 基于STM32的联合调试侦听设备解决方案原理图PCB源文件调试工具视频(大赛作品)
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功