Blame view
src/components/outro.vue
14 KB
921970bb2
|
1 2 |
<template> <main class="landing-page"> |
c65b51996
|
3 |
<div class="container-fluid episode-intro"> |
2b91d45ce
|
4 |
<Header></Header> |
921970bb2
|
5 |
<!-- menu wrapper --> |
c65b51996
|
6 7 8 9 10 |
<div class="intro-startup"> <div class="thanks-wrapper"> <div class="thanks-l-wrp"> <div class="thanks-pay-wrp"> <!-- <img src="../assets/images/thanks.svg" class="thanks-img" /> --> |
d0186c77a
|
11 12 13 14 |
<img :src="currentSlideData.payload.metaData.authorImage[0]" class="thanks-img" /> |
c65b51996
|
15 16 17 18 |
<div class="blacktext-wrp"> CHeck out other case studies here <img src="../assets/images/arrow-bottom.svg" /> </div> |
d0186c77a
|
19 |
<ul class=""> |
6b14d08e4
|
20 |
<!-- <li v-for="(study, i) in caseStudies" :key="i"> |
f2328546d
|
21 |
<a href=""> |
c65b51996
|
22 23 |
<img :src="study.intro.logoURL" /> <span |
d0186c77a
|
24 |
><img src="../assets/images/p-eye.svg" /> 0 Views</span |
c65b51996
|
25 26 |
> </a> |
6b14d08e4
|
27 |
</li> --> |
d0186c77a
|
28 |
|
c65b51996
|
29 |
<!-- <li class="payments-spc-57"> |
f2328546d
|
30 |
<a href=""> |
c65b51996
|
31 32 33 34 35 36 37 |
<img src="../assets/images/g-pay.svg" /> <span ><img src="../assets/images/p-eye.svg" /> 19.4k Views</span > </a> </li> |
921970bb2
|
38 |
<li> |
f2328546d
|
39 |
<a href=""> |
c65b51996
|
40 41 42 43 44 45 46 47 48 49 50 |
<img src="../assets/images/bb.svg" /> <span ><img src="../assets/images/p-eye.svg" /> 19.4k Views</span > </a> </li> --> </ul> <!-- payments options --> <!-- <ul class=""> <li> |
f2328546d
|
51 |
<a href=""> |
c65b51996
|
52 53 54 55 56 57 58 59 |
<img src="../assets/images/payment.svg" /> <span ><img src="../assets/images/p-eye.svg" /> 19.4k Views</span > </a> </li> <li class="payments-spc-57"> |
f2328546d
|
60 |
<a href=""> |
c65b51996
|
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
<img src="../assets/images/uc.svg" /> <span ><img src="../assets/images/p-eye.svg" /> 19.4k Views</span > </a> </li> </ul> --> <!-- payments options --> </div> <!-- thanks pay wrp --> <img src="../assets/images/spot-light-bt.svg" class="payment-spot-light-bt" /> </div> <!-- thanks left wrp --> <div class="thanks-r-section"> <div class="logo-common-wrp"> |
f2328546d
|
80 |
<a href="" |
c65b51996
|
81 82 83 84 85 |
><img src="../assets/images/ps-growth.svg" /> <span>Product Growth</span> </a> </div> <!-- logo wrp --> |
921970bb2
|
86 |
<div class="clearfix"></div> |
c65b51996
|
87 88 89 90 91 |
<p> Don’t forget to <strong> join the discussion </strong> by scrolling back and adding your comments! </p> <div class="clearfix"></div> |
f2328546d
|
92 |
<a href="" class="back-bt" @click="goHome"> |
c65b51996
|
93 94 95 96 97 98 99 100 101 102 103 104 |
<span class="s1"></span> <span class="s2"></span> <span class="s3"></span> <span class="s4"></span> <img src="../assets/images/refresh.svg" /> Back to home </a> <ul class="rating-section"> <li> <p> Excited to <strong> create case studies</strong> or help build Product Growth? </p> |
f2328546d
|
105 |
<a href="" class="publish" @click="open()">Publish</a> |
c65b51996
|
106 107 108 109 |
</li> <li> <p class="wdth">How would you rate this case study?</p> <span class="rating-list"> |
d0186c77a
|
110 111 |
<star-rating @rating-selected ="updateRating" v-bind:star-size="30" v-model="rating" active-color="#514da6"> </star-rating> |
f2328546d
|
112 |
<!-- <a href="" |
c65b51996
|
113 114 |
><img src="../assets/images/f-review.svg" /></a> |
f2328546d
|
115 |
<a href="" |
c65b51996
|
116 117 |
><img src="../assets/images/f-review.svg" /></a> |
f2328546d
|
118 |
<a href="" |
c65b51996
|
119 |
><img src="../assets/images/e-review.svg" |
d0186c77a
|
120 |
/></a> --> |
c65b51996
|
121 122 123 124 125 126 127 |
</span> </li> </ul> <div class="follow-us-py"> <span>Follow us at</span> <ul class="p-follows"> <li> |
f2328546d
|
128 |
<a href=""> |
c65b51996
|
129 130 131 132 |
<img src="../assets/images/p-rss.svg" /> </a> </li> <li> |
f2328546d
|
133 |
<a href=""> |
c65b51996
|
134 135 136 137 |
<img src="../assets/images/p-linkedin.svg" /> </a> </li> <li> |
f2328546d
|
138 |
<a href=""> |
c65b51996
|
139 140 141 142 143 |
<img src="../assets/images/p-twitter.svg" /> </a> </li> </ul> </div> |
d0186c77a
|
144 |
<!-- <star-rating v-model="rating"></star-rating> --> |
c65b51996
|
145 146 147 |
<!-- follow us --> <div class="p-users"> <span>Author</span> |
d0186c77a
|
148 |
<h1>{{ currentSlideData.payload.metaData.authors[0] }}</h1> |
c65b51996
|
149 150 151 152 |
<!-- <span>Author</span> <h1>Pramod</h1> <span>Author</span> <h1>Sarthak</h1> --> |
d0186c77a
|
153 154 155 156 157 158 159 160 |
<span v-if="currentSlideData.payload.metaData.designer" >Designer</span > <h1>{{ currentSlideData.payload.metaData.designer }}</h1> <span v-if="currentSlideData.payload.metaData.illustrations" >Illustrations</span > <h1>{{ currentSlideData.payload.metaData.illustrations }}</h1> |
c65b51996
|
161 162 163 164 165 166 167 168 169 170 |
</div> <!-- users --> </div> <!-- thanks payment right section --> </div> <!--- thanks wrapper --> <div class="footer-nav"> <div class="footer-top"> <ul class="top-intro-bt ps_right"> <li> |
f2328546d
|
171 |
<a href="" @click="goBack" |
c65b51996
|
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
><img src="../assets/images/skip-prev.svg" /> Prev</a > </li> </ul> </div> <!-- footer top --> <div class="footer-bottom"> <ul> <li class="active"></li> <li class="active"></li> </ul> </div> <!-- footer top --> </div> <!-- footer --> </div> |
921970bb2
|
188 189 190 191 192 193 194 195 196 |
<!-- body wrapper --> </div> <!-- main wrapper --> </main> </template> <script> import Vue from "vue"; import router from "../router"; |
c65b51996
|
197 |
import axios from "axios"; |
2b91d45ce
|
198 |
import Header from "./Header"; |
921970bb2
|
199 200 |
export default { |
2b91d45ce
|
201 202 203 |
components: { Header: Header, }, |
921970bb2
|
204 205 206 |
name: "Outro", data() { |
c65b51996
|
207 208 209 210 211 |
return { caseStudies: [], allSlide: [], currentSlideIndex: null, currentSlideData: null, |
d0186c77a
|
212 |
rating: 0, |
c65b51996
|
213 214 215 216 217 218 219 220 221 222 |
}; }, mounted() { var allSlideData = localStorage.getItem( "spotlight_slide" + this.$route.params.caseStudyId ); if (allSlideData) { this.allSlide = JSON.parse(allSlideData); this.getCurrentSlideData(); this.getCaseStudies(); |
6b14d08e4
|
223 |
}else{ |
49055248c
|
224 |
this.generatecaseStudies(); |
c65b51996
|
225 |
} |
49055248c
|
226 |
|
921970bb2
|
227 |
}, |
921970bb2
|
228 |
methods: { |
49055248c
|
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
generatecaseStudies(){ axios .get("/caseStudy?caseStudyId="+this.$route.params.caseStudyId, { headers: { Authorization: "Bearer " + this.usertoken, }, }) .then((response) => { console.log('response',response.data.data); this.openStudy(response.data.data); }) .catch((error) => console.log(error)); }, openStudy(payload) { console.log("payload-", payload); payload.intro.date = payload.createdAt; payload.intro.focusPoint = payload.focusAreas; axios .get("/caseStudy/slides?caseStudyId=" + payload._id, { headers: { Authorization: "Bearer " + this.usertoken, }, }) .then((response) => { this.createSlide(payload, response.data.data); }) .catch((error) => console.log(error)); }, createSlide(payload, slides) { var finalSlides = []; slides.forEach((slides_) => { var url = this.assignRoutes(slides_.templateId); var obj = { forward: true, backward: true, ur: url, slideId: slides_._id, caseStudyId: slides_.caseStudyId, payload: { metaData: slides_.metaData, comments: slides_.comments, insight: slides_.insight ? slides_.insight : null, }, }; // slides_ finalSlides.push(obj); }); console.log("payload", payload); // add first slide at begining finalSlides.unshift({ forward: true, backward: false, ur: "EpisodeIntro", slideId: "INTRO_oqkdMOVDrwRptsdWJ6Ye", caseStudyId: payload._id, payload: { metaData: payload.intro, comments: [], }, }); finalSlides.push({ forward: true, backward: false, ur: "Outro", slideId: "OUTRO_oqkdMOVDrwRptsdWJ6Ye", caseStudyId: payload._id, payload: { metaData: payload.outro, comments: [], }, }); console.log(finalSlides); console.log("payload", payload); localStorage.setItem( "spotlight_slide" + payload._id, JSON.stringify(finalSlides) ); this.allSlide = finalSlides; this.getCurrentSlideData(); }, assignRoutes(tempId) { // /episode-intro // /outro var routes = [ { url: "AuthorIntro", tempId: "T1_RoeMG8130Xko1DvhC3Ou", }, { url: "NoScreenshotSingleAuthor", tempId: "T2_ROsUOEy3vxsRAiQ72XdI", }, { url: "SingleMobileScreenInsightTwo", tempId: "T3_cqNIf7tuqL4jyON63dA7", }, { url: "TwoScreenWithoutInsight", tempId: "T4_4QC8W7kIYnJtZ26Jt0Go", }, { url: "noscreenshotSingleautho", tempId: "T5_za3c3sYgx7bVvtKz5r0e", }, { url: "SingleMobileScreenInsightOne", tempId: "T6_za3c3sYgx7bVvtKz5sgf", }, { url: "TwoScreenWithInsight", tempId: "T7_za3c3sYgx7bVvtKzasdf", }, { url: "AuthorReadingNow", tempId: "T8_zb4d4fYgx7bVvtKzasdf", }, { url: "AuthorReadingBreak", tempId: "T9_zb3e4fYgy7dVvfKdasdf", }, ]; var i = routes.findIndex((routes_) => routes_.tempId == tempId); return routes[i].url; }, |
c65b51996
|
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
getCurrentSlideData() { var i = this.allSlide.findIndex( (slide_) => slide_.slideId == this.$route.params.slideId ); this.currentSlideIndex = i; this.currentSlideData = this.allSlide[i]; console.log("currentSlideData", this.currentSlideData); }, goNext() { this.currentSlideIndex++; this.$router.push({ name: this.allSlide[this.currentSlideIndex].ur, params: { caseStudyId: this.allSlide[this.currentSlideIndex].caseStudyId, slideId: this.allSlide[this.currentSlideIndex].slideId, }, }); }, goBack() { this.currentSlideIndex--; this.$router.push({ name: this.allSlide[this.currentSlideIndex].ur, params: { caseStudyId: this.allSlide[this.currentSlideIndex].caseStudyId, slideId: this.allSlide[this.currentSlideIndex].slideId, }, }); }, |
5c9c1581c
|
387 388 389 390 391 392 393 394 395 396 |
goHome() { this.currentSlideIndex--; this.$router.push({ name: this.allSlide[0].ur, params: { caseStudyId: this.allSlide[0].caseStudyId, slideId: this.allSlide[0].slideId, }, }); }, |
c65b51996
|
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
getCaseStudies() { var userdata = localStorage.getItem("spotlight_usertoken"); if (userdata) { userdata = JSON.parse(userdata); axios .get("/caseStudy/all", { headers: { Authorization: "Bearer " + userdata.token, }, }) .then((response) => { console.log(response.data.data.caseStudies); this.caseStudies = response.data.data.caseStudies; }) .catch((error) => console.log(error)); } }, |
d0186c77a
|
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
getRating() { var userdata = localStorage.getItem("spotlight_usertoken"); if (userdata) { userdata = JSON.parse(userdata); axios .get("/caseStudy/rating?caseStudyId="+this.$route.params.caseStudyId, { headers: { Authorization: "Bearer " + userdata.token, }, }) .then((response) => { this.rating = response.data.data.Avgrating; }) .catch((error) => console.log(error)); } }, |
f2328546d
|
432 433 434 |
open(){ window.open('https://www.productgrowth.org/spotlight#typeform-spotlight'); }, |
d0186c77a
|
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 |
updateRating() { var userdata = localStorage.getItem("spotlight_usertoken"); if (userdata) { userdata = JSON.parse(userdata); var obj = { "caseStudyId":this.$route.params.caseStudyId, "rating":this.rating } axios .post("/caseStudy/rating",obj, { headers: { Authorization: "Bearer " + userdata.token, }, }) .then((response) => { console.log("response",response) // this.rating = response.data.data.Avgrating; }) .catch((error) => console.log(error)); } }, |
921970bb2
|
456 |
goToLogin() { |
56f4b7548
|
457 |
this.$router.push("/login"); |
921970bb2
|
458 459 |
}, goToSignUp() { |
56f4b7548
|
460 |
this.$router.push("/"); |
921970bb2
|
461 |
}, |
c65b51996
|
462 463 464 |
goToProfile() { this.$router.push("/profile"); }, |
921970bb2
|
465 466 467 |
}, }; </script> |
d0186c77a
|
468 469 470 471 472 473 |
<style> .vue-star-rating-rating-text[data-v-fde73a0c] { margin-left: 7px; display: none; } </style> |