master
ewall 6 years ago
commit 63f5333fe8

@ -16,6 +16,7 @@
"lib-flexible": "^0.3.2",
"vue": "^2.5.2",
"vue-awesome-swiper": "^3.1.3",
"vue-lazyload": "^1.2.6",
"vue-resource": "^1.5.1",
"vue-router": "^3.0.1"
},

@ -1,41 +0,0 @@
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var app = express();
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter);
app.use('/users', usersRouter);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
});
// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error');
});
module.exports = app;

@ -1,90 +0,0 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('server:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
}

@ -1,16 +0,0 @@
{
"name": "server",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "~4.16.0",
"http-errors": "~1.6.2",
"jade": "~1.11.0",
"morgan": "~1.9.0"
}
}

@ -1,8 +0,0 @@
body {
padding: 50px;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
}
a {
color: #00B7FF;
}

@ -1,9 +0,0 @@
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
module.exports = router;

@ -1,9 +0,0 @@
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res, next) {
res.send('respond with a resource');
});
module.exports = router;

@ -1,6 +0,0 @@
extends layout
block content
h1= message
h2= error.status
pre #{error.stack}

@ -1,5 +0,0 @@
extends layout
block content
h1= title
p Welcome to #{title}

@ -1,7 +0,0 @@
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content

@ -2,17 +2,8 @@
<div class="carousel">
<swiper :options="swiperOption" ref="mySwiper">
<!-- slides -->
<swiper-slide>
<img class="myswiper_img" src="http://a3.vimage1.com/upload/flow/2018/06/21/160/15295761713116.jpg" alt="">
</swiper-slide>
<swiper-slide>
<img class="myswiper_img" src="https://a2.vimage1.com/upload/flow/2018/06/22/40/15296362191561.jpg" alt="">
</swiper-slide>
<swiper-slide>
<img class="myswiper_img" src="https://a3.vimage1.com/upload/flow/2018/06/06/29/15282588215380.jpg" alt="">
</swiper-slide>
<swiper-slide>
<img class="myswiper_img" src="https://a4.vimage1.com/upload/flow/2018/06/21/49/15295697893682.jpg" alt="">
<swiper-slide v-for="(item,index) in swiperData" :key="index">
<img class="myswiper_img" :src="item" alt="">
</swiper-slide>
<!-- Optional controls -->
<div class="swiper-pagination" slot="pagination"></div>
@ -30,6 +21,12 @@ export default {
swiper,
swiperSlide
},
props: {
swiperData: {
type: Array,
default: []
}
},
data() {
return {
swiperOption: {
@ -43,6 +40,9 @@ export default {
}
}
};
},
mounted() {
console.log('111',this.swiperData)
}
};
</script>

@ -1,13 +1,15 @@
import Vue from 'vue'
import App from './App'
import router from './router'
import VueResource from 'vue-resource'
import VueLazyload from 'vue-lazyload'
import 'styles/reset.css'
import 'styles/border.css'
import 'styles/iconfont.css'
import 'lib-flexible/flexible.js'
Vue.use(VueResource)
Vue.use(VueLazyload, {
loading: '/static/images/loading.gif'
})
Vue.config.productionTip = false

@ -1,151 +0,0 @@
<template>
<div class="home">
<my-header></my-header>
<carousel></carousel>
<!-- 分类 -->
<div class="classification">
<div class="class_top">
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/29/106/15275616596915.jpg" alt="">
</div>
<div class="item">
<img src="https://a2.vimage1.com/upload/flow/2018/05/22/138/15269786875124.jpg" alt="">
</div>
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/29/100/15275815231657.jpg" alt="">
</div>
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/22/190/15269788745661.jpg" alt="">
</div>
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/22/110/15269789816830.jpg" alt="">
</div>
</div>
<div class="class_bottom">
<div class="item">
<img src="https://a3.vimage1.com/upload/flow/2018/05/29/40/15275616172415.jpg" alt="">
</div>
<div class="item">
<img src="https://a2.vimage1.com/upload/flow/2018/05/29/139/15275815452999.jpg" alt="">
</div>
<div class="item">
<img src="https://a3.vimage1.com/upload/flow/2018/05/22/163/15269793276446.jpg" alt="">
</div>
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/22/172/15269794028123.jpg" alt="">
</div>
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/22/21/15269794589634.jpg" alt="">
</div>
</div>
</div>
<!-- 推荐 -->
<div class="recommend">
<div class="title">今日推荐</div>
<div class="content">
<div class="item">
<img src="https://b.vimage1.com/upload/mst/2018/06/27/14/9b74b67ad8d6049035e8178f6c17ab70_604x290_80.jpg" alt="">
<div class="item_text">
<span>运动潮人录取线
</span>
<span> 2 </span>
</div>
</div>
<div class="item">
<img src="https://b.vimage1.com/upload/mst/2018/06/26/189/f43d77bad367edf2cd9721601f90df1a_604x290_80.jpg" alt="">
<div class="item_text">
<span>国潮攻心计
</span>
<span> 1 </span>
</div>
</div>
<div class="item">
<img src="https://a.vimage1.com/upcb/2018/06/05/132/ias_152816727785388_604x290_80.jpg" alt="">
<div class="item_text">
<span>欧美品牌女装与美泽美
</span>
<span> 2 </span>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import MyHeader from "@/components/myHeader";
import Carousel from "@/components/carousel";
import axios from 'axios';
export default {
name: "home",
components: {
MyHeader,
Carousel
},
data() {
return {};
},
mounted() {
this.getIndexData();
},
methods: {
getIndexData() {
axios.get("/api/index.json").then(res => {
console.log(res.data);
})
}
}
};
</script>
<style lang="less" scoped>
@import "~styles/variables.less";
.home {
background: #f3f4f5;
//
.classification {
.class_top,
.class_bottom {
display: flex;
flex-direction: row;
justify-content: space-around;
.item {
img {
display: block;
width: 2rem;
height: 2.346667rem;
}
}
}
}
//
.recommend {
.title {
text-align: center;
font-size: 0.373333rem;
padding: 0.266667rem;
background: #fff;
margin: 0.133333rem 0;
}
.content {
.item {
background: #fff;
margin-bottom: .133333rem;
img {
width: 100%;
height: 4.8rem;
display: block;
}
.item_text {
box-sizing: border-box;
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0.133333rem;
font-size: 0.32rem;
}
}
}
}
}
</style>

