perf: 添加会议机器人快捷菜单

This commit is contained in:
kuaifan 2024-11-11 09:49:53 +08:00
parent ab61715973
commit bd7228a378
2 changed files with 68 additions and 32 deletions

View File

@ -146,6 +146,21 @@ class UserBot extends AbstractModel
], ],
]; ];
case 'meeting-alert@bot.system':
if (!Base::judgeClientVersion('0.39.89')) {
return [];
}
return [
[
'key' => 'meeting-create',
'label' => Doo::translate('新会议')
],
[
'key' => 'meeting-join',
'label' => Doo::translate('加入会议')
],
];
case 'bot-manager@bot.system': case 'bot-manager@bot.system':
return [ return [
[ [

View File

@ -1755,40 +1755,61 @@ export default {
* @param item * @param item
*/ */
sendQuick(item) { sendQuick(item) {
if (item.key === "locat-checkin") { switch (item.key) {
this.$store.dispatch('openAppMapPage', { //
key: item.config.key, case "locat-checkin":
point: `${item.config.lng},${item.config.lat}`, this.$store.dispatch('openAppMapPage', {
}).then(data => { key: item.config.key,
if (!$A.isJson(data)) { point: `${item.config.lng},${item.config.lat}`,
return }).then(data => {
} if (!$A.isJson(data)) {
if (data.distance > item.config.radius) { return
$A.modalError(`你选择的位置「${data.title}」不在签到范围内`) }
return if (data.distance > item.config.radius) {
} $A.modalError(`你选择的位置「${data.title}」不在签到范围内`)
const thumb = $A.urlAddParams('https://api.map.baidu.com/staticimage/v2', { return
ak: item.config.key, }
center: `${data.point.lng},${data.point.lat}`, const thumb = $A.urlAddParams('https://api.map.baidu.com/staticimage/v2', {
markers: `${data.point.lng},${data.point.lat}`, ak: item.config.key,
width: 800, center: `${data.point.lng},${data.point.lat}`,
height: 480, markers: `${data.point.lng},${data.point.lat}`,
zoom: 19, width: 800,
copyright: 1, height: 480,
zoom: 19,
copyright: 1,
})
this.sendLocationMsg({
type: 'bd',
lng: data.point.lng,
lat: data.point.lat,
title: data.title,
distance: data.distance,
address: data.address || '',
thumb
})
}) })
this.sendLocationMsg({ break;
type: 'bd',
lng: data.point.lng, //
lat: data.point.lat, case "meeting-create":
title: data.title, Store.set('addMeeting', {
distance: data.distance, type: 'create',
address: data.address || '', userids: [this.userId],
thumb });
}) break;
})
return; //
case "meeting-join":
Store.set('addMeeting', {
type: 'join',
});
break;
//
default:
this.sendMsg(`<p><span data-quick-key="${item.key}">${item.label}</span></p>`)
break;
} }
this.sendMsg(`<p><span data-quick-key="${item.key}">${item.label}</span></p>`)
}, },
/** /**