|
|
@ -41,6 +41,17 @@ |
|
|
v-hasPermi="['img:inviteLog:delete']" |
|
|
v-hasPermi="['img:inviteLog:delete']" |
|
|
>删除</el-button> |
|
|
>删除</el-button> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
<el-col :span="1.5"> |
|
|
|
|
|
<el-switch |
|
|
|
|
|
v-hasPermi="['img:inviteLog:edit']" |
|
|
|
|
|
v-model="specialInviteCode" |
|
|
|
|
|
active-value="1" |
|
|
|
|
|
inactive-value="0" |
|
|
|
|
|
@change="handleStatus(specialInviteCode)" |
|
|
|
|
|
active-text="开启特约邀请码" |
|
|
|
|
|
inactive-text="关闭特约邀请码"> |
|
|
|
|
|
</el-switch> |
|
|
|
|
|
</el-col> |
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> |
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
@ -98,7 +109,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { listInviteLog, delInviteLog } from "@/api/img/inviteLog"; |
|
|
import { listInviteLog, delInviteLog, getStatus, changeStatus, initStatus } from "@/api/img/inviteLog"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: "InviteLog", |
|
|
name: "InviteLog", |
|
|
@ -117,7 +128,9 @@ export default { |
|
|
// 总条数 |
|
|
// 总条数 |
|
|
total: 0, |
|
|
total: 0, |
|
|
// 邀请记录列表数据 |
|
|
// 邀请记录列表数据 |
|
|
inviteLog: null, |
|
|
inviteLogList: null, |
|
|
|
|
|
//特约邀请码状态 |
|
|
|
|
|
specialInviteCode: "0", |
|
|
//是否显示 |
|
|
//是否显示 |
|
|
isShow: [ |
|
|
isShow: [ |
|
|
{ value: '0', label: '否'}, |
|
|
{ value: '0', label: '否'}, |
|
|
@ -145,8 +158,27 @@ export default { |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
this.getList(); |
|
|
this.getList(); |
|
|
|
|
|
this.getStatus(); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
/**初始化特约邀请码 */ |
|
|
|
|
|
initStatus(){ |
|
|
|
|
|
initStatus().then(res =>{ |
|
|
|
|
|
console.log('初始化特约邀请码成功!') |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
/**获取特约邀请码状态 */ |
|
|
|
|
|
getStatus(){ |
|
|
|
|
|
getStatus().then(res =>{ |
|
|
|
|
|
console.log('状态结果',res) |
|
|
|
|
|
if(res.msg == null){ |
|
|
|
|
|
this.initStatus(); |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.specialInviteCode = res.msg; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
/** 查询类型列表 */ |
|
|
/** 查询类型列表 */ |
|
|
getList() { |
|
|
getList() { |
|
|
this.loading = true; |
|
|
this.loading = true; |
|
|
@ -192,6 +224,21 @@ export default { |
|
|
this.getList(); |
|
|
this.getList(); |
|
|
this.$modal.msgSuccess("删除成功"); |
|
|
this.$modal.msgSuccess("删除成功"); |
|
|
}).catch(() => {}); |
|
|
}).catch(() => {}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/**切换特约邀请码状态 */ |
|
|
|
|
|
handleStatus(row){ |
|
|
|
|
|
let text = row === "1" ? "开启" : "关闭"; |
|
|
|
|
|
this.$modal.confirm('确认要' + text + '特约邀请码吗?').then(function() { |
|
|
|
|
|
let data = { |
|
|
|
|
|
status : row |
|
|
|
|
|
} |
|
|
|
|
|
return changeStatus(data); |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
this.$modal.msgSuccess(text + "成功"); |
|
|
|
|
|
}).catch(function() { |
|
|
|
|
|
row = row === "0" ? "1" : "0"; |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|