@ -1,41 +1,17 @@
<template>
<div class="home">
<my-header></my-header>
<carousel></carousel>
<carousel :swiperData='swiperData'></carousel>
<!-- 分类 -->
<div class="classification">
<div class="class_top">
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/29/106/15275616596915.jpg" alt="">
</div>
<div class="item">
<img src="https://a2.vimage1.com/upload/flow/2018/05/22/138/15269786875124.jpg" alt="">
</div>
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/29/100/15275815231657.jpg" alt="">
</div>
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/22/190/15269788745661.jpg" alt="">
</div>
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/22/110/15269789816830.jpg" alt="">
<div class="item" v-for="(item,index) in classifiData.up" :key="index">
<img :src="item" alt="">
</div>
</div>
<div class="class_bottom">
<div class="item">
<img src="https://a3.vimage1.com/upload/flow/2018/05/29/40/15275616172415.jpg" alt="">
</div>
<div class="item">
<img src="https://a2.vimage1.com/upload/flow/2018/05/29/139/15275815452999.jpg" alt="">
</div>
<div class="item">
<img src="https://a3.vimage1.com/upload/flow/2018/05/22/163/15269793276446.jpg" alt="">
</div>
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/22/172/15269794028123.jpg" alt="">
</div>
<div class="item">
<img src="https://a4.vimage1.com/upload/flow/2018/05/22/21/15269794589634.jpg" alt="">
<div class="item" v-for="(item,index) in classifiData.down" :key="index">
<img :src="item" alt="">
</div>
</div>
</div>
@ -43,28 +19,11 @@
<div class="recommend">
<div class="title">今日推荐</div>
<div class="content">
<div class="item">
<img src="https://b.vimage1.com/upload/mst/2018/06/27/14/9b74b67ad8d6049035e8178f6c17ab70_604x290_80.jpg" alt="">
<div class="item" v-for="(item,index) in recommendData" :key="index">
<img v-lazy="item.imgurl" alt="">
<div class="item_text">
<span>运动潮人录取线
</span>
<span> 2 </span>
</div>
</div>
<div class="item">
<img src="https://b.vimage1.com/upload/mst/2018/06/26/189/f43d77bad367edf2cd9721601f90df1a_604x290_80.jpg" alt="">
<div class="item_text">
<span>国潮攻心计
</span>
<span> 1 </span>
</div>
</div>
<div class="item">
<img src="https://a.vimage1.com/upcb/2018/06/05/132/ias_152816727785388_604x290_80.jpg" alt="">
<div class="item_text">
<span>欧美品牌女装与美泽美
</span>
<span> 2 </span>
<span>{{item.title}}</span>
<span> {{item.endtime}} </span>
</div>
</div>
</div>
@ -74,8 +33,7 @@
<script>
import MyHeader from "@/components/myHeader";
import Carousel from "@/components/carousel";
import axios from 'axios';
import axios from "axios";
export default {
name: "home",
components: {
@ -83,7 +41,14 @@ export default {
Carousel
},
data() {
return {};
return {
//
swiperData: [],
//
classifiData: {},
//
recommendData: []
};
},
mounted() {
this.getIndexData();
@ -92,14 +57,16 @@ export default {
getIndexData() {
axios.get("/api/index.json").then(res => {
console.log(res.data);
})
this.swiperData = res.data.swiper;
this.classifiData = res.data.classifiData;
this.recommendData = res.data.recommendData;
});
}
}
};
</script>
<style lang="less" scoped>
@import "~styles/variables.less";
.home {
background: #f3f4f5;
//
@ -130,12 +97,18 @@ export default {
.content {
.item {
background: #fff;
margin-bottom: .133333rem;
margin-bottom: 0.133333rem;
img {
width: 100%;
height: 4.8rem;
display: block;
}
img[lazy="loading"] {
display: block;
width: 50px;
height: 50px;
margin: 0 auto;
}
.item_text {
box-sizing: border-box;
display: flex;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Loading…
Cancel
Save