优化前段代码

This commit is contained in:
wuxw 2024-12-27 11:03:02 +08:00
parent 4726be82ad
commit 02d314e7e9
3 changed files with 28 additions and 28 deletions

View File

@ -20,36 +20,36 @@
}
},
_initMethod: function () {
vc.component._listListPropertys(DEFAULT_PAGE, DEFAULT_ROWS);
$that._listListPropertys(DEFAULT_PAGE, DEFAULT_ROWS);
},
_initEvent: function () {
vc.on('listPropertyManage', 'listListProperty', function (_param) {
vc.component._listListPropertys(DEFAULT_PAGE, DEFAULT_ROWS);
$that._listListPropertys(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('pagination', 'page_event', function (_currentPage) {
vc.component._listListPropertys(_currentPage, DEFAULT_ROWS);
$that._listListPropertys(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_listListPropertys: function (_page, _rows) {
vc.component.listPropertyManageInfo.conditions.page = _page;
vc.component.listPropertyManageInfo.conditions.row = _rows;
var param = {
params: vc.component.listPropertyManageInfo.conditions
$that.listPropertyManageInfo.conditions.page = _page;
$that.listPropertyManageInfo.conditions.row = _rows;
let param = {
params: $that.listPropertyManageInfo.conditions
};
//发送get请求
vc.http.apiGet('/storeStaff/getPropertyStaffs',
param,
function (json, res) {
var _listPropertyManageInfo = JSON.parse(json);
vc.component.listPropertyManageInfo.total = _listPropertyManageInfo.total;
vc.component.listPropertyManageInfo.records = _listPropertyManageInfo.records;
vc.component.listPropertyManageInfo.listPropertys = _listPropertyManageInfo.data;
let _json = JSON.parse(json);
$that.listPropertyManageInfo.total = _json.total;
$that.listPropertyManageInfo.records = _json.records;
$that.listPropertyManageInfo.listPropertys = _json.data;
vc.emit('pagination', 'init', {
total: vc.component.listPropertyManageInfo.records,
dataCount: vc.component.listPropertyManageInfo.total,
total: $that.listPropertyManageInfo.records,
dataCount: $that.listPropertyManageInfo.total,
currentPage: _page
});
}, function (errInfo, error) {
@ -75,14 +75,14 @@
})
},
_queryListPropertyMethod: function () {
vc.component._listListPropertys(DEFAULT_PAGE, DEFAULT_ROWS);
$that._listListPropertys(DEFAULT_PAGE, DEFAULT_ROWS);
},
_moreCondition: function () {
if (vc.component.listPropertyManageInfo.moreCondition) {
vc.component.listPropertyManageInfo.moreCondition = false;
if ($that.listPropertyManageInfo.moreCondition) {
$that.listPropertyManageInfo.moreCondition = false;
} else {
vc.component.listPropertyManageInfo.moreCondition = true;
$that.listPropertyManageInfo.moreCondition = true;
}
}

View File

@ -46,17 +46,17 @@
_listOrders: function(_page, _rows) {
$that.orderManageInfo.conditions.page = _page;
$that.orderManageInfo.conditions.row = _rows;
var param = {
let param = {
params: $that.orderManageInfo.conditions
};
//发送get请求
vc.http.apiGet('/corders.listCorders',
param,
function(json, res) {
var _orderManageInfo = JSON.parse(json);
$that.orderManageInfo.total = _orderManageInfo.total;
$that.orderManageInfo.records = _orderManageInfo.records;
$that.orderManageInfo.orderDataVos = _orderManageInfo.data;
let _json = JSON.parse(json);
$that.orderManageInfo.total = _json.total;
$that.orderManageInfo.records = _json.records;
$that.orderManageInfo.orderDataVos = _json.data;
vc.emit('pagination', 'init', {
total: $that.orderManageInfo.records,

View File

@ -112,10 +112,10 @@
vc.http.apiGet('/storeStaff/getPropertyStaffs',
param,
function (json, res) {
var _listPropertyManageInfo = JSON.parse(json);
let _json = JSON.parse(json);
vc.emit('adminLoginProperty', 'login', {
username: _listPropertyManageInfo.data[0].staffName,
userId: _listPropertyManageInfo.data[0].staffId,
username: _json.data[0].staffName,
userId: _json.data[0].staffId,
curUserName: vc.getData('/nav/getUserInfo').name
})
},
@ -137,10 +137,10 @@
vc.http.apiGet('/storeStaff/getPropertyStaffs',
param,
function (json, res) {
var _listPropertyManageInfo = JSON.parse(json);
let _json = JSON.parse(json);
vc.emit('resetStaffPwd', 'openResetStaffPwd', {
username: _listPropertyManageInfo.data[0].staffName,
userId: _listPropertyManageInfo.data[0].staffId,
username: _json.data[0].staffName,
userId: _json.data[0].staffId,
curUserName: vc.getData('/nav/getUserInfo').name
});
},