contact-sales.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. <template>
  2. <div>
  3. <Header />
  4. <div class="banner md:mt-80px md:pt-75px md:pb-110px <md:pt-106px <md:pb-40px">
  5. <div class="container <md:text-center">
  6. <h1 class="font-bold md:mb-20px md:text-brand-1 md:text-2xl <md:mb-8px <md:text-white <md:text-lg">免费试用&获取报价</h1>
  7. <div class="md:text-brand-3 md:text-tiny <md:text-white <md:text-xs">请填写以下表单, 提供贵公司项目的详细信息获得免费试用和报价。ComPDFKit团队将在一个工作日内,以邮件的形式与您取得联系。</div>
  8. </div>
  9. </div>
  10. <div class="container contact-container lg:flex lg:justify-between lg:mb-120px">
  11. <div class="contact-box lg:w-[57.6271%] lg:mt-[-50px] lg:bg-white lg:rounded-18px lg:px-30px lg:pt-40px lg:pb-80px <lg:my-40px">
  12. <div class="md:text-tiny <md:text-sm font-bold md:mb-20px <md:mb-8px text-brand-2"><i class="text-[#FF5050]">*</i> 项目描述</div>
  13. <textarea
  14. class="appearance-none w-full p-12px text-14px leading-20px rounded-6px outline-none border-1px border-[#CCCCCC] focus:border-brand-0 hover:border-brand-0 resize-y"
  15. v-model.trim="description"
  16. :placeholder="`您的项目使用场景是什么?您需要什么功能?您期望在哪些方面与ComPDFKit进行合作?\r\n详细的信息,有利于我们了解您的需求,并提供合适的解决方案以及精准的报价。`"
  17. rows="6"
  18. @input="handleInfo('description')"
  19. ></textarea>
  20. <div v-if="description_err && submitted" class="text-[#FF5050]">{{ description_err }}</div>
  21. <div class="md:mt-40px <md:mt-24px md:mb-20px md:text-tiny <md:mb-8px <md:text-sm text-brand-2 font-bold"><i class="text-[#FF5050]">*</i> 您的应用程序将用于:</div>
  22. <div class="relative">
  23. <select class="w-full md:h-50px <md:h-44px px-12px rounded-6px appearance-none border-1px border-[#CCCCCC] outline-none focus:border-brand-0 hover:border-brand-0" v-model="building" name="building" @change="handleInfo('building', $event)">
  24. <option value="A product for customers">公司内部</option>
  25. <option value="A product for internal use">公司产品的终端用户</option>
  26. <option value="A product for another company">另一家公司的产品</option>
  27. </select>
  28. <Arrow class="absolute bottom-12px right-10px z-2 w-20px h-20px pointer-events-none text-[#CCCCCC] transform rotate-90" />
  29. </div>
  30. <div class="md:mt-40px md:mb-20px <md:mt-24px <md:mb-17px md:text-tiny <md:text-sm font-bold text-brand-2"><i class="text-[#FF5050]">*</i> 您期望支持部署ComPDFKit产品到哪些开发平台?</div>
  31. <div class="tiny:flex tiny:justify-between tiny:flex-wrap">
  32. <label class="inline-flex items-center tiny:mb-20px <tiny:w-full <tiny:mb-16px <tiny:pl-16px">
  33. <input v-model="platforms" type="checkbox" value="Android" @change="handleCheckBox('platforms')">
  34. <CheckBox v-if="platforms.includes('Android')" />
  35. <span v-else class="box"></span>
  36. <span class="ml-10px text-brand-0"><Android class="w-24px h-24px" /></span>
  37. <span class="text-sm text-brand-2 ml-8px">Android</span>
  38. </label>
  39. <label class="inline-flex items-center tiny:mb-20px <tiny:w-full <tiny:mb-16px <tiny:pl-16px">
  40. <input v-model="platforms" type="checkbox" value="Windows" @change="handleCheckBox('platforms')">
  41. <CheckBox v-if="platforms.includes('Windows')" />
  42. <span v-else class="box"></span>
  43. <span class="ml-10px text-brand-0"><Windows class="w-24px h-24px" /></span>
  44. <span class="text-sm text-brand-2 ml-8px">Windows</span>
  45. </label>
  46. <label class="inline-flex items-center tiny:mb-20px <tiny:w-full <tiny:mb-16px <tiny:pl-16px">
  47. <input v-model="platforms" type="checkbox" value="iOS" @change="handleCheckBox('platforms')">
  48. <CheckBox v-if="platforms.includes('iOS')" />
  49. <span v-else class="box"></span>
  50. <span class="ml-10px text-brand-0"><iOS class="w-24px h-24px" /></span>
  51. <span class="text-sm text-brand-2 ml-8px">iOS</span>
  52. </label>
  53. <label class="inline-flex items-center tiny:mb-20px <tiny:w-full <tiny:mb-16px <tiny:pl-16px">
  54. <input v-model="platforms" type="checkbox" value="Mac" @change="handleCheckBox('platforms')">
  55. <CheckBox v-if="platforms.includes('Mac')" />
  56. <span v-else class="box"></span>
  57. <span class="ml-10px text-brand-0"><Mac class="w-24px h-24px" /></span>
  58. <span class="text-sm text-brand-2 ml-8px">Mac</span>
  59. </label>
  60. <label class="inline-flex items-center tiny:mb-20px <tiny:w-full <tiny:mb-16px <tiny:pl-16px">
  61. <input v-model="platforms" type="checkbox" value="Web" @change="handleCheckBox('platforms')">
  62. <CheckBox v-if="platforms.includes('Web')" />
  63. <span v-else class="box"></span>
  64. <span class="ml-10px text-brand-0"><Web class="w-24px h-24px" /></span>
  65. <span class="text-sm text-brand-2 ml-8px">Web</span>
  66. </label>
  67. <label class="inline-flex items-center tiny:mb-20px <tiny:w-full <tiny:mb-16px <tiny:pl-16px">
  68. <input v-model="platforms" type="checkbox" value="Linux" @change="handleCheckBox('platforms')">
  69. <CheckBox v-if="platforms.includes('Linux')" />
  70. <span v-else class="box"></span>
  71. <span class="ml-10px text-brand-0"><Linux class="w-24px h-24px" /></span>
  72. <span class="text-sm text-brand-2 ml-8px">Linux</span>
  73. </label>
  74. </div>
  75. <div v-show="platforms_err && submitted" class="text-[#FF5050]">{{ platforms_err }}</div>
  76. <div class="md:my-20px md:text-tiny <md:mt-24px <md:mb-17px <md:text-sm font-bold text-brand-2"><i class="text-[#FF5050]">*</i> 选择您的项目需要的功能</div>
  77. <div class="features">
  78. <label class="inline-flex items-center tiny:w-[24.1935%] @tiny:w-[30%] @lg:w-[30%] md:mb-20px <tiny:w-full <md:mb-16px <tiny:pl-16px">
  79. <input v-model="features" type="checkbox" value="Viewer" @change="handleCheckBox('features')">
  80. <CheckBox v-if="features.includes('Viewer')" />
  81. <span v-else class="box"></span>
  82. <span class="text-sm text-brand-2 ml-8px">Viewer</span>
  83. </label>
  84. <label class="inline-flex items-center tiny:w-[24.1935%] @tiny:w-[30%] @lg:w-[30%] md:mb-20px <tiny:w-full <md:mb-16px <tiny:pl-16px">
  85. <input v-model="features" type="checkbox" value="Annotations" @change="handleCheckBox('features')">
  86. <CheckBox v-if="features.includes('Annotations')" />
  87. <span v-else class="box"></span>
  88. <span class="text-sm text-brand-2 ml-8px">Annotations</span>
  89. </label>
  90. <label class="inline-flex items-center tiny:w-[24.1935%] @tiny:w-[30%] @lg:w-[30%] md:mb-20px <tiny:w-full <md:mb-16px <tiny:pl-16px">
  91. <input v-model="features" type="checkbox" value="Signatures" @change="handleCheckBox('features')">
  92. <CheckBox v-if="features.includes('Signatures')" />
  93. <span v-else class="box"></span>
  94. <span class="text-sm text-brand-2 ml-8px">Signatures</span>
  95. </label>
  96. <label class="inline-flex items-center tiny:w-[24.1935%] @tiny:w-[30%] @lg:w-[30%] md:mb-20px <tiny:w-full <md:mb-16px <tiny:pl-16px">
  97. <input v-model="features" type="checkbox" value="Forms" @change="handleCheckBox('features')">
  98. <CheckBox v-if="features.includes('Forms')" />
  99. <span v-else class="box"></span>
  100. <span class="text-sm text-brand-2 ml-8px">Forms</span>
  101. </label>
  102. <label class="inline-flex items-center tiny:w-[24.1935%] @tiny:w-[30%] @lg:w-[30%] md:mb-20px <tiny:w-full <md:mb-16px <tiny:pl-16px">
  103. <input v-model="features" type="checkbox" value="Document editor" @change="handleCheckBox('features')">
  104. <CheckBox v-if="features.includes('Document editor')" />
  105. <span v-else class="box"></span>
  106. <span class="text-sm text-brand-2 ml-8px">Document editor</span>
  107. </label>
  108. <label class="inline-flex items-center tiny:w-[24.1935%] @tiny:w-[30%] @lg:w-[30%] md:mb-20px <tiny:w-full <md:mb-16px <tiny:pl-16px">
  109. <input v-model="features" type="checkbox" value="Edit PDF" @change="handleCheckBox('features')">
  110. <CheckBox v-if="features.includes('Edit PDF')" />
  111. <span v-else class="box"></span>
  112. <span class="text-sm text-brand-2 ml-8px">Edit PDF</span>
  113. </label>
  114. <label class="inline-flex items-center tiny:w-[24.1935%] @tiny:w-[30%] @lg:w-[30%] md:mb-20px <tiny:w-full <md:mb-16px <tiny:pl-16px">
  115. <input v-model="features" type="checkbox" value="Security" @change="handleCheckBox('features')">
  116. <CheckBox v-if="features.includes('Security')" />
  117. <span v-else class="box"></span>
  118. <span class="text-sm text-brand-2 ml-8px">Security</span>
  119. </label>
  120. <label class="inline-flex items-center tiny:w-[24.1935%] @tiny:w-[30%] @lg:w-[30%] tiny:mb-20px <tiny:w-full <tiny:mb-16px <tiny:pl-16px">
  121. <input v-model="features" type="checkbox" value="Conversion" @change="handleCheckBox('features')">
  122. <CheckBox v-if="features.includes('Conversion')" />
  123. <span v-else class="box"></span>
  124. <span class="text-sm text-brand-2 ml-8px">Conversion</span>
  125. </label>
  126. <label class="inline-flex items-center tiny:w-[24.1935%] @tiny:w-[30%] @lg:w-[30%] tiny:mb-20px <tiny:w-full <tiny:mb-16px <tiny:pl-16px">
  127. <input v-model="features" type="checkbox" value="OCR" @change="handleCheckBox('features')">
  128. <CheckBox v-if="features.includes('OCR')" />
  129. <span v-else class="box"></span>
  130. <span class="text-sm text-brand-2 ml-8px">OCR</span>
  131. </label>
  132. <label class="inline-flex items-center tiny:w-[24.1935%] @tiny:w-[30%] @lg:w-[30%] tiny:mb-20px <tiny:w-full <tiny:mb-16px <tiny:pl-16px">
  133. <input v-model="features" type="checkbox" value="Redaction" @change="handleCheckBox('features')">
  134. <CheckBox v-if="features.includes('Redaction')" />
  135. <span v-else class="box"></span>
  136. <span class="text-sm text-brand-2 ml-8px">Redaction</span>
  137. </label>
  138. <label class="inline-flex items-center tiny:w-[24.1935%] @tiny:w-[30%] @lg:w-[30%] tiny:mb-20px <tiny:w-full <tiny:mb-16px <tiny:pl-16px">
  139. <input v-model="features" type="checkbox" value="Document Comparison" @change="handleCheckBox('features')">
  140. <CheckBox v-if="features.includes('Document Comparison')" />
  141. <span v-else class="box"></span>
  142. <span class="text-sm text-brand-2 ml-8px">Document Comparison</span>
  143. </label>
  144. </div>
  145. <div v-show="features_err && submitted" class="text-[#FF5050]">{{ features_err }}</div>
  146. <div class="md:my-20px md:text-tiny <md:mt-24px <md:mb-8px <md:text-sm text-brand-2 font-bold"><i class="text-[#FF5050]">*</i> 终端用户人数</div>
  147. <div><input class="w-full md:h-50px <md:h-44px px-12px rounded-6px !border-1px !border-[#CCCCCC] border-solid !focus:border-brand-0 !hover:border-brand-0" v-model="number" min="1" type="number"></div>
  148. <div class="info-content">
  149. <div class="name">
  150. <span class="inline-block md:mt-40px md:mb-20px md:text-tiny <md:mt-24px <md:mb-8px <md:text-sm text-brand-2 font-bold"><i class="text-[#FF5050]">*</i> 姓名</span>
  151. <input class="w-full md:h-50px <md:h-44px px-12px rounded-6px !border-1px !border-[#CCCCCC] border-solid !focus:border-brand-0 !hover:border-brand-0" v-model.trim="name" type="text" placeholder="您的全名" @input="handleInfo('name')">
  152. </div>
  153. <div v-if="name_err" class="text-[#FF5050]">{{ name_err }}</div>
  154. </div>
  155. <div class="info-content">
  156. <div class="email">
  157. <span class="inline-block md:mt-40px md:mb-20px md:text-tiny <md:mt-24px <md:mb-8px <md:text-sm text-brand-2 font-bold"><i class="text-[#FF5050]">*</i> 公司邮箱地址</span>
  158. <input class="w-full md:h-50px <md:h-44px px-12px rounded-6px !border-1px !border-[#CCCCCC] border-solid !focus:border-brand-0 !hover:border-brand-0" v-model.trim="email" type="text" placeholder="name@company.com" @input="handleEmail">
  159. </div>
  160. <div v-if="email_err" class="text-[#FF5050]">{{ email_err }}</div>
  161. </div>
  162. <div class="info-content">
  163. <div class="phone">
  164. <span class="inline-block md:mt-40px md:mb-20px md:text-tiny <md:mt-24px <md:mb-8px <md:text-sm text-brand-2 font-bold">电话</span>
  165. <input class="w-full h-50px px-12px rounded-6px !border-1px !border-[#CCCCCC] border-solid !focus:border-brand-0 !hover:border-brand-0" v-model.trim="phone" type="text" placeholder="Enter phone number">
  166. <p class="lg:mt-8px lg:pl-12px <lg:mt-4px text-12px leading-18px text-brand-0">为了与您取得联系,移动电话最好开通了微信,固定电话请填写区号。</p>
  167. </div>
  168. </div>
  169. <div class="info-content">
  170. <div class="email">
  171. <span class="inline-block md:mt-40px md:mb-20px md:text-tiny <md:mt-24px <md:mb-8px <md:text-sm text-brand-2 font-bold"><i class="text-[#FF5050]">*</i> 公司名称</span>
  172. <input class="w-full md:h-50px <md:h-44px px-12px rounded-6px !border-1px !border-[#CCCCCC] border-solid !focus:border-brand-0 !hover:border-brand-0" v-model.trim="company" type="text" placeholder="填写您的公司名称" @input="handleInfo('company')">
  173. </div>
  174. <div v-if="company_err" class="text-[#FF5050]">{{ company_err }}</div>
  175. </div>
  176. <div class="info-content">
  177. <div class="email">
  178. <span class="inline-block md:mt-40px md:mb-20px md:text-tiny <md:mt-24px <md:mb-8px <md:text-sm text-brand-2 font-bold"><i class="text-[#FF5050]">*</i> 公司网站</span>
  179. <input class="w-full md:h-50px <md:h-44px px-12px rounded-6px !border-1px !border-[#CCCCCC] border-solid !focus:border-brand-0 !hover:border-brand-0" v-model.trim="website" type="text" placeholder="请留下您公司官网网址" @input="handleInfo('website')">
  180. </div>
  181. <div v-if="website_err" class="text-[#FF5050]">{{ website_err }}</div>
  182. </div>
  183. <div class="info-content">
  184. <div class="email">
  185. <span class="inline-block md:mt-40px md:mb-20px md:text-tiny <md:mt-24px <md:mb-8px <md:text-sm text-brand-2 font-bold"><i class="text-[#FF5050]">*</i> 公司行业</span>
  186. <div class="relative">
  187. <select class="w-full md:h-50px <md:h-44px px-12px rounded-6px appearance-none border-1px border-[#CCCCCC] outline-none focus:border-brand-0 hover:border-brand-0" v-model="industry" name="Industry" @change="handleInfo('industry', $event)">
  188. <option value="Architecture">建筑</option>
  189. <option value="Engineering_Construction">工程与施工</option>
  190. <option value="Finance">金融</option>
  191. <option value="Law_Firms_Legal_Services">律师事务所和法律服务</option>
  192. <option value="Government">政府</option>
  193. <option value="Healthcare">医疗健康</option>
  194. <option value="Aerospace_Defense">航空航天</option>
  195. <option value="Automotive_Marine">汽车和船舶</option>
  196. <option value="Pharmaceuticals">制药产业</option>
  197. <option value="Security">安全</option>
  198. <option value="Information_Document_Management">信息和文档管理</option>
  199. <option value="Media">媒体</option>
  200. <option value="Publishing">图书出版</option>
  201. <option value="Education">教育</option>
  202. <option value="eLearning">电子学习</option>
  203. <option value="Marketing_Services">市场营销服务</option>
  204. <option value="Insurance">保险</option>
  205. <option value="HR_Staffing">人力资源和人员配置</option>
  206. </select>
  207. <Arrow class="absolute bottom-12px right-10px z-2 w-20px h-20px pointer-events-none text-[#CCCCCC] transform rotate-90" />
  208. </div>
  209. </div>
  210. </div>
  211. <div class="lg:hover:bg-[#548CF9] <lg:active:[#548CF9] w-full lg:max-w-280px md:mt-56px text-sm md:py-15px <md:mt-32px <md:py-10px text-center mx-auto rounded-6px font-bold bg-brand-0 text-white cursor-pointer" @click="submit">{{ submitText }}</div>
  212. <div v-if="errText" class="w-full mt-5px text-[#FF5050] text-xs text-center">{{ errText }}</div>
  213. </div>
  214. <div class="lg:w-[37.7966%]">
  215. <h3 class="text-brand-1 text-base lg:mt-40px <md:text-20px <md:leading-24px font-bold">联系</h3>
  216. <div class="mt-16px pt-10px pb-18px text-0px border-b-black/8 border-b-2px">
  217. <a class="inline-flex items-center" href="mailto:support@compdf.com?subject=获取报价@@&@@免费试用ComPDFKit产品">
  218. <span class="inline-block rounded-1/2 bg-brand-0"><Email /></span>
  219. <span class="ml-12px font-bold text-sm text-brand-0">联系销售</span>
  220. </a>
  221. </div>
  222. <div class="<lg:hidden mt-116px">
  223. <div v-for="(item, index) in comment" :key="index" class="comment-item">
  224. <Dot />
  225. <div class="mt-20px mb-26px text-sm text-brand-3">{{ item.text }}</div>
  226. <div class="mb-3px text-xs text-brand-2 font-bold">{{ item.name }}</div>
  227. <div class="text-12px leading-18px text-brand-4">{{ item.job }}</div>
  228. </div>
  229. </div>
  230. </div>
  231. </div>
  232. <PdfSdkFormSwiper :comment="comment" />
  233. <Modal @close="doClose" :modalShow="modalShow" />
  234. <Footer />
  235. </div>
  236. </template>
  237. <script>
  238. import checkEmail from '~/utils/checkemail'
  239. import iOS from '~/assets/images/icons/apple.svg?inline'
  240. import Mac from '~/assets/images/icons/macos.svg?inline'
  241. import Android from '~/assets/images/icons/android.svg?inline'
  242. import Windows from '~/assets/images/icons/windows.svg?inline'
  243. import Web from '~/assets/images/icons/web.svg?inline'
  244. import CheckBox from '~/assets/images/icons/check_box.svg?inline'
  245. import Email from '~/assets/images/icons/email.svg?inline'
  246. import Dot from '~/assets/images/icons/dot.svg?inline'
  247. import Arrow from '~/assets/images/icons/arrow.svg?inline'
  248. import Linux from '~/assets/images/icons/linux.svg?inline'
  249. export default {
  250. components: {
  251. CheckBox,
  252. iOS,
  253. Mac,
  254. Android,
  255. Windows,
  256. Web,
  257. Email,
  258. Dot,
  259. Arrow,
  260. Linux
  261. },
  262. data() {
  263. return {
  264. modalShow: false,
  265. submitted: false,
  266. fieldsNum: 0,
  267. submitText: '提交',
  268. errText: '',
  269. building: 'A product for customers',
  270. number: 1,
  271. platforms: [],
  272. platforms_err: null,
  273. features: [],
  274. features_err: null,
  275. description: '',
  276. description_err: null,
  277. name: null,
  278. name_err: null,
  279. email: null,
  280. email_err: null,
  281. phone: '',
  282. company: null,
  283. company_err: null,
  284. website: null,
  285. website_err: null,
  286. industry: 'Architecture',
  287. err: {
  288. description: '请描述贵公司的项目',
  289. platforms: '请选择开发平台',
  290. features: '请勾选所需功能',
  291. name: '请输入您的姓名',
  292. phone: '请填写正确的联系电话',
  293. email: {
  294. err: '请输入您公司的邮箱地址',
  295. correct: '请填写正确格式的邮箱地址',
  296. business: 'Please enter a non generic email address'
  297. },
  298. company: '请填写您的公司名称',
  299. website: '请留下您公司官网网址'
  300. },
  301. comment: [
  302. {
  303. text: `Considered that our users want to take some notes when they are reading and studying. I was trying to process PDFs and to recreate all the functionality, but what I needed to provide is a solution to a business problem at my work, not write a PDF-processing piece of software. With the help of ComPDFKit, we needn't waste much time on development process.`,
  304. name: 'Gordon Hall',
  305. job: 'Operations Director, Information Technology'
  306. },
  307. {
  308. text: 'Thanks to ComPDFKit a lot. This time, our company want to offer customers a simple, fast, and secure way to sign and fill PDF forms, they could always meet the needs of our company. That is why PDF Technologies has been our partner for many years.',
  309. name: 'Ronald W. Reagan ',
  310. job: 'Product Manager, Modern service industry'
  311. }
  312. ]
  313. }
  314. },
  315. head() {
  316. return {
  317. title: this.$config.meta['contact-sales-title'],
  318. meta: [
  319. {
  320. hid: 'description',
  321. name: 'description',
  322. content: this.$config.meta['contact-sales-desc']
  323. },
  324. {
  325. hid: 'og:title',
  326. property: 'og:title',
  327. content: this.$config.meta['contact-sales-title']
  328. },
  329. {
  330. hid: 'og:description',
  331. property: 'og:description',
  332. content: this.$config.meta['contact-sales-desc']
  333. },
  334. {
  335. hid: 'twitter:title',
  336. property: 'twitter:title',
  337. content: this.$config.meta['contact-sales-title']
  338. },
  339. {
  340. hid: 'twitter:description',
  341. property: 'twitter:description',
  342. content: this.$config.meta['contact-sales-desc']
  343. }
  344. ],
  345. link: [{
  346. hid: 'canonical',
  347. rel: 'canonical',
  348. href: process.env.domain + this.$route.path
  349. }]
  350. }
  351. },
  352. watch: {
  353. fieldsNum(val) {
  354. if (val > 9) {
  355. this.errText = ''
  356. }
  357. }
  358. },
  359. methods: {
  360. doClose() {
  361. this.modalShow = false
  362. this.platforms = []
  363. this.features = []
  364. this.description = ''
  365. this.name = null
  366. this.email = null
  367. this.company = null
  368. this.website = null
  369. this.fieldsNum = 0
  370. this.submitText = 'Submit'
  371. document.documentElement.scrollTop = window.pageYOffset = document.body.scrollTop = 0
  372. },
  373. handleCheckBox(arg) {
  374. if (!this[arg].length) {
  375. if (!this[arg + '_err']) {
  376. this[arg + '_err'] = this.err[arg]
  377. if (this.fieldsNum > 0) {
  378. this.fieldsNum--
  379. }
  380. }
  381. return false
  382. } else {
  383. if (this[arg + '_err']) {
  384. this[arg + '_err'] = false
  385. this.fieldsNum++
  386. }
  387. return true
  388. }
  389. },
  390. handleErr(flag, errMessage, origin) {
  391. if (!this[flag]) {
  392. if (!this[flag + '_err']) {
  393. this[flag + '_err'] = errMessage
  394. if (this.fieldsNum > 0) {
  395. this.fieldsNum--
  396. }
  397. }
  398. return false
  399. } else {
  400. if (this[flag + '_err']) {
  401. this[flag + '_err'] = origin
  402. this.fieldsNum++
  403. }
  404. return true
  405. }
  406. },
  407. handleEmail() {
  408. if (!this.email) {
  409. if (!this.email_err) {
  410. this.email_err = this.err.email.err
  411. if (this.fieldsNum > 0) {
  412. this.fieldsNum--
  413. }
  414. }
  415. return false
  416. }
  417. if (!checkEmail(this.email)) {
  418. if (!this.email_err) {
  419. if (this.fieldsNum > 0) {
  420. this.fieldsNum--
  421. }
  422. }
  423. this.email_err = this.err.email.correct
  424. return false
  425. }
  426. if (this.email_err) {
  427. this.email_err = null
  428. this.fieldsNum++
  429. }
  430. return true
  431. },
  432. handleInfo(message, $event) {
  433. $event && $event.target.blur()
  434. return this.handleErr(message, this.err[message], null)
  435. },
  436. submit() {
  437. this.submitted = true
  438. let i = 0
  439. if (this.handleCheckBox('platforms')) i++
  440. if (this.handleCheckBox('features')) i++
  441. if (this.handleInfo('description')) i++
  442. if (this.handleInfo('name')) i++
  443. if (this.handleEmail()) i++
  444. if (this.handleInfo('company')) i++
  445. if (this.handleInfo('website')) i++
  446. this.fieldsNum = i
  447. if (this.fieldsNum < 7) {
  448. this.errText = '请完成必选项的填写'
  449. return
  450. }
  451. this.errText = ''
  452. const self = this
  453. this.$axios({
  454. method: 'POST',
  455. url: this.$config.pdfDomain + '/api/contact',
  456. data: {
  457. 'detail[platform]': self.platforms.join(', '),
  458. 'detail[feature]': self.features.join(', '),
  459. 'detail[description]': self.description,
  460. 'contact_email[user_name]': self.name,
  461. 'contact_email[email]': self.email,
  462. 'detail[building]': self.building,
  463. 'detail[phone]': self.phone,
  464. 'detail[number]': self.number,
  465. 'detail[company]': self.company,
  466. 'detail[website]': self.website,
  467. 'detail[industry]': self.industry
  468. },
  469. transformRequest: [function (data) {
  470. let ret = ''
  471. for (let item in data) {
  472. ret += encodeURIComponent(item) + '=' + encodeURIComponent(data[item]) + '&'
  473. }
  474. ret = ret.substr(0, ret.length - 1)
  475. return ret
  476. }]
  477. })
  478. .then((res) => {
  479. console.log(res)
  480. const { data } = res
  481. if (data.status === 'success') {
  482. console.log('Replace the success Flag')
  483. setTimeout(function () {
  484. self.submitText = 'Success'
  485. self.modalShow = true
  486. }, 0)
  487. } else if (data.status === 'faild') {
  488. alert('The email fails to send.')
  489. }
  490. })
  491. .catch((err) => {
  492. console.log(err)
  493. alert('The email fails to send.')
  494. })
  495. }
  496. }
  497. }
  498. </script>
  499. <style lang="scss" scoped>
  500. .contact-container {
  501. .contact-box {
  502. label {
  503. input {
  504. position: absolute;
  505. border: 0px;
  506. clip: rect(0px, 0px, 0px, 0px);
  507. height: 1px;
  508. width: 1px;
  509. margin: -1px;
  510. padding: 0px;
  511. overflow: hidden;
  512. white-space: nowrap;
  513. }
  514. svg {
  515. flex-shrink: 0;
  516. color: #1460F3;
  517. }
  518. }
  519. .box {
  520. flex-shrink: 0;
  521. display: inline-block;
  522. width: 22px;
  523. height: 22px;
  524. border: 2px solid #A6B2BF;
  525. border-radius: 2px;
  526. }
  527. }
  528. .comment-item {
  529. &::before {
  530. content: '';
  531. display: block;
  532. width: 60px;
  533. height: 2px;
  534. margin-bottom: 18px;
  535. background-color: rgba(20, 96, 243, 0.1);
  536. }
  537. & + .comment-item {
  538. margin-top: 30px;
  539. }
  540. }
  541. }
  542. @media screen and (max-width: 767px) {
  543. .banner {
  544. background: linear-gradient(90deg, #8D83FF 0%, #1D69FC 118.36%);
  545. }
  546. }
  547. @media screen and (min-width: 768px) {
  548. .banner {
  549. background: #F8FAFF url('/images/contact/sdk_form_bg.jpg') center bottom no-repeat;
  550. background-size: 1920px auto;
  551. }
  552. }
  553. @media screen and (min-width: 930px) {
  554. .contact-container {
  555. .contact-box {
  556. box-shadow: 0px 4px 35px rgba(129, 149, 200, 0.18);
  557. }
  558. }
  559. }
  560. @media screen and (min-width: 1920px) {
  561. .banner {
  562. background-size: cover;
  563. }
  564. }
  565. </style>