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.

1360 lines
51 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
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
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. <div
  3. class="service-content tw-mb-[60px] tw-grid tw-grid-cols-1 tw-gap-[30px] md:tw-mb-[100px] xl:tw-px-[60px] xl:tw-max-w-screen-xl xl:tw-mx-auto xl:tw-grid-cols-[auto_364px]">
  4. <mobileFixTopBar ref="stickySwiper" :fixBar="fixBar" :currStep="currStep" :list="fixBarList"></mobileFixTopBar>
  5. <section class="step sercion-1 tw-w-full md:tw-px-[30px] xl:tw-px-0 xl:tw-col-span-2">
  6. <div class="tw-mt-[20px] md:tw-mb-[11px] md:tw-mt-[40px]">
  7. <Breadcrumbs></Breadcrumbs>
  8. </div>
  9. <div v-if="content.banners.length" class="tw-w-full">
  10. <slideshow :banners="content.banners"></slideshow>
  11. </div>
  12. </section>
  13. <section class="sercion-2 tw-px-[30px] md:tw-px-[30px] xl:tw-px-0 xl:tw-col-start-1 xl:tw-row-start-2">
  14. <h1 class="t16 tw-mb-[18px] md:t24">{{ content.name }}</h1>
  15. <div v-if="content.supplier"
  16. class="supplier tw-flex tw-items-center tw-mb-[20px] tw-text-base-primary t14 md:tw-mb-[30px] md:t16 md:tw-font-normal">
  17. <img :src="content.supplier.logo" class="tw-max-w-[40px] md:tw-max-w-[80px]" />
  18. <div class="t14 tw-font-normal tw-ml-[10px] md:t18 md:tw-font-normal">
  19. {{ content.supplier.brand }}
  20. </div>
  21. </div>
  22. <div class="editor-styleguide tw-text-base-primary" v-html="content.highlights"></div>
  23. </section>
  24. <section
  25. class="sercion-3 tw-grid tw-grid-cols-1 tw-gap-[30px] md:tw-gap-[40px] md:tw-px-[30px] xl:tw-px-0 xl:tw-col-start-1 xl:tw-row-start-3">
  26. <div ref="packageOptions" id="packageOptions" class="step">
  27. <div class="tw-px-[30px] md:tw-px-0">
  28. <h2 class="title-icon-left t16 tw-mb-[20px] md:t24">
  29. {{ $t("Package Options") }}
  30. </h2>
  31. <p class="text-slate-600 t12 md:t16">{{ $t("Select the exhibition you want to attend, and add the storage and delivery service of exhibits or truck pickup service") }}</p>
  32. </div>
  33. <div class="tw-w-full tw-bg-neutrals-100 tw-px-[20px] tw-py-[30px] md:tw-p-[30px] tw-rounded-[20px]">
  34. <div class="">
  35. <!-- 輸入攤位數量 -->
  36. <div v-if="serviceID" class="group tw-mb-[40px] tw-px-[20px] tw-py-[30px] tw-rounded-[20px] tw-bg-white">
  37. <h3 class="t14 tw-font-bold tw-mb-[30px] md:t16 tw-block">
  38. 輸入攤位數量
  39. </h3>
  40. <selectExhibitionBooth @booth-select="getBoothSelect"></selectExhibitionBooth>
  41. </div>
  42. <!-- 選擇展覽 -->
  43. <div v-else class="group tw-mb-[40px] tw-px-[20px] tw-py-[30px] tw-rounded-[20px] tw-bg-white">
  44. <h3 class="t14 tw-font-bold tw-mb-[30px] md:t16 tw-block">
  45. {{ $t("Select Exhibition") }}
  46. </h3>
  47. <selectExhibition ref="ref_selectExhibition" :selectYearList="selectYearList" :selectMonthList="selectMonthList" :selectExhibitionList="selectExhibitionList"></selectExhibition>
  48. </div>
  49. <div class="group tw-mb-[20px] tw-p-[20px] tw-rounded-[20px] tw-bg-white">
  50. <h3 class="t14 tw-font-bold tw-mb-[20px] md:t16 tw-block">
  51. {{ $t("Select exhibition hall service") }}
  52. </h3>
  53. <div class="tw-mb-[10px]">
  54. <p class="tw-text-neutrals-500 tw-font-normal md:t16">{{ $t("Storage service of exhibits in the exhibition hall, and assistance in transportation to the designated booth") }}</p>
  55. </div>
  56. <selectExhibitionService v-for="(item,index) in selectExhibitionServiceList"
  57. :key="item.id" :ref="'ref_selectExhibitionitem'+item.id" @ChangeCosts="ChangeCosts($event)"
  58. :selectQuantityList="selectQuantityList"
  59. :selectPackageList="selectPackageList"
  60. :typeGroupList="typeGroupList"
  61. :sort="index+1"
  62. :show = "item.id == showServiceItem"
  63. @delExhibitionService="delExhibitionService(item.id)">
  64. </selectExhibitionService>
  65. <v-btn outlined class="tw-rounded-[16px] remove-upper tw-border-primary-2 tw-text-primary-1 tw-flex tw-items-center"
  66. style="padding: 24px 10px" width="100%" @click="addExhibitionService">
  67. <v-img max-width="20" class="tw-mr-[8px]" :src="require(`@/assets/svg/new.svg`)"></v-img>
  68. <span class="t18 tw-font-normal">{{ $t("New exhibit specifications") }}</span>
  69. </v-btn>
  70. </div>
  71. <div v-show="showCardItem" class="group tw-mb-[20px] tw-p-[20px] tw-rounded-[20px] tw-bg-white">
  72. <div class="tw-flex tw-justify-between tw-items-center">
  73. <h3 class="t14 tw-font-bold tw-mb-[20px] md:t16">
  74. {{ $t("Select truck pickup service") }}
  75. </h3>
  76. <v-img v-show="pickupServiceShow" max-width="18" max-height="19" class="tw-mr-[8px] tw-cursor-pointer" :src="require(`@/assets/svg/delete_default.svg`)" @click="deletePickupSerivce()"></v-img>
  77. </div>
  78. <div class="tw-mb-[20px]">
  79. <p class="tw-text-neutrals-500 tw-font-normal md:t16">{{ $t("Pick up the goods at the designated place and transport them to the exhibition hall") }}</p>
  80. </div>
  81. <div v-show="pickupServiceShow">
  82. <div>
  83. <quantitySelectGroup ref="ref_quantitySelectGroup" :label="'Select quantity'" :quantitySelectList="quantitySelectList" @ChangeCosts="ChangeCosts($event)">
  84. </quantitySelectGroup>
  85. </div>
  86. <h3 class="t14 tw-font-bold tw-mb-[20px] md:t16 tw-block">
  87. {{ $t("Fill in the picking information") }}<span class="required t12 md:t14">*</span>
  88. </h3>
  89. <pickupInformation :selectAddressList="selectAddressList" ref="ref_pickupService" @ChangeCosts="ChangeCosts($event)"></pickupInformation>
  90. </div>
  91. <v-btn v-show="pickupServiceShow==false" outlined class="tw-rounded-[16px] remove-upper tw-border-primary-2 tw-text-primary-1 t18"
  92. style="padding: 24px 10px" width="100%" @click="pickupServiceShow = true">
  93. <v-img max-width="20" class="tw-mr-[8px]" :src="require(`@/assets/svg/new.svg`)"></v-img>
  94. <span class="t18 tw-font-normal">{{ $t("New pickup service") }}</span>
  95. </v-btn>
  96. </div>
  97. <div class="md:tw-flex md:tw-justify-between md:tw-items-center">
  98. <div class="tw-flex tw-justify-between tw-items-start md:tw-w-full md:tw-basis-10/12">
  99. <div class="tw-flex tw-flex-col tw-justify-center">
  100. <div class="tw-flex tw-items-center tw-mb-[8px] md:tw-mb-0">
  101. <div class="tw-body-4 tw-text-neutrals-900 tw-mr-[10px] md:t24">
  102. ${{ finalPrice }} {{ currencyName }}
  103. </div>
  104. </div>
  105. <!-- <div class="tw-hidden tw-body-4 tw-text-neutrals-600 md:tw-hidden">
  106. Deposit fee: $5 {{ currency }} (10%)
  107. </div> -->
  108. </div>
  109. <like></like>
  110. </div>
  111. <button
  112. class="tw-transition tw-btn-md tw-text-white tw-border tw-border-solid tw-border-primary-default tw-bg-primary-default tw-py-[8.5px] tw-mt-[20px] tw-w-full tw-rounded-xl md:tw-mt-0 md:tw-ml-[36px] md:tw-w-auto md:tw-basis-2/12 disabled:tw-bg-neutral-100 disabled:tw-text-base-disable disabled:tw-border-neutral-200"
  113. @click="bookNow" :disabled="btnDisabled">
  114. {{ $t("Book Now") }}
  115. </button>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. <div id="serviceDetails" class="serviceDetails step">
  121. <div class="tw-px-[30px] md:tw-px-0">
  122. <h2 class="title-icon-left t16 tw-mb-[20px] md:t20 xl:tw-font-bold">
  123. {{ $t("Service Details") }}
  124. </h2>
  125. <div v-if="content.details.length < 800">
  126. <div ref="details" class="editor-styleguide tw-text-base-primary t14 md:t16 md:tw-font-normal"
  127. v-html="content.details"></div>
  128. </div>
  129. <div v-else>
  130. <div :class="[
  131. button.details ? 'seeMore-hide' : 'seeMore-show',
  132. 'editor-styleguide tw-text-base-primary tw-transition t14 md:t16 md:tw-font-normal',
  133. ]" ref="details" v-html="content.details"></div>
  134. <button v-show="seeMore.details" :class="[
  135. 'seeMore tw-transition tw-btn-md tw-text-primary-1 tw-border tw-border-solid tw-border-primary-1 tw-px-[30px] tw-py-[8.5px] tw-mt-[20px] tw-w-full tw-rounded-xl hover:tw-bg-primary-3 xl:hover:tw-bg-transparent xl:tw-border-none',
  136. button.details ? '' : 'open',
  137. ]" @click="opendetail()">
  138. {{ $t(seeMoreDetailsText) }}
  139. </button>
  140. </div>
  141. </div>
  142. </div>
  143. <div id="serviceDescription" class="serviceDescription step">
  144. <div class="tw-px-[30px] md:tw-px-0">
  145. <h2 class="title-icon-left t16 tw-mb-[20px] md:t20 xl:tw-font-bold">
  146. {{ $t("Service Description") }}
  147. </h2>
  148. <div v-for="(item,index) in expenseRules" :key="index" style="border: 1px solid red;">
  149. <h3 class="t16 tw-mb-[20px] md:18 xl:t18 xl:tw-font-bold tw-pl-[10px]">
  150. {{ index+1 }}.&nbsp;{{ item.ItemName }}
  151. </h3>
  152. <table class="tablecss" width="100%" v-if="item.ItemType=='01'">
  153. <thead class="tw-bg-[#343434]">
  154. <tr>
  155. <th class="tw-text-[#fefefe]">{{$t('Weight')}}</th>
  156. <th class="tw-text-[#fefefe]">{{$t('Price (NT $, tax included)')}}</th>
  157. </tr>
  158. </thead>
  159. <tbody>
  160. <template v-if="item.StackerCostRules && item.StackerCostRules.length>0">
  161. <tr v-for="item2 in item.StackerCostRules" :key="item2.Guid">
  162. <td width="50%">{{item2.Weight_Min}}{{$t('More than tons to')}}{{item2.Weight_Max}}{{$t('Less than tons')}}</td>
  163. <td width="50%">{{item2.Price}}<span v-if="item2.PricingMode=='N'">{{$t('NTD/piece')}}</span><span v-else>{{$t('NTD/ton')}}</span></td>
  164. </tr>
  165. </template>
  166. </tbody>
  167. </table>
  168. <div ref="details" v-if="item.ItemType!='01' && item.ItemType!='02'" class="editor-styleguide tw-text-base-primary t14 md:t16 md:tw-font-normal tw-mt-[20px]"
  169. v-html="item.CostRuleText"></div>
  170. <div ref="details" class="editor-styleguide tw-text-base-primary t14 md:t16 md:tw-font-normal tw-mt-[20px]"
  171. v-html="item.ExpensesMemo"></div>
  172. </div>
  173. <!-- <div v-if="content.details.length < 800">
  174. <div ref="details" class="editor-styleguide tw-text-base-primary t14 md:t16 md:tw-font-normal"
  175. v-html="content.details"></div>
  176. </div>
  177. <div v-else>
  178. <div :class="[
  179. button.details ? 'seeMore-hide' : 'seeMore-show',
  180. 'editor-styleguide tw-text-base-primary tw-transition t14 md:t16 md:tw-font-normal',
  181. ]" ref="details" v-html="content.details"></div>
  182. <button v-show="seeMore.details" :class="[
  183. 'seeMore tw-transition tw-btn-md tw-text-primary-1 tw-border tw-border-solid tw-border-primary-1 tw-px-[30px] tw-py-[8.5px] tw-mt-[20px] tw-w-full tw-rounded-xl hover:tw-bg-primary-3 xl:hover:tw-bg-transparent xl:tw-border-none',
  184. button.details ? '' : 'open',
  185. ]" @click="opendetail()">
  186. {{ $t(seeMoreDetailsText) }}
  187. </button>
  188. </div> -->
  189. </div>
  190. </div>
  191. <div id="cancellationPolicy" class="cancellationPolicy step tw-px-[30px] md:tw-px-0">
  192. <h2 class="title-icon-left t16 tw-mb-[20px] md:t20 xl:tw-font-bold">
  193. {{ $t("Cancellation Policy") }}
  194. </h2>
  195. <div v-if="content.cancellation_policy.length < 800">
  196. <div ref="cancellation_policy" class="editor-styleguide tw-text-base-primary t14 md:t16 md:tw-font-normal"
  197. v-html="content.cancellation_policy">
  198. </div>
  199. </div>
  200. <div v-else>
  201. <div :class="[
  202. button.cancellation_policy ? 'seeMore-hide' : 'seeMore-show',
  203. 'editor-styleguide tw-text-base-primary tw-transition t14 md:t16 md:tw-font-normal',
  204. ]" ref="cancellation_policy" v-html="content.cancellation_policy"></div>
  205. <button v-show="seeMore.cancellation_policy" :class="[
  206. 'seeMore tw-transition tw-btn-md tw-text-primary-1 tw-border tw-border-solid tw-border-primary-1 tw-px-[30px] tw-py-[8.5px] tw-mt-[20px] tw-w-full tw-rounded-xl hover:tw-bg-primary-3 xl:hover:tw-bg-transparent xl:tw-border-none',
  207. button.cancellation_policy ? '' : 'open',
  208. ]" @click="openCancellationPolicy()">
  209. {{ $t(seeMoreCancellationPolicyText) }}
  210. </button>
  211. </div>
  212. </div>
  213. <div v-show="content.faq && content.faq.length>0" id="faq" ref="faq" class="step tw-px-[30px] md:tw-px-0">
  214. <h2 class="title-icon-left t16 tw-mb-[20px] md:t20 xl:tw-font-bold">
  215. {{ $t("FAQ") }}
  216. </h2>
  217. <faq :faq="content.faq" class="tw-z-[8]"></faq>
  218. </div>
  219. <div id="contactUs" class="step tw-px-[30px] md:tw-px-0">
  220. <h2 class="title-icon-left t16 tw-mb-[20px] md:t20 xl:tw-font-bold">
  221. {{ $t("Contact Us") }}
  222. </h2>
  223. <div class="tw-body-3 tw-text-base-primary tw-mb-[20px]">
  224. 886-2-2725-5000
  225. </div>
  226. <div class="tw-body-3 tw-text-base-primary">info@showeasy.com</div>
  227. </div>
  228. <div :class="[
  229. 'tw-bg-white tw-flex tw-flex-cols tw-justify-between tw-items-center tw-px-[30px] tw-py-[16px] tw-w-full',
  230. fixBar
  231. ? 'tw-fixed tw-left-[0px] tw-bottom-[0px] tw-z-[8] tw-shadow-[1px_0px_2px_rgba(0,0,0,0.25)]'
  232. : 'tw-hidden',
  233. ]">
  234. <div :class="[
  235. 'tw-flex tw-flex-col tw-justify-between tw-items-start tw-grow md:tw-w-full md:tw-flex-row md:tw-items-center',
  236. ]">
  237. <div class="tw-flex tw-items-center tw-mb-[12px] md:tw-mb-0">
  238. <div class="t16 tw-text-neutrals-900 tw-mr-[10px] md:t20 md:tw-mr-0">
  239. ${{ finalPrice }} {{ currencyName }}
  240. </div>
  241. </div>
  242. <div class="tw-flex tw-justify-center tw-items-center tw-w-full md:tw-w-fit">
  243. <like></like>
  244. <button
  245. class="tw-transition tw-whitespace-nowrap tw-body-4 tw-text-white tw-border tw-border-solid tw-border-primary-default tw-bg-primary-default tw-ml-[22px] tw-px-[24px] tw-py-[8.5px] tw-rounded-xl tw-w-full md:tw-body-2 md:tw-min-w-[130px] md:tw-max-w-[130px] md:tw-mt-0 disabled:tw-bg-neutral-100 disabled:tw-text-base-disable disabled:tw-border-neutral-200"
  246. @click="bookNow" :disabled="btnDisabled">
  247. {{ $t("Book Now") }}
  248. </button>
  249. </div>
  250. </div>
  251. </div>
  252. </section>
  253. <section
  254. class="sercion-4 tw-px-[30px] tw-grid tw-grid-cols-1 tw-gap-[40px] tw-z-[8] md:tw-px-[30px] xl:tw-px-0 xl:tw-col-start-1 xl:tw-row-start-4">
  255. <detailsModal :detail="content.details"></detailsModal>
  256. <cancellationPolicyModal :cancellationPolicy="content.cancellation_policy"></cancellationPolicyModal>
  257. </section>
  258. <section class="sercion-5 tw-hidden md:tw-px-[30px] xl:tw-px-0 xl:tw-block xl:tw-row-start-2 xl:tw-row-end-5">
  259. <div class="tw-mb-[40px]">
  260. <sidebarSelectOption :totalPrice="finalPrice" :currency="currencyName" :confirmationTime="content.confirmationTime">
  261. </sidebarSelectOption>
  262. </div>
  263. <sideBarMenu :fixBarList="fixBarList" :currStep="currStep"></sideBarMenu>
  264. </section>
  265. <v-dialog v-model="dialog" :width="423"
  266. @click:outside="colseDialog()">
  267. <v-card class="tw-p-[30px]">
  268. <v-spacer class="d-flex tw-justify-between align-center tw-mb-[30px]">
  269. <div class="tw-text-[20px] tw-text-black tw-font-bold">
  270. {{ $t("Remind") }}
  271. </div>
  272. <v-btn @click="colseDialog()" icon>
  273. <v-icon> mdi-close </v-icon>
  274. </v-btn>
  275. </v-spacer>
  276. <v-spacer class="tw-mb-[40px]">
  277. <div class="tw-text-[16px] tw-text-neutrals-800">
  278. {{$t("Your goods are of special size. Please contact ShowEasy service personnel (02) 2725-5000")}}
  279. </div>
  280. </v-spacer>
  281. <div class="tw-text-[18px] tw-rounded-[16px] tw-text-center">
  282. <span class="tw-text-primary-1 t18">{{countdown}}</span>s{{ $t("userProfile.unLinkOK") }}
  283. </div>
  284. </v-card>
  285. </v-dialog>
  286. <loading :isLoading="isLoading"></loading>
  287. </div>
  288. </template>
  289. <script>
  290. import Breadcrumbs from "@/components/Breadcrumbs";
  291. import slideshow from "@/components/swiper/serviceContent.vue";
  292. import detailsModal from "@/components/service/contentModal/DetailsModal.vue";
  293. import cancellationPolicyModal from "@/components/service/contentModal/cancellationPolicyModal.vue";
  294. import selectExhibition from "@/components/service/content/selectExhibition.vue";
  295. import selectExhibitionBooth from "@/components/service/content/selectExhibitionBooth.vue";
  296. import selectExhibitionService from "@/components/service/content/selectExhibitionService.vue";
  297. import quantitySelectGroup from "@/components/service/content/quantitySelectGroup.vue";
  298. import pickupInformation from "@/components/service/content/pickupInformation.vue";
  299. import faq from "@/components/service/content/faq.vue";
  300. import sidebarSelectOption from "@/components/service/content/sidebarSelectOption.vue";
  301. import sideBarMenu from "@/components/service/content/sideBarMenu.vue";
  302. import Swiper from "swiper/bundle";
  303. import { scrollama } from "scrollama";
  304. import mobileFixTopBar from "@/components/swiper/mobileFixTopBar.vue";
  305. import like from "@/components/newComponent/like/like.vue";
  306. import { filterData,dateIsInWeekend } from "~/utils/common";
  307. import loading from "@/components/newComponent/loading/loading.vue";
  308. export default {
  309. name: 'ServiceContent',
  310. layout: "login",
  311. auth: false,
  312. components: {
  313. Swiper,
  314. scrollama,
  315. Breadcrumbs,
  316. slideshow,
  317. detailsModal,
  318. cancellationPolicyModal,
  319. selectExhibition,
  320. selectExhibitionBooth,
  321. selectExhibitionService,
  322. quantitySelectGroup,
  323. pickupInformation,
  324. faq,
  325. sidebarSelectOption,
  326. sideBarMenu,
  327. mobileFixTopBar,
  328. like,
  329. loading,
  330. },
  331. data() {
  332. return {
  333. dialog: false,
  334. isLoading: false,
  335. showCardItem: false,
  336. pickupServiceShow: false,
  337. apiUrl: process.env.SERVICE_CONSOLE,
  338. btnDisabled: process.env.ENV == 'production',
  339. currStep: null,
  340. stickySwiper: null,
  341. content: {
  342. banners: [],
  343. country: null,
  344. city: null,
  345. name: "",
  346. highlights: '',
  347. details: '',
  348. cancellation_policy: "",
  349. saved: false,
  350. confirmation_time: 24,
  351. supplier: {
  352. logo: require('/assets/img/Footer.png'),
  353. brand: 'ShowEasy'
  354. },
  355. available_sections: null,
  356. timeStatus: 'active',
  357. dateStatus: 'active',
  358. times: [{
  359. start_time: '2023-02-06',
  360. end_time: '2023-03-06',
  361. },{
  362. start_time: '2023-02-06',
  363. end_time: '2023-03-06',
  364. },{
  365. start_time: '2023-02-06',
  366. end_time: '2023-03-06',
  367. }],
  368. start: '2023-02-06',
  369. end: '2023-06-06',
  370. faq: [],
  371. confirmationTime: '',
  372. additionalServices: [
  373. {
  374. name: '司機英文服務'
  375. },{
  376. name: '兒童安全座椅'
  377. },{
  378. name: '增加一個停靠點'
  379. },{
  380. name: '協助飯店入住(每個人,限接機)'
  381. }
  382. ],
  383. },
  384. list: [],
  385. choicesIndex: 0,
  386. countrycode: [],
  387. regionName: [],
  388. elementHeight: {
  389. details: null,
  390. cancellation_policy: null,
  391. faq: null,
  392. },
  393. seeMore: {
  394. details: true,
  395. cancellation_policy: true,
  396. },
  397. button: {
  398. details: true,
  399. cancellation_policy: true,
  400. },
  401. offset: {
  402. packageOptions: 0,
  403. faq: 0,
  404. },
  405. contentId: "",
  406. packageId: "",
  407. packageName: "",
  408. window: {
  409. width: 0,
  410. },
  411. fixBar: false,
  412. fixBarList: [
  413. { id: "packageOptions", title: "Package Options", show: true },
  414. { id: "serviceDetails", title: "Service Details", show: true },
  415. { id: "serviceDescription", title: "Service Description", show: true },
  416. { id: "cancellationPolicy", title: "Cancellation Policy", show: true },
  417. { id: "faq", title: "FAQ", show: false },
  418. { id: "contactUs", title: "Contact Us", show: true },
  419. ],
  420. activePackage: 0,
  421. totalPrice: 0,
  422. additionTotalPrice: [],
  423. customPlanPrice: [],
  424. selectDates: '',
  425. typeGroupList: [],
  426. selectQuantityList: [],
  427. selectYearList: [],
  428. selectMonthList: [],
  429. selectExhibitionList: [],
  430. selectAddressList: [],
  431. selectExhibitionServiceList: [{id: 0,show: true}],
  432. selectPackageList: [],
  433. quantitySelectList: [],
  434. deliveryType: '',
  435. expenseRules: [],
  436. finalPrice: "0",
  437. showServiceItem: 0,
  438. currencyName: '',
  439. currencyID: '',
  440. previewFile: '',
  441. countdown: 15,
  442. rulesShow: false,
  443. boothSelect: 0,
  444. serviceID: false,
  445. };
  446. },
  447. async created() {
  448. if(this.$route.params.id == "1c6e0001-e2dd-46b5-a617-4dac2f34894f"){
  449. this.serviceID = true;
  450. }else{
  451. this.serviceID = false;
  452. }
  453. this.isLoading = true;
  454. let arr = [];
  455. for(let i=1;i<11;i++){
  456. let target = {
  457. id: i+"",
  458. name: i+"",
  459. };
  460. arr.push(target);
  461. }
  462. this.selectQuantityList = arr;
  463. await this.getBanners();
  464. await this.getServiceData();
  465. await this.getExtensionYear();
  466. await this.getExtensionMonth();
  467. await this.getExhibitions();
  468. await this.getQuantitySelects();
  469. await this.getServiceItems();
  470. await this.getReceivingCitys();
  471. // await this.getFaq();
  472. await this.getPackages();
  473. await this.getInfoItem();
  474. // await this.addViewCount();
  475. // await this.getYouMightLikeData();
  476. // await this.getRegionName();
  477. // await this.getCountryCode();
  478. if (process.browser) {
  479. window.addEventListener("resize", this.handleResize);
  480. }
  481. this.handleResize();
  482. this.$nextTick(()=>{
  483. this.isLoading = false;
  484. });
  485. },
  486. mounted() {
  487. let vm = this;
  488. vm.contentId = vm.$route.params.id;
  489. vm.offset.packageOptions = vm.$refs.packageOptions.offsetTop;
  490. vm.offset.faq = vm.$refs.faq.offsetTop;
  491. vm.$nextTick(function () {
  492. // instantiate the scrollama
  493. const scrollama = require("scrollama");
  494. const scroller = scrollama();
  495. // setup the instance, pass callback functions
  496. scroller
  497. .setup({
  498. step: ".service-content .step",
  499. offset: 0.6,
  500. })
  501. .onStepEnter((response) => {
  502. // { element, index, direction }
  503. vm.currStep = response.element.id;
  504. let fb_messenger = document.querySelector(".fb_dialog_content");
  505. if (response.index > 3) {
  506. vm.$refs.stickySwiper.slideTo(4);
  507. } else {
  508. vm.$refs.stickySwiper.slideTo(0);
  509. }
  510. if (response.index >= 1 && response.index < 6) {
  511. vm.fixBar = true;
  512. if (fb_messenger) {
  513. fb_messenger.classList.add("hasBar");
  514. }
  515. } else {
  516. vm.fixBar = false;
  517. if (fb_messenger) {
  518. fb_messenger.classList.remove("hasBar");
  519. }
  520. }
  521. })
  522. .onStepExit((response) => {
  523. // { element, index, direction }
  524. vm.currStep = response.element.id;
  525. let fb_messenger = document.querySelector(".fb_dialog_content");
  526. if (response.index >= 1 && response.index < 6) {
  527. vm.fixBar = true;
  528. if (fb_messenger) {
  529. fb_messenger.classList.add("hasBar");
  530. }
  531. } else {
  532. vm.fixBar = false;
  533. if (fb_messenger) {
  534. fb_messenger.classList.remove("hasBar");
  535. }
  536. }
  537. });
  538. })
  539. },
  540. computed: {
  541. currency() {
  542. return this.$store.getters.getCurrency;
  543. },
  544. seeMoreDetailsText() {
  545. if (this.button.details == false) {
  546. return "See less";
  547. } else {
  548. return "See more";
  549. }
  550. },
  551. seeMoreCancellationPolicyText() {
  552. if (this.button.cancellation_policy == false) {
  553. return "See less";
  554. } else {
  555. return "See more";
  556. }
  557. },
  558. // finalPrice() {
  559. // let option = 0;
  560. // let custom = 0;
  561. // let addition = 0;
  562. // if (this.additionTotalPrice) {
  563. // this.additionTotalPrice.forEach((item) => {
  564. // addition += Number(item.total);
  565. // });
  566. // }
  567. // if (this.customPlanPrice) {
  568. // this.customPlanPrice.forEach((item) => {
  569. // custom += Number(item.total);
  570. // });
  571. // }
  572. // if (this.totalPrice) {
  573. // this.totalPrice.forEach((item) => {
  574. // option += Number(item.total);
  575. // });
  576. // }
  577. // if (this.currency == 'USD') {
  578. // return Number(addition + custom + option).toFixed(2).toLocaleString();
  579. // } else {
  580. // return Number(addition + custom + option).toLocaleString();
  581. // }
  582. // },
  583. },
  584. watch: {
  585. currency: {
  586. handler: function () {
  587. this.getServiceData();
  588. // this.getPackages();
  589. },
  590. },
  591. // activePackage: {
  592. // handler: function (newVal, oldVal) {
  593. // if (newVal !== oldVal) {
  594. // this.customPlanPrice = [];
  595. // this.totalPrice = [];
  596. // }
  597. // },
  598. // },
  599. // choicesIndex: {
  600. // handler: function (newVal, oldVal) {
  601. // if (newVal !== oldVal) {
  602. // this.customPlanPrice = [];
  603. // this.totalPrice = [];
  604. // }
  605. // },
  606. // }
  607. },
  608. destroyed() {
  609. if (process.browser) {
  610. window.removeEventListener("resize", this.handleResize);
  611. }
  612. },
  613. methods: {
  614. async getBanners() {
  615. await this.$axios.get(`/trending/api/Onsite/BannerFiles?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`)
  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.content.banners = data.map((item) => {
  621. return {
  622. banner_id: item.FileID,
  623. image: item.FilePath,
  624. };
  625. });
  626. }
  627. }
  628. })
  629. .catch((error) => console.log(error));
  630. },
  631. async getExtensionYear() {
  632. await this.$axios.get(`/trending/api/Onsite/ExtensionYear?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`)
  633. .then((response) => {
  634. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  635. let data = response.data.DATA.rel
  636. if(data.length>0){
  637. this.selectYearList = data.map((item) => {
  638. return {
  639. id: item.ArgumentID,
  640. name: item.ArgumentValue,
  641. };
  642. });
  643. }
  644. }
  645. })
  646. .catch((error) => console.log(error));
  647. },
  648. async getExtensionMonth() {
  649. await this.$axios.get(`/trending/api/Onsite/ExtensionMonth?Lang=${this.$i18n.localeProperties["langQuery"]}`)
  650. .then((response) => {
  651. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  652. let data = response.data.DATA.rel
  653. if(data.length>0){
  654. this.selectMonthList = data.map((item) => {
  655. return {
  656. id: item.ArgumentID,
  657. name: item.ArgumentValue,
  658. };
  659. });
  660. }
  661. }
  662. })
  663. .catch((error) => console.log(error));
  664. },
  665. async getExhibitions(){
  666. let select_year = "";
  667. let select_month = "";
  668. await this.$axios.get(`/trending/api/Onsite/Exhibitions?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}&Year=${select_year}&Month=${select_month}`)
  669. .then((response) => {
  670. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  671. let data = response.data.DATA.rel
  672. if(data.length>0){
  673. this.selectExhibitionList = data.map((item) => {
  674. return {
  675. id: item.ArgumentID,
  676. name: item.ArgumentValue,
  677. };
  678. });
  679. }
  680. }
  681. })
  682. .catch((error) => console.log(error));
  683. },
  684. async getServiceItems() {
  685. this.showCardItem = false;
  686. await this.$axios
  687. .get(`trending/api/Onsite/ServiceItems?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`)
  688. .then((response) => {
  689. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  690. let data = response.data.DATA.rel
  691. if(data.length>0){
  692. this.typeGroupList = data.map((item) => {
  693. if(item.ItemType=="02"){
  694. this.showCardItem = true;
  695. }
  696. return {
  697. package_id: item.ArgumentID,
  698. name: item.ArgumentValue,
  699. itemType: item.ItemType
  700. };
  701. });
  702. }
  703. }
  704. })
  705. .catch((error) => console.log(error));
  706. },
  707. // async getFaq() {
  708. // await this.$axios
  709. // .get(
  710. // `${this.apiUrl}/user-services/faqs?service_id=${this.$route.params.id}&lang_code=${this.$i18n.localeProperties["langQuery"]}`
  711. // )
  712. // .then((res) => {
  713. // this.content.faq = res.data;
  714. // })
  715. // .catch((error) => console.log(error));
  716. // },
  717. async getPackages() {
  718. await this.$axios
  719. .get(`trending/api/Onsite/PackingTypes?Lang=${this.$i18n.localeProperties["langQuery"]}`)
  720. .then((response) => {
  721. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  722. let data = response.data.DATA.rel
  723. if(data.length>0){
  724. this.selectPackageList = data.map((item) => {
  725. return {
  726. id: item.ArgumentID,
  727. name: item.ArgumentValue,
  728. };
  729. });
  730. }
  731. }
  732. })
  733. .catch((error) => console.log(error));
  734. },
  735. async getQuantitySelects() {
  736. await this.$axios
  737. .get(`trending/api/Onsite/TruckTypes?Lang=${this.$i18n.localeProperties["langQuery"]}`)
  738. .then((response) => {
  739. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  740. let data = response.data.DATA.rel
  741. if(data.length>0){
  742. this.quantitySelectList = data;
  743. }
  744. }
  745. })
  746. .catch((error) => console.log(error));
  747. },
  748. async getReceivingCitys() {
  749. await this.$axios
  750. .get(`trending/api/Onsite/ReceivingCitys?Lang=${this.$i18n.localeProperties["langQuery"]}`)
  751. .then((response) => {
  752. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  753. let data = response.data.DATA.rel
  754. if(data.length>0){
  755. this.selectAddressList = data.map((item) => {
  756. return {
  757. id: item.ArgumentID,
  758. name: item.ArgumentValue,
  759. };
  760. });
  761. }
  762. }
  763. })
  764. .catch((error) => console.log(error));
  765. },
  766. async getServiceData() {
  767. await this.$axios
  768. .get(`/trending/api/Onsite/Info?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`)
  769. .then((response) => {
  770. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  771. let data = response.data.DATA.rel
  772. console.log(data)
  773. if(data){
  774. this.content.name = data.ServiceName;
  775. this.content.highlights = data.Features;
  776. this.content.details = data.Details;
  777. this.content.cancellation_policy = data.CancelPolicy;
  778. this.content.faq = data.FQAs;
  779. this.currencyName = data.CurrencyName;
  780. this.currencyID = data.CurrencyID;
  781. this.previewFile = data.PreviewFile;
  782. this.finalPrice = data.MinPrice == null ? "0" : data.MinPrice +"";
  783. this.content.supplier.brand = data.SupplierName;
  784. this.content.supplier.logo = data.SupplierLogo;
  785. for(let i=0;i<this.fixBarList.length;i++){
  786. if(this.fixBarList[i].id=="faq"){
  787. if(data.FQAs && data.FQAs.length>0){
  788. this.fixBarList.show = true;
  789. }else{
  790. this.fixBarList.show = false;
  791. }
  792. break;
  793. }
  794. }
  795. this.content.confirmationTime = data.ConfirmDays;
  796. }
  797. }
  798. // this.content.country = res.data.country;
  799. // this.content.city = res.data.city;
  800. // this.content.highlights = res.data.highlights;
  801. // this.content.details = res.data.details;
  802. // this.content.cancellation_policy = res.data.cancellation_policy;
  803. // this.content.supplier = res.data.supplier;
  804. // this.content.available_sections = res.data.available_sections;
  805. // this.content.times = res.data.available_sections.times;
  806. // this.content.timeStatus = res.data.available_sections.time_status;
  807. // this.content.dateStatus = res.data.available_sections.date_status;
  808. // this.content.start = res.data.available_sections.start;
  809. // this.content.end = res.data.available_sections.end;
  810. // this.content.payment_currency = res.data.payment_currency;
  811. // this.content.confirmationTime = res.data.confirmation_time.toString();
  812. })
  813. .catch((error) => console.log(error));
  814. },
  815. //攤位數量
  816. getBoothSelect(value){
  817. this.boothSelect = value;
  818. },
  819. //抓卡車相關數據
  820. async getInfoItem() {
  821. await this.$axios
  822. .get(`/trending/api/Onsite/InfoItem?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`)
  823. .then((response) => {
  824. if(response && response.data && response.data.DATA && response.data.DATA.rel){
  825. let data = response.data.DATA.rel
  826. console.log(data);
  827. if(data.length>0){
  828. this.expenseRules = data;
  829. }
  830. }
  831. })
  832. .catch((error) => console.log(error));
  833. },
  834. async addViewCount() {
  835. let Obj = {
  836. service_id: `${this.$route.params.id}`,
  837. lang_code: `${this.$i18n.localeProperties["langQuery"]}`,
  838. add_number: 1,
  839. };
  840. await this.$axios
  841. .put(`${this.apiUrl}/user-services/view-counts`, Obj)
  842. .then((res) => { })
  843. .catch((error) => console.log(error));
  844. },
  845. opendetail() {
  846. if (this.window.width >= 1366) {
  847. this.button.details = !this.button.details;
  848. } else {
  849. this.$modal.show("Details");
  850. }
  851. },
  852. openCancellationPolicy() {
  853. if (this.window.width >= 1366) {
  854. this.button.cancellation_policy = !this.button.cancellation_policy;
  855. } else {
  856. this.$modal.show("cancellationPolicy");
  857. }
  858. },
  859. handleResize() {
  860. if (process.browser) {
  861. this.window.width = window.innerWidth;
  862. }
  863. },
  864. bookNow() {
  865. let validators = this.$refs.ref_selectExhibition.validators();
  866. console.log("this.$refs.ref_selectExhibition:" + this.$refs.ref_selectExhibition);
  867. if(validators==false){
  868. return false;
  869. }
  870. if(this.selectExhibitionServiceList.length>0){
  871. for(let i=0;i<this.selectExhibitionServiceList.length;i++){
  872. let ref = eval("this.$refs.ref_selectExhibitionitem"+this.selectExhibitionServiceList[i].id)[0];
  873. if(ref !=undefined){
  874. validators = ref.validators();
  875. if(validators==false){
  876. ref.show = true;
  877. return false;
  878. }
  879. }
  880. }
  881. }
  882. let selectExhibitionData = this.$refs.ref_selectExhibition.formData;
  883. let selectExhibitionServiceData = [];
  884. if(this.selectExhibitionServiceList.length>0){
  885. for(let i=0;i<this.selectExhibitionServiceList.length;i++){
  886. let ref = eval("this.$refs.ref_selectExhibitionitem"+this.selectExhibitionServiceList[i].id)[0];
  887. if(ref !=undefined){
  888. let target = ref.formData;
  889. selectExhibitionServiceData.push(target);
  890. }
  891. }
  892. }
  893. let quantityData = this.$refs.ref_quantitySelectGroup.formData;
  894. if(quantityData.selectList.length>0){
  895. if(this.showCardItem){
  896. validators = this.$refs.ref_quantitySelectGroup.validators();
  897. if(validators==false){
  898. this.pickupServiceShow = true;
  899. return false;
  900. }
  901. validators = this.$refs.ref_pickupService.validators();
  902. if(validators==false){
  903. this.pickupServiceShow = true;
  904. return false;
  905. }
  906. }
  907. }
  908. // let pickupServiceData = this.$refs.ref_pickupService.formData;
  909. if(this.rulesShow){
  910. this.ChangeCosts(null);
  911. return false;
  912. }
  913. this.$router.push(
  914. {
  915. path: this.localePath("/service/checkout/" + this.$route.params.id),
  916. //携带需要传递的参数
  917. query: {
  918. selectExhibitionData: encodeURIComponent(JSON.stringify(selectExhibitionData)),
  919. selectExhibitionServiceData: encodeURIComponent(JSON.stringify(selectExhibitionServiceData)),
  920. quantityData: encodeURIComponent(JSON.stringify(quantityData)),
  921. // pickupServiceData: encodeURIComponent(JSON.stringify(pickupServiceData)),
  922. totalPrice: this.totalPrice,
  923. currencyName: encodeURIComponent(this.currencyName),
  924. previewFile: encodeURIComponent(this.previewFile),
  925. title: encodeURIComponent(this.content.name)
  926. }
  927. });
  928. },
  929. // choicesIdx(data) {
  930. // let vm = this;
  931. // vm.choicesIndex = data;
  932. // },
  933. addExhibitionService(){
  934. const arr = this.selectExhibitionServiceList.map(({id})=> id);
  935. let max = arr.length>0 ? Math.max.apply(null, arr) : 0;
  936. this.selectExhibitionServiceList.push({id: max+1,show:true});
  937. this.showServiceItem = max+1;
  938. },
  939. delExhibitionService(value){
  940. if(this.selectExhibitionServiceList.length>0){
  941. for(let i=0;i<this.selectExhibitionServiceList.length;i++){
  942. if(value == this.selectExhibitionServiceList[i].id){
  943. // let index = this.selectExhibitionServiceList.indexOf(this.selectExhibitionServiceList[i]);
  944. this.selectExhibitionServiceList.splice(i, 1);
  945. break;
  946. }
  947. }
  948. }
  949. this.ChangeCosts(null);
  950. },
  951. deletePickupSerivce(){
  952. this.pickupServiceShow = false;
  953. if(this.$refs.ref_quantitySelectGroup){
  954. this.$refs.ref_quantitySelectGroup.clearAll();
  955. }
  956. },
  957. //展館服務(包裝、尺寸、數量、服務類型)
  958. ChangeCosts(data){
  959. let totalPrice = 0;
  960. this.totalPrice = 0;
  961. this.rulesShow = false;
  962. // let selectExhibitionData = this.$refs.ref_selectExhibition.formData;
  963. let selectExhibitionServiceData = [];
  964. if(this.selectExhibitionServiceList.length>0){
  965. for(let i=0;i<this.selectExhibitionServiceList.length;i++){
  966. let ref = eval("this.$refs.ref_selectExhibitionitem"+this.selectExhibitionServiceList[i].id)[0];
  967. if(ref !=undefined){
  968. let target = ref.formData;
  969. selectExhibitionServiceData.push(target);
  970. }
  971. }
  972. }
  973. if(selectExhibitionServiceData.length>0){
  974. for(let i=0;i<selectExhibitionServiceData.length;i++){
  975. let arr = selectExhibitionServiceData[i].selectServiceItems;
  976. if(arr.length>0){
  977. for(let j=0;j<arr.length;j++){
  978. if(arr[j].itemType == "01"){
  979. totalPrice += this.stackerCostRules(selectExhibitionServiceData[i],arr[j]);
  980. if(totalPrice==-1){
  981. this.totalPrice = 0;
  982. this.finalPrice = "0";
  983. this.rulesShow = true;
  984. return false;
  985. }
  986. }else if(arr[j].itemType == "02"){
  987. }else if(arr[j].itemType == "03" || arr[j].itemType == "04" || arr[j].itemType == "05" || arr[j].itemType == "06"){
  988. totalPrice += this.OtherCostRules(selectExhibitionServiceData[i],arr[j]);
  989. if(totalPrice==-1){
  990. this.totalPrice = 0;
  991. this.finalPrice = "0";
  992. this.rulesShow = true;
  993. return false;
  994. }
  995. }
  996. }
  997. }
  998. }
  999. }
  1000. let quantityData = this.$refs.ref_quantitySelectGroup.formData;
  1001. if(quantityData.selectList.length>0){
  1002. totalPrice += this.TruckCostRules();
  1003. }
  1004. this.totalPrice = Math.ceil(totalPrice);
  1005. this.finalPrice = Math.ceil(Number(totalPrice)).toLocaleString();
  1006. },
  1007. // 堆高機
  1008. stackerCostRules(data1,data2){
  1009. //這邊這邊是這個
  1010. console.log('expenseRules', this.expenseRules);
  1011. let price = 0;
  1012. let tmpWeight = 0;//Number(data1.weight)/1000;
  1013. // 材積重 長x寬x高/6000 得到噸
  1014. if((data1.length =="" && data1.width=="" && data1.height=="") && data1.weight!=""){
  1015. tmpWeight = Number(data1.weight)/1000; // Number() => 將字串轉為數值!!
  1016. } //長(沒值),寬(沒值),高(沒值) 但重量(有值) => 總噸數 = 重量(公斤)/1000!!
  1017. else if((data1.length !="" && data1.width!="" && data1.height!="") && data1.weight==""){
  1018. tmpWeight = Number(data1.length)*Number(data1.width)*Number(data1.height)/6000/1000;
  1019. } //長(有值),寬(有值),高(有值) 但重量(沒值) => 總噸數 = 長*寬*高/6000/1000!!
  1020. //長(有值),寬(有值),高(有值) 但重量(有值) => 總噸數 = 長*寬*高/6000/1000!!
  1021. else if(data1.length !="" && data1.width!="" && data1.height!="" && data1.weight!=""){
  1022. let volumeWeight = Number(data1.length)*Number(data1.width)*Number(data1.height)/6000/1000;
  1023. // 比較誰大 (材積重與客戶給出的公斤重比較)!!
  1024. if(volumeWeight>Number(data1.weight)/1000){
  1025. tmpWeight = volumeWeight; //若材積重 > 客戶給的公斤重 => 總噸數 = 材積重!!
  1026. }else{
  1027. tmpWeight = Number(data1.weight)/1000; //若材積重 < 客戶給的公斤重 => 總噸數 = 客戶給的公斤重!!
  1028. }
  1029. }
  1030. //判斷 => 若長 > 1000 或 寬 > 1000 或 高 > 330,則顯示提醒dialog!!
  1031. if(Number(data1.length) > 1000 || Number(data1.width) > 1000 || Number(data1.height)>330){
  1032. this.dialog = true;
  1033. this.openTimer();
  1034. return -1;
  1035. }
  1036. //防呆 => 若總噸數為0,則總金額為0 !!
  1037. if(tmpWeight==0){
  1038. return price;
  1039. }
  1040. if(this.expenseRules.length>0){
  1041. for(let i=0;i<this.expenseRules.length;i++){
  1042. let subArr = this.expenseRules[i].StackerCostRules;
  1043. console.log('subArr', subArr)
  1044. if(this.expenseRules[i].Guid == data2.package_id && subArr.length>0){
  1045. for(let j=0;j<subArr.length;j++){
  1046. // 需要判斷按數量還是重量
  1047. if(subArr[j].Weight_Min!="" && subArr[j].Weight_Max!=""){
  1048. if(Number(subArr[j].Weight_Min)<=tmpWeight && Number(subArr[j].Weight_Max)>=tmpWeight){
  1049. if(subArr[j].PricingMode=="N"){
  1050. price = subArr[j].Price;
  1051. }else{
  1052. price = subArr[j].Price*tmpWeight;
  1053. }
  1054. break;
  1055. }
  1056. }
  1057. }
  1058. break;
  1059. }
  1060. }
  1061. }
  1062. let num = (data1.quantity =="" || data1.quantity =="0") ? 0 : Number(data1.quantity);
  1063. price = price*num;
  1064. return price;
  1065. },
  1066. TruckCostRules(){
  1067. let price = 0;
  1068. let quantityData = this.$refs.ref_quantitySelectGroup.formData;
  1069. let pickupServiceData = this.$refs.ref_pickupService.formData;
  1070. if(this.expenseRules.length>0){
  1071. let list = filterData({ItemType: '02'},this.expenseRules);
  1072. if(list.length>0){
  1073. if(list[0].TruckCostRules.length>0 && quantityData.selectList.length>0 && pickupServiceData.address1!="" && pickupServiceData.address1!="0"){
  1074. price += this.updateForData(quantityData.selectList,list[0].TruckCostRules,pickupServiceData.address1);
  1075. }
  1076. if(list[0].TruckMarkupByModel.length>0 && quantityData.truckList.length>0){
  1077. price += this.updateForData(quantityData.truckList,list[0].TruckMarkupByModel,null);
  1078. }
  1079. // 壓車費
  1080. if(list[0].TruckEscortCostRules.length>0 && pickupServiceData.delivery_type=="2" && quantityData.selectList.length>0
  1081. && list[0].EscortFreeCityID!="" && pickupServiceData.address1!="0"){
  1082. price += this.updateForData(quantityData.selectList,list[0].TruckEscortCostRules,list[0].EscortFreeCityID);
  1083. }
  1084. if(list[0].TruckHolidayPay.length>0 && pickupServiceData.select_date!=""){
  1085. let inWeekend = dateIsInWeekend(pickupServiceData.select_date);
  1086. if(inWeekend==5 && pickupServiceData.delivery_type=="2"){
  1087. price += this.updateForData(quantityData.selectList,list[0].TruckHolidayPay,null);
  1088. }else if(inWeekend==6 && pickupServiceData.delivery_type=="2"){
  1089. price += this.updateForData(quantityData.selectList,list[0].TruckHolidayPay,null)*2;
  1090. }else if(inWeekend==0 && pickupServiceData.delivery_type=="2"){
  1091. price += this.updateForData(quantityData.selectList,list[0].TruckHolidayPay,null);
  1092. }else if(inWeekend==6 && pickupServiceData.delivery_type=="1"){
  1093. price += this.updateForData(quantityData.selectList,list[0].TruckHolidayPay,null);
  1094. }else if(inWeekend==0 && pickupServiceData.delivery_type=="1"){
  1095. price += this.updateForData(quantityData.selectList,list[0].TruckHolidayPay,null);
  1096. }
  1097. }
  1098. }
  1099. }
  1100. return price;
  1101. },
  1102. updateForData(data1,data2,address1){
  1103. let price = 0;
  1104. if(data1.length>0 && data2.length>0){
  1105. for(let n=0;n<data1.length;n++){
  1106. let truckID = data1[n].id;
  1107. let num = data1[n].number;
  1108. for(let i=0;i<data2.length;i++){
  1109. if(data2[i].CityID!=undefined && data2[i].CityID!="" && data2[i].TruckID!=""){
  1110. if(data2[i].CityID==address1 && data2[i].TruckID == truckID){
  1111. price += data2[i].Price*num;
  1112. break;
  1113. }
  1114. }else if(data2[i].CityID ==undefined && data2[i].TruckID!=""){
  1115. if(data2[i].TruckID == truckID){
  1116. price += data2[i].Price*num;
  1117. break;
  1118. }
  1119. }
  1120. }
  1121. }
  1122. }
  1123. return price;
  1124. },
  1125. OtherCostRules(data1,data2){
  1126. console.log('OtherCostRules data1: ',data1)
  1127. console.log('OtherCostRules data2: ',data2)
  1128. let price = 0;
  1129. let tmpValue = 0;
  1130. if(data1.length =="" && data1.width=="" && data1.height==""){
  1131. return price;
  1132. }else{
  1133. tmpValue = Number(data1.length)*Number(data1.width)*Number(data1.height)/1000000;
  1134. }
  1135. if(Number(data1.length) > 1000 || Number(data1.width) > 1000 || Number(data1.height)>330){
  1136. this.dialog = true;
  1137. this.openTimer();
  1138. return -1;
  1139. }
  1140. if(this.expenseRules.length>0){
  1141. for(let i=0;i<this.expenseRules.length;i++){
  1142. let subArr = this.expenseRules[i].OtherCostRules;
  1143. if(this.expenseRules[i].Guid == data2.package_id && subArr.length>0){
  1144. for(let j=0;j<subArr.length;j++){
  1145. if(subArr[j].Unit_Min!=""){
  1146. if(Number(subArr[j].Unit_Min)<tmpValue){
  1147. price = subArr[j].Price*tmpValue;
  1148. }else{
  1149. price = subArr[j].Price*subArr[j].Unit_Min;
  1150. }
  1151. break;
  1152. }
  1153. }
  1154. break;
  1155. }
  1156. }
  1157. }
  1158. let num = (data1.quantity =="" || data1.quantity =="0") ? 0 : Number(data1.quantity);
  1159. price = price*num;
  1160. return price;
  1161. },
  1162. colseDialog(){
  1163. this.dialog = false;
  1164. },
  1165. openTimer(){
  1166. this.countdown = 15;
  1167. this.timer = setInterval(() => {
  1168. if (this.countdown > 0) {
  1169. this.countdown--;
  1170. } else {
  1171. clearInterval(this.timer);
  1172. this.dialog = false;
  1173. }
  1174. }, 1000);
  1175. },
  1176. },
  1177. };
  1178. </script>
  1179. <style lang="scss" scoped>
  1180. :deep() {
  1181. // .serviceDetails,
  1182. // .cancellationPolicy {
  1183. // p {
  1184. // margin-bottom: 6px;
  1185. // }
  1186. // }
  1187. }
  1188. .service-content {
  1189. .serviceDetails img {
  1190. width: 100%;
  1191. height: auto;
  1192. }
  1193. .fix-right {
  1194. position: fixed;
  1195. top: 120px;
  1196. right: 0 px;
  1197. max-width: 400px;
  1198. height: auto;
  1199. z-index: 100;
  1200. }
  1201. .title-icon-left {
  1202. background-position: left 0px center;
  1203. }
  1204. ul {
  1205. padding-left: 24px;
  1206. }
  1207. img {
  1208. // image-rendering: pixelated;
  1209. }
  1210. }
  1211. .seeMore {
  1212. &-hide {
  1213. position: relative;
  1214. max-height: 295px;
  1215. overflow: hidden;
  1216. &::after {
  1217. content: "";
  1218. display: block;
  1219. position: absolute;
  1220. background: url("~/assets/img/gradient_white.png") repeat-x left bottom;
  1221. width: 100%;
  1222. height: 130px;
  1223. left: 0;
  1224. bottom: 0;
  1225. z-index: 1;
  1226. transition: bottom 0.5s;
  1227. }
  1228. }
  1229. &-show {
  1230. position: relative;
  1231. max-height: 100%;
  1232. overflow: initial;
  1233. &::after {
  1234. display: none;
  1235. }
  1236. }
  1237. @media screen and (min-width: 1366px) {
  1238. position: relative;
  1239. display: flex;
  1240. align-items: center;
  1241. justify-content: center;
  1242. &::after {
  1243. content: "";
  1244. display: inline-block;
  1245. position: relative;
  1246. background-image: url("~/assets/svg/arrow-down-primary.svg");
  1247. background-position: center center;
  1248. background-repeat: no-repeat;
  1249. background-size: 100%;
  1250. width: 9px;
  1251. height: 6px;
  1252. margin-left: 16px;
  1253. }
  1254. &.open {
  1255. &::after {
  1256. transform: rotate(180deg);
  1257. }
  1258. }
  1259. }
  1260. }
  1261. .section-7 {
  1262. >div {
  1263. box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.25), 0px 1px 2px rgba(0, 0, 0, 0.1);
  1264. }
  1265. }
  1266. .tablecss{
  1267. line-height: 36px;
  1268. text-align: center;
  1269. color: #343434;
  1270. // border-radius: 10px;
  1271. }
  1272. table{
  1273. border: 1px solid #cecece;
  1274. border-collapse: separate;
  1275. border-radius: 10px;
  1276. text-align: center;
  1277. border-spacing: 0px;
  1278. // padding: 10px;
  1279. }
  1280. table thead{
  1281. border-radius: 10px;
  1282. }
  1283. th{
  1284. border: 1px solid #343434;
  1285. text-align: center;
  1286. }
  1287. td{
  1288. border-top: 1px solid #cecece;
  1289. text-align: center;
  1290. }
  1291. table thead>tr:first-of-type>th:first-of-type{
  1292. border-top-left-radius: 10px;
  1293. }
  1294. table thead>tr:first-of-type>th:last-of-type{
  1295. border-top-right-radius: 10px;
  1296. }
  1297. table tfoot>tr:last-of-type>td:first-of-type{
  1298. border-bottom-left-radius: 10px;
  1299. }
  1300. table tfoot>tr:last-of-type>td:last-of-type{
  1301. border-bottom-right-radius: 10px;
  1302. }
  1303. table::before{
  1304. border-radius: 10px;
  1305. }
  1306. // table tr:first-child th:first-child {
  1307. // border-top-left-radius: 10px; /* 设置table左下圆角 */
  1308. // }
  1309. // table tr:first-child th:last-child {
  1310. // border-top-right-radius: 10px; /* 设置table右下圆角 */
  1311. // }
  1312. table tr:last-child td:first-child {
  1313. border-bottom-left-radius: 10px; /* 设置table左下圆角 */
  1314. }
  1315. table tr:last-child td:last-child {
  1316. border-bottom-right-radius: 10px; /* 设置table右下圆角 */
  1317. }
  1318. </style>