Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
njison committed Jun 28, 2018
2 parents 51bd435 + 83312a2 commit 2c64a25
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 35 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>b2bmall</title>
<link rel="shortcut icon " type="images/x-icon" href="./static/images/img-logo.png">
</head>
<body>
<div id="app"></div>
Expand Down
24 changes: 15 additions & 9 deletions src/common/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<router-link to="/home">
<div class="headerLeft clear-fix">
<div class="logo-box">
<img src="/static/images/CMlogo.png" alt="">
<img src="../../static/images/CMlogo.png" alt="">
</div>
<div class="logo-text">
<h1> 辽宁移动零售库存系统</h1>
Expand Down Expand Up @@ -210,7 +210,13 @@
})
}
},
message (m) {
messageSuccess (m) {
this.$message({
message: m,
type: 'success'
})
},
messageError (m) {
this.$message.error({
message: m
})
Expand Down Expand Up @@ -311,10 +317,10 @@
cartDel(cartDelParams).then(res => {
if (res.code=='success') {
this.message('删除成功!')
this.messageSuccess('删除成功!')
this.EDIT_CART({goodsId})
} else {
this.message('删除失败!')
this.messageError('删除失败!')
}
})
Expand Down Expand Up @@ -533,7 +539,7 @@
/*display: flex;*/
align-items: center;
a {
background: url(/static/images/[email protected]) no-repeat 50%;
background: url(../../static/images/[email protected]) no-repeat 50%;
background-size: cover;
display: block;
@include wh(50px, 40px);
Expand Down Expand Up @@ -645,7 +651,7 @@
left: 8px;
top: 0;
@include wh(20px);
background: url(/static/images/[email protected]) -155px 0;
background: url(../../static/images/[email protected]) -155px 0;
background-size: 240px 107px;
transition: none;
}
Expand Down Expand Up @@ -744,7 +750,7 @@
display: block;
@include wh(30px, 100%);
content: " ";
background: url(/static/images/[email protected]) 0 -22px;
background: url(../../static/images/[email protected]) 0 -22px;
background-size: 240px 107px;
background-position: -150px -22px;
}
Expand Down Expand Up @@ -990,7 +996,7 @@
&:before {
position: absolute;
content: " ";
background: url(/static/images/[email protected]) no-repeat -49px -43px;
background: url(../../static/images/[email protected]) no-repeat -49px -43px;
background-size: 240px 107px;
@include wh(20px, 8px);
top: -8px;
Expand Down Expand Up @@ -1115,7 +1121,7 @@
top: 50%;
width: 76px;
height: 62px;
background: url("/static/images/cart-empty-new.png") no-repeat;
background: url("../../static/images/cart-empty-new.png") no-repeat;
background-size: cover;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/mallGoodsIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</a>
<y-button text="加入购物车"
style="margin: 0 5px"
@btnClick="addCart(msg.goodsId,msg.goodsShipPrice,msg.goodsSettlePrice,msg.goodsRetailPrice,msg.goodsName,msg.url)"
@btnClick="addCart(msg.goodsId,msg.goodsShipPrice,msg.goodsSettlePrice,msg.goodsRetailPrice,msg.goodsName,msg.goodsHostImg)"
classStyle="main-btn"
></y-button>
</div>
Expand Down
42 changes: 20 additions & 22 deletions src/page/Cart/cart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<div class="cart-top-items">
<div class="cart-items clearfix">
<!--勾选-->
<div class="items-choose" @click="editCart('check',item)">
<span class="blue-checkbox-new " v-if="item.checked==0"></span>
<span class="blue-checkbox-new checkbox-on" v-if="item.checked==1"></span>
<div class="items-choose">
<span class="blue-checkbox-new " :class="{'checkbox-on':item.checked === '1'}"
@click="editCart('check',item)"></span>
</div>
<!--图片-->
<div class="items-thumb fl">
Expand Down Expand Up @@ -172,9 +172,9 @@
checkPrice () {
var totalPrice = 0
this.cartList && this.cartList.forEach(item => {
if (item.checked == '1' && this.chanelType===4) {
if (item.checked == '1' && this.chanelType === 4) {
totalPrice += (item.goodsNum * item.goodsShipPrice)
}else if (item.checked == '1' && this.chanelType!=4) {
} else if (item.checked == '1' && this.chanelType != 4) {
totalPrice += (item.goodsNum * item.goodsSettlePrice)
}
})
Expand All @@ -192,7 +192,13 @@
}
},
methods: {
message (m) {
messageSuccess (m) {
this.$message({
message: m,
type: 'success'
})
},
messageError (m) {
this.$message.error({
message: m
})
Expand All @@ -206,9 +212,9 @@
// 全选
editCheckAll () {
let checkAll = !this.checkAllFlag
editCheckAll({userId: this.userId, checked: checkAll}).then(res => {
// editCheckAll({userId: this.userId, checked: checkAll}).then(res => {
this.EDIT_CART({checked: checkAll})
})
// })
},
// 修改购物车
_cartEdit (cartParams, goodsId, goodsNum, checked) {
Expand All @@ -227,21 +233,13 @@
// 修改购物车
editCart (type, item) {
item.checked=!item.checked
if (type && item) {
let checked = item.checked
let goodsId = item.goodsId
let goodsNum = item.goodsNum
// console.log('checked='+ checked)
// 勾选
if (type === 'check') {
let newChecked = ''
if(checked==false){
newChecked ='0'
}else{
newChecked ='1'
}
// let newChecked = checked === '1' ? '0' : '1'
let newChecked = checked === '1' ? '0' : '1'
let cartParams = {
cartDto : {
userId: getStore('userId'),
Expand All @@ -250,8 +248,7 @@
checked: newChecked
}
}
// console.log(newChecked)
this._cartEdit(cartParams, goodsId, goodsNum, checked)
this._cartEdit(cartParams, goodsId, goodsNum, newChecked)
}
} else {
console.log('缺少所需参数')
Expand All @@ -267,6 +264,7 @@
checked: checked
}
}
console.log(checked)
this._cartEdit(cartParams, goodsId, goodsNum, checked)
},
// 删除整条购物车
Expand All @@ -280,9 +278,9 @@
cartDel(cartDelParams).then(res => {
if (res.code=='success') {
this.EDIT_CART({goodsId})
this.message('删除成功!')
this.messageSuccess('删除成功!')
} else {
this.message('删除失败!')
this.messageError('删除失败!')
}
})
Expand Down Expand Up @@ -599,7 +597,7 @@
.cart-e {
margin: 0 auto;
background: url("/static/images/[email protected]") no-repeat;
background: url("../../../static/images/[email protected]") no-repeat;
width: 275px;
height: 300px;
color: #8d8d8d;
Expand Down
2 changes: 1 addition & 1 deletion src/page/Home/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<div class="no-info" v-if="error">
<div class="no-data">
<img src="/static/images/error.png">
<img src="../../../static/images/error.png">
<br> 抱歉!出错了...
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/page/Login/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="wrap">
<div class="header clear-fix">
<div class="logo-box">
<img src="/static/images/CMlogo.png" alt="">
<img src="../../../static/images/CMlogo.png" alt="">
</div>
<div class="logo-text">
<h1> 辽宁移动零售库存系统</h1>
Expand Down
4 changes: 3 additions & 1 deletion src/page/Search/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
<a href="javascript:;" :class="{active:sortType===1}" @click="reset()">综合排序</a>
<a href="javascript:;" @click="sortByPrice(1)" :class="{active:sortType===2}">价格从低到高</a>
<a href="javascript:;" @click="sortByPrice(-1)" :class="{active:sortType===3}">价格从高到低</a>
<a href="javascript:;">销量排行</a>

<!--<div class="price-interval">-->
<!--<input type="number" class="input" placeholder="价格" v-model="min">-->
<!--<span style="margin: 0 5px"> - </span>-->
Expand Down Expand Up @@ -112,7 +114,7 @@
</div>
<div class="no-info" v-if="noResult" >
<div class="no-data">
<img src="/static/images/no-search.png">
<img src="../../../static/images/no-search.png">
<br> 抱歉!没有为您找到相关的商品
</div>
</div>
Expand Down

0 comments on commit 2c64a25

Please sign in to comment.