更换版本
This commit is contained in:
34
we7/pages/index/index.js
Normal file
34
we7/pages/index/index.js
Normal file
@@ -0,0 +1,34 @@
|
||||
var e;
|
||||
(e = getApp()),
|
||||
Page({
|
||||
data: { navs: [], slide: [], commend: [], userInfo: {} },
|
||||
onLoad: function () {
|
||||
var a = this;
|
||||
e.util.footer(a),
|
||||
e.util.request({
|
||||
url: "wxapp/home/nav",
|
||||
cachetime: "30",
|
||||
success: function (e) {
|
||||
e.data.message.errno ||
|
||||
(console.log(e.data.message.message),
|
||||
a.setData({ navs: e.data.message.message }));
|
||||
},
|
||||
}),
|
||||
e.util.request({
|
||||
url: "wxapp/home/slide",
|
||||
cachetime: "30",
|
||||
success: function (e) {
|
||||
e.data.message.errno ||
|
||||
a.setData({ slide: e.data.message.message });
|
||||
},
|
||||
}),
|
||||
e.util.request({
|
||||
url: "wxapp/home/commend",
|
||||
cachetime: "30",
|
||||
success: function (e) {
|
||||
e.data.message.errno ||
|
||||
a.setData({ commend: e.data.message.message });
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
28
we7/pages/index/index.wxml
Normal file
28
we7/pages/index/index.wxml
Normal file
@@ -0,0 +1,28 @@
|
||||
<view class="container">
|
||||
<view class="swiper">
|
||||
<swiper autoplay="true" duration="1200" indicatorDots="true" interval="3000">
|
||||
<swiper-item wx:for="{{slide}}" wx:key="{{index}}">
|
||||
<image class="nav-icon" mode="aspectFill" src="{{item.thumb}}"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="nav">
|
||||
<navigator class="nav-item {{(index+1)%3==0?'nav-item-no-border':''}}" hoverClass="navigator-hover" url="{{item.url}}" wx:for="{{navs}}" wx:key="{{index}}">
|
||||
<image class="nav-icon" src="{{item.icon}}"></image>
|
||||
<view class="nav-title">{{item.name}}</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="commend">
|
||||
<block wx:for="{{commend}}" wx:key="{{index}}">
|
||||
<view class="commend-header-title">{{item.name}}</view>
|
||||
<view class="commend-column">
|
||||
<navigator class="commend-item" hoverClass="navigator-hover" wx:for="{{item.article}}" wx:for-item="subItem">
|
||||
<image class="commend-thumb" src="{{subItem.thumb}}"></image>
|
||||
<view class="commend-title">{{subItem.title}}</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<import src="/we7/pages/templates/footer.wxml"></import>
|
||||
<template is="footerWx" data="{{...tabBar}}"></template>
|
74
we7/pages/index/index.wxss
Normal file
74
we7/pages/index/index.wxss
Normal file
@@ -0,0 +1,74 @@
|
||||
.container {
|
||||
background: #e6e6e6;
|
||||
}
|
||||
.nav {
|
||||
background-color: #fff;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
}
|
||||
.nav-item {
|
||||
border: 1px solid #c9c9c9;
|
||||
border-left: none;
|
||||
border-top: none;
|
||||
color: #fff;
|
||||
flex-direction: column;
|
||||
height: 237rpx;
|
||||
text-align: center;
|
||||
width: 248rpx;
|
||||
}
|
||||
.nav-item.nav-item-no-border {
|
||||
border-right: none;
|
||||
}
|
||||
.nav-item .nav-icon {
|
||||
align-items: center;
|
||||
height: 118rpx;
|
||||
margin-top: 38rpx;
|
||||
width: 118rpx;
|
||||
}
|
||||
.commend-item .commend-title,
|
||||
.nav-item .nav-title {
|
||||
color: #000;
|
||||
font-size: 24rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.swiper {
|
||||
height: 350rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.swiper image,
|
||||
.swiper swiper {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.commend {
|
||||
background: #fff;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
.commend .commend-column {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
}
|
||||
.commend .commend-header-title {
|
||||
font-size: 30rpx;
|
||||
line-height: 98rpx;
|
||||
padding-left: 15rpx;
|
||||
text-align: left;
|
||||
}
|
||||
.commend .commend-item {
|
||||
border-right: 1px solid #c9c9c9;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-bottom: 60rpx;
|
||||
width: 372rpx;
|
||||
}
|
||||
.commend .commend-item image {
|
||||
height: 210rpx;
|
||||
width: 100%;
|
||||
}
|
Reference in New Issue
Block a user