From 20784fe9f62d12499a03b12eb283c83351fbb9dd Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 22 Jun 2020 13:45:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=92=8C=E5=85=AC=E4=BC=97=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editWechatAttr/editWechatAttr.html | 29 +++++ .../property/editWechatAttr/editWechatAttr.js | 95 +++++++++++++++ .../property/weChatAttr/weChatAttr.html | 10 +- .../property/weChatAttr/weChatAttr.js | 7 +- .../publicWeChatManage/publicWeChatManage.js | 4 +- .../smallWeChatManage/smallWeChatManage.html | 113 ++++++------------ .../smallWeChatManage/smallWeChatManage.js | 1 + 7 files changed, 173 insertions(+), 86 deletions(-) create mode 100644 public/components/property/editWechatAttr/editWechatAttr.html create mode 100644 public/components/property/editWechatAttr/editWechatAttr.js diff --git a/public/components/property/editWechatAttr/editWechatAttr.html b/public/components/property/editWechatAttr/editWechatAttr.html new file mode 100644 index 000000000..a0c3afae6 --- /dev/null +++ b/public/components/property/editWechatAttr/editWechatAttr.html @@ -0,0 +1,29 @@ +
\ No newline at end of file diff --git a/public/components/property/editWechatAttr/editWechatAttr.js b/public/components/property/editWechatAttr/editWechatAttr.js new file mode 100644 index 000000000..13ac4fac8 --- /dev/null +++ b/public/components/property/editWechatAttr/editWechatAttr.js @@ -0,0 +1,95 @@ +(function (vc) { + + vc.extends({ + data: { + editWechatAttrInfo: { + attrId: '', + wechatId: '', + specCdName: '', + specCd: '', + value: '' + } + }, + _initMethod: function () { + + }, + _initEvent: function () { + vc.on('editWechatAttr', 'openEditWechatAttrModal', function (_wechatAttr) { + vc.copyObject(_wechatAttr, vc.component.editWechatAttrInfo); + $('#editWechatAttrModel').modal('show'); + }); + }, + methods: { + editWechatAttrValidate() { + return vc.validate.validate({ + editWechatAttrInfo: vc.component.editWechatAttrInfo + }, { + 'editWechatAttrInfo.attrId': [ + { + limit: "required", + param: "", + errInfo: "填写错误" + } + ], + 'editWechatAttrInfo.value': [ + { + limit: "required", + param: "", + errInfo: "请填写值" + }, + { + limit: "maxLength", + param: "500", + errInfo: "长度不能超过200位" + } + ] + + }); + }, + editWechatAttrMethod: function () { + + if (!vc.component.editWechatAttrValidate()) { + vc.toast(vc.validate.errInfo); + return; + } + vc.component.editWechatAttrInfo.communityId = vc.getCurrentCommunity().communityId; + vc.http.apiPost( + 'smallWechat.updateSmallWechatAttr', + JSON.stringify(vc.component.editWechatAttrInfo), + { + emulateJSON: true + }, + function (json, res) { + let _json = JSON.parse(json); + if (_json.code == 0) { + //关闭model + $('#editWechatAttrModel').modal('hide'); + vc.emit('wechatAttrInfo', 'getWechatAttrInfo', + vc.component.editWechatAttrInfo); + vc.component.clearEditWechatAttrInfo(); + return; + } + + vc.toast(_json.msg); + + }, + function (errInfo, error) { + console.log('请求失败处理'); + + vc.component.editWechatAttrInfo.errorInfo = errInfo; + + }); + }, + clearEditWechatAttrInfo: function () { + vc.component.editWechatAttrInfo = { + attrId: '', + wechatId: '', + specCdName: '', + specCd: '', + value: '' + }; + } + } + }); + +})(window.vc); \ No newline at end of file diff --git a/public/components/property/weChatAttr/weChatAttr.html b/public/components/property/weChatAttr/weChatAttr.html index 6fd475010..f24d191bd 100644 --- a/public/components/property/weChatAttr/weChatAttr.html +++ b/public/components/property/weChatAttr/weChatAttr.html @@ -18,13 +18,13 @@ -