网站
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

demandDetail.js 2.3 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "demandApi", "paging","user"], function ($, template, Tools ) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //公告列表
  9. demandInformationList:'',
  10. //鉴证列表
  11. supplyInformationList:'',
  12. //页码
  13. pageNum: 1,
  14. //页码集合
  15. pageList: [],
  16. //每页数量
  17. pageSize: 50,
  18. //总页数
  19. pageCount:0,
  20. //选中卡ID
  21. clickType:'supply',
  22. //供求类型 1:供应 2:求购 (不传值获取两种类型混合数据)
  23. demandType:1
  24. },
  25. };
  26. var tools = new Tools();
  27. module.init = function (page) {
  28. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  29. tools.getWebConfig();
  30. tools.doGet(userDemandUpdate+'/'+getQueryVariable('id'), {}, module.demandDetail,true);
  31. };
  32. //获取地址栏参数
  33. function getQueryVariable(variable){
  34. var query = window.location.search.substring(1);
  35. var vars = query.split("&");
  36. for (var i=0;i<vars.length;i++) {
  37. var pair = vars[i].split("=");
  38. if(pair[0] == variable){return pair[1];}
  39. }
  40. return(false);
  41. }
  42. //个人中心用户信息
  43. module.demandDetail = function(data){
  44. if (data.code == 200) {
  45. var content = data.data;
  46. console.log(content)
  47. module.data.demandInformationDetail = content;
  48. tools.doGet(demandImageList+'/'+getQueryVariable('id'), {}, module.demandImageDetail,true);
  49. }
  50. }
  51. module.demandImageDetail = function(data){
  52. console.log(data)
  53. if (data.code == 200){
  54. var content = data.data;
  55. var fileUrlList = [];
  56. for (var i = 0 ; i < content.length ; i++){
  57. fileUrlList[i] = serverApi+content[i].fileUrl;
  58. }
  59. module.data.demandInformationDetail.fileUrlList = fileUrlList;
  60. var demandInformationData = template('demandInformationData', module.data);
  61. $("#demandInformationContent").html(demandInformationData);
  62. $("#projectContent").html(module.data.demandInformationDetail.projectContent);
  63. }
  64. }
  65. return module;
  66. });