代码优化
This commit is contained in:
@@ -210,7 +210,7 @@
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-24" v-if="orderInfo.status == 'unpaid'||orderInfo.status == 'done'">
|
||||
<my-button @tap="printOrder" type="cancel" :color="color.ColorMain">重新打印</my-button>
|
||||
<my-button @tap="printOrder" type="cancel" :color="$utils.ColorMain">重新打印</my-button>
|
||||
</view>
|
||||
</view>
|
||||
<up-popup :round="10" :show="pop.youhui" mode="center" closeOnClickOverlay @close="youhuiDetailHide">
|
||||
@@ -268,7 +268,6 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, reactive } from 'vue';
|
||||
import color from '@/commons/color.js'
|
||||
import { hasPermission } from '@/commons/utils/hasPermission.js'
|
||||
import { isTui, isTuiCai, isGift, canTuiKuan, canTuicai, mathFloorPrice } from '@/commons/utils/goodsUtil.js'
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-24">
|
||||
<view class="u-flex u-row-between">
|
||||
<view>订单状态</view>
|
||||
<view>{{returnStatus(data.status)}}</view>
|
||||
<view>{{$dict.getDiceName(data.status,'orderStatus')}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>订单类型</view>
|
||||
<view>{{returnUseType(data.dineMode)}}</view>
|
||||
<view>{{$dict.getDiceName(data.dineMode,'dineMode')}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>桌位号</view>
|
||||
@@ -18,7 +18,7 @@
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>支付方式</view>
|
||||
<view>{{returnPayType(data.payType)||''}}</view>
|
||||
<view>{{$dict.getDiceName(data.payType,'payType')||''}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>下单时间</view>
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import orderEnum from '@/commons/orderEnum.js'
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
@@ -63,35 +63,7 @@
|
||||
}
|
||||
}
|
||||
})
|
||||
const payTypeList = [
|
||||
{name: '主扫', type:'main_scan'},
|
||||
{name: '被扫', type:'back_scan'},
|
||||
{name: '微信小程序', type:'wechat_mini'},
|
||||
{name: '支付宝小程序', type:'alipay_mini'},
|
||||
{name: '会员支付', type:'vip_pay'},
|
||||
{name: '现金支付', type:'cash_pay'},
|
||||
]
|
||||
const payTypeName = ref(null)
|
||||
|
||||
/**
|
||||
* 获取支付方式
|
||||
*/
|
||||
function returnPayType(payType) {
|
||||
let item = payTypeList.find( v=> v.type == payType )
|
||||
return item ? item.name : ''
|
||||
}
|
||||
|
||||
function returnStatus(status) {
|
||||
const item = orderEnum.status.find(v => v.key == status)
|
||||
return item ? item.label : ''
|
||||
}
|
||||
|
||||
function returnUseType(useType) {
|
||||
if (!useType) {
|
||||
return ''
|
||||
}
|
||||
return useType == "take-out" ? '自取' : '堂食';
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -13,10 +13,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive
|
||||
} from 'vue';
|
||||
import color from '@/commons/color.js'
|
||||
import { reactive } from 'vue';
|
||||
const itemStyle = reactive({
|
||||
color: 'rgb(255,0,0)'
|
||||
})
|
||||
|
||||
@@ -42,14 +42,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import orderEnum from '@/commons/orderEnum.js'
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import * as $time from '@/commons/utils/dayjs-time.js';
|
||||
import color from '@/commons/color.js';
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
|
||||
const emits = defineEmits(['update:time', 'update:status','updateStatus'])
|
||||
|
||||
@@ -91,7 +85,7 @@
|
||||
})
|
||||
|
||||
const statusData = reactive({
|
||||
allList: orderEnum.status,
|
||||
allList: uni.$dict.orderStatus,
|
||||
moreShow: false,
|
||||
allListSel: -1,
|
||||
list: [{
|
||||
@@ -145,7 +139,7 @@
|
||||
console.log(i);
|
||||
}
|
||||
function statusConfirm(){
|
||||
const status=statusData.allList[statusData.allListSel].key
|
||||
const status=statusData.allList[statusData.allListSel].type
|
||||
statusData.sel=status
|
||||
emits('updateStatus',status)
|
||||
moreShowHide()
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
<template>
|
||||
<view class="bg-fff item" @click="toDetail">
|
||||
<view class="u-flex u-p-b-22 border-bottom u-row-between u-col-center">
|
||||
<view class="u-flex u-col-bottom">
|
||||
<view class="u-flex u-col-bottom" style="align-items: center;">
|
||||
<template v-if="data.tableName">
|
||||
<view class="u-flex u-col-center">
|
||||
<view class="u-font-40 color-333">{{data.tableName}}</view>
|
||||
<view class="line" style="height: 16px;"></view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="">{{data.masterId}}</view>
|
||||
<!-- <view class="">{{ $dict.getDiceName(data.platformType,'platformType') }}</view> -->
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<view>
|
||||
<text :class="[data.status]">{{returnStatus(data.status)}}</text>
|
||||
<text :class="[data.status]">{{$dict.getDiceName(data.status,'orderStatus')}}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class=" color-main">
|
||||
<text>
|
||||
{{sendTypeFilter(data.dineMode)}}
|
||||
{{$dict.getDiceName(data.dineMode,'dineMode')}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -99,10 +99,10 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import orderEnum from '@/commons/orderEnum.js'
|
||||
import go from '@/commons/utils/go.js'
|
||||
import { mathFloorPrice } from '@/commons/utils/goodsUtil.js'
|
||||
|
||||
const emits = defineEmits(['printOrder'])
|
||||
const props = defineProps({
|
||||
data: {
|
||||
@@ -156,25 +156,10 @@
|
||||
goodsMapInit()
|
||||
})
|
||||
|
||||
|
||||
function formatTime(time) {
|
||||
return dayjs(time).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
function returnStatus(status) {
|
||||
const item = orderEnum.status.find(v => v.key == status)
|
||||
return item ? item.label : ''
|
||||
}
|
||||
|
||||
function sendTypeFilter(t) {
|
||||
if (t) {
|
||||
const item = orderEnum.dineMode.find(item => item.key == t)
|
||||
return item ? item.label : '';
|
||||
} else {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
function toDetail() {
|
||||
go.to('PAGES_ORDER_DETAIL', {
|
||||
id: props.data.id
|
||||
|
||||
@@ -130,7 +130,6 @@
|
||||
<script setup>
|
||||
import { onLoad, onReady } from '@dcloudio/uni-app'
|
||||
import { ref, reactive, watch, computed, onMounted } from 'vue';
|
||||
import color from '@/commons/color.js'
|
||||
import dayjs from 'dayjs';
|
||||
import { getSafeBottomHeight } from '@/commons/utils/safe-bottom.js'
|
||||
import go from '@/commons/utils/go.js'
|
||||
|
||||
Reference in New Issue
Block a user