mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 13:22:49 +00:00
perf: 添加会议机器人快捷菜单
This commit is contained in:
parent
ab61715973
commit
bd7228a378
@ -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':
|
||||
return [
|
||||
[
|
||||
|
||||
@ -1755,40 +1755,61 @@ export default {
|
||||
* @param item
|
||||
*/
|
||||
sendQuick(item) {
|
||||
if (item.key === "locat-checkin") {
|
||||
this.$store.dispatch('openAppMapPage', {
|
||||
key: item.config.key,
|
||||
point: `${item.config.lng},${item.config.lat}`,
|
||||
}).then(data => {
|
||||
if (!$A.isJson(data)) {
|
||||
return
|
||||
}
|
||||
if (data.distance > item.config.radius) {
|
||||
$A.modalError(`你选择的位置「${data.title}」不在签到范围内`)
|
||||
return
|
||||
}
|
||||
const thumb = $A.urlAddParams('https://api.map.baidu.com/staticimage/v2', {
|
||||
ak: item.config.key,
|
||||
center: `${data.point.lng},${data.point.lat}`,
|
||||
markers: `${data.point.lng},${data.point.lat}`,
|
||||
width: 800,
|
||||
height: 480,
|
||||
zoom: 19,
|
||||
copyright: 1,
|
||||
switch (item.key) {
|
||||
// 位置签到
|
||||
case "locat-checkin":
|
||||
this.$store.dispatch('openAppMapPage', {
|
||||
key: item.config.key,
|
||||
point: `${item.config.lng},${item.config.lat}`,
|
||||
}).then(data => {
|
||||
if (!$A.isJson(data)) {
|
||||
return
|
||||
}
|
||||
if (data.distance > item.config.radius) {
|
||||
$A.modalError(`你选择的位置「${data.title}」不在签到范围内`)
|
||||
return
|
||||
}
|
||||
const thumb = $A.urlAddParams('https://api.map.baidu.com/staticimage/v2', {
|
||||
ak: item.config.key,
|
||||
center: `${data.point.lng},${data.point.lat}`,
|
||||
markers: `${data.point.lng},${data.point.lat}`,
|
||||
width: 800,
|
||||
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({
|
||||
type: 'bd',
|
||||
lng: data.point.lng,
|
||||
lat: data.point.lat,
|
||||
title: data.title,
|
||||
distance: data.distance,
|
||||
address: data.address || '',
|
||||
thumb
|
||||
})
|
||||
})
|
||||
return;
|
||||
break;
|
||||
|
||||
// 创建会议
|
||||
case "meeting-create":
|
||||
Store.set('addMeeting', {
|
||||
type: 'create',
|
||||
userids: [this.userId],
|
||||
});
|
||||
break;
|
||||
|
||||
// 加入会议
|
||||
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>`)
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user