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.

760 lines
26 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="total"
  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. let currency = "";
  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 serviceItemNum = 0;
  269. let orderItems = [];
  270. if(selectExhibitionServiceData && selectExhibitionServiceData.length>0){
  271. for(let i=0;i<selectExhibitionServiceData.length;i++){
  272. let tmpData = selectExhibitionServiceData[i];
  273. let target = tmpData.selectServiceItems;
  274. let itemTypes = "";
  275. if(target && target.length>0){
  276. for(let j=0;j<target.length;j++){
  277. if(target[j].name!=""){
  278. if(serviceItemNum<=2){
  279. if(j>0){
  280. serviceItems +=",";
  281. }
  282. serviceItems += target[j].name;
  283. }else if(serviceItemNum==3){
  284. serviceItems +=this.$t("......etc");
  285. }
  286. if(j>0){
  287. itemTypes +=",";
  288. }
  289. serviceItemNum ++;
  290. itemTypes += target[j].name;
  291. }
  292. }
  293. }
  294. let item = "["+ tmpData.selectPackape.name +","+tmpData.length+"*"+tmpData.width+"*"+tmpData.height+"cm,"+tmpData.weight+"kg,"+itemTypes+"] x"+tmpData.quantity;
  295. orderItems.push(item);
  296. }
  297. }
  298. for(let n=0;n<quantityData.selectList.length;n++){
  299. let name = quantityData.selectList[n].name;
  300. let num = quantityData.selectList[n].number;
  301. let maxWeight = quantityData.selectList[n].maxWeight;
  302. let size = quantityData.selectList[n].size;
  303. if(num>0){
  304. let item = "["+ name +" "+ this.$t("Ton truck")+","+this.$t("Maximum load")+" "+maxWeight+","+this.$t("Car size")+" "+size+"] x"+num;
  305. orderItems.push(item);
  306. }
  307. }
  308. for(let n=0;n<quantityData.truckList.length;n++){
  309. let name = quantityData.truckList[n].name;
  310. let num = quantityData.truckList[n].number;
  311. if(num>0){
  312. let item = "["+ name +" "+this.$t("Ton lift tailgate truck")+"] x"+num;
  313. orderItems.push(item);
  314. }
  315. }
  316. if(data.totalPrice!=undefined && data.totalPrice!=""){
  317. let price = Number(data.totalPrice);
  318. this.order.total = price*0.05 + price;
  319. this.subTotal = price;
  320. this.total = price*0.05 + price;
  321. }
  322. this.order.order_item = orderItems;
  323. this.order.title = this.order.title+"("+serviceItems+")";
  324. this.order.service_name = this.order.title+"("+serviceItems+")";
  325. this.order.selectExhibition = selectExhibitionData.selectPackape.name;
  326. this.order.selectExhibitionID = selectExhibitionData.selectPackape.id;
  327. // await this.getContactList();
  328. // await this.getActiveLength();
  329. // await this.getOrder();
  330. // await this.getServiceData();
  331. // await this.getPackages();
  332. await this.getOrderQuestions();
  333. await this.getCountries();
  334. await this.getPayTypes();
  335. // await this.getCompanyList();
  336. this.isLoading = false;
  337. }
  338. },
  339. mounted() {},
  340. methods: {
  341. getQuestionList(){
  342. this.questionList = [{
  343. id: "question01",
  344. name: this.$t("Mobilization date"),
  345. type: "DateText",
  346. validation: true,
  347. value: '',
  348. requiredFlag: '1'
  349. },{
  350. id: "question02",
  351. name: this.$t("Mobilization time"),
  352. type: "TimeText",
  353. validation: true,
  354. value: '',
  355. requiredFlag: '1'
  356. },{
  357. id: "question03",
  358. name: this.$t("Exit date"),
  359. type: "DateText",
  360. validation: true,
  361. value: '',
  362. requiredFlag: '1'
  363. },{
  364. id: "question04",
  365. name: this.$t("Exit time"),
  366. type: "TimeText",
  367. validation: true,
  368. value: '',
  369. requiredFlag: '1'
  370. }];
  371. },
  372. // async getContactList() {
  373. // await this.$axios
  374. // .get(`/trending/api/Members/Contacts`)
  375. // .then((response) => {
  376. // if(response && response.data && response.data.DATA && response.data.DATA.rel){
  377. // let data = response.data.DATA.rel
  378. // if(data.length>0){
  379. // this.userContactList = data.map((item) => {
  380. // return {
  381. // first_name: item.FirstName,
  382. // last_name: item.LastName,
  383. // email: item.Email,
  384. // phone_number: item.PhoneCountryCode +"-"+ item.PhoneNo
  385. // };
  386. // });
  387. // }
  388. // }
  389. // })
  390. // .catch((err) => {
  391. // console.log(err);
  392. // });
  393. // },
  394. // async updateContactList() {
  395. // const patchData = {};
  396. // await this.$axios
  397. // .post(`/trending/api/Members/Contacts`,patchData)
  398. // .then((result) => {
  399. // // this.userContactList = result.data.contacts;
  400. // // this.activeLabel = this.userContactList.length;
  401. // // return result.data;
  402. // })
  403. // .catch((err) => {
  404. // console.log(err);
  405. // });
  406. // },
  407. async getOrder() {
  408. // await this.$axios
  409. // .get(
  410. // `/order/${this.$route.params.id}?jwt=${
  411. // this.$auth.$storage.getUniversal("jwt").token
  412. // }`
  413. // )
  414. // .then((res) => {
  415. // this.order = res.data;
  416. // for (let index in this.order[0].order_item) {
  417. // this.subTotal += this.order[0].order_item[index].item_amount;
  418. // }
  419. // for (let index in this.order[0].order_as) {
  420. // this.subTotal += this.order[0].order_as[index].as_amount;
  421. // }
  422. // this.serviceId = this.order[0].service_id;
  423. // this.currency = this.order[0].currency;
  424. // })
  425. // .catch((err) => {
  426. // console.log(err);
  427. // });
  428. },
  429. async getServiceData() {
  430. await this.$axios
  431. .get(`/trending/api/Onsite/Info?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`)
  432. .then((response) => {
  433. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  434. let data = response.data.DATA.rel
  435. if(data){
  436. // this.content.service_name = data.ServiceName;
  437. // this.content.package_name = data.Features;
  438. // this.content.package_name = data.Details;
  439. // this.content.customer_plan_name = data.CancelPolicy;
  440. // this.content.specification_name = data.FQAs;
  441. // this.content.quantity = data.ConfirmDays;
  442. // this.content.service_date = "2023-02-13";
  443. // this.content.service_time = "02:00:12";
  444. // this.content.booking_questions = data.FQAs;
  445. // this.content.preview_image = res.data.preview_image;
  446. // this.content.name = res.data.name;
  447. // this.content.country = res.data.country;
  448. // this.content.city = res.data.city;
  449. // this.content.highlights = res.data.highlights;
  450. // this.content.details = res.data.details;
  451. // this.content.cancellation_policy = res.data.cancellation_policy;
  452. // this.content.supplier = res.data.supplier;
  453. // this.content.available_sections = res.data.available_sections;
  454. // this.content.times = res.data.available_sections.times;
  455. // this.content.timeStatus = res.data.available_sections.time_status;
  456. // this.content.dateStatus = res.data.available_sections.date_status;
  457. // this.content.start = res.data.available_sections.start;
  458. // this.content.end = res.data.available_sections.end;
  459. // this.content.payment_currency = 0;
  460. }
  461. }
  462. })
  463. .catch((error) => console.log(error));
  464. },
  465. async getPayTypes() {
  466. await this.$axios
  467. .get(`/trending/api/Onsite/PayTypes?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`)
  468. .then((response) => {
  469. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  470. let data = response.data.DATA.rel
  471. if(data.length>0){
  472. this.chooseMethod = data[0].ArgumentID;
  473. this.payTypes = data.map((item)=>{
  474. return {
  475. id: item.ArgumentID,
  476. name: item.ArgumentValue,
  477. }
  478. });
  479. }
  480. }
  481. })
  482. .catch((err) => {
  483. console.log(err);
  484. });
  485. },
  486. async getOrderQuestions() {
  487. await this.$axios
  488. .get(`/trending/api/Onsite/OrderQuestions?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`)
  489. .then((response) => {
  490. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  491. let data = response.data.DATA.rel;
  492. this.getQuestionList();
  493. if(data.length>0){
  494. let list = data.map((item)=>{
  495. return {
  496. id: item.QuestionID,
  497. name: item.SurveyName,
  498. type: item.AnswerType,
  499. validation: true,
  500. value: '',
  501. requiredFlag: item.RequiredFlag
  502. }
  503. });
  504. this.questionList = this.questionList.concat(list);
  505. }
  506. }
  507. })
  508. .catch((err) => {
  509. console.log(err);
  510. });
  511. },
  512. payNow() {
  513. let isPass1 = this.$refs.ref_Booking.getValidation();//this.bookingDetail_Validation;
  514. let isPass2 = true;
  515. this.$refs.purchaserInfo.updatePurchaserInfo();//this.purchaserInfo_Validation;
  516. isPass2 = this.purchaserInfo_Validation;
  517. if(isPass1 && isPass2){
  518. let vm = this;
  519. let answerList = [];
  520. let serviceDateS = "";
  521. let serviceDateE = "";
  522. if(this.answerData.length>2){
  523. serviceDateS = this.answerData[0].value.replaceAll(".","/") +" "+ this.answerData[1].value;
  524. serviceDateE = this.answerData[2].value.replaceAll(".","/") +" "+ this.answerData[3].value;
  525. answerList = this.answerData.map((item)=>{
  526. return item.name +":"+item.value;
  527. });
  528. }
  529. if(this.payment_type==null || this.payment_type==""){
  530. return false;
  531. }
  532. let params = {
  533. LangType: this.$i18n.localeProperties["langQuery"],
  534. ExhibitionID: this.order.selectExhibitionID,
  535. CurrencyID: this.$store.getters.getCurrency,
  536. PayType: this.payment_type,
  537. ServiceID: this.serviceID,
  538. TotalPrice: this.total + "",
  539. SubTotal: this.subTotal +"",
  540. BookingItem: this.order.order_item,
  541. OrderQuestion: answerList,
  542. ServiceDateS: serviceDateS,
  543. ServiceDateE: serviceDateE,
  544. }
  545. this.isLoading = true;
  546. let jsonData = null;
  547. let statusCode = 'failed'
  548. this.$axios.post( `/trending/api/Onsite/Booking`, params)
  549. .then((response) => {
  550. this.isLoading = false;
  551. if(response && response.response && response.response.status==504){
  552. statusCode = 'failed'
  553. }else{
  554. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  555. statusCode = 'success'
  556. let data = response.data.DATA.rel;
  557. if(data){
  558. jsonData = data;
  559. }
  560. }else{
  561. statusCode = 'failed'
  562. }
  563. }
  564. this.$router.push(
  565. {
  566. path: this.localePath("/service/done/" + this.$route.params.id),
  567. //携带需要传递的参数
  568. query: {
  569. data: encodeURIComponent(JSON.stringify(jsonData)),
  570. status: statusCode,
  571. }
  572. });
  573. })
  574. .catch((err) => {
  575. this.isLoading = false;
  576. this.$router.push(
  577. {
  578. path: this.localePath("/service/done/" + this.$route.params.id),
  579. //携带需要传递的参数
  580. query: {
  581. data: encodeURIComponent(JSON.stringify(jsonData)),
  582. status: statusCode
  583. }
  584. });
  585. console.log(err);
  586. });
  587. }
  588. },
  589. async getCountries() {
  590. await this.$axios
  591. .get(`/trending/api/Onsite/Countries?Lang=${this.$i18n.localeProperties["langQuery"]}`)
  592. .then((response) => {
  593. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  594. let data = response.data.DATA.rel
  595. if(data.length>0){
  596. this.countryOptions = data.map((item)=>{
  597. return {
  598. id: item.CountryID,
  599. name: item.CountryName
  600. }
  601. });
  602. }
  603. }
  604. })
  605. .catch((err) => {
  606. console.log(err);
  607. });
  608. },
  609. getCompanyList() {
  610. this.$axios
  611. .get(
  612. `/trending/api/Members/Companies?Lang=${this.$i18n.localeProperties["langQuery"]}`
  613. )
  614. .then((response) => {
  615. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  616. let data = response.data.DATA.rel
  617. if(data.length>0){
  618. this.userCompanyList = data.map((item) => {
  619. return {
  620. company_name: item.CompanyName,
  621. company_tax_no: item.TaxNumber,
  622. company_address1: item.Street1,
  623. company_address2: item.Street2,
  624. company_city: item.CityName,
  625. company_state: item.StateName,
  626. company_country_name: item.Country.Country,
  627. company_zipcode: item.ZipCode,
  628. company_country: item.Country.CountryID,
  629. };
  630. });
  631. // this.userCompanyList = result.data.data;
  632. // Array.from(this.userCompanyList).forEach((item) => {
  633. // let id = item.company_country;
  634. // let countryName = this.countryOptions.filter(
  635. // (item) => item.id === id || null
  636. // );
  637. // item.company_country_name = countryName[0].name ?? 0;
  638. // });
  639. // return result.data;
  640. }
  641. }
  642. })
  643. .catch((err) => {
  644. console.log(err);
  645. });
  646. },
  647. updateCompanyList() {
  648. const patchData = {};
  649. this.$axios
  650. .post(
  651. `/trending/api/Members/Company`,patchData
  652. )
  653. .then((result) => {
  654. // this.userCompanyList = result.data.data;
  655. // this.companyActiveLabel = this.userCompanyList.length;
  656. // this.Company.company_name =
  657. // result.data.data[this.activeLabel].company_name;
  658. // this.Company.company_tax_no =
  659. // result.data.data[this.activeLabel].company_tax_no;
  660. // this.Company.company_address1 =
  661. // result.data.data[this.activeLabel].company_address1;
  662. // this.Company.company_address2 =
  663. // result.data.data[this.activeLabel].company_address2;
  664. // this.Company.company_city =
  665. // result.data.data[this.activeLabel].company_city;
  666. // this.Company.company_state =
  667. // result.data.data[this.activeLabel].company_state;
  668. // this.Company.company_country =
  669. // result.data.data[this.activeLabel].company_country_name;
  670. // this.Company.company_zipcode =
  671. // result.data.data[this.activeLabel].company_zipcode;
  672. // return result.data;
  673. })
  674. .catch((err) => {
  675. console.log(err);
  676. });
  677. },
  678. updateOrder() {
  679. let Object = {
  680. order_id: this.order[0].order_id,
  681. total: this.subTotal,
  682. amount: this.subTotal,
  683. discount: 0,
  684. contact: [this.contactData],
  685. answer: this.answerData,
  686. };
  687. if (this.type == "Individual") {
  688. Object.purchase_personal = this.individualData;
  689. } else {
  690. Object.purchase_company = this.companyData;
  691. }
  692. Object.payment = [this.paymentData];
  693. Object.payment[0].payment_index = 0;
  694. Object.payment[0].amount = this.subTotal;
  695. // this.$axios
  696. // .put(
  697. // `/order/${this.$route.params.id}?jwt=${
  698. // this.$auth.$storage.getUniversal("jwt").token || ""
  699. // }`,
  700. // Object
  701. // )
  702. // .then((res) => {
  703. // if (res.status == "200") {
  704. // if (this.paymentData.payment_type == "Credit Card") {
  705. // this.createPayment();
  706. // } else {
  707. // this.$router.push(
  708. // this.localePath("/service/done/" + this.$route.params.id)
  709. // );
  710. // }
  711. // }
  712. // })
  713. // .catch((error) => {
  714. // console.log(error);
  715. // });
  716. },
  717. // getActiveLength() {
  718. // this.activeLabel = this.userContactList.length > 0 ? 1 : 0;
  719. // },
  720. updateToken(token) {
  721. this.payToken = token;
  722. },
  723. // createPayment() {
  724. // this.$axios
  725. // .post(`${this.devECPayUrl}/payment/ecpay/create-payment`, {
  726. // pay_token: this.payToken,
  727. // payment_flow: "ecpay",
  728. // product_order_no: this.orderNo,
  729. // })
  730. // .then((response) => {
  731. // if (response.data.status_code === 200) {
  732. // window.location.assign(response.data.three_d_url);
  733. // }
  734. // })
  735. // .catch((error) => console.log(error));
  736. // },
  737. getBookingDetail_validation(data) {
  738. this.bookingDetail_Validation = data;
  739. },
  740. getPurchaserInfo_validation(data) {
  741. this.purchaserInfo_Validation = data;
  742. },
  743. },
  744. };
  745. </script>
  746. <style lang="scss" scoped>
  747. .noFilter {
  748. pointer-events: auto;
  749. cursor: auto;
  750. }
  751. .haveFilter {
  752. cursor: not-allowed;
  753. pointer-events: none;
  754. filter: opacity(50%);
  755. }
  756. </style>