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 @@ +| 小程序名称 | +appId | +应用密钥 | +支付密码 | +操作 | + + +||
|---|---|---|---|---|---|---|
| {{smallWeChat.name}} | +{{smallWeChat.appId}} | +{{smallWeChat.appSecret}} | +{{smallWeChat.payPassword}} | +
+
+
+
+
+
+
+ |
+
+ ||
|
+ |
+ ||||||