pc-collect-user-info.js 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083
  1. /**
  2. * 该文件出自主程序js目录pc-collect-user-info.js
  3. * seo项目留资仅能指向到common-module目录,后续可都迁移到此文件
  4. */
  5. var temp = `
  6. <div>
  7. <div class="user-data-dialog" id="collectUserInfoDialog" v-if="showForm">
  8. <div class="mask"></div>
  9. <div class="dialog-container seo-dialog-container">
  10. <div class="dialog-header fs18" v-if="dialogTitleTop" v-text="dialogTitleTop"></div>
  11. <div class="dialog-header dialog-header-subtitle mt-4" v-if="dialogTitle" v-html="dialogTitle"></div>
  12. <div class="dialog-content">
  13. <el-form class="user-form" :model="form" :rules="rules" ref="ruleForm">
  14. <!-- 基本信息 -->
  15. <div class="basic clearfix">
  16. <div class="form-title">基本信息</div>
  17. <div class="form-main clearfix">
  18. <div class="short-control fl">
  19. <el-form-item label="姓名 :" prop="name">
  20. <el-input v-model.trim="form.name" data-short-input class="item-input" placeholder="请输入姓名" @focus="nameFocus" required>
  21. </el-input>
  22. </el-form-item>
  23. </div>
  24. <div class="short-control fr">
  25. <el-form-item label="手机号 :" prop="phone">
  26. <el-input v-model.trim="form.phone" maxlength="11" @input="inputPhone" data-short-input class="item-input" placeholder="请输入准确的手机号" @focus="phoneFocus"></el-input>
  27. </el-form-item>
  28. </div>
  29. <div class="short-control fl" v-if="moduleShow.email">
  30. <el-form-item label="邮箱 :" prop="mail">
  31. <el-input v-model.trim="form.mail" data-short-input class="item-input" placeholder="请输入邮箱" @focus="mailFocus"></el-input>
  32. </el-form-item>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="company clearfix">
  37. <div class="form-title">公司信息</div>
  38. <div class="form-main">
  39. <div class="long-control" style="position: relative;">
  40. <el-form-item label="公司名称 :" prop="companyName">
  41. <el-input
  42. v-model.trim="form.companyName"
  43. data-long-input
  44. class="item-input company-name"
  45. @focus="companyFocus"
  46. @input="searchCompany"
  47. placeholder="请输入准确的公司名称">
  48. </el-input>
  49. </el-form-item>
  50. <div class="company-result" v-if="showSearchResult">
  51. <div class="company-list" v-for="item in companyList" :key="item" @click="selectCompany(item)" v-html="item"></div>
  52. </div>
  53. </div>
  54. <div class="long-control" v-if="moduleShow.companyType">
  55. <el-form-item label="公司类型 :" class="company-type" prop="companyType">
  56. <el-checkbox-group v-model="form.companyType">
  57. <el-checkbox label="投标企业"></el-checkbox>
  58. <el-checkbox label="招标采购单位"></el-checkbox>
  59. <el-checkbox label="厂商"></el-checkbox>
  60. <el-checkbox label="招标代理机构"></el-checkbox>
  61. <el-checkbox label="经销商"></el-checkbox>
  62. <el-checkbox label="服务提供商"></el-checkbox>
  63. <el-checkbox label="其他"></el-checkbox>
  64. </el-checkbox-group>
  65. </el-form-item>
  66. </div>
  67. <div class="long-control" v-if="moduleShow.job">
  68. <el-form-item label="职位 :" prop="job">
  69. <el-select v-model="form.job" placeholder="请选择职位" data-short-input popper-class="leave-info-select" class="item-input" clearable>
  70. <el-option v-for="item in jobData" :key="item.value" :label="item.label" :value="item.value">
  71. </el-option>
  72. </el-select>
  73. <el-select v-if="showBranch" v-model="form.branch" placeholder="请选择部门" data-short-input popper-class="leave-info-select" class="item-input" clearable>
  74. <el-option v-for="item in branchData" :key="item.value" :label="item.label" :value="item.value">
  75. </el-option>
  76. </el-select>
  77. </el-form-item>
  78. </div>
  79. <div class="long-control" v-if="moduleShow.cooperate">
  80. <el-form-item label="合作概述 :" prop="cooperate">
  81. <el-input
  82. v-model.trim="form.cooperate"
  83. data-long-input
  84. class="item-input company-name"
  85. placeholder="请填写商务合作内容">
  86. </el-input>
  87. </el-form-item>
  88. </div>
  89. <div class="long-control" v-if="moduleShow.business">
  90. <el-form-item label="业务范围 :">
  91. <el-input type="textarea" autosize resize="none" v-model="form.business" data-long-input class="item-input"
  92. placeholder="请输入业务范围,让合作伙伴充分了解公司业务内容"></el-input>
  93. </el-form-item>
  94. </div>
  95. <div class="long-control" v-if="moduleShow.need">
  96. <el-form-item label="合作需求 :">
  97. <el-input type="textarea" autosize resize="none" v-model="form.need" data-long-input class="item-input"
  98. placeholder="请输入合作需求,从而创造并匹配更多合作交流机会"></el-input>
  99. </el-form-item>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="company clearfix" v-if="moduleShow.report">
  104. <div class="form-title">定制专属分析报告</div>
  105. <div class="form-main">
  106. <div class="long-control">
  107. <el-form-item label="您的行业 :" class="industry-type" prop="industry">
  108. <el-checkbox-group v-model="form.industry" @change="onIndustryChange">
  109. <el-checkbox v-for="item in industryData" :key="item" :label="item"></el-checkbox>
  110. <el-input
  111. v-model.trim="form.otherIndustry"
  112. class="item-input industry-input"
  113. @input="onOtherIndustryInput"
  114. placeholder="请输入您的行业">
  115. </el-input>
  116. </el-checkbox-group>
  117. </el-form-item>
  118. </div>
  119. </div>
  120. </div>
  121. <div class="warm-prompt">
  122. <span class="icon-warning"></span>
  123. <span class="warm-text">@@warmText@@</span>
  124. </div>
  125. <div class="agree-service" v-if="moduleShow.agree">
  126. <el-checkbox v-model="form.agreeChecked">&nbsp;我同意剑鱼标讯将业务范围及合作需求提供给潜在合作伙伴搜索、查看</el-checkbox>
  127. </div>
  128. <div class="dialog-footer">
  129. <el-button class="cancel-btn" @click="cancelForm" v-text="ajaxSourceTitleInfo.cancelText"></el-button>
  130. <el-button class="submit-btn" @click="submitForm('ruleForm')" v-text="ajaxSourceTitleInfo.submitText"></el-button>
  131. </div>
  132. </el-form>
  133. </div>
  134. </div>
  135. </div>
  136. <div id="success-dialog" style="display: none;" v-show="showSuccess">
  137. <div class="mask"></div>
  138. <div class="success-dialog-container">
  139. <div class="success-title">提交成功</div>
  140. <div class="success-content" v-html="successText"></div>
  141. <div class="success-footer">
  142. <button type="button" class="custom-btn go-know" @click="knowHandle" v-text="successConfirmText"></button>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. `
  148. var jobJson = [
  149. '总裁',
  150. '总经理',
  151. '总监',
  152. '经理',
  153. '主管',
  154. '职员'
  155. ]
  156. var branchJson = [
  157. '市场',
  158. '产品',
  159. '销售',
  160. '渠道',
  161. '其他'
  162. ]
  163. var jobData = jobJson.map(function (item) {
  164. return {
  165. value: item,
  166. label: item
  167. }
  168. })
  169. // 部门数据处理
  170. var branchData = branchJson.map(function (item) {
  171. return {
  172. value: item,
  173. label: item
  174. }
  175. })
  176. // 您的行业
  177. var industryData = ['建筑工程', '行政办公', '医疗卫生', '服务采购', '机械设备', '弱电安防', '信息技术', '交通工程', '市政设施', '其他']
  178. // 防抖
  179. function debounce (fn, delay) {
  180. var timer
  181. return function () {
  182. var context = this
  183. var args = arguments
  184. clearTimeout(timer)
  185. timer = setTimeout(function () {
  186. fn.apply(context, args)
  187. }, delay)
  188. }
  189. }
  190. function getParam(name) {
  191. var search = document.location.search;
  192. // alert(search);
  193. var pattern = new RegExp("[?&]" + name + "\=([^&]+)", "g");
  194. var matcher = pattern.exec(search);
  195. //工作桌面快照页面登录后 地址不做切割
  196. if (name==="backTo"&&search.indexOf("page_workDesktop")>0&&search.indexOf("content")>0){
  197. matcher[1] = search.replace("?backTo=","");
  198. }
  199. var items = null;
  200. if (null != matcher) {
  201. try {
  202. items = decodeURIComponent(decodeURIComponent(matcher[1]));
  203. } catch (e) {
  204. try {
  205. items = decodeURIComponent(matcher[1]);
  206. } catch (e) {
  207. items = matcher[1];
  208. }
  209. }
  210. }
  211. return items;
  212. }
  213. function checkRequiredKeys (keys, target) {
  214. try {
  215. // 职位/部门特殊处理, 满足时移除部门校验
  216. if (keys.indexOf('branch') !== -1 && keys.indexOf('position') !== -1) {
  217. if (target['position'] === '总裁' || target['position'] === '总经理') {
  218. keys.splice(keys.indexOf('branch'), 1)
  219. }
  220. }
  221. return !keys.some(function (k) {
  222. var tempValue = target[k]
  223. var result = false
  224. if (typeof tempValue === 'number') {
  225. tempValue = tempValue.toString()
  226. }
  227. if (typeof tempValue === 'string') {
  228. result = tempValue.trim() !== ''
  229. }
  230. if (typeof tempValue === 'boolean') {
  231. result = true
  232. }
  233. return !result
  234. })
  235. } catch (e) {
  236. console.warn(e)
  237. return false
  238. }
  239. }
  240. var vm = new Vue({
  241. el: '#vue-collect-user-info',
  242. delimiters: ['@@', '@@'],
  243. template: temp,
  244. data: function () {
  245. var validName = function (rule, value, callback) {
  246. if (value === '') {
  247. return callback(new Error('姓名为必填项'));
  248. } else {
  249. if (value.length < 2) {
  250. return callback(new Error('姓名填写不正确'));
  251. }
  252. callback();
  253. }
  254. }
  255. var validPhone = function (rule, value, callback) {
  256. var status = /^1[3-9]\d{9}$/.test(value)
  257. if (value === '') {
  258. return callback(new Error('手机号为必填项'));
  259. } else if (!status) {
  260. return callback(new Error('手机号填写不正确'));
  261. } else {
  262. callback();
  263. }
  264. }
  265. var validEmail = function (rule, value, callback) {
  266. var status = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)
  267. if (value === '') {
  268. return callback(new Error('邮箱为必填项'));
  269. } else {
  270. if (!status) {
  271. return callback(new Error('邮箱填写不正确'));
  272. } else {
  273. callback();
  274. }
  275. }
  276. }
  277. var validCompany = function (rule, value, callback) {
  278. if (value === '') {
  279. return callback(new Error('公司名称为必填项'));
  280. } else {
  281. if (value.length < 2) {
  282. return callback(new Error('公司名称至少输入2个字'));
  283. } else {
  284. callback();
  285. }
  286. }
  287. }
  288. var validJob = function (rule, value, callback) {
  289. if (value === '') {
  290. return callback(new Error('职位不能为空'));
  291. } else {
  292. if ((value.indexOf('总裁') === -1 || value.indexOf('总经理') === -1) && vm.showBranch && !vm.form.branch) {
  293. return callback(new Error('部门不能为空'));
  294. } else {
  295. callback();
  296. }
  297. }
  298. }
  299. var validIndustry = function (rule, value, callback) {
  300. if (!value.length) {
  301. return callback(new Error('行业为必填项'));
  302. } else {
  303. if (value.indexOf('其他') !== -1) {
  304. if (vm.form.otherIndustry === '') {
  305. callback(new Error('请输入行业'))
  306. } else if (vm.industryData.indexOf(vm.form.otherIndustry) !== -1) {
  307. callback(new Error('行业输入重复'))
  308. } else {
  309. callback()
  310. }
  311. } else {
  312. if (vm.industryData.indexOf(vm.form.otherIndustry) !== -1) {
  313. callback(new Error('行业输入重复'))
  314. } else {
  315. callback()
  316. }
  317. }
  318. }
  319. }
  320. return {
  321. dialogTitleTop: '为给您匹配精准的推荐信息,请完善个人信息',
  322. dialogTitle: '',
  323. ajaxSourceTitleInfo: {
  324. cancelText: '暂不提供',
  325. submitText: '提交'
  326. },
  327. jobData: jobData, // 职位数据
  328. branchData: branchData,
  329. industryData: industryData,
  330. form: {
  331. name: '', // 姓名
  332. phone: '', // 手机号
  333. mail: '', // 邮箱
  334. companyName: '', // 公司名称
  335. companyType: [], // 公司类型值
  336. job: '', // 职位值
  337. otherJob: '', //自定义职位
  338. business: '', // 业务范围
  339. need: '', // 合作需求
  340. agreeChecked: true,
  341. branch: '',
  342. cooperate: '', // 商务合作
  343. industry: [], // 行业
  344. otherIndustry: '', // 其他行业
  345. },
  346. rules: {
  347. name: [
  348. {
  349. required: true,
  350. validator: validName,
  351. trigger: 'blur'
  352. }
  353. ],
  354. phone: [
  355. {
  356. required: true,
  357. validator: validPhone,
  358. trigger: 'blur'
  359. }
  360. ],
  361. mail: [
  362. {
  363. required: true,
  364. validator: validEmail,
  365. trigger: 'blur'
  366. }
  367. ],
  368. companyName: [
  369. {
  370. required: true,
  371. validator: validCompany,
  372. trigger: 'blur'
  373. }
  374. ],
  375. companyType: [
  376. {
  377. required: true,
  378. message: '公司类型为必填项',
  379. trigger: 'blur'
  380. }
  381. ],
  382. job: [
  383. {
  384. required: true,
  385. validator: validJob,
  386. trigger: 'change'
  387. }
  388. ],
  389. cooperate: [
  390. {
  391. required: true,
  392. message: '商务合作为必填项',
  393. trigger: 'change'
  394. }
  395. ],
  396. industry: [
  397. {
  398. required: true,
  399. validator: validIndustry,
  400. trigger: 'change'
  401. }
  402. ],
  403. },
  404. showSearchResult: false,
  405. companyList: [],
  406. showForm: false, // 显示表单填写弹框
  407. showSuccess: false, // 显示提交成功弹框
  408. isForce: false, // 是否强制
  409. source: '', // 来源模块
  410. curDom: null,
  411. // 默认为隐藏,需要展示则需判断
  412. moduleShow: {
  413. email: false,
  414. companyType: true,
  415. job: true,
  416. business: false,
  417. need: false,
  418. agree: false,
  419. cooperate: false, // 商务合作显示
  420. report: false // seo-定制专属分析报告
  421. },
  422. sourceTitleMap: {
  423. pc_article_member_freeuse: '请升级大会员无限制查看标讯、超前项目,优先对接项目负责人,抢占绝对先机!',
  424. article_attach_freeuser: '请留下联系方式,立即免费体验【附件下载】1次,招标文件/采购清单一键下载,商机更完整!',
  425. pc_mine_member_attach_learnmore: '请留下联系方式,我们会尽快联系您!部分招标公告信息等相关文件资料自主下载,帮助企业投标,客户分析、市场挖掘更高效。',
  426. ent_portrait_: '请留下联系方式,我们会尽快联系您!体验企业画像分析,帮你透视企业!',
  427. buyer_portrait_: '请留下联系方式,我们会尽快联系您!体验采购单位画像分析,为你挖掘客户!',
  428. member_attach: '请留下联系方式,我们会尽快联系您!体验附件下载特权,挖掘更多项目情报!',
  429. pc_index_bottom_adv: '请留下联系方式,我们会尽快联系您体验:市场分析周报/月报、竞对实时监控和分析、业主采购趋势/客户分析等',
  430. article_ent_portrait: '请留下联系方式,我们会尽快联系您!体验企业画像分析,帮你透视企业!',
  431. article_buyer_portrait: '请留下联系方式,我们会尽快联系您!体验采购单位画像分析,为你挖掘客户!',
  432. article_slogan: '请留下联系方式,我们会尽快联系您体验大会员全部功能!',
  433. member_: '请留下联系方式,我们会尽快联系您体验大会员全部功能!',
  434. function_: '请留下联系方式,我们会尽快联系您体验大会员全部功能!', // 大会员功能介绍
  435. jylab_see500_plus: '请留下联系方式,我们会尽快联系您!开通大会员可查看更多招标项目,实时监控更多潜在商机!', // 标讯搜索500条
  436. article_purchase_intention: '留下您的联系方式,我们会尽快和您联系。提前介入项目,助您轻松中标。', // 三级页-采购意向
  437. article_proposed_project: '留下您的联系方式,我们会尽快和您联系。提前介入项目,助您轻松中标。', // 三级页-拟建项目
  438. 'ent-manage-pc': '欢迎留下联系方式,我们的大客户经理会在24小时内联系您!',
  439. "jyarticle_see3_plus_pc": "请完善个人信息,即刻享无限次查看标讯的权益,如需查看超前项目请联系客服:400-108-6670",
  440. 'activity_free_plan': '请完善信息,免费获取200剑鱼币',
  441. super_membership_day: '请留下联系方式,我们会尽快联系您体验大会员全部功能!',
  442. peugeot_supplier_regist: '请完善您的个人信息,抢先对接采购单位',
  443. peugeot_view_infor: '请留下联系方式,我们会尽快联系您体验大会员全部功能!',
  444. 'bidmanagement-landingpage': '请留下联系方式,我们会尽快联系您体验投标项目管理全部功能!',
  445. 'businesscooperation-landingpage': '无',
  446. 'customermanagement-landingpage': '请留下联系方式,我们会尽快联系您体验客户管理全部功能!',
  447. 'digitalmarketing-landingpage': '请留下联系方式,我们会尽快联系您体验数字化营销全部功能!',
  448. 'pc_ServiceList_experience': '请留下您的信息,我们将为您推荐最符合您业务需求的产品和服务!',
  449. 'pc_briefinghomepage_dzhfxbg': '帮您透视行业,轻松把握行业核心需求',
  450. 'pc_briefinglist_dzhfxbg': '帮您透视行业,轻松把握行业核心需求',
  451. 'pc_briefingdetails_dzhfxbg': '帮您透视行业,轻松把握行业核心需求',
  452. 'pc_Library_details_free': '此文档为剑鱼文库的付费下载内容,提交资料后可免费下载。'
  453. },
  454. isRefresh: false, // 留完资是否需要刷新页面
  455. sourceDescMap: {
  456. jyarticle_see3_plus_pc: '标讯详情页-无限次免费查看标讯的权益',
  457. pc_article_original_one: '标讯详情页-免费用户获取1次查看原文链接机会',
  458. pc_article_original_more: '标讯详情页-获取更多查看原文链接机会',
  459. 'bidmanagement-landingpage': '投标项目管理落地页',
  460. 'businesscooperation-landingpage': '商务合作落地页',
  461. 'customermanagement-landingpage': '客户管理落地页',
  462. 'digitalmarketing-landingpage': '数字化营销落地页',
  463. 'pc_ServiceList_experience': 'PC服务列表-申请免费体验'
  464. },
  465. warmText: '温馨提示:请提供准确的信息,我们将为您推荐更准确、更个性化的商机和服务'
  466. }
  467. },
  468. computed: {
  469. showOtherJob: function () {
  470. return this.form.job == '其他'
  471. },
  472. showBranch: function () {
  473. // 切换到总裁或总经理之后 把之前选择的部门清空
  474. if (this.form.job.indexOf('总裁') > -1 || this.form.job.indexOf('总经理') > -1) {
  475. this.form.branch = ''
  476. }
  477. var zc = this.form.job.indexOf('总裁') > -1
  478. var zjl = this.form.job.indexOf('总经理') > -1
  479. return !(zc || zjl) && this.form.job
  480. },
  481. // 提交成功,确定按钮文案
  482. successConfirmText: function () {
  483. var passArr = ['activity_free_plan']
  484. if (passArr.indexOf(this.source) !== -1) {
  485. return '去领取'
  486. } else {
  487. return '我知道了'
  488. }
  489. },
  490. // 提交成功 提示文案
  491. successText: function () {
  492. if (this.source.indexOf('_freeuser') > -1 && this.source.indexOf('member_') === -1) {
  493. var text = ''
  494. if (this.source.indexOf('article_attach') > -1) {
  495. text = '附件下载'
  496. } else {
  497. return '我们会尽快联系您并预约演示时间,请耐心等待~您将获得免费体验大会员全部功能!'
  498. }
  499. return '恭喜您,成功解锁【' + text + '】权益1次。如需查看更多,请开通超级订阅,为您提供最新的商业情报,抢占先机。'
  500. } else {
  501. if (this.source.indexOf('ent-manage-pc') > -1) {
  502. return '我们会尽快联系您并预约演示时间,请耐心等待~<br>您将获得免费体验商机管理全部功能!'
  503. }
  504. if (this.source.indexOf('jyarticle_see3_plus_pc') > -1) {
  505. return '您已获得无限次免费查看标讯的权益,如需查看超前项目请联系客服:400-108-6670'
  506. }
  507. if (this.source === 'activity_free_plan') {
  508. return '完善信息任务已完成,快去领取剑鱼币吧~'
  509. }
  510. if (this.source === 'peugeot_supplier_regist') {
  511. return '我们会尽快联系您完成供应商报名,请耐心等待。'
  512. }
  513. if (this.source === 'pc_index_bid_data') {
  514. return '我们会尽快联系您并根据您的需求,提供最适合的产品演示服务,请耐心等待。'
  515. }
  516. if (this.source === 'pc_article_member_freeuse') {
  517. return '已收到您提交的免费体验大会员申请,我们会尽快联系您并预约演示时间。'
  518. }
  519. if (this.source === 'pc_article_original_more') {
  520. return '已收到您提交的升级大会员申请,我们会尽快联系您并预约演示时间。'
  521. }
  522. if (this.source === 'pc_article_original_more') {
  523. return '已收到您提交的升级大会员申请,我们会尽快联系您并预约演示时间。'
  524. }
  525. if (this.source === 'businesscooperation-landingpage') {
  526. return '商务合作经理会尽快联系您,请耐心等待~'
  527. }
  528. if (this.source === 'bidmanagement-landingpage') {
  529. return ' 我们会尽快联系您并预约演示时间,请耐心等待~<br>您将获得免费体验投标项目管理全部功能!'
  530. }
  531. if (this.source === 'digitalmarketing-landingpage') {
  532. return '我们会尽快联系您并预约演示时间,请耐心等待~<br>您将获得免费体验数字化营销全部功能!'
  533. }
  534. if (this.source === 'customermanagement-landingpage') {
  535. return ' 我们会尽快联系您并预约演示时间,请耐心等待~<br>您将获得免费体验客户管理全部功能!'
  536. }
  537. if (this.source === 'pc_ServiceList_experience') {
  538. return '已收到您提交的剑鱼产品免费体验申请,我们会尽快联系您并预约演示时间。'
  539. }
  540. if (this.source === 'pc_briefinghomepage_dzhfxbg' || this.source === 'pc_briefinglist_dzhfxbg' || this.source === 'pc_briefingdetails_dzhfxbg') {
  541. return '我们会快马加鞭的与您联系,请您保持电话畅通。'
  542. }
  543. if (this.source === 'pc_Library_details_free') {
  544. return '请返回文档页面免费下载,如需获取更多文档,请开通剑鱼文库会员。'
  545. }
  546. return '我们会尽快联系您并预约演示时间,请耐心等待~<br>您将获得免费体验大会员全部功能!'
  547. }
  548. }
  549. },
  550. mounted: function () {
  551. var that = this;
  552. $(document).on('click', function (e) {
  553. var dom = $('.company-name')[0];
  554. if (dom) {
  555. // 如果点击的区域不在自定义dom范围
  556. if (!dom.contains((e.target))) {
  557. that.showSearchResult = false
  558. }
  559. }
  560. })
  561. },
  562. beforeDestroy: function () {
  563. $(document).off('click')
  564. },
  565. methods: {
  566. onIndustryChange: function (val) {
  567. console.log(val)
  568. },
  569. onOtherIndustryInput: function (event) {
  570. var val = event.replace(/\s*/g, '')
  571. if (val) {
  572. if (this.form.industry.indexOf('其他') !== -1) {
  573. // console.log('有');
  574. } else {
  575. this.form.industry.push('其他')
  576. }
  577. }
  578. },
  579. // 点击我知道了
  580. knowHandle: function () {
  581. this.showSuccess = false
  582. if (this.isRefresh) {
  583. window.location.reload()
  584. }
  585. },
  586. // 不需要调留资接口 弹出留资弹框回调方法
  587. noCallApiFn: function (source, isRefresh) {
  588. this.isRefresh = isRefresh
  589. vm.source = source
  590. this.showForm = true
  591. this.calcTitleText(source)
  592. this.getOldInfo(source)
  593. },
  594. calcTitleText: function (source) {
  595. if (!source) return
  596. var text = ''
  597. for (var key in this.sourceTitleMap) {
  598. if (source.indexOf(key) !== -1) {
  599. text = this.sourceTitleMap[key]
  600. break
  601. }
  602. }
  603. if (text) {
  604. if (source.indexOf('_freeuser') > -1 && text.indexOf('【') > -1) {
  605. var r = text.match(/\【(.+?)\】/g)
  606. this.dialogTitleTop = '欢迎体验' + r[0].replace('【', '').replace('】', '')
  607. this.dialogTitle = text
  608. } else if (source.indexOf('ent-manage') > -1) {
  609. this.dialogTitle = text
  610. this.dialogTitleTop = '欢迎体验剑鱼标讯商机管理'
  611. } else if (source.indexOf('jyarticle_see3_plus_pc') > -1) {
  612. this.dialogTitle = text
  613. this.dialogTitleTop = '免费享无限次查看标讯体验'
  614. } else if (source === 'activity_free_plan') {
  615. this.dialogTitle = text
  616. this.dialogTitleTop = '完善信息'
  617. } else if (source === 'article_proposed_project' || source === 'article_purchase_intention') {
  618. this.dialogTitle = text
  619. this.dialogTitleTop = '欢迎体验剑鱼大会员'
  620. } else if (source === 'pc_article_member_freeuse') {
  621. this.dialogTitle = text
  622. this.dialogTitleTop = '免费体验大会员功能权益'
  623. } else if (source === 'bidmanagement-landingpage') {
  624. this.dialogTitle = text
  625. this.dialogTitleTop = '欢迎体验剑鱼投标项目管理'
  626. } else if (source === 'businesscooperation-landingpage') {
  627. this.dialogTitle = ''
  628. this.dialogTitleTop = '请留下您的信息,我们会尽快和您联系'
  629. } else if (source === 'customermanagement-landingpage') {
  630. this.dialogTitle = text
  631. this.dialogTitleTop = '欢迎体验剑鱼客户管理'
  632. } else if (source === 'digitalmarketing-landingpage') {
  633. this.dialogTitle = text
  634. this.dialogTitleTop = '欢迎体验剑鱼数字化营销'
  635. } else if (source === 'pc_ServiceList_experience') {
  636. this.dialogTitle = text
  637. this.dialogTitleTop = '申请免费体验剑鱼产品'
  638. } else if (source === 'pc_briefinghomepage_dzhfxbg' || source === 'pc_briefinglist_dzhfxbg' || source === 'pc_briefingdetails_dzhfxbg') {
  639. this.dialogTitle = text
  640. this.dialogTitleTop = '免费获取行业分析报告'
  641. } else if (source === 'pc_Library_details_free') {
  642. this.dialogTitle = text
  643. this.dialogTitleTop = '申请免费下载文档'
  644. }
  645. // else if (source.indexOf("article_collection") > -1){
  646. // this.dialogTitle = text
  647. // this.dialogTitleTop = "为给您匹配精准的推荐信息,请完善个人信息"
  648. // }
  649. else {
  650. this.dialogTitle = text
  651. this.dialogTitleTop = '欢迎体验剑鱼大会员'
  652. }
  653. // 控制非常规表单模块是否展示,默认全部隐藏,companyType、job(公司类型、职位大多数场景都需要展示)
  654. var noNeedCompanyType = ['bidmanagement-landingpage', 'pc_briefinghomepage_dzhfxbg', 'pc_briefinglist_dzhfxbg', 'pc_briefingdetails_dzhfxbg']
  655. var noNeedJob = ['bidmanagement-landingpage']
  656. for (var k in this.moduleShow) {
  657. this.moduleShow[k] = false
  658. }
  659. if (noNeedCompanyType.indexOf(this.source) > -1) {
  660. this.moduleShow.companyType = false
  661. } else {
  662. this.moduleShow.companyType = true
  663. }
  664. if (noNeedJob.indexOf(this.source) > -1) {
  665. this.moduleShow.job = false
  666. } else {
  667. this.moduleShow.job = true
  668. }
  669. if (this.source == "bidmanagement-landingpage") {
  670. this.moduleShow.cooperate = true
  671. } else if (this.source.indexOf('_dzhfxbg') > -1) {
  672. this.moduleShow.report = true
  673. this.warmText = '温馨提示:请提供您的真实信息,以便为您提供精准的分析报告'
  674. }
  675. }
  676. },
  677. nameFocus: function () {
  678. this.$refs['ruleForm'].clearValidate(['name']);
  679. },
  680. phoneFocus: function () {
  681. this.$refs['ruleForm'].clearValidate(['phone']);
  682. },
  683. mailFocus: function () {
  684. this.$refs['ruleForm'].clearValidate(['mail']);
  685. },
  686. // 公司名称获取焦点时
  687. companyFocus: function () {
  688. this.$refs['ruleForm'].clearValidate(['companyName']);
  689. this.getResult(this.form.companyName)
  690. },
  691. otherFocus: function () {
  692. this.$refs['ruleForm'].clearValidate(['job', 'otherJob']);
  693. },
  694. // 是否留资
  695. isNeedSubmit: function (source, callback, dom, infoid, entranceType) {
  696. /*
  697. 三级页-阅读原文 article_original
  698. 三级页-收藏 article_collection
  699. 大会员落地页-免费体验 member_freeuse
  700. */
  701. this.source = source
  702. this.calcTitleText(source)
  703. var _this = this
  704. $.ajax({
  705. type: 'GET',
  706. url: '/salesLeads/retainedCapital',
  707. data: {
  708. source: source
  709. },
  710. success: function (res) {
  711. // 判断当前信息否在其他页面留资 如果全部留资 直接弹窗提交成功
  712. if (entranceType == 'freeDownload') { //结构化数据调用留资弹框 单独判断个类型不影响原逻辑 表单如有更改可区分
  713. var checkKeys = ['name', 'phone', 'companyType', 'company', 'position', 'branch', 'cooperate']
  714. } else {
  715. var checkKeys = ['name', 'phone', 'companyType', 'company', 'branch', 'position', 'cooperate']
  716. }
  717. var sourceList = ['article_collection', 'article_original', 'jyarticle_see3_plus_app', 'jyarticle_see3_plus_pc', 'jyarticle_see3_plus_wx', 'jypush_see10_plus_app', 'jypush_see10_plus_wx']
  718. var isCollect = sourceList.indexOf(source) > -1
  719. if (infoid != "") {
  720. res.info.publish_id = infoid
  721. }
  722. var result = checkRequiredKeys(checkKeys, res.info)
  723. if (result) {
  724. // 包含这些source,不存记录
  725. // 非主动触发留资节点,每点击一次数据库不会记录
  726. if (!isCollect) {
  727. _this.showForm = true
  728. _this.setEchoInfo(res.info)
  729. } else {
  730. res.data.retainedCapital = false
  731. callback && callback(res)
  732. }
  733. switch (source) {
  734. case 'member_freeuse': {
  735. // _this.showSuccess = true
  736. break
  737. }
  738. case 'jyarticle_see3_plus_pc': {
  739. $(".detail-nj-btn").click(function () {
  740. $(".mask-zzz").hide()
  741. })
  742. break
  743. }
  744. case 'article_original': {
  745. _this.showSuccess = false
  746. break
  747. }
  748. case 'article_collection': {
  749. _this.showSuccess = false
  750. break
  751. }
  752. case 'pc_index_bottom_adv': {
  753. location.href = '/big/page/index'
  754. break
  755. }
  756. }
  757. } else if (res.data) {
  758. window.isRetained = res.data.retainedCapital
  759. _this.isForce = res.data.fource
  760. if (window.isFree || !isCollect) {
  761. if (res.data.retainedCapital || !result) {
  762. _this.showForm = true
  763. // _this.getOldInfo(source)
  764. _this.setEchoInfo(res.info)
  765. _this.curDom = dom
  766. } else {
  767. callback && callback(res)
  768. }
  769. } else {
  770. callback && callback(res)
  771. }
  772. }
  773. if (source === 'businesscooperation-landingpage') {
  774. _this.moduleShow.cooperate = true
  775. } else {
  776. // _this.moduleShow.companyType = true
  777. // _this.moduleShow.job = true
  778. _this.moduleShow.cooperate = false
  779. }
  780. }
  781. })
  782. this.getSourceTitle(source)
  783. },
  784. getSourceTitle: function(source) {
  785. var _this = this
  786. var payload = { codes: [source] }
  787. $.ajax({
  788. type: 'post',
  789. url: '/salesLeads/getConfig',
  790. contentType: 'application/json;charset=utf-8',
  791. data: JSON.stringify(payload),
  792. success: function(res) {
  793. try {
  794. var info = res.data[source]
  795. if (info) {
  796. if (info.title) {
  797. _this.dialogTitleTop = info.title
  798. }
  799. if (info.subtitle) {
  800. _this.dialogTitle = info.subtitle
  801. }
  802. if (info.button_cancel) {
  803. _this.ajaxSourceTitleInfo.cancelText = info.button_cancel
  804. }
  805. if (info.button_confirm) {
  806. _this.ajaxSourceTitleInfo.submitText = info.button_confirm
  807. }
  808. }
  809. } catch (e) {
  810. console.warn(e)
  811. }
  812. }
  813. })
  814. },
  815. // 表单提交事件
  816. submitForm: function (formName) {
  817. var _this = this
  818. this.$refs[formName].validate(function (valid) {
  819. if (valid) {
  820. _this.formAjax(vm.source)
  821. _this.bigDocAjax()
  822. } else {
  823. console.log('error submit!!');
  824. return false;
  825. }
  826. });
  827. },
  828. // 快照页引流的文案埋点 留资提交时埋点
  829. bigDocAjax: function () {
  830. if (getParam('id')) {
  831. try {
  832. $.ajax({
  833. type: "POST",
  834. url: "/publicapply/drainage/bmt/" + getParam('id'),
  835. data: {
  836. p: 'ICRW'
  837. },
  838. success: function (r) {
  839. console.log(r)
  840. }
  841. })
  842. } catch (error) {
  843. console.log(error)
  844. }
  845. }
  846. },
  847. // 表单提交请求
  848. formAjax: function (source, info) {
  849. try {
  850. var infoid = window.location.pathname.split("/")[3].split(".html")[0]
  851. } catch (error) { }
  852. var isProDetail = window.location.pathname.indexOf('/article/content')
  853. var params = {
  854. source: source,
  855. name: this.form.name,
  856. phone: this.form.phone,
  857. mail: this.form.mail,
  858. company: this.form.companyName, // 公司名称
  859. companyType: this.form.companyType.join(','),
  860. position: this.form.job == '其他' ? ('其他/' + this.form.otherJob) : this.form.job,
  861. branch: this.form.branch.indexOf('总裁') > -1 || this.form.branch.indexOf('总经理') > -1 ? '' : this.form.branch,
  862. origin: location.origin,
  863. source_desc: this.sourceDescMap[this.source]
  864. }
  865. if (source === 'businesscooperation-landingpage') {
  866. params.cooperate = this.form.cooperate
  867. }
  868. if (infoid != "" && isProDetail != -1) {
  869. params.publish_id = infoid
  870. }
  871. if (info) {
  872. params = info
  873. params.source = source
  874. }
  875. // 行业分析报告增加行业参数
  876. if (source.indexOf('_dzhfxbg') > -1) {
  877. const filterIndustry = this.form.industry.filter(function(item) {
  878. return item !== '其他'
  879. })
  880. if (this.form.industry.indexOf('其他') !== -1) {
  881. filterIndustry.push(this.form.otherIndustry)
  882. }
  883. params.industry = filterIndustry.toString()
  884. }
  885. var _this = this
  886. $.ajax({
  887. type: 'POST',
  888. url: '/salesLeads/collectInfo',
  889. contentType: "application/json;charset=utf-8",
  890. data: JSON.stringify(params),
  891. success: function (res) {
  892. if (res.data) {
  893. _this.showForm = false
  894. typeof collectSubmitCallback === 'function' ? collectSubmitCallback(source, res.data) : null
  895. switch (source) {
  896. // 标讯详情页免费体验留完资 需要自动刷新
  897. case 'pc_article_member_freeuse': {
  898. _this.showSuccess = true
  899. _this.isRefresh = true
  900. }
  901. case 'member_freeuse': {
  902. _this.showSuccess = true
  903. break
  904. }
  905. case 'pc_article_original_one': {
  906. // 如果是阅读原文点击的 留完用户资料此处什么都不执行
  907. _this.showForm = false
  908. try {
  909. dialogsVm.dialog.originalSubmitSuccess = true
  910. } catch (error) {
  911. console.log(error)
  912. }
  913. break
  914. }
  915. case 'article_collection': {
  916. // $('#bidCollect').trigger('click') // 三级页收藏事件
  917. break
  918. }
  919. case 'article_collection': {
  920. // $('#bidCollect').trigger('click') // 三级页收藏事件
  921. // 单个收藏事件传当前点击的dom
  922. if (_this.curDom) {
  923. _this.curDom.trigger('click') // 列表页单个收藏事件
  924. _this.curDom = null
  925. } else {
  926. $('#bid-collect').trigger('click') // 列表页批量收藏事件
  927. }
  928. break
  929. }
  930. case 'jyarticle_see3_plus_pc': {
  931. _this.showSuccess = true
  932. _this.isRefresh = true
  933. // location.reload()
  934. break
  935. }
  936. case 'pc_index_bottom_adv': {
  937. location.href = '/big/page/index'
  938. break
  939. }
  940. default: {
  941. _this.showSuccess = true
  942. break
  943. }
  944. }
  945. }
  946. }
  947. })
  948. },
  949. // 手机号输入框input事件
  950. inputPhone: function (val) {
  951. this.form.phone = val.replace(/[^\d]/g, '')
  952. },
  953. // 查询表单回显信息
  954. getOldInfo: function (source) {
  955. var _this = this
  956. $.ajax({
  957. type: 'POST',
  958. url: '/salesLeads/retainedCapital?t=' + Date.now(),
  959. data: {
  960. source: source
  961. },
  962. success: function (res) {
  963. if (res && res.info) {
  964. _this.setEchoInfo(res.info)
  965. }
  966. }
  967. })
  968. },
  969. // 企业名称联想
  970. getResult: function (name) {
  971. // 名称为空或长度小于2不发请求
  972. if (!name || name.length < 2) return
  973. var _this = this
  974. $.ajax({
  975. type: 'POST',
  976. url: '/jypay/user/company/association',
  977. data: {
  978. name: name,
  979. companyCount: 10
  980. },
  981. heads: {
  982. 'content-type': 'application/x-www-form-urlencoded'
  983. },
  984. success: function (res) {
  985. console.log(res)
  986. if (res.data && res.data.length > 0) {
  987. var result = []
  988. res.data.map(function (item) {
  989. item = _this.brightKeyword(item)
  990. result.push(item)
  991. return result
  992. })
  993. _this.companyList = result
  994. _this.showSearchResult = true
  995. }
  996. }
  997. })
  998. },
  999. searchCompany: debounce(function (val) {
  1000. if (val === '') { this.showSearchResult = false }
  1001. this.getResult(val)
  1002. }, 600),
  1003. // 选择联想出来的公司名称
  1004. selectCompany: function (item) {
  1005. this.form.companyName = item.replace(/<.*?>/ig, '')
  1006. this.showSearchResult = false
  1007. },
  1008. // 关键词高亮
  1009. brightKeyword: function (val) {
  1010. var name = this.form.companyName
  1011. if (val.indexOf(name) !== -1) {
  1012. return val.replace(name, "<font style='color:#2ABED1;'>" + name + "</font>")
  1013. } else {
  1014. return val
  1015. }
  1016. },
  1017. // 暂不提供
  1018. cancelForm: function () {
  1019. this.showForm = false
  1020. this.showSearchResult = false
  1021. this.form.name = ''
  1022. this.form.phone = ''
  1023. this.form.mail = ''
  1024. this.form.industry = []
  1025. this.form.companyName = ''
  1026. this.form.companyType = []
  1027. this.form.job = ''
  1028. this.form.otherJob = ''
  1029. this.form.business = ''
  1030. this.form.need = ''
  1031. this.form.cooperate = ''
  1032. this.form.otherIndustry = ''
  1033. },
  1034. setEchoInfo: function (data) {
  1035. this.form.otherIndustry = ''
  1036. if (data) {
  1037. this.form.name = data.name ? data.name : ''
  1038. this.form.phone = data.phone ? data.phone : ''
  1039. this.form.mail = data.mail ? data.mail : ''
  1040. this.form.companyName = data.company ? data.company : ''
  1041. this.form.companyType = data.companyType ? data.companyType.split(',') : []
  1042. if (data.position) {
  1043. if (jobJson.indexOf(data.position) == -1) {
  1044. this.form.job = ''
  1045. this.form.otherJob = ''
  1046. } else {
  1047. this.form.job = data.position
  1048. }
  1049. } else {
  1050. this.form.job = ''
  1051. }
  1052. this.form.business = data.workScope ? data.workScope : ''
  1053. this.form.need = data.partnerNeeds ? data.partnerNeeds : ''
  1054. this.form.agreeChecked = data.agree == undefined ? true : data.agree
  1055. this.form.branch = data.branch || ''
  1056. this.form.cooperate = data.cooperate ? data.cooperate : ''
  1057. if (data.industry) {
  1058. var industryArr = data.industry.split(',')
  1059. var same = industryArr.filter(item =>
  1060. this.industryData.indexOf(item) !== -1
  1061. )
  1062. var different = industryArr.filter(item =>
  1063. this.industryData.indexOf(item) === -1
  1064. )
  1065. if (same) {
  1066. this.form.industry = same
  1067. }
  1068. if (different && different.length > 0) {
  1069. this.form.otherIndustry = different.toString()
  1070. this.form.industry.push('其他')
  1071. }
  1072. }
  1073. }
  1074. }
  1075. }
  1076. })