提交 7df1f826 作者: 施汉文

w账号详情新增字段

上级 082689f6
...@@ -313,22 +313,35 @@ export function corp_follow_up_task_index(data) { ...@@ -313,22 +313,35 @@ export function corp_follow_up_task_index(data) {
return request({ return request({
url: returnApi('/corp_follow_up_task/index'), url: returnApi('/corp_follow_up_task/index'),
method: 'post', method: 'post',
data data,
}) });
} }
// 【智能待办】工作台-我的 // 【智能待办】工作台-我的
export function corpIntelligentTaskMineList(data) { export function corpIntelligentTaskMineList(data) {
return request({ return request({
url: returnApi('/corp_intelligent_task/mineList'), url: returnApi('/corp_intelligent_task/mineList'),
method: 'post', method: 'post',
data data,
}) });
} }
// 【智能待办】工作台-完成、未完成 // 【智能待办】工作台-完成、未完成
export function corpIntelligentTaskExternalList(data) { export function corpIntelligentTaskExternalList(data) {
return request({ return request({
url: returnApi('/corp_intelligent_task/externalList'), url: returnApi('/corp_intelligent_task/externalList'),
method: 'post', method: 'post',
data data,
}) });
}
/**
* 查询会员首次绑定企微微信信息(首次绑定昵称/标识与首次绑定时间)
* @see https://doc.wozhangwan.com/project/514/interface/api/58755
* @param {{ member_id: string|number }} data - 掌游会员 id
* @returns {import('axios').AxiosPromise}
*/
export function getFirstBindExternalUser(data) {
return request({
url: returnApi('/corp_zyou_bind/getFirstBindExternalUser'),
method: 'post',
data,
});
} }
<template> <template>
<el-drawer title="新增关联账号" :visible="show" size="360px" :append-to-body="true" @close="close"> <el-drawer
title="新增关联账号"
:visible="show"
size="360px"
:append-to-body="true"
@close="close"
>
<div class="content-wrapper"> <div class="content-wrapper">
<div class="content"> <div class="content">
<el-form ref="form" :model="form" label-position="top" :rules="rules" label-width="120px"> <el-form
ref="form"
:model="form"
label-position="top"
:rules="rules"
label-width="120px"
>
<div class="inputContent"> <div class="inputContent">
<el-form-item label="请输入w账号" prop="username"> <el-form-item label="请输入w账号" prop="username">
<el-input v-model.trim="form.username" placeholder="请输入w账号" class="input-with-select"> <el-input
v-model.trim="form.username"
placeholder="请输入w账号"
class="input-with-select"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="请输入主游戏名" prop="main_game_id"> <el-form-item label="请输入主游戏名" prop="main_game_id">
<el-select v-model="form.main_game_id" filterable remote clearable reserve-keyword placeholder="请输入主游戏名" <el-select
style="width: 100%;" :remote-method="remoteMethod" :loading="loading" @focus="gameNameList = optionsList"> v-model="form.main_game_id"
<el-option v-for="item in gameNameList" :key="item.value" :label="item.label" :value="item.value"> filterable
remote
clearable
reserve-keyword
placeholder="请输入主游戏名"
style="width: 100%"
:remote-method="remoteMethod"
:loading="loading"
@focus="gameNameList = optionsList"
>
<el-option
v-for="item in gameNameList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="请输入CP角色ID" prop="username">
label="请输入CP角色ID"
prop="username"
>
<el-input <el-input
v-model.trim="form.cp_role_id" v-model.trim="form.cp_role_id"
placeholder="请先选择主游戏" placeholder="请先选择主游戏"
:disabled="form.main_game_id==''" :disabled="form.main_game_id == ''"
class="input-with-select" class="input-with-select"
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="请输入区服" prop="server_info"> <el-form-item label="请输入区服" prop="server_info">
<el-select v-model.trim="form.server_info" filterable remote :disabled="form.main_game_id == ''" clearable <el-select
style="width: 100%;" reserve-keyword placeholder="请先选择主游戏" :remote-method="remoteMethodServer" v-model.trim="form.server_info"
:loading="loading"> filterable
<el-option v-for="item in serverNameList" :key="item.id" :label="item.label" :value="item.value"> remote
:disabled="form.main_game_id == ''"
clearable
style="width: 100%"
reserve-keyword
placeholder="请先选择主游戏"
:remote-method="remoteMethodServer"
:loading="loading"
>
<el-option
v-for="item in serverNameList"
:key="item.id"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="请输入角色名" prop="role_name"> <el-form-item label="请输入角色名" prop="role_name">
<el-input v-model.trim="form.role_name" :disabled="form.main_game_id==''" placeholder="请先选择主游戏" class="input-with-select"> <el-input
v-model.trim="form.role_name"
:disabled="form.main_game_id == ''"
placeholder="请先选择主游戏"
class="input-with-select"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" @click="onSubmit">搜索</el-button> <el-button type="primary" size="small" @click="onSubmit"
>搜索</el-button
>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
<div class="table account_table"> <div class="table account_table">
<div class="bind-account-title"> <div class="bind-account-title">账号列表</div>
账号列表
</div>
<userTable :list="tableList" @checkedTag="checkedTag" /> <userTable :list="tableList" @checkedTag="checkedTag" />
</div> </div>
<!-- <div class="line"></div> w92865226508--> <!-- <div class="line"></div> w92865226508-->
<div v-if="userDetails.username" class="account_select_userInfo"> <div v-if="userDetails.username" class="account_select_userInfo">
<div class="bind-account-title" style="margin-top: 20px;"> <div class="bind-account-title" style="margin-top: 20px">
账号详情 账号详情
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">账号</span> <div class="item rowFlex columnCenter">
<p class="text">{{ userDetails.username }}</p> <span v-if="userDetails.account_type == 2" <span class="label">账号</span>
class="account_type"></span> <p class="text">{{ userDetails.username }}</p>
<span v-if="userDetails.account_type == 2" class="account_type"
></span
>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">获客渠道</span> <div class="item rowFlex columnCenter">
<span class="label">获客渠道</span>
<p class="text">{{ userDetails.channel_name }}</p> <p class="text">{{ userDetails.channel_name }}</p>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">注册渠道</span> <div class="item rowFlex columnCenter">
<span class="label">注册渠道</span>
<p class="text">{{ userDetails.register_channel_name }}</p> <p class="text">{{ userDetails.register_channel_name }}</p>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">运营渠道</span> <div class="item rowFlex columnCenter">
<span class="label">运营渠道</span>
<p class="text">{{ userDetails.operator_channel_name }}</p> <p class="text">{{ userDetails.operator_channel_name }}</p>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">注册游戏</span> <div class="item rowFlex columnCenter">
<span class="label">注册游戏</span>
<p class="text">{{ userDetails.reg_game_name }}</p> <p class="text">{{ userDetails.reg_game_name }}</p>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">主游戏</span> <div class="item rowFlex columnCenter">
<span class="label">主游戏</span>
<p class="text">{{ userDetails.main_game_name }}</p> <p class="text">{{ userDetails.main_game_name }}</p>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">真实姓名</span> <div class="item rowFlex columnCenter">
<span class="label">真实姓名</span>
<p class="text">{{ userDetails.real_name }}</p> <p class="text">{{ userDetails.real_name }}</p>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">手机号</span> <div class="item rowFlex columnCenter">
<span class="label">手机号</span>
<p class="text">{{ userDetails.mobile }}</p> <p class="text">{{ userDetails.mobile }}</p>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">染色时间</span> <div class="item rowFlex columnCenter">
<p class="text">{{ moment(userDetails.seq_time * 1000).format('YYYY-MM-DD') }}</p> <span class="label">染色时间</span>
<p class="text">
{{ moment(userDetails.seq_time * 1000).format('YYYY-MM-DD') }}
</p>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">注册时间</span> <div class="item rowFlex columnCenter">
<p class="text">{{ moment(userDetails.reg_time * 1000).format('YYYY-MM-DD') }}</p> <span class="label">注册时间</span>
<p class="text">
{{ moment(userDetails.reg_time * 1000).format('YYYY-MM-DD') }}
</p>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">登录系统</span> <div class="item rowFlex columnCenter">
<span class="label">登录系统</span>
<p class="text">{{ userDetails.last_login_os }}</p> <p class="text">{{ userDetails.last_login_os }}</p>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">充值金额</span> <div class="item rowFlex columnCenter">
<span class="label">充值金额</span>
<p class="text">{{ userDetails.recharge_total }}</p> <p class="text">{{ userDetails.recharge_total }}</p>
</div> </div>
<div class="item rowFlex columnCenter"><span class="label">是否添加微信</span> <div class="item rowFlex columnCenter">
<span class="label">是否添加微信</span>
<p class="text">{{ userDetails.wechat_add_status_text }}</p> <p class="text">{{ userDetails.wechat_add_status_text }}</p>
</div> </div>
<div class="item rowFlex columnCenter">
<span class="label">首次绑定微信</span>
<p class="text">{{ firstWechatBind?.external_user_name }}</p>
</div> </div>
<div class="item rowFlex columnCenter">
<span class="label">首次绑定时间</span>
<p class="text">{{ firstWechatBind?.bind_time }}</p>
</div> </div>
<page class="pageInfo" :page-info="pageInfo" @requestNextPage="requestNextPage" /> </div>
</div>
<page
class="pageInfo"
:page-info="pageInfo"
@requestNextPage="requestNextPage"
/>
<span class="dialog-footer rowFlex"> <span class="dialog-footer rowFlex">
<el-button class="btn" type="primary" size="small" :disabled="!userDetails.id" @click="confirmSubmit"> <el-button
</el-button> class="btn"
type="primary"
size="small"
:disabled="!userDetails.id"
@click="confirmSubmit"
>确 定</el-button
>
<el-button class="btn" size="small" @click="close">取 消</el-button> <el-button class="btn" size="small" @click="close">取 消</el-button>
</span> </span>
</div> </div>
...@@ -108,17 +193,18 @@ ...@@ -108,17 +193,18 @@
</template> </template>
<script type="text/javascript"> <script type="text/javascript">
import moment from 'moment' import moment from 'moment';
import userTable from './userTable.vue' import userTable from './userTable.vue';
import { getRoleHoLo, memberView, selectSearch } from '@/api/game' import { getRoleHoLo, memberView, selectSearch } from '@/api/game';
import { checkZyouBind,zyouBind } from '@/api/works' import { checkZyouBind, zyouBind } from '@/api/works';
import { mapMutations, mapActions, mapState } from 'vuex' import { mapMutations, mapActions, mapState } from 'vuex';
import page from '@/components/page/pageNum.vue' import { getFirstBindExternalUser } from '@/api/works';
export default { import page from '@/components/page/pageNum.vue';
export default {
name: 'addUser', name: 'addUser',
components: { components: {
userTable, userTable,
page page,
}, },
props: ['show'], props: ['show'],
data() { data() {
...@@ -127,40 +213,39 @@ ...@@ -127,40 +213,39 @@
tableList: [], tableList: [],
checkoutUser: {}, checkoutUser: {},
userDetails: {}, userDetails: {},
firstWechatBind: {},
loading: false, loading: false,
pageInfo: { pageInfo: {
page: 1, page: 1,
page_size: 20, page_size: 20,
total: 0 total: 0,
}, },
form: { form: {
member_id: '', member_id: '',
username: '', username: '',
role_name: '', role_name: '',
cp_role_id:'', cp_role_id: '',
main_game_id: '', main_game_id: '',
server_info: '' server_info: '',
}, },
gameNameList: [], gameNameList: [],
optionsList: [], optionsList: [],
serverNameList: [], serverNameList: [],
rules: {}, rules: {},
} };
}, },
computed: { computed: {
...mapState('game', ['chatUserInfo','userid','external_userid']), ...mapState('game', ['chatUserInfo', 'userid', 'external_userid']),
}, },
watch: { watch: {
show(newVal, oldVal) { show(newVal, oldVal) {
if (newVal) { if (newVal) {
// this.requestRoleList() // this.requestRoleList()
this.requestGameList() this.requestGameList();
}
} }
}, },
mounted() {
}, },
mounted() {},
methods: { methods: {
...mapActions('game', ['gameBindUser']), ...mapActions('game', ['gameBindUser']),
...mapMutations('game', ['set_accountSelect']), ...mapMutations('game', ['set_accountSelect']),
...@@ -169,93 +254,98 @@ ...@@ -169,93 +254,98 @@
member_id: this.form.member_id, member_id: this.form.member_id,
username: this.form.username.trim(), username: this.form.username.trim(),
role_name: this.form.role_name.trim(), role_name: this.form.role_name.trim(),
main_game_id: this.form.main_game_id !== '' ? [this.form.main_game_id] : [], main_game_id:
zyou_server_id: this.form.server_info !== '' ? [this.form.server_info] : [], this.form.main_game_id !== '' ? [this.form.main_game_id] : [],
zyou_server_id:
this.form.server_info !== '' ? [this.form.server_info] : [],
cp_role_id: this.form.cp_role_id.trim() || '', cp_role_id: this.form.cp_role_id.trim() || '',
search_type: 'bind', search_type: 'bind',
...this.pageInfo ...this.pageInfo,
} };
getRoleHoLo(data).then(res => { getRoleHoLo(data).then((res) => {
if (res.status_code == 1) { if (res.status_code == 1) {
if (res.data.data.length == 0) { if (res.data.data.length == 0) {
this.tableList = [] this.tableList = [];
this.$message.warning('暂无数据') this.$message.warning('暂无数据');
} else { } else {
this.tableList = res.data.data this.tableList = res.data.data;
this.pageInfo = res.data.page_info this.pageInfo = res.data.page_info;
} }
} }
}) });
}, },
// S181.啊呸¤可瑞 八荒181服 // S181.啊呸¤可瑞 八荒181服
// 分页 // 分页
requestNextPage(pageInfo) { requestNextPage(pageInfo) {
this.pageInfo.page = pageInfo.page this.pageInfo.page = pageInfo.page;
this.requestRoleList() this.requestRoleList();
}, },
remoteMethodServer(query) { remoteMethodServer(query) {
if (query !== '') { if (query !== '') {
this.loading = true this.loading = true;
const data = { const data = {
type: 'server_info', type: 'server_info',
value: query, value: query,
main_game_ids: this.form.main_game_id main_game_ids: this.form.main_game_id,
} };
selectSearch(data).then(res => { selectSearch(data).then((res) => {
this.loading = false this.loading = false;
if (res.status_code == 1) { if (res.status_code == 1) {
this.serverNameList = res.data.data this.serverNameList = res.data.data;
} }
}) });
} }
}, },
remoteMethod(query) { remoteMethod(query) {
if (query !== '') { if (query !== '') {
this.gameNameList = this.optionsList.filter(item => { this.gameNameList = this.optionsList.filter((item) => {
return item.label.toLowerCase() return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1;
.indexOf(query.toLowerCase()) > -1 });
})
} else { } else {
this.gameNameList = [] this.gameNameList = [];
} }
}, },
requestGameList() { requestGameList() {
const data = { const data = {
type: 'mainGameList', type: 'mainGameList',
value: '', value: '',
weixin_blong_id: '' weixin_blong_id: '',
} };
selectSearch(data).then(res => { selectSearch(data).then((res) => {
this.loading = false this.loading = false;
if (res.status_code == 1) { if (res.status_code == 1) {
this.gameNameList = this.optionsList = res.data.data this.gameNameList = this.optionsList = res.data.data;
} }
}) });
}, },
close() { close() {
this.$emit('update:show', false) this.$emit('update:show', false);
this.resizeData() this.resizeData();
this.$emit('close') this.$emit('close');
}, },
onSubmit() { onSubmit() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
this.pageInfo = { this.pageInfo = {
page: 1, page: 1,
page_size: 20, page_size: 20,
total: 0 total: 0,
} };
if (valid) { if (valid) {
if (this.form.role_name == '' && this.form.username == '' && this.form.cp_role_id == '') { if (
this.$message.warning('请输入角色名或者w账号或者CP角色ID') this.form.role_name == '' &&
return this.form.username == '' &&
} this.form.cp_role_id == ''
this.requestRoleList() ) {
this.$message.warning('请输入角色名或者w账号或者CP角色ID');
return;
}
this.requestRoleList();
} else { } else {
console.log('error submit!!') console.log('error submit!!');
return false return false;
} }
}) });
}, },
resizeData() { resizeData() {
this.form = { this.form = {
...@@ -264,90 +354,135 @@ ...@@ -264,90 +354,135 @@
role_name: '', role_name: '',
cp_role_id: '', cp_role_id: '',
main_game_id: '', main_game_id: '',
server_info: '' server_info: '',
};
this.tableList = [];
this.checkoutUser = {};
this.userDetails = {};
this.firstWechatBind = {};
},
/**
* 拉取当前选中会员的首次绑定微信信息;仅在表格勾选 w 账号并成功返回 memberView 后调用(见 rquestUserInfo)。
* 快速切换用户时用 member_id 比对,避免旧请求覆盖新数据。
* @param {string|number|undefined} memberId - 会员 id,与 userDetails.id 一致
*/
requestFirstWechatBind(memberId) {
if (!memberId) {
this.firstWechatBind = {};
return;
}
const reqMemberId = memberId;
getFirstBindExternalUser({ member_id: memberId })
.then((res) => {
if (reqMemberId !== this.userDetails.id) return;
if (res.status_code === 1 && res.data) {
this.firstWechatBind = res.data;
} else {
this.firstWechatBind = {};
}
})
.catch(() => {
if (reqMemberId === this.userDetails.id) {
this.firstWechatBind = {};
} }
this.tableList = [] });
this.checkoutUser = {}
this.userDetails = {}
}, },
confirmSubmit() { confirmSubmit() {
const data = { const data = {
member_id: this.userDetails.id && this.userDetails.id != '' ? this.userDetails.id : this.checkoutUser.member_id, member_id:
username: this.userDetails.username this.userDetails.id && this.userDetails.id != ''
} ? this.userDetails.id
checkZyouBind(data).then(res => { : this.checkoutUser.member_id,
console.log(data) username: this.userDetails.username,
};
checkZyouBind(data).then((res) => {
console.log(data);
if (!res.data.has_bind) { if (!res.data.has_bind) {
this.submit() this.submit();
} else { } else {
this.$confirm(res.data.tip || '', { this.$confirm(res.data.tip || '', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning',
}) })
.then(() => { .then(() => {
this.submit() this.submit();
}) })
.catch((err) => { .catch((err) => {
console.log(err) console.log(err);
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除',
}) });
}) });
} }
}) });
}, },
submit() { submit() {
const data = { const data = {
userid: this.userid || this.chatUserInfo.userid , userid: this.userid || this.chatUserInfo.userid,
external_userid:this.external_userid || this.chatUserInfo.external_userid , external_userid:
member_id: this.userDetails.id && this.userDetails.id != '' ? this.userDetails.id : this.checkoutUser.member_id, this.external_userid || this.chatUserInfo.external_userid,
member_id:
this.userDetails.id && this.userDetails.id != ''
? this.userDetails.id
: this.checkoutUser.member_id,
username: this.userDetails.username, username: this.userDetails.username,
reg_game_id: this.userDetails.reg_game_id, reg_game_id: this.userDetails.reg_game_id,
main_game_id: this.userDetails.main_game_id, main_game_id: this.userDetails.main_game_id,
recharge_total: this.userDetails.recharge_total, recharge_total: this.userDetails.recharge_total,
} };
console.log(this.chatUserInfo,'this.chatUserInfo',this.userid,this.external_userid) console.log(
this.chatUserInfo,
'this.chatUserInfo',
this.userid,
this.external_userid,
);
// 绑定掌游账号 // 绑定掌游账号
zyouBind(data).then(res => { zyouBind(data).then((res) => {
if (res.status_code == 1) { if (res.status_code == 1) {
this.$message.success(res.msg) this.$message.success(res.msg);
this.updateData() this.updateData();
} }
}) });
}, },
// 更新列表数据 // 更新列表数据
updateData() { updateData() {
const data = { const data = {
userid: this.chatUserInfo.userid, userid: this.chatUserInfo.userid,
external_userid: this.chatUserInfo.external_userid external_userid: this.chatUserInfo.external_userid,
} };
this.gameBindUser(data).then(res => { this.gameBindUser(data).then((res) => {
this.set_accountSelect(this.userDetails.id) this.set_accountSelect(this.userDetails.id);
this.close() this.close();
}) });
}, },
// 勾选活码 // 勾选活码
checkedTag(value) { checkedTag(value) {
this.checkoutUser = value this.checkoutUser = value;
const data = { const data = {
member_id: value.member_id, member_id: value.member_id,
need_channel: 1, need_channel: 1,
need_roleInfo: 1 need_roleInfo: 1,
} };
this.rquestUserInfo(data) this.rquestUserInfo(data);
}, },
rquestUserInfo(data) { rquestUserInfo(data) {
memberView(data).then(res => { memberView(data).then((res) => {
if (res.status_code == 1) { if (res.status_code == 1) {
this.userDetails = res.data this.userDetails = res.data;
} const memberId = res.data.id ?? res.data.member_id ?? data.member_id;
}) if (memberId) {
} this.requestFirstWechatBind(memberId);
} else {
this.firstWechatBind = {};
} }
} }
</script> });
},
},
};
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .el-drawer { ::v-deep .el-drawer {
...@@ -428,7 +563,6 @@ ...@@ -428,7 +563,6 @@
} }
} }
} }
} }
.account_table { .account_table {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论