|
- /**
- * Created by Administrator on 2021/4/5.
- */
- define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function ($, template, Tools) {
- //数据存储
- var module = {
- data: {
- propertyList:''
- },
- };
- var tools = new Tools();
-
- module.init = function (page) {
- tools.doGet(zjdzdxxGet+getQueryVariable('id'), {translate_dict: 1}, module.assetDetail , true);
- tools.doGet(webList, {}, module.webList , true);
- // var map = new BMapGL.Map('container'); // 创建Map实例
- // map.centerAndZoom(new BMapGL.Point(116.320938,39.950026), 18); // 初始化地图,设置中心点坐标和地图级别
- // map.enableScrollWheelZoom(false); // 开启鼠标滚轮缩放
- };
-
- module.webList = function (data) {
- if (data.code == 200) {
- var content = data.rows;
- module.data.webList = content;
- var webData = template('webData', module.data);
- $("#webContent").html(webData);
- var titData = template('titData', module.data);
- $("#titContent").html(titData);
- }
- }
-
- module.assetDetail = function(data){
- if (data.code == 200) {
- var content = data.data;
- module.data.propertyDetail = content;
- tools.doGet(attachmentList, {
- tableId:content.id,
- tableName: 't_homestead_zjdzdxx',
- bizPath: 'home'
- }, module.attachmentDetail , true);
- // var propertyDetailData = template('propertyDetailData', module.data);
- // $("#propertyDetailContent").html(propertyDetailData);
- // $('#dialog').css('display','block');
- }
- }
-
- module.attachmentDetail = function(data){
- if (data.code == 200) {
- var content = data.rows;
- var attachmentList = [];
- content.map(res=>{
- if (res.fileName.indexOf('png')>-1||res.fileName.indexOf('jpg')>-1){
- attachmentList.push(res);
- }
- })
- module.data.attachment = attachmentList;
- var propertyDetailData = template('propertyDetailData', module.data);
- $("#propertyDetailContent").html(propertyDetailData);
- $('#dialog').css('display','block');
- }
- }
-
- //获取地址栏参数
- function getQueryVariable(variable){
- var query = window.location.search.substring(1);
- var vars = query.split("&");
- for (var i=0;i<vars.length;i++) {
- var pair = vars[i].split("=");
- if(pair[0] == variable){return pair[1];}
- }
- return(false);
- }
-
- return module;
- });
|