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.

754 lines
25 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
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
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
2 years ago
  1. <template>
  2. <client-only>
  3. <div
  4. class="tw-px-[15px] tw-mb-[60px] xl:tw-px-[60px] xl:tw-max-w-screen-xl xl:tw-mx-auto xl:tw-grid xl:tw-grid-cols-[822px_auto] xl:tw-gap-[30px]"
  5. >
  6. <section
  7. class="section section-one tw-my-[40px] md:tw-my-[50px] xl:tw-col-span-2"
  8. >
  9. <StepInfo :step_active="step"></StepInfo>
  10. </section>
  11. <section class="section section-two">
  12. <h2
  13. class="t18 title-icon-left tw-text-black tw-mb-[15px] xl:tw-mb-[10px] xl:tw-text-[24px]"
  14. >
  15. {{ $t("Ordering information") }}
  16. </h2>
  17. <div
  18. class="notice tw-body-3 tw-text-black tw-mb-[20px] tw-hidden xl:tw-block"
  19. >
  20. {{
  21. $t(
  22. "Please confirm whether the information is filled in correctly. Once the information is sent, it cannot be changed"
  23. )
  24. }}
  25. </div>
  26. <BookingInfoItem
  27. ref="ref_Booking"
  28. :info="order"
  29. :content="content"
  30. :questions="questionList"
  31. @answer="answerData = $event"
  32. @bookingDetail_validation="getBookingDetail_validation"
  33. >
  34. </BookingInfoItem>
  35. <h2
  36. class="t18 title-icon-left tw-text-black tw-mb-[15px] lg:tw-mb-[8px] xl:tw-text-[24px] xl:tw-mt-[60px]"
  37. >
  38. {{ $t("Complete Payment") }}
  39. </h2>
  40. <div
  41. class="notice tw-body-3 tw-text-black tw-mb-[20px] tw-hidden xl:tw-block"
  42. >
  43. {{
  44. $t(
  45. "Please enter your info carefully. Once submitted it cannot be changed."
  46. )
  47. }}
  48. </div>
  49. <PurchaserInfo
  50. :class="[bookingDetail_Validation ? 'noFilter' : 'haveFilter']"
  51. ref="purchaserInfo"
  52. :countryOptions="countryOptions"
  53. :infoType="type"
  54. :bookingDetail_Validation="bookingDetail_Validation"
  55. @type="type = $event"
  56. @active="companyActiveLabel = $event"
  57. @individual="individualData = $event"
  58. @company="companyData = $event"
  59. @purchaserInfo_validation="getPurchaserInfo_validation"
  60. ></PurchaserInfo>
  61. <ChooseMethod
  62. :class="[purchaserInfo_Validation ? 'noFilter' : 'haveFilter']"
  63. :orderNo="orderNo"
  64. :payTypes="payTypes"
  65. :chooseMethod="chooseMethod"
  66. :purchaserInfo_Validation="purchaserInfo_Validation"
  67. @paymentType="payment_type = $event"
  68. @update="updateToken($event)"
  69. >
  70. </ChooseMethod>
  71. <!-- <Invoice v-if="language == 'zh-tw'"></Invoice> -->
  72. <PcTotalPrice
  73. :subTotal="total"
  74. :currency="currency"
  75. v-on:payNowClick="payNow()"
  76. ></PcTotalPrice>
  77. </section>
  78. <section class="section section-three">
  79. <PriceInfo
  80. :info="order"
  81. :currency="currency"
  82. ></PriceInfo>
  83. <TotalPrice
  84. :subTotal="subTotal"
  85. :total="total"
  86. :currency="currency"
  87. v-on:payNowClick="payNow()"
  88. ></TotalPrice>
  89. </section>
  90. <!-- <AddContactModal @update="updateContactList"></AddContactModal> -->
  91. <!-- <EditContactModal
  92. ref="EditContactModal"
  93. :contact.sync="userContactList[this.activeLabel - 1]"
  94. @update="getContactList"
  95. ></EditContactModal>
  96. <AddCompanyModal
  97. :selectList.sync="countryOptions"
  98. @update="updateCompanyList()"
  99. >
  100. </AddCompanyModal>
  101. <EditCompanyModal
  102. :selectList.sync="countryOptions"
  103. :company.sync="userCompanyList[companyActiveLabel - 1]"
  104. @update="getCompanyList()"
  105. ></EditCompanyModal> -->
  106. <loading :isLoading="isLoading"></loading>
  107. </div></client-only>
  108. </template>
  109. <script>
  110. import StepInfo from "@/components/service/StepInfo";
  111. import BookingInfoItem from "@/components/service/BookingInfoItem";
  112. import PurchaserInfo from "@/components/service/PurchaserInfo";
  113. import ChooseMethod from "@/components/service/ChooseMethod";
  114. import PriceInfo from "@/components/service/PriceInfo";
  115. import TotalPrice from "@/components/service/TotalPrice";
  116. import PcTotalPrice from "@/components/service/PcTotalPrice";
  117. import elementInput from "@/components/newComponent/form/ElementInput";
  118. // import AddContactModal from "@/components/newComponent/modal/AddContactModal";
  119. // import EditContactModal from "@/components/newComponent/modal/EditContactModal";
  120. // import AddCompanyModal from "@/components/newComponent/modal/AddCompanyModal";
  121. // import EditCompanyModal from "@/components/newComponent/modal/EditCompanyModal";
  122. import Invoice from "@/components/service/Invoice.vue";
  123. // import ElementInputNew from "@/components/newComponent/form/ElementInputNew";
  124. import loading from "@/components/newComponent/loading/loading.vue";
  125. export default {
  126. name: "checkout",
  127. layout: "service",
  128. auth: true,
  129. components: {
  130. StepInfo,
  131. BookingInfoItem,
  132. PurchaserInfo,
  133. ChooseMethod,
  134. PriceInfo,
  135. TotalPrice,
  136. PcTotalPrice,
  137. elementInput,
  138. Invoice,
  139. loading,
  140. // AddContactModal,
  141. // EditContactModal,
  142. // AddCompanyModal,
  143. // EditCompanyModal,
  144. // ElementInputNew,
  145. },
  146. data() {
  147. return {
  148. isLoading: false,
  149. serviceID: '',
  150. apiUrl: process.env.SERVICE_CONSOLE,
  151. devECPayUrl: "https://dev-lambda.showeasy.com",
  152. language: this.$i18n.locale,
  153. step: "2",
  154. orderNo: this.$route.params.id,
  155. order: {
  156. title: '',
  157. detail: '',
  158. preview_image: '',
  159. date: '',
  160. quantity: '',
  161. total: 0,
  162. service_name: '',
  163. package_name: '',
  164. package_name: '',
  165. customer_plan_name: '',
  166. service_date: '',
  167. service_time: '',
  168. selectExhibition: '',
  169. selectExhibitionID: '',
  170. order_as: [],
  171. order_item: []
  172. },
  173. serviceId: "",
  174. currency: "NTD",
  175. type: "Company",
  176. individualData: {},
  177. companyData: {},
  178. contactData: {},
  179. paymentData: {},
  180. answerData: [],
  181. content: {
  182. preview_image: "",
  183. country: null,
  184. city: null,
  185. name: "",
  186. highlights: "",
  187. details: "",
  188. cancellation_policy: "",
  189. saved: false,
  190. confirmation_time: 24,
  191. supplier: null,
  192. available_sections: null,
  193. timeStatus: "",
  194. dateStatus: "",
  195. times: [],
  196. start: "",
  197. end: "",
  198. faq: null,
  199. packages: [],
  200. additionalServices: [],
  201. booking_questions: [],
  202. },
  203. subTotal: 0,
  204. total: 0,
  205. activeLabel: 0,
  206. companyActiveLabel: 0,
  207. userContactList: [],
  208. userCompanyList: [],
  209. countryOptions: [],
  210. contact: [],
  211. method: "",
  212. payToken: "",
  213. three_d_url: "",
  214. validation: {
  215. bookingInfo: false,
  216. purchaserInfo: false,
  217. chooseMethod: false,
  218. },
  219. bookingDetail_Validation: false,
  220. purchaserInfo_Validation: false,
  221. chooseMethod: "",
  222. payTypes: [],
  223. questionList: [{
  224. id: "question01",
  225. name: this.$t("Mobilization date"),
  226. type: "DateText",
  227. validation: true,
  228. value: '',
  229. requiredFlag: '1'
  230. },{
  231. id: "question02",
  232. name: this.$t("Mobilization time"),
  233. type: "TimeText",
  234. validation: true,
  235. value: '',
  236. requiredFlag: '1'
  237. },{
  238. id: "question03",
  239. name: this.$t("Exit date"),
  240. type: "DateText",
  241. validation: true,
  242. value: '',
  243. requiredFlag: '1'
  244. },{
  245. id: "question04",
  246. name: this.$t("Exit time"),
  247. type: "TimeText",
  248. validation: true,
  249. value: '',
  250. requiredFlag: '1'
  251. }],
  252. payment_type: '',
  253. };
  254. },
  255. async created() {
  256. this.isLoading = true;
  257. if (this.$auth.loggedIn) {
  258. let data = this.$route.query;
  259. this.serviceID = this.$route.params.id;
  260. let selectExhibitionData = JSON.parse(decodeURIComponent(data.selectExhibitionData));
  261. let selectExhibitionServiceData = JSON.parse(decodeURIComponent(data.selectExhibitionServiceData));
  262. let quantityData = JSON.parse(decodeURIComponent(data.quantityData));
  263. this.currency = decodeURIComponent(data.currencyName);
  264. // let pickupServiceData = JSON.parse(data.pickupServiceData);
  265. this.order.preview_image = decodeURIComponent(data.previewFile);
  266. this.order.title = decodeURIComponent(data.title);
  267. let serviceItems = "";
  268. let orderItems = [];
  269. if(selectExhibitionServiceData && selectExhibitionServiceData.length>0){
  270. for(let i=0;i<selectExhibitionServiceData.length;i++){
  271. let tmpData = selectExhibitionServiceData[i];
  272. let target = tmpData.selectServiceItems;
  273. let itemTypes = "";
  274. if(target && target.length>0){
  275. for(let j=0;j<target.length;j++){
  276. if(target[j].name!=""){
  277. if(j>0){
  278. itemTypes +=",";
  279. }
  280. itemTypes += target[j].name;
  281. }
  282. }
  283. }
  284. let item = "["+ tmpData.selectPackape.name +","+tmpData.length+"*"+tmpData.width+"*"+tmpData.height+"cm,"+tmpData.weight+"kg,"+itemTypes+"] x"+tmpData.quantity;
  285. orderItems.push(item);
  286. }
  287. }
  288. for(let n=0;n<quantityData.selectList.length;n++){
  289. let name = quantityData.selectList[n].name;
  290. let num = quantityData.selectList[n].number;
  291. let maxWeight = quantityData.selectList[n].maxWeight;
  292. let size = quantityData.selectList[n].size;
  293. if(num>0){
  294. let item = "["+ name +" "+ this.$t("Ton truck")+","+this.$t("Maximum load")+" "+maxWeight+","+this.$t("Car size")+" "+size+"] x"+num;
  295. orderItems.push(item);
  296. }
  297. }
  298. for(let n=0;n<quantityData.truckList.length;n++){
  299. let name = quantityData.truckList[n].name;
  300. let num = quantityData.truckList[n].number;
  301. if(num>0){
  302. let item = "["+ name +" "+this.$t("Ton lift tailgate truck")+"] x"+num;
  303. orderItems.push(item);
  304. }
  305. }
  306. if(data.totalPrice!=undefined && data.totalPrice!=""){
  307. let price = Number(data.totalPrice);
  308. this.order.total = Math.ceil(price);
  309. this.subTotal = Math.ceil(price);
  310. this.total = Math.ceil(price*0.05)+Math.ceil(price);
  311. }
  312. this.order.order_item = orderItems;
  313. let title = this.order.title;
  314. this.order.title = title;
  315. this.order.service_name = title;
  316. this.order.selectExhibition = selectExhibitionData.selectPackape.name;
  317. this.order.selectExhibitionID = selectExhibitionData.selectPackape.id;
  318. // await this.getContactList();
  319. // await this.getActiveLength();
  320. // await this.getOrder();
  321. // await this.getServiceData();
  322. // await this.getPackages();
  323. await this.getOrderQuestions();
  324. await this.getCountries();
  325. await this.getPayTypes();
  326. // await this.getCompanyList();
  327. this.$nextTick(()=>{
  328. this.isLoading = false;
  329. });
  330. }
  331. },
  332. mounted() {},
  333. methods: {
  334. getQuestionList(){
  335. this.questionList = [{
  336. id: "question01",
  337. name: this.$t("Mobilization date"),
  338. type: "DateText",
  339. validation: true,
  340. value: '',
  341. requiredFlag: '1'
  342. },{
  343. id: "question02",
  344. name: this.$t("Mobilization time"),
  345. type: "TimeText",
  346. validation: true,
  347. value: '',
  348. requiredFlag: '1'
  349. },{
  350. id: "question03",
  351. name: this.$t("Exit date"),
  352. type: "DateText",
  353. validation: true,
  354. value: '',
  355. requiredFlag: '1'
  356. },{
  357. id: "question04",
  358. name: this.$t("Exit time"),
  359. type: "TimeText",
  360. validation: true,
  361. value: '',
  362. requiredFlag: '1'
  363. }];
  364. },
  365. // async getContactList() {
  366. // await this.$axios
  367. // .get(`/trending/api/Members/Contacts`)
  368. // .then((response) => {
  369. // if(response && response.data && response.data.DATA && response.data.DATA.rel){
  370. // let data = response.data.DATA.rel
  371. // if(data.length>0){
  372. // this.userContactList = data.map((item) => {
  373. // return {
  374. // first_name: item.FirstName,
  375. // last_name: item.LastName,
  376. // email: item.Email,
  377. // phone_number: item.PhoneCountryCode +"-"+ item.PhoneNo
  378. // };
  379. // });
  380. // }
  381. // }
  382. // })
  383. // .catch((err) => {
  384. // console.log(err);
  385. // });
  386. // },
  387. // async updateContactList() {
  388. // const patchData = {};
  389. // await this.$axios
  390. // .post(`/trending/api/Members/Contacts`,patchData)
  391. // .then((result) => {
  392. // // this.userContactList = result.data.contacts;
  393. // // this.activeLabel = this.userContactList.length;
  394. // // return result.data;
  395. // })
  396. // .catch((err) => {
  397. // console.log(err);
  398. // });
  399. // },
  400. async getOrder() {
  401. // await this.$axios
  402. // .get(
  403. // `/order/${this.$route.params.id}?jwt=${
  404. // this.$auth.$storage.getUniversal("jwt").token
  405. // }`
  406. // )
  407. // .then((res) => {
  408. // this.order = res.data;
  409. // for (let index in this.order[0].order_item) {
  410. // this.subTotal += this.order[0].order_item[index].item_amount;
  411. // }
  412. // for (let index in this.order[0].order_as) {
  413. // this.subTotal += this.order[0].order_as[index].as_amount;
  414. // }
  415. // this.serviceId = this.order[0].service_id;
  416. // this.currency = this.order[0].currency;
  417. // })
  418. // .catch((err) => {
  419. // console.log(err);
  420. // });
  421. },
  422. async getServiceData() {
  423. await this.$axios
  424. .get(`/trending/api/Onsite/Info?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`)
  425. .then((response) => {
  426. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  427. let data = response.data.DATA.rel
  428. if(data){
  429. // this.content.service_name = data.ServiceName;
  430. // this.content.package_name = data.Features;
  431. // this.content.package_name = data.Details;
  432. // this.content.customer_plan_name = data.CancelPolicy;
  433. // this.content.specification_name = data.FQAs;
  434. // this.content.quantity = data.ConfirmDays;
  435. // this.content.service_date = "2023-02-13";
  436. // this.content.service_time = "02:00:12";
  437. // this.content.booking_questions = data.FQAs;
  438. // this.content.preview_image = res.data.preview_image;
  439. // this.content.name = res.data.name;
  440. // this.content.country = res.data.country;
  441. // this.content.city = res.data.city;
  442. // this.content.highlights = res.data.highlights;
  443. // this.content.details = res.data.details;
  444. // this.content.cancellation_policy = res.data.cancellation_policy;
  445. // this.content.supplier = res.data.supplier;
  446. // this.content.available_sections = res.data.available_sections;
  447. // this.content.times = res.data.available_sections.times;
  448. // this.content.timeStatus = res.data.available_sections.time_status;
  449. // this.content.dateStatus = res.data.available_sections.date_status;
  450. // this.content.start = res.data.available_sections.start;
  451. // this.content.end = res.data.available_sections.end;
  452. // this.content.payment_currency = 0;
  453. }
  454. }
  455. })
  456. .catch((error) => console.log(error));
  457. },
  458. async getPayTypes() {
  459. await this.$axios
  460. .get(`/trending/api/Onsite/PayTypes?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`)
  461. .then((response) => {
  462. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  463. let data = response.data.DATA.rel
  464. if(data.length>0){
  465. this.chooseMethod = data[0].ArgumentID;
  466. this.payTypes = data.map((item)=>{
  467. return {
  468. id: item.ArgumentID,
  469. name: item.ArgumentValue,
  470. }
  471. });
  472. }
  473. }
  474. })
  475. .catch((err) => {
  476. console.log(err);
  477. });
  478. },
  479. async getOrderQuestions() {
  480. await this.$axios
  481. .get(`/trending/api/Onsite/OrderQuestions?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`)
  482. .then((response) => {
  483. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  484. let data = response.data.DATA.rel;
  485. this.getQuestionList();
  486. if(data.length>0){
  487. let list = data.map((item)=>{
  488. return {
  489. id: item.QuestionID,
  490. name: item.SurveyName,
  491. type: item.AnswerType,
  492. validation: true,
  493. value: '',
  494. requiredFlag: item.RequiredFlag
  495. }
  496. });
  497. this.questionList = this.questionList.concat(list);
  498. }
  499. }
  500. })
  501. .catch((err) => {
  502. console.log(err);
  503. });
  504. },
  505. payNow() {
  506. let isPass1 = this.$refs.ref_Booking.getValidation();//this.bookingDetail_Validation;
  507. let isPass2 = true;
  508. this.$refs.purchaserInfo.updatePurchaserInfo(true);//this.purchaserInfo_Validation;
  509. isPass2 = this.purchaserInfo_Validation;
  510. if(isPass1 && isPass2){
  511. let vm = this;
  512. let answerList = [];
  513. let serviceDateS = "";
  514. let serviceDateE = "";
  515. if(this.answerData.length>2){
  516. serviceDateS = this.answerData[0].value.replaceAll(".","/") +" "+ this.answerData[1].value;
  517. serviceDateE = this.answerData[2].value.replaceAll(".","/") +" "+ this.answerData[3].value;
  518. answerList = this.answerData.map((item)=>{
  519. return item.name +":"+item.value;
  520. });
  521. }
  522. if(this.payment_type==null || this.payment_type==""){
  523. return false;
  524. }
  525. let params = {
  526. LangType: this.$i18n.localeProperties["langQuery"],
  527. ExhibitionID: this.order.selectExhibitionID,
  528. CurrencyID: this.$store.getters.getCurrency,
  529. PayType: this.payment_type,
  530. ServiceID: this.serviceID,
  531. TotalPrice: this.total + "",
  532. SubTotal: this.subTotal +"",
  533. BookingItem: this.order.order_item,
  534. OrderQuestion: answerList,
  535. ServiceDateS: serviceDateS,
  536. ServiceDateE: serviceDateE,
  537. }
  538. this.isLoading = true;
  539. let jsonData = null;
  540. let statusCode = 'failed'
  541. this.$axios.post( `/trending/api/Onsite/Booking`, params)
  542. .then((response) => {
  543. this.isLoading = false;
  544. if(response && response.response && response.response.status==504){
  545. statusCode = 'failed'
  546. }else{
  547. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  548. statusCode = 'success'
  549. let data = response.data.DATA.rel;
  550. if(data){
  551. jsonData = data;
  552. }
  553. }else{
  554. statusCode = 'failed'
  555. }
  556. }
  557. this.$router.push(
  558. {
  559. path: this.localePath("/service/done/" + this.$route.params.id),
  560. //携带需要传递的参数
  561. query: {
  562. data: encodeURIComponent(JSON.stringify(jsonData)),
  563. status: statusCode,
  564. }
  565. });
  566. })
  567. .catch((err) => {
  568. this.isLoading = false;
  569. this.$router.push(
  570. {
  571. path: this.localePath("/service/done/" + this.$route.params.id),
  572. //携带需要传递的参数
  573. query: {
  574. data: encodeURIComponent(JSON.stringify(jsonData)),
  575. status: statusCode
  576. }
  577. });
  578. console.log(err);
  579. });
  580. }
  581. },
  582. async getCountries() {
  583. await this.$axios
  584. .get(`/trending/api/Onsite/Countries?Lang=${this.$i18n.localeProperties["langQuery"]}`)
  585. .then((response) => {
  586. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  587. let data = response.data.DATA.rel
  588. if(data.length>0){
  589. this.countryOptions = data.map((item)=>{
  590. return {
  591. id: item.CountryID,
  592. name: item.CountryName
  593. }
  594. });
  595. }
  596. }
  597. })
  598. .catch((err) => {
  599. console.log(err);
  600. });
  601. },
  602. getCompanyList() {
  603. this.$axios
  604. .get(
  605. `/trending/api/Members/Companies?Lang=${this.$i18n.localeProperties["langQuery"]}`
  606. )
  607. .then((response) => {
  608. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  609. let data = response.data.DATA.rel
  610. if(data.length>0){
  611. this.userCompanyList = data.map((item) => {
  612. return {
  613. company_name: item.CompanyName,
  614. company_tax_no: item.TaxNumber,
  615. company_address1: item.Street1,
  616. company_address2: item.Street2,
  617. company_city: item.CityName,
  618. company_state: item.StateName,
  619. company_country_name: item.Country.Country,
  620. company_zipcode: item.ZipCode,
  621. company_country: item.Country.CountryID,
  622. };
  623. });
  624. // this.userCompanyList = result.data.data;
  625. // Array.from(this.userCompanyList).forEach((item) => {
  626. // let id = item.company_country;
  627. // let countryName = this.countryOptions.filter(
  628. // (item) => item.id === id || null
  629. // );
  630. // item.company_country_name = countryName[0].name ?? 0;
  631. // });
  632. // return result.data;
  633. }
  634. }
  635. })
  636. .catch((err) => {
  637. console.log(err);
  638. });
  639. },
  640. updateCompanyList() {
  641. const patchData = {};
  642. this.$axios
  643. .post(
  644. `/trending/api/Members/Company`,patchData
  645. )
  646. .then((result) => {
  647. // this.userCompanyList = result.data.data;
  648. // this.companyActiveLabel = this.userCompanyList.length;
  649. // this.Company.company_name =
  650. // result.data.data[this.activeLabel].company_name;
  651. // this.Company.company_tax_no =
  652. // result.data.data[this.activeLabel].company_tax_no;
  653. // this.Company.company_address1 =
  654. // result.data.data[this.activeLabel].company_address1;
  655. // this.Company.company_address2 =
  656. // result.data.data[this.activeLabel].company_address2;
  657. // this.Company.company_city =
  658. // result.data.data[this.activeLabel].company_city;
  659. // this.Company.company_state =
  660. // result.data.data[this.activeLabel].company_state;
  661. // this.Company.company_country =
  662. // result.data.data[this.activeLabel].company_country_name;
  663. // this.Company.company_zipcode =
  664. // result.data.data[this.activeLabel].company_zipcode;
  665. // return result.data;
  666. })
  667. .catch((err) => {
  668. console.log(err);
  669. });
  670. },
  671. updateOrder() {
  672. let Object = {
  673. order_id: this.order[0].order_id,
  674. total: this.subTotal,
  675. amount: this.subTotal,
  676. discount: 0,
  677. contact: [this.contactData],
  678. answer: this.answerData,
  679. };
  680. if (this.type == "Individual") {
  681. Object.purchase_personal = this.individualData;
  682. } else {
  683. Object.purchase_company = this.companyData;
  684. }
  685. Object.payment = [this.paymentData];
  686. Object.payment[0].payment_index = 0;
  687. Object.payment[0].amount = this.subTotal;
  688. // this.$axios
  689. // .put(
  690. // `/order/${this.$route.params.id}?jwt=${
  691. // this.$auth.$storage.getUniversal("jwt").token || ""
  692. // }`,
  693. // Object
  694. // )
  695. // .then((res) => {
  696. // if (res.status == "200") {
  697. // if (this.paymentData.payment_type == "Credit Card") {
  698. // this.createPayment();
  699. // } else {
  700. // this.$router.push(
  701. // this.localePath("/service/done/" + this.$route.params.id)
  702. // );
  703. // }
  704. // }
  705. // })
  706. // .catch((error) => {
  707. // console.log(error);
  708. // });
  709. },
  710. // getActiveLength() {
  711. // this.activeLabel = this.userContactList.length > 0 ? 1 : 0;
  712. // },
  713. updateToken(token) {
  714. this.payToken = token;
  715. },
  716. // createPayment() {
  717. // this.$axios
  718. // .post(`${this.devECPayUrl}/payment/ecpay/create-payment`, {
  719. // pay_token: this.payToken,
  720. // payment_flow: "ecpay",
  721. // product_order_no: this.orderNo,
  722. // })
  723. // .then((response) => {
  724. // if (response.data.status_code === 200) {
  725. // window.location.assign(response.data.three_d_url);
  726. // }
  727. // })
  728. // .catch((error) => console.log(error));
  729. // },
  730. getBookingDetail_validation(data) {
  731. this.bookingDetail_Validation = data;
  732. },
  733. getPurchaserInfo_validation(data) {
  734. this.purchaserInfo_Validation = data;
  735. },
  736. },
  737. };
  738. </script>
  739. <style lang="scss" scoped>
  740. .noFilter {
  741. pointer-events: auto;
  742. cursor: auto;
  743. }
  744. .haveFilter {
  745. cursor: not-allowed;
  746. pointer-events: none;
  747. filter: opacity(50%);
  748. }
  749. </style>