From 293991d0a461574cdef716b6fd4bcad4d237552b Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sun, 3 Jan 2021 16:15:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=B4=A6=E5=8F=B7=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adminLoginProperty.html | 32 +++++ .../adminLoginProperty/adminLoginProperty.js | 112 ++++++++++++++++++ .../updateStoreState/updateStoreState.html | 19 +++ .../updateStoreState/updateStoreState.js | 51 ++++++++ .../listPropertyManage.html | 19 ++- .../listPropertyManage/listPropertyManage.js | 16 ++- 6 files changed, 244 insertions(+), 5 deletions(-) create mode 100644 public/components/admin/adminLoginProperty/adminLoginProperty.html create mode 100644 public/components/admin/adminLoginProperty/adminLoginProperty.js create mode 100644 public/components/admin/updateStoreState/updateStoreState.html create mode 100644 public/components/admin/updateStoreState/updateStoreState.js diff --git a/public/components/admin/adminLoginProperty/adminLoginProperty.html b/public/components/admin/adminLoginProperty/adminLoginProperty.html new file mode 100644 index 000000000..acf7d3fce --- /dev/null +++ b/public/components/admin/adminLoginProperty/adminLoginProperty.html @@ -0,0 +1,32 @@ +
diff --git a/public/components/admin/adminLoginProperty/adminLoginProperty.js b/public/components/admin/adminLoginProperty/adminLoginProperty.js new file mode 100644 index 000000000..3ffaae20f --- /dev/null +++ b/public/components/admin/adminLoginProperty/adminLoginProperty.js @@ -0,0 +1,112 @@ +(function (vc) { + + vc.extends({ + data: { + adminLoginPropertyInfo: { + username: '', + userId: '', + curPasswd: '', + curUserName: '' + } + }, + _initMethod: function () { + + }, + _initEvent: function () { + vc.on('adminLoginProperty', 'login', function (_param) { + vc.copyObject(_param, $that.adminLoginPropertyInfo); + $('#adminLoginPropertyModel').modal('show'); + }); + }, + methods: { + adminLoginPropertyValidate() { + return vc.validate.validate({ + adminLoginPropertyInfo: vc.component.adminLoginPropertyInfo + }, { + 'adminLoginPropertyInfo.curPasswd': [ + { + limit: "required", + param: "", + errInfo: "当前用户密码不能为空" + } + ] + }); + }, + _adminLoginPropertySubmit: function () { + if (!vc.component.adminLoginPropertyValidate()) { + vc.toast(vc.validate.errInfo); + return; + } + + vc.http.apiPost('/adminLoginPropertyAccount', + JSON.stringify($that.adminLoginPropertyInfo), + { + emulateJSON: true + }, + function (json, res) { + $that.clearAddBasePrivilegeInfo(); + $('#adminLoginPropertyModel').modal('hide'); + let _data = JSON.parse(json); + if (_data.hasOwnProperty('code') && _data.code != '0') { + vc.toast(_data.msg); + return; + } + if (res.status == 200) { + vc.component.clearCacheData(); + vc.component._loadSysInfo(); + vc.emit('initData', 'loadCommunityInfo', { + url: '/' + }); + return; + } + }, + function (errInfo, error) { + console.log('请求失败处理'); + vc.toast(json); + }); + + }, + clearAddBasePrivilegeInfo: function () { + vc.component.adminLoginPropertyInfo = { + username: '', + userId: '', + curPasswd: '', + curUserName: '' + } + }, + clearCacheData: function () { + vc.clearCacheData(); + }, + _loadSysInfo: function () { + var param = { + params: { + sys: 'HC' + } + } + vc.http.get( + 'login', + 'getSysInfo', + param, + function (json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + if (res.status != 200) { + console.log("加载系统信息失败"); + vc.saveData("_sysInfo", { logo: 'HC' }); + vc.copyObject(json, vc.component.loginInfo); + return; + } + vc.copyObject(JSON.parse(json), vc.component.loginInfo); + //保存到浏览器 + vc.saveData("_sysInfo", JSON.parse(json)); + }, + function (errInfo, error) { + console.log('请求失败处理'); + vc.saveData("_sysInfo", { logo: 'HC' }); + vc.copyObject(json, vc.component.loginInfo); + vc.component.loginInfo.errorInfo = errInfo; + }); + }, + } + }); + +})(window.vc); diff --git a/public/components/admin/updateStoreState/updateStoreState.html b/public/components/admin/updateStoreState/updateStoreState.html new file mode 100644 index 000000000..a097201ef --- /dev/null +++ b/public/components/admin/updateStoreState/updateStoreState.html @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/public/components/admin/updateStoreState/updateStoreState.js b/public/components/admin/updateStoreState/updateStoreState.js new file mode 100644 index 000000000..cf7b32e63 --- /dev/null +++ b/public/components/admin/updateStoreState/updateStoreState.js @@ -0,0 +1,51 @@ +(function (vc) { + vc.extends({ + data: { + updateStoreStateInfo: { + storeId: '', + state: '', + stateName: '' + } + }, + _initEvent: function () { + vc.on('updateStoreState', 'open', function (_storeInfo) { + vc.copyObject(_storeInfo, $that.updateStoreStateInfo) + $('#updateStoreStateModel').modal('show'); + }); + }, + methods: { + closeDeleteStaffModel: function () { + $that.updateStoreStateInfo = { + storeId: '', + state: '', + stateName: '' + } + $('#updateStoreStateModel').modal('hide'); + }, + + _updateStoreState: function () { + + vc.http.apiPost( + '/storeApi/updateStoreState', + JSON.stringify($that.updateStoreStateInfo), + { + emulateJSON: true + }, + function (json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + + //关闭model + let _result = JSON.parse(json); + vc.toast(_result.msg); + $('#updateStoreStateModel').modal('hide'); + vc.emit('listPropertyManage', 'listListProperty',{}) + }, + function (errInfo, error) { + console.log('请求失败处理'); + + vc.component.updateStoreStateInfo.errorInfo = errInfo; + }); + } + } + }); +})(window.vc); \ No newline at end of file diff --git a/public/pages/admin/listPropertyManage/listPropertyManage.html b/public/pages/admin/listPropertyManage/listPropertyManage.html index 8fe2a5cf9..335b4a4cc 100644 --- a/public/pages/admin/listPropertyManage/listPropertyManage.html +++ b/public/pages/admin/listPropertyManage/listPropertyManage.html @@ -20,8 +20,8 @@