合并代码

This commit is contained in:
duan 2024-10-31 16:47:16 +08:00
commit 7605773087
17 changed files with 284 additions and 157 deletions

View File

@ -0,0 +1,27 @@
export function canComputedPackFee(v) {
return v.pack && v.status != 'return' && v.status != 'refund' && v.status != 'refunding'
}
export function returnCanComputedGoodsArr(arr) {
return arr.filter(v=>canComputedPackFee(v))
}
export function returnPackFee(arr) {
return arr.reduce((prve, cur) => {
return prve + cur.packAmount
}, 0).toFixed(2)
}
export function canTuicai(orderInfo,item){
return orderInfo.status=='unpaid'&&orderInfo.useType!='dine-in-before'&& item.status!='return'
}
export function canTuiKuan(orderInfo,item){
return orderInfo.status!='unpaid'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding'
}
export function isTui(item){
return item.status=='return'||item.status=='refund'||item.status=='refunding'
}
export function numSum(arr){
const sum=arr.reduce((a,b)=>{
return a+b*100
},0)
return (sum/100).toFixed(2)
}

View File

@ -11,7 +11,7 @@
<view class="u-m-t-40 u-flex ">
<view>实收金额</view>
<view class="u-m-l-32 border u-p-l-10 u-p-r-10 u-flex-1">
<uni-easyinput style="digit" @input="currentPriceInput" @change="currentPriceChange" paddingNone :inputBorder="false"
<uni-easyinput type="number" @input="currentPriceInput" @change="currentPriceChange" paddingNone :inputBorder="false"
v-model="form.currentPrice"
placeholder="输入实际金额"></uni-easyinput>
</view>
@ -20,7 +20,7 @@
<view>优惠折扣</view>
<view class="u-m-l-32 u-flex-1 u-flex border u-p-l-10 u-p-r-10">
<view class="u-flex-1">
<uni-easyinput @input="discountInput" @change="discountChange" style="digit" paddingNone :inputBorder="false"
<uni-easyinput type="number" @input="discountInput" @change="discountChange" paddingNone :inputBorder="false"
v-model="form.discount"
placeholder="输入折扣"></uni-easyinput>
</view>

View File

@ -17,13 +17,13 @@ import infoBox from "@/commons/utils/infoBox.js"
import go from '@/commons/utils/go.js';
import { reject } from 'lodash';
// 测试服
let baseUrl = 'https://admintestpapi.sxczgkj.cn'
// let baseUrl = 'https://admintestpapi.sxczgkj.cn'
//预发布
// let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
//正式
// let baseUrl = 'https://cashieradmin.sxczgkj.cn'
let baseUrl = 'https://cashieradmin.sxczgkj.cn'
// 王伟本地测
// let baseUrl = '/ww'

View File

