Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | <template> <div class="shipping_inf" :class="isShipping ? 'show' : 'hide'"> <div class="shipping_inf_content d-flex flex-column"> <vueCustomScrollbar class="scroll-area px-sm-3 px-1 mb-auto" :settings="settings" > <div class="d-flex flex-column"> <div class=" head mb-3 d-flex w-100 rounded justify-content-between align-items-center " > <h6 class="py-3 p-3 text-nowrap" v-on:click.self="isAddressOpen = !isAddressOpen" > + Add Shipping Address </h6> <CloseButton class="mr-3 my-2" v-on:close="isAddressOpen = false" /> </div> <UserForm v-if="isAddressOpen" v-on:setUserInfo="setUserInfo" /> </div> <div class="d-flex flex-column"> <div class=" head w-100 mb-3 d-flex rounded justify-content-between align-items-center " > <h6 class="p-3 text-nowrap" v-on:click.self="isCardOpen = !isCardOpen" > + Add Credit Card </h6> <CloseButton class="mr-3 my-2" v-on:close="isCardOpen = false" /> </div> <Card v-if="isCardOpen" v-on:setCard="setCard" /> </div> </vueCustomScrollbar> <button class="finalize-btn text-nowrap p-3 my-3 mx-1" v-on:click="finalize" > FINALIZE AND PLACE ORDER </button> </div> </div> </template> <script> import { mapGetters, mapActions } from "vuex"; import Sign from "@/components/Sign"; import UserForm from "@/components/UserForm"; import Card from "./Card.vue"; import CloseButton from "@/components/common/CloseButton"; export default { components: { Sign, UserForm, Card, CloseButton }, props: ["isShipping"], data: () => ({ userInfo: {}, card: {}, isAddressOpen: false, isCardOpen: false, settings: { suppressScrollX: true, wheelPropagation: true, }, }), computed: { ...mapGetters({ username: "auth/username", userInf: "userInfo/userInfo", }), }, methods: { ...mapActions({ confirmOrder: "order/confirmOrder", }), setUserInfo: function (val) { this.userInfo = val; }, setCard: function (val) { this.card = val; }, finalize: function () { const isUserInfo = Object.keys(this.userInfo).length !== 0; const isCard = Object.keys(this.card).length !== 0; const data = { ...this.userInfo }; this.confirmOrder(data); if (isUserInfo && isCard) { const data = { ...this.userInfo }; data.state = this.userInfo.state.name; this.confirmOrder(data); this.$emit("nextStep"); } }, }, mounted() { this.userInfo = { ...this.userInf }; }, }; </script> <style scoped> @media (max-width: 992px) { .shipping_inf, .shipping_inf.show, .shipping_inf.hide, .finalize-btn, .scroll-area { width: 100% !important; transition: none !important; } .shipping_inf_content { width: 100%; } } @media (min-width: 992px) { .scroll-area { width: 100%; } .shipping_inf_content { width: 340px; height: 100%; } } .icon { filter: brightness(0) invert(1); } .show { width: 340px; transition: width 1s ease-in-out; } .hide { width: 0; transition: width 1s ease-in-out; } .head { cursor: pointer; background: rgb(21, 21, 22); } button { color: #fff; border: none; } .finalize-btn { width: 340px; background: #5bb85d; color: #fff; } </style> |