81 lines
2.9 KiB
JavaScript
81 lines
2.9 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function(vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
merchantManageInfo: {
|
|
merchants: [],
|
|
total: 0,
|
|
records: 1,
|
|
moreCondition: false,
|
|
storeId: '',
|
|
conditions: {
|
|
storeId: '',
|
|
name: '',
|
|
tel: '',
|
|
mallApiCode: 'queryMerchantBmoImpl'
|
|
}
|
|
}
|
|
},
|
|
_initMethod: function() {
|
|
$that._listMerchants(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
_initEvent: function() {
|
|
vc.on('merchantManage', 'listMerchant', function(_param) {
|
|
$that._listMerchants(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('pagination', 'page_event', function(_currentPage) {
|
|
$that._listMerchants(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
},
|
|
methods: {
|
|
_listMerchants: function(_page, _rows) {
|
|
$that.merchantManageInfo.conditions.page = _page;
|
|
$that.merchantManageInfo.conditions.row = _rows;
|
|
let param = {
|
|
params: $that.merchantManageInfo.conditions
|
|
};
|
|
param.params.storeId = param.params.storeId.trim();
|
|
param.params.name = param.params.name.trim();
|
|
param.params.tel = param.params.tel.trim();
|
|
//发送get请求
|
|
vc.http.apiGet('/mall.getAdminMallOpenApi',
|
|
param,
|
|
function(json, res) {
|
|
let _json = JSON.parse(json);
|
|
$that.merchantManageInfo.total = _json.total;
|
|
$that.merchantManageInfo.records = _json.records;
|
|
$that.merchantManageInfo.merchants = _json.data;
|
|
vc.emit('pagination', 'init', {
|
|
total: $that.merchantManageInfo.records,
|
|
dataCount: $that.merchantManageInfo.total,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function(errInfo, error) {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
_toMerchantModal: function() {
|
|
vc.jumpToMall('/#/pages/admin/merchantManage')
|
|
},
|
|
|
|
//查询
|
|
_queryMerchantMethod: function() {
|
|
$that._listMerchants(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
|
|
_moreCondition: function() {
|
|
if ($that.merchantManageInfo.moreCondition) {
|
|
$that.merchantManageInfo.moreCondition = false;
|
|
} else {
|
|
$that.merchantManageInfo.moreCondition = true;
|
|
}
|
|
},
|
|
}
|
|
});
|
|
})(window.vc); |