mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-27 00:20:01 +08:00
91 lines
3.5 KiB
JavaScript
91 lines
3.5 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function (vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
couponPropertyUserManageInfo: {
|
|
couponPropertyUsers: [],
|
|
total: 0,
|
|
records: 1,
|
|
moreCondition: false,
|
|
couponId: '',
|
|
conditions: {
|
|
couponId: '',
|
|
couponName: '',
|
|
validityDay: '',
|
|
userName: '',
|
|
tel: '',
|
|
toType: '',
|
|
state: '',
|
|
communityId:''
|
|
}
|
|
}
|
|
},
|
|
_initMethod: function () {
|
|
$that._listCouponPropertyUsers(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_initEvent: function () {
|
|
|
|
vc.on('couponPropertyUserManage', 'listCouponPropertyUser', function (_param) {
|
|
$that._listCouponPropertyUsers(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('pagination', 'page_event', function (_currentPage) {
|
|
$that._listCouponPropertyUsers(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
},
|
|
methods: {
|
|
_listCouponPropertyUsers: function (_page, _rows) {
|
|
|
|
$that.couponPropertyUserManageInfo.conditions.page = _page;
|
|
$that.couponPropertyUserManageInfo.conditions.row = _rows;
|
|
$that.couponPropertyUserManageInfo.conditions.communityId =vc.getCurrentCommunity().communityId;
|
|
let param = {
|
|
params: $that.couponPropertyUserManageInfo.conditions
|
|
};
|
|
|
|
//发送get请求
|
|
vc.http.apiGet('/couponProperty.listCouponPropertyUser',
|
|
param,
|
|
function (json, res) {
|
|
let _json = JSON.parse(json);
|
|
$that.couponPropertyUserManageInfo.total = _json.total;
|
|
$that.couponPropertyUserManageInfo.records = _json.records;
|
|
$that.couponPropertyUserManageInfo.couponPropertyUsers = _json.data;
|
|
vc.emit('pagination', 'init', {
|
|
total: $that.couponPropertyUserManageInfo.records,
|
|
currentPage: _page
|
|
});
|
|
}, function (errInfo, error) {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
_openAddCouponPropertyUserModal: function () {
|
|
vc.emit('addCouponPropertyUser', 'openAddCouponPropertyUserModal', {});
|
|
},
|
|
_openEditCouponPropertyUserModel: function (_couponPropertyUser) {
|
|
vc.emit('editCouponPropertyUser', 'openEditCouponPropertyUserModal', _couponPropertyUser);
|
|
},
|
|
_openDeleteCouponPropertyUserModel: function (_couponPropertyUser) {
|
|
vc.emit('deleteCouponPropertyUser', 'openDeleteCouponPropertyUserModal', _couponPropertyUser);
|
|
},
|
|
_queryCouponPropertyUserMethod: function () {
|
|
$that._listCouponPropertyUsers(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
|
|
},
|
|
_moreCondition: function () {
|
|
if ($that.couponPropertyUserManageInfo.moreCondition) {
|
|
$that.couponPropertyUserManageInfo.moreCondition = false;
|
|
} else {
|
|
$that.couponPropertyUserManageInfo.moreCondition = true;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
});
|
|
})(window.vc);
|