diff --git a/public/components/property/addSmallWeChat/addSmallWeChat.html b/public/components/property/addSmallWeChat/addSmallWeChat.html new file mode 100644 index 000000000..98e835d19 --- /dev/null +++ b/public/components/property/addSmallWeChat/addSmallWeChat.html @@ -0,0 +1,53 @@ + diff --git a/public/components/property/addSmallWeChat/addSmallWeChat.js b/public/components/property/addSmallWeChat/addSmallWeChat.js new file mode 100644 index 000000000..9eb2ad942 --- /dev/null +++ b/public/components/property/addSmallWeChat/addSmallWeChat.js @@ -0,0 +1,136 @@ +(function (vc) { + + vc.extends({ + propTypes: { + callBackListener: vc.propTypes.string, //父组件名称 + callBackFunction: vc.propTypes.string //父组件监听方法 + }, + data: { + addSmallWeChatInfo: { + weChatId: '', + name: '', + appId: '', + appSecret: '', + payPassword: '', + + } + }, + _initMethod: function () { + + }, + _initEvent: function () { + vc.on('addSmallWeChat', 'openAddSmallWeChatModal', function () { + $('#addSmallWeChatModel').modal('show'); + }); + }, + methods: { + addSmallWeChatValidate() { + return vc.validate.validate({ + addSmallWeChatInfo: vc.component.addSmallWeChatInfo + }, { + 'addSmallWeChatInfo.name': [ + { + limit: "required", + param: "", + errInfo: "小程序名称不能为空" + }, + { + limit: "max", + param: "1,100", + errInfo: "小程序名称不能超过100位" + }, + ], + 'addSmallWeChatInfo.appId': [ + { + limit: "required", + param: "", + errInfo: "appId不能为空" + }, + { + limit: "maxin", + param: "1,100", + errInfo: "appId不能超过100位" + }, + ], + 'addSmallWeChatInfo.appSecret': [ + { + limit: "required", + param: "", + errInfo: "应用密钥不能为空" + }, + { + limit: "maxin", + param: "1,200", + errInfo: "应用密钥不能超过200个字符" + }, + ], + 'addSmallWeChatInfo.payPassword': [ + { + limit: "required", + param: "", + errInfo: "支付密码不能为空" + }, + { + limit: "maxin", + param: "1,200", + errInfo: "支付密码不能超过200个字符" + }, + ], + + + }); + }, + saveSmallWeChatInfo: function () { + if (!vc.component.addSmallWeChatValidate()) { + vc.toast(vc.validate.errInfo); + + return; + } + + vc.component.addSmallWeChatInfo.communityId = vc.getCurrentCommunity().communityId; + //不提交数据将数据 回调给侦听处理 + if (vc.notNull($props.callBackListener)) { + vc.emit($props.callBackListener, $props.callBackFunction, vc.component.addSmallWeChatInfo); + $('#addSmallWeChatModel').modal('hide'); + return; + } + + vc.http.apiPost( + 'smallWeChat.saveSmallWeChat', + JSON.stringify(vc.component.addSmallWeChatInfo), + { + emulateJSON: true + }, + function (json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + if (res.status == 200) { + //关闭model + $('#addSmallWeChatModel').modal('hide'); + vc.component.clearAddSmallWeChatInfo(); + vc.emit('smallWeChatManage', 'listSmallWeChat', {}); + + return; + } + vc.message(json); + + }, + function (errInfo, error) { + console.log('请求失败处理'); + + vc.message(errInfo); + + }); + }, + clearAddSmallWeChatInfo: function () { + vc.component.addSmallWeChatInfo = { + name: '', + appId: '', + appSecret: '', + payPassword: '', + + }; + } + } + }); + +})(window.vc); diff --git a/public/components/property/chooseSmallWeChat/chooseSmallWeChat.html b/public/components/property/chooseSmallWeChat/chooseSmallWeChat.html new file mode 100644 index 000000000..5024e5d55 --- /dev/null +++ b/public/components/property/chooseSmallWeChat/chooseSmallWeChat.html @@ -0,0 +1,62 @@ + diff --git a/public/components/property/chooseSmallWeChat/chooseSmallWeChat.js b/public/components/property/chooseSmallWeChat/chooseSmallWeChat.js new file mode 100644 index 000000000..3b61da58c --- /dev/null +++ b/public/components/property/chooseSmallWeChat/chooseSmallWeChat.js @@ -0,0 +1,63 @@ +(function(vc){ + vc.extends({ + propTypes: { + emitChooseSmallWeChat:vc.propTypes.string, + emitLoadData:vc.propTypes.string + }, + data:{ + chooseSmallWeChatInfo:{ + smallWeChats:[], + _currentSmallWeChatName:'', + } + }, + _initMethod:function(){ + }, + _initEvent:function(){ + vc.on('chooseSmallWeChat','openChooseSmallWeChatModel',function(_param){ + $('#chooseSmallWeChatModel').modal('show'); + vc.component._refreshChooseSmallWeChatInfo(); + vc.component._loadAllSmallWeChatInfo(1,10,''); + }); + }, + methods:{ + _loadAllSmallWeChatInfo:function(_page,_row,_name){ + var param = { + params:{ + page:_page, + row:_row, + communityId:vc.getCurrentCommunity().communityId, + name:_name + } + }; + + //发送get请求 + vc.http.apiGet('smallWeChat.listSmallWeChats', + param, + function(json){ + var _smallWeChatInfo = JSON.parse(json); + vc.component.chooseSmallWeChatInfo.smallWeChats = _smallWeChatInfo.smallWeChats; + },function(){ + console.log('请求失败处理'); + } + ); + }, + chooseSmallWeChat:function(_smallWeChat){ + if(_smallWeChat.hasOwnProperty('name')){ + _smallWeChat.smallWeChatName = _smallWeChat.name; + } + vc.emit($props.emitChooseSmallWeChat,'chooseSmallWeChat',_smallWeChat); + vc.emit($props.emitLoadData,'listSmallWeChatData',{ + smallWeChatId:_smallWeChat.smallWeChatId + }); + $('#chooseSmallWeChatModel').modal('hide'); + }, + querySmallWeChats:function(){ + vc.component._loadAllSmallWeChatInfo(1,10,vc.component.chooseSmallWeChatInfo._currentSmallWeChatName); + }, + _refreshChooseSmallWeChatInfo:function(){ + vc.component.chooseSmallWeChatInfo._currentSmallWeChatName = ""; + } + } + + }); +})(window.vc); diff --git a/public/components/property/deleteSmallWeChat/deleteSmallWeChat.html b/public/components/property/deleteSmallWeChat/deleteSmallWeChat.html new file mode 100644 index 000000000..3418474b7 --- /dev/null +++ b/public/components/property/deleteSmallWeChat/deleteSmallWeChat.html @@ -0,0 +1,19 @@ + diff --git a/public/components/property/deleteSmallWeChat/deleteSmallWeChat.js b/public/components/property/deleteSmallWeChat/deleteSmallWeChat.js new file mode 100644 index 000000000..017f54526 --- /dev/null +++ b/public/components/property/deleteSmallWeChat/deleteSmallWeChat.js @@ -0,0 +1,51 @@ +(function(vc,vm){ + + vc.extends({ + data:{ + deleteSmallWeChatInfo:{ + + } + }, + _initMethod:function(){ + + }, + _initEvent:function(){ + vc.on('deleteSmallWeChat','openDeleteSmallWeChatModal',function(_params){ + + vc.component.deleteSmallWeChatInfo = _params; + $('#deleteSmallWeChatModel').modal('show'); + + }); + }, + methods:{ + deleteSmallWeChat:function(){ + vc.component.deleteSmallWeChatInfo.communityId=vc.getCurrentCommunity().communityId; + vc.http.apiPost( + 'smallWeChat.deleteSmallWeChat', + JSON.stringify(vc.component.deleteSmallWeChatInfo), + { + emulateJSON:true + }, + function(json,res){ + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + if(res.status == 200){ + //关闭model + $('#deleteSmallWeChatModel').modal('hide'); + vc.emit('smallWeChatManage','listSmallWeChat',{}); + return ; + } + vc.message(json); + }, + function(errInfo,error){ + console.log('请求失败处理'); + vc.message(json); + + }); + }, + closeDeleteSmallWeChatModel:function(){ + $('#deleteSmallWeChatModel').modal('hide'); + } + } + }); + +})(window.vc,window.vc.component); diff --git a/public/components/property/editSmallWeChat/editSmallWeChat.html b/public/components/property/editSmallWeChat/editSmallWeChat.html new file mode 100644 index 000000000..0fee95120 --- /dev/null +++ b/public/components/property/editSmallWeChat/editSmallWeChat.html @@ -0,0 +1,53 @@ + diff --git a/public/components/property/editSmallWeChat/editSmallWeChat.js b/public/components/property/editSmallWeChat/editSmallWeChat.js new file mode 100644 index 000000000..89876e234 --- /dev/null +++ b/public/components/property/editSmallWeChat/editSmallWeChat.js @@ -0,0 +1,130 @@ +(function (vc, vm) { + + vc.extends({ + data: { + editSmallWeChatInfo: { + weChatId: '', + name: '', + appId: '', + appSecret: '', + payPassword: '', + createTime:'' + + } + }, + _initMethod: function () { + + }, + _initEvent: function () { + vc.on('editSmallWeChat', 'openEditSmallWeChatModal', function (_params) { + console.log("收到参数",_params); + vc.component.refreshEditSmallWeChatInfo(); + $('#editSmallWeChatModel').modal('show'); + vc.copyObject(_params, vc.component.editSmallWeChatInfo); + }); + }, + methods: { + editSmallWeChatValidate: function () { + return vc.validate.validate({ + editSmallWeChatInfo: vc.component.editSmallWeChatInfo + }, { + 'editSmallWeChatInfo.name': [ + { + limit: "required", + param: "", + errInfo: "小程序名称不能为空" + }, + { + limit: "max", + param: "1,100", + errInfo: "小程序名称不能超过100位" + }, + ], + 'editSmallWeChatInfo.appId': [ + { + limit: "required", + param: "", + errInfo: "appId不能为空" + }, + { + limit: "maxin", + param: "1,100", + errInfo: "appId不能超过100位" + }, + ], + 'editSmallWeChatInfo.appSecret': [ + { + limit: "required", + param: "", + errInfo: "应用密钥不能为空" + }, + { + limit: "maxin", + param: "1,200", + errInfo: "应用密钥不能超过200个字符" + }, + ], + 'editSmallWeChatInfo.payPassword': [ + { + limit: "required", + param: "", + errInfo: "支付密码不能为空" + }, + { + limit: "maxin", + param: "1,200", + errInfo: "支付密码不能超过200个字符" + }, + ], + 'editSmallWeChatInfo.weChatId': [ + { + limit: "required", + param: "", + errInfo: "编码不能为空" + }] + + }); + }, + editSmallWeChat: function () { + if (!vc.component.editSmallWeChatValidate()) { + vc.toast(vc.validate.errInfo); + return; + } + + vc.http.apiPost( + 'smallWeChat.updateSmallWeChat', + JSON.stringify(vc.component.editSmallWeChatInfo), + { + emulateJSON: true + }, + function (json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + if (res.status == 200) { + //关闭model + $('#editSmallWeChatModel').modal('hide'); + vc.emit('smallWeChatManage', 'listSmallWeChat', {}); + return; + } + vc.message(json); + }, + function (errInfo, error) { + console.log('请求失败处理'); + + vc.message(errInfo); + }); + }, + refreshEditSmallWeChatInfo: function () { + vc.component.editSmallWeChatInfo = { + weChatId: '', + name: '', + appId: '', + appSecret: '', + payPassword: '', + createTime:'' + + } + } + } + }); + +})(window.vc, window.vc.component); diff --git a/public/components/property/viewSmallWeChatInfo/viewSmallWeChatInfo.html b/public/components/property/viewSmallWeChatInfo/viewSmallWeChatInfo.html new file mode 100644 index 000000000..b66327fcf --- /dev/null +++ b/public/components/property/viewSmallWeChatInfo/viewSmallWeChatInfo.html @@ -0,0 +1,58 @@ +
+
+
+
+
小程序管理信息
+
+ + + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+ +
+
+
+ + + + + +
diff --git a/public/components/property/viewSmallWeChatInfo/viewSmallWeChatInfo.js b/public/components/property/viewSmallWeChatInfo/viewSmallWeChatInfo.js new file mode 100644 index 000000000..cedd5b094 --- /dev/null +++ b/public/components/property/viewSmallWeChatInfo/viewSmallWeChatInfo.js @@ -0,0 +1,51 @@ +/** + 小程序管理 组件 +**/ +(function(vc){ + + vc.extends({ + propTypes: { + callBackListener:vc.propTypes.string, //父组件名称 + callBackFunction:vc.propTypes.string //父组件监听方法 + }, + data:{ + viewSmallWeChatInfo:{ + index:0, + flowComponent:'viewSmallWeChatInfo', + name:'', +appId:'', +appSecret:'', +payPassword:'', + + } + }, + _initMethod:function(){ + //根据请求参数查询 查询 业主信息 + vc.component._loadSmallWeChatInfoData(); + }, + _initEvent:function(){ + vc.on('viewSmallWeChatInfo','chooseSmallWeChat',function(_app){ + vc.copyObject(_app, vc.component.viewSmallWeChatInfo); + vc.emit($props.callBackListener,$props.callBackFunction,vc.component.viewSmallWeChatInfo); + }); + + vc.on('viewSmallWeChatInfo', 'onIndex', function(_index){ + vc.component.viewSmallWeChatInfo.index = _index; + }); + + }, + methods:{ + + _openSelectSmallWeChatInfoModel(){ + vc.emit('chooseSmallWeChat','openChooseSmallWeChatModel',{}); + }, + _openAddSmallWeChatInfoModel(){ + vc.emit('addSmallWeChat','openAddSmallWeChatModal',{}); + }, + _loadSmallWeChatInfoData:function(){ + + } + } + }); + +})(window.vc); diff --git a/public/pages/property/smallWeChatManage/smallWeChatManage.html b/public/pages/property/smallWeChatManage/smallWeChatManage.html new file mode 100644 index 000000000..9f7e8bb95 --- /dev/null +++ b/public/pages/property/smallWeChatManage/smallWeChatManage.html @@ -0,0 +1,108 @@ +
+
+
+
+
+
查询条件
+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+ + +
+
+
+
+
+
+
+
+
小程序管理信息
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
小程序名称appId应用密钥支付密码操作
{{smallWeChat.name}}{{smallWeChat.appId}}{{smallWeChat.appSecret}}{{smallWeChat.payPassword}} +
+ +
+
+ +
+
+
    +
    + + +
    +
    +
    +
    + + + + + + + + +
    diff --git a/public/pages/property/smallWeChatManage/smallWeChatManage.js b/public/pages/property/smallWeChatManage/smallWeChatManage.js new file mode 100644 index 000000000..369328fc0 --- /dev/null +++ b/public/pages/property/smallWeChatManage/smallWeChatManage.js @@ -0,0 +1,84 @@ +/** + 入驻小区 + **/ +(function (vc) { + var DEFAULT_PAGE = 1; + var DEFAULT_ROWS = 10; + vc.extends({ + data: { + smallWeChatManageInfo: { + smallWeChats: [], + total: 0, + records: 1, + moreCondition: false, + name: '', + conditions: { + name: '', + appId: '', + + } + } + }, + _initMethod: function () { + vc.component._listSmallWeChats(DEFAULT_PAGE, DEFAULT_ROWS); + }, + _initEvent: function () { + + vc.on('smallWeChatManage', 'listSmallWeChat', function (_param) { + vc.component._listSmallWeChats(DEFAULT_PAGE, DEFAULT_ROWS); + }); + vc.on('pagination', 'page_event', function (_currentPage) { + vc.component._listSmallWeChats(_currentPage, DEFAULT_ROWS); + }); + }, + methods: { + _listSmallWeChats: function (_page, _rows) { + + vc.component.smallWeChatManageInfo.conditions.page = _page; + vc.component.smallWeChatManageInfo.conditions.row = _rows; + var param = { + params: vc.component.smallWeChatManageInfo.conditions + }; + + //发送get请求 + vc.http.apiGet('smallWeChat.listSmallWeChats', + param, + function (json, res) { + var _smallWeChatManageInfo = JSON.parse(json); + vc.component.smallWeChatManageInfo.total = _smallWeChatManageInfo.total; + vc.component.smallWeChatManageInfo.records = _smallWeChatManageInfo.records; + vc.component.smallWeChatManageInfo.smallWeChats = _smallWeChatManageInfo.smallWeChats; + vc.emit('pagination', 'init', { + total: vc.component.smallWeChatManageInfo.records, + currentPage: _page + }); + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + _openAddSmallWeChatModal: function () { + vc.emit('addSmallWeChat', 'openAddSmallWeChatModal', {}); + }, + _openEditSmallWeChatModel: function (_smallWeChat) { + vc.emit('editSmallWeChat', 'openEditSmallWeChatModal', _smallWeChat); + }, + _openDeleteSmallWeChatModel: function (_smallWeChat) { + vc.emit('deleteSmallWeChat', 'openDeleteSmallWeChatModal', _smallWeChat); + }, + _querySmallWeChatMethod: function () { + vc.component._listSmallWeChats(DEFAULT_PAGE, DEFAULT_ROWS); + + }, + _moreCondition: function () { + if (vc.component.smallWeChatManageInfo.moreCondition) { + vc.component.smallWeChatManageInfo.moreCondition = false; + } else { + vc.component.smallWeChatManageInfo.moreCondition = true; + } + } + + + } + }); +})(window.vc);