소스 검색

Payment Option

master
30117125 4 년 전
부모
커밋
8b99c27a3d

+ 2
- 2
src/components/admin/status/editTimeShareAdminPage.vue 파일 보기

@@ -460,10 +460,10 @@
460 460
               </div>
461 461
               <div class="row">
462 462
                 <div class="text-center col-6">
463
-                  <button class="btn-solid-blue" v-on:click="saveEdit()">Save</button>
463
+                  <button class="btn-solid-blue" v-on:click="saveEdit()">SAVE</button>
464 464
                 </div>
465 465
                 <div class="text-center col-6">
466
-                  <button class="btn-solid-blue" v-on:click="backToListView()">Back</button>
466
+                  <button class="btn-solid-blue" v-on:click="backToListView()">BACK</button>
467 467
                 </div>
468 468
               </div>
469 469
             </div>

+ 102
- 0
src/components/financial/paymentOption.vue 파일 보기

@@ -0,0 +1,102 @@
1
+<template>
2
+  <section id="intro">
3
+    <div class="container">
4
+      <div class="row">
5
+        <div class="col-md-6">
6
+          <div class="intro-content box text-center">
7
+            <h2>Payment Option</h2>
8
+            <select name="" id="" v-model="selectedOption" class="uniSelect form-control">
9
+              <option value="CC">Credit/Debit Card</option>
10
+              <option value="EFT">EFT</option>
11
+            </select>
12
+            <button class="btn-solid-blue mt-5" @click="pushToApi()">Continue</button>
13
+          </div>
14
+        </div>
15
+      </div>
16
+    </div>
17
+
18
+    <carousel
19
+      :nav="false"
20
+      :dots="false"
21
+      :items="1"
22
+      :autoplay="true"
23
+      :loop="true"
24
+      :autoHeight="true"
25
+      id="intro-carousel"
26
+      style="margin-top:-50px;"
27
+      :responsive="{ 0: { items: 1, nav: false }, 600: { items: 1, nav: false } }"
28
+    >
29
+      <img class="item" src="/img/intro-carousel/home-1.jpg" alt="" />
30
+      <img class="item" src="/img/intro-carousel/16.jpg" alt="" />
31
+      <img class="item" src="/img/intro-carousel/comm-1.jpg" alt="" />
32
+      <img class="item" src="/img/intro-carousel/comm-4.jpg" alt="" />
33
+      <img class="item" src="/img/intro-carousel/3.jpg" alt="" />
34
+      <img class="item" src="/img/intro-carousel/home-5.jpg" alt="" />
35
+    </carousel>
36
+  </section>
37
+</template>
38
+
39
+<script>
40
+/* eslint-disable */
41
+import { mapState, mapActions, mapGetters } from "vuex";
42
+import carousel from "vue-owl-carousel";
43
+import Log from "../../assets/Log";
44
+export default {
45
+  components: {
46
+    carousel
47
+  },
48
+  props: {
49
+    week: {}
50
+  },
51
+  data() {
52
+    return {
53
+      boolLoaded: false,
54
+      selectedOption: "CC"
55
+    };
56
+  },
57
+  computed: {
58
+    ...mapGetters("fees", ["getListingFee"])
59
+  },
60
+  methods: {
61
+    ...mapActions("payment", ["addPayment"]),
62
+    ...mapActions("myWeeks", ["editSave"]),
63
+    pushToApi() {
64
+      if (this.selectedOption == "CC") {
65
+        this.paygateRedirect();
66
+      } else {
67
+        this.week.statusId = 1033; // change this value to link with status
68
+        if (this.week.owner.telephone === "") {
69
+          delete this.week.owner.telephone;
70
+        }
71
+        console.log(JSON.stringify(this.week));
72
+        this.editSave(this.week).then(ex => {
73
+          console.log("It was here");
74
+        });
75
+      }
76
+    },
77
+    paygateRedirect() {
78
+      var amount = this.getListingFee.amount;
79
+      var paymentObj = {
80
+        timeshareWeekId: this.week.id, // this.sellItem.Id,
81
+        propertyId: 0,
82
+        creatydById: Log.getUser().id, //Log.getUser().id,
83
+        amount: amount,
84
+        paymentStatus: "",
85
+        paymentToken: ""
86
+      };
87
+
88
+      this.addPayment(paymentObj).then(res => {
89
+        this.$router.push({
90
+          name: "PaymentGateway",
91
+          params: {
92
+            paymentReqId: res.PAY_REQUEST_ID,
93
+            checksum: res.CHECKSUM
94
+          }
95
+        });
96
+      });
97
+    }
98
+  }
99
+};
100
+</script>
101
+
102
+<style lang="scss" scoped></style>

