This commit is contained in:
zoujiandong
2024-01-22 08:42:14 +08:00
parent 3a2b2cd3b1
commit 4948f35fb3
573 changed files with 640 additions and 24515 deletions
@@ -4,9 +4,8 @@ var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexport
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1704883497555, function(require, module, exports) {
__DEFINE__(1705019652554, function(require, module, exports) {
// TUIKitWChat/Chat/index.js
var __TEMP__ = require('aegis-mp-sdk');var Aegis = __REQUIRE_DEFAULT__(__TEMP__);
var __TEMP__ = require('./utils/constant');var constant = __REQUIRE_DEFAULT__(__TEMP__);
const app = getApp();
Component({
@@ -14,7 +13,16 @@ Component({
* 组件的属性列表
*/
properties: {
conversationID: {
type: String,
value: '',
observer(conversationID) {
this.setData({
outsideConversation: true,
currentConversationID: conversationID,
});
},
},
},
/**
@@ -22,7 +30,7 @@ Component({
*/
data: {
isShowConversation: false,
isShowConversationList: true,
isShowConversationList: false,
currentConversationID: '',
unreadCount: 0,
hasCallKit: false,
@@ -33,6 +41,7 @@ Component({
tim: null,
SDKAppID: 0,
},
outsideConversation: false,
},
/**
@@ -45,68 +54,61 @@ Component({
config.userSig = wx.$chat_userSig;
config.tim = wx.$TUIKit;
config.SDKAppID = wx.$chat_SDKAppID;
if (this.data.outsideConversation) {
this.currentConversationID({
detail: {
currentConversationID: this.data.currentConversationID,
unreadCount: 0
}
})
} else {
this.showConversationList();
}
this.setData({
config,
}, () => {
this.TUICallKit = this.selectComponent('#TUICallKit');
// 这里的 isExitInit 用来判断 TUICallKit init 方法是否存在
// 当 isExitInit 为 true 时,进行 callkit 初始化和日志上报
const isExitInit = (this.TUICallKit.init !== undefined);
if (this.TUICallKit !== null && isExitInit) {
wx.aegis.reportEvent({
name: 'TUICallKit',
ext1: 'TUICallKitInit',
ext2: wx.$chat_reportType,
ext3: wx.$chat_SDKAppID,
});
this.TUICallKit.init();
wx.setStorageSync('_isTIMCallKit', true);
wx.$_isTIMCallKit = '_isTIMCallKit';
this.setData({
hasCallKit: true,
});
}
});
const TUIConversation = this.selectComponent('#TUIConversation');
TUIConversation.init();
if (!app.globalData || app.globalData.reportType !== constant.OPERATING_ENVIRONMENT) {
this.aegisInit();
}
wx.$chat_reportType = 'chat-uikit-wechat';
wx.aegis.reportEvent({
name: 'time',
ext1: 'first-run-time',
ext2: wx.$chat_reportType,
ext3: wx.$chat_SDKAppID,
this.initCallKit();
});
},
aegisInit() {
wx.aegis = new Aegis({
id: 'iHWefAYquFxvklBblC', // 项目key
reportApiSpeed: true, // 接口测速
reportAssetSpeed: true, // 静态资源测速
pagePerformance: true, // 开启页面测速
});
initCallKit() {
this.TUICallKit = this.selectComponent('#TUICallKit');
// 这里的 isExitInit 用来判断 TUICallKit init 方法是否存在
// 当 isExitInit 为 true 时,进行 callkit 初始化和日志上报
const isExitInit = (this.TUICallKit.init !== undefined);
if (this.TUICallKit !== null && isExitInit) {
this.TUICallKit.init();
wx.setStorageSync('_isTIMCallKit', true);
wx.$_isTIMCallKit = '_isTIMCallKit';
this.setData({
hasCallKit: true,
});
}
},
currentConversationID(event) {
this.setData({
isShowConversation: true,
isShowConversationList: false,
currentConversationID: event.detail.currentConversationID,
unreadCount: event.detail.unreadCount,
}, () => {
const TUIChat = this.selectComponent('#TUIChat');
TUIChat.init();
const timer = setTimeout(() => {
const TUIConversation = this.selectComponent('#TUIConversation');
TUIConversation.destroy();
clearTimeout(timer);
}, 300)
});
},
showConversationList() {
this.setData({
isShowConversation: false,
isShowConversationList: true,
}, () => {
if (this.data.outsideConversation) {
this.handleBack();
} else {
const TUIConversation = this.selectComponent('#TUIConversation');
TUIConversation.init();
});
this.setData({
isShowConversation: false,
});
}
},
handleCall(event) {
if (event.detail.groupID) {
@@ -115,14 +117,25 @@ Component({
this.TUICallKit.call(event.detail);
}
},
handleBack() {
if (app.globalData && app.globalData.reportType !== constant.OPERATING_ENVIRONMENT) {
wx.navigateBack({
delta: 1,
});
} else {
wx.switchTab({
url: '/pages/TUI-Index/index',
});
}
},
sendMessage(event) {
this.selectComponent('#TUIChat').sendMessage(event);
},
},
});
}, function(modId) {var map = {"./utils/constant":1704883497556}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1704883497556, function(require, module, exports) {
}, function(modId) {var map = {"./utils/constant":1705019652555}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1705019652555, function(require, module, exports) {
const constant = {
FEAT_NATIVE_CODE: {
NATIVE_VERSION: 1,
@@ -180,7 +193,7 @@ const constant = {
if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true });exports.default = constant;
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1704883497555);
return __REQUIRE__(1705019652554);
})()
//miniprogram-npm-outsideDeps=["aegis-mp-sdk"]
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long