新增结算页面
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<SemiSelect />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="item number" @click="takeFoodCodeRef.show()">
|
||||
<div class="item number" @click="props.item.id && takeFoodCodeRef.show()">
|
||||
<el-text class="num">{{ props.item.number || 1 }}</el-text>
|
||||
</div>
|
||||
<div class="item" @click="numberChange('add')">
|
||||
@@ -13,7 +13,7 @@
|
||||
<CloseBold />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="item" :class="{ disabled: !props.item.tbProductSpec }" @click="showSkuModal">
|
||||
<div class="item" :class="{ disabled: (props.item.id && !props.item.tbProductSpec) }" @click="showSkuModal">
|
||||
<el-icon class="icon">
|
||||
<Filter />
|
||||
</el-icon>
|
||||
@@ -31,19 +31,19 @@
|
||||
</el-icon>
|
||||
<el-text class="t">打包</el-text>
|
||||
</div>
|
||||
<div class="item" @click="emit('delete', props.item)">
|
||||
<div class="item" @click="props.item.id && emit('delete', props.item)">
|
||||
<el-icon class="icon">
|
||||
<Delete />
|
||||
</el-icon>
|
||||
<el-text class="t">删除</el-text>
|
||||
</div>
|
||||
<div class="item" @click="emit('pending', props.item)">
|
||||
<div class="item" @click="props.item.id && emit('pending', props.item)">
|
||||
<el-icon class="icon">
|
||||
<Sell />
|
||||
</el-icon>
|
||||
<el-text class="t">挂单</el-text>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="item" @click="props.item.id && emit('clearCart')">
|
||||
<el-icon class="icon">
|
||||
<RefreshRight />
|
||||
</el-icon>
|
||||
@@ -65,13 +65,14 @@ const props = defineProps({
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['confirm', 'delete', 'pending'])
|
||||
const emit = defineEmits(['confirm', 'delete', 'pending', 'clearCart'])
|
||||
|
||||
const takeFoodCodeRef = ref(null)
|
||||
const skuModalRef = ref([])
|
||||
|
||||
// 赠送打包操作
|
||||
function giftPackHandle(key) {
|
||||
if (!props.item.id) return
|
||||
if (props.item[key] == 'true') {
|
||||
props.item[key] = false
|
||||
} else {
|
||||
@@ -82,6 +83,7 @@ function giftPackHandle(key) {
|
||||
|
||||
// 加减修改数量
|
||||
function numberChange(t) {
|
||||
if (!props.item.id) return
|
||||
switch (t) {
|
||||
case 'sub':
|
||||
if (props.item.number <= 1) return
|
||||
@@ -98,12 +100,14 @@ function numberChange(t) {
|
||||
|
||||
// 输入修改数量
|
||||
function updateNumber(num) {
|
||||
if (!props.item.id) return
|
||||
props.item.number = num
|
||||
emit('confirm', props.item)
|
||||
}
|
||||
|
||||
// 显示规格
|
||||
function showSkuModal() {
|
||||
if (!props.item.id) return
|
||||
if (props.item.tbProductSpec && props.item.tbProductSpec.specList) {
|
||||
skuModalRef.value.show(props.item, 'cart')
|
||||
}
|
||||
@@ -111,7 +115,7 @@ function showSkuModal() {
|
||||
|
||||
// 修改规格
|
||||
function skuConfirm(e) {
|
||||
console.log(e)
|
||||
if (!props.item.id) return
|
||||
emit('confirm', e)
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user