+ 1
- 1
src/components/shared/navBar.vue 파일 보기

@@ -299,7 +299,7 @@
299 299
                         </ul>
300 300
                       </li> -->
301 301
                       <hr />
302
-                      <li>
302
+                      <li v-if="ROLE === 'Super Admin'">
303 303
                         <router-link to="/Offers">Offers</router-link>
304 304
                       </li>
305 305
                       <!-- <li v-if="ROLE === 'Super Admin'">

+ 18
- 4
src/components/timeshare/sell/contentSection.vue 파일 보기

@@ -798,6 +798,13 @@
798 798
                 <p class="alert myError">Please ensure that you add spouse details.</p>
799 799
               </div>
800 800
             </div>
801
+            <div class="form-row" v-if="profileEmailError">
802
+              <div class="col-md-12">
803
+                <p class="alert myError">
804
+                  Please ensure that your email is correct before adding a timeshare week.
805
+                </p>
806
+              </div>
807
+            </div>
801 808
             <div class="text-center col-12" v-if="CanSave">
802 809
               <button class="btn-solid-blue" v-if="!sellItem.id" @click="submitSale()">
803 810
                 SUBMIT
@@ -838,7 +845,8 @@ export default {
838 845
   data() {
839 846
     return {
840 847
       wait: false,
841
-      userLoggedIn: Log.isLoggedIn()
848
+      userLoggedIn: Log.isLoggedIn(),
849
+      profileEmailError: false
842 850
     };
843 851
   },
844 852
   components: {
@@ -933,9 +941,15 @@ export default {
933 941
       if (this.userLoggedIn) {
934 942
         this.sellItem.ownerObject = this.indiv;
935 943
         this.sellItem.weekStatus = "For Sale";
936
-        this.saveWeek(this.sellItem).then(fulfilled => {
937
-          this.paygateRedirect();
938
-        });
944
+        this.saveWeek(this.sellItem)
945
+          .then(fulfilled => {
946
+            console.log(fulfilled);
947
+            this.$router.push({ name: "PaymentOption", params: { week: fulfilled } });
948
+            //this.paygateRedirect();
949
+          })
950
+          .catch(ex => {
951
+            this.profileEmailError = true;
952
+          });
939 953
       } else {
940 954
         this.$router.push("/user/login");
941 955
       }

+ 10
- 1
src/router/index.js 파일 보기

@@ -86,7 +86,8 @@ import ResidentialSearchResults from "../components/property/residential/residen
86 86
 import PaymentGateway from "../components/financial/paygate/paygateProcess.vue";
87 87
 import Payments from "../components/financial/payments.vue";
88 88
 import PaymentSuccess from "../components/financial/OrderThankYou.vue";
89
-import PaymentError from '../components/financial/paymentError.vue'
89
+import PaymentError from '../components/financial/paymentError.vue';
90
+import PaymentOption from '../components/financial/paymentOption.vue'
90 91
 
91 92
 import LandingPages from "../components/marketing/landingPages.vue";
92 93
 import LandingPage from "../components/marketing/landingPage.vue";
@@ -529,6 +530,14 @@ export default new Router({
529 530
       name: "statusNew",
530 531
       component: StatusNew,
531 532
     },
533
+    {
534
+      path: "/financial/paymentOption",
535
+      name: "PaymentOption",
536
+      props: route => ({
537
+        ...route.params
538
+      }),
539
+      component: PaymentOption,
540
+    },
532 541
     {
533 542
       path: "/status/Edit/:id",
534 543
       name: "statusEdit",

+ 3
- 3
src/store/modules/timeshare/timeshare.js 파일 보기

@@ -203,13 +203,13 @@ export default {
203 203
     onResortChange({ commit }, resort) {
204 204
       commit("changeResort", resort);
205 205
     },
206
-    saveWeek({ commit }, week) {
207
-      return new Promise((resolve, reject) => {
206
+    async saveWeek({ commit }, week) {
207
+      return await new Promise((resolve, reject) => {
208 208
         axios
209 209
           .post("/api/timeshareweek", week)
210 210
           .then(result => {
211 211
             commit("setWeekDetail", result.data);
212
-            resolve();
212
+            resolve(result.data);
213 213
           })
214 214
           .catch(error => reject(new Error(error.message)));
215 215
       });

Loading…
취소
저장