vue 下列表侧滑操作实例代码详解

2020-06-13 10:38:26易采站长站整理

if (!this.$store.state.authList['AUT20180705181442eQbFSPyr7HTOKji']) {
this.$store.commit('popSet', {tips: '无权限操作', status: 1, time: 1500});
return;
}
}
this.delActivityAlert = false;
let data = baseAjaxParam(this);
data.activityId = this.currentItem.activityId;
this.$http.jsonp(delActivityApi, {params: data}).then((res) => {
if (res.body.code === 0) {
this.$store.commit('popSet', {tips: '删除动成功', status: 0, time: 1500});
this.getActivityList();
} else {
baseAjaxErr(this, res);
}
}).catch(function (err) {
alert('服务器错误:' + err.status);
console.log(err);
});
},
// 停止活动
stopActivity () {
if (this.$store.state.roleId !== '0' && this.$store.state.roleId !== 'ROL197001010800007e4b5ce2fe28308' && this.$store.state.roleId !== 'ROL197001010800004ca4238a0b92382') {
if (!this.$store.state.authList['AUT20180705181442eQbFSPyr7HTOKji']) {
this.$store.commit('popSet', {tips: '无权限操作', status: 1, time: 1500});
return;
}
}
this.stopActivityAlert = false;
let data = baseAjaxParam(this);
data.activityId = this.currentItem.activityId;
this.$http.jsonp(overActivityApi, {params: data}).then((res) => {
if (res.body.code === 0) {
this.$store.commit('popSet', {tips: '结束活动成功', status: 0, time: 1500});
this.getActivityList();
} else {
baseAjaxErr(this, res);
}
}).catch(function (err) {
alert('服务器错误:' + err.status);
console.log(err);
});
},
// 启用活动
startActivity () {
if (this.$store.state.roleId !== '0' && this.$store.state.roleId !== 'ROL197001010800007e4b5ce2fe28308' && this.$store.state.roleId !== 'ROL197001010800004ca4238a0b92382') {
if (!this.$store.state.authList['AUT20180705181442eQbFSPyr7HTOKji']) {
this.$store.commit('popSet', {tips: '无权限操作', status: 1, time: 1500});
return;
}
}
this.startActivityAlert = false;
let data = baseAjaxParam(this);
data.activityId = this.currentItem.activityId;
this.$http.jsonp(startActivityApi, {params: data}).then((res) => {
if (res.body.code === 0) {
this.$store.commit('popSet', {tips: '启用活动成功', status: 0, time: 1500});
this.getActivityList();
} else {
baseAjaxErr(this, res);
}
}).catch(function (err) {
alert('服务器错误:' + err.status);
console.log(err);
});
},
addAwardActivity () {
if (this.$store.state.roleId !== '0' && this.$store.state.roleId !== 'ROL197001010800007e4b5ce2fe28308' && this.$store.state.roleId !== 'ROL197001010800004ca4238a0b92382') {