diff --git a/docs/shopping_cart_list.json b/docs/shopping_cart_list.json new file mode 100644 index 0000000000000000000000000000000000000000..47fcbc17694c5737d615d0623ccf755b35f047bc --- /dev/null +++ b/docs/shopping_cart_list.json @@ -0,0 +1,41 @@ +{ + "data": { + "list": [ + { + "id": 0, + "name": "水路货物周转量情况", + "type": "基础数据服务", + "creator": "贵州省交通运输厅0", + "state": 1, + "mapService": 1, + "num": 2, + "checkedSubscription": false, + "specification": 1, + "specificationApplication": 2 + }, + { + "id": 1, + "name": "水路货物周转量情况水路货物周水路货物周转量情况水路货物周", + "type": "基础数据服务", + "creator": "贵州省交通运输厅1", + "state": 1, + "num": 2, + "checkedSubscription": false, + "specification": 1, + "specificationApplication": 2 + }, + { + "id": 2, + "name": "水路货物周转量情况水路货物周转量情况", + "type": "基础数据服务", + "creator": "贵州省交通运输厅2", + "state": 1, + "mapService": 1, + "num": 2, + "checkedSubscription": true, + "specification": 1, + "specificationApplication": 2 + } + ] + } +} \ No newline at end of file diff --git a/src/components/commodity-cell.vue b/src/components/commodity-cell.vue index 52587233d3c1964a9a15e7551311c48ae029ce8d..d7b56054f256e1886b3eb7d12e7cfb2124dfc191 100644 --- a/src/components/commodity-cell.vue +++ b/src/components/commodity-cell.vue @@ -150,7 +150,7 @@ export default { font-size: 12px; font-weight: 500; line-height: 12px; - border-radius: 15px; + border-radius: 4px; position: relative; top: -2px; } diff --git a/src/components/menu.vue b/src/components/menu.vue index 0c7d2f4c64ade37648aa692d70dfa74387e944d3..75d88779531fa4b2ab77f2cd8d8c50fef1fda33a 100644 --- a/src/components/menu.vue +++ b/src/components/menu.vue @@ -1,140 +1,307 @@ \ No newline at end of file diff --git a/src/components/shopping-cart/shopping-cart-cell.vue b/src/components/shopping-cart/shopping-cart-cell.vue index 3a0eaa6cfccb8fd985093ca4baf7522a4dcee0ff..703d5a95f0f3fddcb97c1d04f4646a5d8f6b4c2e 100644 --- a/src/components/shopping-cart/shopping-cart-cell.vue +++ b/src/components/shopping-cart/shopping-cart-cell.vue @@ -15,18 +15,18 @@ />
- {{ cellItem.name }} + {{ cellItems.name }} mapService - 共享 - 受限 + 共享 + 受限 敏感
-
{{ cellItem.type }}
-
{{ cellItem.creator }}
+
{{ cellItems.type }}
+
{{ cellItems.creator }}
@@ -34,10 +34,19 @@
-
规格:{{ specificationBtns[specification] }}
-
申请方式:{{ specificationApplicationBtns[specificationApplication] }}
+
规格:{{ specificationBtns[cellItems.specification] }}
+
申请方式:{{ specificationApplicationBtns[cellItems.specificationApplication] }}
- +
规格:
@@ -56,7 +65,7 @@ :key="'specification' + index" :class="specificationApplicationPop == index ? 'shopping_cell_specification_btn active' : 'shopping_cell_specification_btn'" size="mini" - @click="changeSpecificationApplication(index)" + @click="changeSpecificationApplication(index)" >{{ item }}购买
@@ -82,12 +91,22 @@
- + - 订阅该服务 + 订阅该服务
- 删除 + 删除
@@ -112,16 +131,20 @@ export default { watch: { cellCheck: function(val) { this.checkedItem = val; + }, + cellItem: { + immediate: true, // 这句重要 + handler(val) { + this.cellItems = val; + } } }, data: () => ({ + cellItems: {}, checkedItem: false, - numItem: 1, specificationEdit: require("../../assets/imgs/ic_edit.png"), checkedSubscription: false, visible: false, - specification: 1, - specificationApplication: 0, specificationPop: 1, specificationApplicationPop: 0, specificationBtns: [ @@ -143,13 +166,32 @@ export default { this.specificationApplicationPop = val; }, submitPop() { - this.specification = this.specificationPop; - this.specificationApplication = this.specificationApplicationPop; + this.cellItems.specification = this.specificationPop; + this.cellItems.specificationApplication = this.specificationApplicationPop; this.visible = false; + this.changeCellItem(); }, setSpecificationPop() { - this.specificationPop = this.specification; - this.specificationApplicationPop = this.specificationApplication; + this.specificationPop = this.cellItems.specification; + this.specificationApplicationPop = this.cellItems.specificationApplication; + }, + changeSubscription(val) { + this.changeCellItem(); + }, + changeNum(val) { + this.changeCellItem(); + }, + changeCellItem() { + this.$emit("changeCellMsg", { + index: this.cellIndex, + data: this.cellItems + }); + }, + delCellItem() { + this.$emit("deleteItem", { + index: this.cellIndex, + data: this.cellItems + }); } }, mounted() {} @@ -229,7 +271,7 @@ export default { font-size: 12px; font-weight: 500; line-height: 12px; - border-radius: 15px; + border-radius: 4px; position: relative; top: -2px; } diff --git a/src/components/shopping-cart/shopping-cart-com.vue b/src/components/shopping-cart/shopping-cart-com.vue index f931e9ef8cb670f62fa13a4fb0c87ac4e06e74eb..de27abb870c038b84cf481ba249dbfd467039861 100644 --- a/src/components/shopping-cart/shopping-cart-com.vue +++ b/src/components/shopping-cart/shopping-cart-com.vue @@ -8,7 +8,7 @@ 服务信息 规格 - 数量 + 购买时长 操作
@@ -19,6 +19,8 @@ :checkList="checkList" :readOnly="false" @changeState="changeState" + @changeCellMsg="changeCellMsg" + @deleteItem="deleteItem" class="shopping_all_list" />
@@ -45,8 +47,12 @@ {{ getNum }}
- 一键申请 - 一键申请 + 一键申请 + 一键申请 @@ -71,14 +77,22 @@ export default { type: "基础数据服务", creator: "贵州省交通运输厅0", state: 1, - mapService: 1 + mapService: 1, + num: 2, + checkedSubscription: false, + specification: 1, + specificationApplication: 2 }, { id: 1, name: "水路货物周转量情况水路货物周水路货物周转量情况水路货物周", type: "基础数据服务", creator: "贵州省交通运输厅1", - state: 1 + state: 1, + num: 2, + checkedSubscription: false, + specification: 1, + specificationApplication: 2 }, { id: 2, @@ -86,7 +100,11 @@ export default { type: "基础数据服务", creator: "贵州省交通运输厅2", state: 1, - mapService: 1 + mapService: 1, + num: 2, + checkedSubscription: true, + specification: 1, + specificationApplication: 2 } ] }), @@ -119,6 +137,19 @@ export default { console.log(this.list[index]); } }); + }, + changeCellMsg(val) { + console.log(val); + }, + deleteItem(val) { + console.log(val); + }, + oneClickApplication() { + this.checkList.forEach((item, index) => { + if (item === true) { + console.log(this.list[index]); + } + }); } } }; @@ -194,7 +225,7 @@ export default { .shopping_all_head { background-color: #e5f0ff; height: 48px; - padding: 0 20px; + padding: 0; font-weight: 700; line-height: 48px; } diff --git a/src/components/shopping-cart/shopping-cart-list.vue b/src/components/shopping-cart/shopping-cart-list.vue index c99d996752a457d1dea271610e005e483aeb1da1..9485f9ee92e0d41a5fb9ccdf72ab3bf9d1d67852 100644 --- a/src/components/shopping-cart/shopping-cart-list.vue +++ b/src/components/shopping-cart/shopping-cart-list.vue @@ -9,6 +9,8 @@ :key="item.id" :readOnly="readOnly" @changeState="changeState" + @changeCellMsg="changeCellMsg" + @deleteItem="deleteItem" /> @@ -58,6 +60,12 @@ export default { for (let i = 0; i < this.checkLists.length; i++) { this.$set(this.checkLists, i, val) } + }, + changeCellMsg(val) { + this.$emit("changeCellMsg", val) + }, + deleteItem(val) { + this.$emit("deleteItem", val) } } };