提交 26ef2fa3 作者: 毛细亚

set_send_game_log还没有适配

上级 ae154c5a
......@@ -26,7 +26,7 @@
"lodash": "^4.17.21",
"moment": "^2.29.1",
"postcss-plugin-px2rem": "^0.8.1",
"qrcode.vue": "^3.6.0",
"qrcode.vue": "^1.7.0",
"sass": "^1.89.0",
"sass-loader": "^16.0.5",
"vconsole": "^3.15.1",
......
......@@ -208,3 +208,12 @@ export function getZqCserWxBelong(data) {
data
})
}
// 记录转游发送记录
export function send_log_add(data) {
return request({
url: returnApi('/corp_zyou_game_send_log/add'),
method: 'post',
data
})
}
\ No newline at end of file
<template>
<div class="sendGameContent">
<div
v-if="!disabled && bindGameUserList.length > 0"
class="btnRelease"
......@@ -292,7 +291,7 @@
</div>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
import { mapState, mapMutations,mapActions } from 'vuex'
import {
memberExtensionGameList,
passwardEncryption,
......@@ -306,7 +305,7 @@
getLandingPageConfig,
getMemberTransStatus
} from '@/api/game'
import { getRecentSendLog, markTransScene,getZqCserGroup,getZqCserWxBelong } from '@/api/works'
import { getRecentSendLog, markTransScene,getZqCserGroup,getZqCserWxBelong,getMediaId } from '@/api/works'
import { companyviewConfig } from '@/api/user'
import { throttle, throttleStart } from '@/utils/index'
import createChannel from './sendGame/createChannel'
......@@ -355,11 +354,12 @@
}
},
mounted() {
this.initDisable()
this.sendGameInfo()
},
computed: {
...mapState('game', ['accountSelect', 'bindGameUserList','chatUserInfo','gameUserInfo']),
...mapState('user', ['userInfo'])
...mapState('user', ['userInfo','corp_id'])
},
// props: [ 'chatUserInfo', 'chatUser'],
watch: {
......@@ -380,11 +380,20 @@
}
},
methods: {
...mapMutations('common', ['set_sendSkillMessage']),
// ...mapMutations('game', ['set_send_game_log']),
initDisable(){
// 切换 w 账号的时候清空 conversionGameList 数据
this.conversionGameList = []
this.getMemberTransStatus()
if (this.accountSelect && this.accountSelect !== '' && this.bindGameUserList.length > 0) {
this.disabled = false
} else {
this.disabled = true
}
},
requestConfig() {
return new Promise((resolve, reject) => {
companyviewConfig().then((res) => {
companyviewConfig({corp_id:this.corp_id}).then((res) => {
this.weixin_blongs_id = res.data.weixin_blongs_id
resolve()
})
......@@ -736,10 +745,10 @@
str = 'IOS游戏链接:'
} else {
}
const list = [
{ msgtype: 'text', text: { content: `${str}${item.url}` }}
]
this.set_sendSkillMessage(list)
// const list = [
// { msgtype: 'text', text: { content: `${str}${item.url}` }}
// ]
this.sendChatMessage(`${str}${item.url}`, 'text')
this.markTransScene(type)
item.type = 1
this.sendGameLog(item)
......@@ -760,13 +769,14 @@
).username
passwardEncryption({ member_id: this.accountSelect })
.then((res) => {
const list = [
{
msgtype: 'text',
text: { content: `账号:${username} \n密码:${res.data.encryptPassword}`, key: res.data.key, iv: res.data.iv }
}
]
this.set_sendSkillMessage(list)
// const list = [
// {
// msgtype: 'text',
// text: { content: `账号:${username} \n密码:${res.data.encryptPassword}`, key: res.data.key, iv: res.data.iv }
// }
// ]
// this.set_sendSkillMessage(list)
this.sendChatMessage(`账号:${username} \n密码:${res.data.encryptPassword}`, 'text')
this.markTransScene(type)
this.sendGameLog(item)
})
......@@ -774,7 +784,8 @@
const list = [
{ msgtype: 'text', text: { content: `账号:${username}` }}
]
this.set_sendSkillMessage(list)
// this.set_sendSkillMessage(list)
this.sendChatMessage(`账号:${username}`, 'text')
item.type = 1
this.sendGameLog(item)
console.log(err)
......@@ -813,7 +824,8 @@
}
}
]
this.set_sendSkillMessage(list)
// this.set_sendSkillMessage(list)
this.sendChatMessage(`${str}${item.url} \n账号:${username} \n密码:${res.data.encryptPassword}`, 'text')
this.markTransScene(type)
item.type = 1
this.sendGameLog(item)
......@@ -825,7 +837,8 @@
text: { content: `${str}${item.url} \n账号:${username}` }
}
]
this.set_sendSkillMessage(list)
// this.set_sendSkillMessage(list)
this.sendChatMessage(`${str}${item.url} \n账号:${username}`, 'text')
this.sendGameLog(item)
console.log(err)
})
......@@ -833,15 +846,8 @@
// 发送游戏落地页
startSendPage(value) {
console.log(value, 'value')
const list = [
{
msgtype: 'image',
image: {
picurl: value
}
}
]
this.set_sendSkillMessage(list)
// this.set_sendSkillMessage(list)
this.getMediaId(value, 'image')
},
// 转端发送落地页面
sendDownLoadPage: throttleStart(function(items, type, index) {
......@@ -938,10 +944,8 @@
} else {
// 没有转端标记过,发送小程序链接 判断标题和封面是否存在 存在发小程序卡片 不存在发二维码
if (data.share_data.share_title && data.share_data.share_img) {
const list = [
const miniprogramInfo =
{
msgtype: 'miniprogram',
miniprogram: {
appid: data.share_data.app_id,
rawid: data.share_data.raw_id,
channle_id: data.share_data.channel_key,
......@@ -949,25 +953,17 @@
title: data.share_data.share_title,
platform: 27,
page: data.share_data.page,
picurl: data.share_data.share_img
imgUrl: data.share_data.share_img
}
}
]
this.set_sendSkillMessage(list)
// this.set_sendSkillMessage(list)
this.sendChatMessage(miniprogramInfo, 'miniprogram')
const game_data = this.$clone(data.game_data)
game_data.type = 3
console.log(game_data, 'data----------')
this.sendGameLog(game_data)
} else {
const list = [
{
msgtype: 'image',
image: {
picurl: data.game_data.game_url
}
}
]
this.set_sendSkillMessage(list)
// this.set_sendSkillMessage(list)
this.getMediaId(data.game_data.game_url,'image')
this.sendGameLog(data.game_data)
}
}
......@@ -1131,15 +1127,16 @@
// 小游戏游戏确认
async handleWxGameConfirm(value) {
console.log(value, 'value')
const list = [
{
msgtype: 'image',
image: {
picurl: value
}
}
]
this.set_sendSkillMessage(list)
// const list = [
// {
// msgtype: 'image',
// image: {
// picurl: value
// }
// }
// ]
// this.set_sendSkillMessage(list)
this.getMediaId(value, 'image')
},
SendTransAppGameClose() {
this.selectedAppGameList = []
......@@ -1150,21 +1147,86 @@
// 安卓或者 IOS 游戏处理
handleAppGameConfirm(data) {
this.selectedAppGameList = []
const list = [
{
// const list = [
// {
// msgtype: 'text',
// text: {
// content: `游戏地址:${data.landing_page_url} \n账号:${data.username} \n密码:${data.password}`
// }
// }
// ]
// this.set_sendSkillMessage(list)
this.sendChatMessage(`游戏地址:${data.landing_page_url} \n账号:${data.username} \n密码:${data.password}`,'text')
},
sendChatMessage(content,type){
let message = {}
if(type == 'text'){
message = {
msgtype: 'text',
text: {
content: `游戏地址:${data.landing_page_url} \n账号:${data.username} \n密码:${data.password}`
content: content
},
success: (res) => {
console.log(res, '发送文本成功')
},
fail: (err) => {
console.log(err, '发送文本失败')
}
}
]
this.set_sendSkillMessage(list)
}else if(type == 'link'){
message = {
msgtype: 'news',
news: content,
success: (res) => {
console.log(res, '发送 news 成功')
},
fail: (err) => {
console.log(err, '发送 news 失败')
}
}
}else if(type == 'image'){
message = {
msgtype: 'image',
image: {
mediaid: content
},
success: (res) => {
console.log(res, '发送 image 成功')
},
fail: (err) => {
console.log(err, '发送 image 失败')
}
}
}else if(type=='miniprogram'){
message = {
msgtype: 'miniprogram',
miniprogram: content,
}
}
console.log(message,'1231')
this.$ww.sendChatMessage(message)
},
async getMediaId(picurl){
// 发送图片作为链接消息
if (picurl) {
const res = await getMediaId({url:picurl})
if(res.status_code == 1){
this.sendChatMessage(res.data.media_id,'image')
}
} else {
// 如果没有图片URL,提示用户
this.$message.error('图片链接不存在,无法发送')
}
},
}
}
</script>
<style lang="scss" scoped>
.sendGameContent{
width: 100%;
height: 100%;
overflow: auto;
.sendLink {
width: 150px;
height: 25px;
......@@ -1213,12 +1275,9 @@
}
.gameList {
width: 100%;
height: 300px;
overflow: auto;
::v-deep .el-tabs__item {
width: 70px;
}
.gameListItem {
width: 100%;
height: 40px;
......
......@@ -3,7 +3,7 @@
<el-drawer
title="选择游戏"
:visible="show"
width="400px"
size="360px"
@close="close"
>
<el-form
......@@ -95,12 +95,14 @@
<span class="dialog-footer rowFlex">
<el-button
class="btn"
size="small"
@click="close"
>取消</el-button>
<el-button
class="btn"
:loading="loading"
type="primary"
size="small"
@click="handleConfirm"
>确认</el-button>
</span>
......
......@@ -3,7 +3,7 @@
<el-drawer
title="选择游戏"
:visible="show"
width="400px"
size="360px"
@close="close"
>
<el-form label-position="top" class="game-select-container">
......@@ -30,8 +30,8 @@
<qrcode-vue ref="qrcode" :value="sendPageUrl" :size="size" level="H"></qrcode-vue>
</div>
<span class="dialog-footer rowFlex">
<el-button class="btn" @click="close">取消</el-button>
<el-button class="btn" type="primary" :loading="loading" @click="handleConfirm">确认</el-button>
<el-button class="btn" @click="close" size="small">取消</el-button>
<el-button class="btn" type="primary" :loading="loading" @click="handleConfirm" size="small">确认</el-button>
</span>
</el-drawer>
</template>
......
......@@ -3,7 +3,7 @@
<el-drawer
title="选择游戏"
:visible="show"
width="400px"
size="360px"
@close="close"
>
<el-form ref="wxGameForm" :model="wxGameForm" :rules="wxGameRules" label-position="top" class="game-select-container">
......@@ -45,8 +45,8 @@
</el-form-item>
</el-form>
<span class="dialog-footer rowFlex">
<el-button class="btn" @click="close">取消</el-button>
<el-button class="btn" :loading="loading" type="primary" @click="handleConfirm">确认</el-button>
<el-button class="btn" @click="close" size="small">取消</el-button>
<el-button class="btn" :loading="loading" type="primary" @click="handleConfirm" size="small">确认</el-button>
</span>
<div ref="composeContainer" class="compose-container">
<div ref="imageWrapper" class="image-wrapper">
......
......@@ -3,7 +3,7 @@
title="新建渠道链接"
:visible="show"
@close='close'
width="500px"
size="360px"
>
<div class="channelContent">
<el-form
......@@ -119,11 +119,12 @@
class="dialog-footer"
style="padding-top: 0;padding-bottom:0;"
>
<el-button @click="close()">取 消</el-button>
<el-button @click="close()" size="small">取 消</el-button>
<el-button
type="primary"
:loading='btnLoading'
@click="submit"
size="small"
>确 定</el-button>
</span>
</el-dialog>
......
......@@ -285,6 +285,9 @@
</script>
<style lang="scss" scoped>
.vipToolsContent{
width: 100%;
height: 100%;
overflow: auto;
.sendLink {
width: 150px;
height: 25px;
......@@ -321,7 +324,7 @@
.gameList {
width: 100%;
height: 350px;
height: auto;
overflow: auto;
::v-deep .el-tabs__item {
width: 70px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论