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}} +
    + +
    +
    +
      +
      +
      +
      +
      +
      + +
      diff --git a/public/components/storeInfoManage/storeInfoManage.js b/public/components/storeInfoManage/storeInfoManage.js new file mode 100644 index 000000000..5d0048bc9 --- /dev/null +++ b/public/components/storeInfoManage/storeInfoManage.js @@ -0,0 +1,72 @@ +(function (vc) { + var DEFAULT_PAGE = 1; + var DEFAULT_ROWS = 10; + vc.extends({ + data: { + listStoreManageInfo: { + listStores: [], + total: 0, + records: 1, + moreCondition: false, + conditions: { + name: '', + storeTypeCd: '', + tel: '' + } + } + }, + _initMethod: function () { + vc.component._listListStores(DEFAULT_PAGE, DEFAULT_ROWS); + }, + _initEvent: function () { + + vc.on('storeInfoManage', 'getStoreInfo', function (_param) { + vc.component._listListStores(DEFAULT_PAGE, DEFAULT_ROWS); + }); + }, + methods: { + _listListStores: function (_page, _rows) { + vc.component.listStoreManageInfo.conditions.page = _page; + vc.component.listStoreManageInfo.conditions.row = _rows; + var param = { + params: vc.component.listStoreManageInfo.conditions + }; + + //发送get请求 + vc.http.get('listStoreManage', + 'getStoreInfo', + param, + function (json, res) { + var _listStoreManageInfo = JSON.parse(json); + vc.component.listStoreManageInfo.listStores = _listStoreManageInfo.stores; + vc.emit('pagination', 'init', { + total: vc.component.listStoreManageInfo.records, + currentPage: _page + }); + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + _queryListStoreMethod: function () { + vc.component._listListStores(DEFAULT_PAGE, DEFAULT_ROWS); + + }, + _openEditStoreInfoModel(_storeInfo){ + vc.emit('editStoreInfo', 'openEditStoreModal', {_storeInfo}); + }, + _moreCondition: function () { + if (vc.component.listStoreManageInfo.moreCondition) { + vc.component.listStoreManageInfo.moreCondition = false; + } else { + vc.component.listStoreManageInfo.moreCondition = true; + } + }, + _openStoresAttributeModel(){ + + } + + + } + }); +})(window.vc);