农燊高科官方网站
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.
 
 
 

761 lines
29 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "user", "paging","cupload","kindeditor"], function ($, template, Tools ) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. userInformationDetail:[],
  9. userSupplyInformationList:'',
  10. consultingInformationList:'',
  11. biddingInformationList:'',
  12. //页码
  13. pageNum: 1,
  14. //页码集合
  15. pageList: [],
  16. //每页数量
  17. pageSize: 5,
  18. //总页数
  19. pageCount:0,
  20. //用户ID
  21. memberId:0,
  22. //用户资料form
  23. form:{
  24. }
  25. },
  26. };
  27. var tools = new Tools();
  28. module.init = function (page) {
  29. //底部友情链接
  30. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  31. //用户资料
  32. tools.doGet(userData, {}, module.userData);
  33. //用户资料
  34. //tools.doPut(userData, {id:}, module.userData,true);
  35. //个人中心选项卡鼠标悬浮
  36. module.userListHover();
  37. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  38. tools.getWebConfig();
  39. window.KindEditor.create('#editor_id')
  40. console.log(tools.getParam('type'))
  41. var type = tools.getParam('type');
  42. module.getType(type);
  43. };
  44. //底部友情链接
  45. module.bottomFriendsLinks = function (data) {
  46. if (data.code == 200) {
  47. var content = data.data;
  48. console.log(content)
  49. module.data.friendsLinksList = content;
  50. var friendsLinksData = template('friendsLinksData', module.data);
  51. $("#friendsLinksContent").html(friendsLinksData);
  52. }
  53. }
  54. //获取类型
  55. module.getType = function(type){
  56. if (type == 'info'){
  57. document.getElementById("icon-list1").click();
  58. }
  59. if (type == 'demand'){
  60. document.getElementById("icon-list2").click();
  61. }
  62. if (type == 'interact'){
  63. document.getElementById("icon-list3").click();
  64. }
  65. if (type == 'bidding'){
  66. document.getElementById("icon-list4").click();
  67. }
  68. if (type == 'goDemand'){
  69. document.getElementById("icon-list2").click();
  70. document.getElementById("goSupply").click();
  71. }
  72. if (type == 'goInteract'){
  73. document.getElementById("icon-list3").click();
  74. document.getElementById("goRelease").click();
  75. }
  76. }
  77. //个人中心用户信息
  78. module.userData = function(data){
  79. if (data.code == 200) {
  80. var content = data.user;
  81. console.log(content)
  82. module.data.userId = content.userId;
  83. tools.doGet(userMember + '/' + content.userId, {}, module.userMember);//memberType 1个人 2单位
  84. }
  85. }
  86. //个人中心用户资料
  87. module.userMember = function(data){
  88. if (data.code == 200) {
  89. var content = data.data;
  90. console.log(data)
  91. module.data.userInformationDetail = content;
  92. module.data.memberType = content.memberType;
  93. if(content.memberType == '1'){
  94. document.getElementById('companyInformationContent').style.display = 'none';
  95. document.getElementById('userInformationContent').style.display = 'block';
  96. var userInformationData = template('userInformationData', module.data);
  97. $("#userInformationContent").html(userInformationData);
  98. }else{
  99. document.getElementById('companyInformationContent').style.display = 'block';
  100. document.getElementById('userInformationContent').style.display = 'none';
  101. var companyInformationData = template('companyInformationData', module.data);
  102. $("#companyInformationContent").html(companyInformationData);
  103. }
  104. document.getElementById('bankAddress').value = content.bankAddress;
  105. document.getElementById('bankCardName').value = content.bankCardName;
  106. document.getElementById('bankCardNum').value = content.bankCardNum;
  107. document.getElementById('phone').innerHTML = content.phone;
  108. module.data.memberId = content.id;
  109. console.log(module.data.userId)
  110. //用户图片
  111. tools.doGet(showUserImg+'/'+module.data.memberId, {}, module.showUserImage);
  112. //我的供求
  113. tools.doGet(userSupply, {memberId:content.id,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.userSupply);
  114. //我的咨询
  115. tools.doGet(userConsulting, {memberId:content.id,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.consulting);
  116. //我的竞价
  117. tools.doGet(userBidding, {memberId:content.id,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.bidding);
  118. //个人资料提交
  119. $('#supplyAction').on('click', module.supplyAction)
  120. $('#releaseAction').on('click', module.releaseAction)
  121. //获取附件的值
  122. //$('#upLoadBtn').on('click',module.upLoadAction)
  123. //document.getElementById('userAction').addEventListener('click',module.formAction);
  124. }
  125. }
  126. module.showUserImage = function(data){
  127. console.log(data)
  128. if (data.code == 200) {
  129. var content = data.data;
  130. var fileUrlList = [];
  131. var fileNum = [];
  132. for (var i = 0 ; i < content.length ; i++){
  133. fileUrlList[i] = serverApi + content[i].fileUrl ;
  134. fileNum[i] = content[i].id;
  135. }
  136. if (fileUrlList.length == 0){
  137. fileUrlList = '';
  138. }
  139. console.log(fileUrlList)
  140. module.data.fileNum = fileNum;
  141. if(module.data.memberType == '1'){
  142. var cupload2 = new Cupload ({
  143. ele: '#cupload-3',
  144. num: 5,
  145. data:fileUrlList
  146. });
  147. }else{
  148. var cupload2 = new Cupload ({
  149. ele: '#cupload-2',
  150. num: 5,
  151. data:fileUrlList
  152. });
  153. }
  154. }
  155. }
  156. module.showSupplyImage = function(data){
  157. console.log(data)
  158. if (data.code == 200) {
  159. var content = data.data;
  160. var fileUrlList = [];
  161. var fileNum = [];
  162. for (var i = 0 ; i < content.length ; i++){
  163. fileUrlList[i] = serverApi + content[i].fileUrl ;
  164. fileNum[i] = content[i].id;
  165. }
  166. if (fileUrlList.length == 0){
  167. fileUrlList = '';
  168. }
  169. console.log(fileUrlList)
  170. document.getElementById('cupload-1').innerHTML = '';
  171. module.data.fileNum = fileNum;
  172. var cupload1 = new Cupload ({
  173. ele: '#cupload-1',
  174. num: 5,
  175. data:fileUrlList
  176. });
  177. }
  178. }
  179. deleteList = function(){
  180. console.log(module.data.fileNum[deleteNum])
  181. tools.doDelete(deleteUserImg+'/'+module.data.fileNum[deleteNum], {}, module.Tips);
  182. }
  183. module.getData = function(data){
  184. upLoadAction(data.data)
  185. }
  186. //获取上传图片list
  187. upLoadAction = function(type){
  188. console.log(type)
  189. var upLoadList = [];
  190. var data = {};
  191. if(type == 'user'){
  192. if(module.data.memberType == '1'){
  193. $('#cupload-3').find('input').each(function() {
  194. if($(this).val()!=''&&$(this).val().indexOf('http') == -1){
  195. upLoadList.push($(this).val())
  196. }
  197. })
  198. }else{
  199. $('#cupload-2').find('input').each(function() {
  200. if($(this).val()!=''&&$(this).val().indexOf('http') == -1){
  201. upLoadList.push($(this).val())
  202. }
  203. })
  204. }
  205. data["tableName"] = 't_transaction_member';
  206. data["tableId"] = module.data.memberId;
  207. }else{
  208. $('#cupload-1').find('input').each(function() {
  209. if($(this).val()!=''&&$(this).val().indexOf('http') == -1){
  210. upLoadList.push($(this).val())
  211. }
  212. })
  213. data["tableName"] = 't_transaction_supply_demand';
  214. data["tableId"] = type;
  215. setTimeout(function(){
  216. tools.doGet(userSupply, {memberId:module.data.memberId,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.userSupply)
  217. document.getElementById('supplyInformation').style.display = "block";
  218. document.getElementById('releaseSupply').style.display = "none";
  219. $('#demandType').val('');
  220. $('#projectName').val('');
  221. $('#location').val('');
  222. $('#projectRealName').val('');
  223. $('#projectPhone').val('');
  224. $('#projectContent').val('');
  225. },2000)
  226. }
  227. data["files"] = upLoadList;
  228. data["fileType"] = '';
  229. data["bizPath"] = 'transaction';
  230. tools.doPostImg(base64Attach, data, module.upLoadOver);//memberType 1个人 2单位
  231. tools.initError('发布成功');
  232. }
  233. module.upLoadOver = function(){
  234. }
  235. //删除供求
  236. deleteUserSupply = function(ids){
  237. tools.doDelete(deleteSupply+'/'+ids, {}, module.Tips);
  238. }
  239. //个人中心我的供求
  240. module.userSupply = function(data){
  241. console.log(data)
  242. if (data.code == 200) {
  243. var content = data.rows;
  244. console.log(data)
  245. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  246. if (pageCount < 1){
  247. pageCount = 1;
  248. }
  249. if(module.data.userSupplyInformationList == ''){
  250. $('.page_s1').html('');
  251. // 初始化 分页器
  252. var page_s1 = createPage('.page_s1');
  253. // 设置分页
  254. setPage(page_s1, {
  255. pageTotal: data.total, // 数据总条数
  256. pageSize: module.data.pageSize, // 每页显示条数
  257. pageCurrent: 1, // 当前页
  258. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  259. })
  260. $('#page_s1').html('共' + pageCount + '页')
  261. }
  262. module.data.userSupplyInformationList = content;
  263. var userSupplyInformationData = template('userSupplyInformationData', module.data);
  264. $("#userSupplyInformationContent").html(userSupplyInformationData);
  265. }
  266. }
  267. //个人中心我的咨询
  268. module.consulting = function(data){
  269. if (data.code == 200) {
  270. var content = data.rows;
  271. console.log(content)
  272. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  273. if (pageCount < 1){
  274. pageCount = 1;
  275. }
  276. $('.page_s2').html('');
  277. // 初始化 分页器
  278. var page_s1 = createPage('.page_s2');
  279. // 设置分页
  280. setPage(page_s1, {
  281. pageTotal: data.total, // 数据总条数
  282. pageSize: module.data.pageSize, // 每页显示条数
  283. pageCurrent: 1, // 当前页
  284. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  285. })
  286. module.data.consultingInformationList = content;
  287. $('#page_s2').html('共'+pageCount+'页')
  288. var consultingInformationData = template('consultingInformationData', module.data);
  289. $("#consultingInformationContent").html(consultingInformationData);
  290. }
  291. }
  292. //个人中心我的竞价
  293. module.bidding = function(data){
  294. if (data.code == 200) {
  295. var content = data.rows;
  296. console.log(content)
  297. var pageCount = (data.total/module.data.pageSize).toFixed(0);
  298. if (pageCount < 1){
  299. pageCount = 1;
  300. }
  301. if(module.data.biddingInformationList == '') {
  302. // 初始化 分页器
  303. var page_s1=createPage('.page_s3');
  304. // 设置分页
  305. setPage(page_s1, {
  306. pageTotal: data.total, // 数据总条数
  307. pageSize: module.data.pageSize, // 每页显示条数
  308. pageCurrent: 1, // 当前页
  309. maxBtnNum: 5, // 最多按钮个数 (最少5个)
  310. })
  311. $('#page_s3').html('共' + pageCount + '页')
  312. }
  313. module.data.biddingInformationList = content;
  314. var biddingInformationData = template('biddingInformationData', module.data);
  315. $("#biddingInformationContent").html(biddingInformationData);
  316. }
  317. }
  318. tabCheck = function(type){
  319. document.getElementById('user').className = '';
  320. document.getElementById('bank').className = '';
  321. document.getElementById(type).className = 'active';
  322. console.log(type)
  323. document.getElementById('userInformationContent').style.display = 'none';
  324. document.getElementById('companyInformationContent').style.display = 'none';
  325. document.getElementById('bankInformationContent').style.display = 'none';
  326. document.getElementById('phoneInformationContent').style.display = 'none';
  327. if (module.data.memberType == '2' && type == 'user'){
  328. document.getElementById('companyInformationContent').style.display = 'block';
  329. }else if (module.data.memberType == '1' && type == 'user'){
  330. document.getElementById('userInformationContent').style.display = 'block';
  331. }else{
  332. document.getElementById(type+'InformationContent').style.display = 'block';
  333. }
  334. }
  335. phoneUpdate = function(type){
  336. document.getElementById(type+'InformationContent').style.display = 'none';
  337. document.getElementById('phoneInformationContent').style.display = 'block';
  338. }
  339. tabLeftCheck = function(type){
  340. for (var i = 1 ; i < 5 ; i++){
  341. document.getElementById('icon-list'+i).className = '';
  342. }
  343. document.getElementById(type).className = 'active';
  344. document.getElementById('userInformation').style.display = 'none';
  345. document.getElementById('supplyInformation').style.display = 'none';
  346. document.getElementById('consultingInformation').style.display = 'none';
  347. document.getElementById('biddingInformation').style.display = 'none';
  348. document.getElementById('releaseSupply').style.display = 'none';
  349. document.getElementById('release').style.display = 'none';
  350. if(type == 'icon-list1'){
  351. document.getElementById('userInformation').style.display = 'block';
  352. }
  353. if(type == 'icon-list2'){
  354. document.getElementById('supplyInformation').style.display = 'block';
  355. module.data.clickType = 'supply';
  356. $('#demandType').val('');
  357. $('#projectName').val('');
  358. $('#location').val('');
  359. $('#projectRealName').val('');
  360. $('#projectPhone').val('');
  361. $('#projectContent').val('');
  362. }
  363. if(type == 'icon-list3'){
  364. document.getElementById('consultingInformation').style.display = 'block';
  365. module.data.clickType = 'consulting';
  366. $('#title').val('');
  367. $('#releaseContent').val('');
  368. $('#releaseRealName').val('');
  369. $('#releasePhone').val('');
  370. }
  371. if(type == 'icon-list4'){
  372. document.getElementById('biddingInformation').style.display = 'block';
  373. module.data.clickType = 'bidding';
  374. }
  375. module.data.pageNum = 1 ;
  376. }
  377. goSupply = function(){
  378. document.getElementById('supplyInformation').style.display = "none";
  379. document.getElementById('releaseSupply').style.display = "block";
  380. document.getElementById('cupload-1').innerHTML = '';
  381. var cupload1 = new Cupload ({
  382. ele: '#cupload-1',
  383. num: 5,
  384. });
  385. }
  386. gosupplyTable = function(){
  387. document.getElementById('supplyInformation').style.display = "block";
  388. document.getElementById('releaseSupply').style.display = "none";
  389. $('#demandType').val('');
  390. $('#projectName').val('');
  391. $('#location').val('');
  392. $('#projectRealName').val('');
  393. $('#projectPhone').val('');
  394. $('#projectContent').val('');
  395. }
  396. goRelease = function(){
  397. document.getElementById('consultingInformation').style.display = "none";
  398. document.getElementById('release').style.display = "block";
  399. }
  400. goReleaseTable = function(){
  401. document.getElementById('consultingInformation').style.display = "block";
  402. document.getElementById('release').style.display = "none";
  403. $('#title').val('');
  404. $('#releaseContent').val('');
  405. $('#releaseRealName').val('');
  406. $('#releasePhone').val('');
  407. }
  408. //翻页
  409. turnThePage = function (pageNum) {
  410. module.data.pageNum = pageNum ;
  411. if(module.data.clickType == 'supply'){
  412. tools.doGet(userSupply, {memberId:module.data.memberId,pageNum:pageNum,pageSize:module.data.pageSize}, module.userSupply);
  413. }
  414. if(module.data.clickType == 'consulting'){
  415. tools.doGet(userConsulting, {memberId:module.data.memberId,pageNum:pageNum,pageSize:module.data.pageSize}, module.consulting);
  416. }
  417. if(module.data.clickType == 'bidding'){
  418. tools.doGet(userBidding, {memberId:module.data.memberId,pageNum:pageNum,pageSize:module.data.pageSize}, module.bidding);
  419. }
  420. }
  421. //个人用户资料修改
  422. formAction = function (type){
  423. var data = {};
  424. //var password = $('#password').val();
  425. module.data.userFormType = type ;
  426. if(type == 'company'){
  427. //公司用户信息
  428. var companyName = $('#companyName').val();
  429. var idCardNum = $('#idCardNum').val();
  430. var realname = $('#realname').val();
  431. var companyCode = $('#companyCode').val();
  432. var companyNature = $('#companyNature').val();
  433. var companyScope = $('#companyScope').val();
  434. var companyTimeLimit = $('#companyTimeLimit').val();
  435. var companySetupTime = $('#companySetupTime').val();
  436. var companyCapital = $('#companyCapital').val();
  437. var companyLicense = $('#companyLicense').val();
  438. var address = $('#address').val();
  439. data['companyName'] = companyName;
  440. data['idCardNum'] = idCardNum;
  441. data['realname'] = realname;
  442. data['companyCode'] = companyCode;
  443. data['companyName'] = companyName;
  444. data['companyNature'] = companyNature;
  445. data['companyScope'] = companyScope;
  446. data['companyTimeLimit'] = companyTimeLimit;
  447. data['companySetupTime'] = companySetupTime;
  448. data['companyCapital'] = companyCapital;
  449. data['companyLicense'] = companyLicense;
  450. data['address'] = address;
  451. tools.setCookie('userName',realname,24 * 60 * 60)
  452. tools.setCookie('idCardNum',idCardNum,24 * 60 * 60)
  453. tools.setCookie('address',address,24 * 60 * 60)
  454. upLoadAction('user');
  455. }
  456. if(type == 'user'){
  457. //个人用户信息
  458. var userFormRealName = $('#userFormRealName').val();
  459. var userFormIdCard = $('#userFormIdCard').val();
  460. var userFormAddress = $('#userFormAddress').val();
  461. data['idCardNum'] = userFormIdCard;
  462. data['realname'] = userFormRealName;
  463. data['address'] = userFormAddress;
  464. tools.setCookie('userName',userFormRealName,24 * 60 * 60)
  465. tools.setCookie('idCardNum',userFormIdCard,24 * 60 * 60)
  466. tools.setCookie('address',userFormAddress,24 * 60 * 60)
  467. upLoadAction('user');
  468. }
  469. if(type == 'bank'){
  470. //银行卡信息
  471. var bankCardName = $('#bankCardName').val();
  472. var bankCardNum = $('#bankCardNum').val();
  473. var bankAddress = $('#bankAddress').val();
  474. data['bankCardName'] = bankCardName;
  475. data['bankCardNum'] = bankCardNum;
  476. data['bankAddress'] = bankAddress;
  477. tools.setCookie('bankCardName',bankCardName,24 * 60 * 60)
  478. tools.setCookie('bankCardNum',bankCardNum,24 * 60 * 60)
  479. tools.setCookie('bankAddress',bankAddress,24 * 60 * 60)
  480. }
  481. //data['password'] = password;
  482. data['id'] = module.data.memberId;
  483. tools.doPut(userUpdate, data, module.Tips)
  484. }
  485. //发布供求
  486. module.supplyAction = function (){
  487. var data = {};
  488. if(module.supplyCheck()){
  489. //供求信息
  490. var demandType = $('#demandType').val();
  491. var projectName = $('#projectName').val();
  492. var location = $('#location').val();
  493. var projectRealName = $('#projectRealName').val();
  494. var projectPhone = $('#projectPhone').val();
  495. var projectContent = $('#projectContent').val();
  496. var logintime = tools.getNowFormatDate();
  497. console.log(demandType);
  498. data['projectName'] = projectName;
  499. data['location'] = location;
  500. data['realname'] = projectRealName;
  501. data['phone'] = projectPhone;
  502. data['projectContent'] = projectContent;
  503. data['logintime'] = logintime;
  504. data['supplyDemandType'] = demandType;
  505. data['deptId'] = 100;
  506. data['memberId'] = module.data.memberId;
  507. tools.doPost(userDemand, data, module.getData)
  508. }
  509. }
  510. //发布咨询
  511. module.releaseAction = function (){
  512. var data = {};
  513. if(module.releaseCheck()){
  514. //供求信息
  515. var title = $('#title').val();
  516. var releaseContent = $('#releaseContent').val();
  517. var releaseRealName = $('#releaseRealName').val();
  518. var releasePhone = $('#releasePhone').val();
  519. var logintime = tools.getNowFormatDate();
  520. data['title'] = title;
  521. data['content'] = releaseContent;
  522. data['realname'] = releaseRealName;
  523. data['phone'] = releasePhone;
  524. data['logintime'] = logintime;
  525. data['deptId'] = 100;
  526. data['memberId'] = module.data.memberId;
  527. tools.doPost(userCommunicate, data, module.releaseActionYes)
  528. }
  529. }
  530. module.releaseActionYes = function(data){
  531. tools.initError(data.msg);
  532. setTimeout(function(){
  533. tools.doGet(userConsulting, {memberId:module.data.memberId,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.consulting);
  534. document.getElementById('consultingInformation').style.display = "block";
  535. document.getElementById('release').style.display = "none";
  536. $('#title').val('');
  537. $('#releaseContent').val('');
  538. $('#releaseRealName').val('');
  539. $('#releasePhone').val('');
  540. },2000)
  541. }
  542. module.Tips = function(data){
  543. tools.initError(data.msg);
  544. }
  545. //手动验证表单
  546. module.check = function () {
  547. var usernameVal = $('#username').val();
  548. var passwordVal = $('#password').val();
  549. var codeVal = $('#code').val();
  550. /* 手机号 */
  551. if (usernameVal == '') {
  552. $('#username')[0].focus()
  553. tools.initTips('请输入用户名', 'right', $('#username')[0], 2000)
  554. return false;
  555. }
  556. /* 密码 */
  557. if (passwordVal == '') {
  558. $('#password')[0].focus()
  559. tools.initTips('请输入密码', 'right', $('#password')[0], 2000)
  560. return false;
  561. } else if (parseInt(passwordVal.length) < 6 || parseInt(passwordVal.length) > 18) {
  562. $('#password')[0].focus()
  563. tools.initTips('请输入正确格式密码', 'right', $('#password')[0], 2000)
  564. return false;
  565. }
  566. /*图形验证码*/
  567. if (module.uuid == '' || codeVal == '') {
  568. $('#code')[0].focus()
  569. tools.initTips('请输入图形验证码', 'right', $('#code')[0], 2000)
  570. return false;
  571. }
  572. return true;
  573. }
  574. module.supplyCheck = function () {
  575. var projectName = $('#projectName').val();
  576. var location = $('#location').val();
  577. var projectRealName = $('#projectRealName').val();
  578. var projectPhone = $('#projectPhone').val();
  579. var projectContent = $('#projectContent').val();
  580. if (projectName == '') {
  581. $('#projectName')[0].focus()
  582. tools.initTips('请输入项目名称', 'right', $('#projectName')[0], 2000)
  583. return false;
  584. }
  585. if (location == '') {
  586. $('#location')[0].focus()
  587. tools.initTips('请输入项目地址', 'right', $('#location')[0], 2000)
  588. return false;
  589. }
  590. if (projectRealName == '') {
  591. $('#projectRealName')[0].focus()
  592. tools.initTips('请输入姓名', 'right', $('#projectRealName')[0], 2000)
  593. return false;
  594. }
  595. if (projectPhone == '') {
  596. $('#projectPhone')[0].focus()
  597. tools.initTips('请输入联系电话', 'right', $('#projectPhone')[0], 2000)
  598. return false;
  599. }
  600. if (projectContent == '') {
  601. $('#projectContent')[0].focus()
  602. tools.initTips('请输入项目详情', 'right', $('#projectContent')[0], 2000)
  603. return false;
  604. }
  605. return true;
  606. }
  607. module.releaseCheck = function () {
  608. var title = $('#title').val();
  609. var releaseContent = $('#releaseContent').val();
  610. var releaseRealName = $('#releaseRealName').val();
  611. var releasePhone = $('#releasePhone').val();
  612. if (title == '') {
  613. $('#title')[0].focus()
  614. tools.initTips('请输入标题', 'right', $('#title')[0], 2000)
  615. return false;
  616. }
  617. if (releaseContent == '') {
  618. $('#releaseContent')[0].focus()
  619. tools.initTips('请输入咨询内容', 'right', $('#releaseContent')[0], 2000)
  620. return false;
  621. }
  622. if (releaseRealName == '') {
  623. $('#releaseRealName')[0].focus()
  624. tools.initTips('请输入姓名', 'right', $('#releaseRealName')[0], 2000)
  625. return false;
  626. }
  627. if (releasePhone == '') {
  628. $('#releasePhone')[0].focus()
  629. tools.initTips('请输入联系电话', 'right', $('#releasePhone')[0], 2000)
  630. return false;
  631. }
  632. return true;
  633. }
  634. //个人中心选项卡鼠标悬浮
  635. module.userListHover = function(){
  636. document.getElementById('icon-list1').onmouseout = function(){
  637. document.getElementById('icon1').src = '../../static/images/user_index_icon1.png'
  638. }
  639. document.getElementById('icon-list1').onmouseover = function(){
  640. document.getElementById('icon1').src = '../../static/images/user_index_icon5.png'
  641. }
  642. document.getElementById('icon-list2').onmouseout = function(){
  643. document.getElementById('icon2').src = '../../static/images/user_index_icon2.png'
  644. }
  645. document.getElementById('icon-list2').onmouseover = function(){
  646. document.getElementById('icon2').src = '../../static/images/user_index_icon6.png'
  647. }
  648. document.getElementById('icon-list3').onmouseout = function(){
  649. document.getElementById('icon3').src = '../../static/images/user_index_icon3.png'
  650. }
  651. document.getElementById('icon-list3').onmouseover = function(){
  652. document.getElementById('icon3').src = '../../static/images/user_index_icon7.png'
  653. }
  654. document.getElementById('icon-list4').onmouseout = function(){
  655. document.getElementById('icon4').src = '../../static/images/user_index_icon4.png'
  656. }
  657. document.getElementById('icon-list4').onmouseover = function(){
  658. document.getElementById('icon4').src = '../../static/images/user_index_icon8.png'
  659. }
  660. }
  661. goSearch = function () {
  662. var searchTitle = $('#searchTitle').val();
  663. var searchContent = $('#searchContent').val();
  664. console.log(searchTitle)
  665. module.data.searchType = 'YES';
  666. tools.doGet(userConsulting,{title:searchTitle,content:searchContent,memberId:module.data.memberId,pageNum:module.data.pageNum,pageSize:module.data.pageSize},module.consulting);
  667. }
  668. selectUserSupply = function(ids) {
  669. tools.doGet(deleteSupply + '/' + ids, {}, module.selectSupplyDetail);//memberType 1个人 2单位
  670. }
  671. module.selectSupplyDetail = function(data){
  672. document.getElementById('supplyInformation').style.display = "none";
  673. document.getElementById('releaseSupply').style.display = "block";
  674. var content = data.data
  675. $('#demandType').val(content.supplyDemandType);
  676. $('#projectName').val(content.projectName);
  677. $('#location').val(content.location);
  678. $('#projectRealName').val(content.realname);
  679. $('#projectPhone').val(content.phone);
  680. $('#projectContent').val(content.projectContent);
  681. tools.doGet(supplyDemandImg+'/'+content.id, {}, module.showSupplyImage);
  682. console.log(data)
  683. }
  684. goProject = function(id){
  685. tools.skip('../listingItems/itemsDetail.html?id='+id)
  686. }
  687. return module;
  688. });