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