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.

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