From 36b307fbbef20b85f5f0a74f03405ae151826096 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Thu, 29 Aug 2024 18:10:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=8A=98=E6=89=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/util.scss | 152 +++++++++----- src/views/table/components/choose-user.vue | 5 +- .../table-diancan-components/discount.vue | 197 ++++++++++++++++++ src/views/table/components/table-diancan.vue | 81 ++++--- 4 files changed, 350 insertions(+), 85 deletions(-) create mode 100644 src/views/table/components/table-diancan-components/discount.vue diff --git a/src/assets/styles/util.scss b/src/assets/styles/util.scss index be155a0..6c90650 100644 --- a/src/assets/styles/util.scss +++ b/src/assets/styles/util.scss @@ -7,7 +7,9 @@ .u-abso { position: absolute; } -.u-fixed,.u-fix{ + +.u-fixed, +.u-fix { position: fixed; } @@ -22,6 +24,7 @@ view, text { box-sizing: border-box; } + /* #endif */ .u-font-xs { @@ -130,39 +133,44 @@ text { // 定义内外边距,历遍1-80 @for $i from 0 through 80 { + // 只要双数和能被5除尽的数 - @if $i % 2 == 0 or $i % 5 == 0 { + @if $i % 2==0 or $i % 5==0 { + // 得出:u-margin-30或者u-m-30 - .u-margin-#{$i}, .u-m-#{$i} { - margin: $i + px!important; + .u-margin-#{$i}, + .u-m-#{$i} { + margin: $i + px !important; } - + // 得出:u-padding-30或者u-p-30 - .u-padding-#{$i}, .u-p-#{$i} { - padding: $i + px!important; + .u-padding-#{$i}, + .u-p-#{$i} { + padding: $i + px !important; } - + @each $short, $long in l left, t top, r right, b bottom { + // 缩写版,结果如: u-m-l-30 // 定义外边距 .u-m-#{$short}-#{$i} { - margin-#{$long}: $i + px!important; + margin-#{$long}: $i + px !important; } - + // 定义内边距 .u-p-#{$short}-#{$i} { - padding-#{$long}: $i + px!important; + padding-#{$long}: $i + px !important; } - + // 完整版,结果如:u-margin-left-30 // 定义外边距 .u-margin-#{$long}-#{$i} { - margin-#{$long}: $i + px!important; + margin-#{$long}: $i + px !important; } - + // 定义内边距 .u-padding-#{$long}-#{$i} { - padding-#{$long}: $i + px!important; + padding-#{$long}: $i + px !important; } } } @@ -176,116 +184,146 @@ text { /* start--文本行数限制--start */ .u-line-1 { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } .u-line-2 { - -webkit-line-clamp: 2; + -webkit-line-clamp: 2; } .u-line-3 { - -webkit-line-clamp: 3; + -webkit-line-clamp: 3; } .u-line-4 { - -webkit-line-clamp: 4; + -webkit-line-clamp: 4; } .u-line-5 { - -webkit-line-clamp: 5; + -webkit-line-clamp: 5; } -.u-line-2, .u-line-3, .u-line-4, .u-line-5 { - overflow: hidden; +.u-line-2, +.u-line-3, +.u-line-4, +.u-line-5 { + overflow: hidden; word-break: break-all; - text-overflow: ellipsis; - display: -webkit-box; // 弹性伸缩盒 - -webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式 + text-overflow: ellipsis; + display: -webkit-box; // 弹性伸缩盒 + -webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式 } /* end--文本行数限制--end */ /* start--不同颜色文字--start */ -.color-333{ +.color-333 { color: #333; } -.color-666{ + +.color-666 { color: #666; } -.color-999{ + +.color-999 { color: #999; } +.color-red { + color: rgb(250, 85, 85); +} + + /* end--不同颜色文字--end */ - -.tranistion{ +.tranistion { transition: all .3s ease-in-out; } -.tranistion-1{ + +.tranistion-1 { transition: all .1s ease-in-out; } -.tranistion-2{ + +.tranistion-2 { transition: all .2s ease-in-out; } -.font-bold{ + +.font-bold { font-weight: 700; } +.font-600 { + font-weight: 600; +} -.bg-gray{ +.bg-gray { background-color: #F9F9F9; } -.w-full{ + +.w-full { width: 100%; } -.gap-10{ + +.gap-10 { gap: 10px; } -.gap-20{ + +.gap-20 { gap: 20px; } -.color-aaa{ + +.color-aaa { color: #aaa; } -.color-000{ + +.color-000 { color: #000; } -.color-fff{ + +.color-fff { color: #fff; } -.bg-fff{ + +.bg-fff { background-color: #fff; } -.bg-gray{ + +.bg-gray { background-color: #F9F9F9; } -.overflow-hide{ + +.overflow-hide { overflow: hidden; } -.no-wrap{ + +.no-wrap { white-space: nowrap; } -.border-r-12{ + +.border-r-12 { border-radius: 12px; } -.border-r-18{ + +.border-r-18 { border-radius: 18px; } -.border-top{ + +.border-top { border-top: 1px solid #E5E5E5; } -.border-bottom{ + +.border-bottom { border-bottom: 1px solid #E5E5E5; } -.scale7{ + +.scale7 { transform: scale(0.7); } -.position-all{ +.position-all { left: 0; right: 0; top: 0; @@ -295,18 +333,20 @@ text { .lh16 { line-height: 16px; } -.default-box-padding{ + +.default-box-padding { padding: 16px 14px; } -.zIndex-999{ +.zIndex-999 { z-index: 999; } -.icon-default-size{ + +.icon-default-size { width: 14px; height: 14px; } -.filter-gray{ +.filter-gray { filter: grayscale(1); } \ No newline at end of file diff --git a/src/views/table/components/choose-user.vue b/src/views/table/components/choose-user.vue index 6427ca7..c391b32 100644 --- a/src/views/table/components/choose-user.vue +++ b/src/views/table/components/choose-user.vue @@ -128,9 +128,7 @@ export default { }, }, mounted() { - cacheData = { ...this.query }; - this.getTableData(); - this.getShopInfo(); + // this.getTableData(); }, methods: { cellClick(user){ @@ -155,6 +153,7 @@ export default { this.show = false; }, open() { + this.getTableData(); this.show = true; }, toPage(type) { diff --git a/src/views/table/components/table-diancan-components/discount.vue b/src/views/table/components/table-diancan-components/discount.vue new file mode 100644 index 0000000..bc9e9b8 --- /dev/null +++ b/src/views/table/components/table-diancan-components/discount.vue @@ -0,0 +1,197 @@ + + + + \ No newline at end of file diff --git a/src/views/table/components/table-diancan.vue b/src/views/table/components/table-diancan.vue index e14f731..9108fa0 100644 --- a/src/views/table/components/table-diancan.vue +++ b/src/views/table/components/table-diancan.vue @@ -162,7 +162,7 @@ alt="" />
- +
{{ vipUser.nickName }}
@@ -592,14 +592,6 @@
- @@ -989,6 +993,7 @@ import chooseUser from "./choose-user.vue"; import payType from "./pay-type.vue"; import chooseTable from "./table-diancan-components/choose-table-master.vue"; import scanPay from "./table-diancan-components/scan-pay.vue"; +import moneyDiscount from "./table-diancan-components/discount.vue"; import orderNote from "./table-diancan-components/note.vue"; import moneyKeyboard from "./money-keyboard.vue"; import dayjs from "dayjs"; @@ -1009,7 +1014,12 @@ import { $payOrder, } from "@/api/table"; import { tbShopCategoryGet } from "@/api/shop"; -import { isCanBuy,arrayContainsAll,generateCombinations,returnReverseVal } from "./util.js"; +import { + isCanBuy, + arrayContainsAll, + generateCombinations, + returnReverseVal, +} from "./util.js"; export default { components: { @@ -1019,6 +1029,7 @@ export default { orderNote, moneyKeyboard, scanPay, + moneyDiscount, }, data() { return { @@ -1143,6 +1154,7 @@ export default { canUpdate: true, //下单 createOrder: { + discount: 1, form: {}, data: {}, quan: { @@ -1243,6 +1255,11 @@ export default { masterId: function (val) { console.log(val); }, + isCreateOrder: function (val) { + if (!val) { + this.createOrder.discount = 1; + } + }, "vipUser.id": async function (val) { let masterId = this.order.masterId; if (!masterId) { @@ -1378,16 +1395,26 @@ export default { mounted() { // this.getGoods(); // this.getCategory(); - // this.refToggle('refScanCode',true) + // this.refToggle("refDiscount", true); }, methods: { - refToggle(key,isShow){ - if(!this.$refs[key]){ - return + ChangeDiscount(discount) { + this.createOrder.discount = discount; + }, + disCountShow() { + const { amount } = this.createOrder.data; + this.refToggle("refDiscount", true, { + amount, + discount: this.createOrder.discount * 100, + }); + }, + refToggle(key, isShow, data) { + if (!this.$refs[key]) { + return; } - isShow?this.$refs[key].open():this.$refs[key].close() - }, + isShow ? this.$refs[key].open(data) : this.$refs[key].close(data); + }, //购物车商品输入框数量输入 cartGoodsNumberInput(newval, item) { if (newval <= 0) { @@ -1486,6 +1513,7 @@ export default { orderId: this.createOrder.data.id, payType: this.order.payType, vipUserId: this.vipUser.id, + discount: this.createOrder.discount.toFixed(2), }); this.payOrderSuccess(); }, @@ -2114,6 +2142,7 @@ export default { this.allPack = false; this.note.content = ""; this.isPrverOrder = false; + this.createOrder.discount = 1; }, //获取购物车数据 async getCart() { @@ -2456,10 +2485,6 @@ input[type="number"]::-webkit-outer-spin-button { text-align: center; } -::v-deep .number-box .el-input__inner::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; -} ::v-deep .el-button--success:not(.is-disabled) { background: #22bf64; color: #fff; @@ -2490,6 +2515,10 @@ input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } +::v-deep .number-box .el-input__inner::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} .carts_list_title { padding: 16px 0 12px 0; display: flex;