提交 00afd8bc 作者: 毛细亚

发送游戏成功

上级 6eb7fa02
...@@ -14,7 +14,7 @@ import moment from 'moment' ...@@ -14,7 +14,7 @@ import moment from 'moment'
import VConsole from 'vconsole'; import VConsole from 'vconsole';
import uploading from '@/utils/cos-upload' import uploading from '@/utils/cos-upload'
import errorHandle from '@/utils/errorHandle' import errorHandle from '@/utils/errorHandle'
import { getParams } from '@/utils/index' import { getParams,deepClone } from '@/utils/index'
import * as ww from '@wecom/jssdk' import * as ww from '@wecom/jssdk'
import globalComponent from '@/components/register.js' import globalComponent from '@/components/register.js'
import loadmore from '@/directive/loadmore/index.js' // 加载更多 import loadmore from '@/directive/loadmore/index.js' // 加载更多
...@@ -37,6 +37,7 @@ Vue.prototype.$cookies = Cookies; ...@@ -37,6 +37,7 @@ Vue.prototype.$cookies = Cookies;
Vue.prototype.$lodash = _; Vue.prototype.$lodash = _;
Vue.prototype.$moment = moment; Vue.prototype.$moment = moment;
Vue.prototype.$ww = ww; Vue.prototype.$ww = ww;
Vue.prototype.$clone = deepClone // vue原型挂载递归拷贝方法
new Vue({ new Vue({
router, router,
store, store,
......
...@@ -41,10 +41,12 @@ export default { ...@@ -41,10 +41,12 @@ export default {
* @param {*} type 消息类型 * @param {*} type 消息类型
*/ */
async sendChatMessage(content, type) { async sendChatMessage(content, type) {
// 开始发送
console.log(content,type,'content,type',this.pendingGameLog,this.isLoggingEnabled)
try { try {
// 调用原始的sendChatMessage方法 // 调用原始的sendChatMessage方法
const result = await originalSendChatMessage(content, type) const result = await originalSendChatMessage(content, type)
console.log(result,'发送成功的回调')
// 如果有待记录的游戏日志,则记录 // 如果有待记录的游戏日志,则记录
if (this.pendingGameLog && this.isLoggingEnabled) { if (this.pendingGameLog && this.isLoggingEnabled) {
await this.recordGameLog(result, content, type) await this.recordGameLog(result, content, type)
...@@ -64,6 +66,7 @@ export default { ...@@ -64,6 +66,7 @@ export default {
* @param {String} type 消息类型 * @param {String} type 消息类型
*/ */
async recordGameLog(messageInfo, content, type) { async recordGameLog(messageInfo, content, type) {
console.log(messageInfo, content, type,'进入记日志方法')
if (!this.pendingGameLog) { if (!this.pendingGameLog) {
return return
} }
...@@ -71,6 +74,7 @@ export default { ...@@ -71,6 +74,7 @@ export default {
try { try {
const chatUser = this.chatUserForLog const chatUser = this.chatUserForLog
console.log(this.pendingGameLog,'pendingGameLog')
// 构建日志数据 // 构建日志数据
const logData = { const logData = {
game_id: this.pendingGameLog.game_id, game_id: this.pendingGameLog.game_id,
...@@ -78,7 +82,7 @@ export default { ...@@ -78,7 +82,7 @@ export default {
game_type: this.pendingGameLog.game_type || '', game_type: this.pendingGameLog.game_type || '',
main_game_id: this.pendingGameLog.main_game_id || '', main_game_id: this.pendingGameLog.main_game_id || '',
weixin_blongs_id: this.pendingGameLog.weixin_blongs_id || '', weixin_blongs_id: this.pendingGameLog.weixin_blongs_id || '',
content: this.formatLogContent(messageInfo?.message || content, type), content: [this.formatLogContent(messageInfo?.message || content, type)],
type: this.pendingGameLog.type || 2, type: this.pendingGameLog.type || 2,
frontend_message_id: messageInfo?.frontend_message_id || '', frontend_message_id: messageInfo?.frontend_message_id || '',
session_id: messageInfo?.session_id || '', session_id: messageInfo?.session_id || '',
...@@ -96,7 +100,6 @@ export default { ...@@ -96,7 +100,6 @@ export default {
} else { } else {
console.warn('游戏日志记录失败:', response.msg) console.warn('游戏日志记录失败:', response.msg)
} }
// 清空待记录的日志信息 // 清空待记录的日志信息
this.pendingGameLog = null this.pendingGameLog = null
this.set_send_game_log(null) this.set_send_game_log(null)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
title="新建渠道链接" title="新建渠道链接"
:visible="show" :visible="show"
@close='close' @close='close'
size="360px" width="320px"
> >
<div class="channelContent"> <div class="channelContent">
<el-form <el-form
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论