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.

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