2025-03-01 14:14:43 +01:00
import type { PropType } from 'vue' ;
import { computed , defineComponent , onMounted , ref , watch , nextTick } from 'vue'
2025-12-05 17:56:05 +01:00
import { CMyFieldDb } from '@/components/CMyFieldDb'
import { CTitleBanner } from '@/components/CTitleBanner'
import { CProfile } from '@/components/CProfile'
import { CDateTime } from '@/components/CDateTime'
import { CMyPage } from '@/components/CMyPage'
import { CMyGroup } from '@/components/CMyGroup'
import { CMyChipList } from '@/components/CMyChipList'
import { CGridTableUser } from '@/components/CGridTableUser'
import { CMyFieldRec } from '@/components/CMyFieldRec'
import { CMyUser } from '@/components/CMyUser'
import { CLabel } from '@/components/CLabel'
import { CGalleryImages } from '@/components/CGalleryImages'
import { CAccomodation } from '@/components/CAccomodation'
2025-03-01 14:14:43 +01:00
import { tools } from '@tools'
2023-04-04 15:27:03 +02:00
import { useUserStore } from '@store/UserStore'
import { useCalendarStore } from '@store/CalendarStore'
import { useGlobalStore } from '@store/globalStore'
2025-03-01 14:14:43 +01:00
import { useI18n } from 'vue-i18n'
2023-04-04 15:27:03 +02:00
import { toolsext } from '@store/Modules/toolsext'
import { useQuasar } from 'quasar'
import { costanti } from '@costanti'
2025-03-01 14:14:43 +01:00
import type { IReaction , IBookedEventPage , IColGridTable , IBookedEvent , IEvents , IMessage , IMessagePage , IParamDialog , ISearchList } from '@model' ;
import { EState } from '@model'
2025-12-05 17:56:05 +01:00
import { shared_consts } from '@/common/shared_vuejs'
2023-04-04 15:27:03 +02:00
import { colCitys , fieldsTable } from '@store/Modules/fieldsTable'
2023-04-07 21:10:16 +02:00
import { useRoute , useRouter } from 'vue-router'
2023-04-04 15:27:03 +02:00
import { useNotifStore } from '@store/NotifStore'
2023-04-17 00:11:45 +02:00
import { lists } from '@store/Modules/lists'
2025-12-05 17:56:05 +01:00
import translate from '@/globalroutines/util'
import { useMessageStore } from '@/store/MessageStore'
import mixinEvents from '@/mixins/mixin-events'
2023-04-04 15:27:03 +02:00
2025-12-02 22:16:24 +01:00
import { colmyUserPeople } from '@store/Modules/fieldsTable' ;
2023-04-04 15:27:03 +02:00
export default defineComponent ( {
name : 'CMyCardService' ,
2024-08-29 23:31:54 +02:00
emits : [ 'showInMap' ] ,
2023-04-07 21:10:16 +02:00
components : {
CProfile , CTitleBanner ,
2023-04-04 15:27:03 +02:00
CMyFieldDb , CDateTime , CMyPage , CMyFieldRec , CAccomodation ,
2023-09-27 18:39:05 +02:00
CMyUser , CGalleryImages , CMyChipList , CLabel , CMyGroup , CGridTableUser ,
2023-04-07 21:10:16 +02:00
} ,
2023-04-04 15:27:03 +02:00
props : {
table : {
type : String ,
required : true ,
} ,
prop_myrec : {
type : Object as PropType < any > ,
required : false ,
default : null ,
} ,
idRec : {
2025-03-01 14:14:43 +01:00
type : String ,
2023-04-04 15:27:03 +02:00
required : false ,
2025-03-01 14:14:43 +01:00
default : ''
2023-04-04 15:27:03 +02:00
} ,
nopopup : {
type : Boolean ,
required : false ,
default : false
} ,
2024-07-31 15:02:30 +02:00
showAnteprima : {
type : Boolean ,
required : false ,
default : false ,
}
2023-04-04 15:27:03 +02:00
} ,
2024-08-29 23:31:54 +02:00
setup ( props , { emit } ) {
2023-04-04 15:27:03 +02:00
const userStore = useUserStore ( )
const calendarStore = useCalendarStore ( )
2023-04-17 00:11:45 +02:00
const messageStore = useMessageStore ( )
2023-04-04 15:27:03 +02:00
const notifStore = useNotifStore ( )
const globalStore = useGlobalStore ( )
const $q = useQuasar ( )
const $route = useRoute ( )
const { t } = useI18n ( )
2023-09-27 18:39:05 +02:00
const arrfilterand : any = ref ( [ ] )
const searchList = ref ( < ISearchList [ ] > [ ] )
const filter = ref ( costanti . FIND_PEOPLE )
2023-04-17 00:11:45 +02:00
2023-04-04 15:27:03 +02:00
const showPic = ref ( false )
2023-04-17 00:11:45 +02:00
const loading = ref ( false )
2023-04-04 15:27:03 +02:00
2023-04-07 21:10:16 +02:00
const $router = useRouter ( )
2023-04-17 00:11:45 +02:00
const contextDay = ref ( < any > null )
2024-09-18 14:56:25 +02:00
const ismounted = ref ( false )
2023-04-17 00:11:45 +02:00
2023-09-27 18:39:05 +02:00
const usersList = ref ( < any > { show : false , title : '' , list : [ ] , loadfromDb : false , tipofavbook : 0 } )
const bookedList = ref ( < any > { show : false , title : '' , list : [ ] , loadfromDb : false , tipofavbook : 0 } )
2023-04-17 00:11:45 +02:00
const formbookEventDefault = ref ( < IBookedEvent > {
userId : '' ,
username : '' ,
msgbooking : '' ,
infoevent : '' ,
tableType : shared_consts.TABLETYPE.MyBachecas ,
numpeople : 1 ,
numpeopleLunch : 0 ,
numpeopleDinner : 0 ,
numpeopleDinnerShared : 0 ,
datebooked : tools.getDateNow ( ) ,
booked : false ,
modified : false
} )
const formAskForDefault = ref ( < IMessage > {
dest : '' ,
origin : '' ,
message : '' ,
} )
const bookEventForm = ref ( { . . . formbookEventDefault . value } )
const askInfoForm = ref ( < IMessage > {
dest : '' ,
origin : '' ,
message : '' ,
} )
const askInfopage = ref ( < IMessagePage > {
show : false ,
msg : {
message : ''
} ,
state : EState.None
} )
const bookEventpage = ref ( < IBookedEventPage > {
show : false ,
bookedevent : {
userId : '' ,
username : '' ,
tableType : shared_consts.TABLETYPE.MyBachecas ,
numpeople : 0 ,
infoevent : '' ,
msgbooking : '' ,
modified : false ,
booked : false
} ,
state : EState.Creating ,
} )
2023-04-07 21:10:16 +02:00
2024-09-18 14:56:25 +02:00
const myrec = ref ( < any > null )
2023-04-04 15:27:03 +02:00
const col = ref ( < IColGridTable > { } )
const idnotif = computed ( ( ) = > $route . query . idnotif ? $route . query . idnotif . toString ( ) : '' )
2023-04-17 00:11:45 +02:00
const arrbookings = computed ( ( ) = > calendarStore . findAllBookedByIdEvent ( myrec . value . _id ) )
2023-04-04 15:27:03 +02:00
2024-07-31 15:02:30 +02:00
const isSmall = ref ( props . showAnteprima ) ;
const cardRef = ref ( < any > null )
const smallHeight = ref ( '30vh' )
const largeHeight = ref ( '100vh' )
const cardStyle = computed ( ( ) = > ( {
2024-09-18 13:11:56 +02:00
// height: isSmall.value ? smallHeight.value : largeHeight.value,
2024-07-31 15:02:30 +02:00
transition : 'height 0.3s ease-in-out'
} ) )
2025-03-03 00:45:56 +01:00
const numpart = ref < number | null > ( null ) ;
const updatePart = ( ) = > {
numpart . value = calendarStore . getNumParticipants (
myrec . value ,
true ,
tools . peopleWhere . participants
) ;
} ;
2023-09-27 18:39:05 +02:00
const filtercustom : any = computed ( ( ) = > {
let queryreact = { }
if ( usersList . value . tipofavbook === costanti . TIPOFAVBOOK . SEEN ) {
2024-09-18 13:11:56 +02:00
queryreact = { seen : true }
2023-09-27 18:39:05 +02:00
} else if ( usersList . value . tipofavbook === costanti . TIPOFAVBOOK . FAVORITE ) {
2024-09-18 13:11:56 +02:00
queryreact = { fav : true }
2023-09-27 18:39:05 +02:00
} else if ( usersList . value . tipofavbook === costanti . TIPOFAVBOOK . BOOKMARK ) {
2024-09-18 13:11:56 +02:00
queryreact = { book : true }
2023-09-27 18:39:05 +02:00
} else if ( usersList . value . tipofavbook === costanti . TIPOFAVBOOK . ATTEND ) {
2024-09-18 13:11:56 +02:00
queryreact = { attend : true }
2023-09-27 18:39:05 +02:00
}
return [ {
2025-03-01 14:14:43 +01:00
idapp : tools.getEnv ( 'VITE_APP_ID' ) ,
2023-09-27 18:39:05 +02:00
tab : tools.getNumTabByTable ( props . table ) ,
idrec : myrec.value._id ,
. . . queryreact ,
} ]
} )
2023-04-04 15:27:03 +02:00
function profile() {
return userStore . my . profile
}
2023-10-01 01:24:55 +02:00
async function load() {
2025-03-03 00:45:56 +01:00
// console.log('load')
2023-09-27 18:39:05 +02:00
// Carica il record
2023-04-07 21:10:16 +02:00
if ( props . idRec ) {
2023-10-01 01:24:55 +02:00
await userStore . loadGeneric ( props . table , props . idRec , idnotif . value ) . then ( ( ris ) = > {
2024-04-19 15:44:52 +02:00
// console.log('myrec', myrec)
2023-04-04 15:27:03 +02:00
myrec . value = ris
2024-09-18 14:56:25 +02:00
if ( ris )
notifStore . setAsRead ( idnotif . value )
2024-06-20 17:22:46 +02:00
} ) . catch ( ( err ) = > {
2024-09-18 13:11:56 +02:00
2023-04-04 15:27:03 +02:00
} )
} else {
2023-10-03 00:40:54 +02:00
// myrec.value = props.prop_myrec
await userStore . loadGeneric ( props . table , props . prop_myrec . _id , idnotif . value ) . then ( ( ris ) = > {
2024-04-19 15:44:52 +02:00
// console.log('myrec', myrec)
2023-10-03 00:40:54 +02:00
myrec . value = ris
2024-09-18 14:56:25 +02:00
if ( ris )
notifStore . setAsRead ( idnotif . value )
2023-10-03 00:40:54 +02:00
} )
2023-04-04 15:27:03 +02:00
}
2023-04-13 14:27:06 +02:00
if ( myrec . value )
clicca ( costanti . TIPOFAVBOOK . SEEN , true , myrec . value . _id )
2023-04-04 15:27:03 +02:00
col . value = fieldsTable . getArrColsByTable ( props . table )
2024-09-18 14:56:25 +02:00
2025-03-03 00:45:56 +01:00
updatePart ( )
2024-09-18 14:56:25 +02:00
ismounted . value = true
2023-04-04 15:27:03 +02:00
}
watch ( ( ) = > props . idRec , ( to : any , from : any ) = > {
2024-09-18 14:56:25 +02:00
if ( ismounted . value )
load ( )
2023-04-04 15:27:03 +02:00
} )
2024-07-31 15:02:30 +02:00
async function mounted() {
2024-09-18 14:56:25 +02:00
await load ( )
2024-07-31 15:02:30 +02:00
await nextTick ( )
}
function updateCard() {
if ( cardRef . value ) {
largeHeight . value = ! isSmall . value ? ` ${ cardRef . value . clientHeight } px ` : largeHeight . value
if ( isSmall . value )
smallHeight . value = ` ${ cardRef . value . clientHeight } px `
}
2023-04-04 15:27:03 +02:00
}
function getlinkpage() {
return self . location . host + tools . getPathByTable ( props . table , myrec . value . _id )
}
function condividipag() {
const mystr = getlinkpage ( )
tools . copyStringToClipboard ( $q , mystr , true )
tools . sendMsgTelegramCmd ( $q , t , shared_consts . MsgTeleg . SHARE_TEXT , false , mystr )
2024-02-27 22:08:16 +01:00
// Apri il BOT RISO
tools . openUrl ( tools . getLinkBotTelegram ( '' , '' ) )
2023-04-04 15:27:03 +02:00
return true
}
function showBadge() {
if ( shared_consts . TABLES_SHOW_ADTYPE . includes ( props . table ) ) {
return true
}
return false
}
2023-04-07 18:38:22 +02:00
function getRecGoodSkillByRec ( rec : any ) {
if ( props . table === 'myskills' )
return rec . recSkill
else if ( props . table === 'mygoods' )
return rec . recGood
return null
}
function getSectorByRec ( rec : any ) {
if ( props . table === 'myskills' )
return rec . sector
else if ( props . table === 'mygoods' )
return rec . sectorGood
return null
}
2023-04-17 00:11:45 +02:00
async function clicca ( tipo : any , myset : any , title : string ) {
2023-10-01 01:24:55 +02:00
if ( ! userStore . my . username ) {
return
}
2023-04-13 13:46:53 +02:00
let mylist = null
if ( tipo === costanti . TIPOFAVBOOK . FAVORITE ) {
if ( myset ) {
2023-04-17 00:11:45 +02:00
await userStore . setFavorite ( $q , t , myrec . value . _id , props . table , myrec . value ) ;
2023-04-13 13:46:53 +02:00
}
2023-09-27 18:39:05 +02:00
mylist = myrec . value . myreaction ? myrec . value . myreaction . filter ( ( rec : IReaction ) = > rec . fav ) : [ ]
2023-04-13 13:46:53 +02:00
} else if ( tipo === costanti . TIPOFAVBOOK . BOOKMARK ) {
if ( myset ) {
2023-04-17 00:11:45 +02:00
await userStore . setBookmark ( $q , t , myrec . value . _id , props . table , myrec . value ) ;
2023-04-13 13:46:53 +02:00
}
2023-09-27 18:39:05 +02:00
mylist = myrec . value . myreaction ? myrec . value . myreaction . filter ( ( rec : IReaction ) = > rec . book ) : [ ]
2023-04-13 14:27:06 +02:00
} else if ( tipo === costanti . TIPOFAVBOOK . SEEN ) {
if ( myset ) {
2023-04-17 00:11:45 +02:00
2023-09-27 18:39:05 +02:00
if ( ! userStore . isSeen ( myrec . value . _id , props . table ) ) {
loading . value = true
const risrecord = await userStore . setSeen ( $q , t , myrec . value . _id , props . table , myrec . value )
if ( risrecord && risrecord . mybookings ) {
myrec . value = risrecord
calendarStore . updatearrBookingEvent ( myrec . value . _id , risrecord . mybookings )
2023-04-17 00:11:45 +02:00
2023-09-27 18:39:05 +02:00
bookEventpage . value . state = EState . None
2023-04-17 00:11:45 +02:00
2023-09-27 18:39:05 +02:00
const findev = calendarStore . findEventBooked ( myrec . value . _id , false )
EditBookEvent ( false )
}
loading . value = false
2023-04-17 00:11:45 +02:00
}
2023-04-13 14:27:06 +02:00
}
2023-09-27 18:39:05 +02:00
mylist = myrec . value . myreaction ? myrec . value . myreaction . filter ( ( rec : IReaction ) = > rec . seen ) : [ ]
2023-04-17 00:11:45 +02:00
} else if ( tipo === costanti . TIPOFAVBOOK . ATTEND ) {
if ( myset ) {
// userStore.setAttend($q, t, myrec.value._id, props.table, bookEventpage.value.bookedevent.numpeople, myrec.value);
}
mylist = arrbookings . value
if ( ! myset && mylist && mylist . length > 0 ) {
2023-09-27 18:39:05 +02:00
bookedList . value . show = true
bookedList . value . title = title
bookedList . value . list = mylist
2023-04-17 00:11:45 +02:00
}
return true ;
2023-04-07 18:38:22 +02:00
}
2023-09-27 18:39:05 +02:00
if ( ! myset && mylist ) {
usersList . value . show = true
usersList . value . title = title
usersList . value . tipofavbook = tipo
usersList . value . loadfromDb = true
usersList . value . list = mylist
2023-04-07 18:38:22 +02:00
}
}
function naviga ( path : string ) {
$router . push ( path )
}
function getTypeHosps() {
let obj = null
if ( myrec . value . typeHosp ) {
obj = globalStore . getRecordByTableSingle ( toolsext . TABTYPEHOSP , myrec . value . typeHosp )
if ( obj )
return obj . label
}
return obj
}
2024-06-19 00:21:06 +02:00
function getTipodiAttivita() {
let obj = null
if ( myrec . value . tipodiAttivita ) {
obj = globalStore . getRecordByTableSingle ( toolsext . TABTIPODIATTIVITA , myrec . value . tipodiAttivita )
if ( obj )
return obj . label
}
return obj
}
2023-04-17 00:11:45 +02:00
function hasModifiedBooking() {
return ( bookEventpage . value . bookedevent . numpeople !== bookEventForm . value . numpeople ) ||
( bookEventpage . value . bookedevent . numpeopleLunch !== bookEventForm . value . numpeopleLunch ) ||
( bookEventpage . value . bookedevent . numpeopleDinner !== bookEventForm . value . numpeopleDinner ) ||
( bookEventpage . value . bookedevent . numpeopleDinnerShared !== bookEventForm . value . numpeopleDinnerShared ) ||
( bookEventpage . value . bookedevent . msgbooking !== bookEventForm . value . msgbooking ) ||
( bookEventpage . value . bookedevent . booked !== bookEventForm . value . booked )
}
function checkseinviaMsg() {
return ( bookEventpage . value . state === EState . Creating ) && ( ! bookEventForm . value . booked )
}
function getTitleBtnBooking() {
if ( bookEventpage . value . state === EState . Creating ) {
return t ( 'dialog.book' )
} else {
return t ( 'dialog.update' )
}
}
function EditBookEvent ( show : boolean ) {
// const bookedevent: any = calendarStore.findEventBooked(myrec.value._id, false)
const bookedevent : any = arrbookings . value . find ( ( recbook : IBookedEvent ) = > recbook . userId === userStore . my . _id )
console . log ( 'bookedevent' , bookedevent )
if ( bookedevent ) {
bookEventForm . value . _id = bookedevent . _id
bookEventForm . value . numpeople = bookedevent . numpeople
bookEventForm . value . numpeopleLunch = bookedevent . numpeopleLunch
bookEventForm . value . numpeopleDinner = bookedevent . numpeopleDinner
bookEventForm . value . numpeopleDinnerShared = bookedevent . numpeopleDinnerShared
bookEventForm . value . infoevent = bookedevent . infoevent
bookEventForm . value . msgbooking = bookedevent . msgbooking
bookEventForm . value . booked = bookedevent . booked
bookEventForm . value . datebooked = bookedevent . datebooked
bookEventpage . value . state = EState . Modifying
} else {
bookEventpage . value . state = EState . Creating
}
bookEventpage . value . bookedevent = bookedevent
bookEventpage . value . show = show
}
async function BookEvent ( eventparam : IBookedEvent ) {
const ris = await calendarStore . BookEvent ( eventparam )
load ( )
return ris
}
2025-12-02 22:16:24 +01:00
function saveBookEvent() {
2023-04-17 00:11:45 +02:00
if ( true ) {
// close the dialog
bookEventpage . value . show = false
// bookEventForm.value.booked = bookEventForm.value.bookedcheck
const data : IBookedEvent = {
userId : userStore.my._id ,
username : userStore.my.username ,
id_bookedevent : myrec.value._id ,
tableType : shared_consts.TABLETYPE.MyBachecas ,
numpeople : bookEventForm.value.numpeople ,
numpeopleLunch : bookEventForm.value.numpeopleLunch ,
numpeopleDinner : bookEventForm.value.numpeopleDinner ,
numpeopleDinnerShared : bookEventForm.value.numpeopleDinnerShared ,
infoevent : tools.gettextevent ( myrec . value ) ,
msgbooking : bookEventForm.value.msgbooking ,
booked : bookEventForm.value.booked ,
datebooked : tools.getDateNow ( ) ,
modified : ( bookEventpage . value . state !== EState . Creating )
}
BookEvent ( data ) . then ( ( ris ) = > {
if ( ris )
tools . showPositiveNotif ( $q , t ( 'cal.booked' ) + ' ' + t ( 'cal.event' ) + ' "' + myrec . value . descr + '"' )
else
tools . showNegativeNotif ( $q , t ( 'cal.booked_error' ) )
} )
contextDay . value = null
}
}
function executefunc ( mythisq : any , table : string , func : number , par : IParamDialog ) {
if ( func === lists . MenuAction . DELETE ) {
// console.log('param1', par.param1)
calendarStore . CancelBookingEvent ( {
ideventbook : par.param1 ,
notify : par.param2 === true ? '1' : '0' ,
} ) . then ( ( ris : any ) = > {
if ( ris ) {
tools . showPositiveNotif ( mythisq , t ( 'cal.canceledbooking' ) + ' "' + par . param3 + '"' )
if ( bookEventpage . value )
bookEventpage . value . show = false
} else {
tools . showNegativeNotif ( mythisq , t ( 'cal.cancelederrorbooking' ) )
}
} )
}
}
function CancelBookingEvent ( mythisq : any , bookeventid : string , notify : boolean , mythis? : any ) {
const mytitle = translate ( 'cal.titlebooking' )
const mytext = translate ( 'cal.cancelbooking' ) + ' ' + tools . gettextevent ( myrec . value ) + '?'
const ok = translate ( 'dialog.yes' )
const funcok = lists . MenuAction . DELETE
const table = ''
const funccancel = 0
const par = {
param1 : bookeventid ,
param2 : notify ,
param3 : myrec.value.descr ,
}
// console.log('CancelBookingEvent ', myrec.value)
return $q . dialog ( {
message : mytext ,
html : true ,
ok : {
label : ok ,
push : true ,
} ,
title : mytitle ,
cancel : true ,
persistent : false ,
} ) . onOk ( ( ) = > {
// console.log('OK')
executefunc ( $q , table , funcok , par )
return true
} ) . onCancel ( ( ) = > {
// console.log('CANCEL')
executefunc ( $q , table , funccancel , par )
return false
} )
}
function sendMsg ( info : boolean ) {
askInfopage . value . show = false
const data : IMessage = {
source : {
event_id : myrec.value._id ,
infoevent : tools.gettextevent ( myrec . value )
} ,
origin : userStore.my.username ,
dest : myrec.value.username ,
message : info ? askInfoForm.value.message : bookEventForm.value.msgbooking
}
messageStore . SendMsgEvent ( data ) . then ( ( ris ) = > {
contextDay . value = null
if ( ris )
tools . showPositiveNotif ( $q , t ( 'cal.sendmsg_sent' ) )
else
tools . showNegativeNotif ( $q , t ( 'cal.sendmsg_error' ) )
} )
}
function isAlreadyBooked() {
2025-12-02 22:16:24 +01:00
return arrbookings . value . some ( ( recbook : IBookedEvent ) = > recbook . userId === userStore . my . _id && recbook . booked ) ;
2023-04-17 00:11:45 +02:00
}
2023-09-27 18:39:05 +02:00
function extraparams() {
return {
lookupPipeline1 : {
lk_tab : 'users' ,
lk_LF : 'userId' ,
lk_FF : '_id' ,
lk_as : 'user' ,
lk_proj : {
name : 1 ,
surname : 1 ,
username : 1 ,
2023-11-30 01:48:29 +01:00
verified_by_aportador : 1 ,
2023-09-27 18:39:05 +02:00
'profile.handshake' : 1 ,
'profile.img' : 1 ,
'profile.mygroups' : 1 ,
'profile.qualifica' : 1 ,
2025-11-26 18:32:05 +01:00
'profile.resid_str_comune' : 1 ,
'profile.resid_comune' : 1 ,
2023-09-27 18:39:05 +02:00
'profile.resid_province' : 1 ,
2023-11-26 01:38:09 +01:00
'profile.resid_card' : 1 ,
2023-09-27 18:39:05 +02:00
'mycities.reg' : 1 ,
} ,
} ,
/ *
{
$lookup : {
from : "users" ,
let : { searchId : { $toObjectId : "$userId" } } ,
pipeline : [
{
$match : {
$expr : {
$and : [
{ $eq : [ "$_id" , "$$searchId" ] } ,
] ,
} ,
} ,
} ,
{
$project : {
name : 1 ,
surname : 1 ,
username : 1 ,
"profile.handshake" : 1 ,
"profile.img" : 1 ,
"profile.mygroups" : 1 ,
"profile.qualifica" : 1 ,
"profile.resid_province" : 1 ,
"mycities.reg" : 1 ,
} ,
}
] ,
as : "user" ,
} ,
} ,
{
$replaceRoot : {
newRoot : {
$mergeObjects : [
{
$arrayElemAt : [
"$mycities" ,
0 ,
] ,
} ,
{
$arrayElemAt : [
"$user" ,
0 ,
] ,
} ,
"$$ROOT" ,
] ,
} ,
} ,
} ,
lookup1 : {
lk_tab : 'provinces' ,
lk_LF : 'profile.resid_province' ,
lk_FF : 'prov' ,
lk_as : 'mycities' ,
lk_proj : {
username : 1 ,
name : 1 ,
surname : 1 ,
'profile.handshake' : 1 ,
'profile.img' : 1 ,
'profile.mygroups' : 1 ,
'profile.qualifica' : 1 ,
'profile.resid_province' : 1 ,
'mycities.reg' : 1 ,
}
} ,
* /
}
}
2023-04-17 00:11:45 +02:00
2024-02-27 22:08:16 +01:00
async function condividi() {
2025-11-23 01:13:27 +01:00
const mystr = "❇️ Ecco l'annuncio da condividere !\nPuoi copiarlo oppure inoltrarlo a chi vuoi.\n\nE\' utile pubblicarlo anche nel gruppo Telegram RISO territoriale o in <a href=\'https://riso.app/riso_gruppo\'>☀️💚 RISO - Rete Italiana Scambio orizzontale</a> (Topic \'Annunci RISO\') "
2024-02-27 22:08:16 +01:00
await tools . sendMsgTelegramCmd ( $q , t , shared_consts . MsgTeleg . SHARE_TEXT , false , mystr )
tools . copyToClip ( $q , getlinkpage ( ) , true )
await tools . sendMsgAnnuncioToTelegramCmd ( $q , t , props . table , myrec . value . _id )
2024-04-25 23:26:25 +02:00
// Apri telegram sulla chat BOT RISO
tools . openUrl ( tools . getLinkBotTelegram ( '' , '' ) )
2024-02-27 22:08:16 +01:00
}
2024-07-31 15:02:30 +02:00
const expandDialog = ( ) = > {
isSmall . value = false ; // Cambia lo stato a 'non piccolo'
} ;
function toggleShowScheda() {
// updateCard()
isSmall . value = ! isSmall . value
2024-09-18 13:11:56 +02:00
2024-07-31 15:02:30 +02:00
}
2024-08-29 23:31:54 +02:00
function showInMap ( rec : any ) {
// close dialo
emit ( 'showInMap' , rec )
}
2025-03-03 00:45:56 +01:00
2023-04-04 15:27:03 +02:00
onMounted ( mounted )
return {
2024-07-31 15:02:30 +02:00
expandDialog ,
2023-04-04 15:27:03 +02:00
profile ,
tools ,
costanti ,
myrec ,
shared_consts ,
globalStore ,
2023-04-17 00:11:45 +02:00
site : globalStore.site ,
2023-04-04 15:27:03 +02:00
showPic ,
userStore ,
t ,
fieldsTable ,
colCitys ,
toolsext ,
col ,
condividipag ,
showBadge ,
getlinkpage ,
calendarStore ,
2023-04-07 21:10:16 +02:00
getSectorByRec ,
getRecGoodSkillByRec ,
usersList ,
2023-04-17 00:11:45 +02:00
bookedList ,
2023-04-07 21:10:16 +02:00
clicca ,
naviga ,
getTypeHosps ,
2023-04-17 00:11:45 +02:00
bookEventpage ,
hasModifiedBooking ,
checkseinviaMsg ,
getTitleBtnBooking ,
askInfoForm ,
EState ,
saveBookEvent ,
EditBookEvent ,
CancelBookingEvent ,
sendMsg ,
askInfopage ,
isAlreadyBooked ,
bookEventForm ,
loading ,
2023-09-27 18:39:05 +02:00
arrfilterand ,
filtercustom ,
searchList ,
filter ,
extraparams ,
2024-02-27 22:08:16 +01:00
condividi ,
2024-06-19 00:21:06 +02:00
getTipodiAttivita ,
2024-07-31 15:02:30 +02:00
isSmall ,
cardStyle ,
cardRef ,
smallHeight ,
toggleShowScheda ,
2024-08-29 23:31:54 +02:00
showInMap ,
2024-09-18 14:56:25 +02:00
ismounted ,
2025-03-03 00:45:56 +01:00
updatePart ,
numpart ,
2025-12-02 22:16:24 +01:00
colmyUserPeople ,
2023-04-04 15:27:03 +02:00
}
}
} )