pc-collect-user-info.js 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875
  1. var temp = `
  2. <div>
  3. <div class="user-data-dialog" id="collectUserInfoDialog" v-if="showForm">
  4. <div class="mask"></div>
  5. <div class="dialog-container">
  6. <div class="dialog-header fs18" v-if="dialogTitleTop" v-text="dialogTitleTop"></div>
  7. <div class="dialog-header mt-4" v-if="dialogTitle" v-html="dialogTitle"></div>
  8. <div class="dialog-content">
  9. <el-form class="user-form" :model="form" :rules="rules" ref="ruleForm">
  10. <!-- 基本信息 -->
  11. <div class="basic clearfix">
  12. <div class="form-title">基本信息</div>
  13. <div class="form-main clearfix">
  14. <div class="short-control fl">
  15. <el-form-item label="姓名 :" prop="name">
  16. <el-input v-model.trim="form.name" data-short-input class="item-input" placeholder="请输入姓名" @focus="nameFocus" required>
  17. </el-input>
  18. </el-form-item>
  19. </div>
  20. <div class="short-control fr">
  21. <el-form-item label="手机号 :" prop="phone">
  22. <el-input v-model.trim="form.phone" maxlength="11" @input="inputPhone" data-short-input class="item-input" placeholder="请输入手机号" @focus="phoneFocus"></el-input>
  23. </el-form-item>
  24. </div>
  25. <div class="short-control fl" v-if="moduleShow.email">
  26. <el-form-item label="邮箱 :" prop="mail">
  27. <el-input v-model.trim="form.mail" data-short-input class="item-input" placeholder="请输入邮箱" @focus="mailFocus"></el-input>
  28. </el-form-item>
  29. </div>
  30. <div class="short-control fr" v-if="moduleShow.region">
  31. <el-form-item label="地区 :">
  32. <el-cascader data-short-input v-model="form.region" class="item-input" :options="regionData"
  33. placeholder="请选择省份城市" clearable></el-cascader>
  34. </el-form-item>
  35. </div>
  36. <div class="short-control fr" v-if="moduleShow.industry">
  37. <el-form-item label="行业 :">
  38. <el-cascader data-short-input v-model="form.industry" class="item-input" :options="industryData"
  39. placeholder="请选择所属行业" :show-all-levels="false" clearable></el-cascader>
  40. </el-form-item>
  41. </div>
  42. <div class="short-control fr" v-if="moduleShow.mold">
  43. <el-form-item label="受雇类型 :">
  44. <el-select v-model="form.mold" data-short-input class="item-input">
  45. <el-option v-for="item in moldData" :key="item.value" :label="item.label" :value="item.value">
  46. </el-option>
  47. </el-select>
  48. </el-form-item>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="company clearfix">
  53. <div class="form-title">公司信息</div>
  54. <div class="form-main">
  55. <div class="long-control" style="position: relative;">
  56. <el-form-item label="公司名称 :" prop="companyName">
  57. <el-input
  58. v-model.trim="form.companyName"
  59. data-long-input
  60. class="item-input company-name"
  61. @focus="companyFocus"
  62. @input="searchCompany"
  63. placeholder="请输入公司名称">
  64. </el-input>
  65. </el-form-item>
  66. <div class="company-result" v-if="showSearchResult">
  67. <div class="company-list" v-for="item in companyList" :key="item" @click="selectCompany(item)" v-html="item"></div>
  68. </div>
  69. </div>
  70. <div class="long-control" >
  71. <el-form-item label="公司类型 :" class="company-type" prop="companyType">
  72. <el-checkbox-group v-model="form.companyType">
  73. <el-checkbox label="投标企业"></el-checkbox>
  74. <el-checkbox label="招标采购单位"></el-checkbox>
  75. <el-checkbox label="厂商"></el-checkbox>
  76. <el-checkbox label="招标代理机构"></el-checkbox>
  77. <el-checkbox label="经销商"></el-checkbox>
  78. <el-checkbox label="服务提供商"></el-checkbox>
  79. <el-checkbox label="其他"></el-checkbox>
  80. </el-checkbox-group>
  81. </el-form-item>
  82. </div>
  83. <div class="long-control">
  84. <el-form-item label="职位 :" prop="job">
  85. <el-select v-model="form.job" placeholder="请选择职位" data-short-input class="item-input" clearable>
  86. <el-option v-for="item in jobData" :key="item.value" :label="item.label" :value="item.value">
  87. </el-option>
  88. </el-select>
  89. <el-select v-if="showBranch" v-model="form.branch" placeholder="请选择部门" data-short-input class="item-input" clearable>
  90. <el-option v-for="item in branchData" :key="item.value" :label="item.label" :value="item.value">
  91. </el-option>
  92. </el-select>
  93. </el-form-item>
  94. </div>
  95. <div class="long-control" v-if="moduleShow.scale">
  96. <el-form-item label="公司规模 :">
  97. <el-select v-model="form.scale" placeholder="请选择公司规模" data-short-input class="item-input" clearable>
  98. <el-option v-for="item in scaleData" :key="item.value" :label="item.label" :value="item.value">
  99. </el-option>
  100. </el-select>
  101. </el-form-item>
  102. </div>
  103. <div class="long-control" v-if="moduleShow.business">
  104. <el-form-item label="业务范围 :">
  105. <el-input type="textarea" autosize resize="none" v-model="form.business" data-long-input class="item-input"
  106. placeholder="请输入业务范围,让合作伙伴充分了解公司业务内容"></el-input>
  107. </el-form-item>
  108. </div>
  109. <div class="long-control" v-if="moduleShow.need">
  110. <el-form-item label="合作需求 :">
  111. <el-input type="textarea" autosize resize="none" v-model="form.need" data-long-input class="item-input"
  112. placeholder="请输入合作需求,从而创造并匹配更多合作交流机会"></el-input>
  113. </el-form-item>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="agree-service" v-if="moduleShow.agree">
  118. <el-checkbox v-model="form.agreeChecked">&nbsp;我同意剑鱼标讯将业务范围及合作需求提供给潜在合作伙伴搜索、查看</el-checkbox>
  119. </div>
  120. <div class="dialog-footer">
  121. <el-button class="cancel-btn" @click="cancelForm">暂不提供</el-button>
  122. <el-button class="submit-btn" @click="submitForm('ruleForm')">提交</el-button>
  123. </div>
  124. </el-form>
  125. </div>
  126. </div>
  127. </div>
  128. <div id="success-dialog" style="display: none;" v-show="showSuccess">
  129. <div class="mask"></div>
  130. <div class="success-dialog-container">
  131. <div class="success-title">提交成功</div>
  132. <div class="success-content" v-html="successText"></div>
  133. <div class="success-footer">
  134. <button type="button" class="custom-btn go-know" @click="knowHandle" v-text="successConfirmText"></button>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. `
  140. // var temp = "\n <div>\n <div class=\"user-data-dialog\" id=\"collectUserInfoDialog\" v-if=\"showForm\">\n <div class=\"mask\"></div>\n <div class=\"dialog-container\">\n <div class=\"dialog-header fs18\" v-if=\"dialogTitleTop\" v-text=\"dialogTitleTop\"></div>\n <div class=\"dialog-header mt-4\" v-if=\"dialogTitle\" v-html=\"dialogTitle\"></div>\n <div class=\"dialog-content\">\n <el-form class=\"user-form\" :model=\"form\" :rules=\"rules\" ref=\"ruleForm\">\n <!-- \u57FA\u672C\u4FE1\u606F -->\n <div class=\"basic clearfix\">\n <div class=\"form-title\">\u57FA\u672C\u4FE1\u606F</div>\n <div class=\"form-main clearfix\">\n <div class=\"short-control fl\">\n <el-form-item label=\"\u59D3\u540D :\" prop=\"name\">\n <el-input v-model.trim=\"form.name\" data-short-input class=\"item-input\" placeholder=\"\u8BF7\u8F93\u5165\u59D3\u540D\" @focus=\"nameFocus\" required>\n </el-input>\n </el-form-item>\n </div>\n <div class=\"short-control fr\">\n <el-form-item label=\"\u624B\u673A\u53F7 :\" prop=\"phone\">\n <el-input v-model.trim=\"form.phone\" maxlength=\"11\" @input=\"inputPhone\" data-short-input class=\"item-input\" placeholder=\"\u8BF7\u8F93\u5165\u624B\u673A\u53F7\" @focus=\"phoneFocus\"></el-input>\n </el-form-item>\n </div>\n <div class=\"short-control fl\" v-if=\"moduleShow.email\">\n <el-form-item label=\"\u90AE\u7BB1 :\" prop=\"mail\">\n <el-input v-model.trim=\"form.mail\" data-short-input class=\"item-input\" placeholder=\"\u8BF7\u8F93\u5165\u90AE\u7BB1\" @focus=\"mailFocus\"></el-input>\n </el-form-item>\n </div>\n <div class=\"short-control fr\" v-if=\"moduleShow.region\">\n <el-form-item label=\"\u5730\u533A :\">\n <el-cascader data-short-input v-model=\"form.region\" class=\"item-input\" :options=\"regionData\"\n placeholder=\"\u8BF7\u9009\u62E9\u7701\u4EFD\u57CE\u5E02\" clearable></el-cascader>\n </el-form-item>\n </div>\n <div class=\"short-control fr\" v-if=\"moduleShow.industry\">\n <el-form-item label=\"\u884C\u4E1A :\">\n <el-cascader data-short-input v-model=\"form.industry\" class=\"item-input\" :options=\"industryData\"\n placeholder=\"\u8BF7\u9009\u62E9\u6240\u5C5E\u884C\u4E1A\" :show-all-levels=\"false\" clearable></el-cascader>\n </el-form-item>\n </div>\n <div class=\"short-control fr\" v-if=\"moduleShow.mold\">\n <el-form-item label=\"\u53D7\u96C7\u7C7B\u578B :\">\n <el-select v-model=\"form.mold\" data-short-input class=\"item-input\">\n <el-option v-for=\"item in moldData\" :key=\"item.value\" :label=\"item.label\" :value=\"item.value\">\n </el-option>\n </el-select>\n </el-form-item>\n </div>\n </div>\n </div>\n <div class=\"company clearfix\">\n <div class=\"form-title\">\u516C\u53F8\u4FE1\u606F</div>\n <div class=\"form-main\">\n <div class=\"long-control\" style=\"position: relative;\">\n <el-form-item label=\"\u516C\u53F8\u540D\u79F0 :\" prop=\"companyName\">\n <el-input \n v-model.trim=\"form.companyName\" \n data-long-input\n class=\"item-input company-name\" \n @focus=\"companyFocus\"\n @input=\"searchCompany\"\n placeholder=\"\u8BF7\u8F93\u5165\u516C\u53F8\u540D\u79F0\">\n </el-input>\n </el-form-item>\n <div class=\"company-result\" v-if=\"showSearchResult\">\n <div class=\"company-list\" v-for=\"item in companyList\" :key=\"item\" @click=\"selectCompany(item)\" v-html=\"item\"></div>\n </div>\n </div>\n <div class=\"long-control\" v-if=\"moduleShow.companyType\">\n <el-form-item label=\"\u516C\u53F8\u7C7B\u578B :\" class=\"company-type\">\n <el-checkbox-group v-model=\"form.companyType\">\n <el-checkbox label=\"\u6295\u6807\u4F01\u4E1A\"></el-checkbox>\n <el-checkbox label=\"\u62DB\u6807\u91C7\u8D2D\u5355\u4F4D\"></el-checkbox>\n <el-checkbox label=\"\u5382\u5546\"></el-checkbox>\n <el-checkbox label=\"\u62DB\u6807\u4EE3\u7406\u673A\u6784\"></el-checkbox>\n <el-checkbox label=\"\u7ECF\u9500\u5546\"></el-checkbox>\n <el-checkbox label=\"\u670D\u52A1\u63D0\u4F9B\u5546\"></el-checkbox>\n <el-checkbox label=\"\u5176\u4ED6\"></el-checkbox>\n </el-checkbox-group>\n </el-form-item>\n </div>\n <div class=\"long-control\">\n <el-form-item label=\"\u804C\u4F4D :\" prop=\"job\">\n <el-select v-model=\"form.job\" placeholder=\"\u8BF7\u9009\u62E9\u804C\u4F4D\" data-short-input class=\"item-input\" clearable>\n <el-option v-for=\"item in jobData\" :key=\"item.value\" :label=\"item.label\" :value=\"item.value\">\n </el-option>\n </el-select>\n <el-select v-if=\"showBranch\" v-model=\"form.branch\" placeholder=\"\u8BF7\u9009\u62E9\u90E8\u95E8\" data-short-input class=\"item-input\" clearable>\n <el-option v-for=\"item in branchData\" :key=\"item.value\" :label=\"item.label\" :value=\"item.value\">\n </el-option>\n </el-select>\n </el-form-item>\n </div>\n <div class=\"long-control\" v-if=\"moduleShow.scale\">\n <el-form-item label=\"\u516C\u53F8\u89C4\u6A21 :\">\n <el-select v-model=\"form.scale\" placeholder=\"\u8BF7\u9009\u62E9\u516C\u53F8\u89C4\u6A21\" data-short-input class=\"item-input\" clearable>\n <el-option v-for=\"item in scaleData\" :key=\"item.value\" :label=\"item.label\" :value=\"item.value\">\n </el-option>\n </el-select>\n </el-form-item>\n </div>\n <div class=\"long-control\" v-if=\"moduleShow.business\">\n <el-form-item label=\"\u4E1A\u52A1\u8303\u56F4 :\">\n <el-input type=\"textarea\" autosize resize=\"none\" v-model=\"form.business\" data-long-input class=\"item-input\"\n placeholder=\"\u8BF7\u8F93\u5165\u4E1A\u52A1\u8303\u56F4\uFF0C\u8BA9\u5408\u4F5C\u4F19\u4F34\u5145\u5206\u4E86\u89E3\u516C\u53F8\u4E1A\u52A1\u5185\u5BB9\"></el-input>\n </el-form-item>\n </div>\n <div class=\"long-control\" v-if=\"moduleShow.need\">\n <el-form-item label=\"\u5408\u4F5C\u9700\u6C42 :\">\n <el-input type=\"textarea\" autosize resize=\"none\" v-model=\"form.need\" data-long-input class=\"item-input\"\n placeholder=\"\u8BF7\u8F93\u5165\u5408\u4F5C\u9700\u6C42\uFF0C\u4ECE\u800C\u521B\u9020\u5E76\u5339\u914D\u66F4\u591A\u5408\u4F5C\u4EA4\u6D41\u673A\u4F1A\"></el-input>\n </el-form-item>\n </div>\n </div>\n </div>\n <div class=\"agree-service\" v-if=\"moduleShow.agree\">\n <el-checkbox v-model=\"form.agreeChecked\">&nbsp;\u6211\u540C\u610F\u5251\u9C7C\u6807\u8BAF\u5C06\u4E1A\u52A1\u8303\u56F4\u53CA\u5408\u4F5C\u9700\u6C42\u63D0\u4F9B\u7ED9\u6F5C\u5728\u5408\u4F5C\u4F19\u4F34\u641C\u7D22\u3001\u67E5\u770B</el-checkbox>\n </div>\n <div class=\"dialog-footer\">\n <el-button class=\"cancel-btn\" @click=\"cancelForm\">\u6682\u4E0D\u63D0\u4F9B</el-button>\n <el-button class=\"submit-btn\" @click=\"submitForm('ruleForm')\">\u63D0\u4EA4</el-button>\n </div>\n </el-form>\n </div>\n </div>\n </div>\n <div id=\"success-dialog\" style=\"display: none;\" v-show=\"showSuccess\">\n <div class=\"mask\"></div>\n <div class=\"success-dialog-container\">\n <div class=\"success-title\">\u63D0\u4EA4\u6210\u529F</div>\n <div class=\"success-content\" v-html=\"successText\"></div>\n <div class=\"success-footer\">\n <button type=\"button\" class=\"custom-btn go-know\" @click=\"knowHandle\" v-text=\"successConfirmText\"></button>\n </div>\n </div>\n </div>\n </div>\n ";
  141. var filterData = chinaMapJSON.filter(function (item) {
  142. item.name = item.name.replace(/\s*/g,"")
  143. return item.name !== '海外' && item.name !== '钓鱼岛'
  144. })
  145. filterData.forEach(function (item) {
  146. if (item.name == '台湾省') { item.name = '台湾'}
  147. item.name = item.name.replace(/自治区|特别行政区|壮族|回族|维吾尔/g, '')
  148. item.label = item.name
  149. item.value = item.name
  150. var filterWord = ['北京市', '上海市', '天津市', '上海市', '重庆市', '香港', '澳门', '台湾']
  151. if (filterWord.indexOf(item.name) == -1) {
  152. item.children = item.city.map(function (v) {
  153. return {
  154. value: v.name,
  155. label: v.name
  156. }
  157. })
  158. }
  159. })
  160. industryJson.forEach(function (item) {
  161. item.label = item.name
  162. item.value = item.name
  163. item.children = item.children.map(function (v) {
  164. return {
  165. value: v.name,
  166. label: v.name
  167. }
  168. })
  169. })
  170. var jobData = jobJson.map(function (item) {
  171. return {
  172. value: item,
  173. label: item
  174. }
  175. })
  176. var companyScaleData = companyScaleJson.map(function (item) {
  177. return {
  178. value: item,
  179. label: item
  180. }
  181. })
  182. // 部门数据处理
  183. var branchData = branchJson.map(function(item) {
  184. return {
  185. value: item,
  186. label: item
  187. }
  188. })
  189. // 防抖
  190. function debounce(fn, delay) {
  191. var timer
  192. return function () {
  193. var context = this
  194. var args = arguments
  195. clearTimeout(timer)
  196. timer = setTimeout(function () {
  197. fn.apply(context, args)
  198. }, delay)
  199. }
  200. }
  201. var vm = new Vue({
  202. el: '#vue-collect-user-info',
  203. delimiters: ['@@', '@@'],
  204. template: temp,
  205. data: function () {
  206. var validName = function(rule,value,callback) {
  207. if(value === '') {
  208. return callback(new Error('姓名为必填项'));
  209. } else {
  210. if (value.length < 2) {
  211. return callback(new Error('姓名填写不正确'));
  212. }
  213. callback();
  214. }
  215. }
  216. var validPhone = function(rule,value,callback) {
  217. var status = /^1[3-9]\d{9}$/.test(value)
  218. if(value === '') {
  219. return callback(new Error('手机号为必填项'));
  220. } else if (!status) {
  221. return callback(new Error('手机号填写不正确'));
  222. } else {
  223. callback();
  224. }
  225. }
  226. var validEmail = function(rule,value,callback) {
  227. var status = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(value)
  228. if (value === '') {
  229. return callback(new Error('邮箱为必填项'));
  230. } else {
  231. if (!status) {
  232. return callback(new Error('邮箱填写不正确'));
  233. } else {
  234. callback();
  235. }
  236. }
  237. }
  238. var validCompany = function(rule,value,callback) {
  239. if (value === '') {
  240. return callback(new Error('公司名称为必填项'));
  241. } else {
  242. if (value.length < 2) {
  243. return callback(new Error('公司名称至少输入2个字'));
  244. } else {
  245. callback();
  246. }
  247. }
  248. }
  249. var validJob = function(rule,value,callback) {
  250. if(value === '') {
  251. return callback(new Error('职位不能为空'));
  252. } else {
  253. if ((value.indexOf('总裁') === -1 || value.indexOf('总经理') === -1) && vm.showBranch && !vm.form.branch) {
  254. return callback(new Error('部门不能为空'));
  255. } else {
  256. callback();
  257. }
  258. }
  259. }
  260. return {
  261. dialogTitleTop: '为给您匹配精准的推荐信息,请完善个人信息',
  262. dialogTitle: '',
  263. // showCompany: true, // 是否显示公司信息
  264. regionData: filterData, // 地区数据
  265. industryData: industryJson, // 行业数据
  266. jobData: jobData, // 职位数据
  267. scaleData: companyScaleData, // 公司规模数据
  268. branchData: branchData,
  269. moldData: [{ // 公司类型数据
  270. label: '公司',
  271. value: '公司'
  272. }, {
  273. label: '个体经营者',
  274. value: '个体经营者'
  275. },{
  276. label: '其他',
  277. value: '其他'
  278. }],
  279. form: {
  280. name: '', // 姓名
  281. phone: '', // 手机号
  282. mail: '', // 邮箱
  283. region: [], // 地区值
  284. industry: [], // 行业值
  285. mold: '公司', // 受雇类型值
  286. companyName: '', // 公司名称
  287. companyType: [], // 公司类型值
  288. job: '', // 职位值
  289. otherJob: '', //自定义职位
  290. scale: '', // 公司规模
  291. business: '', // 业务范围
  292. need: '', // 合作需求
  293. agreeChecked: true,
  294. branch: ''
  295. },
  296. rules: {
  297. name: [
  298. {
  299. required: true,
  300. validator: validName,
  301. trigger: 'blur'
  302. }
  303. ],
  304. phone: [
  305. {
  306. required: true,
  307. validator: validPhone,
  308. trigger: 'blur'
  309. }
  310. ],
  311. mail: [
  312. {
  313. required: true,
  314. validator: validEmail,
  315. trigger: 'blur'
  316. }
  317. ],
  318. companyName: [
  319. {
  320. required: true,
  321. validator: validCompany,
  322. trigger: 'blur'
  323. }
  324. ],
  325. companyType: [
  326. {
  327. required: true,
  328. message:'公司类型为必填项',
  329. trigger: 'blur'
  330. }
  331. ],
  332. job: [
  333. {
  334. required: true,
  335. validator: validJob,
  336. trigger: 'change'
  337. }
  338. ]
  339. },
  340. showSearchResult: false,
  341. companyList: [],
  342. showForm: false, // 显示表单填写弹框
  343. showSuccess: false, // 显示提交成功弹框
  344. isForce: false, // 是否强制
  345. source: '', // 来源模块
  346. curDom: null,
  347. // 默认为隐藏,需要展示则需判断
  348. moduleShow: {
  349. email: false,
  350. region: false,
  351. industry: false,
  352. mold: false,
  353. companyType: false,
  354. scale: false,
  355. business: false,
  356. need: false,
  357. agree: false,
  358. },
  359. sourceTitleMap: {
  360. article_attach_freeuser: '请留下联系方式,立即免费体验【附件下载】1次,招标文件/采购清单一键下载,商机更完整!',
  361. ent_portrait_freeuser: '请留下联系方式,立即免费体验【企业中标分析】1次,多维度可视化分析竞争对手!',
  362. ent_portrait_winnerNewMsg_freeuser: '请留下联系方式,立即免费体验【企业中标分析】1次,多维度可视化分析竞争对手!',
  363. ent_portrait_yearData_freeuser: '请留下联系方式,立即免费体验【企业中标分析】1次,多维度可视化分析竞争对手!',
  364. ent_portrait_monthData_freeuser: '请留下联系方式,立即免费体验【企业中标分析】1次,多维度可视化分析竞争对手!',
  365. ent_portrait_areaData_freeuser: '请留下联系方式,立即免费体验【企业中标分析】1次,多维度可视化分析竞争对手!',
  366. ent_portrait_discountRate_freeuser: '请留下联系方式,立即免费体验【企业中标分析】1次,多维度可视化分析竞争对手!',
  367. ent_portrait_top10_freeuser:'请留下联系方式,立即免费体验【企业中标分析】1次,多维度可视化分析竞争对手!',
  368. ent_portrait_topShow_freeuser: '请留下联系方式,立即免费体验【企业中标分析】1次,多维度可视化分析竞争对手!',
  369. buyer_portrait_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  370. buyer_portrait_getNewMsg_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  371. buyer_portrait_yearData_freeuser:'请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  372. buyer_portrait_monthData_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  373. buyer_portrait_moneyRange_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  374. buyer_portrait_bidtypeData_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  375. buyer_portrait_rate_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  376. buyer_portrait_top12_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  377. buyer_portrait_topShow_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  378. buyer_portrait_withCapitalData_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  379. buyer_portrait_withEstablishData_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  380. buyer_portrait_withAreaData_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  381. buyer_portrait_topAgencyData_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  382. buyer_portrait_contacts_freeuser: '请留下联系方式,立即免费体验【采购单位全景分析】1次,帮你全面洞察采购单位,开发新客户!',
  383. ent_portrait_: '请留下联系方式,我们会尽快联系您!体验企业画像分析,帮你透视企业!',
  384. buyer_portrait_: '请留下联系方式,我们会尽快联系您!体验采购单位画像分析,为你挖掘客户!',
  385. member_attach: '请留下联系方式,我们会尽快联系您!体验附件下载特权,挖掘更多项目情报!',
  386. pc_index_bottom_adv: '请留下联系方式,我们会尽快联系您体验:市场分析周报/月报、竞对实时监控和分析、业主采购趋势/客户分析等',
  387. article_ent_portrait: '请留下联系方式,我们会尽快联系您!体验企业画像分析,帮你透视企业!',
  388. article_buyer_portrait: '请留下联系方式,我们会尽快联系您!体验采购单位画像分析,为你挖掘客户!',
  389. article_slogan: '请留下联系方式,我们会尽快联系您体验大会员全部功能!',
  390. member_: '请留下联系方式,我们会尽快联系您体验大会员全部功能!',
  391. function_: '请留下联系方式,我们会尽快联系您体验大会员全部功能!', // 大会员功能介绍
  392. jylab_see500_plus: '请留下联系方式,我们会尽快联系您!开通大会员可查看更多招标项目,实时监控更多潜在商机!', // 标讯搜索500条
  393. article_purchase_intention: '请留下联系方式,我们会尽快联系您!开通大会员可抢先对接采购单位,帮助企业拓客!', // 三级页-采购意向
  394. article_proposed_project: '请留下联系方式,我们会尽快联系您!开通大会员可抢先获知拟建商机动态,提高中标机率!', // 三级页-拟建项目
  395. 'ent-manage-pc': '欢迎留下联系方式,我们的大客户经理会在24小时内联系您!',
  396. "jyarticle_see3_plus_pc":"请完善个人信息,获取更多免费查看公告权限",
  397. 'activity_free_plan': '请完善信息,免费获取200剑鱼币',
  398. peugeot_supplier_regist:'请完善您的个人信息,抢先对接采购单位'
  399. },
  400. isRefresh: false // 留完资是否需要刷新页面
  401. }
  402. },
  403. computed: {
  404. showOtherJob: function() {
  405. return this.form.job == '其他'
  406. },
  407. showCompany: function() {
  408. return this.form.mold === '公司'
  409. },
  410. showBranch: function () {
  411. // 切换到总裁或总经理之后 把之前选择的部门清空
  412. if (this.form.job.indexOf('总裁') > -1 || this.form.job.indexOf('总经理') > -1) {
  413. this.form.branch = ''
  414. }
  415. var zc = this.form.job.indexOf('总裁') > -1
  416. var zjl = this.form.job.indexOf('总经理') > -1
  417. return !(zc || zjl) && this.form.job
  418. },
  419. // 提交成功,确定按钮文案
  420. successConfirmText: function () {
  421. if (this.source.indexOf('activity_free_plan') !== -1) {
  422. return '去领取'
  423. } else {
  424. return '我知道了'
  425. }
  426. },
  427. // 提交成功 提示文案
  428. successText: function() {
  429. if (this.source.indexOf('_freeuser') > -1 && this.source.indexOf('member_') === -1) {
  430. var text = ''
  431. if (this.source.indexOf('buyer_portrait') > -1) {
  432. text = '采购单位全景分析'
  433. } else if (this.source.indexOf('ent_portrait') > -1) {
  434. text = '企业中标分析'
  435. } else if (this.source.indexOf('article_attach') > -1) {
  436. text = '附件下载'
  437. } else {
  438. return '我们会尽快联系您并预约演示时间,请耐心等待~您将获得免费体验大会员全部功能!'
  439. }
  440. return '恭喜您,成功解锁【' + text + '】权益1次。如需查看更多,请开通超级订阅,为您提供最新的商业情报,抢占先机。'
  441. } else {
  442. if (this.source.indexOf('ent-manage-pc') > -1) {
  443. return '我们会尽快联系您并预约演示时间,请耐心等待~<br>您将获得免费体验商机管理全部功能!'
  444. }
  445. if (this.source.indexOf('jyarticle_see3_plus_pc') > -1) {
  446. return ''
  447. }
  448. if (this.source === 'activity_free_plan') {
  449. return '完善信息任务已完成,快去领取剑鱼币吧~'
  450. }
  451. if (this.source === 'peugeot_supplier_regist') {
  452. return '我们会尽快联系您完成供应商报名,请耐心等待。'
  453. }
  454. return '我们会尽快联系您并预约演示时间,请耐心等待~<br>您将获得免费体验大会员全部功能!'
  455. }
  456. }
  457. },
  458. mounted: function () {
  459. let that = this;
  460. $(document).on('click', function (e) {
  461. let dom = $('.company-name')[0];
  462. if (dom) {
  463. // 如果点击的区域不在自定义dom范围
  464. if (!dom.contains((e.target))) {
  465. that.showSearchResult = false
  466. }
  467. }
  468. })
  469. },
  470. beforeDestroy: function () {
  471. $(document).off('click')
  472. },
  473. methods: {
  474. // 点击我知道了
  475. knowHandle: function() {
  476. this.showSuccess = false
  477. if (this.isRefresh) {
  478. window.location.reload()
  479. }
  480. },
  481. // 不需要调留资接口 弹出留资弹框回调方法
  482. noCallApiFn: function(source, isRefresh) {
  483. this.isRefresh = isRefresh
  484. vm.source = source
  485. this.showForm = true
  486. this.calcTitleText(source)
  487. this.getOldInfo(source)
  488. },
  489. calcTitleText: function (source) {
  490. if (!source) return
  491. var text = ''
  492. for (var key in this.sourceTitleMap) {
  493. if (source.indexOf(key) !== -1) {
  494. text = this.sourceTitleMap[key]
  495. break
  496. }
  497. }
  498. // 判断收藏留资显示
  499. if (this.source == "article_collection"){
  500. for (var k in this.moduleShow) {
  501. this.moduleShow[k] = false
  502. }
  503. }
  504. // 判断阅读原文留资显示
  505. if (vm.source == "article_original"){
  506. for (var k in vm.moduleShow) {
  507. vm.moduleShow[k] = false
  508. }
  509. }
  510. if (text) {
  511. if (source.indexOf('_freeuser') > -1 && text.indexOf('【') > -1) {
  512. var r = text.match(/\【(.+?)\】/g)
  513. this.dialogTitleTop = '欢迎体验' + r[0].replace('【','').replace('】','')
  514. this.dialogTitle = text
  515. } else if(source.indexOf('ent-manage') > -1){
  516. this.dialogTitle = text
  517. this.dialogTitleTop = '欢迎体验剑鱼标讯商机管理'
  518. } else if(source.indexOf('jyarticle_see3_plus_pc') > -1){
  519. this.dialogTitle = text
  520. this.dialogTitleTop = '完善信息'
  521. } else if (source === 'activity_free_plan') {
  522. this.dialogTitle = text
  523. this.dialogTitleTop = '完善信息'
  524. }
  525. // else if (source.indexOf("article_collection") > -1){
  526. // this.dialogTitle = text
  527. // this.dialogTitleTop = "为给您匹配精准的推荐信息,请完善个人信息"
  528. // }
  529. else {
  530. this.dialogTitle = text
  531. this.dialogTitleTop = '欢迎体验剑鱼大会员'
  532. }
  533. for (var k in this.moduleShow) {
  534. this.moduleShow[k] = false
  535. }
  536. }
  537. },
  538. nameFocus:function(){
  539. this.$refs['ruleForm'].clearValidate(['name']);
  540. },
  541. phoneFocus:function(){
  542. this.$refs['ruleForm'].clearValidate(['phone']);
  543. },
  544. mailFocus:function(){
  545. this.$refs['ruleForm'].clearValidate(['mail']);
  546. },
  547. // 公司名称获取焦点时
  548. companyFocus: function() {
  549. this.$refs['ruleForm'].clearValidate(['companyName']);
  550. this.getResult(this.form.companyName)
  551. },
  552. otherFocus:function() {
  553. this.$refs['ruleForm'].clearValidate(['job','otherJob']);
  554. },
  555. // 是否留资
  556. isNeedSubmit: function(source, callback, dom,infoid) {
  557. /*
  558. 三级页-阅读原文 article_original
  559. 三级页-收藏 article_collection
  560. 大会员落地页-免费体验 member_freeuse
  561. */
  562. this.calcTitleText(source)
  563. this.source = source
  564. var _this = this
  565. $.ajax({
  566. type:'GET',
  567. url:'/salesLeads/retainedCapital',
  568. data: {
  569. source: source
  570. },
  571. success:function (res) {
  572. // 判断当前信息否在其他页面留资 如果全部留资 直接弹窗提交成功
  573. var checkKeys = ['name', 'phone','companyType', 'company', 'branch', 'position']
  574. 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']
  575. var isCollect = sourceList.includes(source)
  576. if (infoid != ""){
  577. res.info.publish_id = infoid
  578. }
  579. var result = checkRequiredKeys(checkKeys, res.info)
  580. if (result) {
  581. _this.showForm = false
  582. res.data.retainedCapital = false
  583. callback && callback(res)
  584. // 包含这些source,不存记录
  585. // 非主动触发留资节点,每点击一次数据库不会记录
  586. if(!isCollect) {
  587. _this.formAjax(_this.source, res.info)
  588. }
  589. switch (source) {
  590. case 'member_freeuse': {
  591. _this.showSuccess = true
  592. break
  593. }
  594. case 'jyarticle_see3_plus_pc': {
  595. $(".detail-nj-btn").click(function(){
  596. $(".mask-zzz").hide()
  597. })
  598. break
  599. }
  600. case 'article_original': {
  601. _this.showSuccess = false
  602. break
  603. }
  604. case 'article_collection': {
  605. _this.showSuccess = false
  606. break
  607. }
  608. case 'pc_index_bottom_adv': {
  609. location.href = '/big/page/index'
  610. break
  611. }
  612. default: {
  613. if (source.indexOf('_freeuser') > -1) {
  614. _this.showSuccess = true
  615. } else {
  616. _this.showSuccess = true
  617. }
  618. }
  619. }
  620. } else if (res.data) {
  621. window.isRetained = res.data.retainedCapital
  622. _this.isForce = res.data.fource
  623. if(window.isFree || !isCollect) {
  624. if (res.data.retainedCapital || !result) {
  625. _this.showForm = true
  626. _this.getOldInfo(source)
  627. _this.curDom = dom
  628. } else {
  629. callback && callback(res)
  630. }
  631. } else {
  632. callback && callback(res)
  633. }
  634. }
  635. }
  636. })
  637. },
  638. // 表单提交事件
  639. submitForm: function(formName) {
  640. var _this = this
  641. this.$refs[formName].validate(function (valid) {
  642. if (valid) {
  643. _this.formAjax(vm.source)
  644. _this.bigDocAjax()
  645. } else {
  646. console.log('error submit!!');
  647. return false;
  648. }
  649. });
  650. },
  651. // 快照页引流的文案埋点 留资提交时埋点
  652. bigDocAjax: function() {
  653. if (getParam('id')) {
  654. try {
  655. $.ajax({
  656. type: "POST",
  657. url: "/publicapply/drainage/bmt/" + getParam('id'),
  658. data: {
  659. p: 'ICRW'
  660. },
  661. success: function(r) {
  662. console.log(r)
  663. }
  664. })
  665. } catch (error) {
  666. console.log(error)
  667. }
  668. }
  669. },
  670. // 表单提交请求
  671. formAjax: function(source, info) {
  672. var infoid = window.location.pathname.split("/")[3].split(".html")[0]
  673. var params = {
  674. source: source,
  675. name: this.form.name,
  676. phone: this.form.phone,
  677. mail: this.form.mail,
  678. // province: this.form.region[0],
  679. // city: this.form.region[1] ? this.form.region[1] : '',
  680. industry: this.form.industry.join('_'),
  681. // hireType: this.form.mold, // 受雇类型值
  682. company: this.form.companyName, // 公司名称
  683. companyType: this.form.companyType.join(','),
  684. position: this.form.job == '其他' ? ('其他/' + this.form.otherJob) : this.form.job,
  685. // company_size: this.form.scale,
  686. // workScope: this.form.business,
  687. // partnerNeeds: this.form.need,
  688. // agree: this.form.agreeChecked,
  689. branch: this.form.branch.indexOf('总裁') > -1 || this.form.branch.indexOf('总经理') > -1 ? '' : this.form.branch
  690. }
  691. if (infoid != ""){
  692. params.publish_id = infoid
  693. }
  694. if (info) {
  695. params = info
  696. params.source = source
  697. }
  698. var _this = this
  699. $.ajax({
  700. type:'POST',
  701. url:'/salesLeads/collectInfo',
  702. contentType: "application/json;charset=utf-8",
  703. data: JSON.stringify(params),
  704. success:function (res) {
  705. if (res.data) {
  706. _this.showForm = false
  707. typeof collectSubmitCallback === 'function' ? collectSubmitCallback(source, res.data) : null
  708. switch (source) {
  709. case 'member_freeuse': {
  710. _this.showSuccess = true
  711. break
  712. }
  713. case 'article_original': {
  714. // 如果是阅读原文点击的 留完用户资料执行原点击操作
  715. // $(".com-original").trigger('click')
  716. // $(".mask-zz").hide()
  717. // $(".dialog-container").hide()
  718. break
  719. }
  720. case 'article_collection': {
  721. // $('#bidCollect').trigger('click') // 三级页收藏事件
  722. break
  723. }
  724. case 'article_collection': {
  725. // $('#bidCollect').trigger('click') // 三级页收藏事件
  726. // 单个收藏事件传当前点击的dom
  727. if(_this.curDom) {
  728. _this.curDom.trigger('click') // 列表页单个收藏事件
  729. _this.curDom = null
  730. } else {
  731. $('#bid-collect').trigger('click') // 列表页批量收藏事件
  732. }
  733. break
  734. }
  735. case 'jyarticle_see3_plus_pc': {
  736. location.reload()
  737. break
  738. }
  739. case 'pc_index_bottom_adv': {
  740. location.href = '/big/page/index'
  741. break
  742. }
  743. default: {
  744. if (source.indexOf('_freeuser') > -1) {
  745. _this.showSuccess = true
  746. } else {
  747. _this.showSuccess = true
  748. }
  749. break
  750. }
  751. }
  752. }
  753. }
  754. })
  755. },
  756. // 手机号输入框input事件
  757. inputPhone: function(val) {
  758. this.form.phone = val.replace(/[^\d]/g,'')
  759. },
  760. // 查询表单回显信息
  761. getOldInfo: function(source) {
  762. var _this = this
  763. $.ajax({
  764. type:'POST',
  765. url:'/salesLeads/retainedCapital?t=' + Date.now(),
  766. data: {
  767. source: source
  768. },
  769. success:function (res) {
  770. if (res && res.info) {
  771. res.data = res.info
  772. }
  773. if (res.data) {
  774. _this.form.name = res.data.name ? res.data.name : ''
  775. _this.form.phone = res.data.phone ? res.data.phone : ''
  776. _this.form.mail = res.data.mail ? res.data.mail : ''
  777. if (res.data.province && res.data.city) {
  778. _this.form.region = [res.data.province, res.data.city]
  779. } else if (res.data.province && !res.data.city) {
  780. _this.form.region = [res.data.province]
  781. } else {
  782. _this.form.region = []
  783. }
  784. _this.form.industry = res.data.industry ? res.data.industry.split('_') : []
  785. _this.form.mold = res.data.hireType ? res.data.hireType : '公司'
  786. _this.form.companyName = res.data.company ? res.data.company : ''
  787. _this.form.companyType = res.data.companyType ? res.data.companyType.split(',') : []
  788. if (res.data.position) {
  789. if (jobJson.indexOf(res.data.position) == -1) {
  790. // _this.form.job = '其他'
  791. // _this.form.otherJob = res.data.position.replace('其他/', '')
  792. _this.form.job = ''
  793. _this.form.otherJob = ''
  794. } else {
  795. _this.form.job = res.data.position
  796. }
  797. } else {
  798. _this.form.job = ''
  799. }
  800. _this.form.scale = res.data.company_size ? res.data.company_size : ''
  801. _this.form.business = res.data.workScope ? res.data.workScope : ''
  802. _this.form.need = res.data.partnerNeeds ? res.data.partnerNeeds : ''
  803. _this.form.agreeChecked = res.data.agree == undefined ? true : res.data.agree
  804. _this.form.branch = res.data.branch || ''
  805. }
  806. }
  807. })
  808. },
  809. // 企业名称联想
  810. getResult:function(name) {
  811. // 名称为空或长度小于2不发请求
  812. if (!name || name.length < 2) return
  813. var _this = this
  814. $.ajax({
  815. type:'POST',
  816. url:'/jypay/user/company/association',
  817. data: {
  818. name: name
  819. },
  820. heads : {
  821. 'content-type': 'application/x-www-form-urlencoded'
  822. },
  823. success:function (res) {
  824. console.log(res)
  825. if (res.data && res.data.length > 0) {
  826. var result = []
  827. res.data.map(function(item){
  828. item = _this.brightKeyword(item)
  829. result.push(item)
  830. return result
  831. })
  832. _this.companyList = result
  833. _this.showSearchResult = true
  834. }
  835. }
  836. })
  837. },
  838. searchCompany: debounce(function(val){
  839. if(val === '') { this.showSearchResult = false}
  840. this.getResult(val)
  841. }, 600),
  842. // 选择联想出来的公司名称
  843. selectCompany: function(item) {
  844. this.form.companyName = item.replace(/<.*?>/ig, '')
  845. this.showSearchResult = false
  846. },
  847. // 关键词高亮
  848. brightKeyword: function (val) {
  849. var name = this.form.companyName
  850. if (val.indexOf(name) !== -1) {
  851. return val.replace(name, "<font style='color:#2ABED1;'>" + name + "</font>")
  852. } else {
  853. return val
  854. }
  855. },
  856. // 暂不提供
  857. cancelForm: function() {
  858. this.showForm = false
  859. this.form.name = ''
  860. this.form.phone = ''
  861. this.form.mail = ''
  862. this.form.industry = []
  863. this.form.companyName = ''
  864. this.form.companyType = []
  865. this.form.job = ''
  866. this.form.otherJob = ''
  867. this.form.scale = ''
  868. this.form.business = ''
  869. this.form.need = ''
  870. }
  871. }
  872. })