|
|
@@ -10,14 +10,14 @@
|
|
|
<i class="iconfont icon-sousuo"></i>
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div class="attention-bus-list">
|
|
|
+ <div class="attention-bus-list" v-if="attentionList.length > 0">
|
|
|
<ul>
|
|
|
- <li v-for="item in attentionList">
|
|
|
+ <li v-for="(item, index) in attentionList" v-bind:key="index">
|
|
|
<div class="item">
|
|
|
<div class="name">
|
|
|
{{ item.nameCn | filterStr}}
|
|
|
</div>
|
|
|
- <div class="attention-button" @click="attentionFn(item)">
|
|
|
+ <div class="attention-button" @click="attentionFn(item, index)">
|
|
|
<i class="iconfont icon-shoucang" :class="{'active': item.status}"></i>
|
|
|
<p v-if="item.status === 1">取消关注</p>
|
|
|
<p v-else>关注</p>
|
|
|
@@ -26,6 +26,11 @@
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
+ <div class="none-state" v-else>
|
|
|
+ <img src="/images/mobile/@2x/search-empty.png">
|
|
|
+ <p>暂无数据</p>
|
|
|
+ <nuxt-link to="/">返回首页</nuxt-link>
|
|
|
+ </div>
|
|
|
<div class="fixedAlert" v-show="isShowAlert">
|
|
|
关注类目,商机无限!
|
|
|
<i class="iconfont icon-guanbi" @click="isShowAlert = false"></i>
|
|
|
@@ -91,25 +96,43 @@
|
|
|
this.attentionList = []
|
|
|
this.getMoreSearch()
|
|
|
},
|
|
|
- attentionFn(item) {
|
|
|
- if (item.status === 1) {
|
|
|
- this.$http.post('/kind/concern', {kindConcern: item, type: 'del'}).then(res => {
|
|
|
+ attentionFn(kindConcern, index) {
|
|
|
+ let param = {
|
|
|
+ date: kindConcern.date,
|
|
|
+ enUU: kindConcern.enUU,
|
|
|
+ nameCn: kindConcern.nameCn,
|
|
|
+ nameEn: kindConcern.nameEn,
|
|
|
+ status: kindConcern.status
|
|
|
+ }
|
|
|
+ if (kindConcern.status === 1) {
|
|
|
+ param.id = kindConcern.id
|
|
|
+ this.$http.post('/produce/kindConcern/modify', param).then(res => {
|
|
|
this.collectResult = '取消成功'
|
|
|
this.timeoutCount++
|
|
|
+ this.attentionList.splice(index, 1)
|
|
|
+ if (this.attentionList.length <= 15 && this.page < this.allPage) {
|
|
|
+ this.page++
|
|
|
+ this.getAttentionListArray(this.page)
|
|
|
+ }
|
|
|
})
|
|
|
} else {
|
|
|
- this.$http.post('/kind/concern', {indConcern: item, type: 'add'}).then(res => {
|
|
|
+ this.$http.post('/produce/kindConcern/modify', param).then(res => {
|
|
|
this.collectResult = '关注成功'
|
|
|
this.timeoutCount++
|
|
|
+ this.attentionList.splice(index, 1)
|
|
|
+ if (this.attentionList.length <= 15 && this.page < this.allPage) {
|
|
|
+ this.page++
|
|
|
+ this.getAttentionListArray(this.page)
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
getAttentionListArray(page) {
|
|
|
this.isSearchSearchingMore = true
|
|
|
if (this.activeType === 'attention') {
|
|
|
- this.$store.dispatch('product/getUserCollectCode', {keyword: this.keyword, count: 10, page: page, type: 'yes', enUU: this.$store.state.option.user.data.enterprise.uu})
|
|
|
+ this.$store.dispatch('product/getUserCollectCode', {keyword: this.keyword, count: 20, page: page, type: 'yes', enUU: this.$store.state.option.user.data.enterprise.uu})
|
|
|
} else {
|
|
|
- this.$store.dispatch('product/getUserCollectCode', {keyword: this.keyword, count: 10, page: page, type: 'no', enUU: this.$store.state.option.user.data.enterprise.uu})
|
|
|
+ this.$store.dispatch('product/getUserCollectCode', {keyword: this.keyword, count: 20, page: page, type: 'no', enUU: this.$store.state.option.user.data.enterprise.uu})
|
|
|
}
|
|
|
},
|
|
|
getMoreSearch() {
|
|
|
@@ -245,5 +268,33 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .none-state{
|
|
|
+ text-align: center;
|
|
|
+ padding:1.5rem 0;
|
|
|
+ background: #fff;
|
|
|
+ margin-top:.1rem;
|
|
|
+ width:100%;
|
|
|
+ img{
|
|
|
+ margin:0 auto;
|
|
|
+ width: 4.08rem;
|
|
|
+ height: 2.62rem;
|
|
|
+ }
|
|
|
+ p {
|
|
|
+ font-size: .32rem;
|
|
|
+ color: #999;
|
|
|
+ margin: 1.19rem 0 0 0;
|
|
|
+ }
|
|
|
+ a {
|
|
|
+ display: block;
|
|
|
+ font-size: .28rem;
|
|
|
+ color: #fff;
|
|
|
+ width: 1.88rem;
|
|
|
+ height: .54rem;
|
|
|
+ line-height: .54rem;
|
|
|
+ background: #418bf6;
|
|
|
+ margin: .7rem auto 0;
|
|
|
+ border-radius: .05rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|