|
|
@@ -2,10 +2,10 @@
|
|
|
<div class="right-bar">
|
|
|
<ul class="right-bar-center">
|
|
|
<li class="right-bar-item">
|
|
|
- <nuxt-link to="/user/cart" class="title">
|
|
|
+ <a href="user#/cart" class="title" target="_blank">
|
|
|
<i class="iconfont icon-shopping-cart icon-xlg"></i>
|
|
|
- </nuxt-link>
|
|
|
- <div class="sidebar-menu"><a href="" title="我的购物车" target="_blank">我的购物车<em><span>(<span>10</span>)</span></em></a></div>
|
|
|
+ </a>
|
|
|
+ <div class="sidebar-menu"><a href="user#/cart" title="我的购物车" target="_blank">我的购物车<em><span>(<span v-text="cartCount.count || 0"></span>)</span></em></a></div>
|
|
|
</li>
|
|
|
<li class="right-bar-item">
|
|
|
<a @click="onLeaveMessageClick()" class="title">
|
|
|
@@ -28,10 +28,25 @@
|
|
|
</ul>
|
|
|
<ul class="right-bar-bottom">
|
|
|
<li class="right-bar-item">
|
|
|
- <nuxt-link to="/user/browsingHistory" class="title">
|
|
|
+ <a href="http://www.usoftmall.com/user#/browsingHistory" class="title" target="_blank">
|
|
|
<i class="iconfont icon-zuji icon-xlg"></i>
|
|
|
- </nuxt-link>
|
|
|
- <div class="sidebar-menu"><a href="" title="浏览记录" target="_blank">浏览记录</a></div>
|
|
|
+ </a>
|
|
|
+ <div class="sidebar-menu" v-if="!user.logged"><a href="user#/browsingHistory" title="浏览记录" target="_blank">浏览记录</a></div>
|
|
|
+ <div class="sidebar-menu" v-if="user.logged && listMe(history).length == 0"><a href="user#/browsingHistory" title="浏览记录" target="_blank">浏览记录</a></div>
|
|
|
+ <div class="foot-record sidebar-menu" v-if="user.logged && listMe(history).length > 0">
|
|
|
+ <h3><a href="">浏览历史</a></h3>
|
|
|
+ <dl>
|
|
|
+ <dd v-for="item in listMe(history)">
|
|
|
+ <a :href="'/store/' + item.storeid + '/' + item.batchCode" :title="item.code" v-text="item.code" v-if="item.status== 1"></a>
|
|
|
+ <a :title="item.code" v-text="item.code" v-if="item.status== 0" disabled="disabled"></a>
|
|
|
+ <div class="hover-shows">
|
|
|
+ <em :class="{ 'off' : item.status== 0}"></em>
|
|
|
+ <span :class="{ 'off' : item.status== 0}">失效</span>
|
|
|
+ <a @click="deleteHistory(item,item.id)">×</a>
|
|
|
+ </div>
|
|
|
+ </dd>
|
|
|
+ </dl>
|
|
|
+ </div>
|
|
|
</li>
|
|
|
<li class="right-bar-item">
|
|
|
<a @click="toTop()" class="title">
|
|
|
@@ -47,7 +62,41 @@
|
|
|
|
|
|
export default {
|
|
|
name: 'right-bar',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ historyLength: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ user () {
|
|
|
+ return this.$store.state.option.user
|
|
|
+ },
|
|
|
+ cartCount () {
|
|
|
+ return this.$store.state.user.history.cartCount.data
|
|
|
+ },
|
|
|
+ history () {
|
|
|
+ let arr = this.$store.state.user.history.historyList.data.slice(0, 8)
|
|
|
+ return arr
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.loadHistorys()
|
|
|
+ this.loadCarCount()
|
|
|
+ })
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ listMe: function (list) {
|
|
|
+ return list.filter(function (item) {
|
|
|
+ return item.isDelete === 1
|
|
|
+ })
|
|
|
+ },
|
|
|
+ loadHistorys () {
|
|
|
+ this.$store.dispatch('user/loadHistory')
|
|
|
+ },
|
|
|
+ loadCarCount () {
|
|
|
+ this.$store.dispatch('user/CarCount')
|
|
|
+ },
|
|
|
toTop () {
|
|
|
scrollTo('body', 300)
|
|
|
},
|
|
|
@@ -56,11 +105,18 @@
|
|
|
},
|
|
|
// 打开留言板
|
|
|
onLeaveMessageClick () {
|
|
|
+ },
|
|
|
+ deleteHistory (item, id) {
|
|
|
+ this.$store.dispatch('user/deleteHistory', {id: id})
|
|
|
+ this.loadHistorys()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+ a[disabled] {
|
|
|
+ cursor: not-allowed;
|
|
|
+ }
|
|
|
em,i{
|
|
|
font-style: inherit;
|
|
|
}
|
|
|
@@ -104,6 +160,141 @@
|
|
|
-o-transform: translateX(-72px);
|
|
|
transform: translateX(-72px);
|
|
|
}
|
|
|
+ /*浏览记录*/
|
|
|
+ .right-bar ul li .foot-record{
|
|
|
+ /* display: none; */
|
|
|
+ width: 210px !important;
|
|
|
+ max-height: 230px;
|
|
|
+ line-height: 30px;
|
|
|
+ /* right: 200px;*/
|
|
|
+ top: inherit;
|
|
|
+ bottom: -100%;
|
|
|
+ height: inherit;
|
|
|
+ /*padding-bottom: 10px;*/
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record h3{
|
|
|
+ line-height: 39px;
|
|
|
+ border-bottom: #767575 1px solid;
|
|
|
+ text-align: left;
|
|
|
+ padding-left: 10px;
|
|
|
+ width: 96%;
|
|
|
+ display: inline-block;
|
|
|
+ margin: 0 auto;
|
|
|
+ font-size: 12px;
|
|
|
+ height: 39px;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record h3:hover a{
|
|
|
+ color: #fbb029;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record h3 a{
|
|
|
+ color: #fff;
|
|
|
+ background-color: inherit;
|
|
|
+ line-height: 39px;
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl{
|
|
|
+ padding-top: 5px;
|
|
|
+ display: inline-block;
|
|
|
+ background: #555;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl,.right-bar ul li .foot-record dl dd{
|
|
|
+ width: 100%;
|
|
|
+ margin: 0 auto;
|
|
|
+ background: #555;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd{
|
|
|
+ line-height: 22px;
|
|
|
+ width: 100%;
|
|
|
+ display: inline-block;
|
|
|
+ float: left;
|
|
|
+ height: 22px;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd a{
|
|
|
+ display: inline-block;
|
|
|
+ height: 22px;
|
|
|
+ padding: 0 10px;
|
|
|
+ width: 91%;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #fff;
|
|
|
+ line-height: 22px;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ background: none;
|
|
|
+ text-align: left;
|
|
|
+ padding-right: 44px;
|
|
|
+ }
|
|
|
+ .right-bar ul li li a:hover div.foot-record{
|
|
|
+ display: inline-block !important;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd:hover{
|
|
|
+ background: #fff;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd:hover a{
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd:hover div.hover-shows{
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd div.hover-shows{
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 2px;
|
|
|
+ max-width: 55px;
|
|
|
+ line-height: 20px;
|
|
|
+ padding-right: 0;
|
|
|
+ z-index: 100;
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd div.hover-shows span{
|
|
|
+ display: inline-block;
|
|
|
+ width: 30px;
|
|
|
+ height: 20px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 20px;
|
|
|
+ background: #e04b38;
|
|
|
+ color: #fff;
|
|
|
+ border-radius: 5px;
|
|
|
+ opacity: 0;
|
|
|
+ margin-top: 1px;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd:first-child{
|
|
|
+ /* margin-top: 5px;*/
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd:last-child{
|
|
|
+ /* margin-bottom: 10px;*/
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd div.hover-shows a{
|
|
|
+ font-size: 23px;
|
|
|
+ float: right;
|
|
|
+ width: 20px;
|
|
|
+ padding: 0;
|
|
|
+ text-align: center;
|
|
|
+ color: #999;
|
|
|
+ top: -2px;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd div.hover-shows a:hover{
|
|
|
+ color: #fbb029;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd div.hover-shows em{
|
|
|
+ display: inline-block;
|
|
|
+ position: absolute;
|
|
|
+ width: 0;
|
|
|
+ height: 0;
|
|
|
+ border-top: 8px solid transparent;
|
|
|
+ border-left: 7px solid #fbb029;
|
|
|
+ border-bottom: 8px solid transparent;
|
|
|
+ left: -158px;
|
|
|
+ top: 4px;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd div.hover-shows em.off{
|
|
|
+ border-left: 8px solid #b2b0b0;
|
|
|
+ }
|
|
|
+ .right-bar ul li .foot-record dl dd div.hover-shows span.off{
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ /*浏览记录结束*/
|
|
|
.right-bar ul li .contact-us{
|
|
|
/*right: 200px;*/
|
|
|
height: 180px;
|
|
|
@@ -133,7 +324,7 @@
|
|
|
}
|
|
|
.right-bar-item{
|
|
|
width: 36px;
|
|
|
- height: 38px;
|
|
|
+ /* height: 38px;*/
|
|
|
}
|
|
|
.right-bar .right-bar-item a.title{
|
|
|
display: inline-block;
|
|
|
@@ -162,7 +353,7 @@
|
|
|
.right-bar-bottom {
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
- bottom: 20px;
|
|
|
+ bottom: 0;
|
|
|
width: 36px;
|
|
|
}
|
|
|
|