@ -42,7 +42,6 @@ onShow(() => {
const saveImage = () => {
// #ifdef APP-PLUS
saveQrcodeImg()
uni.downloadFile({
url: vdata.QrcodeUrl,
success: (res) => {
@ -92,16 +91,6 @@ function downloadQR() {
}
//#endif
const saveQrcodeImg = () => {
saveHeadImgFile(vdata.QrcodeUrl, 80)
.then((success) => {
infoBox.showSuccessToast('保存成功')
})
.catch((err) => {
console.log(err)
infoBox.showErrorToast('保存失败')
})
}
const saveWxQrcodeImg = (data) => {
const fileManager = wx.getFileSystemManager()

View File

@ -298,9 +298,11 @@
const isSku = computed(() => {
return props.goods.typeEnum == 'sku'
})
let isBindGuige = ref(isSku.value)
let isBindGuige = ref(false)
watch(() => props.goods.typeEnum, (newval) => {
isBindGuige.value = isSku.value
if(!newval){
isBindGuige.value = false
}
})
@ -385,7 +387,6 @@
$haocaiMap[item.id] = item
}
haoCaiList.value = res.content
})
tbShopCurrencyGet({
page: 0,
@ -400,6 +401,8 @@
}
onMounted(() => {
init()
const firstItem= props.goods.conInfos[0]
isBindGuige.value=firstItem?(firstItem.productSkuId==0?false:true):false
})
</script>

View File

@ -143,6 +143,11 @@
// icon: '/static/indexImg/icon-staff.svg',
// pageUrl: 'PAGES_USER'
// },
{
title: '订阅通知',
icon: '/static/indexImg/icon-notification.svg',
pageUrl: 'PAGES_NOTIFICATION_INDEX',
},
{
title: '设置中心',
icon: '/static/indexImg/icon-cashier.svg',

View File

@ -166,7 +166,7 @@
async function getTable() {
// let state=status.list[status.active].key
// state=state?(state=='all'?'':state):''
const areaId=area.list[area.defaultCateIndex].id
const areaId=area.list[area.defaultCateIndex].id||''
let {
content,total
} = await $table.get({...query,areaId,name:searchValue.value,state:'idle'})

View File

@ -40,7 +40,7 @@
</view>
</view>
</view>
<!-- <view class="u-p-b-24 u-m-b-24 border-bottom">
<view>就餐类型</view>
<view class="u-m-t-24 u-flex ">
@ -67,7 +67,7 @@
</view>
<template v-if="user">
<template v-if="user&&user.id">
<view class="block">
<view class="">
<view class="u-flex border-bottom u-p-b-24 ">
@ -116,7 +116,7 @@
<view class="u-p-b-24 ">
<view class="font-bold">订单备注</view>
<view class="u-m-t-32 u-flex ">
<uni-easyinput type="textarea" v-model="note" placeholder="请输入备注"></uni-easyinput>
<uni-easyinput type="textarea" v-model="note" placeholder="请输入备注"></uni-easyinput>
</view>
</view>
@ -183,7 +183,7 @@
<button class="tag" hover-class="hover-class"
@tap="toggleGoodsItemKey(item,index,'isGift')">{{item.isGift?'取消赠送':'赠送'}}</button>
</view>
<view class="u-flex u-m-r-20 " >
<view class="u-flex u-m-r-20 ">
<button class="tag" hover-class="hover-class"
@tap="toggleGoodsItemKey(item,index,'isPack')">{{item.isPack?'取消打包':'打包'}}</button>
</view>
@ -201,24 +201,24 @@
</view>
<view class="border-bottom">
<template v-if="$seatFee&&$seatFee.totalAmount">
<view class="u-flex u-row-between u-m-t-18 u-p-b-34 ">
<view class="u-flex u-row-between u-m-t-18 u-p-b-34 ">
<view>
<text >桌位费</text>
<text>桌位费</text>
</view>
<view>{{$seatFee.totalAmount||'0.00'}}</view>
</view>
</template>
<template v-if="$packFee>0">
<view class="u-flex u-row-between u-m-t-18 u-p-b-34 ">
<view class="u-flex u-row-between u-m-t-18 u-p-b-34 ">
<view>
<text >打包费</text>
<text>打包费</text>
</view>
<view>{{$packFee||'0.00'}}</view>
</view>
</template>
</view>
<view class="u-flex u-row-right u-m-t-38">
<!-- <template v-if="$shop.registerType=='munchies'">
@ -273,7 +273,9 @@
computed,
watch
} from 'vue';
import {getSafeBottomHeight} from '@/commons/utils/safe-bottom.js'
import {
getSafeBottomHeight
} from '@/commons/utils/safe-bottom.js'
import modelDiscount from './components/discount'
import giveFood from './components/give-food'
import oneRemark from './components/remark'
@ -291,7 +293,9 @@
import {
getNowCart
} from '@/pagesCreateOrder/util.js'
import {hasPermission} from '@/commons/utils/hasPermission.js'
import {
hasPermission
} from '@/commons/utils/hasPermission.js'
const models = new Map();
const modelData = reactive({
data: {},
@ -311,7 +315,7 @@
modelData.selIndex = index
const model = models.get(key)
model && model.open({
remark: modelData.data.note||''
remark: modelData.data.note || ''
})
}
@ -325,7 +329,7 @@
const userNumbers = reactive({
list: new Array(100).fill(1).map((v, index) => {
// return index === 0 ? '' : index + ''
return (index+1)+ '人'
return (index + 1) + '人'
}),
defaultCateIndex: 0,
})
@ -336,15 +340,23 @@
//
async function updateChoseCount() {
console.log($shop.value);
if (!$shop.value.isTableFee&& table.value.tableId) {
const maxCapacity = table.value.tableId ? (table.value.maxCapacity || 0) : 100
if (table.value.tableId && userNumbers.defaultCateIndex * 1 + 1 > maxCapacity) {
uni.showToast({
title: '当前台桌最大人数为: ' + maxCapacity
})
userNumbers.defaultCateIndex=maxCapacity-1
return
}
if (!$shop.value.isTableFee && table.value.tableId) {
//
const res = await Api.$choseCount({
masterId: option.masterId,
tableId: table.value.tableId,
num: userNumbers.defaultCateIndex+1,
tableId: table.value.tableId || '',
num: userNumbers.defaultCateIndex * 1 + 1,
})
Object.assign($seatFee, res)
userNumbers.defaultCateIndex = res.totalNumber-1
userNumbers.defaultCateIndex = res.totalNumber - 1
}
}
@ -362,14 +374,15 @@
skuId,
id,
number,
isPack,isGift
isPack,
isGift
} = item
const par = {
cartId:id,
cartId: id,
isPack,
isGift,
masterId: option.masterId,
tableId: table.value.tableId,
tableId: table.value.tableId || '',
productId,
num: number,
skuId
@ -377,7 +390,7 @@
par[key] = !item[key]
const res = await Api.$updateCart(par)
goods.list[index][key] = returnBoolean(res[key])
if(key=='isPack'){
if (key == 'isPack') {
getCart()
}
}
@ -400,11 +413,11 @@
],
active: 'dine-in'
})
const $packFee=computed(()=>{
return goods.list.reduce((prve,cur)=>{
return prve+cur.packFee
},0).toFixed(2)
const $packFee = computed(() => {
return goods.list.reduce((prve, cur) => {
return prve + cur.packFee
}, 0).toFixed(2)
})
function chooseUser() {
@ -427,7 +440,7 @@
console.log(option);
const submitPar = {
masterId: option.masterId,
tableId: table.value.tableId,
tableId: table.value.tableId || "",
vipUserId: user.value.id ? user.value.id : '',
type: user.value.id ? 0 : 1 //0 1
}
@ -481,16 +494,16 @@
})
const goodsPrice = computed(() => {
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
const tPrice=cur.salePrice * cur.number
const tPrice = cur.salePrice * cur.number
console.log(cur.isPack);
const tpackFee=cur.isPack? cur.packFee*1:0
return prve +(cur.isGift?0:tPrice) +tpackFee
const tpackFee = cur.isPack ? cur.packFee * 1 : 0
return prve + (cur.isGift ? 0 : tPrice) + tpackFee
}, 0)
return (goodsTotalPrice|| 0).toFixed(2)
return (goodsTotalPrice || 0).toFixed(2)
})
const allPrice = computed(() => {
console.log(goodsPrice.value);
const n=goodsPrice.value*1 + $seatFee.totalAmount
const n = goodsPrice.value * 1 + $seatFee.totalAmount
return n.toFixed(2)
// const goodsTotalPrice = goods.list.reduce((prve, cur) => {
// return prve + cur.salePrice * cur.number * (cur.isGift ? 0 : 1)
@ -510,7 +523,7 @@
page: 0,
size: 300,
masterId: option.masterId,
tableId: table.value.tableId
tableId: table.value.tableId || ''
}) {
const {
records,
@ -524,10 +537,10 @@
}
goods.list = getNowCart(records)
if (seatFee && seatFee.totalNumber) {
userNumbers.defaultCateIndex = seatFee.totalNumber-1 || 0
userNumbers.defaultCateIndex = seatFee.totalNumber - 1 || 0
Object.assign($seatFee, seatFee)
}else{
$seatFee.totalAmount=0
} else {
$seatFee.totalAmount = 0
}
console.log(userNumbers.defaultCateIndex);
}
@ -550,20 +563,20 @@
note: note.value,
postPay: true,
orderId: '',
tableId: table.value.tableId
tableId: table.value.tableId || ''
}) {
if (!$shop.value.isTableFee) {
//
await Api.$choseCount({
masterId: option.masterId,
tableId: table.value.tableId,
num: userNumbers.defaultCateIndex+1,
tableId: table.value.tableId || "",
num: userNumbers.defaultCateIndex + 1,
})
}
if ($shop.value.registerType == 'munchies'||eatTypes.active=='takeout') {
const canJiesuan=await hasPermission('允许收款')
if(!canJiesuan){
return
if ($shop.value.registerType == 'munchies' || eatTypes.active == 'takeout') {
const canJiesuan = await hasPermission('允许收款')
if (!canJiesuan) {
return
}
}
// updateChoseCount()
@ -571,21 +584,20 @@
uni.$emit('update:createOrderIndex')
console.log($shop.value);
console.log(res);
if ($shop.value.registerType == 'munchies'||eatTypes.active=='takeout') {
if ($shop.value.registerType == 'munchies' || eatTypes.active == 'takeout') {
//
return go.to('PAGES_ORDER_PAY', {
orderId: res.id,
isNowPay:true
},'redirect'
)
isNowPay: true
}, 'redirect')
} else {
//
console.log(option.isCreateOrderToDetail);
if (option.isCreateOrderToDetail!='0') {
if (option.isCreateOrderToDetail != '0') {
console.log('PAGES_ORDER_DETAIL');
go.to('PAGES_ORDER_DETAIL', {
id: res.id
},'redirect')
}, 'redirect')
} else {
console.log('back');
uni.navigateBack({
@ -616,7 +628,7 @@
cartId: cart.id,
productId: cart.productId,
skuId: cart.skuId,
tableId: option.tableId,
tableId: option.tableId || "",
note: e.remark,
num: cart.number // 0
})
@ -634,22 +646,27 @@
onLoad((opt) => {
Object.assign(option, opt)
console.log(option,);
console.log(opt);
if (opt) {
table.value = {
tableId: opt.tableId,
...option,
tableId: opt.tableId || '',
name: opt.name
}
userNumbers.list = new Array(opt.maxCapacity?opt.maxCapacity*1:100).fill(1).map((v, index) => {
return (index + 1) + '人'
})
// console.log(userNumbers.list);
}
init()
// updateChoseCount()
})
let bottomHeight=ref(100)
onReady(()=>{
getSafeBottomHeight('safe-bottom').then(res=>{
let bottomHeight = ref(100)
onReady(() => {
getSafeBottomHeight('safe-bottom').then(res => {
console.log(res);
bottomHeight.value=res
bottomHeight.value = res
})
})
@ -668,12 +685,12 @@
uni.setStorageSync("useType", useType);
}
const tableId = useType == 'takeout' ? undefined : table.value.tableId;
if(!goods.list.length){
if (!goods.list.length) {
return
}
const res = await Api.$changeUseType({
useType,
tableId,
tableId: tableId || '',
cartIds: goods.list.map((v) => v.id),
})
getCart()
@ -712,6 +729,7 @@
border-radius: 18rpx;
margin-bottom: 32rpx;
}
.textarea {
border-radius: 12rpx 12rpx 12rpx 12rpx;
padding: 32rpx 0 32rpx 24rpx;
@ -722,6 +740,7 @@
.goods {
// padding-bottom: 30rpx;
border-bottom: 1px dashed #E5E5E5;
.item {
.img {
width: 84rpx;

View File

@ -448,21 +448,26 @@
})
console.log(res);
if (res && res.content[0]) {
// data.table=res.content[0]
data.table={...res.content[0],...data.table}
}
}
}
let $originGoods = []
let $category = []
async function init() {
const masterRes = await getMasterId()
data.masterId = masterRes.masterId
if(option.type=='add'){
data.masterId = option.masterId
setTabBar($category, $originGoods, [])
}else{
const masterRes = await getMasterId()
data.masterId = masterRes.masterId
}
const shopInfo = await tbShopInfo()
$shop.value = shopInfo
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
uni.setStorageSync('useType', useType)
console.log(shopInfo);
getTableInfo()
await getTableInfo()
const categoryRes = await getCategory()
const category = categoryRes.content.reduce((prve, cur) => {
prve.push({
@ -482,16 +487,24 @@
return isShow;
});
$originGoods = goods
if (!data.table.tableId) {
//
console.log(option);
if(option.type=='add'){
cars.length = 0
setTabBar(category, goods, [])
return
}
const {
masterId
} = await getMasterId()
data.masterId = masterId
if (!data.table.tableId) {
//
const cartRes = await getCart()
cars.length = 0
const cartArr = getNowCart(cartRes.records)
for (let i in cartArr) {
cars.push(cartArr[i])
}
setTabBar(category, goods, cars)
return
}
const cartRes = await getCart()
cars.length = 0
const cartArr = getNowCart(cartRes.records)
@ -1089,7 +1102,9 @@
})
}
watch(() => data.table.tableId, (newval, oldval) => {
onSelTable()
if(option.type!='add'){
onSelTable()
}
})
async function onSelTable() {
const {

View File

@ -1,30 +1,30 @@
<template>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20" v-if="packeFee>0||data.totalAmount>0">
<view class="default-box-padding bg-fff border-r-12 u-m-t-20" v-if="packeFee>0||data.priceAmount>0">
<view class="u-flex u-row-between">
<view class="font-bold">附加费</view>
<template v-if="orderInfo.status=='unpaid'&&data.status!='return'">
<template v-if="extraCanTuicai(orderInfo,data)">
<my-button plain shape="circle" :width="160" :height="56" @click="tuicai">退菜</my-button>
</template>
<template v-if="orderInfo.status=='closed'&&data.status!='return'">
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
<template v-if=" extraCanTuiKuan(orderInfo,data)">
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
</template>
</view>
<view>
<template v-if="data.status!='return'">
<view class="u-flex u-row-between u-m-t-24">
<view>{{data.name||'餐位费'}}</view>
<view>x{{data.number||0}}</view>
<view class="price-min-width">{{data.totalAmount}}</view>
<template v-if="data.status!='return'&&data.status!='refund'&&data.status!='refunding'">
<view class="u-flex u-row-between u-m-t-24" v-if="data.priceAmount*1>0">
<view>{{data.productName||'餐位费'}}</view>
<view>x{{data.num||0}}</view>
<view class="price-min-width">{{data.priceAmount}}</view>
</view>
</template>
<template v-else>
<view class="u-flex u-row-between u-m-t-24 color-999">
<view class="u-flex">
<view class="line-th ">{{data.name||'餐位费'}}</view>
<view class="tag yitui u-m-l-10">已退</view>
<view class="line-th ">{{data.productName||'餐位费'}}</view>
<view class="tag yitui u-m-l-10">{{data.status=='refunding'?'退款中': '已退'}}</view>
</view>
<view class="line-th">x{{data.number||0}}</view>
<view class="line-th">{{data.totalAmount}}</view>
<view class="line-th">x{{data.num||0}}</view>
<view class="line-th">{{data.priceAmount}}</view>
</view>
</template>
<!-- <view class="u-flex u-row-right u-m-t-24">
@ -49,6 +49,16 @@
import {
computed
} from 'vue'
import {
returnCanComputedGoodsArr,canComputedPackFee,
returnPackFee
} from '@/commons/utils/goodsUtil.js'
function extraCanTuicai(orderInfo,data){
return orderInfo.status=='unpaid'&&data.status!='return'&&data.priceAmount*1>0
}
function extraCanTuiKuan(orderInfo,data){
return orderInfo.status=='closed'&&data.status!='return'&&data.priceAmount*1>0
}
const props = defineProps({
data: {
type: Object,
@ -72,16 +82,16 @@
return 0
}
return props.orderInfo.detailList.reduce((prve, cur) => {
return prve + (cur.packAmount>0?cur.num:0)
return prve + (cur.packAmount > 0 ? cur.num : 0)
}, 0)
})
const packeFee = computed(() => {
if (!props.orderInfo.detailList) {
return 0
}
return props.orderInfo.detailList.reduce((prve, cur) => {
return prve + cur.packAmount
}, 0).toFixed(2)
const arr = returnCanComputedGoodsArr(props.orderInfo.detailList)
console.log(arr);
return returnPackFee(arr)
})
const statusMap = {
@ -113,7 +123,8 @@
color: #fff;
}
}
.price-min-width{
.price-min-width {
min-width: 100rpx;
text-align: right;
}

View File

@ -23,10 +23,10 @@
<view class="">
<view class="u-flex">
<view class="tui" v-if="item.status=='return'||item.status=='refund'">
已退
<view class="tui" v-if="isTui(item)">
{{item.status=='refunding'?'退款中':'已退'}}
</view>
<view :class="{'line-th':item.status=='return'||item.status=='refund'}">{{item.name||item.productName}}
<view :class="{'line-th':item.status=='return'||item.status=='refund'||item.status=='refunding'}">{{item.name||item.productName}}
</view>
</view>
<view class="u-flex u-m-t-8">
@ -49,7 +49,7 @@
</view>
</view>
<view class="u-text-right u-m-t-28">
<template v-if="item.status=='return'||item.gift||item.status=='refund'">
<template v-if="isTui(item)">
<view>0.00</view>
<view class="line-th color-666 ">{{returnTotalMoney(item)}}
</view>
@ -62,20 +62,18 @@
</view>
</view>
</view>
<template v-if="orderInfo.status=='unpaid'&&orderInfo.useType!='dine-in-before'">
<view class="u-flex u-row-right gap-20 u-m-t-24" v-if="item.status!='return'">
<template v-if="canTuicai(orderInfo,item)">
<view class="u-flex u-row-right gap-20 u-m-t-24">
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
<my-button :width="128" :height="48" plain shape="circle" @tap="tuicai(item,index)"><text
class="no-wrap">退菜</text></my-button>
</view>
</template>
<template v-if="item.status!='refund'&&!item.gift">
<template v-if="orderInfo.status=='closed'||orderInfo.status=='refund'">
<view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'">
<template v-if="canTuiKuan(orderInfo,item)">
<view class="u-flex u-row-right gap-20 u-m-t-20">
<my-button :width="128" :height="48" plain shape="circle"
@tap="tuikuan(item,index)"><text class="no-wrap">退款</text> </my-button>
</view>
</template>
</template>
</view>
@ -131,6 +129,7 @@
<view></view>
<view>
<text>总计</text>
<!-- <text class="font-bold u-font-32">{{numSum([allPrice,seatFeePrice,packFee]) }}</text> -->
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1+packFee*1) }}</text>
</view>
</view>
@ -149,6 +148,7 @@
import {
hasPermission
} from '@/commons/utils/hasPermission.js'
import {isTui,canTuiKuan,canTuicai,numSum} from '@/commons/utils/goodsUtil.js'
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
function returnTotalMoney(item) {
@ -193,10 +193,10 @@
})
const seatFeePrice = computed(() => {
if (!props.seatFee.totalAmount) {
if (!props.seatFee.priceAmount) {
return 0
}
const n = props.seatFee.totalAmount * (props.seatFee.status == 'return' ? 0 : 1)
const n = props.seatFee.priceAmount * (props.seatFee.status == 'return' ? 0 : 1)
return n.toFixed(2)
})

View File

@ -26,11 +26,21 @@
</view> -->
<view class="u-flex u-row-between u-m-t-24">
<view>下单时间</view>
<view><up-text v-if="data.createdAt" mode="date" format="yyyy-mm-dd hh:MM:ss" :text="data.createdAt"></up-text></view>
<view><up-text v-if="data.createdAt" mode="date" format="yyyy-mm-dd hh:MM:ss"
:text="data.createdAt"></up-text></view>
</view>
<view class="u-flex u-row-between u-m-t-24">
<view>订单编号</view>
<view>{{data.orderNo}}</view>
<view class="u-flex">
<view>{{data.orderNo}}</view>
<view v-if="data.orderNo" class="u-m-l-6">
<up-copy :content="data.orderNo" >
<up-icon name="/static/copy.svg" :size="16"></up-icon>
</up-copy>
</view>
</view>
</view>
<view class="u-flex u-row-between u-m-t-24 u-col-top">
<view class="no-wrap">商家备注</view>

View File

@ -5,21 +5,24 @@
<view>
{{data.productName}}
</view>
<view class="u-flex u-m-t-32">
<up-number-box :min="1" :max="data.num" :buttonSize="44" v-model="number" integer>
<view class="u-flex u-m-t-32" :class="{'gray':data.productId=='-999'}">
<up-number-box :min="1" :max="data.num" :buttonSize="44" v-model="number" integer :disabled="data.productId=='-999'">
<template #minus>
<view class="minus number-box-btn">
</view>
</template>
<template #input>
<view class="u-flex-1 u-row-center u-text-center input">
<up-input @change="parseIntNumber($event,false)" @blur="parseIntNumber($event,true)"
<up-input
:disabled="data.productId=='-999'"
@change="parseIntNumber($event,false)" @blur="parseIntNumber($event,true)"
v-model="number" border="none" type="number"></up-input>
</view>
</template>
<template #plus>
<view class="plus number-box-btn">
<up-icon name="plus" color="#999" size="16" bold></up-icon>
<up-icon v-if="data.productId=='-999'" name="plus" color="#ccc" size="16" bold></up-icon>
<up-icon v-else name="plus" color="#999" size="16" bold></up-icon>
</view>
</template>
</up-number-box>
@ -66,7 +69,11 @@
const props = defineProps({
data: {
type: Object,
default: () => {}
default: () => {
return {
productId:'-999'
}
}
},
show: {
type: Boolean,
@ -143,10 +150,17 @@
function open() {
model.value.open()
if(props.data.productId=='-999'){
number.value=props.data.num
}
}
function close() {
model.value.close()
tags.value.map(v=>{
v.checked=false
})
form.note=''
}
function confirm() {
@ -191,7 +205,12 @@
::v-deep .uni-input-input {
text-align: center;
}
.gray{
.minus::after{
border-color: #ccc;
}
}
.minus {
&::after {
content: '';

View File

@ -75,7 +75,7 @@
})
function onSeatFeeTuicai(seatFee) {
seatFee={...seatFee,num:seatFee.number,productName:seatFee.name}
seatFee={...seatFee,num:seatFee.num,productName:seatFee.productName}
console.log(seatFee);
tuicai.show = true
tuicai.isSeatFee = seatFee
@ -94,26 +94,26 @@
return
}
const {
id,
id,cartId,
productId,
productSkuId,
name,
cartId,
number,
totalAmount,
salePrice
productName,
num,
priceAmount,
price
} = seatFee
go.to('PAGES_ORDER_TUIKUAN', {
orderId:orderDetail.info.id,
id:seatFee.id,
id,
cartId,
productId,
productSkuId,
productName:name,
num:number,
productName,
num,
number: 0,
productSkuName: '',
priceAmount:totalAmount,
price:salePrice
priceAmount,
price
})
}
@ -211,6 +211,7 @@
go.to('PAGES_CREATE_ORDER', {
tableId: options.tableId || orderDetail.info.tableId,
name: options.name || orderDetail.info.tableName,
masterId:orderDetail.info.masterId,
type: 'add'
})
}
@ -282,12 +283,15 @@
}
}
console.log(res.seatInfo);
orderDetail.seatFee = res.seatInfo|| {
name: '客座费',
number: res.seatCount,
totalNumber: res.seatCount,
totalAmount: res.seatAmount,
status:''
// name: '',
// number: res.seatCount,
// num: res.seatCount,
// totalNumber: res.seatCount,
// priceAmount: res.seatAmount,
// status:'',
totalNumber:0,
}
orderDetail.goodsList = Object.entries(goodsMap).map(([key, value]) => ({
info: value,

View File

@ -59,6 +59,7 @@
<view class="no-wrap u-m-r-32">打包费</view>
<view>{{data.packFee||0}}</view>
</view>
<view style="height: 32rpx;" v-if="data.packFee>0&&data.seatInfo&&data.seatInfo.priceAmount>0"></view>
<view class="u-flex u-row-between u-col-top" v-if="data.seatInfo&&data.seatInfo.priceAmount>0">
<view class="no-wrap u-m-r-32">{{data.seatInfo.productName}}</view>
<view>{{data.seatInfo.priceAmount}}</view>
@ -72,7 +73,7 @@
</view>
<view class="u-m-t-32">
<view class="u-flex u-row-right">
<text></text>
<text></text>
<text class="font-bold u-font-32">{{data.orderAmount}}</text>
</view>
<view class="u-flex u-row-right u-m-t-24">
@ -87,6 +88,7 @@
import dayjs from 'dayjs';
import orderEnum from '@/commons/orderEnum.js'
import go from '@/commons/utils/go.js'
import {isTui,canTuiKuan,canTuicai} from '@/commons/utils/goodsUtil.js'
import {
computed,
reactive,
@ -119,7 +121,7 @@
const priceSize = 9
function goodsPriceAmount(item){
return item.price*item.num
return (item.price*item.num).toFixed(2)
}
// const packeFee=computed(()=>{
// return props.data.detailList.reduce((prve,cur)=>{

View File

@ -3,9 +3,13 @@
<view class="bg-fff u-p-24 border-r-12 u-flex u-row-between">
<view>全退</view>
<view>
<my-radio v-model="allTui"></my-radio>
<my-radio v-model="allTui" :disabled="option.productId=='-999'"></my-radio>
</view>
</view>
<view class="u-m-t-24 u-font-24 u-font-24">
<text class="color-red">*</text>
<text>客座费只能全退</text>
</view>
<view class="bg-fff border-r-12 list u-m-t-32">
<view class="u-flex u-row-between border-top item u-p-t-32 u-p-b-32"
v-for="(item,index) in orderDetail.goodsList" :key="index">
@ -14,15 +18,25 @@
<view class="u-m-t-10 color-999 u-font-24">{{item.productSkuName||""}}</view>
<view class="u-m-t-10 color-999 u-font-24">最多可退×{{item.num}}</view>
</view>
<view class="u-flex">
<view class="color-red">{{item.priceAmount}}</view>
<view class="u-flex u-m-l-32 u-col-center">
<up-icon @click="changeItem(item,-1)" :size="20" name="minus-circle"></up-icon>
<view class="u-m-l-28 u-m-r-28">{{item.number}}</view>
<up-icon @click="changeItem(item,1)" :color="color.ColorMain" :size="20"
name="plus-circle-fill"></up-icon>
<template v-if="option.productId=='-999'">
<view class="u-flex">
<view class="color-red">{{item.priceAmount}}</view>
<view class="u-flex u-m-l-32 u-col-center">
<view class="u-m-l-28 u-m-r-28">x{{item.number}}</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="u-flex">
<view class="color-red">{{item.priceAmount}}</view>
<view class="u-flex u-m-l-32 u-col-center">
<up-icon @click="changeItem(item,-1)" :size="20" name="minus-circle"></up-icon>
<view class="u-m-l-28 u-m-r-28">{{item.number}}</view>
<up-icon @click="changeItem(item,1)" :color="color.ColorMain" :size="20"
name="plus-circle-fill"></up-icon>
</view>
</view>
</template>
</view>
</view>
<view class="bg-fff u-m-t-32 u-p-24 border-r-12 u-flex u-row-between">
@ -139,6 +153,9 @@
}
function changeItem(item, step) {
if(item.productId=='-999'){
return
}
console.log(item);
let newval = item.number * 1 + step * 1;
if (newval <= 0) {
@ -179,9 +196,14 @@
uni.navigateBack({delta:1})
},500)
}
const option=reactive({})
const option=reactive({
productId:'-999'
})
onLoad((opt) => {
Object.assign(option,opt)
if(opt.productId=='-999'){
allTui.value=true
}
if (Array.isArray(opt)) {
orderDetail.goodsList = opt
} else {

1
static/copy.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1730281062594" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4292" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M394.666667 106.666667h448a74.666667 74.666667 0 0 1 74.666666 74.666666v448a74.666667 74.666667 0 0 1-74.666666 74.666667H394.666667a74.666667 74.666667 0 0 1-74.666667-74.666667V181.333333a74.666667 74.666667 0 0 1 74.666667-74.666666z m0 64a10.666667 10.666667 0 0 0-10.666667 10.666666v448a10.666667 10.666667 0 0 0 10.666667 10.666667h448a10.666667 10.666667 0 0 0 10.666666-10.666667V181.333333a10.666667 10.666667 0 0 0-10.666666-10.666666H394.666667z m245.333333 597.333333a32 32 0 0 1 64 0v74.666667a74.666667 74.666667 0 0 1-74.666667 74.666666H181.333333a74.666667 74.666667 0 0 1-74.666666-74.666666V394.666667a74.666667 74.666667 0 0 1 74.666666-74.666667h74.666667a32 32 0 0 1 0 64h-74.666667a10.666667 10.666667 0 0 0-10.666666 10.666667v448a10.666667 10.666667 0 0 0 10.666666 10.666666h448a10.666667 10.666667 0 0 0 10.666667-10.666666v-74.666667z" fill="#8a8a8a" p-id="4293"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB