Skip to content

Commit

Permalink
deleteEle
Browse files Browse the repository at this point in the history
  • Loading branch information
yucccc committed Jul 10, 2017
1 parent 21b392a commit b990038
Show file tree
Hide file tree
Showing 81 changed files with 150 additions and 55,407 deletions.
605 changes: 0 additions & 605 deletions element-variables.css

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
},
"dependencies": {
"axios": "^0.16.2",
"element-ui": "^1.3.7",
"vue": "^2.3.3",
"vue-cookie": "^1.1.4",
"vue-infinite-scroll": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/style/theme.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 主色
$main-col: #f10215;
$main-col: #5079d9;
// 头部
$head-col: #e3e4e5;
// 字体颜色
Expand Down
95 changes: 95 additions & 0 deletions src/components/YButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<template>
<button :class="classStyle" @click="btnClick" :disabled="classStyle==='disabled-btn'">
<span>{{text}}</span>
</button>
</template>
<script>
export default {
props: {
text: {
type: [String, Number],
default: '一颗小按钮'
},
classStyle: {
type: String,
default: 'default-btn'
}
},
methods: {
btnClick () {
this.$emit('btnClick')
}
}
}
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
@import "../assets/style/theme";
%style {
margin: 0 5px;
width: 100px;
height: 30px;
line-height: 28px;
vertical-align: middle;
}
@mixin color($a,$b,$c) {
border: 1px solid $a;
border-radius: 4px;
font-size: 12px;
color: $b;
background-color: $c;
}
button {
display: inline-block;
cursor: pointer;
text-align: center;
> span {
user-select: none;
}
}
/*灰色的按钮*/
.gray-btn {
border: 1px solid #d5d5d5;
color: #646464;
}
// 默认按钮
.default-btn {
@include color(#e1e1e1, #646464, #f9f9f9);
@extend %style;
background-image: -webkit-linear-gradient(top, $cf, #f9f9f9);
background-image: linear-gradient(180deg, $cf, #f9f9f9);
&:hover {
background-color: #eee;
background-image: -webkit-linear-gradient(top, #f5f5f5, #eee);
background-image: linear-gradient(180deg, #f5f5f5, #eee);
}
}
// 主色按钮
.main-btn {
@include color(#5c81e3, #fff, #678ee7);
background-image: -webkit-linear-gradient(top, #678ee7, #5078df);
background-image: linear-gradient(180deg, #678ee7, #5078df);
@extend %style;
&:hover {
background-color: #6c8cd4;
background-image: -webkit-linear-gradient(top, #6c8cd4, #4769c2);
background-image: linear-gradient(180deg, #6c8cd4, #4769c2);
}
}
// 禁用
.disabled-btn {
cursor: not-allowed;
@include color(#afafaf, $cf, #a9a9a9);
@extend %style;
background-image: -webkit-linear-gradient(top, #b8b8b8, #a9a9a9);
background-image: linear-gradient(180deg, #b8b8b8, #a9a9a9);
}
</style>
47 changes: 9 additions & 38 deletions src/components/mallGoods.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<p class="good-title">{{item.productTitle}}</p>
<div class="good-price pr">
<div class="ds pa">
<input type="button" value="查看详情" @click="goodsDetails(item.productId)">
<input type="button" value="加入购物车" @click="addCart(item.productId)">
<y-button text="查看详情" @btnClick="goodsDetails(item.productId)"></y-button>
<y-button text="加入购物车" @btnClick="addCart(item.productId)" classStyle="main-btn"></y-button>
</div>
<p><span style="font-size: 16px">¥</span>
{{item.salePrice}}</p>
Expand All @@ -20,6 +20,7 @@
</div>
</template>
<script>
import YButton from '/components/YButton'
export default {
props: {
msg: {type: [Object, Array]}
Expand Down Expand Up @@ -63,6 +64,9 @@
}).catch(() => {
})
}
},
components: {
YButton
}
}
</script>
Expand All @@ -77,49 +81,17 @@
&:hover {
transform: translateY(-3px);
box-shadow: 1px 1px 20px #999;
input[type='button'] {
display: block;
}
.good-price p {
display: none;
}
.ds {
display: flex;
}
}
.ds {
@extend %block-center;
width: 100%;
}
input[type='button'] {
display: none;
width: 40%;
height: 30px;
line-height: 28px;
border: 1px solid #d5d5d5;
color: #646464;
font-size: 12px;
border-radius: 4px;
cursor: pointer;
font-weight: 200;
background: #fff;
transition: all .1s ease;
&:hover {
background-image: linear-gradient(#f6f6f6, #ededed);
}
}
input:last-child {
background-color: #5c85e5;
background-image: -webkit-linear-gradient(#779ae9, #5078df);
background-image: linear-gradient(#779ae9, #5078df);
border: 1px solid #5c81e3;
color: #fff;
margin-left: 10px;
&:hover {
border: 1px solid #5374c8;
background-color: #5074db;
background-image: -webkit-linear-gradient(#6e8ed5, #4769c2);
background-image: linear-gradient(#6e8ed5, #4769c2);
}
}
.good-img {
Expand All @@ -130,7 +102,6 @@
height: 100%;
display: block;
}
}
.good-price {
margin: 15px 0;
Expand Down
3 changes: 0 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import App from './App'
import router from './router'
import VueLazyload from 'vue-lazyload'
import infiniteScroll from 'vue-infinite-scroll'
import ElementUI from 'element-ui'
import VueCookie from 'vue-cookie'
import '../theme/index.css'
Vue.use(infiniteScroll)
Vue.use(VueCookie)
Vue.use(VueLazyload, {
Expand All @@ -14,7 +12,6 @@ Vue.use(VueLazyload, {
loading: '/static/images/[email protected]'
// attempt: 1
})
Vue.use(ElementUI)
Vue.config.productionTip = false
import store from './store'
/* eslint-disable no-new */
Expand Down
1 change: 1 addition & 0 deletions src/page/Goods/goods.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<script>
import {getComputer} from '/api/goods.js'
import mallGoods from '/components/mallGoods'
export default {
data () {
return {
Expand Down
10 changes: 5 additions & 5 deletions src/page/Home/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<div>
<div class="w">
<div class="shuffling">
<el-carousel height="340px" :interval="5000">
<el-carousel-item v-for="(item,i) in banner.data" :key="i">
<router-link :to="item.href"><img :src="item.src" :alt="item.alt"></router-link>
</el-carousel-item>
</el-carousel>
<!--<el-carousel height="340px" :interval="5000">-->
<!--<el-carousel-item v-for="(item,i) in banner.data" :key="i">-->
<!--<router-link :to="item.href"><img :src="item.src" :alt="item.alt"></router-link>-->
<!--</el-carousel-item>-->
<!--</el-carousel>-->
</div>
<div>
<div><span>秒杀块标题</span><span>时间</span></div>
Expand Down
76 changes: 38 additions & 38 deletions src/page/Login/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,44 +22,44 @@
</div>
</div>
<div style="margin-top: 23px;">
<el-form class="demo-ruleForm">
<el-form-item label="账号" label-width="64px">
<el-input v-model="ruleForm.userName"></el-input>
</el-form-item>
<el-form-item label="密码" prop="pass" label-width="64px">
<el-input type="password" v-model="ruleForm.userPwd"></el-input>
</el-form-item>
</el-form>
<!--<el-form class="demo-ruleForm">-->
<!--<el-form-item label="账号" label-width="64px">-->
<!--<el-input v-model="ruleForm.userName"></el-input>-->
<!--</el-form-item>-->
<!--<el-form-item label="密码" prop="pass" label-width="64px">-->
<!--<el-input type="password" v-model="ruleForm.userPwd"></el-input>-->
<!--</el-form-item>-->
<!--</el-form>-->
</div>
<div class="clickLogin">
<el-button type="primary" @click="login()">登陆</el-button>
<!--<el-button type="primary" @click="login()">登陆</el-button>-->
</div>
</div>
</div>
</div>
<el-button :plain="true"></el-button>
<!--<el-button :plain="true"></el-button>-->
<!--底部-->
<y-footer></y-footer>
</div>
</div>
</template>
<script>
import YFooter from '/common/footer'
import {userLogin} from '/api/index.js'
// import {userLogin} from '/api/index.js'
export default {
data () {
return {
loginWay: 1,
ruleForm: {
userName: '',
userPwd: ''
},
rules: {
userName: [
{required: true, message: '请输入账号', trigger: 'blur'},
{min: 3, max: 12, message: '账号格式错误', trigger: 'blur'}
]
}
// loginWay: 1,
// ruleForm: {
// userName: '',
// userPwd: ''
// },
// rules: {
// userName: [
// {required: true, message: '请输入账号', trigger: 'blur'},
// {min: 3, max: 12, message: '账号格式错误', trigger: 'blur'}
// ]
// }
}
},
computed: {
Expand All @@ -68,22 +68,22 @@
}
},
methods: {
login () {
if (!this.ruleForm.userName || !this.ruleForm.userPwd) {
this.$message.error('账号或者密码不能为空')
return false
}
var params = {userName: this.ruleForm.userName, userPwd: this.ruleForm.userPwd}
userLogin(params).then(res => {
if (res.status === '0') {
// 暂时先存在seetion
sessionStorage.setItem('userMsg', JSON.stringify(res.result))
this.$router.go(-1)
} else {
this.$message.error('账号或者密码错误')
}
})
}
// login () {
// if (!this.ruleForm.userName || !this.ruleForm.userPwd) {
// this.$message.error('账号或者密码不能为空')
// return false
// }
// var params = {userName: this.ruleForm.userName, userPwd: this.ruleForm.userPwd}
// userLogin(params).then(res => {
// if (res.status === '0') {
// // 暂时先存在seetion
// sessionStorage.setItem('userMsg', JSON.stringify(res.result))
// this.$router.go(-1)
// } else {
// this.$message.error('账号或者密码错误')
// }
// })
// }
},
mounted () {
},
Expand Down
2 changes: 1 addition & 1 deletion src/page/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
}
</script>
<style lang="scss" scoped>
<style lang="scss" rel="stylesheet/scss" scoped>
.logo {
background-image: url('/static/images/[email protected]');
background-repeat: no-repeat;
Expand Down
Loading

0 comments on commit b990038

Please sign in to comment.