From 4287732f44895bd17fe25e2b3f570e9695738a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=88=90?= <121184950@qq.com> Date: Sat, 25 Apr 2020 23:10:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E4=BF=AE=E6=94=B9=E4=B8=8A?= =?UTF-8?q?=E5=95=86=E6=88=B7=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editStoreInfo/editStoreInfo.html | 66 ++++++++ .../components/editStoreInfo/editStoreInfo.js | 150 ++++++++++++++++++ .../storeInfoManage/storeInfoManage.html | 110 +++++++++++++ .../storeInfoManage/storeInfoManage.js | 72 +++++++++ 4 files changed, 398 insertions(+) create mode 100644 public/components/editStoreInfo/editStoreInfo.html create mode 100644 public/components/editStoreInfo/editStoreInfo.js create mode 100644 public/components/storeInfoManage/storeInfoManage.html create mode 100644 public/components/storeInfoManage/storeInfoManage.js diff --git a/public/components/editStoreInfo/editStoreInfo.html b/public/components/editStoreInfo/editStoreInfo.html new file mode 100644 index 000000000..3d1f302b4 --- /dev/null +++ b/public/components/editStoreInfo/editStoreInfo.html @@ -0,0 +1,66 @@ +
diff --git a/public/components/editStoreInfo/editStoreInfo.js b/public/components/editStoreInfo/editStoreInfo.js new file mode 100644 index 000000000..0fa5cf3a9 --- /dev/null +++ b/public/components/editStoreInfo/editStoreInfo.js @@ -0,0 +1,150 @@ +(function (vc, vm) { + vc.extends({ + data: { + editStoreInfo: { + storeId:'', + name:'', + address:'', + tel:'', + nearByLandmarks:'', + mapX:'', + mapY:'', + } + }, + _initMethod: function () { + + }, + _initEvent: function () { + + vc.on("editStoreInfo", "openEditStoreModal", function (_param) { + vc.component.clearEditStoreInfo(); + vc.component.refreshEditStoreInfo(_param); + $('#editStoreModel').modal('show'); + }); + + }, + methods: { + refreshEditStoreInfo(_storeInfo){ + _storeInfo = _storeInfo._storeInfo; + vc.component.editStoreInfo.storeId = _storeInfo.storeId; + vc.component.editStoreInfo.name = _storeInfo.name; + vc.component.editStoreInfo.address = _storeInfo.address; + vc.component.editStoreInfo.tel = _storeInfo.tel; + vc.component.editStoreInfo.nearByLandmarks = _storeInfo.nearByLandmarks; + vc.component.editStoreInfo.mapX = _storeInfo.mapX; + vc.component.editStoreInfo.mapY = _storeInfo.mapY; + }, + clearEditStoreInfo(){ + vc.component.editStoreInfo= { + storeId:'', + name:'', + address:'', + tel:'', + nearByLandmarks:'', + mapX:'', + mapY:'', + } + }, + editStoreValidate: function () { + return vc.validate.validate({ + editStoreInfo: vc.component.editStoreInfo + }, { + 'editStoreInfo.name': [ + { + limit: "required", + param: "", + errInfo: "商户名称必填" + }, + { + limit: "maxLength", + param: "100", + errInfo: "商户名称不能超过100位" + }, + ], + 'editStoreInfo.address': [ + { + limit: "required", + param: "", + errInfo: "商户地址必填" + }, + { + limit: "maxLength", + param: "200", + errInfo: "商户地址不能超过200位" + } + ], + 'editStoreInfo.tel': [ + { + limit: "required", + param: "", + errInfo: "联系电话必填" + }, + { + limit: "maxLength", + param: "11", + errInfo: "联系电话最多11位" + } + ], + 'editStoreInfo.nearByLandmarks': [ + { + limit: "required", + param: "", + errInfo: "附件地标必填" + }, + { + limit: "maxLength", + param: "200", + errInfo: "附件地标位置最多200位" + } + ] + }); + }, + submitEditStoreInfo:function () { + if (!vc.component.editStoreValidate()) { + vc.toast(vc.validate.errInfo); + return; + } + + + // vc.http.post( + // 'editStore', + // 'update', + // JSON.stringify(vc.component.editStoreInfo), + // { + // emulateJSON: true + // }, + // function (json, res) { + // if (res.status == 200) { + // $('#editStoreModel').modal('hide'); + // vc.emit('storeInfoManage', 'getStoreInfo', {}); + // return; + // } + // vc.toast(json); + // }, + // function (errInfo, error) { + // console.log('请求失败处理'); + // + // vc.toast(errInfo); + // }); + + + // var param = { + // params: vc.component.editStoreInfo + // }; + vc.http.apiPost('update.store.info', + JSON.stringify(vc.component.editStoreInfo), + function (json, res) { + }, function (bodyText, res) { + if (res.status == 200) { + $('#editStoreModel').modal('hide'); + vc.emit('storeInfoManage', 'getStoreInfo', {}); + return; + } + vc.toast(bodyText); + } + ); + } + } + }); + +})(window.vc, window.vc.component); diff --git a/public/components/storeInfoManage/storeInfoManage.html b/public/components/storeInfoManage/storeInfoManage.html new file mode 100644 index 000000000..9d282fc91 --- /dev/null +++ b/public/components/storeInfoManage/storeInfoManage.html @@ -0,0 +1,110 @@ +| 商户名称 | +商户地址 | +联系电话 | +商户类型 | +企业法人 | +附近地标 | +操作 | +
|---|---|---|---|---|---|---|
| {{listStore.name}} | +{{listStore.address}} | +{{listStore.tel}} | +{{listStore.storeTypeName}} | +{{listStore.artificialPerson}} | +{{listStore.nearByLandmarks}} | +
+
+
+
+ |
+
|
+ |
+ ||||||
| 企业法人 | +注册资本 | +成立日期 | +经营范围 | +登记机关 | +操作 | +|
|---|---|---|---|---|---|---|
| {{listStore.A}} | +{{listStore.V}} | +{{listStore.A}} | +{{listStore.A}} | +{{listStore.A}} | +
+
+
+
+ |
+ |
|
+ |
+ ||||||