2020-02-07 22:08:16 +01:00
|
|
|
import { Component, Prop } from 'vue-property-decorator'
|
|
|
|
|
|
|
|
|
|
import { CMyPage } from '../CMyPage/index'
|
|
|
|
|
|
|
|
|
|
import { tools } from '../../store/Modules/tools'
|
|
|
|
|
import { Screen } from 'quasar'
|
|
|
|
|
import { CCopyBtn, CImgText, CTitleBanner } from '@components'
|
|
|
|
|
import MixinBase from '../../mixins/mixin-base'
|
|
|
|
|
import { static_data } from '../../db/static_data'
|
|
|
|
|
import { UserStore } from '@modules'
|
|
|
|
|
import { CMyFieldDb } from '../CMyFieldDb'
|
|
|
|
|
import { shared_consts } from '../../common/shared_vuejs'
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
mixins: [MixinBase],
|
|
|
|
|
components: { CMyPage, CTitleBanner, CImgText, CMyFieldDb }
|
|
|
|
|
})
|
|
|
|
|
export default class CGuidelines extends MixinBase {
|
|
|
|
|
@Prop({required: false, default: false}) public showconditions: boolean
|
|
|
|
|
public $t: any
|
|
|
|
|
public $q
|
|
|
|
|
public msg: string = ''
|
2020-02-12 20:41:57 +01:00
|
|
|
public myguideline: boolean = false
|
2020-02-07 22:08:16 +01:00
|
|
|
|
|
|
|
|
get static_data() {
|
|
|
|
|
return static_data
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-12 20:41:57 +01:00
|
|
|
public created() {
|
|
|
|
|
this.aggiorna_guideline()
|
2020-02-07 22:08:16 +01:00
|
|
|
}
|
|
|
|
|
|
2020-02-12 20:41:57 +01:00
|
|
|
public aggiorna_guideline() {
|
|
|
|
|
this.myguideline = tools.isBitActive(UserStore.state.my.profile.saw_and_accepted, shared_consts.Accepted.CHECK_READ_GUIDELINES)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public changeval(value) {
|
|
|
|
|
console.log('PRIMA saw_and_accepted', UserStore.state.my.profile.saw_and_accepted)
|
2020-02-07 22:08:16 +01:00
|
|
|
if (value)
|
|
|
|
|
UserStore.state.my.profile.saw_and_accepted = tools.SetBit(UserStore.state.my.profile.saw_and_accepted, shared_consts.Accepted.CHECK_READ_GUIDELINES)
|
|
|
|
|
else
|
|
|
|
|
UserStore.state.my.profile.saw_and_accepted = tools.UnSetBit(UserStore.state.my.profile.saw_and_accepted, shared_consts.Accepted.CHECK_READ_GUIDELINES)
|
|
|
|
|
|
|
|
|
|
const mydata = {
|
|
|
|
|
'profile.saw_and_accepted': UserStore.state.my.profile.saw_and_accepted
|
|
|
|
|
}
|
2020-02-12 20:41:57 +01:00
|
|
|
this.aggiorna_guideline()
|
|
|
|
|
|
|
|
|
|
console.log('DOPO saw_and_accepted', UserStore.state.my.profile.saw_and_accepted)
|
2020-02-07 22:08:16 +01:00
|
|
|
|
|
|
|
|
tools.saveFieldToServer(this, 'users', UserStore.state.my._id, mydata)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|