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 @@ - - {{storeAttr.specCdName}} - {{storeAttr.value}} + + {{wechatAttr.specCdName}} + {{wechatAttr.value}}
@@ -46,4 +46,6 @@ + + \ No newline at end of file diff --git a/public/components/property/weChatAttr/weChatAttr.js b/public/components/property/weChatAttr/weChatAttr.js index 1a30abace..d4f6a1330 100644 --- a/public/components/property/weChatAttr/weChatAttr.js +++ b/public/components/property/weChatAttr/weChatAttr.js @@ -28,7 +28,7 @@ _initEvent: function () { vc.on('wechatAttrInfo', 'getWechatAttrInfo', function (_param) { - $that.wechatAttrInfo.wechatId = _param.weChatId; + $that.wechatAttrInfo.wechatId = _param.wechatId; $that._listListWechatAttrs(DEFAULT_PAGE, DEFAULT_ROWS); }); }, @@ -50,9 +50,10 @@ console.log('请求失败处理'); } ); + }, + _openEditWechatAttrModel:function(_wechatAttr){ + vc.emit('editWechatAttr','openEditWechatAttrModal',_wechatAttr); } - - } }); })(window.vc); diff --git a/public/pages/property/publicWeChatManage/publicWeChatManage.js b/public/pages/property/publicWeChatManage/publicWeChatManage.js index eec6b7290..317f81613 100644 --- a/public/pages/property/publicWeChatManage/publicWeChatManage.js +++ b/public/pages/property/publicWeChatManage/publicWeChatManage.js @@ -46,7 +46,9 @@ var _smallWeChatManageInfo = JSON.parse(json); vc.component.smallWeChatManageInfo.smallWeChats = _smallWeChatManageInfo.smallWeChats; if (_smallWeChatManageInfo.smallWeChats.length > 0) { - vc.emit('wechatAttrInfo', 'getWechatAttrInfo', _smallWeChatManageInfo.smallWeChats[0]); + vc.emit('wechatAttrInfo', 'getWechatAttrInfo', { + wechatId:_smallWeChatManageInfo.smallWeChats[0].weChatId + }); } }, function (errInfo, error) { diff --git a/public/pages/property/smallWeChatManage/smallWeChatManage.html b/public/pages/property/smallWeChatManage/smallWeChatManage.html index 01d7d3a61..b1a634ecb 100644 --- a/public/pages/property/smallWeChatManage/smallWeChatManage.html +++ b/public/pages/property/smallWeChatManage/smallWeChatManage.html @@ -1,45 +1,12 @@
-
-
-
-
-
查询条件
-
- -
-
-
-
-
-
- -
-
-
-
- -
-
-
- -
-
- - -
-
-
-
-
- @@ -47,55 +14,45 @@
- +
- - - - - - - - + + + + + + + + - + - - - - - - - - - - + + + + + + + + + - - - + + +
名称APPID应用密钥支付密码商户ID描述操作
名称APPID应用密钥支付密码商户ID描述操作
{{smallWeChat.name}}{{smallWeChat.appId}}******************{{smallWeChat.mchId}}{{smallWeChat.remarks}} - - - - - -
- -
-
{{smallWeChat.name}}{{smallWeChat.appId}}******************{{smallWeChat.mchId}}{{smallWeChat.remarks}} +
+ +
+
-
    -
    +
      +
      - -
      @@ -108,4 +65,4 @@ -
      +
      \ No newline at end of file diff --git a/public/pages/property/smallWeChatManage/smallWeChatManage.js b/public/pages/property/smallWeChatManage/smallWeChatManage.js index 4850d538f..3290b6da5 100644 --- a/public/pages/property/smallWeChatManage/smallWeChatManage.js +++ b/public/pages/property/smallWeChatManage/smallWeChatManage.js @@ -37,6 +37,7 @@ vc.component.smallWeChatManageInfo.conditions.page = _page; vc.component.smallWeChatManageInfo.conditions.row = _rows; + vc.component.smallWeChatManageInfo.conditions.communityId = vc.getCurrentCommunity().communityId; var param = { params: vc.component.smallWeChatManageInfo.conditions };