From 2ea87d61b476a2e0277e4ce55fc028cb373b06f1 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Wed, 21 Oct 2020 13:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=20=E6=8B=BC=E5=9B=A2?= =?UTF-8?q?=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editGroupBuySetting.html | 4 +- .../editGroupBuySetting.js | 9 +- .../groupBuyProductManage.html | 121 ++++++++++++++++++ .../groupBuyProductManage.js | 88 +++++++++++++ 4 files changed, 219 insertions(+), 3 deletions(-) create mode 100644 public/pages/goods/groupBuyProductManage/groupBuyProductManage.html create mode 100644 public/pages/goods/groupBuyProductManage/groupBuyProductManage.js diff --git a/public/components/goods/editGroupBuySetting/editGroupBuySetting.html b/public/components/goods/editGroupBuySetting/editGroupBuySetting.html index bfac339a1..4f4ab9f4c 100644 --- a/public/components/goods/editGroupBuySetting/editGroupBuySetting.html +++ b/public/components/goods/editGroupBuySetting/editGroupBuySetting.html @@ -32,14 +32,14 @@
+ class="form-control editStartTime">
+ class="form-control editEndTime">
diff --git a/public/components/goods/editGroupBuySetting/editGroupBuySetting.js b/public/components/goods/editGroupBuySetting/editGroupBuySetting.js index 85d012752..2947de4b7 100644 --- a/public/components/goods/editGroupBuySetting/editGroupBuySetting.js +++ b/public/components/goods/editGroupBuySetting/editGroupBuySetting.js @@ -12,6 +12,13 @@ } }, _initMethod: function () { + vc.initDateTime('editStartTime', function (_value) { + $that.editGroupBuySettingInfo.startTime = _value; + }); + + vc.initDateTime('editEndTime', function (_value) { + $that.editGroupBuySettingInfo.endTime = _value; + }); }, _initEvent: function () { @@ -103,7 +110,7 @@ } vc.http.apiPost( - 'groupBuySetting.updateGroupBuySetting', + '/groupBuy/updateGroupBuySetting', JSON.stringify(vc.component.editGroupBuySettingInfo), { emulateJSON: true diff --git a/public/pages/goods/groupBuyProductManage/groupBuyProductManage.html b/public/pages/goods/groupBuyProductManage/groupBuyProductManage.html new file mode 100644 index 000000000..d928712db --- /dev/null +++ b/public/pages/goods/groupBuyProductManage/groupBuyProductManage.html @@ -0,0 +1,121 @@ +
+
+
+
+
+
查询条件
+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+ + +
+
+
+
+
+
+
+
+
拼团商品
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
商品ID商品图片拼团名称拼团人数库存参与人数排序状态操作
{{product.productId}} + + {{product.groupProdName}}{{product.userCount}}{{product.stock}}{{product.groupBuyCount}}{{product.sort}}{{product.stateName}} +
+ +
+
+ +
+
+
    +
    + + +
    +
    +
    +
    + +
    + +
    +
    + +
    + + + +
    \ No newline at end of file diff --git a/public/pages/goods/groupBuyProductManage/groupBuyProductManage.js b/public/pages/goods/groupBuyProductManage/groupBuyProductManage.js new file mode 100644 index 000000000..82b4cbb73 --- /dev/null +++ b/public/pages/goods/groupBuyProductManage/groupBuyProductManage.js @@ -0,0 +1,88 @@ +/** + 入驻小区 +**/ +(function (vc) { + var DEFAULT_PAGE = 1; + var DEFAULT_ROWS = 10; + vc.extends({ + data: { + groupBuyProductManageInfo: { + products: [], + total: 0, + records: 1, + moreCondition: false, + productId: '', + componentShow:'groupBuyProductManage', + conditions: { + prodName: '', + keyword: '', + barCode: '', + } + } + }, + _initMethod: function () { + vc.component._listProducts(DEFAULT_PAGE, DEFAULT_ROWS); + }, + _initEvent: function () { + + vc.on('groupBuyProductManage', 'listProduct', function (_param) { + $that.groupBuyProductManageInfo.componentShow = 'groupBuyProductManage'; + vc.component._listProducts(DEFAULT_PAGE, DEFAULT_ROWS); + }); + vc.on('pagination', 'page_event', function (_currentPage) { + vc.component._listProducts(_currentPage, DEFAULT_ROWS); + }); + }, + methods: { + _listProducts: function (_page, _rows) { + + vc.component.groupBuyProductManageInfo.conditions.page = _page; + vc.component.groupBuyProductManageInfo.conditions.row = _rows; + var param = { + params: vc.component.groupBuyProductManageInfo.conditions + }; + + //发送get请求 + vc.http.apiGet('/groupBuy/queryGroupBuyProduct', + param, + function (json, res) { + var _groupBuyProductManageInfo = JSON.parse(json); + vc.component.groupBuyProductManageInfo.total = _groupBuyProductManageInfo.total; + vc.component.groupBuyProductManageInfo.records = _groupBuyProductManageInfo.records; + vc.component.groupBuyProductManageInfo.products = _groupBuyProductManageInfo.data; + vc.emit('pagination', 'init', { + total: vc.component.groupBuyProductManageInfo.records, + currentPage: _page + }); + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + _openAddProductModal: function () { + //vc.emit('addProduct', 'openAddProductModal', {}); + $that.groupBuyProductManageInfo.componentShow = 'addProduct'; + }, + _openEditProductModel: function (_product) { + $that.groupBuyProductManageInfo.componentShow = 'editProduct'; + vc.emit('editProduct', 'openEditProductModal', _product); + }, + _openDeleteProductModel: function (_product) { + vc.emit('deleteProduct', 'openDeleteProductModal', _product); + }, + _queryProductMethod: function () { + vc.component._listProducts(DEFAULT_PAGE, DEFAULT_ROWS); + + }, + _moreCondition: function () { + if (vc.component.groupBuyProductManageInfo.moreCondition) { + vc.component.groupBuyProductManageInfo.moreCondition = false; + } else { + vc.component.groupBuyProductManageInfo.moreCondition = true; + } + } + + + } + }); +})(window.vc);