@@ -13,5 +13,5 @@ module.exports = {
// 提交任务
submitTask: data => request('/v3/task', 'post', data),
// 获取轮播图列表
- getBannerList: data => request(`/v3/column/${data}`, 'get', data),
+ getBannerList: data => request(`/v3/banner/${data}`, 'get', data),
}
@@ -1,5 +1,6 @@
{
"pages": [
+ "pages/works/index",
"pages/index/index",
"pages/collection/index",
"pages/personal/index",
@@ -12,8 +13,7 @@
"pages/my/index",
"pages/editUser/index",
"pages/notice/index",
- "pages/follow/index",
- "pages/logs/logs"
+ "pages/follow/index"
],
"tabBar": {
"custom": true,
@@ -24,7 +24,7 @@
"pagePath": "pages/index/index",
"text": "推荐"
}, {
- "pagePath": "pages/logs/logs",
+ "pagePath": "pages/works/index",
"text": "作品"
}]
},
@@ -0,0 +1,29 @@
+import {
+ getBannerList
+} from '~/api/global'
+Component({
+ properties: {
+
+ },
+ data: {
+ bannerList: []
+ lifetimes: {
+ attached() {
+ console.log('111');
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ async getBannerList() {
+ let bannerList = await getBannerList(1)
+ console.log(bannerList);
+ this.setData({
+ bannerList
+ })
+ bannelEvent() {},
+ }
+})
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
+.header {
+ position: relative;
+ .headerBg {
+ position: absolute;
+ z-index: -2;
+ width: 100%;
+ height: 100%;
+ background-color: white;
+ .swiper {
+ margin: 0 auto;
+ width: 710rpx;
+ height: 216rpx;
+ border-radius: 20rpx;
+ overflow: hidden;
+ box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
+ .swiper-item {
+ object-fit: cover;
@@ -0,0 +1,10 @@
+<view class="header">
+ <view class="headerBg"></view>
+ <swiper class="swiper" autoplay circular indicator-dots indicator-active-color="#fff" indicator-color='#ecececa1'>
+ <block wx:for="{{bannerList}}" wx:key="id">
+ <swiper-item bindtap='bannelEvent'>
+ <image src="{{item.icon}}" class="swiper-item" mode="" />
+ </swiper-item>
+ </block>
+ </swiper>
+</view>
@@ -0,0 +1,25 @@
+.header .headerBg {
+.header .swiper {
+.header .swiper .swiper-item {
@@ -25,7 +25,7 @@ Component({
"iconPath": "/static/tj.png",
"selectedIconPath": "/static/tj2.png"
- "pagePath": "/pages/logs/logs",
+ "pagePath": "/pages/works/index",
"text": "作品",
"iconPath": "/static/zp.png",
"selectedIconPath": "/static/zp2.png"
@@ -49,8 +49,8 @@ Page({
})
this.storeBindings.updateStoreBindings()
- // let res = await getBannerList()
- // console.log(res);
+ /* let res = await getBannerList(1)
+ console.log(res); */
loadMore() {
if (this.data.currentType == '1') {
@@ -6,5 +6,4 @@
"navigationStyle": "custom",
"enablePullDownRefresh": false
-
@@ -1,6 +1,6 @@
<navigationBar bind:reload='resetData'></navigationBar>
<view class="recommend">
- <!-- 头部及轮播图 -->
+ <!-- 轮播图 -->
<view class="header">
<view class="headerBg"></view>
<swiper class="swiper" autoplay circular indicator-dots indicator-active-color="#fff" indicator-color='#ecececa1'>
@@ -1,18 +0,0 @@
-// logs.js
-const util = require('../../utils/util.js')
-Page({
- data: {
- logs: []
- },
- onLoad() {
- this.setData({
- logs: (wx.getStorageSync('logs') || []).map(log => {
- return {
- date: util.formatTime(new Date(log)),
- timeStamp: log
- }
- })
-})
@@ -1,4 +0,0 @@
-{
- "navigationBarTitleText": "查看启动日志",
- "usingComponents": {}
-}
@@ -1,6 +0,0 @@
-<!--logs.wxml-->
-<view class="container log-list">
- <block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
- <text class="log-item">{{index + 1}}. {{log.date}}</text>
- </block>
-</view>
@@ -1,8 +0,0 @@
-.log-list {
- display: flex;
- flex-direction: column;
- padding: 40rpx;
-.log-item {
- margin: 10rpx;
@@ -0,0 +1,32 @@
+const app = getApp()
+Page({
+ onShow() {
+ if (typeof this.getTabBar === 'function') {
+ this.getTabBar().setData({
+ selected: 2
+ getApp().callBack = (res) => {
+ * 页面上拉触底事件的处理函数
+ onReachBottom() {
+ * 用户点击右上角分享
+ onShareAppMessage() {
@@ -0,0 +1,8 @@
+ "usingComponents": {
+ "navigationBar": "/components/navigationBar/index",
+ "worksList": "/components/worksList/index",
+ "banner": "/components/banner/index"
+ "navigationStyle": "custom"
@@ -0,0 +1,3 @@
+.worksBox {
@@ -0,0 +1,5 @@
+<navigationBar bind:reload='resetData'></navigationBar>
+<view class="worksBox">
+ <banner />