提交 ef9aa8ce 作者: 施汉文

同步pc修改转端筛选

上级 d631131e
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
:key="indexs" :key="indexs"
class="gameListItem rowFlex columnCenter spaceBetween" class="gameListItem rowFlex columnCenter spaceBetween"
> >
<p>{{ items.game_name + "/" + items.game_id }}</p> <p>{{ items.game_name + '/' + items.game_id }}</p>
<el-popover placement="top" width="160" trigger="hover"> <el-popover placement="top" width="160" trigger="hover">
<div> <div>
<p <p
...@@ -99,9 +99,24 @@ ...@@ -99,9 +99,24 @@
</p> </p>
<!-- h5 安卓游戏 IOS游戏 发送分身包 --> <!-- h5 安卓游戏 IOS游戏 发送分身包 -->
<div v-if="[2].includes(item.game_type)"> <div v-if="[2].includes(item.game_type)">
<p class="sendLink" @click="sendTransferCloneGame(2,items)">发送分身包-H5</p> <p
<p class="sendLink" @click="sendTransferCloneGame(3,items)">发送分身包-安卓</p> class="sendLink"
<p class="sendLink" @click="sendTransferCloneGame(4,items)">发送分身包-IOS</p> @click="sendTransferCloneGame(2, items)"
>
发送分身包-H5
</p>
<p
class="sendLink"
@click="sendTransferCloneGame(3, items)"
>
发送分身包-安卓
</p>
<p
class="sendLink"
@click="sendTransferCloneGame(4, items)"
>
发送分身包-IOS
</p>
</div> </div>
</div> </div>
<el-button <el-button
...@@ -179,7 +194,7 @@ ...@@ -179,7 +194,7 @@
:key="indexs" :key="indexs"
class="gameListItem rowFlex columnCenter spaceBetween" class="gameListItem rowFlex columnCenter spaceBetween"
> >
<p>{{ items.game_name + "/" + items.game_id }}</p> <p>{{ items.game_name + '/' + items.game_id }}</p>
<el-button <el-button
slot="reference" slot="reference"
size="mini" size="mini"
...@@ -282,27 +297,67 @@ ...@@ -282,27 +297,67 @@
:key="indexs" :key="indexs"
class="gameListItem rowFlex columnCenter spaceBetween" class="gameListItem rowFlex columnCenter spaceBetween"
> >
<p>{{ items.label + "/" + items.id }}</p> <p>{{ items.label + '/' + items.id }}</p>
<!--game_type: 1 微信小游戏 2 H5 游戏 3 安卓游戏 4 IOS 游戏 5 抖音小游戏 --> <!--game_type: 1 微信小游戏 2 H5 游戏 3 安卓游戏 4 IOS 游戏 5 抖音小游戏 -->
<!-- 微信小游戏 安卓游戏 IOS游戏 处理逻辑 --> <!-- 微信小游戏 安卓游戏 IOS游戏 处理逻辑 -->
<el-popover v-if="items.game_type == 1 || items.game_type == 3 || items.game_type == 4 || items.game_type == 5" placement="top" trigger="click"> <el-popover
<div v-if="items.game_type!=5"> v-if="
<p class="sendLink" @click="sendChannelGame(items, item)">发送链接/渠道二维码</p> items.game_type == 1 ||
<p class="sendLink" @click="handleGameType(items, item, item.game_type, index)">发送落地页</p> items.game_type == 3 ||
items.game_type == 4 ||
items.game_type == 5
"
placement="top"
trigger="click"
>
<div v-if="items.game_type != 5">
<p class="sendLink" @click="sendChannelGame(items, item)">
发送链接/渠道二维码
</p>
<p
class="sendLink"
@click="
handleGameType(items, item, item.game_type, index)
"
>
发送落地页
</p>
<div v-if="items.game_type == 1"> <div v-if="items.game_type == 1">
<!-- 发送 H5 安卓分身包 --> <!-- 发送 H5 安卓分身包 -->
<p class="sendLink" @click="sendH5CloneGame(items, 'android')">发送H5-安卓分身包</p> <p
<!-- 发送 H5 IOS 分身包 --> class="sendLink"
<p class="sendLink" @click="sendH5CloneGame(items, 'ios')">发送H5-IOS分身包</p> @click="sendH5CloneGame(items, 'android')"
</div> >
</div> 发送H5-安卓分身包
<!-- 抖音小游戏发送落地页 --> </p>
<div v-else> <!-- 发送 H5 IOS 分身包 -->
<p class="sendLink" @click="handleGameType(items, item, item.game_type, index)">发送落地页</p> <p
class="sendLink"
@click="sendH5CloneGame(items, 'ios')"
>
发送H5-IOS分身包
</p>
</div> </div>
<el-button slot="reference" size="mini" :disabled="accountSelect == ''">发送</el-button> </div>
</el-popover> <!-- 抖音小游戏发送落地页 -->
<div v-else>
<p
class="sendLink"
@click="
handleGameType(items, item, item.game_type, index)
"
>
发送落地页
</p>
</div>
<el-button
slot="reference"
size="mini"
:disabled="accountSelect == ''"
>发送</el-button
>
</el-popover>
<el-button <el-button
v-else v-else
size="mini" size="mini"
...@@ -393,7 +448,7 @@ ...@@ -393,7 +448,7 @@
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapMutations, mapActions } from "vuex"; import { mapState, mapMutations, mapActions } from 'vuex';
import { import {
memberExtensionGameList, memberExtensionGameList,
passwardEncryption, passwardEncryption,
...@@ -407,8 +462,8 @@ import { ...@@ -407,8 +462,8 @@ import {
getClonePackageLink, getClonePackageLink,
getLandingPageConfig, getLandingPageConfig,
getMemberTransStatus, getMemberTransStatus,
memberRegGameCloneLink memberRegGameCloneLink,
} from "@/api/game"; } from '@/api/game';
import { import {
getRecentSendLog, getRecentSendLog,
markTransScene, markTransScene,
...@@ -416,20 +471,20 @@ import { ...@@ -416,20 +471,20 @@ import {
getZqCserWxBelong, getZqCserWxBelong,
getMediaId, getMediaId,
send_log_add, send_log_add,
} from "@/api/works"; } from '@/api/works';
import { companyviewConfig } from "@/api/user"; import { companyviewConfig } from '@/api/user';
import { throttle, throttleStart } from "@/utils/index"; import { throttle, throttleStart } from '@/utils/index';
import createChannel from "./sendGame/createChannel"; import createChannel from './sendGame/createChannel';
import sendPage from "./sendGame/SendTransPage.vue"; import sendPage from './sendGame/SendTransPage.vue';
import SendTransWxGame from "./sendGame/SendTransWxGame.vue"; import SendTransWxGame from './sendGame/SendTransWxGame.vue';
import SendTransAppGame from "./sendGame/SendTransAppGame.vue"; import SendTransAppGame from './sendGame/SendTransAppGame.vue';
import selectChannel from "./sendGame/selectChannel.vue"; import selectChannel from './sendGame/selectChannel.vue';
import sendSelectChannel from "./sendGame/sendSelectChannel.vue"; import sendSelectChannel from './sendGame/sendSelectChannel.vue';
import gameLogMixin from "@/mixins/gameLogMixin"; import gameLogMixin from '@/mixins/gameLogMixin';
import { sendChatMessage } from "@/utils/index"; import { sendChatMessage } from '@/utils/index';
import QrcodeVue from "qrcode.vue"; import QrcodeVue from 'qrcode.vue';
export default { export default {
name: "sendGame", name: 'sendGame',
mixins: [gameLogMixin], mixins: [gameLogMixin],
components: { components: {
createChannel, createChannel,
...@@ -453,15 +508,15 @@ export default { ...@@ -453,15 +508,15 @@ export default {
weixin_blongs_id: [], weixin_blongs_id: [],
regGameList: [], regGameList: [],
allRegGameList: [], allRegGameList: [],
filterGameText: "", filterGameText: '',
channelselectList: [], channelselectList: [],
webForm: { webForm: {
channel_id: "", channel_id: '',
}, },
sendLoading: false, sendLoading: false,
belongList: [], // 项目列表 belongList: [], // 项目列表
activeName: "1", // 转端 1 转游 2 召回 3 activeName: '1', // 转端 1 转游 2 召回 3
sendType: "", // 1 进发送链接 2 仅发送账号密码 3 发送链接和账号密码 sendType: '', // 1 进发送链接 2 仅发送账号密码 3 发送链接和账号密码
showCreateChannel: false, showCreateChannel: false,
showImageComposer: false, showImageComposer: false,
showWxGameDrawer: false, showWxGameDrawer: false,
...@@ -475,7 +530,7 @@ export default { ...@@ -475,7 +530,7 @@ export default {
channelInfoList: {}, channelInfoList: {},
transMemberStatus: true, transMemberStatus: true,
h5CloneGameInfo: {}, h5CloneGameInfo: {},
qrCodeValue: "", // 二维码内容 qrCodeValue: '', // 二维码内容
qrCodeSize: 200, // 二维码大小 qrCodeSize: 200, // 二维码大小
}; };
}, },
...@@ -484,14 +539,14 @@ export default { ...@@ -484,14 +539,14 @@ export default {
this.sendGameInfo(); this.sendGameInfo();
}, },
computed: { computed: {
...mapState("game", [ ...mapState('game', [
"accountSelect", 'accountSelect',
"bindGameUserList", 'bindGameUserList',
"chatUserInfo", 'chatUserInfo',
"gameUserInfo", 'gameUserInfo',
"send_game_log", 'send_game_log',
]), ]),
...mapState("user", ["userInfo", "corp_id"]), ...mapState('user', ['userInfo', 'corp_id']),
}, },
// props: [ 'chatUserInfo', 'chatUser'], // props: [ 'chatUserInfo', 'chatUser'],
watch: { watch: {
...@@ -499,7 +554,7 @@ export default { ...@@ -499,7 +554,7 @@ export default {
// 切换 w 账号的时候清空 conversionGameList 数据 // 切换 w 账号的时候清空 conversionGameList 数据
this.conversionGameList = []; this.conversionGameList = [];
this.getMemberTransStatus(); this.getMemberTransStatus();
if (newVal && newVal !== "" && this.bindGameUserList.length > 0) { if (newVal && newVal !== '' && this.bindGameUserList.length > 0) {
this.disabled = false; this.disabled = false;
} else { } else {
this.disabled = true; this.disabled = true;
...@@ -511,14 +566,14 @@ export default { ...@@ -511,14 +566,14 @@ export default {
}, },
}, },
methods: { methods: {
...mapMutations("game", ["set_send_game_log"]), ...mapMutations('game', ['set_send_game_log']),
initDisable() { initDisable() {
// 切换 w 账号的时候清空 conversionGameList 数据 // 切换 w 账号的时候清空 conversionGameList 数据
this.conversionGameList = []; this.conversionGameList = [];
this.getMemberTransStatus(); this.getMemberTransStatus();
if ( if (
this.accountSelect && this.accountSelect &&
this.accountSelect !== "" && this.accountSelect !== '' &&
this.bindGameUserList.length > 0 this.bindGameUserList.length > 0
) { ) {
this.disabled = false; this.disabled = false;
...@@ -538,20 +593,20 @@ export default { ...@@ -538,20 +593,20 @@ export default {
async sendH5CloneGame(items, type) { async sendH5CloneGame(items, type) {
const res = await getClonePackageLink({ mini_game_id: items.id }); const res = await getClonePackageLink({ mini_game_id: items.id });
if (res.status_code == 1) { if (res.status_code == 1) {
if (type == "android" && !res?.data?.data?.android_download_url) { if (type == 'android' && !res?.data?.data?.android_download_url) {
this.$message.warning("安卓分身包链接不存在,请联系掌游配置"); this.$message.warning('安卓分身包链接不存在,请联系掌游配置');
return; return;
} else if (type == "ios" && !res?.data?.data?.ios_download_url) { } else if (type == 'ios' && !res?.data?.data?.ios_download_url) {
this.$message.warning("IOS分身包链接不存在,请联系掌游配置"); this.$message.warning('IOS分身包链接不存在,请联系掌游配置');
return; return;
} }
let srt = ""; let srt = '';
if (type == "android") { if (type == 'android') {
srt = "安卓分身包链接: " + res.data.data.android_download_url; srt = '安卓分身包链接: ' + res.data.data.android_download_url;
} else { } else {
srt = "IOS分身包链接: " + res.data.data.ios_download_url; srt = 'IOS分身包链接: ' + res.data.data.ios_download_url;
} }
sendChatMessage(srt, "text"); sendChatMessage(srt, 'text');
} else { } else {
this.$message.warning(res.msg); this.$message.warning(res.msg);
} }
...@@ -566,7 +621,7 @@ export default { ...@@ -566,7 +621,7 @@ export default {
}, },
// 请求当前 W 账号是否符合转端条件 如果不符合 提示 当前w账号不满足转端要求,请联系组长处理 // 请求当前 W 账号是否符合转端条件 如果不符合 提示 当前w账号不满足转端要求,请联系组长处理
async getMemberTransStatus() { async getMemberTransStatus() {
if (this.accountSelect && this.accountSelect !== "") { if (this.accountSelect && this.accountSelect !== '') {
const res = await getMemberTransStatus({ const res = await getMemberTransStatus({
member_id: this.accountSelect, member_id: this.accountSelect,
}); });
...@@ -578,11 +633,11 @@ export default { ...@@ -578,11 +633,11 @@ export default {
} }
}, },
recallTabChange() { recallTabChange() {
this.activeName = "3"; this.activeName = '3';
this.sendGameRecallList(); this.sendGameRecallList();
}, },
async requestGameSendLog() { async requestGameSendLog() {
this.filterGameText = ""; this.filterGameText = '';
const res = await getRecentSendLog(); const res = await getRecentSendLog();
if (res.status_code == 1) { if (res.status_code == 1) {
if (res.status_code == 1 && res.data.length > 0) { if (res.status_code == 1 && res.data.length > 0) {
...@@ -593,22 +648,22 @@ export default { ...@@ -593,22 +648,22 @@ export default {
} }
// 检查是否已经存在"最近发送"项 // 检查是否已经存在"最近发送"项
const recentSendIndex = this.regGameList.findIndex( const recentSendIndex = this.regGameList.findIndex(
(item) => item.label === "最近发送" (item) => item.label === '最近发送',
); );
if (recentSendIndex !== -1) { if (recentSendIndex !== -1) {
// 如果已存在,更新它 // 如果已存在,更新它
this.$set(this.regGameList[recentSendIndex], "children", res.data); this.$set(this.regGameList[recentSendIndex], 'children', res.data);
} else { } else {
// 如果不存在,添加它 // 如果不存在,添加它
this.regGameList.unshift({ this.regGameList.unshift({
label: "最近发送", label: '最近发送',
children: res.data, children: res.data,
}); });
} }
} }
}, },
async sendGameInfo() { async sendGameInfo() {
this.activeName = "1"; this.activeName = '1';
this.conversionGameList = []; this.conversionGameList = [];
this.recallGameList = []; this.recallGameList = [];
this.getMemberTransStatus(); this.getMemberTransStatus();
...@@ -616,15 +671,15 @@ export default { ...@@ -616,15 +671,15 @@ export default {
this.sendGameList(); this.sendGameList();
}, },
requestRegGameList() { requestRegGameList() {
this.activeName = "2"; this.activeName = '2';
if ( if (
this.gameUserInfo.main_game_id || this.gameUserInfo.main_game_id ||
this.gameUserInfo.main_game_id == 0 this.gameUserInfo.main_game_id == 0
) { ) {
this.contentLoading = true; this.contentLoading = true;
const data = { const data = {
type: "gameListWithType", type: 'gameListWithType',
value: "", value: '',
use_type: 2, use_type: 2,
game_id: this.gameUserInfo.main_game_id, game_id: this.gameUserInfo.main_game_id,
use_user_id: this.userInfo.id, use_user_id: this.userInfo.id,
...@@ -635,7 +690,7 @@ export default { ...@@ -635,7 +690,7 @@ export default {
if (res.status_code == 1) { if (res.status_code == 1) {
// 暂时隐藏快手小游戏 // 暂时隐藏快手小游戏
const ksGameIndex = res.data.data.findIndex( const ksGameIndex = res.data.data.findIndex(
(item) => item.label === "快手小游戏" (item) => item.label === '快手小游戏',
); );
if (ksGameIndex !== -1) { if (ksGameIndex !== -1) {
res.data.data.splice(ksGameIndex, 1); res.data.data.splice(ksGameIndex, 1);
...@@ -655,26 +710,26 @@ export default { ...@@ -655,26 +710,26 @@ export default {
// 召回发送渠道 // 召回发送渠道
sendChannel(items, type) { sendChannel(items, type) {
items.type = 3; items.type = 3;
type ? (this.sendType = type) : ""; type ? (this.sendType = type) : '';
this.channelList(items); this.channelList(items);
}, },
// 转游发送渠道 // 转游发送渠道
sendChannelGame(items, item, type) { sendChannelGame(items, item, type) {
console.log(items, "items", item); console.log(items, 'items', item);
type ? (this.sendType = type) : ""; type ? (this.sendType = type) : '';
const gameInfo = this.$clone(items); const gameInfo = this.$clone(items);
gameInfo.type = 2; gameInfo.type = 2;
this.channelList(gameInfo); this.channelList(gameInfo);
}, },
changeGameText() { changeGameText() {
console.log(this.filterGameText); console.log(this.filterGameText);
if (this.filterGameText.trim() === "") { if (this.filterGameText.trim() === '') {
this.regGameList = this.allRegGameList; this.regGameList = this.allRegGameList;
} else { } else {
const list = JSON.parse(JSON.stringify(this.allRegGameList)); const list = JSON.parse(JSON.stringify(this.allRegGameList));
list.map((item, index) => { list.map((item, index) => {
item.children = item.children.filter( item.children = item.children.filter(
(items) => items.label.indexOf(this.filterGameText) !== -1 (items) => items.label.indexOf(this.filterGameText) !== -1,
); );
}); });
this.regGameList = list; this.regGameList = list;
...@@ -682,7 +737,7 @@ export default { ...@@ -682,7 +737,7 @@ export default {
}, },
// 获取渠道列表 // 获取渠道列表
channelList(items) { channelList(items) {
console.log(items, "items"); console.log(items, 'items');
const data = { const data = {
game_id: items.game_id || items.id, game_id: items.game_id || items.id,
page_size: 200, page_size: 200,
...@@ -691,7 +746,7 @@ export default { ...@@ -691,7 +746,7 @@ export default {
weixin_blongs_id: items.weixin_blongs_id weixin_blongs_id: items.weixin_blongs_id
? [items.weixin_blongs_id] ? [items.weixin_blongs_id]
: this.weixin_blongs_id, : this.weixin_blongs_id,
request_system: "company_wx", request_system: 'company_wx',
member_id: this.accountSelect, member_id: this.accountSelect,
use_type: this.activeName, use_type: this.activeName,
}; };
...@@ -712,7 +767,7 @@ export default { ...@@ -712,7 +767,7 @@ export default {
} }
this.sendGameLog(items); this.sendGameLog(items);
} else { } else {
this.$message.warning("请到掌游创建运营渠道"); this.$message.warning('请到掌游创建运营渠道');
} }
}); });
}, },
...@@ -727,7 +782,7 @@ export default { ...@@ -727,7 +782,7 @@ export default {
this.contentLoading = false; this.contentLoading = false;
if (res.status_code === 1 && res.data.data.length > 0) { if (res.status_code === 1 && res.data.data.length > 0) {
const ksGameIndex = res.data.data.findIndex( const ksGameIndex = res.data.data.findIndex(
(item) => item.game_type == 6 (item) => item.game_type == 6,
); );
if (ksGameIndex != -1) { if (ksGameIndex != -1) {
res.data.data.splice(ksGameIndex, 1); res.data.data.splice(ksGameIndex, 1);
...@@ -742,7 +797,7 @@ export default { ...@@ -742,7 +797,7 @@ export default {
} }
}, },
async conversionChangeOld(value) { async conversionChangeOld(value) {
console.log("请求数据", this.conversionGameList); console.log('请求数据', this.conversionGameList);
if (this.isReqeustData) { if (this.isReqeustData) {
return; return;
} }
...@@ -765,7 +820,7 @@ export default { ...@@ -765,7 +820,7 @@ export default {
// 使用解构赋值简化数据设置 // 使用解构赋值简化数据设置
const updates = { const updates = {
children: reslist.data?.length > 0 ? reslist.data : [], children: reslist.data?.length > 0 ? reslist.data : [],
send_trans_page_id: "", // 转端要发送的游戏 ID send_trans_page_id: '', // 转端要发送的游戏 ID
isReqeustData: true, isReqeustData: true,
}; };
...@@ -776,17 +831,17 @@ export default { ...@@ -776,17 +831,17 @@ export default {
} catch (error) { } catch (error) {
console.error( console.error(
`Failed to fetch game list for index ${index}:`, `Failed to fetch game list for index ${index}:`,
error error,
); );
// 设置空数组作为默认值 // 设置空数组作为默认值
this.$set(this.conversionGameList[index], "children", []); this.$set(this.conversionGameList[index], 'children', []);
} }
}); });
await Promise.all(promiseList); await Promise.all(promiseList);
this.handleConversionGameList(); this.handleConversionGameList();
} catch (error) { } catch (error) {
console.error("Failed to fetch conversion game lists:", error); console.error('Failed to fetch conversion game lists:', error);
} finally { } finally {
this.gameLoding = false; this.gameLoding = false;
this.isReqeustData = false; this.isReqeustData = false;
...@@ -803,56 +858,72 @@ export default { ...@@ -803,56 +858,72 @@ export default {
item.children.length > 0 item.children.length > 0
) { ) {
const filteredChildren = item.children.filter((child) => { const filteredChildren = item.children.filter((child) => {
return child.game_id !== "912" && child.game_id != "784"; return child.game_id !== '912' && child.game_id != '784';
}); });
this.$set( this.$set(
this.conversionGameList[index], this.conversionGameList[index],
"children", 'children',
filteredChildren filteredChildren,
); );
} }
// 隐藏安卓游戏 安卓游戏 game_type: 3 // 隐藏安卓游戏 安卓游戏 game_type: 3
// 隐藏神权之战 这里根据游戏名称判断 因为 game_id 是会变化的
if ( if (
item.game_type === 3 && item.game_type === 3 &&
item.children && item.children &&
item.children.length > 0 item.children.length > 0
) { ) {
// 过滤掉 game_name 为"破日开天"的数据 英雄霸业 741:独步天龙 912:神权之战 繁华梦/2274 const filterList = [
'2365',
'2378',
'2431',
'2437',
'2439',
'2440',
'2441',
'2442',
'2443',
];
// 过滤掉 game_name 为"破日开天"的数据 英雄霸业 741:独步天龙 912:神权之战 繁华梦/2274 黑夜传奇/685 深海花园/2326
const filteredChildren = item.children.filter((child) => { const filteredChildren = item.children.filter((child) => {
return ( return (
child.game_name !== "破日开天" && child.game_name !== '破日开天' &&
child.game_name !== "英雄霸业" && child.game_name !== '英雄霸业' &&
child.game_id !== "741" && child.game_name !== '神权之战' &&
child.game_id !== "912" && child.game_id != '741' &&
child.game_name !== '神权之战' && child.game_id != '2274' &&
child.game_id !== '741' && !filterList.includes(child.game_id) &&
child.game_id !== '2274' && child.game_name !== '繁华梦' &&
child.game_name !== '繁华梦' Number(child.game_id) !== 685
); );
}); });
this.$set( this.$set(
this.conversionGameList[index], this.conversionGameList[index],
"children", 'children',
filteredChildren filteredChildren,
); );
} }
// 隐藏 IOS 游戏 雄霸天下 有两个包 1 个是 691 一个是 819 王鑫说 暂时先隐藏 691 的功能 // 隐藏 IOS 游戏 雄霸天下 有两个包 1 个是 691 一个是 819 王鑫说 暂时先隐藏 691 的功能
// 隐藏神权之战 这里根据游戏名称判断 因为 game_id 是会变化的
if ( if (
item.game_type === 4 && item.game_type === 4 &&
item.children && item.children &&
item.children.length > 0 item.children.length > 0
) { ) {
const filteredChildren = item.children.filter((child) => { const filteredChildren = item.children.filter((child) => {
return Number(child.game_id) !== 691; return (
Number(child.game_id) !== 691 &&
child.game_name !== '神权之战' &&
child.game_id != '2393'
);
}); });
this.$set( this.$set(
this.conversionGameList[index], this.conversionGameList[index],
"children", 'children',
filteredChildren filteredChildren,
); );
} }
}); });
console.log(this.conversionGameList, "conversionGameList");
} }
}, },
// 转端展开 // 转端展开
...@@ -860,7 +931,7 @@ export default { ...@@ -860,7 +931,7 @@ export default {
if (value && value.length > 0) { if (value && value.length > 0) {
const gameType = value[value.length - 1]; const gameType = value[value.length - 1];
const gameIndex = this.conversionGameList.findIndex( const gameIndex = this.conversionGameList.findIndex(
(item) => item.game_type === gameType (item) => item.game_type === gameType,
); );
if ( if (
!this.conversionGameList[gameIndex].children || !this.conversionGameList[gameIndex].children ||
...@@ -881,11 +952,11 @@ export default { ...@@ -881,11 +952,11 @@ export default {
if (reslist.status_code === 1 && reslist.data.data.length > 0) { if (reslist.status_code === 1 && reslist.data.data.length > 0) {
this.$set( this.$set(
this.conversionGameList[gameIndex], this.conversionGameList[gameIndex],
"children", 'children',
reslist.data.data reslist.data.data,
); );
} else { } else {
this.$set(this.conversionGameList[gameIndex], "children", []); this.$set(this.conversionGameList[gameIndex], 'children', []);
} }
setTimeout(() => { setTimeout(() => {
this.gameLoding = false; this.gameLoding = false;
...@@ -902,7 +973,7 @@ export default { ...@@ -902,7 +973,7 @@ export default {
this.contentLoading = false; this.contentLoading = false;
if (res.status_code === 1 && res.data.data.length > 0) { if (res.status_code === 1 && res.data.data.length > 0) {
const ksGameIndex = res.data.data.findIndex( const ksGameIndex = res.data.data.findIndex(
(item) => item.game_type == 6 (item) => item.game_type == 6,
); );
if (ksGameIndex !== -1) { if (ksGameIndex !== -1) {
res.data.data.splice(ksGameIndex, 1); res.data.data.splice(ksGameIndex, 1);
...@@ -921,7 +992,7 @@ export default { ...@@ -921,7 +992,7 @@ export default {
if (value && value.length > 0) { if (value && value.length > 0) {
const gameType = value[value.length - 1]; const gameType = value[value.length - 1];
const gameIndex = this.recallGameList.findIndex( const gameIndex = this.recallGameList.findIndex(
(item) => item.game_type === gameType (item) => item.game_type === gameType,
); );
if ( if (
!this.recallGameList[gameIndex].children || !this.recallGameList[gameIndex].children ||
...@@ -943,17 +1014,17 @@ export default { ...@@ -943,17 +1014,17 @@ export default {
if (reslist.status_code === 1 && reslist.data.data.length > 0) { if (reslist.status_code === 1 && reslist.data.data.length > 0) {
this.$set( this.$set(
this.recallGameList[gameIndex], this.recallGameList[gameIndex],
"children", 'children',
reslist.data.data reslist.data.data,
); );
} else { } else {
this.$set(this.recallGameList[gameIndex], "children", []); this.$set(this.recallGameList[gameIndex], 'children', []);
} }
setTimeout(() => { setTimeout(() => {
this.gameLoding = false; this.gameLoding = false;
}, 2000); }, 2000);
} else { } else {
console.log("之前请求过了"); console.log('之前请求过了');
} }
} }
}, },
...@@ -967,7 +1038,7 @@ export default { ...@@ -967,7 +1038,7 @@ export default {
handleAccount() { handleAccount() {
if (this.bindGameUserList.length > 0) { if (this.bindGameUserList.length > 0) {
const account = this.bindGameUserList.find( const account = this.bindGameUserList.find(
(item) => item.member_id == this.accountSelect (item) => item.member_id == this.accountSelect,
); );
if (account) { if (account) {
return true; return true;
...@@ -980,60 +1051,60 @@ export default { ...@@ -980,60 +1051,60 @@ export default {
}, },
sendLink: throttle(function (item, type) { sendLink: throttle(function (item, type) {
if (!this.transMemberStatus) { if (!this.transMemberStatus) {
this.$message.warning("当前w账号不满足转端要求,请联系组长处理"); this.$message.warning('当前w账号不满足转端要求,请联系组长处理');
return; return;
} }
console.log(item, "转端发送仅发送链接"); console.log(item, '转端发送仅发送链接');
const result = this.handleAccount(); const result = this.handleAccount();
if (!result) { if (!result) {
this.$message.warning("请稍后再试"); this.$message.warning('请稍后再试');
return false; return false;
} }
let str = ""; let str = '';
if (type == 2) { if (type == 2) {
str = "网页游戏链接:"; str = '网页游戏链接:';
} else if (type == 3) { } else if (type == 3) {
str = "安卓游戏链接:"; str = '安卓游戏链接:';
} else if (type == 4) { } else if (type == 4) {
str = "IOS游戏链接:"; str = 'IOS游戏链接:';
} else { } else {
} }
// const list = [ // const list = [
// { msgtype: 'text', text: { content: `${str}${item.url}` }} // { msgtype: 'text', text: { content: `${str}${item.url}` }}
// ] // ]
this.sendChatMessage(`${str}${item.url}`, "text"); this.sendChatMessage(`${str}${item.url}`, 'text');
this.markTransScene(type); this.markTransScene(type);
item.type = 1; item.type = 1;
this.sendGameLog(item); this.sendGameLog(item);
}, 500), }, 500),
sendPassword: throttle(function (item, type) { sendPassword: throttle(function (item, type) {
if (!this.transMemberStatus) { if (!this.transMemberStatus) {
this.$message.warning("当前w账号不满足转端要求,请联系组长处理"); this.$message.warning('当前w账号不满足转端要求,请联系组长处理');
return; return;
} }
console.log(item, "转端仅发送账号密码"); console.log(item, '转端仅发送账号密码');
const result = this.handleAccount(); const result = this.handleAccount();
if (!result) { if (!result) {
this.$message.warning("请稍后再试"); this.$message.warning('请稍后再试');
return false; return false;
} }
const username = this.bindGameUserList.find( const username = this.bindGameUserList.find(
(items) => items.member_id == this.accountSelect (items) => items.member_id == this.accountSelect,
).username; ).username;
passwardEncryption({ member_id: this.accountSelect }) passwardEncryption({ member_id: this.accountSelect })
.then((res) => { .then((res) => {
this.sendChatMessage( this.sendChatMessage(
`账号:${username} \n密码:${res.data.password}`, `账号:${username} \n密码:${res.data.password}`,
"text" 'text',
); );
this.markTransScene(type); this.markTransScene(type);
this.sendGameLog(item); this.sendGameLog(item);
}) })
.catch((err) => { .catch((err) => {
const list = [ const list = [
{ msgtype: "text", text: { content: `账号:${username}` } }, { msgtype: 'text', text: { content: `账号:${username}` } },
]; ];
this.sendChatMessage(`账号:${username}`, "text"); this.sendChatMessage(`账号:${username}`, 'text');
item.type = 1; item.type = 1;
this.sendGameLog(item); this.sendGameLog(item);
console.log(err); console.log(err);
...@@ -1041,31 +1112,31 @@ export default { ...@@ -1041,31 +1112,31 @@ export default {
}, 500), }, 500),
sendMessage: throttle(function (item, type) { sendMessage: throttle(function (item, type) {
if (!this.transMemberStatus) { if (!this.transMemberStatus) {
this.$message.warning("当前w账号不满足转端要求,请联系组长处理"); this.$message.warning('当前w账号不满足转端要求,请联系组长处理');
return; return;
} }
const result = this.handleAccount(); const result = this.handleAccount();
if (!result) { if (!result) {
this.$message.warning("请稍后再试"); this.$message.warning('请稍后再试');
return false; return false;
} }
let str = ""; let str = '';
if (type == 2) { if (type == 2) {
str = "网页游戏链接:"; str = '网页游戏链接:';
} else if (type == 3) { } else if (type == 3) {
str = "安卓游戏链接:"; str = '安卓游戏链接:';
} else if (type == 4) { } else if (type == 4) {
str = "IOS游戏链接:"; str = 'IOS游戏链接:';
} else { } else {
} }
const username = this.bindGameUserList.find( const username = this.bindGameUserList.find(
(items) => items.member_id == this.accountSelect (items) => items.member_id == this.accountSelect,
).username; ).username;
passwardEncryption({ member_id: this.accountSelect }) passwardEncryption({ member_id: this.accountSelect })
.then((res) => { .then((res) => {
const list = [ const list = [
{ {
msgtype: "text", msgtype: 'text',
text: { text: {
content: `${str}${item.url} \n账号:${username} \n密码:${res.data.password}`, content: `${str}${item.url} \n账号:${username} \n密码:${res.data.password}`,
key: res.data.key, key: res.data.key,
...@@ -1075,7 +1146,7 @@ export default { ...@@ -1075,7 +1146,7 @@ export default {
]; ];
this.sendChatMessage( this.sendChatMessage(
`${str}${item.url} \n账号:${username} \n密码:${res.data.password}`, `${str}${item.url} \n账号:${username} \n密码:${res.data.password}`,
"text" 'text',
); );
this.markTransScene(type); this.markTransScene(type);
item.type = 1; item.type = 1;
...@@ -1084,102 +1155,106 @@ export default { ...@@ -1084,102 +1155,106 @@ export default {
.catch((err) => { .catch((err) => {
const list = [ const list = [
{ {
msgtype: "text", msgtype: 'text',
text: { content: `${str}${item.url} \n账号:${username}` }, text: { content: `${str}${item.url} \n账号:${username}` },
}, },
]; ];
this.sendChatMessage(`${str}${item.url} \n账号:${username}`, "text"); this.sendChatMessage(`${str}${item.url} \n账号:${username}`, 'text');
this.sendGameLog(item); this.sendGameLog(item);
console.log(err); console.log(err);
}); });
}, 500), }, 500),
// 发送游戏落地页 // 发送游戏落地页
startSendPage(value) { startSendPage(value) {
console.log(value, "value"); console.log(value, 'value');
this.getMediaId(value, "image"); this.getMediaId(value, 'image');
}, },
// 转端发送落地页面 // 转端发送落地页面
sendDownLoadPage: throttleStart(function (items, type, index) { sendDownLoadPage: throttleStart(function (items, type, index) {
if (!this.transMemberStatus) { if (!this.transMemberStatus) {
this.$message.warning("当前w账号不满足转端要求,请联系组长处理"); this.$message.warning('当前w账号不满足转端要求,请联系组长处理');
return; return;
} }
this.$set( this.$set(
this.conversionGameList[index], this.conversionGameList[index],
"send_trans_page_id", 'send_trans_page_id',
items.game_id items.game_id,
); );
this.showSendPage = true; this.showSendPage = true;
}, 500), }, 500),
// 转端发送游戏分身包 h5 安卓游戏 IOS游戏 发送分身包 // 转端发送游戏分身包 h5 安卓游戏 IOS游戏 发送分身包
async sendTransferCloneGame(type,items) { async sendTransferCloneGame(type, items) {
if(!this.h5CloneGameInfo?.data?.h5_download_url){ if (!this.h5CloneGameInfo?.data?.h5_download_url) {
this.h5CloneGameInfo = await memberRegGameCloneLink({ member_id: this.accountSelect ,game_id:items.game_id}) || {} this.h5CloneGameInfo =
(await memberRegGameCloneLink({
member_id: this.accountSelect,
game_id: items.game_id,
})) || {};
} }
if (this.h5CloneGameInfo?.status_code == 1) { if (this.h5CloneGameInfo?.status_code == 1) {
// 通过 type 判断 用 switch // 通过 type 判断 用 switch
switch (type) { switch (type) {
case 2: case 2:
if (!this.h5CloneGameInfo?.data?.h5_download_url) { if (!this.h5CloneGameInfo?.data?.h5_download_url) {
this.$message.warning('H5安卓分身包链接不存在,请联系掌游配置') this.$message.warning('H5安卓分身包链接不存在,请联系掌游配置');
return return;
} }
break break;
case 3: case 3:
if (!this.h5CloneGameInfo?.data?.android_download_url) { if (!this.h5CloneGameInfo?.data?.android_download_url) {
this.$message.warning('安卓分身包链接不存在,请联系掌游配置') this.$message.warning('安卓分身包链接不存在,请联系掌游配置');
return return;
} }
break break;
case 4: case 4:
if (!this.h5CloneGameInfo?.data?.ios_download_url) { if (!this.h5CloneGameInfo?.data?.ios_download_url) {
this.$message.warning('IOS分身包链接不存在,请联系掌游配置') this.$message.warning('IOS分身包链接不存在,请联系掌游配置');
return return;
} }
break break;
default: default:
this.$message.warning('不支持的游戏类型') this.$message.warning('不支持的游戏类型');
return return;
} }
let srt = '' let srt = '';
switch (type) { switch (type) {
case 2: case 2:
srt = this.h5CloneGameInfo?.data?.h5_download_url srt = this.h5CloneGameInfo?.data?.h5_download_url;
break break;
case 3: case 3:
srt = this.h5CloneGameInfo?.data?.android_download_url srt = this.h5CloneGameInfo?.data?.android_download_url;
break break;
case 4: case 4:
srt = this.h5CloneGameInfo?.data?.ios_download_url srt = this.h5CloneGameInfo?.data?.ios_download_url;
break break;
} }
this.sendChatMessage(srt, "text"); this.sendChatMessage(srt, 'text');
} else { } else {
this.$message.warning(this.h5CloneGameInfo?.msg) this.$message.warning(this.h5CloneGameInfo?.msg);
} }
}, },
// 转端发送游戏二维码 // 转端发送游戏二维码
sendDownLoadQrCode: throttleStart(async function (items, type, index) { sendDownLoadQrCode: throttleStart(async function (items, type, index) {
if (!this.transMemberStatus) { if (!this.transMemberStatus) {
this.$message.warning("当前w账号不满足转端要求,请联系组长处理"); this.$message.warning('当前w账号不满足转端要求,请联系组长处理');
return; return;
} }
const result = this.handleAccount(); const result = this.handleAccount();
if (!result) { if (!result) {
this.$message.warning("请稍后再试"); this.$message.warning('请稍后再试');
return false; return false;
} }
try { try {
this.sendLoading = true; this.sendLoading = true;
// 获取游戏落地页链接 // 获取游戏落地页链接
let landingPageUrl = ""; let landingPageUrl = '';
if (items.url) { if (items.url) {
landingPageUrl = items.url; landingPageUrl = items.url;
} }
if (!landingPageUrl) { if (!landingPageUrl) {
this.$message.error("没有有效的链接可生成二维码"); this.$message.error('没有有效的链接可生成二维码');
return; return;
} }
...@@ -1190,23 +1265,23 @@ export default { ...@@ -1190,23 +1265,23 @@ export default {
await this.$nextTick(); await this.$nextTick();
// 获取二维码canvas并转换为Blob // 获取二维码canvas并转换为Blob
const canvas = this.$refs.qrcode.$el.querySelector("canvas"); const canvas = this.$refs.qrcode.$el.querySelector('canvas');
if (!canvas) { if (!canvas) {
throw new Error("获取二维码canvas失败"); throw new Error('获取二维码canvas失败');
} }
const blob = await new Promise((resolve) => { const blob = await new Promise((resolve) => {
canvas.toBlob((blob) => { canvas.toBlob((blob) => {
resolve(blob); resolve(blob);
}, "image/png"); }, 'image/png');
}); });
// 创建File对象 // 创建File对象
blob.name = "qrcode.png"; blob.name = 'qrcode.png';
// 上传图片 // 上传图片
const uploadConfig = { const uploadConfig = {
dir: "/company_wx/service/avatars/", dir: '/company_wx/service/avatars/',
}; };
const uploadResult = await this.uploading(blob, uploadConfig); const uploadResult = await this.uploading(blob, uploadConfig);
debugger; debugger;
...@@ -1225,17 +1300,17 @@ export default { ...@@ -1225,17 +1300,17 @@ export default {
// }; // };
// console.log(image, 12312321); // console.log(image, 12312321);
this.sendChatMessage(uploadResult.data, "image"); this.sendChatMessage(uploadResult.data, 'image');
this.markTransScene(type); this.markTransScene(type);
items.type = 1; items.type = 1;
this.sendGameLog(items); this.sendGameLog(items);
this.$message.success("二维码发送成功"); this.$message.success('二维码发送成功');
} else { } else {
throw new Error("上传失败"); throw new Error('上传失败');
} }
} catch (error) { } catch (error) {
console.error("发送二维码失败:", error); console.error('发送二维码失败:', error);
this.$message.error("发送二维码失败,请重试"); this.$message.error('发送二维码失败,请重试');
} finally { } finally {
this.sendLoading = false; this.sendLoading = false;
} }
...@@ -1248,10 +1323,10 @@ export default { ...@@ -1248,10 +1323,10 @@ export default {
}; };
const res = await markTransScene(data); const res = await markTransScene(data);
if (res.status_code == 1) { if (res.status_code == 1) {
console.log("标记转端成功"); console.log('标记转端成功');
if ( if (
this.chatUserInfo.trans_scene && this.chatUserInfo.trans_scene &&
this.chatUserInfo.trans_scene !== "" && this.chatUserInfo.trans_scene !== '' &&
this.chatUserInfo.trans_scene != type this.chatUserInfo.trans_scene != type
) { ) {
this.chatUserInfo.trans_scene = type; this.chatUserInfo.trans_scene = type;
...@@ -1269,14 +1344,14 @@ export default { ...@@ -1269,14 +1344,14 @@ export default {
return { return {
value: item.value, value: item.value,
label: label:
item.label && item.label.split("-")[0] item.label && item.label.split('-')[0]
? item.label.split("-")[0] ? item.label.split('-')[0]
: "", : '',
}; };
}); });
resolve(this.belongList); resolve(this.belongList);
} else { } else {
this.$message.warning("暂无绑定项目,请先绑定项目"); this.$message.warning('暂无绑定项目,请先绑定项目');
reject(null); reject(null);
} }
}); });
...@@ -1297,7 +1372,7 @@ export default { ...@@ -1297,7 +1372,7 @@ export default {
belonsList.length > 0 belonsList.length > 0
) { ) {
groupItem = group.data.data[0]; groupItem = group.data.data[0];
const group_name_list = groupItem.label.split("-"); const group_name_list = groupItem.label.split('-');
const data = { const data = {
blongs_name: belonsList[0].label, blongs_name: belonsList[0].label,
member_id: this.accountSelect, member_id: this.accountSelect,
...@@ -1305,7 +1380,7 @@ export default { ...@@ -1305,7 +1380,7 @@ export default {
use_user_name: this.userInfo.username, use_user_name: this.userInfo.username,
group_id: groupItem.value, group_id: groupItem.value,
group_name: group_name_list[group_name_list.length - 1], group_name: group_name_list[group_name_list.length - 1],
game_type: this.chatUserInfo.trans_scene || "", game_type: this.chatUserInfo.trans_scene || '',
}; };
this.sendLoading = true; this.sendLoading = true;
try { try {
...@@ -1320,11 +1395,11 @@ export default { ...@@ -1320,11 +1395,11 @@ export default {
this.$message.success(res.msg); this.$message.success(res.msg);
} }
} catch (error) { } catch (error) {
this.$message.error("获取召回链接失败,请重新再试"); this.$message.error('获取召回链接失败,请重新再试');
this.sendLoading = false; this.sendLoading = false;
} }
} else { } else {
this.$message.error("获取分组失败,请到掌权添加分组"); this.$message.error('获取分组失败,请到掌权添加分组');
return; return;
} }
}, },
...@@ -1342,11 +1417,11 @@ export default { ...@@ -1342,11 +1417,11 @@ export default {
*/ */
handleSendType(data) { handleSendType(data) {
console.log(data, "获取一键发送的信息"); console.log(data, '获取一键发送的信息');
// 转端发送优先逻辑 不需要了 现在发送当前会话框选中的账号对应的注册游戏 // 转端发送优先逻辑 不需要了 现在发送当前会话框选中的账号对应的注册游戏
data?.game_data?.game_type data?.game_data?.game_type
? (this.chatUserInfo.trans_scene = data.game_data.game_type) ? (this.chatUserInfo.trans_scene = data.game_data.game_type)
: ""; : '';
if (this.chatUserInfo.trans_scene && this.chatUserInfo.trans_scene != 1) { if (this.chatUserInfo.trans_scene && this.chatUserInfo.trans_scene != 1) {
this.sendCreateChannel(data.game_data, data.game_data.game_type); this.sendCreateChannel(data.game_data, data.game_data.game_type);
} else { } else {
...@@ -1362,13 +1437,13 @@ export default { ...@@ -1362,13 +1437,13 @@ export default {
page: data.share_data.page, page: data.share_data.page,
imgUrl: data.share_data.share_img, imgUrl: data.share_data.share_img,
}; };
this.sendChatMessage(miniprogramInfo, "miniprogram"); this.sendChatMessage(miniprogramInfo, 'miniprogram');
const game_data = this.$clone(data.game_data); const game_data = this.$clone(data.game_data);
game_data.type = 3; game_data.type = 3;
console.log(game_data, "data----------"); console.log(game_data, 'data----------');
this.sendGameLog(game_data); this.sendGameLog(game_data);
} else { } else {
this.getMediaId(data.game_data.game_url, "image"); this.getMediaId(data.game_data.game_url, 'image');
this.sendGameLog(data.game_data); this.sendGameLog(data.game_data);
} }
} }
...@@ -1386,26 +1461,26 @@ export default { ...@@ -1386,26 +1461,26 @@ export default {
sendCreateChannel: throttle(function (item, type) { sendCreateChannel: throttle(function (item, type) {
const result = this.handleAccount(); const result = this.handleAccount();
if (!result) { if (!result) {
this.$message.warning("请稍后再试"); this.$message.warning('请稍后再试');
return false; return false;
} }
let str = ""; let str = '';
if (type == 2) { if (type == 2) {
str = "网页游戏链接:"; str = '网页游戏链接:';
} else if (type == 3) { } else if (type == 3) {
str = "安卓游戏链接:"; str = '安卓游戏链接:';
} else if (type == 4) { } else if (type == 4) {
str = "IOS游戏链接:"; str = 'IOS游戏链接:';
} else { } else {
} }
const username = this.bindGameUserList.find( const username = this.bindGameUserList.find(
(items) => items.member_id == this.accountSelect (items) => items.member_id == this.accountSelect,
).username; ).username;
passwardEncryption({ member_id: this.accountSelect }).then((res) => { passwardEncryption({ member_id: this.accountSelect }).then((res) => {
const list = [ const list = [
{ {
msgtype: "text", msgtype: 'text',
// 一键发送渠道任务相关的参数 // 一键发送渠道任务相关的参数
taskInfo: { taskInfo: {
task_id: this.chatUser.task_id, task_id: this.chatUser.task_id,
...@@ -1422,7 +1497,7 @@ export default { ...@@ -1422,7 +1497,7 @@ export default {
]; ];
this.sendChatMessage( this.sendChatMessage(
`${str}${item.game_url} \n账号:${username} \n密码:${res.data.password}`, `${str}${item.game_url} \n账号:${username} \n密码:${res.data.password}`,
"text" 'text',
); );
item.type = 3; item.type = 3;
this.sendGameLog(item); this.sendGameLog(item);
...@@ -1433,7 +1508,12 @@ export default { ...@@ -1433,7 +1508,12 @@ export default {
const params = { const params = {
main_game_id: items.main_game_id, main_game_id: items.main_game_id,
weixin_blongs_id: items.weixin_blongs_id, weixin_blongs_id: items.weixin_blongs_id,
type: items.game_type == 1 || items.game_type == 5 ? 2 : items.game_type == 3 || items.game_type == 4 ? 1 : '' type:
items.game_type == 1 || items.game_type == 5
? 2
: items.game_type == 3 || items.game_type == 4
? 1
: '',
}; };
const res = await getLandingPageConfig(params); const res = await getLandingPageConfig(params);
if (res.status_code === 1 && res.data) { if (res.status_code === 1 && res.data) {
...@@ -1457,7 +1537,7 @@ export default { ...@@ -1457,7 +1537,7 @@ export default {
this.showWxGameDrawer = true; this.showWxGameDrawer = true;
return true; return true;
} catch (error) { } catch (error) {
console.error("处理微信小游戏失败:", error); console.error('处理微信小游戏失败:', error);
return false; return false;
} }
}, },
...@@ -1468,12 +1548,12 @@ export default { ...@@ -1468,12 +1548,12 @@ export default {
return targetList.filter( return targetList.filter(
(game) => (game) =>
game.weixin_blongs_id === sourceGame.weixin_blongs_id && game.weixin_blongs_id === sourceGame.weixin_blongs_id &&
game.main_game_id === sourceGame.main_game_id game.main_game_id === sourceGame.main_game_id,
); );
}, },
handleAndroidList(items, item) { handleAndroidList(items, item) {
const androidGameList = this.regGameList.find((item) => const androidGameList = this.regGameList.find((item) =>
item.label.includes("安卓") item.label.includes('安卓'),
); );
if ( if (
androidGameList && androidGameList &&
...@@ -1482,7 +1562,7 @@ export default { ...@@ -1482,7 +1562,7 @@ export default {
) { ) {
androidGameList.children = this.filterGameList( androidGameList.children = this.filterGameList(
items, items,
androidGameList.children androidGameList.children,
); );
} else { } else {
androidGameList.children = []; androidGameList.children = [];
...@@ -1496,7 +1576,7 @@ export default { ...@@ -1496,7 +1576,7 @@ export default {
}, },
handleIosList(items, item) { handleIosList(items, item) {
const IOSGameList = this.regGameList.find((item) => const IOSGameList = this.regGameList.find((item) =>
item.label.includes("IOS" || "ios") item.label.includes('IOS' || 'ios'),
); );
IOSGameList.game_type = 4; IOSGameList.game_type = 4;
if ( if (
...@@ -1519,13 +1599,20 @@ export default { ...@@ -1519,13 +1599,20 @@ export default {
this.showAppGameDrawer = true; this.showAppGameDrawer = true;
const androidGameList = this.handleAndroidList(items, item); const androidGameList = this.handleAndroidList(items, item);
const IOSGameList = this.handleIosList(items, item); const IOSGameList = this.handleIosList(items, item);
androidGameList ? this.selectedAppGameList.push(androidGameList) : ""; androidGameList ? this.selectedAppGameList.push(androidGameList) : '';
IOSGameList ? this.selectedAppGameList.push(IOSGameList) : ""; IOSGameList ? this.selectedAppGameList.push(IOSGameList) : '';
console.log(this.selectedAppGameList, "selectedAppGameList"); console.log(this.selectedAppGameList, 'selectedAppGameList');
}, },
// 主方法 // 主方法
async handleGameType(items, item, type, index) { async handleGameType(items, item, type, index) {
if ((items.game_type == 1 || items.game_type == 3 || items.game_type == 4 || items.game_type == 5) && items.main_game_id && items.weixin_blongs_id) { if (
(items.game_type == 1 ||
items.game_type == 3 ||
items.game_type == 4 ||
items.game_type == 5) &&
items.main_game_id &&
items.weixin_blongs_id
) {
const result = await this.getLandingPageConfig(items, item); const result = await this.getLandingPageConfig(items, item);
if (result && result.data?.data?.tag) { if (result && result.data?.data?.tag) {
if (items.game_type == 1 || items.game_type == 5) { if (items.game_type == 1 || items.game_type == 5) {
...@@ -1548,8 +1635,8 @@ export default { ...@@ -1548,8 +1635,8 @@ export default {
}, },
// 小游戏游戏确认 // 小游戏游戏确认
async handleWxGameConfirm(value) { async handleWxGameConfirm(value) {
console.log(value, "value"); console.log(value, 'value');
this.getMediaId(value, "image"); this.getMediaId(value, 'image');
}, },
SendTransAppGameClose() { SendTransAppGameClose() {
this.selectedAppGameList = []; this.selectedAppGameList = [];
...@@ -1562,17 +1649,17 @@ export default { ...@@ -1562,17 +1649,17 @@ export default {
this.selectedAppGameList = []; this.selectedAppGameList = [];
this.sendChatMessage( this.sendChatMessage(
`游戏地址:${data.landing_page_url} \n账号:${data.username} \n密码:${data.password}`, `游戏地址:${data.landing_page_url} \n账号:${data.username} \n密码:${data.password}`,
"text" 'text',
); );
}, },
async getMediaId(picurl) { async getMediaId(picurl) {
// 发送图片作为链接消息 // 发送图片作为链接消息
if (picurl) { if (picurl) {
this.sendChatMessage(picurl, "image"); this.sendChatMessage(picurl, 'image');
} else { } else {
// 如果没有图片URL,提示用户 // 如果没有图片URL,提示用户
this.$message.error("图片链接不存在,无法发送"); this.$message.error('图片链接不存在,无法发送');
} }
}, },
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论