代客下单从弹窗修改为页面,修改台桌列表弹窗为跳转,代客下单完毕后跳转至台桌页面
This commit is contained in:
parent
148ac92e80
commit
34fc9c4ee1
|
|
@ -0,0 +1,34 @@
|
|||
export const $status= {
|
||||
pending: {
|
||||
label: "挂单中",
|
||||
type: "#E6A23C",
|
||||
},
|
||||
using: {
|
||||
label: "开台中",
|
||||
type: "#fa5555",
|
||||
},
|
||||
paying: {
|
||||
label: "结算中",
|
||||
type: "#E6A23C",
|
||||
},
|
||||
idle: {
|
||||
label: "空闲",
|
||||
type: "#3F9EFF",
|
||||
},
|
||||
subscribe: {
|
||||
label: "预定",
|
||||
type: "rgb(34, 191, 100)",
|
||||
},
|
||||
closed: {
|
||||
label: "关台",
|
||||
type: "rgb(221,221,221)",
|
||||
},
|
||||
// opening: {
|
||||
// label: "开台中",
|
||||
// type: "#67C23A",
|
||||
// },
|
||||
cleaning: {
|
||||
label: "待清台",
|
||||
type: "#FAAD14",
|
||||
}
|
||||
}
|
||||
|
|
@ -197,7 +197,7 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.login {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
|
|
|||
|
|
@ -252,13 +252,12 @@ export default {
|
|||
status: $status,
|
||||
selTable: "", //当前选中的桌台
|
||||
areaMap: {},
|
||||
shopInfo:{},
|
||||
shopInfo: {},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.tbShopAreaGet();
|
||||
this.getShopInfo()
|
||||
|
||||
this.getShopInfo();
|
||||
},
|
||||
filters: {
|
||||
formatTime(time) {
|
||||
|
|
@ -271,13 +270,13 @@ export default {
|
|||
try {
|
||||
const shopId = localStorage.getItem("shopId");
|
||||
const res = await tbShopInfo(shopId);
|
||||
this.shopInfo=res
|
||||
console.log(res)
|
||||
this.shopInfo = res;
|
||||
console.log(res);
|
||||
} catch (error) {}
|
||||
},
|
||||
// 清台
|
||||
cleanTableHandle(item) {
|
||||
this.$confirm("确定要清台:"+item.name, "提示", {
|
||||
this.$confirm("确定要清台:" + item.name, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
|
|
@ -321,21 +320,30 @@ export default {
|
|||
//key isAddGoods 加菜
|
||||
//key isPayOrder结账
|
||||
this.selTable = item;
|
||||
if(this.shopInfo.isTableFee){
|
||||
if (this.shopInfo.isTableFee) {
|
||||
//免餐位费
|
||||
this.$refs.diancan.open(item, key, '');
|
||||
return
|
||||
this.toInstead({num: 0,key});
|
||||
// this.$refs.diancan.open(item, key, '');
|
||||
return;
|
||||
}
|
||||
const num = item.useNum || 0;
|
||||
if (item.useNum <= 0) {
|
||||
return this.$refs.refChooseDinersNumber.open();
|
||||
}
|
||||
this.$refs.diancan.open(item, key, num);
|
||||
this.toInstead({num: num,key});
|
||||
// this.$refs.diancan.open(item, key, num);
|
||||
},
|
||||
toInstead(query) {
|
||||
this.$router.push({ path: "/tool/Instead/index", query: {
|
||||
table_name: this.selTable.name,
|
||||
tableId: this.selTable.tableId,
|
||||
useType: this.selTable.type,
|
||||
...query
|
||||
}});
|
||||
},
|
||||
chooseDinersNumberConfirm(num) {
|
||||
//就餐人数
|
||||
console.log(num);
|
||||
this.$refs.diancan.open(this.selTable, undefined, num);
|
||||
this.toInstead({num: num});
|
||||
// this.$refs.diancan.open(this.selTable, undefined, num);
|
||||
},
|
||||
tabClick() {
|
||||
this.tbShopTableGet();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,317 @@
|
|||
<template>
|
||||
<div
|
||||
class="flex order-item relative"
|
||||
:class="[isActive]"
|
||||
@click="itemClick"
|
||||
>
|
||||
<span class="absolute pack" v-if="item.isPack === 'true'"> 包 </span>
|
||||
<span class="absolute tui" v-if="item.status === 'return'"> 退 </span>
|
||||
<div class="flex">
|
||||
|
||||
<div class="img">
|
||||
<div class="isSeatFee img u-line-1 u-flex u-col-center u-row-center" v-if="isSeatFee">
|
||||
<span>{{ item.name }}</span>
|
||||
</div>
|
||||
<img v-else :src="item.coverImg" class="" alt="" />
|
||||
</div>
|
||||
<div class="good-info">
|
||||
<div class="flex lh-16">
|
||||
<div class="name" :class="{ 'free-price': item.status === 'return' }">{{ item.name }}</div>
|
||||
<span class="good_info_discount" v-if="item.isGift === 'true'"
|
||||
>赠</span
|
||||
>
|
||||
</div>
|
||||
<div v-if="item.specSnap" class="specSnap">
|
||||
{{ item.specSnap }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="order-number-box">
|
||||
<div class="" v-if="isSeatFee">X{{ item.totalNumber }}</div>
|
||||
<div class="" v-else>X{{ item.number }}</div>
|
||||
<div class="absolute" v-if="canChangeNumber">
|
||||
<div class="order-input-number">
|
||||
<i class="icon-remove" @click="changeOrderNumber(true)"></i>
|
||||
<div style="width: 40px" class="number-box">
|
||||
<el-input
|
||||
:min="0"
|
||||
type="number"
|
||||
@input="cartGoodsNumberInput"
|
||||
@change="cartGoodsNumberChange"
|
||||
v-model="number"
|
||||
placeholder="0"
|
||||
></el-input>
|
||||
</div>
|
||||
<i
|
||||
class="el-icon-circle-plus icon-add"
|
||||
@click="changeOrderNumber(false)"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="color-333 total-price">
|
||||
<div v-if="item.isGift === 'true'||item.status=='return' ">¥0</div>
|
||||
<div :class="{ 'free-price': item.isGift === 'true'||item.status=='return' }">
|
||||
<span v-if="isSeatFee"> ¥{{ item.totalAmount }}</span>
|
||||
<span v-else> ¥{{ item.salePrice }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
//是否是餐位费
|
||||
isSeatFee:{
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
//是否是历史订单商品
|
||||
isOld:{
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
//第几次下单 1以及以上为历史订单 0为当前购物车
|
||||
placeNum:{
|
||||
type: [String,Number],
|
||||
default: 0,
|
||||
},
|
||||
selPlaceNum:{
|
||||
type: [String,Number],
|
||||
default: -1,
|
||||
},
|
||||
//是否允许改变数量
|
||||
canChangeNumber: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
item: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
number: 0,
|
||||
};
|
||||
},
|
||||
},
|
||||
selIndex: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
number: 0,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isActive(){
|
||||
const isSel= (this.selIndex === this.index)&&(this.placeNum===this.selPlaceNum)
|
||||
console.log(isSel)
|
||||
return isSel?'active':'';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
"item.number": function (val) {
|
||||
this.number = val;
|
||||
// this.$emit('changeOrderNumber',this.index)
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = this.item.number;
|
||||
},
|
||||
methods: {
|
||||
//购物车商品输入框数量改变
|
||||
cartGoodsNumberChange(newval) {
|
||||
if (newval <= 0) {
|
||||
item.number = 1;
|
||||
}
|
||||
newval = `${newval}`.split(".")[0] * 1;
|
||||
this.number = newval;
|
||||
this.$emit("cartGoodsNumberChange",newval, this.index);
|
||||
|
||||
},
|
||||
//购物车商品输入框数量输入
|
||||
cartGoodsNumberInput(newval) {
|
||||
if (newval <= 0) {
|
||||
return this.number =1
|
||||
}
|
||||
newval = `${newval}`.split(".")[0] * 1;
|
||||
this.number = newval;
|
||||
this.$emit("cartGoodsNumberInput",newval, this.index);
|
||||
},
|
||||
changeOrderNumber(isReduce) {
|
||||
this.$emit("changeOrderNumber", this.index, isReduce);
|
||||
},
|
||||
itemClick() {
|
||||
if(this.isSeatFee){
|
||||
return
|
||||
}
|
||||
this.$emit("itemClick", this.index,this.canChangeNumber,this.placeNum);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .number-box .el-input__inner {
|
||||
border: none;
|
||||
}
|
||||
::v-deep .el-button--text {
|
||||
color: #000;
|
||||
}
|
||||
::v-deep .number-box .el-input__inner {
|
||||
border: none;
|
||||
padding: 0 4px;
|
||||
text-align: center;
|
||||
}
|
||||
.isSeatFee{
|
||||
background: #3F9EFF;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
}
|
||||
.icon-remove {
|
||||
border: 1px solid #d8d8d8;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 10px;
|
||||
height: 1px;
|
||||
background: #999;
|
||||
}
|
||||
}
|
||||
.icon-add {
|
||||
color: rgb(34, 191, 100);
|
||||
font-size: 22px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.order-item {
|
||||
padding: 4px;
|
||||
border-radius: 2px;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
transition: all 0.3s;
|
||||
.pack {
|
||||
right: 100%;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background: #35ac6a;
|
||||
border-radius: 4px 0 4px 0;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 17px;
|
||||
}
|
||||
.tui{
|
||||
right: 100%;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background: #ac4735;
|
||||
border-radius: 4px 0 4px 0;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 17px;
|
||||
}
|
||||
&.active {
|
||||
background-color: rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.total-price {
|
||||
width: 94px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.good-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
min-width: 70px;
|
||||
|
||||
.specSnap {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
color: #212121;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
|
||||
img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-number-box {
|
||||
position: relative;
|
||||
|
||||
.absolute {
|
||||
width: 60px;
|
||||
height: 40px;
|
||||
right: -30px;
|
||||
top: -12px;
|
||||
position: absolute;
|
||||
|
||||
.order-input-number {
|
||||
position: absolute;
|
||||
right: -6px;
|
||||
top: 0;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
|
||||
padding: 9px 6px;
|
||||
background-color: #fff;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
&:hover .order-input-number {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
.good_info_discount {
|
||||
height: 16px;
|
||||
padding: 0 3px;
|
||||
color: #ff3f3f;
|
||||
background-color: rgba(255, 63, 63, 0.1);
|
||||
border-radius: 2px;
|
||||
margin-left: 6px;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,270 @@
|
|||
<template>
|
||||
<div class="select_desk">
|
||||
<el-dialog width="410px" title="就餐人数" :visible.sync="show">
|
||||
<div class="select_desk_dialog u-p-b-20">
|
||||
<key-board
|
||||
isCanEmpty
|
||||
v-model="number"
|
||||
@clear="clear"
|
||||
:max="max"
|
||||
:maxTips=" '最多'+max+'位'"
|
||||
>
|
||||
<div slot="clear">清空</div>
|
||||
<div slot="input" class="u-p-l-20 u-p-r-20 u-flex w-full">
|
||||
<el-input
|
||||
placeholder="请输入就餐人数"
|
||||
v-model="number"
|
||||
@input="inputNumber"
|
||||
@change="inputChange"
|
||||
type="number"
|
||||
>
|
||||
<template slot="append">位</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</key-board>
|
||||
<div class="confirm_btns">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button type="primary" size="medium" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import keyBoard from "./keyboard.vue";
|
||||
export default {
|
||||
components: { keyBoard },
|
||||
props:{
|
||||
max:{
|
||||
type:Number,
|
||||
default:99
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
number: "",
|
||||
show: false,
|
||||
hasOpen: false,
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
number(newval) {
|
||||
if (newval >this.max) {
|
||||
this.number = this.max;
|
||||
this.$message("最多只能选择"+this.max+"位就餐人数");
|
||||
}
|
||||
// 使用正则表达式匹配正整数
|
||||
const regex = /^[1-9]\d*$/;
|
||||
// 如果输入的值不是正整数,则将其设置为上一个有效值
|
||||
if (!regex.test(newval)) {
|
||||
this.number = newval.substring(0, newval.length - 1);
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
inputNumber(e) {},
|
||||
inputChange(e) {},
|
||||
clear(e) {
|
||||
console.log(e);
|
||||
this.number = "";
|
||||
},
|
||||
confirm() {
|
||||
if (this.number >this.max) {
|
||||
return this.$message("最多只能选择"+this.max+"位就餐人数");
|
||||
}
|
||||
if (!this.number) {
|
||||
return this.$message("请选择就餐人数");
|
||||
}
|
||||
console.log(this.number)
|
||||
this.$emit("confirm", this.number);
|
||||
this.close();
|
||||
},
|
||||
open(number) {
|
||||
this.number = number || "";
|
||||
this.show = true;
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
this.number = "";
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-button {
|
||||
padding: 12px 20px;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-button--success {
|
||||
border-color: #22bf64;
|
||||
background-color: #22bf64;
|
||||
}
|
||||
.select_desk .btn {
|
||||
height: 34px;
|
||||
}
|
||||
.tags {
|
||||
font-size: 16px;
|
||||
&.using {
|
||||
color: rgb(234, 64, 37);
|
||||
}
|
||||
&.wait {
|
||||
color: rgb(252, 236, 79);
|
||||
}
|
||||
&.idle {
|
||||
color: rgb(137, 234, 71);
|
||||
}
|
||||
&.closed {
|
||||
color: rgb(221, 221, 221);
|
||||
filter: grayscale(1);
|
||||
}
|
||||
}
|
||||
::v-deep .inputs .el-input__inner {
|
||||
border-color: transparent !important;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.select_desk .select_desk_dialog {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
width: 286px;
|
||||
height: 38px;
|
||||
background: #dcf0e8;
|
||||
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li,
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
border-radius: 4px;
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li {
|
||||
width: 140px;
|
||||
height: 34px;
|
||||
color: #0fc161;
|
||||
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .lion {
|
||||
background: #0fc161;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .inputs {
|
||||
width: 370px;
|
||||
line-height: 54px;
|
||||
margin-top: 24px;
|
||||
height: 54px;
|
||||
margin-bottom: 20px;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .inputs .close {
|
||||
color: #aaa;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
line-height: 30px;
|
||||
top: 50%;
|
||||
margin-top: -15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard {
|
||||
display: flex;
|
||||
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
border-right: 1px solid #dcdfe6;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li {
|
||||
height: 60px;
|
||||
width: 33.333%;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
font-size: 24px;
|
||||
color: #212121;
|
||||
cursor: pointer;
|
||||
|
||||
user-select: none;
|
||||
border-left: 1px solid #dcdfe6;
|
||||
border-top: 1px solid #dcdfe6;
|
||||
|
||||
transition: all 0.1s;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li:hover {
|
||||
background: #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li .icon {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm {
|
||||
height: 140px;
|
||||
background: #ff9f2e;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm:hover {
|
||||
background: #f88502;
|
||||
}
|
||||
|
||||
.confirm_btns {
|
||||
display: flex;
|
||||
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.confirm_btns .el-button {
|
||||
width: 175px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,287 @@
|
|||
<template>
|
||||
<div class="select_desk">
|
||||
<el-dialog width="410px" title="桌台号/取餐号" :visible.sync="show">
|
||||
<div class="select_desk_dialog u-p-t-20 u-p-b-20">
|
||||
<div class="nav">
|
||||
<div
|
||||
class="li"
|
||||
:class="type === 0 ? 'lion' : ''"
|
||||
@click="changeType(0)"
|
||||
>
|
||||
桌台号
|
||||
</div>
|
||||
<div
|
||||
class="li"
|
||||
:class="type === 1 ? 'lion' : ''"
|
||||
@click="changeType(1)"
|
||||
>
|
||||
自定义取餐号
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="type === 0">
|
||||
<el-select
|
||||
class="inputs"
|
||||
v-model="selTableId"
|
||||
placeholder="请选择桌位"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tableList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
<div class="u-flex u-row-between ">
|
||||
<span>{{ item.name }}</span>
|
||||
<span :class="['tags',item.status]">
|
||||
{{ status[item.status] ? status[item.status].label : "" }}
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template v-else>
|
||||
<key-board isCanEmpty v-model="masterId"></key-board>
|
||||
</template>
|
||||
|
||||
<div class="confirm_btns">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button type="primary" size="medium" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbShopTableGet } from "@/api/table";
|
||||
import keyBoard from "./keyboard.vue";
|
||||
import {$status} from "@/utils/table.js";
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
components: { keyBoard },
|
||||
data() {
|
||||
return {
|
||||
masterId: "",
|
||||
//0 台桌 ,1 取餐号
|
||||
type: 0,
|
||||
show: false,
|
||||
hasOpen: false,
|
||||
total: 0,
|
||||
loading: false,
|
||||
tableList: [],
|
||||
selTableId: "",
|
||||
status:$status
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
confirm() {
|
||||
const item = this.tableList.find((v) => v.id == this.selTableId);
|
||||
this.$emit("confirm", item);
|
||||
this.close();
|
||||
},
|
||||
// 台桌列表
|
||||
async tbShopTableGet() {
|
||||
this.loading = true;
|
||||
try {
|
||||
const { content, total } = await tbShopTableGet({
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
areaId: this.tabVlaue,
|
||||
});
|
||||
this.tableList = content.filter((v) => v.tableId);
|
||||
this.total = total;
|
||||
this.hasOpen = true;
|
||||
setTimeout(() => {
|
||||
this.loading = false;
|
||||
}, 300);
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
changeType(type) {
|
||||
this.type = type;
|
||||
},
|
||||
open() {
|
||||
this.show = true;
|
||||
if (!this.hasOpen) {
|
||||
this.tbShopTableGet();
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-button {
|
||||
padding: 12px 20px;
|
||||
}
|
||||
::v-deep .el-button--success {
|
||||
border-color: #22bf64;
|
||||
background-color: #22bf64;
|
||||
}
|
||||
.select_desk .btn {
|
||||
height: 34px;
|
||||
}
|
||||
.tags {
|
||||
font-size: 16px;
|
||||
&.using {
|
||||
color: rgb(234, 64, 37);
|
||||
}
|
||||
&.wait{
|
||||
color: rgb(252, 236, 79);
|
||||
}
|
||||
&.idle{
|
||||
color: rgb(137, 234, 71);
|
||||
}
|
||||
&.closed {
|
||||
color: rgb(221, 221, 221);
|
||||
filter: grayscale(1);
|
||||
}
|
||||
}
|
||||
::v-deep .inputs .el-input__inner {
|
||||
border-color: transparent !important;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.select_desk .select_desk_dialog {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
width: 286px;
|
||||
height: 38px;
|
||||
background: #dcf0e8;
|
||||
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li,
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
border-radius: 4px;
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li {
|
||||
width: 140px;
|
||||
height: 34px;
|
||||
color: #0fc161;
|
||||
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .lion {
|
||||
background: #0fc161;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .inputs {
|
||||
width: 370px;
|
||||
line-height: 54px;
|
||||
margin-top: 24px;
|
||||
height: 54px;
|
||||
margin-bottom: 20px;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .inputs .close {
|
||||
color: #aaa;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
line-height: 30px;
|
||||
top: 50%;
|
||||
margin-top: -15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard {
|
||||
display: flex;
|
||||
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
border-right: 1px solid #dcdfe6;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li {
|
||||
height: 60px;
|
||||
width: 33.333%;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
font-size: 24px;
|
||||
color: #212121;
|
||||
cursor: pointer;
|
||||
|
||||
user-select: none;
|
||||
border-left: 1px solid #dcdfe6;
|
||||
border-top: 1px solid #dcdfe6;
|
||||
|
||||
transition: all 0.1s;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li:hover {
|
||||
background: #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li .icon {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm {
|
||||
height: 140px;
|
||||
background: #ff9f2e;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm:hover {
|
||||
background: #f88502;
|
||||
}
|
||||
|
||||
.confirm_btns {
|
||||
display: flex;
|
||||
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.confirm_btns .el-button {
|
||||
width: 175px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
<template>
|
||||
<el-dialog title="选择用户" width="850px" :visible.sync="show">
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<el-form-item label="">
|
||||
<el-input
|
||||
v-model="query.name"
|
||||
placeholder="请输入昵称或手机号"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="是否为会员">
|
||||
<el-select v-model="query.isVip" placeholder="是否是会员">
|
||||
<el-option value="" label="全部"></el-option>
|
||||
<el-option :value="1" label="是"></el-option>
|
||||
<el-option :value="0" label="否"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<div class="flex gap-20">
|
||||
<el-button type="primary" @click="getTableData" size="medium"
|
||||
>搜索</el-button
|
||||
>
|
||||
<!-- <el-button @click="resetHandle" size="medium">重置</el-button> -->
|
||||
<el-button @click="noChooseUser" size="medium"
|
||||
>不选择用户</el-button
|
||||
>
|
||||
<!-- <el-button @click="resetHandle" size="medium">新建用户</el-button> -->
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- <div class="head-container">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addActive.show()">
|
||||
添加活动
|
||||
</el-button>
|
||||
</div> -->
|
||||
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading" @cell-click="cellClick">
|
||||
<el-table-column label="ID" prop="id"></el-table-column>
|
||||
<el-table-column label="用户" prop="headImg" width="200px">
|
||||
<template v-slot="scope">
|
||||
<div class="user_info">
|
||||
<el-image
|
||||
:src="scope.row.headImg"
|
||||
style="width: 40px; height: 40px; flex-shrink: 0"
|
||||
>
|
||||
<div slot="error" class="image-slot">
|
||||
<i class="el-icon-user"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<span class="name">{{ scope.row.nickName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="手机号"
|
||||
prop="telephone"
|
||||
width="160"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column label="性别" prop="sex">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="priamry">{{ scope.row.sex || "未知" }}</el-tag>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="会员" prop="isVip">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="warning" v-if="scope.row.isVip"
|
||||
>会员等级{{ scope.row.isVip }}</el-tag
|
||||
>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="余额" prop="amount"></el-table-column>
|
||||
<el-table-column label="积分" prop="totalScore"></el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="90" fixed="right">
|
||||
<template v-slot="scope">
|
||||
<el-button type="primary" size="mini" @click="choose(scope.row)">选择</el-button>
|
||||
<!-- <el-button type="text" @click="charge(scope.row)">充值</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
:total="tableData.total"
|
||||
:current-page="tableData.page + 1"
|
||||
:page-size="tableData.size"
|
||||
@size-change="sizeChange"
|
||||
@current-change="paginationChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryAllShopUser, queryAllShopInfo } from "@/api/shop";
|
||||
import dayjs from "dayjs";
|
||||
let cacheData = {};
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
query: {
|
||||
name: "",
|
||||
},
|
||||
shopInfo: {
|
||||
balanceTotal: 0,
|
||||
userTotal: 0,
|
||||
chageTotal: 0,
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
timeFilter(s) {
|
||||
return dayjs(s).format("YYYY-MM-DD HH:mm:ss");
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
cellClick(user){
|
||||
console.log(user)
|
||||
this.$emit("chooseUser",user)
|
||||
this.close()
|
||||
},
|
||||
noChooseUser(){
|
||||
this.$emit("chooseUser",null)
|
||||
this.close()
|
||||
|
||||
},
|
||||
choose(user) {
|
||||
this.$emit("chooseUser",user)
|
||||
this.close()
|
||||
|
||||
},
|
||||
charge(user) {
|
||||
console.log(user);
|
||||
},
|
||||
close(){
|
||||
this.show = false;
|
||||
},
|
||||
open() {
|
||||
this.getTableData();
|
||||
this.show = true;
|
||||
},
|
||||
toPage(type) {
|
||||
const pages = {
|
||||
charge: "charge_list",
|
||||
cost: "cost_list",
|
||||
};
|
||||
this.$router.push({
|
||||
name: pages[type],
|
||||
});
|
||||
console.log(pages[type]);
|
||||
},
|
||||
// 获取商家用户概述信息
|
||||
async getShopInfo() {
|
||||
try {
|
||||
const res = await queryAllShopInfo(this.query);
|
||||
this.shopInfo = res;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
sizeChange() {
|
||||
this.tableData.page = 0;
|
||||
this.getTableData();
|
||||
},
|
||||
// 切换状态
|
||||
async statusChange(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true;
|
||||
const data = { ...row };
|
||||
data.status = e;
|
||||
await modityActivate(data);
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
this.tableData.loading = false;
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.name = "";
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await queryAllShopUser({
|
||||
...this.query,
|
||||
size: this.tableData.size,
|
||||
page: this.tableData.page + 1,
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.user_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.name {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
::v-deep .el-input--small .el-input__inner{
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
::v-deep .image-slot {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #efefef;
|
||||
font-size: 20px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.card {
|
||||
background-color: #f5f5f5;
|
||||
padding: 0 14px;
|
||||
|
||||
.title {
|
||||
font-size: 22px;
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
padding: 20px 0;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
|
||||
.t {
|
||||
text-align: center;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.n {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
padding-top: 6px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.flex{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.gap-20{
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -0,0 +1,206 @@
|
|||
<template>
|
||||
<el-dialog width="400px" :title="title" :visible.sync="show">
|
||||
<div class="u-p-15">
|
||||
<div class="u-m-t-20">
|
||||
<el-form label-width="90px" label-position="left">
|
||||
<el-form-item label="应付金额">
|
||||
<div class="color-red u-font-18 font-600">¥{{ form.money }}</div>
|
||||
<!-- <el-input :value="form.money" disabled> </el-input> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="减免金额">
|
||||
<el-input
|
||||
v-model="form.reduceMoney"
|
||||
clearable
|
||||
autofocus
|
||||
type="number"
|
||||
@keyup.enter.native="init('reduceMoney')"
|
||||
@blur="init('reduceMoney')"
|
||||
>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="优惠折扣">
|
||||
<el-input
|
||||
v-model="form.discount"
|
||||
type="number"
|
||||
@keyup.enter.native="init('discount')"
|
||||
@blur="init('discount')"
|
||||
>
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="实收金额">
|
||||
<el-input
|
||||
v-model="form.curretnMoney"
|
||||
type="number"
|
||||
clearable
|
||||
@keyup.enter.native="init('curretnMoney')"
|
||||
@blur="init('curretnMoney')"
|
||||
>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<div class="u-flex u-row-center u-m-t-50">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
function toFixedNoRounding(num) {
|
||||
// 转换为字符串
|
||||
var numStr = num.toString();
|
||||
// 分割整数部分和小数部分
|
||||
var parts = numStr.split('.');
|
||||
// 如果小数部分长度大于2,则截取前两位
|
||||
if (parts[1] && parts[1].length > 2) {
|
||||
parts[1] = parts[1].slice(0, 2);
|
||||
}
|
||||
// 拼接回数字字符串并返回
|
||||
return parts.join('.');
|
||||
}
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: "优惠金额",
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
money: 0,
|
||||
discount: 100,
|
||||
reduceMoney: 0,
|
||||
curretnMoney: 0,
|
||||
},
|
||||
number: "0",
|
||||
show: false,
|
||||
};
|
||||
},
|
||||
watch: {},
|
||||
methods: {
|
||||
// init(key) {
|
||||
// const { money, reduceMoney, discount, curretnMoney } = this.form;
|
||||
// if (key == "reduceMoney") {
|
||||
// this.form.curretnMoney = (money - reduceMoney).toFixed(2);
|
||||
// this.form.discount = ((this.form.curretnMoney / money) * 100).toFixed(
|
||||
// 2
|
||||
// );
|
||||
// return;
|
||||
// }
|
||||
// if (key == "discount") {
|
||||
// this.form.curretnMoney = ((money * discount) / 100).toFixed(2);
|
||||
// this.form.reduceMoney = (money - this.form.curretnMoney).toFixed(2);
|
||||
// return;
|
||||
// }
|
||||
// if (key == "curretnMoney") {
|
||||
// this.form.reduceMoney = (money - curretnMoney).toFixed(2);
|
||||
// this.form.discount = ((this.form.curretnMoney / money) * 100).toFixed(
|
||||
// 2
|
||||
// );
|
||||
// return;
|
||||
// }
|
||||
// this.form.curretnMoney = ((money * discount) / 100).toFixed(2);
|
||||
// this.form.reduceMoney = (money - this.form.curretnMoney).toFixed(2);
|
||||
// },
|
||||
init(key) {
|
||||
const { money, reduceMoney, discount, curretnMoney } = this.form;
|
||||
if (key == "reduceMoney") {
|
||||
if (reduceMoney < 0) {
|
||||
this.$message.error("减免金额不能小于0");
|
||||
this.form.reduceMoney = 0;
|
||||
}
|
||||
if (reduceMoney > money) {
|
||||
this.$message.error("减免金额不能大于总金额");
|
||||
this.form.reduceMoney = money;
|
||||
}
|
||||
this.form.curretnMoney = (money - this.form.reduceMoney).toFixed(2);
|
||||
this.form.discount =toFixedNoRounding(((this.form.curretnMoney / money) * 100).toFixed(3) )
|
||||
return;
|
||||
}
|
||||
if (key == "discount") {
|
||||
if (discount < 0) {
|
||||
this.$message.error("折扣不能小于0");
|
||||
this.form.discount = 0;
|
||||
}
|
||||
if (discount > 100) {
|
||||
this.$message.error("折扣不能大于100");
|
||||
this.form.discount = 100;
|
||||
}
|
||||
this.form.curretnMoney = ((money * this.form.discount) / 100).toFixed(
|
||||
2
|
||||
);
|
||||
this.form.reduceMoney = (
|
||||
(money * (100 - this.form.discount)) /
|
||||
100
|
||||
).toFixed(2);
|
||||
return;
|
||||
}
|
||||
if (key == "curretnMoney") {
|
||||
if (curretnMoney < 0) {
|
||||
this.$message.error("实收金额不能小于0");
|
||||
this.form.curretnMoney = 0;
|
||||
}
|
||||
if (curretnMoney > money) {
|
||||
this.$message.error("实收金额不能大于总金额");
|
||||
this.form.curretnMoney = 0;
|
||||
}
|
||||
this.form.reduceMoney = (money - this.form.curretnMoney).toFixed(2);
|
||||
this.form.discount =toFixedNoRounding( ((this.form.curretnMoney / money) * 100).toFixed(3) );
|
||||
return;
|
||||
}
|
||||
this.form.curretnMoney = ((money * discount) / 100).toFixed(2);
|
||||
this.form.reduceMoney = (money - this.form.curretnMoney).toFixed(2);
|
||||
},
|
||||
changeKey(key, val) {
|
||||
this[key] = val;
|
||||
},
|
||||
|
||||
confirm() {
|
||||
this.$emit("confirm", (this.form.discount / 100));
|
||||
this.close();
|
||||
},
|
||||
open(data) {
|
||||
console.log(data);
|
||||
this.form.money = data.amount;
|
||||
this.form.discount = data.discount?toFixedNoRounding(data.discount.toFixed(3)):100;
|
||||
this.show = true;
|
||||
this.init();
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.codeImg {
|
||||
width: 160px;
|
||||
border: 1px solid rgb(220, 223, 230);
|
||||
height: 160px;
|
||||
}
|
||||
::v-deep .el-input .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
::v-deep .el-input .el-input__inner::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,319 @@
|
|||
<template>
|
||||
<div class="simple-Keyboard-number">
|
||||
<div class="carts">
|
||||
<div class="box_status">
|
||||
<slot name="input">
|
||||
<span> {{ number }}</span>
|
||||
</slot>
|
||||
</div>
|
||||
<div class="number_list_box">
|
||||
<div class="yd-keyboard">
|
||||
<div class="mini-number-box1">
|
||||
<div class="mini-number">
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('1')">1</div>
|
||||
<div class="key" @click="keyboradAdd('2')">2</div>
|
||||
<div class="key" @click="keyboradAdd('3')">3</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('4')">4</div>
|
||||
<div class="key" @click="keyboradAdd('5')">5</div>
|
||||
<div class="key" @click="keyboradAdd('6')">6</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('7')">7</div>
|
||||
<div class="key" @click="keyboradAdd('8')">8</div>
|
||||
<div class="key" @click="keyboradAdd('9')">9</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="clearFunction">
|
||||
<slot name="clear"> </slot>
|
||||
</div>
|
||||
<div class="key" @click="keyboradAdd('0')">0</div>
|
||||
<div
|
||||
class="key"
|
||||
style="font-size: 31px"
|
||||
@click="keyboradReduce"
|
||||
>
|
||||
<svg
|
||||
t="1723453480343"
|
||||
class="icon"
|
||||
viewBox="0 0 1664 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="1467"
|
||||
width="32"
|
||||
height="32"
|
||||
>
|
||||
<path
|
||||
d="M1526.08 1.6H459.84L41.28 416c-53.76 53.248-53.76 139.52 0 192.64l418.624 414.592v-0.064h1066.176a136.96 136.96 0 0 0 137.6-136.256V137.792a136.96 136.96 0 0 0-137.6-136.192z m-331.392 631.168c26.816 26.624 26.816 69.76 0 96.384-26.88 26.56-70.4 26.56-97.28 0l-121.28-120.128-123.328 122.112a69.76 69.76 0 0 1-97.92 0 68.096 68.096 0 0 1 0-96.96L878.208 512l-121.28-120.064a67.648 67.648 0 0 1 0-96.32c26.88-26.624 70.4-26.624 97.28 0l121.216 120.064 122.24-120.96a69.696 69.696 0 0 1 97.92 0 68.032 68.032 0 0 1 0 96.96l-122.24 120.96 121.344 120.064z"
|
||||
fill="#333333"
|
||||
p-id="1468"
|
||||
></path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="showConfirm">
|
||||
<div class="submit" @click="keyboradConfirm">确认</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
isCanEmpty: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
maxTips: {
|
||||
type: String,
|
||||
default: "输入值超范围",
|
||||
},
|
||||
showConfirm: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
default: Infinity,
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
number: 0,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newval) {
|
||||
this.number = newval;
|
||||
},
|
||||
number(newval) {
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clearFunction() {
|
||||
this.$emit("clear", this.number);
|
||||
},
|
||||
keyboradAdd(n) {
|
||||
if (Number(this.number) == 0) {
|
||||
return (this.number = n);
|
||||
}
|
||||
const newval = this.number + n;
|
||||
if (newval > this.max) {
|
||||
return this.$message( this.maxTips);
|
||||
}
|
||||
this.number = newval;
|
||||
},
|
||||
keyboradReduce() {
|
||||
if (this.number.length <= 1) {
|
||||
return (this.number = this.isCanEmpty ? "" : "0");
|
||||
}
|
||||
this.number = `${this.number}`.substring(0, this.number.length - 1);
|
||||
},
|
||||
keyboradConfirm() {
|
||||
this.$emit("confirm", this.number);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.yd-keyboard {
|
||||
justify-content: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number,
|
||||
.yd-keyboard {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number {
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key-line {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key {
|
||||
width: 122px;
|
||||
height: 60px;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
.mini-number-box1 .mini-number .key:hover {
|
||||
background-color: #dcdfe6;
|
||||
}
|
||||
.mini-number-box1 .mini-number .key:not(:last-child) {
|
||||
border-right: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key-line:not(:last-child) {
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box2 {
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mini-number-box2 .key {
|
||||
width: 80px;
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.mini-number-box2 .function-button {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mini-number-box2 .function-button .key {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.key-line {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.key,
|
||||
.key-line {
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.key {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
background: #fff;
|
||||
-webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10196078431372549);
|
||||
border-radius: 4px;
|
||||
|
||||
align-items: center;
|
||||
margin-left: 8px;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
text-align: center;
|
||||
line-height: 34px;
|
||||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10196078431372549);
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.simple-Keyboard-number,
|
||||
.simple-Keyboard-weight {
|
||||
min-width: 410px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.submit {
|
||||
width: 366px;
|
||||
height: 44px;
|
||||
background: #22bf64;
|
||||
border-radius: 2px;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
margin-bottom: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.disabled-box {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.carts {
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.carts .title,
|
||||
.carts {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.carts .title {
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
padding: 20px;
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.carts .title .left {
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.carts .title .right {
|
||||
font-size: 14.4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.carts .box_status {
|
||||
margin-bottom: 20px;
|
||||
width: 370px;
|
||||
height: 58px;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
font-family: MicrosoftYaHei;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.carts .box_status span {
|
||||
padding: 0 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,319 @@
|
|||
<template>
|
||||
<div class="simple-Keyboard-number">
|
||||
<div class="carts">
|
||||
<div class="box_status">
|
||||
<slot name="input">
|
||||
<span> {{ number }}</span>
|
||||
</slot>
|
||||
</div>
|
||||
<div class="number_list_box">
|
||||
<div class="yd-keyboard">
|
||||
<div class="mini-number-box1">
|
||||
<div class="mini-number">
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('1')">1</div>
|
||||
<div class="key" @click="keyboradAdd('2')">2</div>
|
||||
<div class="key" @click="keyboradAdd('3')">3</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('4')">4</div>
|
||||
<div class="key" @click="keyboradAdd('5')">5</div>
|
||||
<div class="key" @click="keyboradAdd('6')">6</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('7')">7</div>
|
||||
<div class="key" @click="keyboradAdd('8')">8</div>
|
||||
<div class="key" @click="keyboradAdd('9')">9</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="clearFunction">
|
||||
<slot name="clear"> </slot>
|
||||
</div>
|
||||
<div class="key" @click="keyboradAdd('0')">0</div>
|
||||
<div
|
||||
class="key"
|
||||
style="font-size: 31px"
|
||||
@click="keyboradReduce"
|
||||
>
|
||||
<svg
|
||||
t="1723453480343"
|
||||
class="icon"
|
||||
viewBox="0 0 1664 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="1467"
|
||||
width="32"
|
||||
height="32"
|
||||
>
|
||||
<path
|
||||
d="M1526.08 1.6H459.84L41.28 416c-53.76 53.248-53.76 139.52 0 192.64l418.624 414.592v-0.064h1066.176a136.96 136.96 0 0 0 137.6-136.256V137.792a136.96 136.96 0 0 0-137.6-136.192z m-331.392 631.168c26.816 26.624 26.816 69.76 0 96.384-26.88 26.56-70.4 26.56-97.28 0l-121.28-120.128-123.328 122.112a69.76 69.76 0 0 1-97.92 0 68.096 68.096 0 0 1 0-96.96L878.208 512l-121.28-120.064a67.648 67.648 0 0 1 0-96.32c26.88-26.624 70.4-26.624 97.28 0l121.216 120.064 122.24-120.96a69.696 69.696 0 0 1 97.92 0 68.032 68.032 0 0 1 0 96.96l-122.24 120.96 121.344 120.064z"
|
||||
fill="#333333"
|
||||
p-id="1468"
|
||||
></path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="showConfirm">
|
||||
<div class="submit" @click="keyboradConfirm">确认</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
isCanEmpty: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
maxTips: {
|
||||
type: String,
|
||||
default: "输入值超范围",
|
||||
},
|
||||
showConfirm: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
default: Infinity,
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
number: 0,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newval) {
|
||||
this.number = newval;
|
||||
},
|
||||
number(newval) {
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clearFunction() {
|
||||
this.$emit("clear", this.number);
|
||||
},
|
||||
keyboradAdd(n) {
|
||||
if (Number(this.number) == 0) {
|
||||
return (this.number = n);
|
||||
}
|
||||
const newval = this.number + n;
|
||||
if (newval > this.max) {
|
||||
return this.$message( this.maxTips);
|
||||
}
|
||||
this.number = newval;
|
||||
},
|
||||
keyboradReduce() {
|
||||
if (this.number.length <= 1) {
|
||||
return (this.number = this.isCanEmpty ? "" : "0");
|
||||
}
|
||||
this.number = `${this.number}`.substring(0, this.number.length - 1);
|
||||
},
|
||||
keyboradConfirm() {
|
||||
this.$emit("confirm", this.number);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.yd-keyboard {
|
||||
justify-content: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number,
|
||||
.yd-keyboard {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number {
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key-line {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key {
|
||||
width: 122px;
|
||||
height: 60px;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
.mini-number-box1 .mini-number .key:hover {
|
||||
background-color: #dcdfe6;
|
||||
}
|
||||
.mini-number-box1 .mini-number .key:not(:last-child) {
|
||||
border-right: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key-line:not(:last-child) {
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box2 {
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mini-number-box2 .key {
|
||||
width: 80px;
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.mini-number-box2 .function-button {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mini-number-box2 .function-button .key {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.key-line {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.key,
|
||||
.key-line {
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.key {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
background: #fff;
|
||||
-webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10196078431372549);
|
||||
border-radius: 4px;
|
||||
|
||||
align-items: center;
|
||||
margin-left: 8px;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
text-align: center;
|
||||
line-height: 34px;
|
||||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10196078431372549);
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.simple-Keyboard-number,
|
||||
.simple-Keyboard-weight {
|
||||
min-width: 410px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.submit {
|
||||
width: 366px;
|
||||
height: 44px;
|
||||
background: #22bf64;
|
||||
border-radius: 2px;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
margin-bottom: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.disabled-box {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.carts {
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.carts .title,
|
||||
.carts {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.carts .title {
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
padding: 20px;
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.carts .title .left {
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.carts .title .right {
|
||||
font-size: 14.4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.carts .box_status {
|
||||
margin-bottom: 20px;
|
||||
width: 370px;
|
||||
height: 58px;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
font-family: MicrosoftYaHei;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.carts .box_status span {
|
||||
padding: 0 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,339 @@
|
|||
<template>
|
||||
<el-dialog width="330px" :title="title" :visible.sync="show">
|
||||
<div class="simple-Keyboard-number">
|
||||
<div class="carts">
|
||||
<div class="pad-14">
|
||||
<div class="box_status">
|
||||
<span class="sym">¥</span>
|
||||
<el-input v-model="number" type="text" @input="numberInput"></el-input>
|
||||
<!-- <span class="inputs" :contenteditable="true" @input="numberInput" type="text" >{{ number }}</span> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="number_list_box">
|
||||
<div class="yd-keyboard">
|
||||
<div class="mini-number-box1">
|
||||
<div class="mini-number">
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('1')">1</div>
|
||||
<div class="key" @click="keyboradAdd('2')">2</div>
|
||||
<div class="key" @click="keyboradAdd('3')">3</div>
|
||||
<div
|
||||
class="key"
|
||||
style="font-size: 31px"
|
||||
@click="keyboradReduce"
|
||||
>
|
||||
<svg
|
||||
t="1723453480343"
|
||||
class="icon"
|
||||
viewBox="0 0 1664 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="1467"
|
||||
width="32"
|
||||
height="32"
|
||||
>
|
||||
<path
|
||||
d="M1526.08 1.6H459.84L41.28 416c-53.76 53.248-53.76 139.52 0 192.64l418.624 414.592v-0.064h1066.176a136.96 136.96 0 0 0 137.6-136.256V137.792a136.96 136.96 0 0 0-137.6-136.192z m-331.392 631.168c26.816 26.624 26.816 69.76 0 96.384-26.88 26.56-70.4 26.56-97.28 0l-121.28-120.128-123.328 122.112a69.76 69.76 0 0 1-97.92 0 68.096 68.096 0 0 1 0-96.96L878.208 512l-121.28-120.064a67.648 67.648 0 0 1 0-96.32c26.88-26.624 70.4-26.624 97.28 0l121.216 120.064 122.24-120.96a69.696 69.696 0 0 1 97.92 0 68.032 68.032 0 0 1 0 96.96l-122.24 120.96 121.344 120.064z"
|
||||
fill="#333333"
|
||||
p-id="1468"
|
||||
></path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('4')">4</div>
|
||||
<div class="key" @click="keyboradAdd('5')">5</div>
|
||||
<div class="key" @click="keyboradAdd('6')">6</div>
|
||||
<div class="key" @click="keyboradAdd('clear')">清空</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('7')">7</div>
|
||||
<div class="key" @click="keyboradAdd('8')">8</div>
|
||||
<div class="key" @click="keyboradAdd('9')">9</div>
|
||||
<div class="key"></div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('.')">.</div>
|
||||
<div class="key" @click="keyboradAdd('0')">0</div>
|
||||
<div class="key" @click="keyboradAdd('00')">00</div>
|
||||
<div class="key"></div>
|
||||
</div>
|
||||
<div class="confirm key" @click="confirm">确认</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="submit" @click="keyboradConfirm">确认</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: "支付",
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
number: '0',
|
||||
show:false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
number(newval) {
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
confirm(){
|
||||
|
||||
},
|
||||
open(){
|
||||
this.show=true
|
||||
},
|
||||
close(){
|
||||
this.show=false
|
||||
},
|
||||
numberInput(val){
|
||||
console.log(val)
|
||||
this.number=`${Number(val)}`
|
||||
},
|
||||
keyboradAdd(n) {
|
||||
if (n === "clear") {
|
||||
return (this.number = '0');
|
||||
}
|
||||
if(n==='.'){
|
||||
return this.number += this.number.includes('.')?'' : '.'
|
||||
}
|
||||
if (`${this.number}`.length<=1&&Number(this.number)===0) {
|
||||
return (this.number = n);
|
||||
}
|
||||
this.number += n;
|
||||
},
|
||||
keyboradReduce() {
|
||||
if (this.number.length <= 1) {
|
||||
return (this.number = this.isCanEmpty ? "" : "0");
|
||||
}
|
||||
this.number = this.number.substring(0, this.number.length - 1);
|
||||
},
|
||||
keyboradConfirm() {
|
||||
this.$emit("confirm", this.number);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pad-14 {
|
||||
padding: 14px;
|
||||
width: 100%;
|
||||
}
|
||||
::v-deep .el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-outer-spin-button{
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Firefox */
|
||||
::v-deep .el-input__inner {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
.number_list_box,
|
||||
.yd-keyboard,
|
||||
.mini-number,
|
||||
.mini-number-box1,
|
||||
.key-line {
|
||||
width: 100%;
|
||||
}
|
||||
.yd-keyboard {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number,
|
||||
.yd-keyboard {
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number {
|
||||
border-top: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box2 {
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mini-number-box2 .function-button {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.key,
|
||||
.key-line {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.key {
|
||||
width: 25%;
|
||||
height: 70px;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
align-items: center;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
font-size: 24px;
|
||||
color: #212121;
|
||||
text-align: center;
|
||||
line-height: 34px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
.key:hover {
|
||||
background-color: #dcdfe6;
|
||||
}
|
||||
.key:not(:last-child) {
|
||||
border-right: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.key-line:not(:last-child) {
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
.confirm {
|
||||
height: 142px;
|
||||
width: 25%;
|
||||
background: #22bf64;
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border-right: none;
|
||||
}
|
||||
.confirm:hover {
|
||||
background: rgba(34, 191, 100, 0.8666666666666667);
|
||||
}
|
||||
.simple-Keyboard-number,
|
||||
.simple-Keyboard-weight {
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.submit {
|
||||
width: 366px;
|
||||
height: 44px;
|
||||
background: #22bf64;
|
||||
border-radius: 2px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
margin-bottom: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.disabled-box {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.carts {
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.carts .title,
|
||||
.carts {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.carts .title {
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
padding: 20px;
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.carts .title .left {
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.carts .title .right {
|
||||
font-size: 14.4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.box_status {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
padding: 14px;
|
||||
align-items: flex-end;
|
||||
font-family: MicrosoftYaHei;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
.sym {
|
||||
font-size: 24px;
|
||||
color: #212121;
|
||||
width: 30px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.inputs {
|
||||
font-size: 28px;
|
||||
color: #212121;
|
||||
outline: none;
|
||||
line-height: 37px;
|
||||
border: none;
|
||||
max-width: 250px;
|
||||
}
|
||||
}
|
||||
::v-deep .el-input--small .el-input__inner{
|
||||
font-size: 28px;
|
||||
color: #212121;
|
||||
outline: none;
|
||||
line-height: 37px;
|
||||
border: none;
|
||||
max-width: 250px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.carts .box_status span {
|
||||
padding: 0 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
title="整单备注(提交订单时生效)"
|
||||
width="410px"
|
||||
:visible.sync="show"
|
||||
@close="reset"
|
||||
>
|
||||
<el-input
|
||||
:rows="6"
|
||||
type="textarea"
|
||||
v-model="note"
|
||||
placeholder="请输入备注"
|
||||
></el-input>
|
||||
<div>
|
||||
<el-tag
|
||||
v-for="(tag, index) in tags"
|
||||
@click="addNote(tag)"
|
||||
size="medium"
|
||||
:key="index"
|
||||
closable
|
||||
@close="delTag(index)"
|
||||
type="primary"
|
||||
>
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<el-button
|
||||
size="medium"
|
||||
@click="close"
|
||||
>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button size="medium"
|
||||
type="primary"
|
||||
@click="confirm">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
tags: [],
|
||||
note: "",
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
'tags.length'(){
|
||||
localStorage.setItem("tags", JSON.stringify(this.tags))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reset(){
|
||||
this.note=''
|
||||
},
|
||||
delTag(index){
|
||||
this.tags.splice(index,1)
|
||||
},
|
||||
addNote(tag) {
|
||||
if(this.note.length<=0){
|
||||
return this.note = tag
|
||||
}
|
||||
this.note = tag + "," + this.note;
|
||||
},
|
||||
open(note) {
|
||||
this.show = true;
|
||||
this.note=note
|
||||
const tags = localStorage.getItem("tags");
|
||||
console.log(tags)
|
||||
this.tags = tags ? JSON.parse(tags) : ["免香菜", "不要辣", "不要葱"];
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
confirm(){
|
||||
const originTags = [...this.tags]
|
||||
if(this.note.length>=1){
|
||||
if(originTags>=10){
|
||||
originTags.shift()
|
||||
}
|
||||
const newTags=new Set([this.note,...originTags])
|
||||
console.log(newTags)
|
||||
localStorage.setItem("tags", JSON.stringify([...newTags]));
|
||||
}
|
||||
this.$emit('confirm',this.note)
|
||||
this.close()
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-dialog__body{
|
||||
margin-bottom: 14px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
::v-deep .el-tag {
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
export const orderBtns=[
|
||||
{
|
||||
text: "删除",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "规格",
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
text: "菜品打折",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "赠菜",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "赠菜",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "打包",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "等叫",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "整单等叫",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "单品备注",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "退菜",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "附加费",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "存单",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "取单",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "修改价格",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "撤单",
|
||||
disabled: false,
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="title">选择支付方式</div>
|
||||
<div class="btn_group">
|
||||
<div class="price_select">
|
||||
<div class="pay_btns">
|
||||
<el-button
|
||||
size="medium"
|
||||
@click="changeSel(item)"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
:type="sel === item.payType ? 'primary' : ''"
|
||||
>
|
||||
{{ item.payName }}
|
||||
</el-button>
|
||||
<!-- <el-button size="medium"> 余额支付 </el-button>
|
||||
<el-button size="medium"> 现金支付 </el-button>
|
||||
<el-button size="medium"> 挂账 </el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { $getPayType } from "@/api/table";
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
sel: "",
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
sel(newval) {
|
||||
console.log(newval);
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changeSel(item) {
|
||||
this.sel = item.payType;
|
||||
this.$emit("itemClick", item);
|
||||
},
|
||||
async init() {
|
||||
const res = await $getPayType();
|
||||
this.list = res.filter(v=>v.isDisplay);
|
||||
console.log(res[0]);
|
||||
this.sel = this.sel ? this.sel : res[0].payType;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
font-weight: 600;
|
||||
padding: 20px 0;
|
||||
}
|
||||
.pay_btns .el-button {
|
||||
margin-left: 0;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<template>
|
||||
<el-dialog title="撤单" width="410px" :visible.sync="show" @close="reset">
|
||||
<div>
|
||||
<div><span>撤单原因</span> <span class="color-red">*</span></div>
|
||||
</div>
|
||||
|
||||
<div class="u-flex u-flex-wrap tags">
|
||||
<div
|
||||
class="tag"
|
||||
v-for="(tag, index) in tags"
|
||||
@click="changeSel(index)"
|
||||
:key="index"
|
||||
:class="{ active: tagSel == index }"
|
||||
>
|
||||
{{ tag }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-input
|
||||
v-model="note"
|
||||
size="medium"
|
||||
placeholder="请输入自定义备注"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-checkbox v-model="isPrint"
|
||||
>打印退菜单</el-checkbox
|
||||
>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<el-button size="medium" @click="close"> 取消 </el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isPrint:false,
|
||||
tagSel: -1,
|
||||
show: false,
|
||||
tags: ["人手不足", "店满无法招待", "顾客要求", "商品质量问题"],
|
||||
note: "",
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeSel(i) {
|
||||
this.tagSel = i;
|
||||
},
|
||||
reset() {
|
||||
this.note = "";
|
||||
},
|
||||
delTag(index) {
|
||||
this.tags.splice(index, 1);
|
||||
},
|
||||
addNote(tag) {
|
||||
if (this.note.length <= 0) {
|
||||
return (this.note = tag);
|
||||
}
|
||||
this.note = tag + "," + this.note;
|
||||
},
|
||||
open(note) {
|
||||
this.show = true;
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
confirm() {
|
||||
this.$emit("confirm", this.note);
|
||||
this.close();
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
margin-bottom: 14px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
::v-deep .el-tag {
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
.tags {
|
||||
.tag {
|
||||
margin: 10px 10px 0 0;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
padding: 10px 13px;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
&.active {
|
||||
color: #1890ff;
|
||||
background: #e8f4ff;
|
||||
border-color: #a3d3ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<template>
|
||||
<el-dialog title="退菜" width="410px" :visible.sync="show" @close="reset">
|
||||
<div>
|
||||
<div><span>退菜原因</span> <span class="color-red">*</span></div>
|
||||
</div>
|
||||
|
||||
<div class="u-flex u-flex-wrap tags">
|
||||
<div
|
||||
class="tag"
|
||||
v-for="(tag, index) in tags"
|
||||
@click="changeSel(tag)"
|
||||
:key="index"
|
||||
:class="{ active: tag.checked }"
|
||||
>
|
||||
{{ tag.label }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-input
|
||||
v-model="note"
|
||||
size="medium"
|
||||
placeholder="请输入自定义备注"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-checkbox v-model="isPrint"
|
||||
>打印退菜单</el-checkbox
|
||||
>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<el-button size="medium" @click="close"> 取消 </el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isPrint:false,
|
||||
tagSel: -1,
|
||||
show: false,
|
||||
tags: [{label:"不想要了",checked:false} ,{label:"食材不足",checked:false} ,{label:"等待时间过长",checked:false}],
|
||||
note: "",
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeSel(item) {
|
||||
item.checked = !item.checked ;
|
||||
},
|
||||
reset() {
|
||||
this.note = "";
|
||||
},
|
||||
delTag(index) {
|
||||
this.tags.splice(index, 1);
|
||||
},
|
||||
addNote(tag) {
|
||||
if (this.note.length <= 0) {
|
||||
return (this.note = tag);
|
||||
}
|
||||
this.note = tag + "," + this.note;
|
||||
},
|
||||
open(note) {
|
||||
this.show = true;
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
confirm() {
|
||||
this.$emit("confirm", this.note);
|
||||
this.close();
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
margin-bottom: 14px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
::v-deep .el-tag {
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
.tags {
|
||||
.tag {
|
||||
margin: 10px 10px 0 0;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
padding: 10px 13px;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
&.active {
|
||||
color: #1890ff;
|
||||
background: #e8f4ff;
|
||||
border-color: #a3d3ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
<template>
|
||||
<el-dialog width="400px" :title="title" :visible.sync="show" @close="reset">
|
||||
<div class="u-p-15">
|
||||
<div v-if="openSwitch">
|
||||
<el-button
|
||||
size="medium"
|
||||
@click="changeKey('paysSel', index)"
|
||||
v-for="(item, index) in pays"
|
||||
:key="index"
|
||||
:type="paysSel == index ? 'success' : ''"
|
||||
>{{ item.text }}</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-alert
|
||||
:closable="false"
|
||||
v-if="tips"
|
||||
:title="tips"
|
||||
type="warning"
|
||||
show-icon
|
||||
>
|
||||
</el-alert>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<template v-if="paysSel == 0">
|
||||
<el-form label-width="90px" label-position="left">
|
||||
<el-form-item label="应付金额">
|
||||
<el-input :value="form.money" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款码">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
@change="codeInputChange"
|
||||
placeholder="请扫码或者输入付款码"
|
||||
ref="refInputCode"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<div class="u-flex u-row-center u-m-t-50">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="u-text-center">
|
||||
<div class="u-flex u-row-center">
|
||||
<img :src="codeImg" class="codeImg" alt="" />
|
||||
</div>
|
||||
<div class="color-333 u-font-20 u-m-t-20">32.00元</div>
|
||||
<div class="color-aaa u-font-12 u-m-t-10">
|
||||
<i class="el-icon-loading"></i>
|
||||
<span>等待用户支付</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
openSwitch: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "支付",
|
||||
},
|
||||
price: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
defaultTips: {
|
||||
type: String,
|
||||
default: "请使用扫码枪扫描付款码",
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tips: "",
|
||||
paysSel: 0,
|
||||
form: {
|
||||
money: "",
|
||||
code: "",
|
||||
},
|
||||
codeImg:
|
||||
"https://zhyx.eingdong.com/qrcode/api.php?url=https%3A%2F%2Fzhyx.eingdong.com%2Fcopyright%2F%23%2Fpay%3Fid%3D139451580",
|
||||
pays: [
|
||||
{
|
||||
text: "主扫",
|
||||
},
|
||||
{
|
||||
text: "被扫",
|
||||
},
|
||||
],
|
||||
number: "0",
|
||||
show: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
defaultTips(val) {
|
||||
this.tips = val;
|
||||
},
|
||||
price(val) {
|
||||
console.log(val);
|
||||
this.form.money = Number(val).toFixed(2);
|
||||
},
|
||||
paysSel(newval) {
|
||||
if (newval == 0) {
|
||||
this.tips = "请使用扫码枪扫微信/支付宝收款码";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refInputCode.focus();
|
||||
});
|
||||
} else {
|
||||
this.tips = "请用户使用微信/支付宝扫描付款码";
|
||||
}
|
||||
},
|
||||
number(newval) {
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
codeInputChange(e){
|
||||
console.log(e)
|
||||
// this.$emit("confirm", this.form.code);
|
||||
},
|
||||
reset() {
|
||||
// this.form.money=''
|
||||
this.form.code = "";
|
||||
this.paysSel = 0;
|
||||
},
|
||||
changeKey(key, val) {
|
||||
this[key] = val;
|
||||
},
|
||||
|
||||
confirm() {
|
||||
if(!this.form.code){
|
||||
return this.$message.error("请输入或扫付款码")
|
||||
}
|
||||
this.close()
|
||||
this.$emit("confirm", this.form.code);
|
||||
},
|
||||
open() {
|
||||
this.show = true;
|
||||
this.form.money = Number(this.price).toFixed(2);
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refInputCode.focus();
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
numberInput(val) {
|
||||
console.log(val);
|
||||
this.number = `${Number(val)}`;
|
||||
},
|
||||
keyboradConfirm() {
|
||||
this.$emit("confirm", this.number);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
this.tips = this.defaultTips;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.codeImg {
|
||||
width: 160px;
|
||||
border: 1px solid rgb(220, 223, 230);
|
||||
height: 160px;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,47 @@
|
|||
//判断商品是否可以下单
|
||||
export function isCanBuy(goods,isStock) {
|
||||
return goods.isGrounding && goods.isPauseSale == 0 && (isStock?goods.stockNumber > 0:true) ;
|
||||
}
|
||||
|
||||
// 一个数组是否包含另外一个数组全部元素
|
||||
export function arrayContainsAll(arr1, arr2) {
|
||||
for (let i = 0; i < arr2.length; i++) {
|
||||
if (!arr1.includes(arr2[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//n项 n-1项组合,生成全部结果
|
||||
export function generateCombinations(arr, k) {
|
||||
let result = [];
|
||||
|
||||
function helper(index, current) {
|
||||
if (current.length === k) {
|
||||
result.push(current.slice()); // 使用slice()来避免直接修改原始数组
|
||||
} else {
|
||||
for (let i = index; i < arr.length; i++) {
|
||||
current.push(arr[i]); // 将当前元素添加到组合中
|
||||
helper(i + 1, current); // 递归调用,索引增加以避免重复选择相同的元素
|
||||
current.pop(); // 回溯,移除当前元素以便尝试其他组合
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
helper(0, []); // 从索引0开始,初始空数组作为起点
|
||||
return result;
|
||||
}
|
||||
|
||||
export function returnReverseVal(val, isReturnString = true) {
|
||||
const isBol = typeof val === "boolean";
|
||||
const isString = typeof val === "string";
|
||||
let reverseNewval = "";
|
||||
if (isBol) {
|
||||
reverseNewval = !val;
|
||||
}
|
||||
if (isString) {
|
||||
reverseNewval = val === "true" ? "false" : "true";
|
||||
}
|
||||
return reverseNewval;
|
||||
}
|
||||
Loading…
Reference in New Issue