SdkForm.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. <template>
  2. <div>
  3. <div v-if="modalShow" class="success-modal">
  4. <img src="http://cn-file.17pdf.com/website/sdk/ic_store_success.png" alt="success">
  5. <div class="title">感谢您与我们联系。</div>
  6. <div class="desc">您的信息已成功发送,我们将在24小时内回复您。</div>
  7. </div>
  8. <div v-else class="en poppins">
  9. <div class=" contact-container lg:flex lg:justify-between lg:mb-20px">
  10. <div class="w-full">
  11. <!-- 用户产品描述 非必填项 -->
  12. <div class="text-sm font-600 mb-20px text-[#232748]">{{ contactSales.aboutProject }}</div>
  13. <textarea
  14. class="appearance-none w-full p-12px text-14px leading-20px rounded-6px outline-none border-1px border-[#E1E3E8] focus:border-[#396FFA] hover:border-[#396FFA] resize-y"
  15. v-model.trim="description"
  16. placeholder="您的项目使用场景是什么?(什么情况下需要用到什么功能)"
  17. rows="6"
  18. @input="handleInfo('description')"
  19. ></textarea>
  20. <!-- SDK构建的产品是对内/对外 -->
  21. <div class="mt-30px mb-20px text-sm text-[#232748] font-600 "><i class="text-[#FF5050] mt-10px">*</i> {{ contactSales.whoBuildFor }}</div>
  22. <div class="relative">
  23. <select class="w-full h-44px px-12px rounded-6px appearance-none border-1px border-[#E1E3E8] outline-none focus:border-[#396FFA] hover:border-[#396FFA]" v-model="building" name="building" @change="handleInfo('building', $event)">
  24. <option value="公司内部">{{ contactSales.forCustomers }}</option>
  25. <option value="公司产品的终端用户">{{ contactSales.forInternalUse }}</option>
  26. <option value="另一家公司的产品">{{ contactSales.forAnotherCompany }}</option>
  27. </select>
  28. <Arrow class="absolute bottom-18px right-18px z-2 w-14px h-8px pointer-events-none " />
  29. </div>
  30. <!-- 平台 -->
  31. <div class="mt-30px mb-16px text-sm font-600 text-[#232748]"><i class="text-[#FF5050] mt-10px">*</i> {{ contactSales.whatDeploy }}</div>
  32. <div class="grid gap-y-24px grid-cols-3">
  33. <label class="flex items-center">
  34. <input v-model="platforms" type="checkbox" value="Windows" @change="clearErrInfo('platforms')">
  35. <CheckBox v-if="platforms.includes('Windows')" />
  36. <span v-else class="box"></span>
  37. <span class="ml-8px text-brand-0"><Windows class="w-24px h-24px" /></span>
  38. <span class="text-sm text-[#52555F] ml-6px">Windows</span>
  39. </label>
  40. <label class="flex items-center">
  41. <input v-model="platforms" type="checkbox" value="Web" @change="clearErrInfo('platforms')">
  42. <CheckBox v-if="platforms.includes('Web')" />
  43. <span v-else class="box"></span>
  44. <span class="ml-8px text-brand-0"><Web class="w-24px h-24px" /></span>
  45. <span class="text-sm text-[#52555F] ml-6px">Web</span>
  46. </label>
  47. <label class="flex items-center">
  48. <input v-model="platforms" type="checkbox" value="Android" @change="clearErrInfo('platforms')">
  49. <CheckBox v-if="platforms.includes('Android')" />
  50. <span v-else class="box"></span>
  51. <span class="ml-8px text-brand-0"><Android class="w-24px h-24px" /></span>
  52. <span class="text-sm text-[#52555F] ml-6px ">Android</span>
  53. </label>
  54. <label class="flex items-center">
  55. <input v-model="platforms" type="checkbox" value="iOS" @change="clearErrInfo('platforms')">
  56. <CheckBox v-if="platforms.includes('iOS')" />
  57. <span v-else class="box"></span>
  58. <span class="ml-8px text-brand-0"><iOS class="w-24px h-24px" /></span>
  59. <span class="text-sm text-[#52555F] ml-6px">iOS</span>
  60. </label>
  61. <label class="flex items-center">
  62. <input v-model="platforms" type="checkbox" value="Mac Catalyst" @change="clearErrInfo('platforms')">
  63. <CheckBox v-if="platforms.includes('Mac Catalyst')" />
  64. <span v-else class="box"></span>
  65. <span class="ml-8px text-brand-0"><Mac class="w-24px h-24px" /></span>
  66. <span class="text-sm text-[#52555F] ml-6px">Mac Catalyst</span>
  67. </label>
  68. <label class="flex items-center">
  69. <input v-model="platforms" type="checkbox" value="Linux" @change="clearErrInfo('platforms')">
  70. <CheckBox v-if="platforms.includes('Linux')" />
  71. <span v-else class="box"></span>
  72. <span class="ml-8px text-brand-0"><Linux class="w-24px h-24px" /></span>
  73. <span class="text-sm text-[#52555F] ml-6px">Linux</span>
  74. </label>
  75. <label class="flex items-center">
  76. <input v-model="platforms" type="checkbox" value="ComPDFKit API" @change="clearErrInfo('platforms')">
  77. <CheckBox v-if="platforms.includes('ComPDFKit API')" />
  78. <span v-else class="box"></span>
  79. <span class="ml-8px text-brand-0"><Compdf class="w-24px h-24px" /></span>
  80. <span class="text-sm text-[#52555F] ml-6px whitespace-nowrap">API 解决方案</span>
  81. </label>
  82. </div>
  83. <div v-show="platforms_err && submitted" class="text-[#FF5050] mt-10px">{{ platforms_err }}</div>
  84. <!-- 功能 -->
  85. <div class="mt-27px mb-20px text-sm font-600 "><i class="text-[#FF5050] mt-10px">*</i> {{ contactSales.whichFeatures }}</div>
  86. <div class="grid gap-y-24px grid-cols-3">
  87. <label class="flex items-center">
  88. <input v-model="features" type="checkbox" value="PDF查看" @change="clearErrInfo('features')">
  89. <CheckBox v-if="features.includes('PDF查看')" />
  90. <span v-else class="box"></span>
  91. <span class="text-sm text-[#232748] ml-9px ">{{ contactSales.platforms.viewer }}</span>
  92. </label>
  93. <label class="flex items-center">
  94. <input v-model="features" type="checkbox" value="PDF批注" @change="clearErrInfo('features')">
  95. <CheckBox v-if="features.includes('PDF批注')" />
  96. <span v-else class="box"></span>
  97. <span class="text-sm text-[#232748] ml-9px ">PDF批注</span>
  98. </label>
  99. <label class="flex items-center">
  100. <input v-model="features" type="checkbox" value="PDF签名" @change="clearErrInfo('features')">
  101. <CheckBox v-if="features.includes('PDF签名')" />
  102. <span v-else class="box"></span>
  103. <span class="text-sm text-[#232748] ml-9px">PDF签名</span>
  104. </label>
  105. <label class="flex items-center">
  106. <input v-model="features" type="checkbox" value="PDF内容编辑" @change="clearErrInfo('features')">
  107. <CheckBox v-if="features.includes('PDF内容编辑')" />
  108. <span v-else class="box"></span>
  109. <span class="text-sm text-[#232748] ml-9px ">PDF内容编辑</span>
  110. </label>
  111. <label class="flex items-center">
  112. <input v-model="features" type="checkbox" value="PDF表单" @change="clearErrInfo('features')">
  113. <CheckBox v-if="features.includes('PDF表单')" />
  114. <span v-else class="box"></span>
  115. <span class="text-sm text-[#232748] ml-9px ">PDF表单</span>
  116. </label>
  117. <label class="flex items-center">
  118. <input v-model="features" type="checkbox" value="OCR识别" @change="clearErrInfo('features')">
  119. <CheckBox v-if="features.includes('OCR识别')" />
  120. <span v-else class="box"></span>
  121. <span class="text-sm text-[#232748] ml-9px ">OCR识别</span>
  122. </label>
  123. <label class="flex items-center">
  124. <input v-model="features" type="checkbox" value="PDF页面管理" @change="clearErrInfo('features')">
  125. <CheckBox v-if="features.includes('PDF页面管理')" />
  126. <span v-else class="box"></span>
  127. <span class="text-sm text-[#232748] ml-9px ">{{ contactSales.platforms.documentEditor }}</span>
  128. </label>
  129. <label class="flex items-center">
  130. <input v-model="features" type="checkbox" value="文档转换" @change="clearErrInfo('features')">
  131. <CheckBox v-if="features.includes('文档转换')" />
  132. <span v-else class="box"></span>
  133. <span class="text-sm text-[#232748] ml-9px ">文档转换</span>
  134. </label>
  135. <label class="flex items-center">
  136. <input v-model="features" type="checkbox" value="PDF安全保护" @change="clearErrInfo('features')">
  137. <CheckBox v-if="features.includes('PDF安全保护')" />
  138. <span v-else class="box"></span>
  139. <span class="text-sm text-[#232748] ml-9px ">PDF安全保护</span>
  140. </label>
  141. <label class="flex items-center">
  142. <input v-model="features" type="checkbox" value="标记密文" @change="clearErrInfo('features')">
  143. <CheckBox v-if="features.includes('标记密文')" />
  144. <span v-else class="box"></span>
  145. <span class="text-sm text-[#232748] ml-9px ">标记密文</span>
  146. </label>
  147. <label class="flex items-center">
  148. <input v-model="features" type="checkbox" value="PDF文档对比" @change="clearErrInfo('features')">
  149. <CheckBox v-if="features.includes('PDF文档对比')" />
  150. <span v-else class="box"></span>
  151. <span class="text-sm text-[#232748] ml-9px ">PDF文档对比</span>
  152. </label>
  153. <label class="flex items-center">
  154. <input v-model="features" type="checkbox" value="文档压缩" @change="clearErrInfo('features')">
  155. <CheckBox v-if="features.includes('文档压缩')" />
  156. <span v-else class="box"></span>
  157. <span class="text-sm text-[#232748] ml-9px ">文档压缩</span>
  158. </label>
  159. </div>
  160. <div v-show="features_err && submitted" class="text-[#FF5050] mt-10px ">{{ features_err }}</div>
  161. <!-- 用户数量 非必填项 -->
  162. <div class="mt-27px mb-16px text-sm text-[#232748] font-600 ">{{ contactSales.numberOfUsers }}</div>
  163. <div class="relative">
  164. <select class="w-full h-44px px-12px rounded-6px appearance-none border-1px border-[#E1E3E8] outline-none focus:border-[#396FFA] hover:border-[#396FFA]" v-model="number" name="number" @change="handleInfo('number', $event)">
  165. <option value="0-100">0-100</option>
  166. <option value="101-1000">101-1000</option>
  167. <option value="1001-5000">1001-5000</option>
  168. <option value="5001-10000">5001-10000</option>
  169. <option value="10000+">10000+</option>
  170. </select>
  171. <Arrow class="absolute bottom-18px right-18px z-2 w-14px h-8px pointer-events-none" />
  172. </div>
  173. <!-- 姓名 -->
  174. <div class="info-content">
  175. <div class="flex">
  176. <div class="name flex-1 ">
  177. <div>
  178. <span class="inline-block mt-25px mb-16px text-sm text-[#232748] font-600 "><i class="text-[#FF5050] mt-10px">*</i> 姓名</span>
  179. <input class="w-full h-44px px-12px rounded-6px !border-1px !border-[#E1E3E8] border-solid !focus:border-[#396FFA] !hover:border-[#396FFA]" v-model.trim="firstName" type="text" placeholder="请输入名字" @focus="clearErrInfo('firstName')">
  180. </div>
  181. <div v-if="firstName_err" class="text-[#FF5050] mt-10px ">{{ firstName_err }}</div>
  182. </div>
  183. </div>
  184. </div>
  185. <!-- 公司邮箱 -->
  186. <div class="info-content">
  187. <div class="email">
  188. <span class="inline-block mt-25px mb-16px text-sm text-[#232748] font-600 "><i class="text-[#FF5050] mt-10px">*</i> 公司邮箱地址</span>
  189. <input class="w-full h-44px px-12px rounded-6px !border-1px !border-[#E1E3E8] border-solid !focus:border-[#396FFA] !hover:border-[#396FFA]" v-model.trim="email" type="text" placeholder="name@company.com" @focus="clearErrInfo('email')">
  190. </div>
  191. <div v-if="email_err" class="text-[#FF5050] mt-10px ">{{ email_err }}</div>
  192. </div>
  193. <div class="lg:hover:bg-[#548CF9] w-full lg:max-w-380px mt-40px text-sm py-15px text-center mx-auto rounded-8px font-500 bg-[#396FFA] text-white cursor-pointer" @click="submit">{{ submitText }}</div>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </template>
  199. <script>
  200. import checkEmail from '~/utils/checkemail'
  201. import { country } from "~/utils/country.js"
  202. import iOSCN from '~/assets/images/icons/apple.svg?inline'
  203. import MacCN from '~/assets/images/icons/macos.svg?inline'
  204. import AndroidCN from '~/assets/images/icons/android.svg?inline'
  205. import WindowsCN from '~/assets/images/icons/windows.svg?inline'
  206. import WebCN from '~/assets/images/icons/web.svg?inline'
  207. import CheckBox from '~/assets/images/icons/check_box.svg?inline'
  208. import EmailCN from '~/assets/images/icons/email.svg?inline'
  209. import Dot from '~/assets/images/icons/dot.svg?inline'
  210. import ArrowCN from '~/assets/images/icons/arrow.svg?inline'
  211. import LinuxCN from '~/assets/images/icons/linux.svg?inline'
  212. import iOS from '~/assets/images/icons/apple_black.svg?inline'
  213. import Mac from '~/assets/images/icons/mac_black.svg?inline'
  214. import Android from '~/assets/images/icons/android_black.svg?inline'
  215. import Windows from '~/assets/images/icons/windows_black.svg?inline'
  216. import Web from '~/assets/images/icons/web_black.svg?inline'
  217. import Linux from '~/assets/images/icons/linux_black.svg?inline'
  218. import Compdf from '~/assets/images/icons/compdf_api_black.svg?inline'
  219. import Arrow from '~/assets/images/icons/downarrow.svg?inline'
  220. import Email from '~/assets/images/icons/email_new.svg?inline'
  221. import Tech from '~/assets/images/icons/tech_support.svg?inline'
  222. export default {
  223. components: {
  224. CheckBox,
  225. iOSCN,
  226. MacCN,
  227. AndroidCN,
  228. WindowsCN,
  229. WebCN,
  230. LinuxCN,
  231. Dot,
  232. ArrowCN,
  233. EmailCN,
  234. iOS,
  235. Mac,
  236. Android,
  237. Windows,
  238. Web,
  239. Linux,
  240. Compdf,
  241. Arrow,
  242. Email,
  243. Tech
  244. },
  245. data() {
  246. return {
  247. modalShow: false,
  248. submitted: false,
  249. fieldsNum: 0,
  250. submitText: '提交',
  251. errText: '',
  252. building: '公司内部',
  253. number: '0-100',
  254. number_cn: 1,
  255. platforms: [],
  256. platforms_err: null,
  257. features: [],
  258. features_err: null,
  259. description: '',
  260. description_err: null,
  261. firstName: null,
  262. firstName_err: null,
  263. lastName: null,
  264. lastName_err: null,
  265. name: null,
  266. name_err: null,
  267. email: null,
  268. email_err: null,
  269. phone: '',
  270. phone_err: null,
  271. company: null,
  272. company_err: null,
  273. website: '',
  274. website_err: null,
  275. industry: '',
  276. country: '',
  277. countryList: [],
  278. country_err: null,
  279. err: {
  280. // description: this.$t('contactSales.errDescription'),
  281. platforms: '请选择开发平台',
  282. features: '请勾选所需功能',
  283. firstName: '请输入您的姓名',
  284. lastName: 'Enter your last name',
  285. name: '请输入您的姓名',
  286. // phone_cn: this.$t('contactSales.errPhone'),
  287. // phone: {
  288. // err: 'Enter your phone number',
  289. // correct: 'Wrong phone format'
  290. // },
  291. email: {
  292. err: '请输入您公司的邮箱地址',
  293. correct: '请填写正确格式的邮箱地址',
  294. business: 'Please enter a non generic email address'
  295. },
  296. // company: this.$t('contactSales.errCompany'),
  297. // website: this.$t('contactSales.errWebsite'),
  298. // country: 'Please select your country'
  299. },
  300. checkbox: false,
  301. contactSales: {
  302. "contactUs": "免费试用&获取报价",
  303. "getConnect": "请填写以下表单, 提供贵公司项目的详细信息获得免费试用和报价。ComPDFKit团队将在一个工作日内,以邮件的形式与您取得联系。",
  304. "aboutProject": "项目描述",
  305. "aboutProjectDesc": "您的项目使用场景是什么?您需要什么功能?您期望在哪些方面与ComPDFKit进行合作?\r\n详细的信息,有利于我们了解您的需求,并提供合适的解决方案以及精准的报价。",
  306. "whoBuildFor": "您的应用程序将用于:",
  307. "forCustomers": "公司内部",
  308. "forInternalUse": "公司产品的终端用户",
  309. "forAnotherCompany": "另一家公司的产品",
  310. "whatDeploy": "您期望支持部署到哪些开发平台?",
  311. "whichFeatures": "选择您的项目需要的功能",
  312. "numberOfUsers": "终端用户人数",
  313. "name": "姓名",
  314. "namePlaceholder": "您的全名",
  315. "businessEmail": "公司邮箱地址",
  316. "phoneNumber": "电话",
  317. "phoneNumberPlaceholder": "请输入您的联系电话",
  318. "companyName": "公司名称",
  319. "companyNamePlaceholder": "填写您的公司名称",
  320. "website": "公司网站",
  321. "websitePlaceholder": "请留下您公司官网网址",
  322. "submit": "提交",
  323. "errDescription": "请描述贵公司的项目",
  324. "errName": "请输入您的姓名",
  325. "errPhone": "请填写正确的联系电话",
  326. "errEmailEmpty": "请输入您公司的邮箱地址",
  327. "errEmailWrong": "请填写正确格式的邮箱地址",
  328. "errCompany": "请填写您的公司名称",
  329. "errWebsite": "请留下您公司官网网址",
  330. "errSubmit": "请完成必选项的填写",
  331. "modelThank": "感谢您的联系!",
  332. "modelSuccess": "您的信息已成功发送给ComPDFKit团队,我们将在一个工作日内,以邮件或电话的方式与您取得联系。",
  333. "commentOneText": "考虑到我们的用户在阅读和学习的时候想要添加注释。我试图处理PDF文件并重新开发所有的功能,但我很快意识到我需要的是如何解决业务问题的方法,而不是开发PDF处理软件。在ComPDFKit 的帮助下,我们不必在开发过程中浪费太多时间。",
  334. "commentOneJob": "信息技术 运营总监",
  335. "commentTwoText": "非常感谢 ComPDFKit。我们公司想为客户提供一种简单、快速又安全的方式来签署和填写PDF表格,ComPDFKit做到了,满足我们公司的所有需求。这就是为什么PDF Technologies 多年来一直是我们的合作伙伴的原因。",
  336. "commentTwoJob": "现代服务业 产品经理",
  337. "platforms": {
  338. "viewer": "PDF查看",
  339. "annotations": "PDF批注",
  340. "signatures": "PDF签名",
  341. "forms": "PDF表单填写",
  342. "documentEditor": "PDF页面管理",
  343. "editPDF": "PDF内容编辑",
  344. "security": "PDF安全保护",
  345. "conversion": "标记密文",
  346. "documentComparison": "PDF文档对比",
  347. "ocr": "OCR识别",
  348. "redaction": "文档转换"
  349. }
  350. }
  351. }
  352. },
  353. mounted () {
  354. this.countryList = country()
  355. },
  356. watch: {
  357. fieldsNum(val) {
  358. if (((val > 8 ) || (val > 7 )) && !this.errText) {
  359. this.errText = ''
  360. }
  361. },
  362. checkbox(val) {
  363. if (val && this.errText !== 'Please fill in the missing fields.') {
  364. this.errText = ''
  365. }
  366. }
  367. },
  368. props: ["labelText"],
  369. methods: {
  370. doClose() {
  371. setTimeout(() => {
  372. this.modalShow = false
  373. }, 500);
  374. this.platforms = []
  375. this.features = []
  376. this.description = ''
  377. this.firstName = null
  378. this.lastName = null
  379. this.name = null
  380. this.email = null
  381. this.company = null
  382. this.website = ''
  383. this.phone = ''
  384. this.country = ''
  385. this.fieldsNum = 0
  386. this.submitText = '提交'
  387. },
  388. handleCheckBox(arg) {
  389. if (!this[arg].length) {
  390. if (!this[arg + '_err']) {
  391. this[arg + '_err'] = this.err[arg]
  392. if (this.fieldsNum > 0) {
  393. this.fieldsNum--
  394. }
  395. }
  396. return false
  397. } else {
  398. if (this[arg + '_err']) {
  399. this[arg + '_err'] = false
  400. this.fieldsNum++
  401. }
  402. return true
  403. }
  404. },
  405. handleErr(flag, errMessage, origin) {
  406. if (!this[flag]) {
  407. if (!this[flag + '_err']) {
  408. this[flag + '_err'] = errMessage
  409. if (this.fieldsNum > 0) {
  410. this.fieldsNum--
  411. }
  412. }
  413. return false
  414. } else {
  415. if (this[flag + '_err']) {
  416. this[flag + '_err'] = origin
  417. this.fieldsNum++
  418. }
  419. return true
  420. }
  421. },
  422. handleEmail() {
  423. if (!this.email) {
  424. if (!this.email_err) {
  425. this.email_err = this.err.email.err
  426. if (this.fieldsNum > 0) {
  427. this.fieldsNum--
  428. }
  429. }
  430. return false
  431. }
  432. if (!checkEmail(this.email)) {
  433. if (!this.email_err) {
  434. if (this.fieldsNum > 0) {
  435. this.fieldsNum--
  436. }
  437. }
  438. this.email_err = this.err.email.correct
  439. return false
  440. }
  441. if (this.email_err) {
  442. this.email_err = null
  443. this.fieldsNum++
  444. }
  445. return true
  446. },
  447. handleInfo(message, $event) {
  448. $event && $event.target.blur()
  449. if (message === 'phone') return this.handleErr('phone', this.err['phone_cn'], null)
  450. return this.handleErr(message, this.err[message], null)
  451. },
  452. clearErrInfo(message) {
  453. this[message + '_err'] = null
  454. },
  455. // handlePhone () {
  456. // const reg = /[^0-9-]+/
  457. // if (!this.phone) {
  458. // if (!this.phone_err) {
  459. // this.phone_err = this.err.phone.err
  460. // if (this.fieldsNum > 0) {
  461. // this.fieldsNum--
  462. // }
  463. // }
  464. // return false
  465. // }
  466. // if (reg.test(this.phone)) {
  467. // if (!this.phone_err) {
  468. // if (this.fieldsNum > 0) {
  469. // this.fieldsNum--
  470. // }
  471. // }
  472. // this.phone_err = this.err.phone.correct
  473. // return false
  474. // }
  475. // if (this.phone_err) {
  476. // this.phone_err = null
  477. // this.fieldsNum++
  478. // }
  479. // return true
  480. // },
  481. submit() {
  482. this.submitted = true
  483. let i = 0
  484. if (this.handleCheckBox('platforms')) i++
  485. if (this.handleCheckBox('features')) i++
  486. // if (this.handleInfo('description')) i++
  487. if (this.handleEmail()) i++
  488. if (this.handleInfo('firstName')) i++
  489. // if (this.handlePhone()) i++
  490. // if (this.handleInfo('country')) i++
  491. // if (this.handleInfo('website')) i++
  492. this.fieldsNum = i
  493. if (this.fieldsNum < 4 ) {
  494. this.errText = this.contactSales.errSubmit
  495. return
  496. }
  497. this.errText = ''
  498. const self = this
  499. this.$axios({
  500. method: 'POST',
  501. url: this.$config.pdfDomain + '/api/contact',
  502. data: {
  503. 'detail[platform]': self.platforms.join(', '),
  504. 'detail[feature]': self.features.join(', '),
  505. 'detail[description]': self.description,
  506. 'contact_email[user_name]': self.firstName,
  507. 'contact_email[email]': self.email,
  508. 'contact_email[product_name]': '17PDF',
  509. 'contact_email[email_subject]': 'Contact for SDK Plan',
  510. 'detail[building]': self.building,
  511. 'detail[phone]': self.phone,
  512. 'detail[number]': self.number,
  513. 'detail[website]': self.website,
  514. 'detail[industry]': self.industry,
  515. 'detail[country]': self.country,
  516. 'detail[label]': self.labelText
  517. },
  518. transformRequest: [function (data) {
  519. let ret = ''
  520. for (let item in data) {
  521. ret += encodeURIComponent(item) + '=' + encodeURIComponent(data[item]) + '&'
  522. }
  523. ret = ret.substr(0, ret.length - 1)
  524. return ret
  525. }]
  526. })
  527. .then((res) => {
  528. console.log(res)
  529. const { data } = res
  530. if (data.status === 'success') {
  531. console.log('Replace the success Flag')
  532. setTimeout(function () {
  533. self.submitText = 'Success'
  534. self.modalShow = true
  535. }, 0)
  536. } else {
  537. alert('The email fails to send.')
  538. }
  539. })
  540. .catch((err) => {
  541. console.log(err)
  542. alert('The email fails to send.')
  543. })
  544. }
  545. }
  546. }
  547. </script>
  548. <style lang="scss" scoped>
  549. .poppins {
  550. font-family: 'Poppins';
  551. }
  552. .contact-container {
  553. label {
  554. input {
  555. position: absolute;
  556. border: 0px;
  557. clip: rect(0px, 0px, 0px, 0px);
  558. height: 1px;
  559. width: 1px;
  560. margin: -1px;
  561. padding: 0px;
  562. overflow: hidden;
  563. white-space: nowrap;
  564. }
  565. svg {
  566. flex-shrink: 0;
  567. color: #1460F3;
  568. }
  569. }
  570. .box {
  571. flex-shrink: 0;
  572. display: inline-block;
  573. width: 22px;
  574. height: 22px;
  575. border: 2px solid #A6B2BF;
  576. border-radius: 2px;
  577. }
  578. .comment-item {
  579. &::before {
  580. content: '';
  581. display: block;
  582. width: 60px;
  583. height: 2px;
  584. margin-bottom: 18px;
  585. background-color: rgba(20, 96, 243, 0.1);
  586. }
  587. & + .comment-item {
  588. margin-top: 30px;
  589. }
  590. }
  591. }
  592. .en {
  593. .contact-container .contact-box .box {
  594. border-radius: 4px;
  595. }
  596. select,
  597. input {
  598. font-size: 14px;
  599. line-height: 40px;
  600. }
  601. select option {
  602. color: #000;
  603. }
  604. input::-webkit-input-placeholder,
  605. textarea::-webkit-input-placeholder {
  606. /* WebKit browsers,webkit内核浏览器 */
  607. color: #CCCCCC;
  608. }
  609. input:-moz-placeholder,
  610. textarea:-moz-placeholder {
  611. /* Mozilla Firefox 4 to 18 */
  612. color: #CCCCCC;
  613. }
  614. input::-moz-placeholder,
  615. textarea::-moz-placeholder {
  616. /* Mozilla Firefox 19+ */
  617. color: #CCCCCC;
  618. }
  619. input:-ms-input-placeholder,
  620. textarea:-ms-input-placeholder {
  621. /* Internet Explorer 10+ */
  622. color: #CCCCCC;
  623. }
  624. .nowrap {
  625. white-space: nowrap;
  626. }
  627. .privacy-box {
  628. flex-shrink: 0;
  629. display: inline-block;
  630. width: 16px;
  631. height: 16px;
  632. border: 1px solid #CCCCCC;
  633. border-radius: 2px;
  634. }
  635. .privacy-box-active {
  636. min-width: 16px;
  637. max-width: 16px;
  638. height: 16px;
  639. color: #1460F3;
  640. }
  641. }
  642. @media screen and (min-width: 930px) {
  643. .cn .contact-container {
  644. .contact-box {
  645. box-shadow: 0px 4px 35px rgba(129, 149, 200, 0.18);
  646. }
  647. }
  648. .en {
  649. .container {
  650. padding-left: 0;
  651. padding-right: 0;
  652. }
  653. .contact-container .contact-box {
  654. box-shadow: 0px 4px 35px rgba(0, 41, 146, 0.1);
  655. }
  656. }
  657. }
  658. .success-modal {
  659. text-align: center;
  660. padding-bottom: 30px;
  661. img {
  662. width: 87px;
  663. display: inline-block;
  664. }
  665. .title {
  666. margin-top: 16px;
  667. margin-bottom: 2px;
  668. font-size: 28px;
  669. font-family: Helvetica-Bold,Helvetica;
  670. font-weight: bold;
  671. color: #1d2023;
  672. line-height: 44px;
  673. }
  674. .desc {
  675. font-size: 16px;
  676. color: #606972;
  677. line-height: 22px;
  678. }
  679. }
  680. </style>