网站
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.
 
 
 

75 lines
2.6 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function ($, template, Tools) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. propertyList:''
  9. },
  10. };
  11. var tools = new Tools();
  12. module.init = function (page) {
  13. tools.doGet(zjdzdxxGet+getQueryVariable('id'), {translate_dict: 1}, module.assetDetail , true);
  14. tools.doGet(webList, {}, module.webList , true);
  15. // var map = new BMapGL.Map('container'); // 创建Map实例
  16. // map.centerAndZoom(new BMapGL.Point(116.320938,39.950026), 18); // 初始化地图,设置中心点坐标和地图级别
  17. // map.enableScrollWheelZoom(false); // 开启鼠标滚轮缩放
  18. };
  19. module.webList = function (data) {
  20. if (data.code == 200) {
  21. var content = data.rows;
  22. module.data.webList = content;
  23. var webData = template('webData', module.data);
  24. $("#webContent").html(webData);
  25. var titData = template('titData', module.data);
  26. $("#titContent").html(titData);
  27. }
  28. }
  29. module.assetDetail = function(data){
  30. if (data.code == 200) {
  31. var content = data.data;
  32. module.data.propertyDetail = content;
  33. tools.doGet(attachmentList, {
  34. tableId:content.id,
  35. tableName: 't_homestead_zjdzdxx',
  36. bizPath: 'home'
  37. }, module.attachmentDetail , true);
  38. // var propertyDetailData = template('propertyDetailData', module.data);
  39. // $("#propertyDetailContent").html(propertyDetailData);
  40. // $('#dialog').css('display','block');
  41. }
  42. }
  43. module.attachmentDetail = function(data){
  44. if (data.code == 200) {
  45. var content = data.rows;
  46. var attachmentList = [];
  47. content.map(res=>{
  48. if (res.fileName.indexOf('png')>-1||res.fileName.indexOf('jpg')>-1){
  49. attachmentList.push(res);
  50. }
  51. })
  52. module.data.attachment = attachmentList;
  53. var propertyDetailData = template('propertyDetailData', module.data);
  54. $("#propertyDetailContent").html(propertyDetailData);
  55. $('#dialog').css('display','block');
  56. }
  57. }
  58. //获取地址栏参数
  59. function getQueryVariable(variable){
  60. var query = window.location.search.substring(1);
  61. var vars = query.split("&");
  62. for (var i=0;i<vars.length;i++) {
  63. var pair = vars[i].split("=");
  64. if(pair[0] == variable){return pair[1];}
  65. }
  66. return(false);
  67. }
  68. return module;
  69. });