农燊高科官方网站
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

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