Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
conferinta_tbf
/
resources
/
js
/
components
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
FinishPage.vue
| Size :
9.70
KB
Copy
<template> <div class="content-step"> <div class="question"> <h1 class="title"> <span class="question" v-html="title"></span> </h1> <div class="small-line"></div> <div class="description"> <div class="description_content"> </div> <img :src="'images/' + question.image" v-if="question.image"> <div class="video-description" v-if="question.video"> <div :id="'wistia_'+question.video" class="wistia_embed"> </div> </div> </div> </div> <div class="answer"> <div class="position-relative" v-for="(answer, key) in question.answers" :key="key"> <div class="answer-button" @click="setActive(key,answer)" v-bind:class="[active_answer == (questionKey + '-' + key) ? 'active' : '', question.answers.length == 1 ? 'form-button' : '']"> <img class="img-answer" v-if="answer.image != null && answer.image != ''" :src="'images/' + answer.image"> <div class="video-answer" v-if="answer.video"> <div :id="'wistia_'+answer.video" class="wistia_embed"> </div> </div> <button class="answer-title" v-if="question.answers.length > 1">{{answer.title}} <check></check></button> <button class="answer-form" v-else>{{answer.title}} <img src="/build/images/arrow-right.svg"></button> </div> </div> <div class="back_button" @click="back_to_previous" v-if="showPreviousBtn"> <button><arrow-left></arrow-left> Intrebarea precedenta</button> </div> </div> </div> </template> <script> import Check from "./icons/Check"; import NextIcon from "./icons/Next"; import ArrowLeft from "./icons/ArrowLeft"; export default { data() { return { active_answer: 'nothing', answer_selected: 'nothing', title_question: '', showPreviousBtn: true, generated_description: '' } }, components: { 'check': Check, 'next-icon': NextIcon, 'arrow-left': ArrowLeft }, computed:{ title: function(){ let quiz_obj = JSON.parse(localStorage.getItem('quiz')) var new_title = ''; var regex_get_value = /(?:\#)([^#]+)(?=#|$)/; var title_escaped = ''; var new_title_v1 = ''; for (let i = 0; i < this.question.title.length; i++) { if(this.question.title[i].condition == 'true'){ if(regex_get_value.exec(this.question.title[i].title)){ title_escaped = eval(regex_get_value.exec(this.question.title[i].title)[1]); } new_title_v1 = this.question.title[i].title.replace(/\#([^#]+)\#/g , title_escaped); new_title = new_title_v1.replace('{','<mark>').replace('}','</mark>'); new_title = new_title.replace('&name', this.name_referral); this.title_question = new_title; break; } if(eval(this.question.title[i].condition)){ if(regex_get_value.exec(this.question.title[i].title)){ title_escaped = eval(regex_get_value.exec(this.question.title[i].title)[1]); } new_title_v1 = this.question.title[i].title.replace(/\#([^#]+)\#/g , title_escaped); new_title = new_title_v1.replace('{','<mark>').replace('}','</mark>'); new_title = new_title.replace('&name', this.name_referral); this.title_question = new_title; break; } } return new_title; } }, mounted() { var referral_id = null; if (typeof this.$route.params.referral_id != "undefined") { referral_id = this.$route.params.referral_id; } axios.post('/quizResult', { session_token: localStorage.getItem('sessionId'), entity_json: localStorage.getItem('quiz'), referred_by: referral_id }).then((result)=>{ // console.log('success'); }); if(localStorage.getItem('previous_step') == this.questionKey){ this.showPreviousBtn = false; }else{ this.showPreviousBtn = true; } if(this.question.description){ this.generated_description = this.question.description.replace('&link_referral', process.env.MIX_APP_URL + localStorage.getItem('sessionId')) var html = $.parseHTML(this.generated_description) $('.description_content').append(html); } this.question.answers.forEach((el) => { if(el.video){ setTimeout(() => { var wistiaEmbed = Wistia.embed(el.video, { autoPlay: false, controlsVisibleOnLoad: true, videoFoam: { maxWidth: 960 }, copyLinkAndThumbnailEnabled: false, playerColor: "404040", seo: true }); }, 0); } }); if(this.question.video){ setTimeout(() => { var wistiaEmbed = Wistia.embed(this.question.video, { autoPlay: false, controlsVisibleOnLoad: true, videoFoam: { maxWidth: 960 }, copyLinkAndThumbnailEnabled: false, playerColor: "404040", seo: true }); }, 0); } $(document).on('click', '#copyOnClipboard', function(){ var copyText = document.getElementById("url_link"); copyText.select(); copyText.setSelectionRange(0, 99999) document.execCommand("copy"); $(this).addClass('copied'); $(this).html('Copiat!'); setTimeout(() => { $(this).removeClass('copied'); $(this).html('Copiaza'); }, 1500); }) }, watch: { question: function (val) { if(localStorage.getItem('previous_step') == this.questionKey){ this.showPreviousBtn = false; }else{ this.showPreviousBtn = true; } this.answer_selected = ''; this.active_answer = ''; $('.next_step button').removeClass('active'); if(this.question.description){ this.generated_description = this.question.description.replace('&link_referral', process.env.MIX_APP_URL + localStorage.getItem('sessionId')) var html = $.parseHTML(this.generated_description) $('.description_content').append(html); } this.question.answers.forEach((el) => { if(el.video){ setTimeout(() => { var wistiaEmbed = Wistia.embed(el.video, { autoPlay: false, controlsVisibleOnLoad: true, videoFoam: { maxWidth: 960 }, copyLinkAndThumbnailEnabled: false, playerColor: "404040", seo: true }); }, 0); } }); if(this.question.video){ setTimeout(() => { var wistiaEmbed = Wistia.embed(this.question.video, { autoPlay: false, controlsVisibleOnLoad: true, videoFoam: { maxWidth: 960 }, copyLinkAndThumbnailEnabled: false, playerColor: "404040", seo: true }); }, 0); } } }, props: { question: Object, setNextQuestion: Function, previousSet: Function, questionKey: String, step_no: '', name_referral: String }, methods: { setActive(key, answer){ $('.next_step button span').hide(); this.active_answer = (this.questionKey + '-' + key); this.answer_selected = answer; $('.next_step button').addClass('active'); setTimeout(() => { $('.answer-button.active').removeClass('active'); }, 50); this.setNextQuestion(this.questionKey, this.answer_selected, this.title_question, key) }, back_to_previous(){ this.previousSet(); } } } </script>
Back