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