You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

476 lines
17 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div :class="['tw-h-full tw-p-[30px] tw-bg-white md:tw-bg-primary-pale']">
  3. <div
  4. class="xl:tw-grid xl:tw-grid-cols-[auto_414px] xl:tw-gap-[96px] xl:tw-max-w-[1246px] xl:tw-mx-auto xl:tw-px-[60px]">
  5. <div class="tw-hidden xl:tw-block xl:tw-mt-[30px]">
  6. <p class="welcome tw-text-primary-light">{{ $t("Welcome to ShowEasy") }}</p>
  7. <p class="sub tw-text-neutral-400">
  8. {{
  9. $t(
  10. "Your best guide from trip to show and from show to the world."
  11. )
  12. }}
  13. </p>
  14. <img class="mt-11 ml-15" :src="require('@/assets/img/UserLoginMain.png')" />
  15. </div>
  16. <div class="md:tw-w-[414px] md:tw-mx-auto">
  17. <div
  18. class="tw-bg-white md:tw-rounded-[24px] md:tw-mt-[30px] md:tw-pt-[60px] md:tw-pb-[150px] md:tw-px-[30px]"
  19. >
  20. <div v-if="getPath == null">
  21. <p class="tw-text-[26px] tw-font-bold tw-mb-[20px] md:tw-text-[18px]">
  22. {{ $t("Forgot Password") }}
  23. </p>
  24. <p class="tw-body-3 tw-text-black tw-mb-[24px]">
  25. {{
  26. $t(
  27. "Dont worry! It happens. Please enter the address associated with your account."
  28. )
  29. }}
  30. </p>
  31. <div v-if="wrongMessageActive" class="warning--text text-size-14 ps-1 mb-3">
  32. {{ $t('The Email entered is incorrect') }}
  33. </div>
  34. <v-form v-model="resendValid">
  35. <v-text-field
  36. v-model="Email"
  37. background-color="neutrals darken-1"
  38. :label="this.$t('Email')"
  39. placeholder=""
  40. filled
  41. rounded
  42. dense
  43. single-line
  44. :rules="[rules.email, rules.require]"
  45. ></v-text-field>
  46. </v-form>
  47. <div class="md:tw-flex md:tw-justify-center md:tw-items-center">
  48. <button
  49. @click="sendForgotMail"
  50. :class="[
  51. 'tw-block tw-w-full tw-py-[10px] tw-rounded-[16px] tw-border tw-border-solid tw-body-3 tw-font-normal tw-transition-all tw-duration-200 tw-ease-in-out',
  52. resendValid
  53. ? 'tw-text-white tw-bg-primary-default tw-border-primary-default'
  54. : 'tw-text-base-disable tw-bg-neutral-100 tw-border-neutral-100',
  55. ]"
  56. >
  57. {{ $t("Reset Password")
  58. }}<span v-if="disableBtn">({{ this.countdown }})</span>
  59. </button>
  60. </div>
  61. </div>
  62. <div v-if="getPath != null && resetSuccess == false">
  63. <p class="title">{{ $t("Reset Password") }}</p>
  64. <v-form v-model="resetValid">
  65. <v-text-field
  66. v-model="userData.Password"
  67. background-color="neutrals darken-1"
  68. :label="this.$t('Password') + '*'"
  69. :type="showPass ? 'text' : 'password'"
  70. placeholder=""
  71. filled
  72. rounded
  73. dense
  74. single-line
  75. persistent-hint
  76. :rules="[rules.checkPassword, rules.require]"
  77. :hint="
  78. this.$t(
  79. 'Passwords must be 8-20 characters with at least 1 number, 1 lower case letter and 1 upper case letter'
  80. )
  81. "
  82. :append-icon="showPass ? 'mdi-eye' : 'mdi-eye-off'"
  83. @click:append="showPass = !showPass"
  84. ></v-text-field>
  85. <v-text-field
  86. v-model="userConfirmPass"
  87. background-color="neutrals darken-1"
  88. :label="this.$t('Confirm Password') + '*'"
  89. :type="showConfirmPass ? 'text' : 'password'"
  90. placeholder=""
  91. filled
  92. rounded
  93. dense
  94. single-line
  95. :rules="[rules.checkPassword, rules.require, rules.confirmPass]"
  96. :append-icon="showConfirmPass ? 'mdi-eye' : 'mdi-eye-off'"
  97. @click:append="showConfirmPass = !showConfirmPass"
  98. ></v-text-field>
  99. </v-form>
  100. <div class="md:tw-flex md:tw-justify-center md:tw-items-center">
  101. <button
  102. @click="resetUserPass"
  103. :class="[
  104. 'tw-block tw-w-full tw-py-[10px] tw-rounded-[16px] tw-border tw-border-solid tw-body-3 tw-font-normal tw-transition-all tw-duration-200 tw-ease-in-out tw-text-white tw-bg-primary-default tw-border-primary-default']"
  105. >
  106. {{ $t("Reset Password") }}
  107. </button>
  108. </div>
  109. </div>
  110. <div v-if="resetSuccess">
  111. <p class="title">{{ $t("Password Reset") }}</p>
  112. <p class="neutrals--text text--darken-5 text-size-14">
  113. {{ $t("Congrats! Your password has been successfully reset") }}
  114. </p>
  115. <nuxt-link :to="localePath('/')">
  116. <v-btn
  117. @click="redirectHome"
  118. width="100%"
  119. color="primary"
  120. class="border-radius-16 mt-4"
  121. >
  122. <span class="text-capitalize">{{ $t("Explore with ShowEasy") }}</span>
  123. </v-btn>
  124. </nuxt-link>
  125. <v-spacer class="d-flex justify-center mt-5">
  126. <span
  127. class="text-size-12 primary--text"
  128. v-html="$t('Go to ShowEasy in sec', { second: this.countdown })"
  129. ></span>
  130. </v-spacer>
  131. </div>
  132. <v-dialog v-model="dialog" :width="$vuetify.breakpoint.smAndUp ? 423 : 294"
  133. @click:outside="colseDialog()">
  134. <v-card class="tw-p-[30px]" :height="$vuetify.breakpoint.smAndUp ? 289 : 290">
  135. <v-spacer class="d-flex align-center tw-justify-between tw-mb-[30px]">
  136. <div class="tw-text-[20px] tw-font-bold tw-text-black">
  137. {{ $t("Verify your email") }}
  138. </div>
  139. <v-btn @click="colseDialog()" icon>
  140. <v-icon> mdi-close </v-icon>
  141. </v-btn>
  142. </v-spacer>
  143. <v-spacer class="tw-mb-[40px]">
  144. <div class="tw-text-[16px] tw-text-neutrals-800">
  145. {{ $t("Oops! Seems like you haven't verified your email,please click the button below to resend a verification email.")}}
  146. </div>
  147. </v-spacer>
  148. <button @click="resendVerifyEmail()" class="tw-bg-primary-1 hover:tw-bg-primary-light tw-text-white tw-text-[18px] tw-rounded-[16px] tw-px-[77px] tw-py-[13px]">
  149. {{ $t("Resend verification email") }}
  150. </button>
  151. <!-- <v-btn @click="resendVerifyEmail" class="primary tw-text-[18px] tw-w-auto" rounded
  152. :disabled="countdown > 0">
  153. <span v-if="countdown > 0">
  154. {{ `(${this.countdown})` }}
  155. </span>
  156. </v-btn> -->
  157. </v-card>
  158. </v-dialog>
  159. <v-dialog v-model="deleteDialog" :width="$vuetify.breakpoint.smAndUp ? 423 : 294"
  160. @click:outside="colseDialog()">
  161. <v-card class="tw-p-[30px]" :height="$vuetify.breakpoint.smAndUp ? 289 : 290">
  162. <v-spacer class="d-flex tw-justify-between align-center tw-mb-[30px]">
  163. <div class="tw-text-[20px] tw-text-black tw-font-bold">
  164. {{ $t("Reactivate your account") }}
  165. </div>
  166. <v-btn @click="colseDialog()" icon>
  167. <v-icon> mdi-close </v-icon>
  168. </v-btn>
  169. </v-spacer>
  170. <v-spacer class="tw-mb-[40px]">
  171. <div class="tw-text-[16px] tw-text-neutrals-800 tw-font-bold">
  172. {{ $t("Welcome back!")}}
  173. </div>
  174. <div class="tw-text-[16px] tw-text-neutrals-800">
  175. {{ $t("Looks like your account has been deactivated.")}}
  176. <br />
  177. {{ $t("Would you like to reactivate this account?")}}
  178. </div>
  179. </v-spacer>
  180. <button @click="ReactivateAccount()" class="tw-bg-primary-1 tw-text-white hover:tw-bg-primary-light tw-text-[18px] tw-rounded-[16px] tw-px-[86px] tw-py-[13px]">
  181. {{ $t("Reactivate my account") }}
  182. </button>
  183. <!-- <v-btn class="primary tw-w-auto" rounded
  184. :disabled="countdown > 0">
  185. <span v-if="countdown > 0">
  186. {{ `(${this.countdown})` }}
  187. </span>
  188. </v-btn> -->
  189. </v-card>
  190. </v-dialog>
  191. <v-dialog v-model="chackMailDialog" :width="$vuetify.breakpoint.smAndUp ? 463 : 294"
  192. @click:outside="colseDialog()">
  193. <v-card class="tw-p-[30px]" :height="$vuetify.breakpoint.smAndUp ? 289 : 290">
  194. <v-spacer class="d-flex tw-justify-between align-center tw-mb-[30px]">
  195. <div class="tw-text-[20px] tw-text-black tw-font-bold">
  196. {{ $t("Check your email") }}
  197. </div>
  198. <v-btn @click="colseDialog()" icon>
  199. <v-icon> mdi-close </v-icon>
  200. </v-btn>
  201. </v-spacer>
  202. <v-spacer class="tw-mb-[40px]">
  203. <div class="tw-text-[16px] tw-text-neutrals-800 tw-font-bold">
  204. {{ $t("We've sent a password reset link to")}}
  205. </div>
  206. <div class="tw-text-[16px] tw-text-primary-1">
  207. {{ Email }}
  208. </div>
  209. <div class="tw-text-[16px] tw-text-neutrals-800 tw-font-bold">
  210. {{ $t("Please tap the link inside that email to continue.")}}
  211. </div>
  212. </v-spacer>
  213. <button @click="colseDialog()" class="tw-bg-primary-1 tw-text-white hover:tw-bg-primary-light tw-text-[18px] tw-rounded-[16px] tw-px-[169px] tw-py-[13px]">
  214. {{ $t("OK") }}
  215. </button>
  216. <!-- <v-btn class="primary tw-w-auto" rounded
  217. :disabled="countdown > 0">
  218. <span v-if="countdown > 0">
  219. {{ `(${this.countdown})` }}
  220. </span>
  221. </v-btn> -->
  222. </v-card>
  223. </v-dialog>
  224. </div>
  225. </div>
  226. </div>
  227. </div>
  228. </template>
  229. <script>
  230. export default {
  231. name: "Forgot",
  232. layout: "login",
  233. auth: false,
  234. data() {
  235. return {
  236. showPass: false,
  237. showConfirmPass: false,
  238. resendValid: false,
  239. resetValid: false,
  240. disableBtn: false,
  241. resetSuccess: false,
  242. countdown: 5,
  243. Email: "",
  244. userConfirmPass: "",
  245. userData: {
  246. //user_id: "",
  247. //auth_code: "",
  248. Password: "",
  249. },
  250. result: "",
  251. getPath: null,
  252. rules: {
  253. require: (value) => !!value || this.$t("Required."),
  254. email: (v) =>
  255. /^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/.test(
  256. v
  257. ) || this.$t("Invalid email"),
  258. checkPassword: (v) =>
  259. (/(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])/.test(v) &&
  260. v.length >= 8 &&
  261. v.length <= 20) ||
  262. this.$t(
  263. "Passwords must be 8-20 characters with at least 1 number, 1 lower case letter and 1 upper case letter"
  264. ),
  265. confirmPass: (v) =>
  266. v === this.userData.Password ||
  267. this.$t("Your password and confirmation password do not match"),
  268. },
  269. dialog: false,
  270. deleteDialog: false,
  271. wrongMessageActive: false,
  272. chackMailDialog: false,
  273. };
  274. },
  275. created(){
  276. this.$auth.$storage.removeUniversal('userPassword');
  277. this.$auth.$storage.removeUniversal('userAccount');
  278. this.getPAth();
  279. },
  280. methods: {
  281. colseDialog(){
  282. this.dialog = false;
  283. if(this.dialog == false){
  284. this.resendValid = false;
  285. }
  286. this.deleteDialog = false;
  287. if(this.deleteDialog == false){
  288. this.resendValid = false;
  289. }
  290. this.chackMailDialog = false;
  291. if(this.chackMailDialog == false){
  292. this.resendValid = false;
  293. }
  294. },
  295. getPAth(){
  296. let vm = this;
  297. if (this.$route.query.Email) {
  298. vm.getPath = vm.$route.query.Email;
  299. }else{
  300. vm.getPath = null;
  301. }
  302. },
  303. sendForgotMail() {
  304. this.countdown = 60;
  305. this.resendValid = false;
  306. this.$axios
  307. .post(`/trending/api/Signup/SendForgotMail?Email=${this.Email}`)
  308. .then((response) => {
  309. //console.log(JSON.stringify(response));
  310. if(response.data.STATUSCODE == "404"){
  311. this.resendValid = false;
  312. if(response.data.MSG == "0"){
  313. this.dialog = true;
  314. }else if(response.data.MSG == "2"){
  315. this.deleteDialog = true;
  316. }else{
  317. this.wrongMessageActive = true;
  318. }
  319. }
  320. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  321. let data = response.data.DATA.rel
  322. if(data){
  323. this.result = data;
  324. this.disableBtn = false;
  325. this.resendValid = false;
  326. this.chackMailDialog = true;
  327. this.disableBtn = !this.disableBtn;
  328. this.timeout = setInterval(() => {
  329. if (this.countdown > 0) {
  330. this.countdown--;
  331. }
  332. if (this.countdown == 0) {
  333. this.resendValid = true;
  334. this.disableBtn = true;
  335. this.countdown = 60;
  336. clearInterval(this.timeout);
  337. }
  338. }, 1000);
  339. }
  340. }
  341. })
  342. .catch((error) => {
  343. console.log(error);
  344. });
  345. },
  346. resetUserPass() {
  347. if (
  348. this.userData.Password === this.userConfirmPass &&
  349. this.resetValid
  350. ) {
  351. //this.userData.user_id = this.$route.query.user_uuid;
  352. //this.userData.auth_code = this.$route.query.auth_code;
  353. this.$axios
  354. .post(`/trending/api/Signup/ResetPassword?Email=${this.getPath}&Password=${this.userData.Password}`)
  355. .then((response) => {
  356. //console.log(JSON.stringify(response));
  357. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  358. let data = response.data.DATA.rel
  359. if(data){
  360. this.resetSuccess = !this.resetSuccess;
  361. this.countdown = 3;
  362. this.timer = setInterval(() => {
  363. if (this.countdown > 0) {
  364. this.countdown--;
  365. } else {
  366. clearInterval(this.timer);
  367. this.$router.push(this.localePath("/"));
  368. }
  369. }, 1000);
  370. }
  371. }
  372. })
  373. .catch((error) => {
  374. console.log(error);
  375. });
  376. }
  377. },
  378. resendVerifyEmail() {
  379. this.countdown = 60;
  380. this.$axios
  381. .post(
  382. `/trending/api/Signup/ReSendVerifyMail?Email=${this.Email}`
  383. )
  384. .then((response) => {
  385. //console.log(JSON.stringify(response))
  386. if(response && response.data){
  387. this.dialog = false;
  388. this.resendValid = true;
  389. clearInterval(this.timer);
  390. this.timer = setInterval(() => {
  391. if (this.countdown > 0) {
  392. this.countdown--;
  393. }
  394. if (this.countdown === 0) {
  395. clearInterval(this.timer);
  396. }
  397. }, 1000);
  398. }
  399. })
  400. .catch((error) => {
  401. console.log(error);
  402. });
  403. },
  404. ReactivateAccount(){
  405. this.$axios
  406. .post(
  407. `/trending/api/Members/ReactivateAccount?Email=${this.Email}`
  408. )
  409. .then((response) => {
  410. //console.log(JSON.stringify(response))
  411. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  412. let data = response.data.DATA.rel
  413. if(data){
  414. this.deleteDialog = false;
  415. window.location.href = '/';
  416. }
  417. }
  418. })
  419. .catch((error) => {
  420. console.log(error);
  421. });
  422. },
  423. },
  424. beforeUnmount() {
  425. clearInterval(this.timeout);
  426. clearInterval(this.timer);
  427. },
  428. };
  429. </script>
  430. <style scoped>
  431. .title {
  432. font-weight: 700;
  433. font-size: 26px;
  434. line-height: 34px;
  435. letter-spacing: 0.02em;
  436. color: #232323;
  437. }
  438. </style>
  439. <style lang="scss" scoped>
  440. #app {
  441. overflow-y: hidden;
  442. }
  443. .welcome {
  444. color: #f5cda8;
  445. font-family: Damion;
  446. font-size: 48px;
  447. margin-bottom: 0px;
  448. font-weight: 400;
  449. line-height: 66px;
  450. letter-spacing: 0.02em;
  451. }
  452. .sub {
  453. color: #9c9c9c;
  454. font-style: italic;
  455. font-weight: 400;
  456. font-size: 22px;
  457. line-height: 29px;
  458. letter-spacing: 0.02em;
  459. }
  460. </style>