You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
5.0 KiB
1 line
5.0 KiB
{"remainingRequest":"/Users/linhuakun/Downloads/coderlhk/big bar/bigbar-start/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/linhuakun/Downloads/coderlhk/big bar/bigbar-start/src/views/cart/childComps/CartBottomBar.vue?vue&type=style&index=0&id=5cd8f4a6&scoped=true&lang=css&","dependencies":[{"path":"/Users/linhuakun/Downloads/coderlhk/big bar/bigbar-start/src/views/cart/childComps/CartBottomBar.vue","mtime":1618625496516},{"path":"/Users/linhuakun/Downloads/coderlhk/big bar/bigbar-start/node_modules/css-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/linhuakun/Downloads/coderlhk/big bar/bigbar-start/node_modules/vue-loader/lib/loaders/stylePostLoader.js","mtime":499162500000},{"path":"/Users/linhuakun/Downloads/coderlhk/big bar/bigbar-start/node_modules/postcss-loader/src/index.js","mtime":499162500000},{"path":"/Users/linhuakun/Downloads/coderlhk/big bar/bigbar-start/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/linhuakun/Downloads/coderlhk/big bar/bigbar-start/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgouYm90dG9tLW1lbnUgewogIHdpZHRoOiAxMDAlOwogIGhlaWdodDogNDRweDsKICBiYWNrZ3JvdW5kLWNvbG9yOiAjZWVlOwogIHBvc2l0aW9uOiBmaXhlZDsKICBib3R0b206IDUwcHg7CiAgbGVmdDogMDsKICBib3gtc2hhZG93OiAwIC0ycHggM3B4IHJnYmEoMCwgMCwgMCwgLjIpOwogIGZvbnQtc2l6ZTogMTRweDsKICBjb2xvcjogIzg4ODsKICBsaW5lLWhlaWdodDogNDRweDsKICBwYWRkaW5nLWxlZnQ6IDM1cHg7CiAgYm94LXNpemluZzogYm9yZGVyLWJveDsKICB6LWluZGV4OiA5OTk5OTkgOwp9CgouYm90dG9tLW1lbnUgLnNlbGVjdC1hbGwgewogIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICBsaW5lLWhlaWdodDogMDsKICBsZWZ0OiAtOTk5OTk5OTk5OTlweDsKICB0b3A6IDEzcHg7Cn0KCi5ib3R0b20tbWVudSAudG90YWwtcHJpY2UgewogIG1hcmdpbi1sZWZ0OiAtMjBweDsKICBmb250LXNpemU6IDE2cHg7CiAgY29sb3I6ICM2NjY7Cn0KCi5ib3R0b20tbWVudSAuYnV5LXByb2R1Y3QgewogIGJhY2tncm91bmQtY29sb3I6IG9yYW5nZXJlZDsKICBjb2xvcjogI2ZmZjsKICB3aWR0aDogMTAwcHg7CiAgaGVpZ2h0OiA0NHB4OwogIHRleHQtYWxpZ246IGNlbnRlcjsKICBsaW5lLWhlaWdodDogNDRweDsKICBmbG9hdDogcmlnaHQ7Cn0K"},{"version":3,"sources":["CartBottomBar.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"CartBottomBar.vue","sourceRoot":"src/views/cart/childComps","sourcesContent":["<template>\n <div class=\"bottom-menu\">\n <CheckButton class=\"select-all\" @checkBtnClick=\"checkBtnClick\" v-model=\"isSelectAll\"></CheckButton>\n\n <span class=\"total-price\">合计: {{totalPrice}}</span>\n\n <span class=\"buy-product\" @click=\"btnclick\" >去计算({{$store.getters.cartLength}})</span>\n </div>\n</template>\n\n<script>\n import CheckButton from './CheckButton'\n import {mapGetters} from 'vuex'\n\n\texport default {\n\t\tname: \"BottomBar\",\n components: {\n\t\t CheckButton\n },\n computed: {\n\t\t ...mapGetters(['cartList']),\n\t\t totalPrice(){\n\t\t return '¥'+this.cartList.filter(item=>{\n\t\t return item.checked\n }).reduce((preValue,item)=>{\n return preValue+item.price*item.count\n },0).toFixed(2)\n },\n checkLength(){\n\t\t return !this.cartList.filter(item=>item.checked).length\n },\n isSelectAll () {\n\t\t if(this.cartList.length === 0)\n\t\t return false\n return !this.cartList.find(item=>!item.checked)\n }\n },\n methods: {\n checkBtnClick: function () {\n // 1.判断是否有未选中的按钮\n let isSelectAll = this.$store.getters.cartList.find(item => !item.checked);\n\n // 2.有未选中的内容, 则全部选中\n if (isSelectAll) {\n this.$store.state.cartList.forEach(item => {\n item.checked = true;\n });\n } else {\n this.$store.state.cartList.forEach(item => {\n item.checked = false;\n });\n }\n },\n btnclick(){\n if(!this.isSelectAll){\n this.$toast.show('请选购商品',2000)\n }else{\n this.$router.push('/order')\n }\n }\n }\n\t}\n</script>\n\n<style scoped>\n .bottom-menu {\n width: 100%;\n height: 44px;\n background-color: #eee;\n position: fixed;\n bottom: 50px;\n left: 0;\n box-shadow: 0 -2px 3px rgba(0, 0, 0, .2);\n font-size: 14px;\n color: #888;\n line-height: 44px;\n padding-left: 35px;\n box-sizing: border-box;\n z-index: 999999 ;\n }\n\n .bottom-menu .select-all {\n position: absolute;\n line-height: 0;\n left: -99999999999px;\n top: 13px;\n }\n\n .bottom-menu .total-price {\n margin-left: -20px;\n font-size: 16px;\n color: #666;\n }\n\n .bottom-menu .buy-product {\n background-color: orangered;\n color: #fff;\n width: 100px;\n height: 44px;\n text-align: center;\n line-height: 44px;\n float: right;\n }\n</style>\n"]}]} |