提交 0692d523 作者: 毛细亚

Merge branch 'release' into 7.2

......@@ -2,72 +2,142 @@
<div class="vipToolsContent">
<div class="gameList">
<!-- VIP 自助工具 暂时不显示 -->
<div class="gameListItemApp rowFlex columnCenter spaceBetween" v-if="false">
<div
class="gameListItemApp rowFlex columnCenter spaceBetween"
v-if="false"
>
<p class="rowFlex columnCenter">
<img src="@/assets/icon/svg/vipIcon.svg" alt="vipIcon" style="width: 16px;height: 16px;margin-right: 5px;">
<img
src="@/assets/icon/svg/vipIcon.svg"
alt="vipIcon"
style="width: 16px; height: 16px; margin-right: 5px"
/>
VIP自助工具
</p>
<el-button size="mini" :disabled="accountSelect == ''" @click="sendVipGift">发送</el-button>
<el-button
size="mini"
:disabled="accountSelect == ''"
@click="sendVipGift"
>发送</el-button
>
</div>
<!-- 自助链接(举报、申诉、礼包申请) -->
<div class="gameListItemApp rowFlex columnCenter spaceBetween">
<p class="rowFlex columnCenter">
<i class="el-icon-s-operation" style="font-size:16px;margin-right:5px;"></i>
<i
class="el-icon-s-operation"
style="font-size: 16px; margin-right: 5px"
></i>
自助链接(举报、申诉、礼包申请)
</p>
<el-button size="mini" :disabled="accountSelect == ''" @click="sendReportLink">发送</el-button>
<el-button
size="mini"
:disabled="accountSelect == ''"
@click="sendReportLink"
>发送</el-button
>
</div>
<!-- 专属种花链接 -->
<div class="gameListItemApp rowFlex columnCenter spaceBetween">
<p class="rowFlex columnCenter">
<i class="el-icon-s-operation" style="font-size:16px;margin-right:5px;"></i>
<i
class="el-icon-s-operation"
style="font-size: 16px; margin-right: 5px"
></i>
专属 H5 链接(种花)
</p>
<el-button size="mini" :disabled="accountSelect == ''" @click="showFlowerLinkDialog">发送</el-button>
<el-button
size="mini"
:disabled="accountSelect == ''"
@click="showFlowerLinkDialog"
>发送</el-button
>
</div>
<div class="rowFlex columnCenter spaceBetween gameCodeTitle" @click="showGameCode = !showGameCode">
<div
class="rowFlex columnCenter spaceBetween gameCodeTitle"
@click="showGameCode = !showGameCode"
>
<p class="rowFlex columnCenter spaceBetween">
<svg-icon icon-class="gift" style="font-size:20px;margin-right: 5px;margin-top: -2px;"></svg-icon>
<svg-icon
icon-class="gift"
style="font-size: 20px; margin-right: 5px; margin-top: -2px"
></svg-icon>
<span class="giftCode">礼包码</span>
</p>
<i :class="showGameCode ? 'el-icon-arrow-right' : 'el-icon-arrow-down'"></i>
<i
:class="showGameCode ? 'el-icon-arrow-right' : 'el-icon-arrow-down'"
></i>
</div>
<el-collapse-transition>
<el-collapse v-show="showGameCode" v-if="giftCodeGame.length > 0" :disabled="disabled" class="giftGameCollapse">
<el-collapse-item v-for="(item, index) in giftCodeGame" :key="index" :title="item.label"
style="margin-bottom: 10px;">
<el-collapse
v-show="showGameCode"
v-if="giftCodeGame.length > 0"
:disabled="disabled"
class="giftGameCollapse"
>
<el-collapse-item
v-for="(item, index) in giftCodeGame"
:key="index"
:title="item.label"
style="margin-bottom: 10px"
>
<div v-if="giftCodeGame.length > 0">
<div v-for="(items, indexs) in item.children" :key="indexs" class="gameListItemChange">
<div
v-for="(items, indexs) in item.children"
:key="indexs"
class="gameListItemChange"
>
<div class="gameListItemApp gameListItemAppAC">
<p v-if="items.gift_package_group_name" class="gameName">{{ items.gift_package_group_name }}</p>
<div class="rowFlex columnCenter spaceBetween" style="margin-left: 20px;">
<p v-if="items.gift_package_group_name" class="gameName">
{{ items.gift_package_group_name }}
</p>
<div
class="rowFlex columnCenter spaceBetween"
style="margin-left: 20px"
>
<p class="rowFlex columnCenter spaceBetween">
<el-popover placement="top" width="300" trigger="hover">
<div>{{ items.name }}</div>
<div slot="reference" class="gameName">{{ items.name }}</div>
<div slot="reference" class="gameName">
{{ items.name }}
</div>
</el-popover>
<el-popover placement="top" trigger="hover">
<div class="contentPopover" v-html="items.content">
</div>
<el-button slot="reference" type="text" size="medium"
style="margin-right: 10px;">礼包内容</el-button>
<div
class="contentPopover"
v-html="items.content"
></div>
<el-button
slot="reference"
type="text"
size="medium"
style="margin-right: 10px"
>礼包内容</el-button
>
</el-popover>
</p>
<el-button size="mini" type="primary" :loading="loading"
@click="sendGameCodeCopyDialog(items)">发送礼包码</el-button>
</div>
<el-button
size="mini"
type="primary"
:loading="loading"
@click="sendGameCodeCopyDialog(items)"
>发送礼包码</el-button
>
</div>
</div>
</div>
<div v-else class="rowFlex allCenter">
暂无游戏
</div>
<div v-else class="rowFlex allCenter">暂无游戏</div>
</el-collapse-item>
</el-collapse>
</el-collapse-transition>
</div>
<giftCodeDialog v-if="dialogVisible" :game-name="game_name" :dialogVisible.sync="dialogVisible"
@result="getGiftCodeSubmit" />
<giftCodeDialog
v-if="dialogVisible"
:game-name="game_name"
:dialogVisible.sync="dialogVisible"
@result="getGiftCodeSubmit"
/>
<!-- 种花链接弹窗 -->
<flowerLinkDialog
v-if="flowerLinkDialogVisible"
......@@ -79,138 +149,138 @@
</div>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
import { passwardEncryption, createVipUrl } from '@/api/game'
import { giftCodeList, sendGiftCode, getZyouAuthLink } from '@/api/works'
import giftCodeDialog from './giftCodeDialog.vue'
import flowerLinkDialog from './flowerLinkDialog.vue'
import { mapState, mapMutations } from "vuex";
import { passwardEncryption, createVipUrl } from "@/api/game";
import { giftCodeList, sendGiftCode, getZyouAuthLink } from "@/api/works";
import giftCodeDialog from "./giftCodeDialog.vue";
import flowerLinkDialog from "./flowerLinkDialog.vue";
export default {
name: 'vipTools',
name: "vipTools",
data() {
return {
disabled: true,
showGameCode: false,
giftCodeGame: [],
dialogVisible: false,
game_name: '',
game_name: "",
flowerLinkDialogVisible: false,
giftCodeForm: {
member_id: '',
username: '',
role_name: '',
role_id: '',
gift_package_id: '',
member_id: "",
username: "",
role_name: "",
role_id: "",
gift_package_id: "",
},
loading: false
}
loading: false,
};
},
components: {
giftCodeDialog,
flowerLinkDialog
flowerLinkDialog,
},
mounted() {
this.requestGiftCode()
this.requestGiftCode();
},
destroyed() {
this.giftCodeForm = {
member_id: '',
username: '',
role_name: '',
role_id: '',
gift_package_id: ''
}
member_id: "",
username: "",
role_name: "",
role_id: "",
gift_package_id: "",
};
},
computed: {
...mapState('game', ['accountSelect', 'bindGameUserList', 'chatUserInfo']),
...mapState('user', ['userid']),
},
props: {
...mapState("game", ["accountSelect", "bindGameUserList", "chatUserInfo"]),
...mapState("user", ["userid"]),
},
props: {},
watch: {
accountSelect(newVal, oldVal) {
if (newVal && newVal !== '' && this.bindGameUserList.length > 0) {
this.disabled = false
if (newVal && newVal !== "" && this.bindGameUserList.length > 0) {
this.disabled = false;
} else {
this.disabled = true
}
this.disabled = true;
}
},
},
methods: {
initGiftCodeForm() {
const username = this.bindGameUserList.find(item => item.member_id === this.accountSelect).username
const username = this.bindGameUserList.find(
(item) => item.member_id === this.accountSelect
).username;
this.giftCodeForm = {
member_id: this.accountSelect,
username: username,
role_name: '',
role_id: '',
gift_package_id: '',
}
role_name: "",
role_id: "",
gift_package_id: "",
};
},
sendVipGift() {
if (this.bindGameUserList.length > 0) {
createVipUrl({ member_id: this.accountSelect }).then(res => {
if (res.data.url && res.data.url != '') {
this.sendChatMessage(res.data.url, 'text')
createVipUrl({ member_id: this.accountSelect }).then((res) => {
if (res.data.url && res.data.url != "") {
this.sendChatMessage(res.data.url, "text");
} else {
this.$message.warning('暂无vip链接')
this.$message.warning("暂无vip链接");
}
})
});
} else {
this.$message.warning('请先关联游戏账号')
this.$message.warning("请先关联游戏账号");
}
},
sendChatMessage(content, type) {
let message = {}
if (type == 'text') {
let message = {};
if (type == "text") {
message = {
msgtype: 'text',
msgtype: "text",
text: {
content: content
content: content,
},
success: (res) => {
console.log(res, '发送文本成功')
console.log(res, "发送文本成功");
},
fail: (err) => {
console.log(err, '发送文本失败')
}
}
} else if (type == 'link') {
console.log(err, "发送文本失败");
},
};
} else if (type == "link") {
message = {
msgtype: 'news',
msgtype: "news",
news: content,
success: (res) => {
console.log(res, '发送 news 成功')
console.log(res, "发送 news 成功");
},
fail: (err) => {
console.log(err, '发送 news 失败')
}
}
} else if (type == 'image') {
console.log(err, "发送 news 失败");
},
};
} else if (type == "image") {
message = {
msgtype: 'image',
msgtype: "image",
image: {
mediaid: content
mediaid: content,
},
success: (res) => {
console.log(res, '发送 image 成功')
console.log(res, "发送 image 成功");
},
fail: (err) => {
console.log(err, '发送 image 失败')
}
}
console.log(err, "发送 image 失败");
},
};
}
console.log(message, '1231')
this.$ww.sendChatMessage(message)
console.log(message, "1231");
this.$ww.sendChatMessage(message);
},
// 显示种花链接弹窗
showFlowerLinkDialog() {
if (this.accountSelect === '') {
this.$message.warning('请先关联游戏账号')
return
if (this.accountSelect === "") {
this.$message.warning("请先关联游戏账号");
return;
}
this.flowerLinkDialogVisible = true
this.flowerLinkDialogVisible = true;
},
// 处理种花链接发送成功
handleFlowerLinkSuccess(url) {
......@@ -221,77 +291,80 @@ export default {
},
// 发送举报申诉自助链接
async sendReportLink() {
const res = await getZyouAuthLink()
const res = await getZyouAuthLink();
if (res.status_code == 1) {
const link = {
title: '服务中心',
imgUrl: 'https://companywxcdn.zwnet.cn/company_wx/service/avatars/20250308/t3zztJ5FMMSnSXRtG3K8X5HaxsZMdk8W1741420608159.jpg',
desc: '点击此处提交申请',
link: res.data.url
}
this.sendChatMessage(link, 'link')
title: "服务中心",
imgUrl:
"https://companywxcdn.zwnet.cn/company_wx/service/avatars/20250308/t3zztJ5FMMSnSXRtG3K8X5HaxsZMdk8W1741420608159.jpg",
desc: "点击此处提交申请",
link: res.data.url,
};
this.sendChatMessage(link, "link");
} else {
this.$message.warning('暂无申诉自助链接')
this.$message.warning("暂无申诉自助链接");
}
},
async requestGiftCode() {
this.giftCodeGame = []
this.giftCodeGame = [];
// 1 企微 2 微信
const data = {
userid: this.userid,
user_type: 1
}
const res = await giftCodeList(data)
user_type: 1,
};
const res = await giftCodeList(data);
if (res.status_code == 1 && res.data.length > 0) {
// this.giftCodeGame = res.data
this.handleChildren(res.data)
this.giftCodeGame = res.data
this.handleChildren(res.data);
this.giftCodeGame = res.data;
} else {
this.giftCodeGame = {
label: '礼包码',
children: []
}
label: "礼包码",
children: [],
};
}
},
handleChildren(list) {
list.map(item => {
item.main_game_id?item.label = item.main_game_name + '/' + item.main_game_id:item.label = item.main_game_name
item.value = item.main_game_id
item.children = item.gift_package_list
item.group_name = item.gift_package_group_name
})
list.map((item) => {
item.main_game_id
? (item.label = item.main_game_name + "/" + item.main_game_id)
: (item.label = item.main_game_name);
item.value = item.main_game_id;
item.children = item.gift_package_list;
item.group_name = item.gift_package_group_name;
});
},
// 确定提交
getGiftCodeSubmit(form) {
const { member_id, role_id, username, role_name } = form
this.giftCodeForm.username = username
this.giftCodeForm.role_name = role_name
this.giftCodeForm.member_id = member_id
this.giftCodeForm.role_id = role_id
this.sendGameCode()
const { member_id, role_id, username, role_name } = form;
this.giftCodeForm.username = username;
this.giftCodeForm.role_name = role_name;
this.giftCodeForm.member_id = member_id;
this.giftCodeForm.role_id = role_id;
this.sendGameCode();
},
sendGameCodeCopyDialog(items) {
if (items.package_type !== 1 && items.package_type!==4) {
if (items.package_type !== 1 && items.package_type !== 4) {
if (this.accountSelect && this.bindGameUserList.length > 0) {
this.game_name = items.name
this.initGiftCodeForm()
this.giftCodeForm.gift_package_id = items.id
this.game_name = items.name;
this.initGiftCodeForm();
this.giftCodeForm.gift_package_id = items.id;
if (items.package_type == 3) {
this.dialogVisible = true
this.dialogVisible = true;
} else {
this.sendGameCode()
this.sendGameCode();
}
} else {
this.$message.warning('请先关联游戏账号')
this.$message.warning("请先关联游戏账号");
}
} else {
this.giftCodeForm.gift_package_id = items.id
this.sendGameCode()
this.giftCodeForm.gift_package_id = items.id;
this.sendGameCode();
}
},
// 发送礼包码
async sendGameCode(items) {
this.loading = true
this.loading = true;
const data = {
userid: this.chatUserInfo.userid,
external_userid: this.chatUserInfo.external_userid,
......@@ -300,58 +373,64 @@ export default {
role_name: this.giftCodeForm.role_name,
role_id: this.giftCodeForm.role_id,
gift_package_id: this.giftCodeForm.gift_package_id,
user_type: 3
}
const res = await sendGiftCode(data)
user_type: 3,
};
const res = await sendGiftCode(data);
if (res.status_code === 1) {
this.$message.success('发送成功')
this.sendChatMessage(res.data, 'text')
this.$message.success("发送成功");
this.sendChatMessage(res.data, "text");
} else {
this.$message.error(res.msg || '发送失败')
this.$message.error(res.msg || "发送失败");
}
this.loading = false
this.loading = false;
},
handleAccount() {
if (this.bindGameUserList.length > 0) {
const account = this.bindGameUserList.find(item => item.member_id == this.accountSelect)
const account = this.bindGameUserList.find(
(item) => item.member_id == this.accountSelect
);
if (account) {
return true
return true;
} else {
return false
return false;
}
} else {
return false
return false;
}
},
sendMessage(item, type) {
const result = this.handleAccount()
const result = this.handleAccount();
if (!result) {
this.$message.warning('请稍后再试')
return false
this.$message.warning("请稍后再试");
return false;
}
let str = ''
let str = "";
if (type == 2) {
str = '网页游戏链接:'
str = "网页游戏链接:";
} else if (type == 3) {
str = '安卓游戏链接:'
str = "安卓游戏链接:";
} else if (type == 4) {
str = 'IOS游戏链接:'
str = "IOS游戏链接:";
} else {
}
const username = this.bindGameUserList.find(item => item.member_id == this.accountSelect).username
passwardEncryption({ member_id: this.accountSelect }).then(res => {
this.sendChatMessage(`${str}${item.url} \n账号:${username} \n密码:${res.data.password}`, 'text')
}).catch(err => {
this.sendChatMessage(`${str}${item.url} \n账号:${username}`, 'text')
console.log(err)
const username = this.bindGameUserList.find(
(item) => item.member_id == this.accountSelect
).username;
passwardEncryption({ member_id: this.accountSelect })
.then((res) => {
this.sendChatMessage(
`${str}${item.url} \n账号:${username} \n密码:${res.data.password}`,
"text"
);
})
.catch((err) => {
this.sendChatMessage(`${str}${item.url} \n账号:${username}`, "text");
console.log(err);
});
},
showPopover() {
}
}
}
showPopover() {},
},
};
</script>
<style lang="scss" scoped>
.vipToolsContent {
......@@ -366,7 +445,7 @@ export default {
}
.sendLink:hover {
color: #409EFF;
color: #409eff;
}
.giftGameCollapse {
......@@ -394,7 +473,7 @@ export default {
}
.btnActive {
background: #409EFF;
background: #409eff;
color: #fff;
}
}
......
......@@ -17,7 +17,7 @@
<el-collapse v-model="collapseActive">
<div
v-for="(items, indexs) in roleList"
:key="indexs"
:key="items.role_id"
class="contentItem"
>
<div class="title"></div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论