代码更新
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
<!-- 占位 -->
|
||||
<view class="u-p-t-32 color-666 border-bottom u-p-r-28 u-p-b-32 u-p-l-28 u-flex u-row-between"
|
||||
style="opacity: 0;">
|
||||
<view>已添加{{goodsNumber}}件商品</view>
|
||||
<view>已添加{{goodsNumber.toFixed(0)}}件商品</view>
|
||||
<view class="color-666">
|
||||
<uni-icons color="#666" type="trash"></uni-icons>
|
||||
<text class="u-m-l-10">清空</text>
|
||||
@@ -30,13 +30,13 @@
|
||||
<view class="u-m-t-10 u-font-24 color-666 u-line-1">{{item.specSnap||''}}</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<view class="font-bold red u-m-r-32">¥{{formatPrice(item.salePrice*item.number) }}</view>
|
||||
<view class="font-bold red u-m-r-32">¥{{formatPrice(item.lowPrice*item.number) }}</view>
|
||||
<view class="u-flex" @tap="updateNumber(false,index,item)">
|
||||
<image src="/pagesCreateOrder/static/images/icon-reduce-black.svg" class="icon" mode="">
|
||||
</image>
|
||||
</view>
|
||||
<view class="u-m-l-30 u-m-r-30 color-333">
|
||||
{{(item.number).toFixed(2)}}
|
||||
{{item.number.toFixed(2)}}
|
||||
</view>
|
||||
<view class="u-flex" @tap="updateNumber(true,index,item)">
|
||||
<image src="/pagesCreateOrder/static/images/icon-add-black.svg" class="icon" mode="">
|
||||
@@ -107,10 +107,6 @@
|
||||
tableId: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
masterId: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
const modal = reactive({
|
||||
@@ -125,9 +121,9 @@
|
||||
}
|
||||
|
||||
function setModalShow(key = 'show', show = true) {
|
||||
if (key == 'clear' && show && props.data.length <= 0) {
|
||||
return infoBox.showToast('购物车是空的!')
|
||||
}
|
||||
// if (key == 'clear' && show && props.data.length <= 0) {
|
||||
// return infoBox.showToast('购物车是空的!')
|
||||
// }
|
||||
modal.key = key
|
||||
modal[key] = show
|
||||
console.log(modal);
|
||||
@@ -153,38 +149,36 @@
|
||||
}
|
||||
|
||||
function toConfimOrder() {
|
||||
console.log(props.user);
|
||||
console.log(props.table);
|
||||
if (props.data.length <= 0) {
|
||||
return infoBox.showToast('还没有选择商品')
|
||||
}
|
||||
const {
|
||||
tableId,
|
||||
name,
|
||||
maxCapacity,
|
||||
status,
|
||||
type
|
||||
} = props.table
|
||||
if (props.table.tableId == '') {
|
||||
|
||||
if (props.table.id == '') {
|
||||
go.to('PAGES_CONFIRM_ORDER', {
|
||||
masterId: props.masterId,
|
||||
isCreateOrderToDetail: props.isCreateOrderToDetail ? 1 : 0
|
||||
})
|
||||
return
|
||||
}
|
||||
go.to('PAGES_CONFIRM_ORDER', {
|
||||
masterId: props.masterId,
|
||||
type,
|
||||
tableId,
|
||||
name,
|
||||
maxCapacity,
|
||||
status,
|
||||
type: type,
|
||||
tableId: props.table.id,
|
||||
name:name,
|
||||
maxCapacity:maxCapacity,
|
||||
status:status,
|
||||
isCreateOrderToDetail: props.isCreateOrderToDetail ? 1 : 0
|
||||
})
|
||||
}
|
||||
|
||||
const allPrice = computed(() => {
|
||||
return props.data.reduce((prve, cur) => {
|
||||
return prve + cur.salePrice * cur.number
|
||||
return prve + cur.lowPrice * cur.number
|
||||
}, 0).toFixed(2)
|
||||
})
|
||||
|
||||
@@ -193,6 +187,7 @@
|
||||
result = props.data.reduce((prve, cur) => {
|
||||
return prve + cur.number
|
||||
}, 0)
|
||||
// console.log(result)
|
||||
return result >= 99 ? 99 : result
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user