网站
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 年之前
2 年之前
4 年之前
2 年之前
1 年之前
4 年之前
4 年之前
2 年之前
2 年之前
1 年之前
2 年之前
4 年之前
2 年之前
3 年之前
4 年之前
4 年之前
2 年之前
2 年之前
1 年之前
2 年之前
4 年之前
2 年之前
2 年之前
2 年之前
4 年之前
2 年之前
2 年之前
2 年之前
2 年之前
1 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
3 年之前
3 年之前
4 年之前
1 年之前
4 年之前
1 年之前
2 年之前
2 年之前
4 年之前
2 年之前
1 年之前
4 年之前
4 年之前
4 年之前
4 年之前
2 年之前
1 年之前
2 年之前
2 年之前
2 年之前
1 年之前
3 年之前
3 年之前
3 年之前
2 年之前
3 年之前
4 年之前
3 年之前
4 年之前
2 年之前
3 年之前
2 年之前
3 年之前
2 年之前
3 年之前
2 年之前
3 年之前
3 年之前
2 年之前
3 年之前
2 年之前
2 年之前
3 年之前
4 年之前
2 年之前
2 年之前
1 年之前
2 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
2 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
2 年之前
2 年之前
4 年之前
4 年之前
4 年之前
3 年之前
3 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
4 年之前
3 年之前
3 年之前
1 年之前
4 年之前
3 年之前
2 年之前
3 年之前
4 年之前
3 年之前
4 年之前
3 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
4 年之前
4 年之前
2 年之前
4 年之前
4 年之前
2 年之前
2 年之前
2 年之前
2 年之前
4 年之前
2 年之前
4 年之前
2 年之前
2 年之前
4 年之前
4 年之前
4 年之前
4 年之前
3 年之前
3 年之前
2 年之前
3 年之前
4 年之前
3 年之前
4 年之前
3 年之前
4 年之前
3 年之前
4 年之前
3 年之前
4 年之前
3 年之前
1 年之前
4 年之前
4 年之前
3 年之前
2 年之前
3 年之前
3 年之前
3 年之前
4 年之前
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "user", "paging","cupload","kindeditor", 'swiper'], function ($, template, Tools ) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //焦点图数据
  9. focusListTop: [],
  10. depositStatusOption: [],
  11. userInformationDetail:[],
  12. userSupplyInformationList:'',
  13. consultingInformationList:'',
  14. biddingInformationList:'',
  15. applicationInformationList:'',
  16. //页码
  17. pageNum: 1,
  18. //页码集合
  19. pageList: [],
  20. //每页数量
  21. pageSize: 5,
  22. //总页数
  23. pageCount:0,
  24. //用户ID
  25. memberId:0,
  26. //用户资料form
  27. form:{
  28. },
  29. modifyUrl:'',
  30. detailUrl:'',
  31. sheng:[],
  32. shi:[],
  33. sfzList:[],
  34. yhkList:[],
  35. sfz:'',
  36. yhk:'',
  37. khzm:'',
  38. companyLicense:'',
  39. activitiStatus:'',
  40. upType1:false,
  41. upType2:false,
  42. upType5:false,
  43. },
  44. };
  45. var tools = new Tools();
  46. module.init = function (page) {
  47. //获取焦点图信息
  48. tools.doGet(websitePicture, {picType:1,status:0,orderByColumn:'picSort',isAsc:'desc'}, module.focusNewsTop , true);
  49. //底部友情链接
  50. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  51. //用户资料
  52. tools.doGet(userData, {}, module.userData);
  53. if(!tools.getCookie('Admin-Token')){
  54. tools.skip('../../index.html')
  55. }
  56. //用户资料
  57. //tools.doPut(userData, {id:}, module.userData,true);
  58. //个人中心选项卡鼠标悬浮
  59. module.userListHover();
  60. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  61. tools.getWebConfig();
  62. //所属银行
  63. tools.doGet(dictionaries+"/bank_type_all", {}, module.bankType, true);
  64. //所属银行
  65. tools.doGet(dictionaries+"/deposit_status", {}, module.depositStatus, true);
  66. //账户类型
  67. tools.doGet(dictionaries+"/bank_account_type", {}, module.accountType, true);
  68. window.KindEditor.create('#editor_id')
  69. //console.log(tools.getParam('type'))
  70. var type = tools.getParam('type');
  71. module.getType(type);
  72. setTimeout(function(){
  73. //主题图片切换
  74. module.switchTheme();
  75. },2000)
  76. module.data.sheng = options;
  77. module.data.shi = options[0].children;
  78. var shengData = template('shengData', module.data);
  79. $("#sheng").html(shengData);
  80. var shiData = template('shiData', module.data);
  81. $("#shi").html(shiData);
  82. };
  83. getShi = function () {
  84. console.log($('#bankTypeData').val())
  85. // if (!$('#bankTypeData').val()){
  86. // return;
  87. // }
  88. module.data.shi = module.data.sheng.filter(function (e) { return e.label == $('#sheng').val(); })[0].children;
  89. var shiData = template('shiData', module.data);
  90. $("#shi").html(shiData);
  91. // tools.doGet(depositList, {sheng:$('#sheng').val(),shi:$('#shi').val()}, module.depositList, true);
  92. }
  93. getDeposit = function () {
  94. let data = {
  95. sheng:$('#sheng').val(),
  96. shi:$('#shi').val(),
  97. bankType:$('#bankType').val(),
  98. bankDeposit:$('#bankDeposit').val(),
  99. }
  100. console.log(data)
  101. tools.doGet(depositListYN, data,module.depositListYN);
  102. }
  103. changeBankAddress = function () {
  104. console.log($('#bankAddress').val())
  105. console.log(module.data.bankAddress.filter(function (e) { return e.bankDeposit == $('#bankAddress').val(); }))
  106. document.getElementById('payeePaymentLines').value =
  107. module.data.bankAddress.filter(function (e) { return e.bankDeposit == $('#bankAddress').val(); })[0].payeePaymentLines;
  108. }
  109. module.depositListYN = function (data) {
  110. var content = data.rows;
  111. if (content.length<1){
  112. let dataHtt = {
  113. sheng:$('#sheng').val(),
  114. shi:$('#shi').val(),
  115. bankType:$('#bankType').val(),
  116. bankDeposit:$('#bankDeposit').val(),
  117. }
  118. tools.doPost(depositListPub, dataHtt,module.depositList);
  119. }else{
  120. module.data.bankAddress = content;
  121. var bankAddressData = template('bankAddressData', module.data);
  122. $("#bankAddress").html(bankAddressData);
  123. if (content.length>0){
  124. changeBankAddress();
  125. }else{
  126. document.getElementById('payeePaymentLines').value = '';
  127. }
  128. }
  129. }
  130. module.depositList = function (data) {
  131. var content = data.data;
  132. module.data.bankAddress = content;
  133. var bankAddressData = template('bankAddressData', module.data);
  134. $("#bankAddress").html(bankAddressData);
  135. if (content.length>0){
  136. // changeBankAddress();
  137. }else{
  138. document.getElementById('payeePaymentLines').value = '';
  139. }
  140. }
  141. //底部友情链接
  142. module.bankType = function (data) {
  143. if (data.code == 200) {
  144. var content = data.data;
  145. module.data.bankTypeOption = content;
  146. var bankTypeData = template('bankTypeData', module.data);
  147. $("#bankType").html(bankTypeData);
  148. }
  149. }
  150. //底部友情链接
  151. module.depositStatus = function (data) {
  152. if (data.code == 200) {
  153. var content = data.data;
  154. module.data.depositStatusOption = content;
  155. }
  156. }
  157. //账户类型
  158. module.accountType = function (data) {
  159. if (data.code == 200) {
  160. var content = data.data;
  161. module.data.accountTypeOption = content;
  162. var accountTypeData = template('accountTypeData', module.data);
  163. $("#accountType").html(accountTypeData);
  164. }
  165. }
  166. //焦点图数据
  167. module.focusNewsTop = function (data) {
  168. if (data.code == 200) {
  169. let focusArray = [];
  170. if(data.data.length<1){
  171. focusArray.push({
  172. picUrl:'../../../static/images/banner1.png'
  173. },{
  174. picUrl:'../../../static/images/banner2.png'
  175. },{
  176. picUrl:'../../../static/images/banner3.png'
  177. })
  178. }else{
  179. data.data.forEach(res=>{
  180. focusArray.push({
  181. picUrl:'/api'+res.picUrl
  182. })
  183. })
  184. }
  185. module.data.focusListTop = focusArray;
  186. var bannerFocusDataTop = template('bannerFocusDataTop', module.data);
  187. $("#bannerFocusTopContent").html(bannerFocusDataTop);
  188. new Swiper('#bannerFocusWrapTop', {
  189. paginationClickable: true,
  190. autoplay : 4000,
  191. loop:true
  192. })
  193. }
  194. }
  195. //主题图片切换
  196. module.switchTheme = function(){
  197. if(themeColor == 'red'){
  198. module.data.modifyUrl = '../../static/images/modify_red.png';
  199. module.data.detailUrl = '../../static/images/detail_red.png';
  200. }else if(themeColor == 'green'){
  201. module.data.modifyUrl = '../../static/images/modify.png';
  202. module.data.detailUrl = '../../static/images/detail.png';
  203. }
  204. }
  205. //底部友情链接
  206. module.bottomFriendsLinks = function (data) {
  207. if (data.code == 200) {
  208. var content = data.data;
  209. //console.log(content)
  210. module.data.friendsLinksList = content;
  211. var friendsLinksData = template('friendsLinksData', module.data);
  212. $("#friendsLinksContent").html(friendsLinksData);
  213. }
  214. }
  215. //获取类型
  216. module.getType = function(type){
  217. if (type == 'info'){
  218. document.getElementById("icon-list1").click();
  219. }
  220. if (type == 'demand'){
  221. document.getElementById("icon-list2").click();
  222. }
  223. if (type == 'interact'){
  224. document.getElementById("icon-list3").click();
  225. }
  226. if (type == 'bidding'){
  227. document.getElementById("icon-list4").click();
  228. }
  229. if (type == 'goDemand'){
  230. document.getElementById("icon-list2").click();
  231. document.getElementById("goSupply").click();
  232. }
  233. if (type == 'goInteract'){
  234. document.getElementById("icon-list3").click();
  235. document.getElementById("goRelease").click();
  236. }
  237. if (type == 'application'){
  238. document.getElementById("icon-list5").click();
  239. }
  240. }
  241. //个人中心用户信息
  242. module.userData = function(data){
  243. if (data.code == 200) {
  244. var content = data.user;
  245. //console.log(content)
  246. module.data.userId = content.userId;
  247. tools.doGet(userMember + '/' + content.userId, {}, module.userMember);//memberType 1个人 2单位
  248. }
  249. }
  250. //个人中心用户资料
  251. module.userMember = function(data){
  252. if (data.code == 200) {
  253. var content = data.data;
  254. console.log(data)
  255. module.data.userInformationDetail = content;
  256. module.data.memberType = content.memberType;
  257. module.data.activitiStatus = content.activitiStatus;
  258. var bankTypeData = template('bankTypeData', module.data);
  259. $("#bankType").html(bankTypeData);
  260. var bankAddressData = template('bankAddressData', module.data);
  261. $("#bankAddress").html(bankAddressData);
  262. document.getElementById('bankSubmitBtn').style.display = content.activitiStatus == '1'?'none':'block';
  263. if(content.memberType == '1'){
  264. document.getElementById('companyInformationContent').style.display = 'none';
  265. document.getElementById('userInformationContent').style.display = 'table';
  266. var userInformationData = template('userInformationData', module.data);
  267. $("#userInformationContent").html(userInformationData);
  268. }else{
  269. document.getElementById('companyInformationContent').style.display = 'table';
  270. document.getElementById('userInformationContent').style.display = 'none';
  271. var companyInformationData = template('companyInformationData', module.data);
  272. $("#companyInformationContent").html(companyInformationData);
  273. }
  274. document.getElementById('bankAddress').value = content.bankAddress;
  275. document.getElementById('bankCardName').value = content.bankCardName;
  276. document.getElementById('bankCardNum').value = content.bankCardNum;
  277. document.getElementById('bankType').value = content.bankType;
  278. document.getElementById('accountType').value = content.accountType;
  279. document.getElementById('payeePaymentLines').value = content.payeePaymentLines;
  280. document.getElementById('phone').innerHTML = content.phone;
  281. module.data.memberId = content.id;
  282. //console.log(module.data.userId)
  283. //用户图片
  284. module.showUserImage(content);
  285. //我的供求
  286. tools.doGet(userSupply, {memberId:content.id,pageNum:module.data.pageNum,pageSize:10}, module.userSupply);
  287. //我的咨询
  288. tools.doGet(userConsulting, {memberId:content.id,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.consulting);
  289. //我的竞价
  290. tools.doGet(userBidding, {memberId:content.id,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.bidding);
  291. //我的报名
  292. tools.doGet(getSignupByMemberId, {memberId:content.id,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.application);
  293. tools.doPost(listHistory, {processInstanceId:content.instanceId}, module.listHistory);
  294. //个人资料提交
  295. $('#supplyAction').on('click', module.supplyAction)
  296. $('#releaseAction').on('click', module.releaseAction)
  297. //获取附件的值
  298. //$('#upLoadBtn').on('click',module.upLoadAction)
  299. //document.getElementById('userAction').addEventListener('click',module.formAction);
  300. }
  301. }
  302. module.listHistory = function(data){
  303. if (data.code == 200) {
  304. var content = data.rows;
  305. content.forEach((row) => {
  306. row.startTime = tools.format(row.startTime, "yyyy-MM-dd HH:mm:ss");
  307. row.endTime = tools.format(row.endTime, "yyyy-MM-dd HH:mm:ss");
  308. row.durationInMillis = tools.formatTotalDateSub(
  309. row.durationInMillis / 1000
  310. );
  311. });
  312. module.data.listHistory = content;
  313. var listHistoryData = template('listHistoryData', module.data);
  314. $("#listHistoryContent").html(listHistoryData);
  315. }
  316. }
  317. module.showUserImage = function(data){
  318. console.log(data)
  319. var accountOpenCert = data.accountOpenCert==null||data.accountOpenCert == ''?null:['/api'+data.accountOpenCert];
  320. var idCardPic = data.idCardPic==null||data.idCardPic == ''?null:['/api'+data.idCardPic];
  321. var companyLicense = data.companyLicense==null||data.companyLicense == ''?null:['/api'+data.companyLicense];
  322. console.log(accountOpenCert)
  323. console.log(idCardPic)
  324. if(module.data.memberType == '1'){
  325. var cupload2 = new Cupload ({
  326. ele: '#cupload-3',
  327. num: 1,
  328. data:idCardPic
  329. });
  330. var cupload4 = new Cupload ({
  331. ele: '#cupload-4',
  332. num: 1,
  333. data:accountOpenCert
  334. });
  335. module.data.sfz = data.idCardPic
  336. module.data.yhk = data.accountOpenCert
  337. }else{
  338. var cupload5 = new Cupload ({
  339. ele: '#cupload-5',
  340. num: 1,
  341. data:accountOpenCert
  342. });
  343. var cupload6 = new Cupload ({
  344. ele: '#cupload-6',
  345. num: 1,
  346. data:idCardPic
  347. });
  348. var cupload7 = new Cupload ({
  349. ele: '#cupload-7',
  350. num: 1,
  351. data:companyLicense
  352. });
  353. module.data.khzm = data.accountOpenCert
  354. module.data.frzjz = data.idCardPic
  355. module.data.companyLicense = data.companyLicense
  356. }
  357. }
  358. module.showSupplyImage = function(data){
  359. //console.log(data)
  360. if (data.code == 200) {
  361. var content = data.data;
  362. var fileUrlList = [];
  363. var fileNum = [];
  364. for (var i = 0 ; i < content.length ; i++){
  365. fileUrlList[i] = serverApi + content[i].fileUrl ;
  366. fileNum[i] = content[i].id;
  367. }
  368. if (fileUrlList.length == 0){
  369. fileUrlList = '';
  370. }
  371. //console.log(fileUrlList)
  372. document.getElementById('cupload-1').innerHTML = '';
  373. module.data.fileNum = fileNum;
  374. var cupload1 = new Cupload ({
  375. ele: '#cupload-1',
  376. num: 5,
  377. data:fileUrlList
  378. });
  379. }
  380. }
  381. deleteList = function(){
  382. //console.log(module.data.fileNum[deleteNum])
  383. // tools.doGet(deleteUserImg+'/'+module.data.fileNum[deleteNum], {}, module.Tips);
  384. }
  385. module.getData = function(data){
  386. upLoadAction(data.data)
  387. }
  388. //获取上传图片list
  389. upLoadAction = function(type){
  390. //console.log(type)
  391. var upLoadList = [];
  392. var data = {};
  393. if(type == 'user'||type == 'company'){
  394. if(module.data.memberType == '1'){
  395. $('#cupload-3').find('input').each(function() {
  396. if($(this).val()!=''&&$(this).val().indexOf('http') == -1){
  397. upLoadList.push($(this).val())
  398. }
  399. })
  400. }else{
  401. $('#cupload-5').find('input').each(function() {
  402. if($(this).val()!=''&&$(this).val().indexOf('http') == -1){
  403. upLoadList.push($(this).val())
  404. }
  405. })
  406. data["files"] = upLoadList;
  407. }
  408. // tools.doPostImg(base64Upload, data, module.submitInfo());//memberType 1个人 2单位
  409. }else{
  410. $('#cupload-1').find('input').each(function() {
  411. if($(this).val()!=''&&$(this).val().indexOf('http') == -1){
  412. upLoadList.push($(this).val())
  413. }
  414. })
  415. data["tableName"] = 't_transaction_supply_demand';
  416. data["tableId"] = type?type:module.data.supplyId;
  417. data["files"] = upLoadList;
  418. data["fileType"] = '';
  419. data["bizPath"] = 'transaction';
  420. tools.doPostImg(base64Attach, data, module.upLoadOver);//memberType 1个人 2单位
  421. setTimeout(function(){
  422. tools.doGet(userSupply, {memberId:module.data.memberId,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.userSupply)
  423. document.getElementById('supplyInformation').style.display = "block";
  424. document.getElementById('releaseSupply').style.display = "none";
  425. $('#demandType').val('');
  426. $('#projectName').val('');
  427. $('#location').val('');
  428. $('#projectRealName').val('');
  429. $('#projectPhone').val('');
  430. $('#projectContent').val('');
  431. },2000)
  432. }
  433. // tools.initError('发布成功');
  434. }
  435. module.upLoadOver = function(type){
  436. }
  437. module.upLoadOverInfo1 = function(data){
  438. if (data.code == 200)
  439. module.data.sfz = data.fileName;
  440. }
  441. module.upLoadOverInfo2 = function(data){
  442. if (data.code == 200)
  443. module.data.yhk = data.fileName;
  444. }
  445. module.upLoadOverInfo5 = function(data){
  446. if (data.code == 200)
  447. module.data.khzm = data.fileName;
  448. }
  449. module.upLoadOverInfo6 = function(data){
  450. if (data.code == 200)
  451. module.data.frzjz = data.fileName;
  452. }
  453. module.upLoadOverInfo7 = function(data){
  454. if (data.code == 200)
  455. module.data.companyLicense = data.fileName;
  456. }
  457. submitInfo = function(type){
  458. var upLoadList = [];
  459. var data = {};
  460. console.log(type)
  461. console.log(module.data.memberType)
  462. if(module.data.memberType == '1'){
  463. $('#cupload-3').find('input').each(function() {
  464. if($(this).val()!=''&&$(this).val().indexOf('/api') == -1){
  465. module.data.upType1 = true;
  466. tools.doPostImg(base64Upload, {file:$(this).val()}, module.upLoadOverInfo1);
  467. }
  468. })
  469. $('#cupload-4').find('input').each(function() {
  470. if($(this).val()!=''&&$(this).val().indexOf('/api') == -1){
  471. module.data.upType2 = true;
  472. tools.doPostImg(base64Upload, {file:$(this).val()}, module.upLoadOverInfo2);
  473. }
  474. })
  475. console.log(type);
  476. setTimeout(function(){
  477. formAction(type)
  478. },1000);
  479. }else{
  480. $('#cupload-5').find('input').each(function() {
  481. if($(this).val()!=''&&$(this).val().indexOf('/api') == -1){
  482. module.data.upType5 = true;
  483. console.log('5')
  484. tools.doPostImg(base64Upload, {file:$(this).val()}, module.upLoadOverInfo5);
  485. }
  486. })
  487. $('#cupload-6').find('input').each(function() {
  488. if($(this).val()!=''&&$(this).val().indexOf('/api') == -1){
  489. module.data.upType6 = true;
  490. console.log('6')
  491. tools.doPostImg(base64Upload, {file:$(this).val()}, module.upLoadOverInfo6);
  492. }
  493. })
  494. $('#cupload-7').find('input').each(function() {
  495. if($(this).val()!=''&&$(this).val().indexOf('/api') == -1){
  496. module.data.upType7 = true;
  497. console.log('7')
  498. tools.doPostImg(base64Upload, {file:$(this).val()}, module.upLoadOverInfo7);
  499. }
  500. })
  501. setTimeout(function(){
  502. formAction()
  503. },1000);
  504. }
  505. //memberType 1个人 2单位
  506. }
  507. //删除供求
  508. deleteUserSupply = function(ids){
  509. tools.doGet(deleteSupply+'/'+ids, {}, module.Tips);
  510. }
  511. //个人中心我的供求
  512. module.userSupply = function(data){
  513. //console.log(data)
  514. if (data.code == 200) {
  515. var content = data.rows;
  516. //console.log(data)
  517. var pageCount = (data.total/10).toFixed(0);
  518. if (pageCount < 1){
  519. pageCount = 1;
  520. }
  521. if(module.data.userSupplyInformationList == ''){
  522. $('.page_s1').html('');
  523. // 初始化 分页器
  524. var page_s1 = createPage('.page_s1');
  525. // 设置分页
  526. setPage(page_s1, {
  527. pageTotal: data.total, // 数据总条数
  528. pageSize: 10, // 每页显示条数
  529. pageCurrent: 1, // 当前页
  530. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  531. })
  532. $('#page_s1').html('共' + pageCount + '页')
  533. }
  534. module.data.userSupplyInformationList = content;
  535. var userSupplyInformationData = template('userSupplyInformationData', module.data);
  536. $("#userSupplyInformationContent").html(userSupplyInformationData);
  537. }
  538. }
  539. //个人中心我的咨询
  540. module.consulting = function(data){
  541. if (data.code == 200) {
  542. var content = data.rows;
  543. //console.log(data )
  544. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  545. if (pageCount < 1){
  546. pageCount = 1;
  547. }
  548. $('.page_s2').html('');
  549. // 初始化 分页器
  550. var page_s1 = createPage('.page_s2');
  551. // 设置分页
  552. setPage(page_s1, {
  553. pageTotal: data.total, // 数据总条数
  554. pageSize: module.data.pageSize, // 每页显示条数
  555. pageCurrent: 1, // 当前页
  556. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  557. })
  558. module.data.consultingInformationList = content;
  559. $('#page_s2').html('共'+pageCount+'页')
  560. var consultingInformationData = template('consultingInformationData', module.data);
  561. $("#consultingInformationContent").html(consultingInformationData);
  562. }
  563. }
  564. //个人中心我的竞价
  565. module.bidding = function(data){
  566. if (data.code == 200) {
  567. var content = data.rows;
  568. //console.log(content)
  569. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  570. if (pageCount < 1){
  571. pageCount = 1;
  572. }
  573. if(module.data.biddingInformationList == '') {
  574. // 初始化 分页器
  575. var page_s1=createPage('.page_s3');
  576. // 设置分页
  577. setPage(page_s1, {
  578. pageTotal: data.total, // 数据总条数
  579. pageSize: module.data.pageSize, // 每页显示条数
  580. pageCurrent: 1, // 当前页
  581. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  582. })
  583. $('#page_s3').html('共' + pageCount + '页')
  584. }
  585. module.data.biddingInformationList = content;
  586. var biddingInformationData = template('biddingInformationData', module.data);
  587. $("#biddingInformationContent").html(biddingInformationData);
  588. }
  589. }
  590. //个人中心我的报名
  591. module.application = function(data){
  592. if (data.code == 200) {
  593. var content = data.rows;
  594. //console.log(content)
  595. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  596. if (pageCount < 1){
  597. pageCount = 1;
  598. }
  599. if(module.data.applicationInformationList == '') {
  600. console.log('aaaaaa')
  601. // 初始化 分页器
  602. var page_s1=createPage('.page_s4');
  603. // 设置分页
  604. setPage(page_s1, {
  605. pageTotal: data.total, // 数据总条数
  606. pageSize: module.data.pageSize, // 每页显示条数
  607. pageCurrent: 1, // 当前页
  608. maxBtnNum: 5, // 最多按钮个数(最少5个)
  609. })
  610. $('#page_s4').html('共' + pageCount + '页')
  611. }
  612. // content.forEach((res,index)=>{
  613. // res.depositStatus = module.data.depositStatusOption.filter(function (e) { return e.dictValue == res.depositStatus; })[0].dictLabel;
  614. //
  615. // setInterval(()=>{
  616. // res.endTime = new Date(res.biddingStopTime) - new Date();
  617. // if (res.endTime <= 0){
  618. // document.getElementById('endTime'+res.id).innerHTML = '已结束'
  619. // return;
  620. // }
  621. // document.getElementById('endTime'+res.id).innerHTML = TimeInterval(res.endTime)
  622. // },1000)
  623. // })
  624. module.data.applicationInformationList = content;
  625. var applicationInformationData = template('applicationInformationData', module.data);
  626. $("#applicationInformationContent").html(applicationInformationData);
  627. }
  628. }
  629. TimeInterval = function(timestamp) {
  630. //时间戳转化为天时分秒
  631. // 总秒数
  632. var second = Math.floor(timestamp/ 1000);
  633. // 天数
  634. var day = Math.floor(second / 3600 / 24);
  635. // 小时
  636. var hr = Math.floor(second / 3600 % 24);
  637. // 分钟
  638. var min = Math.floor(second / 60 % 60);
  639. // 秒
  640. var sec = Math.floor(second % 60);
  641. return (day?day + "天":'') + (hr?hr+ "小时":'') + ( min?min + "分钟":'') + sec + "秒";
  642. }
  643. tabCheck = function(type){
  644. document.getElementById('user').className = '';
  645. // document.getElementById('bank').className = '';
  646. document.getElementById('passWord').className = '';
  647. document.getElementById(type).className = 'active';
  648. //console.log(type)
  649. document.getElementById('userInformationContent').style.display = 'none';
  650. document.getElementById('companyInformationContent').style.display = 'none';
  651. document.getElementById('bankInformationContent').style.display = 'none';
  652. document.getElementById('phoneInformationContent').style.display = 'none';
  653. document.getElementById('passWordInformationContent').style.display = 'none';
  654. if (module.data.memberType == '2' && type == 'user'){
  655. document.getElementById('companyInformationContent').style.display = 'table';
  656. document.getElementById('bankInformationContent').style.display = 'table';
  657. }else if (module.data.memberType == '1' && type == 'user'){
  658. document.getElementById('userInformationContent').style.display = 'table';
  659. document.getElementById('bankInformationContent').style.display = 'table';
  660. }else{
  661. document.getElementById(type+'InformationContent').style.display = 'table';
  662. }
  663. }
  664. phoneUpdate = function(type){
  665. document.getElementById(type+'InformationContent').style.display = 'none';
  666. document.getElementById('bankInformationContent').style.display = 'none';
  667. document.getElementById('phoneInformationContent').style.display = 'block';
  668. }
  669. tabLeftCheck = function(type){
  670. for (var i = 1 ; i < 6 ; i++){
  671. document.getElementById('icon-list'+i).className = '';
  672. }
  673. document.getElementById(type).className = 'active';
  674. document.getElementById('userInformation').style.display = 'none';
  675. document.getElementById('supplyInformation').style.display = 'none';
  676. document.getElementById('consultingInformation').style.display = 'none';
  677. document.getElementById('biddingInformation').style.display = 'none';
  678. document.getElementById('applicationInformation').style.display = 'none';
  679. document.getElementById('releaseSupply').style.display = 'none';
  680. document.getElementById('release').style.display = 'none';
  681. if(type == 'icon-list1'){
  682. document.getElementById('userInformation').style.display = 'block';
  683. }
  684. if(type == 'icon-list2'){
  685. document.getElementById('supplyInformation').style.display = 'block';
  686. module.data.clickType = 'supply';
  687. $('#demandType').val('');
  688. $('#projectName').val('');
  689. $('#location').val('');
  690. $('#projectRealName').val('');
  691. $('#projectPhone').val('');
  692. $('#projectContent').val('');
  693. }
  694. if(type == 'icon-list3'){
  695. document.getElementById('consultingInformation').style.display = 'block';
  696. module.data.clickType = 'consulting';
  697. $('#title').val('');
  698. $('#releaseContent').val('');
  699. $('#releaseRealName').val('');
  700. $('#releasePhone').val('');
  701. }
  702. if(type == 'icon-list4'){
  703. document.getElementById('biddingInformation').style.display = 'block';
  704. module.data.clickType = 'bidding';
  705. }
  706. if(type == 'icon-list5'){
  707. document.getElementById('applicationInformation').style.display = 'block';
  708. module.data.clickType = 'application';
  709. }
  710. module.data.pageNum = 1 ;
  711. }
  712. goSupply = function(){
  713. document.getElementById('supplyInformation').style.display = "none";
  714. document.getElementById('releaseSupply').style.display = "block";
  715. document.getElementById('cupload-1').innerHTML = '';
  716. module.data.supplyType = 'add'
  717. var cupload1 = new Cupload ({
  718. ele: '#cupload-1',
  719. num: 5,
  720. });
  721. }
  722. gosupplyTable = function(){
  723. document.getElementById('supplyInformation').style.display = "block";
  724. document.getElementById('releaseSupply').style.display = "none";
  725. $('#demandType').val('');
  726. $('#projectName').val('');
  727. $('#location').val('');
  728. $('#projectRealName').val('');
  729. $('#projectPhone').val('');
  730. $('#projectContent').val('');
  731. }
  732. goRelease = function(){
  733. document.getElementById('consultingInformation').style.display = "none";
  734. document.getElementById('release').style.display = "block";
  735. }
  736. goReleaseTable = function(){
  737. document.getElementById('consultingInformation').style.display = "block";
  738. document.getElementById('release').style.display = "none";
  739. $('#title').val('');
  740. $('#releaseContent').val('');
  741. $('#releaseRealName').val('');
  742. $('#releasePhone').val('');
  743. }
  744. //翻页
  745. turnThePage = function (pageNum) {
  746. module.data.pageNum = pageNum ;
  747. if(module.data.clickType == 'supply'){
  748. tools.doGet(userSupply, {memberId:module.data.memberId,pageNum:pageNum,pageSize:module.data.pageSize}, module.userSupply);
  749. }
  750. if(module.data.clickType == 'consulting'){
  751. tools.doGet(userConsulting, {memberId:module.data.memberId,pageNum:pageNum,pageSize:module.data.pageSize}, module.consulting);
  752. }
  753. if(module.data.clickType == 'bidding'){
  754. tools.doGet(userBidding, {memberId:module.data.memberId,pageNum:pageNum,pageSize:module.data.pageSize}, module.bidding);
  755. }
  756. if(module.data.clickType == 'application'){
  757. tools.doGet(getSignupByMemberId, {memberId:module.data.memberId,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.application);
  758. }
  759. }
  760. //个人用户资料修改
  761. formAction = function (type){
  762. var data = {};
  763. //var password = $('#password').val();
  764. console.log(module.data.memberType == '2');
  765. // module.data.userFormType = type ;
  766. if(module.data.memberType == '2'){
  767. console.log('qqqqqqqqqqqqq')
  768. //公司用户信息
  769. var companyName = $('#companyName').val();
  770. var idCardNum = $('#idCardNum').val();
  771. var realname = $('#realname').val();
  772. var companyCode = $('#companyCode').val();
  773. var companyNature = $('#companyNature').val();
  774. var companyScope = $('#companyScope').val();
  775. var companyTimeLimit = $('#companyTimeLimit').val();
  776. var companySetupTime = $('#companySetupTime').val();
  777. var companyCapital = $('#companyCapital').val();
  778. var companyLicense = module.data.companyLicense;
  779. var address = $('#address').val();
  780. var accountOpenCert = module.data.khzm;
  781. var idCardPic = module.data.frzjz;
  782. //银行卡信息
  783. var bankCardName = $('#bankCardName').val();
  784. var bankCardNum = $('#bankCardNum').val();
  785. var bankAddress = $('#bankAddress').val();
  786. var bankType = $('#bankType').val();
  787. var accountType = $('#accountType').val();
  788. var payeePaymentLines = $('#payeePaymentLines').val();
  789. if (companyName == '') {
  790. $('#companyName')[0].focus()
  791. tools.initTips('请输入公司名称', 'right', $('#companyName')[0], 2000)
  792. return false;
  793. }
  794. if (idCardNum == '') {
  795. $('#idCardNum')[0].focus()
  796. tools.initTips('请输入身份证号', 'right', $('#idCardNum')[0], 2000)
  797. return false;
  798. }
  799. if (realname == '') {
  800. $('#realname')[0].focus()
  801. tools.initTips('请输入负责人姓名', 'right', $('#realname')[0], 2000)
  802. return false;
  803. }
  804. let array = []
  805. $('#cupload-5').find('input').each(function() {
  806. if($(this).val()!=''){
  807. array.push($(this).val())
  808. }
  809. });
  810. if(array.length<1){
  811. $('#cupload-5')[0].focus()
  812. tools.initTips('请上传相关附件', 'right', $('#cupload-5')[0], 2000)
  813. return false;
  814. }
  815. let array6 = []
  816. $('#cupload-6').find('input').each(function() {
  817. if($(this).val()!=''){
  818. array6.push($(this).val())
  819. }
  820. });
  821. if(array6.length<1){
  822. $('#cupload-6')[0].focus()
  823. tools.initTips('请上传法人证件照', 'right', $('#cupload-6')[0], 2000)
  824. return false;
  825. }
  826. if (bankCardName == '') {
  827. $('#bankCardName')[0].focus()
  828. tools.initTips('请输入开户姓名', 'right', $('#bankCardName')[0], 2000)
  829. return false;
  830. }
  831. if (bankCardNum == '') {
  832. $('#bankCardNum')[0].focus()
  833. tools.initTips('请输入开户账号', 'right', $('#bankCardNum')[0], 2000)
  834. return false;
  835. }
  836. if (bankType == '') {
  837. $('#bankType')[0].focus()
  838. tools.initTips('请选择所属银行', 'right', $('#bankType')[0], 2000)
  839. return false;
  840. }
  841. if (bankAddress == '') {
  842. $('#bankAddress')[0].focus()
  843. tools.initTips('请选择开户银行', 'right', $('#bankAddress')[0], 2000)
  844. return false;
  845. }
  846. if (payeePaymentLines == '') {
  847. $('#payeePaymentLines')[0].focus()
  848. tools.initTips('请输入联行号', 'right', $('#payeePaymentLines')[0], 2000)
  849. return false;
  850. }
  851. data['bankCardName'] = bankCardName;
  852. data['bankCardNum'] = bankCardNum;
  853. data['bankAddress'] = bankAddress;
  854. data['bankType'] = bankType;
  855. data['accountType'] = accountType;
  856. data['payeePaymentLines'] = payeePaymentLines;
  857. data['activitiStatus'] = module.data.activitiStatus;
  858. tools.setCookie('bankCardName',bankCardName,24 * 60 * 60)
  859. tools.setCookie('bankCardNum',bankCardNum,24 * 60 * 60)
  860. tools.setCookie('bankAddress',bankAddress,24 * 60 * 60)
  861. tools.setCookie('bankType',bankType,24 * 60 * 60)
  862. tools.setCookie('accountType',accountType,24 * 60 * 60)
  863. tools.setCookie('payeePaymentLines',payeePaymentLines,24 * 60 * 60)
  864. data['accountOpenCert'] = accountOpenCert;
  865. data['companyName'] = companyName;
  866. data['idCardNum'] = idCardNum;
  867. data['realname'] = realname;
  868. data['companyCode'] = companyCode;
  869. data['companyName'] = companyName;
  870. data['companyNature'] = companyNature;
  871. data['companyScope'] = companyScope;
  872. data['companyTimeLimit'] = companyTimeLimit;
  873. data['companySetupTime'] = companySetupTime;
  874. data['companyCapital'] = companyCapital;
  875. data['companyLicense'] = companyLicense;
  876. data['address'] = address;
  877. data['idCardPic'] = idCardPic;
  878. tools.setCookie('userName',realname,24 * 60 * 60)
  879. tools.setCookie('idCardNum',idCardNum,24 * 60 * 60)
  880. tools.setCookie('address',address,24 * 60 * 60)
  881. // upLoadAction('user');
  882. }
  883. if(module.data.memberType == '1'){
  884. //个人用户信息
  885. var userFormRealName = $('#userFormRealName').val();
  886. var userFormIdCard = $('#userFormIdCard').val();
  887. var userFormAddress = $('#userFormAddress').val();
  888. var idCardPic = module.data.sfz;
  889. var accountOpenCert = module.data.yhk;
  890. //银行卡信息
  891. var bankCardName = $('#bankCardName').val();
  892. var bankCardNum = $('#bankCardNum').val();
  893. var bankAddress = $('#bankAddress').val();
  894. var bankType = $('#bankType').val();
  895. var accountType = $('#accountType').val();
  896. var payeePaymentLines = $('#payeePaymentLines').val();
  897. if (userFormRealName == '') {
  898. $('#userFormRealName')[0].focus()
  899. tools.initTips('请输入姓名', 'right', $('#userFormRealName')[0], 2000)
  900. return false;
  901. }
  902. if (userFormIdCard == '') {
  903. $('#userFormIdCard')[0].focus()
  904. tools.initTips('请输入身份证号码', 'right', $('#userFormIdCard')[0], 2000)
  905. return false;
  906. }
  907. let array = []
  908. $('#cupload-3').find('input').each(function() {
  909. if($(this).val()!=''){
  910. array.push($(this).val())
  911. }
  912. });
  913. if(array.length<1){
  914. $('#cupload-3')[0].focus()
  915. tools.initTips('请上传身份证', 'right', $('#cupload-3')[0], 2000)
  916. return false;
  917. }
  918. let array2 = []
  919. $('#cupload-4').find('input').each(function() {
  920. if($(this).val()!=''){
  921. array2.push($(this).val())
  922. }
  923. });
  924. if(array2.length<1){
  925. $('#cupload-4')[0].focus()
  926. tools.initTips('请上传银行卡', 'right', $('#cupload-4')[0], 2000)
  927. return false;
  928. }
  929. if (bankCardName == '') {
  930. $('#bankCardName')[0].focus()
  931. tools.initTips('请输入开户姓名', 'right', $('#bankCardName')[0], 2000)
  932. return false;
  933. }
  934. if (bankCardNum == '') {
  935. $('#bankCardNum')[0].focus()
  936. tools.initTips('请输入开户账号', 'right', $('#bankCardNum')[0], 2000)
  937. return false;
  938. }
  939. if (bankType == '') {
  940. $('#bankType')[0].focus()
  941. tools.initTips('请选择所属银行', 'right', $('#bankType')[0], 2000)
  942. return false;
  943. }
  944. if (bankAddress == '') {
  945. $('#bankAddress')[0].focus()
  946. tools.initTips('请选择开户银行', 'right', $('#bankAddress')[0], 2000)
  947. return false;
  948. }
  949. if (payeePaymentLines == '') {
  950. $('#payeePaymentLines')[0].focus()
  951. tools.initTips('请输入联行号', 'right', $('#payeePaymentLines')[0], 2000)
  952. return false;
  953. }
  954. data['bankCardName'] = bankCardName;
  955. data['bankCardNum'] = bankCardNum;
  956. data['bankAddress'] = bankAddress;
  957. data['bankType'] = bankType;
  958. data['accountType'] = accountType;
  959. data['payeePaymentLines'] = payeePaymentLines;
  960. data['activitiStatus'] = module.data.activitiStatus;
  961. tools.setCookie('bankCardName',bankCardName,24 * 60 * 60)
  962. tools.setCookie('bankCardNum',bankCardNum,24 * 60 * 60)
  963. tools.setCookie('bankAddress',bankAddress,24 * 60 * 60)
  964. tools.setCookie('bankType',bankType,24 * 60 * 60)
  965. tools.setCookie('accountType',accountType,24 * 60 * 60)
  966. tools.setCookie('payeePaymentLines',payeePaymentLines,24 * 60 * 60)
  967. data['idCardPic'] = idCardPic;
  968. data['accountOpenCert'] = accountOpenCert;
  969. data['idCardNum'] = userFormIdCard;
  970. data['realname'] = userFormRealName;
  971. data['address'] = userFormAddress;
  972. tools.setCookie('userName',userFormRealName,24 * 60 * 60)
  973. tools.setCookie('idCardNum',userFormIdCard,24 * 60 * 60)
  974. tools.setCookie('address',userFormAddress,24 * 60 * 60)
  975. // upLoadAction('user');
  976. }
  977. //data['password'] = password;
  978. data['id'] = module.data.memberId;
  979. data['taskId'] = module.data.userInformationDetail.taskId;
  980. // data['taskName'] = module.data.userInformationDetail.taskName;
  981. tools.doPost(userUpdate, data, module.userTips)
  982. }
  983. module.userTips = function(data){
  984. tools.initError(data.msg);
  985. //用户资料
  986. tools.doGet(userData, {}, module.userData);
  987. }
  988. editPassword = function(){
  989. var data = {};
  990. if(module.passWordCompare()){
  991. var oldPassWord = $('#originalPassWord').val();
  992. var newPassWord = $('#newPassWord').val();
  993. data['oldPassword'] = oldPassWord;
  994. data['newPassword'] = newPassWord;
  995. tools.doPost(updatePwd, data, module.Tips)
  996. }
  997. }
  998. //手动验证密码是否一致
  999. module.passWordCompare = function(){
  1000. var newPassword = $('#newPassWord').val();
  1001. var determinePassWord = $('#determinePassWord').val();
  1002. var originalPassWord = $('#originalPassWord').val();
  1003. /*原密码*/
  1004. if (originalPassWord == '') {
  1005. $('#originalPassWord')[0].focus()
  1006. tools.initTips('请输入原密码', 'right', $('#originalPassWord')[0], 2000)
  1007. return false;
  1008. }
  1009. /* 新密码 */
  1010. if (newPassword == '') {
  1011. $('#newPassWord')[0].focus()
  1012. tools.initTips('请输入新密码', 'right', $('#newPassWord')[0], 2000)
  1013. return false;
  1014. }
  1015. /* 确认密码 */
  1016. if (determinePassWord == '') {
  1017. $('#determinePassWord')[0].focus()
  1018. tools.initTips('请确认密码', 'right', $('#determinePassWord')[0], 2000)
  1019. return false;
  1020. }
  1021. return true;
  1022. }
  1023. //发布供求
  1024. module.supplyAction = function (){
  1025. var data = {};
  1026. if(module.supplyCheck()){
  1027. //供求信息
  1028. var demandType = $('#demandType').val();
  1029. var projectName = $('#projectName').val();
  1030. var location = $('#location').val();
  1031. var projectRealName = $('#projectRealName').val();
  1032. var projectPhone = $('#projectPhone').val();
  1033. var projectContent = $('#projectContent').val();
  1034. var logintime = tools.getNowFormatDate();
  1035. //console.log(demandType);
  1036. data['projectName'] = projectName;
  1037. data['location'] = location;
  1038. data['realname'] = projectRealName;
  1039. data['phone'] = projectPhone;
  1040. data['projectContent'] = projectContent;
  1041. data['logintime'] = logintime;
  1042. data['supplyDemandType'] = demandType;
  1043. data['deptId'] = 100;
  1044. data['memberId'] = module.data.memberId;
  1045. if(module.data.supplyType == 'edit'){
  1046. data['id'] = module.data.supplyId;
  1047. tools.doPost(userEdit, data, module.getData)
  1048. }else{
  1049. tools.doPost(userDemand, data, module.getData)
  1050. }
  1051. }
  1052. }
  1053. //发布咨询
  1054. module.releaseAction = function (){
  1055. var data = {};
  1056. if(module.releaseCheck()){
  1057. //供求信息
  1058. var title = $('#title').val();
  1059. var releaseContent = $('#releaseContent').val();
  1060. var releaseRealName = $('#releaseRealName').val();
  1061. var releasePhone = $('#releasePhone').val();
  1062. var logintime = tools.getNowFormatDate();
  1063. data['title'] = title;
  1064. data['content'] = releaseContent;
  1065. data['realname'] = releaseRealName;
  1066. data['phone'] = releasePhone;
  1067. data['logintime'] = logintime;
  1068. data['deptId'] = 100;
  1069. data['memberId'] = module.data.memberId;
  1070. tools.doPost(userCommunicate, data, module.releaseActionYes)
  1071. }
  1072. }
  1073. module.releaseActionYes = function(data){
  1074. tools.initError(data.msg);
  1075. setTimeout(function(){
  1076. tools.doGet(userConsulting, {memberId:module.data.memberId,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.consulting);
  1077. document.getElementById('consultingInformation').style.display = "block";
  1078. document.getElementById('release').style.display = "none";
  1079. $('#title').val('');
  1080. $('#releaseContent').val('');
  1081. $('#releaseRealName').val('');
  1082. $('#releasePhone').val('');
  1083. },2000)
  1084. }
  1085. module.Tips = function(data){
  1086. tools.initError(data.msg);
  1087. }
  1088. //手动验证表单
  1089. module.check = function () {
  1090. var usernameVal = $('#username').val();
  1091. var passwordVal = $('#password').val();
  1092. var codeVal = $('#code').val();
  1093. /* 手机号 */
  1094. if (usernameVal == '') {
  1095. $('#username')[0].focus()
  1096. tools.initTips('请输入用户名', 'right', $('#username')[0], 2000)
  1097. return false;
  1098. }
  1099. /* 密码 */
  1100. if (passwordVal == '') {
  1101. $('#password')[0].focus()
  1102. tools.initTips('请输入密码', 'right', $('#password')[0], 2000)
  1103. return false;
  1104. } else if (parseInt(passwordVal.length) < 6 || parseInt(passwordVal.length) > 18) {
  1105. $('#password')[0].focus()
  1106. tools.initTips('请输入正确格式密码', 'right', $('#password')[0], 2000)
  1107. return false;
  1108. }
  1109. /*图形验证码*/
  1110. if (module.uuid == '' || codeVal == '') {
  1111. $('#code')[0].focus()
  1112. tools.initTips('请输入图形验证码', 'right', $('#code')[0], 2000)
  1113. return false;
  1114. }
  1115. return true;
  1116. }
  1117. module.supplyCheck = function () {
  1118. var projectName = $('#projectName').val();
  1119. var location = $('#location').val();
  1120. var projectRealName = $('#projectRealName').val();
  1121. var projectPhone = $('#projectPhone').val();
  1122. var projectContent = $('#projectContent').val();
  1123. if (projectName == '') {
  1124. $('#projectName')[0].focus()
  1125. tools.initTips('请输入项目名称', 'right', $('#projectName')[0], 2000)
  1126. return false;
  1127. }
  1128. if (location == '') {
  1129. $('#location')[0].focus()
  1130. tools.initTips('请输入项目地址', 'right', $('#location')[0], 2000)
  1131. return false;
  1132. }
  1133. if (projectRealName == '') {
  1134. $('#projectRealName')[0].focus()
  1135. tools.initTips('请输入姓名', 'right', $('#projectRealName')[0], 2000)
  1136. return false;
  1137. }
  1138. if (projectPhone == '') {
  1139. $('#projectPhone')[0].focus()
  1140. tools.initTips('请输入联系电话', 'right', $('#projectPhone')[0], 2000)
  1141. return false;
  1142. }
  1143. if (projectContent == '') {
  1144. $('#projectContent')[0].focus()
  1145. tools.initTips('请输入项目详情', 'right', $('#projectContent')[0], 2000)
  1146. return false;
  1147. }
  1148. return true;
  1149. }
  1150. module.releaseCheck = function () {
  1151. var title = $('#title').val();
  1152. var releaseContent = $('#releaseContent').val();
  1153. var releaseRealName = $('#releaseRealName').val();
  1154. var releasePhone = $('#releasePhone').val();
  1155. if (title == '') {
  1156. $('#title')[0].focus()
  1157. tools.initTips('请输入标题', 'right', $('#title')[0], 2000)
  1158. return false;
  1159. }
  1160. if (releaseContent == '') {
  1161. $('#releaseContent')[0].focus()
  1162. tools.initTips('请输入咨询内容', 'right', $('#releaseContent')[0], 2000)
  1163. return false;
  1164. }
  1165. if (releaseRealName == '') {
  1166. $('#releaseRealName')[0].focus()
  1167. tools.initTips('请输入姓名', 'right', $('#releaseRealName')[0], 2000)
  1168. return false;
  1169. }
  1170. if (releasePhone == '') {
  1171. $('#releasePhone')[0].focus()
  1172. tools.initTips('请输入联系电话', 'right', $('#releasePhone')[0], 2000)
  1173. return false;
  1174. }
  1175. return true;
  1176. }
  1177. //个人中心选项卡鼠标悬浮
  1178. module.userListHover = function(){
  1179. document.getElementById('icon-list1').onmouseout = function(){
  1180. document.getElementById('icon1').src = '../../static/images/user_index_icon1.png'
  1181. }
  1182. document.getElementById('icon-list1').onmouseover = function(){
  1183. if(themeColor == 'red'){
  1184. document.getElementById('icon1').src = '../../static/images/user_index_icon5_red.png'
  1185. }else if(themeColor == 'green'){
  1186. document.getElementById('icon1').src = '../../static/images/user_index_icon5.png'
  1187. }
  1188. }
  1189. document.getElementById('icon-list2').onmouseout = function(){
  1190. document.getElementById('icon2').src = '../../static/images/user_index_icon2.png'
  1191. }
  1192. document.getElementById('icon-list2').onmouseover = function(){
  1193. if(themeColor == 'red'){
  1194. document.getElementById('icon2').src = '../../static/images/user_index_icon6_red.png'
  1195. }else if(themeColor == 'green') {
  1196. document.getElementById('icon2').src = '../../static/images/user_index_icon6.png'
  1197. }
  1198. }
  1199. document.getElementById('icon-list3').onmouseout = function(){
  1200. document.getElementById('icon3').src = '../../static/images/user_index_icon3.png'
  1201. }
  1202. document.getElementById('icon-list3').onmouseover = function(){
  1203. if(themeColor == 'red'){
  1204. document.getElementById('icon3').src = '../../static/images/user_index_icon7_red.png'
  1205. }else if(themeColor == 'green') {
  1206. document.getElementById('icon3').src = '../../static/images/user_index_icon7.png'
  1207. }
  1208. }
  1209. document.getElementById('icon-list4').onmouseout = function(){
  1210. document.getElementById('icon4').src = '../../static/images/user_index_icon4.png'
  1211. }
  1212. document.getElementById('icon-list4').onmouseover = function(){
  1213. if(themeColor == 'red'){
  1214. document.getElementById('icon4').src = '../../static/images/user_index_icon8_red.png'
  1215. }else if(themeColor == 'green') {
  1216. document.getElementById('icon4').src = '../../static/images/user_index_icon8.png'
  1217. }
  1218. }
  1219. document.getElementById('icon-list5').onmouseout = function(){
  1220. document.getElementById('icon5').src = '../../static/images/user_index_icon9.png'
  1221. }
  1222. document.getElementById('icon-list5').onmouseover = function(){
  1223. if(themeColor == 'red'){
  1224. document.getElementById('icon5').src = '../../static/images/user_index_icon9_red.png'
  1225. }else if(themeColor == 'green') {
  1226. document.getElementById('icon5').src = '../../static/images/user_index_icon10.png'
  1227. }
  1228. }
  1229. }
  1230. goSearch = function () {
  1231. var searchTitle = $('#searchTitle').val();
  1232. var searchContent = $('#searchContent').val();
  1233. //console.log(searchTitle)
  1234. module.data.searchType = 'YES';
  1235. tools.doGet(userConsulting,{title:searchTitle,content:searchContent,memberId:module.data.memberId,pageNum:module.data.pageNum,pageSize:module.data.pageSize},module.consulting);
  1236. }
  1237. selectUserSupply = function(ids) {
  1238. module.data.supplyType = 'edit';
  1239. module.data.supplyId = ids;
  1240. //console.log('点击修改')
  1241. tools.doGet(selectSupply + '/' + ids, {}, module.selectSupplyDetail);//memberType 1个人 2单位
  1242. }
  1243. module.selectSupplyDetail = function(data){
  1244. console.log('进入修改供求')
  1245. document.getElementById('supplyInformation').style.display = "none";
  1246. document.getElementById('releaseSupply').style.display = "block";
  1247. var content = data.data
  1248. $('#demandType').val(content.supplyDemandType);
  1249. $('#projectName').val(content.projectName);
  1250. $('#location').val(content.location);
  1251. $('#projectRealName').val(content.realname);
  1252. $('#projectPhone').val(content.phone);
  1253. $('#projectContent').val(content.projectContent);
  1254. tools.doGet(supplyDemandImg+'/'+content.id, {}, module.showSupplyImage);
  1255. }
  1256. goProject = function(id){
  1257. tools.skip('../listingItems/itemsDetail.html?id='+id)
  1258. }
  1259. openBiddingList = function(id){
  1260. tools.doGet(userBiddingList, {projectId:id,memberId:module.data.memberId}, module.openBidding);
  1261. }
  1262. module.openBidding = function(data){
  1263. $('#dialog-01').css('display','block')
  1264. if (data.code == 200) {
  1265. var content = data.rows;
  1266. module.data.moneyList = content;
  1267. var biddingMoneyData = template('biddingMoneyData', module.data);
  1268. $("#biddingMoneyContent").html(biddingMoneyData);
  1269. }
  1270. }
  1271. return module;
  1272. });