|
@@ -12,7 +12,6 @@ var vm = new Vue({
|
|
|
return {
|
|
|
sessKey: '$data-collection-index',
|
|
|
powerInfo: {},
|
|
|
- power: false,
|
|
|
powerLoaded: false,
|
|
|
toast: {
|
|
|
show: false,
|
|
@@ -64,11 +63,25 @@ var vm = new Vue({
|
|
|
toastShow: false,
|
|
|
show: false,
|
|
|
currentDelTagInfo: {}, // 当前要删除标签的信息
|
|
|
- }
|
|
|
+ },
|
|
|
+ addTagInfo: {
|
|
|
+ content: ''
|
|
|
+ },
|
|
|
+ powerDialogShow: false,
|
|
|
+ urlFilterTagId: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ power: function () {
|
|
|
+ return this.powerInfo.entniche || this.powerInfo.member || this.powerInfo.vip !== 0
|
|
|
}
|
|
|
},
|
|
|
created: function () {
|
|
|
var _this = this
|
|
|
+ var tag = utils.getParam('tag')
|
|
|
+ if (tag) {
|
|
|
+ this.urlFilterTagId = tag.split(',')
|
|
|
+ }
|
|
|
this.getPower(function () {
|
|
|
if (_this.hasRestoreState()) {
|
|
|
// 等TagList请求完成后在恢复数据
|
|
@@ -81,13 +94,15 @@ var vm = new Vue({
|
|
|
}, 0)
|
|
|
})
|
|
|
} else {
|
|
|
- _this.getTagList()
|
|
|
- _this.getList()
|
|
|
+ _this.getTagList(function () {
|
|
|
+ _this.getList()
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
showToast: function (content, timer, callback) {
|
|
|
+ if (this.toast.show) return
|
|
|
content = content || '暂无数据'
|
|
|
timer = timer || 2000
|
|
|
this.toast.content = content
|
|
@@ -104,7 +119,9 @@ var vm = new Vue({
|
|
|
success: function (res) {
|
|
|
if (res.error_code === 0 && res.data) {
|
|
|
this.powerInfo = res.data
|
|
|
- this.checkPower()
|
|
|
+ if (!this.power) {
|
|
|
+ this.listState.pageSize = 100
|
|
|
+ }
|
|
|
}
|
|
|
}.bind(this),
|
|
|
complete: function () {
|
|
@@ -113,12 +130,6 @@ var vm = new Vue({
|
|
|
}.bind(this)
|
|
|
})
|
|
|
},
|
|
|
- checkPower: function () {
|
|
|
- this.power = this.powerInfo.entniche || this.powerInfo.member || this.powerInfo.vip !== 0
|
|
|
- if (!this.power) {
|
|
|
- this.listState.pageSize = 100
|
|
|
- }
|
|
|
- },
|
|
|
getTagList: function (callback) {
|
|
|
$.ajax({
|
|
|
url: '/publicapply/bidcoll/getLabel',
|
|
@@ -127,6 +138,9 @@ var vm = new Vue({
|
|
|
if (res.error_code === 0) {
|
|
|
this.tagList = res.data || []
|
|
|
this.initSelectTagList()
|
|
|
+ if (this.urlFilterTagId.length) {
|
|
|
+ this.filterState.tags = this.filterState.tags.concat(this.urlFilterTagId)
|
|
|
+ }
|
|
|
callback && callback()
|
|
|
}
|
|
|
}.bind(this)
|
|
@@ -200,6 +214,31 @@ var vm = new Vue({
|
|
|
}.bind(this)
|
|
|
})
|
|
|
},
|
|
|
+ addTagConfirmed: function () {
|
|
|
+ var name = this.addTagInfo.content
|
|
|
+ if (!name) return
|
|
|
+ $.ajax({
|
|
|
+ url: '/publicapply/bidcoll/addLabel',
|
|
|
+ type: 'POST',
|
|
|
+ data: {
|
|
|
+ name: name
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ if (res.error_code === 0 && res.data) {
|
|
|
+ this.addTagInfo.content = ''
|
|
|
+ this.tagList.push({
|
|
|
+ count: 0,
|
|
|
+ lanme: name,
|
|
|
+ lid: res.data
|
|
|
+ })
|
|
|
+ this.initSelectTagList()
|
|
|
+ this.resetListState()
|
|
|
+ } else {
|
|
|
+ this.showToast(res.error_msg)
|
|
|
+ }
|
|
|
+ }.bind(this)
|
|
|
+ })
|
|
|
+ },
|
|
|
resetListState: function () {
|
|
|
var state = {
|
|
|
loaded: false,
|
|
@@ -250,16 +289,29 @@ var vm = new Vue({
|
|
|
this.doQuery()
|
|
|
},
|
|
|
buyerClassFilterChange: function (buyerclass) {
|
|
|
- var buyerclassArr = []
|
|
|
- this.filterState.buyerclassObj = buyerclass
|
|
|
- for (var key in buyerclass) {
|
|
|
- buyerclassArr = buyerclassArr.concat(buyerclass[key])
|
|
|
+ if (this.power) {
|
|
|
+ var buyerclassArr = []
|
|
|
+ this.filterState.buyerclassObj = buyerclass
|
|
|
+ for (var key in buyerclass) {
|
|
|
+ buyerclassArr = buyerclassArr.concat(buyerclass[key])
|
|
|
+ }
|
|
|
+ this.filterState.buyerclass = buyerclassArr
|
|
|
+ this.doQuery()
|
|
|
+ } else {
|
|
|
+ this.$refs.buyerClassFilter.setState()
|
|
|
+ this.filterState.buyerclass = ''
|
|
|
+ this.powerDialogShow = true
|
|
|
}
|
|
|
- this.filterState.buyerclass = buyerclassArr
|
|
|
- this.doQuery()
|
|
|
+
|
|
|
},
|
|
|
otherFilterChange: function (t) {
|
|
|
- this.doQuery()
|
|
|
+ if (this.power) {
|
|
|
+ this.doQuery()
|
|
|
+ } else {
|
|
|
+ this.filterState.buyerPhone = 0
|
|
|
+ this.filterState.winnerPhone = 0
|
|
|
+ this.powerDialogShow = true
|
|
|
+ }
|
|
|
},
|
|
|
changeListType: function (type) {
|
|
|
this.listState.listType = type
|
|
@@ -398,6 +450,9 @@ var vm = new Vue({
|
|
|
openTagDrawer: function () {
|
|
|
this.tagDrawer.show = true
|
|
|
},
|
|
|
+ openVipPage: function () {
|
|
|
+ window.open('/front/subscribe.html')
|
|
|
+ },
|
|
|
drawerConfirm: function () {
|
|
|
this.tagDrawer.show = false
|
|
|
},
|
|
@@ -429,6 +484,7 @@ var vm = new Vue({
|
|
|
setTimeout(function () {
|
|
|
_this.tagDrawer.toastShow = false
|
|
|
_this.getTagList()
|
|
|
+ _this.resetListState()
|
|
|
}, 1500)
|
|
|
}
|
|
|
}
|