mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-12 10:00:56 +08:00
优化代码
This commit is contained in:
parent
9669e1a409
commit
35dbd263e2
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
入驻小区
|
入驻小区
|
||||||
**/
|
**/
|
||||||
(function (vc) {
|
(function(vc) {
|
||||||
var DEFAULT_PAGE = 1;
|
var DEFAULT_PAGE = 1;
|
||||||
var DEFAULT_ROWS = 10;
|
var DEFAULT_ROWS = 10;
|
||||||
var photoUrl = '/callComponent/download/getFile/file';
|
var photoUrl = '/callComponent/download/getFile/file';
|
||||||
@ -20,21 +20,21 @@
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_initMethod: function () {
|
_initMethod: function() {
|
||||||
// location.reload();
|
// location.reload();
|
||||||
vc.component._initDate();
|
vc.component._initDate();
|
||||||
vc.component._listApps(DEFAULT_PAGE, DEFAULT_ROWS);
|
vc.component._listApps(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||||
},
|
},
|
||||||
_initEvent: function () {
|
_initEvent: function() {
|
||||||
vc.on('appManage', 'listApp', function (_param) {
|
vc.on('appManage', 'listApp', function(_param) {
|
||||||
vc.component._listApps(DEFAULT_PAGE, DEFAULT_ROWS);
|
vc.component._listApps(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||||
});
|
});
|
||||||
vc.on('pagination', 'page_event', function (_currentPage) {
|
vc.on('pagination', 'page_event', function(_currentPage) {
|
||||||
vc.component._listApps(_currentPage, DEFAULT_ROWS);
|
vc.component._listApps(_currentPage, DEFAULT_ROWS);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
_initDate: function () {
|
_initDate: function() {
|
||||||
$(".visitStartTime").datetimepicker({
|
$(".visitStartTime").datetimepicker({
|
||||||
language: 'zh-CN',
|
language: 'zh-CN',
|
||||||
fontAwesome: 'fa',
|
fontAwesome: 'fa',
|
||||||
@ -54,12 +54,12 @@
|
|||||||
todayBtn: true
|
todayBtn: true
|
||||||
});
|
});
|
||||||
$('.visitStartTime').datetimepicker()
|
$('.visitStartTime').datetimepicker()
|
||||||
.on('changeDate', function (ev) {
|
.on('changeDate', function(ev) {
|
||||||
var value = $(".visitStartTime").val();
|
var value = $(".visitStartTime").val();
|
||||||
vc.component.appManageInfo.conditions.visitStartTime = value;
|
vc.component.appManageInfo.conditions.visitStartTime = value;
|
||||||
});
|
});
|
||||||
$('.visitEndTime').datetimepicker()
|
$('.visitEndTime').datetimepicker()
|
||||||
.on('changeDate', function (ev) {
|
.on('changeDate', function(ev) {
|
||||||
var value = $(".visitEndTime").val();
|
var value = $(".visitEndTime").val();
|
||||||
vc.component.appManageInfo.conditions.visitEndTime = value;
|
vc.component.appManageInfo.conditions.visitEndTime = value;
|
||||||
let start = Date.parse(new Date($that.appManageInfo.conditions.visitStartTime))
|
let start = Date.parse(new Date($that.appManageInfo.conditions.visitStartTime))
|
||||||
@ -82,7 +82,7 @@
|
|||||||
e.currentTarget.blur();
|
e.currentTarget.blur();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_listApps: function (_page, _rows) {
|
_listApps: function(_page, _rows) {
|
||||||
vc.component.appManageInfo.conditions.page = _page;
|
vc.component.appManageInfo.conditions.page = _page;
|
||||||
vc.component.appManageInfo.conditions.row = _rows;
|
vc.component.appManageInfo.conditions.row = _rows;
|
||||||
vc.component.appManageInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
|
vc.component.appManageInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
|
||||||
@ -94,13 +94,13 @@
|
|||||||
//发送get请求
|
//发送get请求
|
||||||
vc.http.apiGet('/visit.listVisits',
|
vc.http.apiGet('/visit.listVisits',
|
||||||
param,
|
param,
|
||||||
function (json, res) {
|
function(json, res) {
|
||||||
var _visitManageInfo = JSON.parse(json);
|
var _visitManageInfo = JSON.parse(json);
|
||||||
vc.component.appManageInfo.total = _visitManageInfo.total;
|
vc.component.appManageInfo.total = _visitManageInfo.total;
|
||||||
vc.component.appManageInfo.records = _visitManageInfo.records;
|
vc.component.appManageInfo.records = _visitManageInfo.records;
|
||||||
vc.component.appManageInfo.visits = _visitManageInfo.visits;
|
vc.component.appManageInfo.visits = _visitManageInfo.visits;
|
||||||
vc.component.appManageInfo.visits.forEach((item) => {
|
vc.component.appManageInfo.visits.forEach((item) => {
|
||||||
vc.urlToBase64(photoUrl + "?fileId=" + item.url + "&communityId=-1&time=" + new Date(), function (_base64Data) {
|
vc.urlToBase64(photoUrl + "?fileId=" + item.url + "&communityId=-1&time=" + new Date(), function(_base64Data) {
|
||||||
item.url = _base64Data;
|
item.url = _base64Data;
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -110,50 +110,50 @@
|
|||||||
currentPage: _page
|
currentPage: _page
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function (errInfo, error) {
|
function(errInfo, error) {
|
||||||
console.log('请求失败处理');
|
console.log('请求失败处理');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
//查询
|
//查询
|
||||||
_queryAppManageInfoMethod: function () {
|
_queryAppManageInfoMethod: function() {
|
||||||
vc.component._listApps(DEFAULT_PAGE, DEFAULT_ROWS);
|
vc.component._listApps(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||||
},
|
},
|
||||||
//重置
|
//重置
|
||||||
_resetAppManageInfoMethod: function () {
|
_resetAppManageInfoMethod: function() {
|
||||||
vc.component.appManageInfo.conditions.vName = "";
|
vc.component.appManageInfo.conditions.vName = "";
|
||||||
vc.component.appManageInfo.conditions.visitStartTime = "";
|
vc.component.appManageInfo.conditions.visitStartTime = "";
|
||||||
vc.component.appManageInfo.conditions.visitEndTime = "";
|
vc.component.appManageInfo.conditions.visitEndTime = "";
|
||||||
vc.component.appManageInfo.conditions.phoneNumber = "";
|
vc.component.appManageInfo.conditions.phoneNumber = "";
|
||||||
vc.component._listApps(DEFAULT_PAGE, DEFAULT_ROWS);
|
vc.component._listApps(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||||
},
|
},
|
||||||
_moreCondition: function () {
|
_moreCondition: function() {
|
||||||
if (vc.component.appManageInfo.moreCondition) {
|
if (vc.component.appManageInfo.moreCondition) {
|
||||||
vc.component.appManageInfo.moreCondition = false;
|
vc.component.appManageInfo.moreCondition = false;
|
||||||
} else {
|
} else {
|
||||||
vc.component.appManageInfo.moreCondition = true;
|
vc.component.appManageInfo.moreCondition = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_openAddVisitModal: function () {
|
_openAddVisitModal: function() {
|
||||||
vc.jumpToPage("/#/pages/property/addVisitSpace")
|
vc.jumpToPage("/#/pages/property/addVisitSpace")
|
||||||
// vc.emit('addApp','openAddAppModal',{});
|
// vc.emit('addApp','openAddAppModal',{});
|
||||||
},
|
},
|
||||||
//审核
|
//审核
|
||||||
_openExamineVisitModel: function (_app) {
|
_openExamineVisitModel: function(_app) {
|
||||||
vc.emit('examineVisit', 'openExamineVisitModel', _app);
|
vc.emit('examineVisit', 'openExamineVisitModel', _app);
|
||||||
},
|
},
|
||||||
_openEditVisitModel: function (_app) {
|
_openEditVisitModel: function(_app) {
|
||||||
vc.emit('editVisit', 'openEditVisitModel', _app);
|
vc.emit('editVisit', 'openEditVisitModel', _app);
|
||||||
// vc.emit('deleteApp','openDeleteAppModal',_app);
|
// vc.emit('deleteApp','openDeleteAppModal',_app);
|
||||||
},
|
},
|
||||||
_openDeleteAppModel: function (_app) {
|
_openDeleteAppModel: function(_app) {
|
||||||
vc.emit('deleteApp', 'openDeleteAppModel', _app);
|
vc.emit('deleteVisit', 'openVisitModel', _app);
|
||||||
},
|
},
|
||||||
showImg: function (e) {
|
showImg: function(e) {
|
||||||
if (!e) {
|
if (!e) {
|
||||||
e = '/img/noPhoto.jpg';
|
e = '/img/noPhoto.jpg';
|
||||||
}
|
}
|
||||||
vc.emit('viewImage', 'showImage', {url: e});
|
vc.emit('viewImage', 'showImage', { url: e });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user