代码优化
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user