This commit is contained in:
duan 2024-09-18 09:05:21 +08:00
commit 98b4bee3bc
47 changed files with 2340 additions and 509 deletions

View File

@ -1,16 +1,20 @@
{ // launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote
"version": "0.0",
"configurations": [{
"default" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
{
// launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote
"version" : "0.0",
"configurations" : [
{
"default" : {
"launchtype" : "local"
},
"mp-weixin" : {
"launchtype" : "local"
},
"type" : "uniCloud"
},
{
"playground" : "custom",
"type" : "uni-app:app-android"
}
]
}

84
commons/orderEnum.js Normal file
View File

@ -0,0 +1,84 @@
export default {
status: [
{
key: 'unpaid',
label: '待支付'
},
{
key: 'unsend',
label: '待发货'
},
{
key: 'closed',
label: '订单完成'
},
{
key: 'send',
label: '已发'
},
{
key: 'refunding',
label: '申请退单'
},
{
key: 'refund',
label: '退单'
},
{
key: 'cancelled',
label: '取消订单'
},
{
key: 'merge',
label: '合台'
},
{
key: 'pending',
label: '挂单'
},
{
key: 'activate',
label: '激活'
},
{
key: 'paying',
label: '支付中'
}
],
sendType: [
{
key: 'post',
label: '快递'
},
{
key: 'takeaway',
label: '外卖'
},
{
key: 'takeself',
label: '自提'
},
{
key: 'table',
label: '堂食'
}
],
orderType: [
{
key: 'cash',
label: '收银'
},
{
key: 'miniapp',
label: '小程序'
},
{
key: 'offline',
label: '线下'
},
{
key: 'return',
label: '退单'
}
]
}

View File

@ -1,30 +1,34 @@
export const $status = {
pending: {
label: "挂单中",
type: "#E6A23C",
},
using: {
label: "开台中",
type: "rgb(250,85,85)",
},
paying: {
label: "结算中",
type: "#E6A23C",
},
idle: {
label: "空闲",
type: "#318AFE",
},
subscribe: {
label: "预定",
type: "#E6A23C",
},
closed: {
label: "关台",
type: "#ddd",
},
cleaning: {
label: "台桌清理中",
type: "#909399",
},
pending: {
label: "挂单中",
type: "#E6A23C",
},
using: {
label: "开台中",
type: "#fa5555",
},
paying: {
label: "结算中",
type: "#E6A23C",
},
idle: {
label: "空闲",
type: "#3F9EFF",
},
subscribe: {
label: "预定",
type: "rgb(34, 191, 100)",
},
closed: {
label: "关台",
type: "rgb(221,221,221)",
},
// opening: {
// label: "开台中",
// type: "#67C23A",
// },
cleaning: {
label: "待清台",
type: "#FAAD14",
}
}

View File

@ -0,0 +1,30 @@
import dayjs from 'dayjs';
// 获取今天的开始和结束时间
export function getTodayTimestamps() {
const start = dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss');
const end = dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss');
return { start, end ,label:'今日'};
}
// 获取昨天的开始和结束时间
export function getYesterdayTimestamps() {
const start = dayjs().subtract(1, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss');
const end = dayjs().subtract(1, 'day').endOf('day').format('YYYY-MM-DD HH:mm:ss');
return { start, end ,label:'昨日'};
}
// 获取本周的开始和结束时间
export function getThisWeekTimestamps() {
const start = dayjs().startOf('week').format('YYYY-MM-DD HH:mm:ss');
const end = dayjs().endOf('week').format('YYYY-MM-DD HH:mm:ss');
return { start, end,label:'本周' };
}
// 获取本月的开始和结束时间
export function getThisMonthTimestamps() {
const start = dayjs().startOf('month').format('YYYY-MM-DD HH:mm:ss');
const end = dayjs().endOf('month').format('YYYY-MM-DD HH:mm:ss');
return { start, end ,label:'本月'};
}

View File

@ -4,7 +4,7 @@
<slot name="title">
</slot>
<view class="item" @tap.stop="itemClick(index)" v-for="(item,index) in props.list" :key="index">
<button class="bg-fff btn" hover-class="btn-hover-class">{{item}}</button>
<button class="bg-fff btn" hover-class="btn-hover-class" :class="{'color-main':active==index}">{{item}}</button>
</view>
<view class="bock-gary"></view>
<view class="cancel-btn" @tap="close">
@ -18,6 +18,11 @@
<script setup>
import { ref } from 'vue';
const props=defineProps({
//
active:{
type:Number,
default:-1
},
autoClose:{
type:Boolean,
default:true

View File

@ -138,6 +138,7 @@
function cancel() {
show.value = false
emits('cancel')
emits('close')
}
function confirm() {

View File

@ -216,4 +216,76 @@ export function $payOrder(data) {
...data
}
});
}
}
//退单
export function $returnCart(data) {
return request({
url: '/api/place/returnCart',
method: "put",
data:{
shopId: uni.getStorageSync('shopId'),
...data
}
});
}
// 选择台桌
export function $choseTable(data) {
return request({
url: '/api/place/choseTable',
method: "put",
data:{
shopId: uni.getStorageSync('shopId'),
...data
}
});
}
// 用餐人数
export function $choseCount(data) {
return request({
url: '/api/place/choseCount',
method: "put",
data:{
shopId: uni.getStorageSync('shopId'),
...data
}
});
}
// 批量生成台桌
export function $fastCreateTable(data) {
return request({
url: '/api/tbShopTable/generate',
method: "post",
data:{
shopId: uni.getStorageSync('shopId'),
...data
}
});
}
//打印当前台桌订单
export function $printOrder(data) {
return request({
url: '/api/place/printOrder',
method: "post",
data:{
shopId: uni.getStorageSync('shopId'),
...data
}
});
}
//打印当前台桌菜品
export function $printDishes(data) {
return request({
url: '/api/place/printDishes',
method: "post",
data:{
shopId: uni.getStorageSync('shopId'),
...data
}
});
}

View File

@ -23,10 +23,6 @@ const loadingShowTime = 200
function getHeader(){
const headerObject={}
headerObject["Authorization"] = storageManage.token()
headerObject["Content-Type"] = 'application/json'
headerObject["loginname"] = 'admin'
headerObject["token"] = 'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyVHlwZSI6Ik1HIiwiZXhwIjoxNjkwMTgwNzE2LCJ1c2VySWQiOiIyNDQiLCJpYXQiOjE2ODg3MDk0ODcsImxvZ2luTmFtZSI6ImFkbWluIn0.lqxxvv2-FcecQngMBorz4MpkB3mIJQDG-IUULQyV-KQ'
headerObject["userId"] = '244'
return headerObject
}

93
http/yskApi/order.js Normal file
View File

@ -0,0 +1,93 @@
import http from './http.js'
const request=http.request
/**
* 查询订单
* @param {*} data
* @returns
*/
export function tbOrderInfoData(data) {
return request({
url: "/api/tbOrderInfo/date",
method: "post",
data: {
shopId: uni.getStorageSync('shopId'),
...data
}
});
}
/**
* 导出数据
* @param {*} data
* @returns
*/
export function tbOrderInfoDownload(data) {
return request({
url: "/api/tbOrderInfo/download",
method: "post",
data: {
shopId: uni.getStorageSync('shopId'),
...data
},
responseType: "blob"
});
}
/**
* 通过Id查询订单
* @param {*} id
* @returns
*/
export function tbOrderInfoDetail(id) {
return request({
url: `/api/tbOrderInfo/${id}`,
method: "get"
});
}
/**
* 通过Id查询订单
* @param {*} createdAt
* @returns
*/
export function payCount(createdAt) {
console.log(createdAt);
return request({
url: `/api/tbOrderInfo/payCount`,
method: "post",
data: {
shopId: uni.getStorageSync('shopId'),
createdAt: createdAt
}
});
}
/**
* 订单列表
* @param {*} createdAt
* @returns
*/
export function tbGroupOrderInfo(params) {
return request({
url: `/api/tbGroupOrderInfo`,
method: "post",
data: {
shopId: uni.getStorageSync('shopId'),
...params
}
});
}
/**
* 退单
* @param {*} data
* @returns
*/
export function returnGpOrder(data) {
return request({
url: `/api/tbGroupOrderInfo/returnGpOrder`,
method: "post",
data
});
}

View File

@ -10,4 +10,5 @@ import infoBox from '@/commons/utils/infoBox.js'
/* 台桌区域 */
export const $tableArea=new $API('/api/tbShopArea',http.req)
/* 台桌 */
export const $table=new $API('/api/tbShopTable',http.req)
export const $table=new $API('/api/tbShopTable',http.req)

View File

@ -1,6 +1,6 @@
{
"name" : "银收客",
"appid" : "__UNI__9C51A5E",
"appid" : "__UNI__66E7BD0",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : 100,
@ -176,57 +176,56 @@
"unipush" : {
"enable" : true
},
"devServer": {
"disableHostCheck": true,
"proxy": {
"/shopApi": {
//
"target": "https://wxcashiertest.sxczgkj.cn/cashierService",
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/shopApi": ""
}
},
"/mch": {
//
"target": "https://b.rscygroup.com",
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/mch": ""
}
},
"/server1": {
//
"target": "http://101.37.12.135:8080",
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/server1": ""
}
},
"/server3": {
//
"target": "http://101.37.12.135:8080",
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/server3": ""
}
},
"/ysk": {
//
"target": "https://admintestpapi.sxczgkj.cn",
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"/ysk": ""
}
}
}
}
"devServer" : {
"disableHostCheck" : true,
"proxy" : {
"/shopApi" : {
//
"target" : "https://wxcashiertest.sxczgkj.cn/cashierService",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {
"^/shopApi" : ""
}
},
"/mch" : {
//
"target" : "https://b.rscygroup.com",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {
"^/mch" : ""
}
},
"/server1" : {
//
"target" : "http://101.37.12.135:8080",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {
"^/server1" : ""
}
},
"/server3" : {
//
"target" : "http://101.37.12.135:8080",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {
"^/server3" : ""
}
},
"/ysk" : {
//
"target" : "https://admintestpapi.sxczgkj.cn",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {
"/ysk" : ""
}
}
}
}
},
"mp-alipay" : {
"appid" : "2021004128648214"

View File

@ -1,6 +1,6 @@
<template>
<view class="u-p-30 safe-page">
<up-sticky v-if="option.type==='edit'" offset-top="20">
<up-sticky v-if="option.type==='edit'" offset-top="20" zIndex="99">
<myTabs :list="tabsList" @change="tabsChange"></myTabs>
</up-sticky>

View File

@ -0,0 +1,120 @@
<template>
<view>
<view class="category " :style="getCompouteStyle()">
<scroll-view scroll-y="true" :style="{height:props.height+'rpx'}">
<view class="list">
<view v-if="showAllText" class="font-bold item border-bottom u-font-28" @tap="cateClick({id:'',name:'全部分类'})">全部分类</view>
<view v-for="(item,index) in category.list" :key="index">
<view class="item font-bold border-bottom" @tap="cateClick(item)">
{{item.name}}
</view>
<view class="item border-bottom" @tap="cateClick(child)"
v-for="(child,childIndex) in item.childrenList"
:key="childIndex" >
<text>&nbsp;&nbsp;</text>
{{child.name}}
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script setup>
import {
ref, warn, watch, watchEffect,
onMounted,reactive
} from 'vue';
import {$tbShopCategory} from '@/http/yskApi/goods.js'
const emite=defineEmits(['cateClick','change'])
const props = defineProps({
showAllText:{
type:Boolean,
default:true
},
width: {
type: [Number, String],
default: 264
},
height: {
type: [Number, String],
default: 420
},
right: {
type: [Number, String],
default: 30
},
bottom: {
type: [Number, String],
default: 0
}
})
let show = ref(false)
watch(()=>show.value,(newval)=>{
emite('change',newval)
})
function open() {
show.value = true
}
function close() {
show.value = false
}
function toggle() {
show.value = !show.value
}
function cateClick(item){
emite('cateClick',item)
close()
}
function getCompouteStyle() {
return {
width: props.width + 'rpx',
height: props.height + 'rpx',
right: props.right + 'rpx',
bottom: props.bottom + 'rpx',
transform:`scaleY(${show.value?1:0})`
}
}
const category=reactive({
list:[],
categoryId:'',
categoryName:'',
})
onMounted(()=>{
$tbShopCategory({
page:0,size:200
}).then(res=>{
category.list=res.content
})
})
defineExpose({
open,
close,toggle
})
</script>
<style lang="scss" scoped>
.category {
background: #FFFFFF;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
border-radius: 14rpx 14rpx 14rpx 14rpx;
position: fixed;
font-size: 24rpx;
color: #333;
.list{
box-sizing: border-box;
.item{
padding: 24rpx 24rpx 24rpx 48rpx;
}
}
}
</style>

View File

@ -1,25 +1,5 @@
<template>
<view>
<view class="category " :style="getCompouteStyle()">
<scroll-view scroll-y="true" :style="{height:props.height+'rpx'}">
<view class="list">
<view v-if="showAllText" class="font-bold item border-bottom u-font-28" @tap="cateClick({id:'',name:'全部分类'})">全部分类</view>
<view v-for="(item,index) in category.list" :key="index">
<view class="item font-bold border-bottom" @tap="cateClick(item)">
{{item.name}}
</view>
<view class="item border-bottom" @tap="cateClick(child)"
v-for="(child,childIndex) in item.childrenList"
:key="childIndex" >
<text>&nbsp;&nbsp;</text>
{{child.name}}
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<up-picker :show="show" keyName="name" @confirm="confirm" :columns="category.list" @close="close" @cancel="close" :closeOnClickOverlay="true"></up-picker>
</template>
<script setup>
@ -28,7 +8,7 @@
onMounted,reactive
} from 'vue';
import {$tbShopCategory} from '@/http/yskApi/goods.js'
const emite=defineEmits(['cateClick','change'])
const emite=defineEmits(['change','update:isShow','confirm'])
const props = defineProps({
showAllText:{
type:Boolean,
@ -49,57 +29,63 @@
bottom: {
type: [Number, String],
default: 0
},
isShow:{
type:Boolean,
default:false
}
})
let show = ref(false)
let show = ref(props.isShow)
watch(()=>show.value,(newval)=>{
emite('change',newval)
emite('update:isShow',newval)
})
watch(()=>props.isShow,(newval)=>{
console.log(newval);
show.value=newval
})
function open() {
show.value = true
function confirm(e){
console.log(e.value[0]);
show.value = false
emite('confirm',e.value[0])
}
function close() {
console.log('close');
show.value = false
}
function toggle() {
show.value = !show.value
}
function cateClick(item){
emite('cateClick',item)
close()
}
function getCompouteStyle() {
return {
width: props.width + 'rpx',
height: props.height + 'rpx',
right: props.right + 'rpx',
bottom: props.bottom + 'rpx',
transform:`scaleY(${show.value?1:0})`
}
}
const category=reactive({
list:[],
categoryId:'',
categoryName:'',
})
onMounted(()=>{
$tbShopCategory({
page:0,size:200
}).then(res=>{
category.list=res.content
res.content.unshift({
name:'全部',
id:'',
childrenList:[]
})
category.list=[res.content.reduce((prve, cur) => {
prve.push(...[{
...cur,
name: '' + cur.name,
childrenList:undefined
}, ...cur.childrenList.map(v => {
return {
...v,
name: '' + v.name
}
})])
return prve
}, [])]
console.log(category.list);
})
})
defineExpose({
open,
close,toggle
})
</script>
<style lang="scss" scoped>

View File

@ -3,12 +3,12 @@
<view class="u-flex control1" v-if="showControl1">
<view class="btn" @click="changeShowControl1">批量管理</view>
<view class="btn" @tap="go.to('PAGES_PRODUCT_ADD')">商品添加</view>
<view class="color-999 btn u-flex u-row-center" @click="emitToggleCategory">
<!-- <view class="color-999 btn u-flex u-row-center" @click="emitToggleCategory">
<text class="u-m-r-10">{{categoryName||'选择分类'}}</text>
<view class="arrow-down" :class="{'up':categoryShow}">
<uni-icons type="right" size="16" color="#999"></uni-icons>
</view>
</view>
</view> -->
</view>
<view class="u-flex control2 u-row-between" v-else>
<view class="u-flex btn">

View File

@ -7,9 +7,9 @@
<text class="u-m-l-20">{{data.sort}}</text>
</view>
<view class="color-333 u-m-l-42 u-flex">
<text class="stock">库存</text>
<up-icon name="edit-pen" :size="16" :color="ColorMain"></up-icon>
<text class="stock">库存:</text>
<text class="font-bold u-m-l-10">{{data.stockNumber}}</text>
<uni-icons type="right" size="16" color="#000"></uni-icons>
</view>
</view>
<text class="u-font-28 color-666" @click="changeClick">修改</text>
@ -24,16 +24,20 @@
</label>
</view>
<image :src="data.coverImg" lazy-load class="img"></image>
<view class="h-100 u-p-l-16 u-flex u-flex-col u-row-between">
<view class="color-333"> <text class="u-m-r-24">{{data.name}}</text><uni-tag size="small" type="primary"
custom-style="background-color: #318AFE;" :text="data.typeEnum"></uni-tag></view>
<view class="h-100 u-p-l-16 u-flex-1 u-flex u-flex-col u-row-between">
<view class="color-333 w-full u-flex u-row-between">
<view class="u-flex">
<text class="u-m-r-24">{{data.name}}</text><uni-tag size="small" type="primary"
custom-style="background-color: #318AFE;" :text="data.typeEnum"></uni-tag>
</view>
<view class="price">¥{{data.lowPrice}}</view>
</view>
<view class="price">¥{{data.lowPrice}}</view>
</view>
</view>
<view class="u-m-t-16 skus u-text-center" v-if="showDetail&&data.skuList.length>=2">
<view class="u-flex u-row-between font-bold">
<view class="u-m-t-16 skus u-text-center" v-if="data.skuList.length>=2">
<!-- <view class="u-flex u-row-between font-bold">
<view class="u-flex-1">商品信息</view>
<view class="u-flex-1">售价</view>
<view class="u-flex-1">库存</view>
@ -44,30 +48,28 @@
<view class="price u-flex-1">¥{{data.lowPrice||0}}</view>
<view class=" u-flex-1">{{item.stockNumber||0}} {{data.unitName||''}}</view>
</view>
</view>
<!-- <view class="u-flex">
<view class="sku">做法</view>
<view class="u-flex u-flex-wrap u-flex-1 skds">
<view class="skd">
<view class="tag-primary tag">上架中</view>
</view>
<view class="skd">
<view class="tag-primary tag">上架中</view>
</view>
</view>
</view> -->
<view class="u-flex u-flex-wrap skds">
<view class="skd" v-for="(item,index) in data.skuList" :key="index"><text>{{item.specSnap}}</text>
<view class="tag-primary tag">上架中</view>
</view>
</view>
</view>
<view class="u-m-t-24 u-flex u-row-between">
<view class="u-flex">
<view class="u-m-r-18 color-999">设置热门</view>
<my-switch v-model="data.isHot" @change="isHotChange"></my-switch>
<!-- <view class="u-m-r-18 color-999">售罄</view>
<my-switch v-model="isSellNone" @change="isSellNoneChange"></my-switch> -->
<view class="u-flex">
<view class="u-m-r-18 color-999">售罄</view>
<my-switch v-model="data.isSellNoneChange" @change="isHotChange"></my-switch>
</view>
<view class="u-flex u-m-l-30">
<view class="u-m-r-18 color-999">下架产品</view>
<my-switch v-model="data.isSellNoneChange" @change="isHotChange"></my-switch>
</view>
</view>
<view class="u-flex">
<!-- <view class="btn-default btn" @tap="xiajia">下架商品</view> -->
<view class="btn-default btn" @tap="del">删除</view>
<!-- <view class="btn-default btn" @tap="del">删除</view> -->
<view class="btn-primary btn u-m-l-38" @click="toEdit">编辑</view>
</view>
</view>
@ -83,13 +85,15 @@
ref,
watchEffect
} from 'vue';
import {$goodsIsHot} from '@/http/yskApi/goods.js'
import {
$goodsIsHot
} from '@/http/yskApi/goods.js'
import mySwitch from '@/components/my-components/my-switch.vue'
import go from '@/commons/utils/go.js';
import {
ColorMain
} from '@/commons/color.js'
const emits = defineEmits(['radioClick', 'changeClick', 'xiajia','del'])
const emits = defineEmits(['radioClick', 'changeClick', 'xiajia', 'del'])
const props = defineProps({
index: {
type: Number
@ -110,19 +114,19 @@
}
})
function isHotChange(e){
function isHotChange(e) {
$goodsIsHot({
id:props.data.id,
isHot:props.data.isHot
}).then(res=>{
id: props.data.id,
isHot: props.data.isHot
}).then(res => {
uni.showToast({
title:'修改成功',
icon:'none'
title: '修改成功',
icon: 'none'
})
})
}
let isSellNone = ref(false)
isSellNone.value = props.isSellNone
@ -132,8 +136,8 @@
}
let checked = ref(false)
function radioClick() {
console.log(props.index);
emits('radioClick', props.index)
@ -146,7 +150,8 @@
function xiajia() {
emits('xiajia', props.index)
}
function del(){
function del() {
emits('del', props.index)
}
@ -223,7 +228,7 @@
.skus {
background: #F9F9F9;
border-radius: 14rpx 14rpx 14rpx 14rpx;
padding: 28rpx 42rpx;
padding: 20rpx;
.sku {
color: #000;
@ -236,12 +241,13 @@
}
.skd {
padding: 14rpx 40rpx;
padding: 14rpx 40rpx 14rpx 20rpx;
background: #F0F2F5;
border-radius: 4rpx;
position: relative;
color: #666;
overflow: hidden;
margin-bottom: 10rpx;
.tag {
position: absolute;

View File

@ -1,70 +1,63 @@
<template>
<view class="safe-page">
<view class="bg-fff u-p-l-30 u-p-t-16 u-p-r-30 u-p-b-30">
<view class="myTabs ">
<up-sticky>
<view class="bg-fff u-p-l-30 u-p-r-30 u-p-b-30">
<!-- <view class="myTabs ">
<myTabs :list="tabsList" @change="tabsChange"></myTabs>
</view>
<view class="input-wrapper">
<view class="input-main">
<uni-easyinput
clearable
class='jeepay-search' :inputBorder="false" :placeholder="pageData.search.placeholder"
v-model="pageData.query.name" @confirm="searchFunc">
<template #prefixIcon>
<image src="@/static/iconImg/icon-search.svg" class="input-icon" />
</template>
</uni-easyinput>
<button type="text" @click="searchFunc()">搜索</button>
</view>
</view>
<view class="u-flex u-m-t-20 u-p-l-30 u-p-r-30 u-font-28 u-p-b-20 border-bottom">
<view class="u-flex-1 tranistion u-text-center color-333"
:class="{'color-main':pageData.stateCurrent==index}" @tap="statesTableClick(index)"
v-for="(item,index) in statesTabsList" :key="index">
{{item}}
</view>
</view>
<view class="u-flex states1 u-row-between u-font-28">
<view class="u-flex">
<view class="u-p-l-16 item u-p-r-16 u-p-t-6 u-p-b-6 tranistion u-text-center color-333"
:class="{'active':pageData.stateCurrent1==index}" @tap="states1TableClick(index)"
v-for="(item,index) in states1TabsList" :key="index">
{{item}}
</view> -->
<view class="input-wrapper">
<view class="input-main">
<view class="u-flex u-p-r-30 u-font-28" @click="onCategoryShowChange(true)">
<text class="u-m-r-10 u-line-1" style="max-width: 100rpx;">{{pageData.categoryName||'分类' }}</text>
<up-icon name="arrow-down" size="16"></up-icon>
</view>
<uni-easyinput clearable class='jeepay-search' :inputBorder="false"
:placeholder="pageData.search.placeholder" v-model="pageData.query.name"
@confirm="searchFunc">
<template #prefixIcon>
<image src="@/static/iconImg/icon-search.svg" class="input-icon" />
</template>
</uni-easyinput>
<button type="text" @click="searchFunc()">搜索</button>
</view>
</view>
<view class="u-flex u-col-center" @click="go.to('PAGES_PRODUCT_SPECIF_TEMPLATE')">
<image src="/pageProduct/static/images/icon-guige.svg" class="icon-guige" />
<text class="color-666 u-m-l-12 u-font-24">规格模版</text>
<view class="u-flex states1 u-row-between u-font-28">
<view class="u-flex">
<view class="u-p-l-16 item u-p-r-16 u-p-t-6 u-p-b-6 tranistion u-text-center color-333"
:class="{'active':pageData.stateCurrent==index}" @tap="statesTableClick(index)"
v-for="(item,index) in statesTabsList" :key="index">
{{item}}
</view>
</view>
<view class="u-flex u-col-center" @click="go.to('PAGES_PRODUCT_SPECIF_TEMPLATE')">
<image src="/pageProduct/static/images/icon-guige.svg" class="icon-guige" />
<text class="color-666 u-m-l-12 u-font-24">规格模版</text>
</view>
</view>
</view>
</view>
<view class="goods-list u-p-30" >
</up-sticky>
<view class="goods-list u-p-30">
<template v-if="pageData.goodsList.length">
<view class="u-m-b-32" v-for="(item,index) in pageData.goodsList" :key="index">
<my-goods @changeClick="goodsChangeClick" @radioClick="goodsRadioClick" :index="index" :data="item"
@del="goodsDel"
:showChecked="showChecked" :showDetail="pageData.showGoodsDetail"></my-goods>
@del="goodsDel" :showChecked="showChecked" :showDetail="pageData.showGoodsDetail"></my-goods>
</view>
</template>
<template v-if="pageData.hasAjax&&!pageData.goodsList.length">
<my-img-empty tips="未找到相关商品"></my-img-empty>
</template>
<my-pagination :totalElements="pageData.totalElements" :size="pageData.query.size" @change="pageChange"></my-pagination>
<my-pagination :totalElements="pageData.totalElements" :size="pageData.query.size"
@change="pageChange"></my-pagination>
<view style="height: 100rpx;"></view>
</view>
<my-control ref="control"
:categoryShow="pageData.categoryShow"
:categoryName="pageData.categoryName"
@categoryChange="categoryIdChange"
@offShelf="offShelf" @allCheckedChange="allCheckedChange"
<my-control ref="control" :categoryShow="pageData.categoryShow" :categoryName="pageData.categoryName"
@categoryChange="categoryIdChange" @offShelf="offShelf" @allCheckedChange="allCheckedChange"
@controlChange="controlChange" @toggleCategory="toggleCategory"
:bottom="pageData.componentBottom"></my-control>
<my-category ref="category"
@change="onCategoryShowChange" @cateClick="cateClick" :bottom="pageData.componentBottom+100"></my-category>
<!-- <my-category ref="category" @change="onCategoryShowChange" @cateClick="cateClick"
:bottom="pageData.componentBottom+100"></my-category> -->
<!-- 下架弹窗 -->
<my-model :desc="pageData.modelDesc" ref="model" @confirm="modelConfirm"></my-model>
<!-- 商品库存修改弹窗 -->
@ -80,7 +73,7 @@
<view class="u-flex u-m-t-32">
<view class="">库存开关:</view>
<view class="u-m-l-46 ">
<my-switch v-model="goodsStockData.isStock"></my-switch>
<my-switch v-model="goodsStockData.isStock"></my-switch>
</view>
</view>
<!-- <view class="u-flex u-m-t-32">
@ -101,7 +94,7 @@
<my-switch v-model="goodsStockData.isGrounding"></my-switch>
</view>
</view> -->
<!-- <view class="u-m-t-24 u-m-t-32" v-if="goodsStockData.isStock">
<view class="">数量:</view>
<view class="u-m-t-24">
@ -118,6 +111,9 @@
</view>
</template>
</my-model>
<!-- 分类 -->
<my-category v-model:isShow="pageData.categoryShow" @confirm="setCategory"></my-category>
</view>
</template>
@ -136,24 +132,21 @@
watch
} from 'vue';
import go from '@/commons/utils/go.js';
import myTabs from '@/pageProduct/components/my-tabs.vue'
import myGoods from './components/goods.vue'
import myControl from './components/control.vue'
import myCategory from './components/category.vue'
import infoBox from "@/commons/utils/infoBox.js"
import myPagination from '@/components/my-components/my-pagination'
import myModel from "@/components/my-components/my-model.vue"
import myButton from "@/components/my-components/my-button.vue"
import mySwitch from "@/components/my-components/my-switch.vue"
import {
$tbProduct,
$upProSort,
$updateProduct,$getProductDetail,$delProduct,$updateProductStatus
$updateProduct,
$getProductDetail,
$delProduct,
$updateProductStatus
} from "@/http/yskApi/goods.js"
const pageData = reactive({
modelDesc: '是否下架',
stateCurrent: 0,
stateCurrent1: 0,
componentBottom: 45,
search: {
value: '',
@ -167,25 +160,29 @@
query: {
page: 0,
size: 10,
categoryId:'',
name:''
categoryId: '',
name: ''
},
category:'',
categoryShow:false,
categoryName:'',
hasAjax:false
category: '',
categoryShow: false,
categoryName: '',
hasAjax: false
})
function onCategoryShowChange(show){
console.log(show);
pageData.categoryShow=show
}
function categoryIdChange(categoryId){
pageData.query.categoryId=categoryId
watch(()=>pageData.query.categoryId,(newval)=>{
getGoodsList()
})
function onCategoryShowChange(show) {
console.log(show);
pageData.categoryShow = show
}
function setCategory(category){
pageData.query.categoryId = category.id
pageData.categoryName = category.name
}
function getGoodsList() {
$tbProduct(pageData.query).then(res => {
pageData.hasAjax=true
pageData.hasAjax = true
console.log(res);
pageData.goodsList = res.content.map(v => {
return {
@ -203,8 +200,7 @@
})
const tabsList = ['简洁', '详情']
const statesTabsList = ['在售中', '已下架']
const states1TabsList = ['全部', '已售罄']
const statesTabsList = ['全部', '已售罄','在售中', '已下架']
const control = ref(null)
const model = ref(null)
const goodsStockModel = ref(null)
@ -213,9 +209,9 @@
return reactive({
sort: 0,
isStock: false,
isDistribute:false,
isPauseSale:false,
isGrounding:false,
isDistribute: false,
isPauseSale: false,
isGrounding: false,
stockNumber: 0,
})
}
@ -234,15 +230,15 @@
async function goodsStockModelSave() {
const item = pageData.goodsList[pageData.selGoodsIndex]
const goods =await $getProductDetail(item.id,false)
const goods = await $getProductDetail(item.id, false)
$updateProduct({
...goods,
sort:goodsStockData.sort,
isStock:goodsStockData.isStock
}).then(res=>{
item.sort=goodsStockData.sort
item.isStock=goodsStockData.isStock
item.stockNumber=goodsStockData.stockNumber
sort: goodsStockData.sort,
isStock: goodsStockData.isStock
}).then(res => {
item.sort = goodsStockData.sort
item.isStock = goodsStockData.isStock
item.stockNumber = goodsStockData.stockNumber
goodsStockModelCancel()
})
}
@ -253,38 +249,34 @@
function goodsChangeClick(index) {
pageData.selGoodsIndex = index
const goods = pageData.goodsList[index]
Object.assign(goodsStockData,goods)
Object.assign(goodsStockData, goods)
goodsStockModel.value.open()
}
//
function goodsDel(index){
function goodsDel(index) {
const goods = pageData.goodsList[index]
uni.showModal({
title: '提示',
content: '确认删除该商品',
success: function (res) {
success: function(res) {
if (res.confirm) {
$delProduct([goods.id]).then(res=>{
$delProduct([goods.id]).then(res => {
uni.showToast({
title:'删除成功',
icon:'none'
title: '删除成功',
icon: 'none'
})
pageData.goodsList.splice(index,1)
pageData.goodsList.splice(index, 1)
})
} else if (res.cancel) {
}
} else if (res.cancel) {}
}
});
}
function statesTableClick(index) {
pageData.stateCurrent = index
}
function states1TableClick(index) {
pageData.stateCurrent1 = index
}
let test = ref(false)
function tabsChange(i) {
@ -292,7 +284,7 @@
pageData.showGoodsDetail = i ? true : false
}
//
function changeGoodsChecked(checked, index) {
if (index !== undefined) {
@ -379,9 +371,9 @@
function cateClick(cate) {
console.log(cate);
pageData.query.categoryId=cate.id
pageData.categoryName=cate.name
pageData.category=cate
pageData.query.categoryId = cate.id
pageData.categoryName = cate.name
pageData.category = cate
getGoodsList()
}
</script>
@ -491,7 +483,7 @@
.item {
font-size: 24rpx;
color: #666;
margin-right: 70rpx;
margin-right: 30rpx;
background: #F4F4F4;
border-radius: 8rpx 8rpx 8rpx 8rpx;
}

View File

@ -108,7 +108,19 @@
</view>
</uni-forms-item>
</view>
<view class="border-bottom u-p-b-10">
<uni-forms-item required label="" name="types">
<template #label>
<view class="u-text-left">
<text class="color-333 u-font-28">清台管理</text>
<!-- <text class="color-red">*</text> -->
</view>
</template>
<view class="u-flex-1">
<my-tabs @change="autoClearsChange" :list="autoClears.list" v-model="form.autoClear"></my-tabs>
</view>
</uni-forms-item>
</view>
<template v-if="tabs.sel==1">
<view class=" u-p-b-10">
<uni-forms-item required label="" >
@ -169,6 +181,13 @@
list:['低消','计时'],
sel:1
})
//
const autoClears=reactive({
list:['手动清台','自动清台']
})
function autoClearsChange(i){
form.autoClearsChange=i
}
const status = reactive({
list:objToArrary($status),
sel: '',

View File

@ -2,50 +2,60 @@
<view class="item color-fff border-r-12" :class="[data.status]" @click="toOrderDetail">
<view class="my-bg-main" :style="{'background-color':returnStutasColor(data.status)}">
<view class="u-flex u-row-between">
<view class="u-font-32 ">{{data.name}}</view>
<view class="u-font-32">{{data.name}}</view>
<view class="u-flex" @tap.stop="more">
<uni-icons type="more-filled" color="#fff" size="16"></uni-icons>
</view>
</view>
<view class="u-flex u-m-t-10 u-row-between">
<view class="u-flex gap-10">
<!-- <uni-tag text="计时" size="small" type="warning"></uni-tag> -->
<!-- <uni-tag text="可预约" size="small" type="primary"></uni-tag> -->
</view>
<view>{{areaMap[data.areaId]||'' }}</view>
<view class="tag" :style="{color:returnStutasColor(data.status)}">
{{returnStutasText(data.status)}}
</view>
</view>
</view>
<view class="u-flex u-flex-col u-row-center u-col-center bg-fff">
<template v-if="data.status=='idle'">
<view class="u-m-t-40 color-main u-font-32">{{returnStutasText(data.status)}}~</view>
<view class="u-flex gap-10 u-m-t-20">
<uni-tag :text="data.type == 0 ? '低消' : '计时'" size="small" type="warning"></uni-tag>
<uni-tag :text="data.isPredate == 1 ? '可预约' : '不可预约'" size="small" type="primary"></uni-tag>
</view>
<view class="u-flex u-flex-col u-row-center u-col-center bg-fff bottom">
<template v-if="data.status!='using'">
<view class=" u-font-32" :style="{color:returnStutasColor(data.status)}">
{{returnStutasText(data.status)}}~</view>
</template>
<view class="u-m-t-40 w-full u-p-l-20 u-p-r-20 u-m-b-40">
<template v-if="data.status=='idle'">
<view class="u-flex u-row-center">
<my-button type="default" @click="diancan" :disabled="!data.tableId">
<view class=" u-p-l-30 u-p-r-30" :class="{'color-333':data.tableId}">点餐</view>
</my-button>
<view class=" w-full u-p-l-16 u-p-r-16 u-p-t-16 u-font-24">
<template v-if="data.status=='using'">
<view class="color-666 u-text-left u-p-b-20 border-bottom">
<view class=""><text>已点</text><text class="u-m-l-20 color-333">{{data.productNum||0}}</text>
</view>
<view class="u-m-t-10"><text>金额</text><text class="u-m-l-20 color-333">{{data.totalAmount||0}}
</text> </view>
<view class="u-m-t-10"><text>待结</text><text class="u-m-l-20 color-333">{{data.totalAmount||0}}
</text> </view>
</view>
<view class="u-flex u-row-between u-font-20 u-p-b-20 u-p-t-20">
<text class="color-333">开台时间</text>
<text class="color-666"> {{data.useTime}}</text>
</view>
</template>
<template v-else>
<view class="color-666 u-text-left u-p-b-20 border-bottom">
<view class=""><text>已点</text><text class="u-m-l-20 color-333">{{goodsNumber}}</text> </view>
<view class="u-m-t-10"><text>金额</text><text class="u-m-l-20 color-333">{{allPrice}} </text> </view>
<view class="u-m-t-10"><text>待结</text><text class="u-m-l-20 color-333">{{allPrice}} </text> </view>
</view>
<view class="u-text-right u-p-20 color-666">
0人扫码
<view class="u-flex u-row-center u-m-t-16">
<template v-if="data.tableId">
<template v-if="data.status=='idle' ">
<my-button color="#333" :width="150" :height="56" type="default" @click="diancan">
选择
</my-button>
</template>
<template v-if="data.status=='cleaning' ">
<my-button color="#333" :width="150" :height="56" type="default" @click="qingtai">
清台
</my-button>
</template>
</template>
<my-button v-else :width="150" :height="56" type="default" disabled>
选择
</my-button>
</view>
</template>
</view>
</view>
</view>
@ -58,8 +68,16 @@
import {
$status
} from '@/commons/table-status.js'
import { computed, onMounted, ref } from 'vue';
import {
computed,
onMounted,
ref
} from 'vue';
import {
$table
} from '@/http/yskApi/table.js'
const status = $status
const emits = defineEmits(['more','update'])
function returnStutasText(key) {
const item = status[key]
@ -81,40 +99,28 @@
default: () => {
return {}
}
},
areaMap: {
type: Object,
default: () => {}
}
})
const goodsList=ref([])
const goodsList = ref([])
const allPrice = computed(() => {
return goodsList.value.reduce((prve,cur)=>{
return prve+cur.salePrice*cur.number
},0).toFixed(2)
return goodsList.value.reduce((prve, cur) => {
return prve + cur.salePrice * cur.number
}, 0).toFixed(2)
})
const goodsNumber = computed(() => {
let result = 0
result = goodsList.value.reduce((prve, cur) => {
return prve + cur.number
}, 0)
return result
return result
})
async function init(){
if(props.data.tableId){
const {masterId}=await Api.$getMasterId({
tableId:props.data.tableId
})
const {records} = await Api.getCart({
tableId:props.data.tableId,
masterId
})
goodsList.value=records
}
}
onMounted(()=>{
init()
})
const emits = defineEmits(['more'])
onMounted(() => {})
function more() {
emits('more')
@ -128,13 +134,42 @@
}
function toOrderDetail() {
if(props.data.status=='using'){
const {tableId,name,status,amount,areaId}=props.data
if (props.data.status == 'using') {
const {
tableId,
name,
status,
amount,
areaId
} = props.data
go.to('PAGES_CRESATE_ORDER_DETAIL', {
tableId,name,status,amount,areaId
tableId,
name,
status,
amount,
areaId
})
}
}
function qingtai() {
const item=props.data
uni.showModal({
title: '提示',
content: '确定要清台:' + props.data.name + '',
success(res) {
if (res.confirm) {
$table.update({
...item,
status: "idle",
qrcode: item.tableId,
}).then(res=>{
emits('update')
})
}
}
})
}
</script>
<style lang="scss" scoped>
@ -149,6 +184,10 @@
box-shadow: 1px 1px 0 #eee;
border-color: #eee;
.bottom {
min-height: 224rpx;
}
.my-bg-main {
padding: 32rpx 28rpx;

View File

@ -23,7 +23,8 @@
<image src="@/static/iconImg/icon-search.svg" class="input-icon" />
<view class="u-flex-1 u-p-l-10">
<input v-model="search.keyword" @confirm="searchConfirm" type="text"
placeholder-style="font-size:28rpx;" placeholder="搜索" /></view>
placeholder-style="font-size:28rpx;" placeholder="搜索" />
</view>
<view @tap.stop="hideSearch" v-if="search.show">取消</view>
</view>
</view>
@ -59,14 +60,14 @@
<view class="u-m-t-30 u-flex u-flex-wrap u-row-between">
<view class="u-m-b-30" v-for="(item,index) in tables.list" :key="index">
<table-item @more="moreShow(item)" :data="item"></table-item>
<table-item @update="getTable" :areaMap="areaMap" @more="moreShow(item)" :data="item"></table-item>
</view>
<my-img-empty v-if="tables.hasAjax&&!tables.list.length" tips="未找到相关桌台"></my-img-empty>
</view>
</view>
</view>
<my-action-sheet @itemClick="actionSheetClick" ref="refMoreSheet" :list="actionSheet.list"
<my-action-sheet :active="4" @itemClick="actionSheetClick" ref="refMoreSheet" :list="actionSheet.list"
:title="actionSheet.title">
<template #title>
<view class="color-999 u-p-30 u-text-center border-bottom">桌号{{actionSheet.title}}</view>
@ -100,6 +101,7 @@
import addTable from './components/add-table'
import myActionSheet from '@/components/my-components/my-action-sheet';
import tableItem from './components/table-item'
import * as $fun from './util.js'
import {
ref,
reactive,
@ -108,7 +110,7 @@
} from 'vue';
const refMoreSheet = ref(null)
const actionSheet = reactive({
list: ['编辑', '历史订单'],
list: ['结账', '清台','增减菜','换台','打印订单','历史订单'],
title: '',
selTable: ''
})
@ -118,11 +120,27 @@
actionSheet.selTable = table
refMoreSheet.value.open()
}
function actionSheetClick(index) {
async function actionSheetClick(index) {
console.log(index);
//
// refTableShow()
if (index == 0) {
refTableShow()
return
}
if (index == 1) {
return
}
if (index == 2) {
return
}
if (index == 3) {
return
}
if (index == 4) {
//
const res=await $fun.printOrder(actionSheet.selTable.tableId)
return
}
}
@ -303,6 +321,7 @@
tables.list = content
tables.originList = content
}
const areaMap = ref({})
async function getArea() {
const {
content
@ -311,6 +330,11 @@
size: 300
})
tables.area.list = content
areaMap.value = content.reduce((prve, cur) => {
prve[cur.id] = cur.name
return prve
}, {})
console.log(areaMap);
}
watch(() => tables.area.sel, (newval) => {
console.log(newval);
@ -329,7 +353,7 @@
watch(() => times.active, (newval) => {
setTimer()
})
function tableUpdate() {
query.page = 0
@ -352,7 +376,7 @@
watch(() => times.active, (newval) => {
setTimer()
})
onHide(()=>{
onHide(() => {
clearInterval(timer)
})
onShow(opt => {

31
pageTable/index/util.js Normal file
View File

@ -0,0 +1,31 @@
import * as Api from '@/http/yskApi/Instead.js'
import go from '@/commons/utils/go.js'
//打印订单
export function printOrder(tableId) {
return new Promise((resolve, reject) => {
uni.showModal({
title: '提示',
content: '确定要打印订单吗?',
success(res) {
if (res.confirm) {
Api.$printOrder({
tableId
}).then(res => {
resolve(res)
})
}
}
})
})
}
//去支付页面
export function toPay(options) {
go.to('PAGES_CRESATE_ORDER_PAY', {
tableId: options.tableId,
tableName: options.name,
masterId: options.masterId,
orderId: orderDetail.info.id,
discount: 1
})
}

View File

@ -1201,6 +1201,27 @@
}
]
},
{
"root": "pagesOrder",
"pages": [{
"pageId": "PAGES_ORDER_INDEX",
"path" : "index/index",
"style" :
{
"navigationBarTitleText" : "订单管理"
}
},
{
"pageId": "PAGES_ORDER_DETAIL",
"path" : "detail/detail",
"style" :
{
"navigationBarTitleText" : "订单详情"
}
}
]
},
{
"root": "pageCoupon",
"pages": [{

View File

@ -81,6 +81,11 @@
icon: '/static/indexImg/icon-substitute-ordering.svg',
pageUrl: 'PAGES_CREATE_ORDER',
},
{
title: '订单管理',
icon: '/static/indexImg/icon-order.svg',
pageUrl: 'PAGES_ORDER_INDEX',
},
{
title: '打印机',
icon: '/static/indexImg/icon-printer.svg',

View File

@ -40,14 +40,14 @@
<uni-forms-item name="code">
<!-- 手机验证码 不限制数字还是本文 如果发送为文本则无需app升级 -->
<view style="display: flex;">
<view style="display: flex;" class="u-flex u-flex-y-center">
<uni-easyinput class='jeepay-easyinput' :maxlength="6" placeholder="请输入验证码"
v-model="vdata.formData.code" :clearable="false">
<template #prefixIcon>
<image src="@/static/login/icon-sms-code.svg" class="input-icon" />
</template>
</uni-easyinput>
<image :src="vdata.formData.img" class="u-m-t-20"
<image :src="vdata.formData.img" class=" u-m-b-50"
style="width: 200rpx; height: 80rpx;margin-left: 10rpx;" @click="getCode" mode="">
</image>
</view>

View File

@ -25,7 +25,8 @@
<view class="u-flex color-666">
<radio-group @change="radioGroupChange">
<label class="radio u-m-r-60" v-for="(item,index) in eatTypes.list" :key="index">
<radio :value="''+index" :checked="index === eatTypes.active" class="scale7 " />
<radio :value="''+item.value" :checked="item.value == eatTypes.active"
class="scale7 " />
<text>{{item.label}}</text>
</label>
</radio-group>
@ -176,10 +177,10 @@
<view class="u-flex u-row-between u-m-t-30 u-p-b-34 border-bottom">
<view>
<text v-if="eatTypes.active==1">包装费</text>
<text v-if="eatTypes.active==2">包装费</text>
<text v-else>桌位费</text>
</view>
<view>0.00</view>
<view>{{$seatFee.totalAmount||'0.00'}}</view>
</view>
<view class="u-flex u-row-right u-m-t-38">
@ -218,13 +219,15 @@
<script setup>
import {
onLoad,onShow
onLoad,
onShow
} from '@dcloudio/uni-app'
import {
ref,
onBeforeUnmount,
reactive,
computed
computed,
watch
} from 'vue';
import myButton from '@/components/my-components/my-button'
import modelDiscount from './components/discount'
@ -237,9 +240,11 @@
} from '@/commons/utils/format.js';
import color from '@/commons/color.js';
import * as Api from '@/http/yskApi/Instead.js'
import {getNowCart} from '@/pagesCreateOrder/util.js'
const models = new Map();
//
let note=ref('')
let note = ref('')
function setModel(el) {
if (el && el.$attrs['name']) {
models.set(el.$attrs['name'], el);
@ -264,6 +269,18 @@
}),
defaultCateIndex: 1,
})
watch(() => userNumbers.defaultCateIndex, (newval) => {
updateChoseCount()
})
//
async function updateChoseCount(){
await Api.$choseCount({
masterId: option.masterId,
tableId: option.tableId,
num: userNumbers.defaultCateIndex,
})
}
function userNumberChange(e) {
userNumbers.defaultCateIndex = e.detail.value
@ -299,11 +316,11 @@
const eatTypes = reactive({
list: [{
label: '堂食',
value: '1'
value: 1
},
{
label: '自取',
value: '2'
value: 2
},
],
active: 1
@ -311,7 +328,6 @@
function radioGroupChange(e) {
eatTypes.active = e.detail.value
console.log(eatTypes.active);
}
@ -320,7 +336,7 @@
}
function chooseTable() {
go.to('PAGES_CHOOSE_TABLE',{
go.to('PAGES_CHOOSE_TABLE', {
...table.value
})
}
@ -336,6 +352,16 @@
})
}
let table = ref(null)
//
watch(() => table.value, (newval, oldval) => {
if (newval && oldval) {
Api.$choseTable({
orderId: 4462,
oldTableId: oldval.tableId,
newTableId: newval.tableId,
})
}
})
function watchChooseTable() {
uni.$off('choose-table')
@ -344,7 +370,7 @@
console.log(table.value);
})
}
const option = reactive({
masterId: '',
tableId: ""
@ -360,6 +386,11 @@
}, 0)
return result
})
//
const $seatFee = reactive({
totalNumber: 0,
totalAmount: 0,
})
const allPrice = computed(() => {
return goods.list.reduce((prve, cur) => {
return prve + cur.salePrice * cur.number * (cur.isGift ? 0 : 1)
@ -380,43 +411,49 @@
masterId: option.masterId,
tableId: option.tableId
}) {
const res = await Api.getCart(par)
goods.list = res.records.map(item => {
return {
...item,
isPack: returnBoolean(item.isPack),
isGift: returnBoolean(item.isGift)
}
})
const {
records,
seatFee
} = await Api.getCart(par)
goods.list =getNowCart(records)
if(seatFee&&seatFee.totalNumber){
userNumbers.defaultCateIndex = seatFee.totalNumber || 1
Object.assign($seatFee, seatFee)
}
console.log(goods.list);
}
//
async function createOrder(par = {
masterId: option.masterId,
vipUserId:user.value?user.value.id:'',
note:note.value,
postPay:true,
orderId:'',
vipUserId: user.value ? user.value.id : '',
note: note.value,
postPay: true,
orderId: '',
tableId: option.tableId
}) {
updateChoseCount()
const res = await Api.$createOrder(par)
uni.showToast({
title:'提交成功',
icon:'none'
title: '提交成功',
icon: 'none'
})
setTimeout(()=>{
uni.navigateBack({delta:2})
},500)
setTimeout(() => {
uni.$emit('orderDetail:update')
uni.navigateBack({
delta: 2
})
}, 500)
}
onLoad((opt) => {
console.log(opt);
Object.assign(option, opt)
if(opt){
table.value={
tableId:opt.tableId,
name:opt.tableName
if (opt) {
table.value = {
tableId: opt.tableId,
name: opt.tableName
}
}
getCart()
@ -424,11 +461,10 @@
onBeforeUnmount(() => {
})
onShow(()=>{
onShow(() => {
watchChooseuser()
watchChooseTable()
})
</script>
<style lang="scss" scoped>

View File

@ -24,7 +24,7 @@
<view class="search u-flex u-col-center ">
<view class="u-flex-1">
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="搜索店内商品" @confirm="search"
:focus="true" v-model="searchValue">
v-model="searchValue">
</uni-search-bar>
</view>
<view class="u-flex">
@ -70,18 +70,18 @@
</scroll-view>
</view>
<view class="bottom w-full">
<my-car @updateNumber="carsNumberChange" :user="data.vipUser" :masterId="data.masterId"
:table="data.table"
:data="cars" @clear="onClearCart"></my-car>
<my-car @updateNumber="carsNumberChange" :user="data.vipUser" :masterId="data.masterId" :table="data.table"
:data="cars" @clear="onClearCart"></my-car>
</view>
<!-- 选择规格 -->
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel" :title="guigeModelData.title"
:sku-map="guigeModelData.chooseGoods.skuMap" :skus="guigeModelData.chooseGoods.skus"></guige-model>
<!-- 添加附加费 -->
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge>
<!-- 选择规格 -->
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel"
:title="guigeModelData.title" :sku-map="guigeModelData.chooseGoods.skuMap"
:skus="guigeModelData.chooseGoods.skus"></guige-model>
<!-- 添加附加费 -->
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge>
</view>
</template>
<script setup>
import _ from 'lodash';
@ -112,6 +112,7 @@
import myCar from './components/car'
import go from '@/commons/utils/go.js';
import infoBox from '@/commons/utils/infoBox.js';
import {getNowCart} from '@/pagesCreateOrder/util.js'
const cars = reactive([])
const data = reactive({
scrollTop: 0, //tab
@ -302,9 +303,11 @@
data.masterId = masterId
const cartRes = await getCart()
cars.length = 0
for (let i in cartRes.records) {
cars.push(cartRes.records[i])
const cartArr =getNowCart(cartRes.records)
for (let i in cartArr) {
cars.push(cartArr[i])
}
const categoryRes = await getCategory()
const category = categoryRes.content.reduce((prve, cur) => {
prve.push({
@ -329,7 +332,7 @@
//
const surcharge = ref(null)
@ -663,15 +666,15 @@
onReady(() => {
getMenuItemTop()
})
let isTabClickOver=true
let isTabClickOver = true
//
async function swichMenu(index) {
if (data.arr.length == 0) {
await getMenuItemTop();
}
if (index == data.current) return;
isTabClickOver=false;
isTabClickOver = false;
data.scrollRightTop = data.oldScrollTop;
nextTick(function() {
data.scrollRightTop = data.arr[index] + data.topZhanwei;
@ -717,12 +720,12 @@
})
}
//
async function leftMenuStatus(index) {
if(!isTabClickOver){
if (!isTabClickOver) {
return
}
data.current = index;
@ -755,9 +758,9 @@
}).exec()
})
}
//
async function rightScroll(e) {
data.oldScrollTop = e.detail.scrollTop;
@ -777,16 +780,17 @@
let height2 = data.arr[i + 1];
// height2
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
if(isTabClickOver){
if (isTabClickOver) {
leftMenuStatus(i);
}else{
isTabClickOver=true
} else {
isTabClickOver = true
}
return;
}
}
}, 10)
}
function watchChooseuser() {
uni.$off('choose-user')
uni.$on('choose-user', (user) => {
@ -797,14 +801,13 @@
setUser()
})
}
onBeforeUnmount(() => {
})
onShow(()=>{
onBeforeUnmount(() => {})
onShow(() => {
watchChooseuser()
})
onLoad((opt) => {
console.log(opt)
Object.assign(data.table,opt)
Object.assign(data.table, opt)
if (!opt.tableId) {
infoBox.showErrorToast('暂不支持不选择台桌下载,请从桌台点餐')
return setTimeout(() => {
@ -813,8 +816,6 @@
}
init()
})
</script>
<style lang="scss" scoped>

View File

@ -0,0 +1,36 @@
<template>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
<view class="u-flex u-row-between">
<view class="font-bold">附加费</view>
<my-button plain shape="circle" :width="160" :height="56">退菜</my-button>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>{{data.name||'餐位费'}}</view>
<view>x{{data.number}}</view>
<view>{{data.number}}</view>
</view>
</view>
</template>
<script setup>
const props = defineProps({
data: {
type: Object,
default: () => {}
},
table:{
type: Object,
default: () => {}
}
})
const statusMap={
unpaid:'未支付'
}
function returnStatus(status){
return statusMap[status]||''
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,37 +1,48 @@
<template>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20" v-if="data.length">
<view class="u-font-32">
<view class="u-font-32 font-bold">
<text></text>
<text class="color-main font-bold"> {{goodsNumber}}</text>
<text>份菜品</text>
</view>
<view class="u-m-t-20 list">
<view class="item u-m-b-20" v-for="(item,index) in data" :key="index">
<view class="u-flex u-col-top">
<view>
<image class="img" :src="item.coverImg" mode=""></image>
</view>
<view class="u-p-l-30 u-flex-1">
<view class="u-flex u-row-between u-col-top">
<view>{{item.name}}</view>
<view class="u-text-right">
<view>{{item.salePrice}}</view>
<view class="u-m-t-10 u-font-24">X{{item.number}}</view>
<view class="u-m-b-20 u-m-t-20" v-for="(order,orderIndex) in data" :key="orderIndex">
<view class="u-font-32"> {{ order.placeNum }}次下单
</view>
<view class="u-m-t-20 list">
<view class="item u-m-b-20" v-for="(item,index) in order.info" :key="index">
<view class="u-flex u-col-top">
<view>
<image class="img" :src="item.coverImg" mode=""></image>
</view>
<view class="u-p-l-30 u-flex-1">
<view class="u-flex u-row-between u-col-top">
<view class="u-flex">
<view class="tui" v-if="item.status=='return'">
已退
</view>
<view :class="{'line-th':item.status=='return'}">{{item.name}}</view>
</view>
<view class="u-text-right">
<view>{{item.salePrice}}</view>
<view v-if="item.status=='return'" class="line-th color-666 u-font-24">{{item.salePrice}}</view>
<view class="u-m-t-10 u-font-24">X{{item.number}}</view>
</view>
</view>
</view>
</view>
<view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'">
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
<my-button :width="168" :height="60" plain shape="circle" @tap="tuicai(item,index)">退菜</my-button>
</view>
</view>
<view class="u-flex u-row-right gap-20 u-m-t-20">
<my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button>
<my-button :width="168" :height="60" plain shape="circle">退菜</my-button>
</view>
</view>
<view class="bg-gray u-p-20 u-m-t-20">
<view>备注</view>
<view class="u-m-t-10"></view>
</view>
</view>
<view class="bg-gray u-p-20 u-m-t-20 ">
<view>备注</view>
<view class="u-m-t-10"></view>
</view>
<view class="u-m-t-40">
<view class="u-flex u-row-between border-bottom u-p-b-20">
<view class="tag no-pay">
@ -47,11 +58,11 @@
<view></view>
<view>
<text>总计</text>
<text class="font-bold u-font-32">{{allPrice}}</text>
<text class="font-bold u-font-32">{{seatFee*1+allPrice*1}}</text>
</view>
</view>
<view class="u-m-t-30">
<my-button type="cancel" :color="color.ColorMain">重新打印</my-button>
<my-button @tap="printOrder" type="cancel" :color="color.ColorMain">重新打印</my-button>
</view>
</view>
</view>
@ -62,25 +73,42 @@
computed
} from 'vue';
import color from '@/commons/color.js'
const emits=defineEmits(['tuicai'])
function tuicai(item,index){
emits('tuicai',item,index)
}
const props = defineProps({
data: {
type: Array,
default: () => []
},
seatFee:{
type:[String,Number],
default:0
}
})
const allPrice = computed(() => {
return props.data.reduce((prve, cur) => {
return prve + cur.salePrice * cur.number
const curTotal=cur.info.filter(v=>v.isGift !== "true"&& v.status !== "return").reduce((a,b)=>{
return a+b.salePrice * b.number
},0)
return prve + curTotal
}, 0).toFixed(2)
})
const goodsNumber = computed(() => {
let result = 0
result = props.data.reduce((prve, cur) => {
return prve + cur.number
result = props.data.reduce((a, b) => {
const bTotal = b.info.reduce((prve, cur) => {
return prve + cur.number * 1;
}, 0);
return a + bTotal
}, 0)
return result
})
function printOrder(){
}
</script>
<style lang="scss" scoped>
@ -88,9 +116,13 @@
width: 70rpx;
height: 70rpx;
}
.border-bottom{
.border-bottom {
border-color: rgb(240, 240, 240);
}
.line-th{
text-decoration: line-through;
}
.tag {
padding: 2rpx 8rpx;
border-radius: 8rpx;
@ -100,4 +132,13 @@
color: #fff;
}
}
.tui{
background-color: rgb(239, 239, 239);
border-radius: 4rpx;
margin-right: 6rpx;
color: #666;
padding: 0 4rpx;
font-size: 20rpx;
}
</style>

View File

@ -14,7 +14,7 @@
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>就餐人数</view>
<view>1</view>
<view>{{seatFee.totalNumber}}</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>支付方式</view>
@ -26,11 +26,11 @@
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>下单时间</view>
<view>2024-08-31 15:54:40</view>
<view ><up-text v-if="data.createdAt" mode="date" :text="data.createdAt"></up-text></view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>订单编号</view>
<view>2024083115544056362</view>
<view>{{data.orderNo}}</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>商家备注</view>
@ -40,6 +40,7 @@
</template>
<script setup>
import orderEnum from '@/commons/orderEnum.js'
const props = defineProps({
data: {
type: Object,
@ -48,14 +49,16 @@
table:{
type: Object,
default: () => {}
},
seatFee:{
type: Object,
default: () => {totalNumber:0}
}
})
const statusMap={
unpaid:'未支付'
}
function returnStatus(status){
return statusMap[status]||''
const item=orderEnum.status.find(v=>v.key==status)
return item?item.label:''
}
</script>

View File

@ -0,0 +1,100 @@
<template>
<my-model title="退菜" ref="model" @close="onModelClose" @open="onModelOpen">
<template #desc>
<view class="u-p-30 u-text-left">
<view>
{{data.name}}
</view>
<view class="u-flex u-m-t-32">
<up-number-box :buttonSize="44" :inputWidth="220" v-model="number"></up-number-box>
</view>
<view class="u-m-t-32">
<view class="u-font-24">
<text class="color-999">退菜理由</text>
<text class="color-red">*</text>
</view>
<view class="u-flex u-flex-wrap u-m-t-24">
<view class="u-flex u-m-r-16 u-m-b-16" v-for="(item,index) in tags" :key="index">
<up-tag @click="changeTagSel(item)" :text="item.label" plain v-if="item.checked"> </up-tag>
<up-tag @click="changeTagSel(item)" borderColor="#E5E5E5" color="#999" :text="item.label" plain v-else> </up-tag>
</view>
</view>
<view class="u-m-t-24">
<up-input placeholder="备注"></up-input>
</view>
</view>
</view>
</template>
<template #btn>
<view class="u-p-t-18 u-p-l-30 u-p-r-30 u-p-b-30">
<my-button box-shadow shape="circle" @tap="confirm">确认退菜</my-button>
<view class="u-m-t-10">
<my-button @tap="toggleModelShow" shape="circle" bgColor="#fff" type="cancel" box-shadow>取消</my-button>
</view>
</view>
</template>
</my-model>
</template>
<script setup>
import {
ref,
watch
} from 'vue';
const props = defineProps({
data: {
type: Object,
default: () => {}
},
show: {
type: Boolean,
default: false
}
})
const emits = defineEmits(['update:show','confirm'])
let model = ref(null)
let modelShow = ref(props.show)
let number = ref(1)
const tags=ref([{label:"点错",checked:false},{label:"不想要了",checked:false} ,{label:"食材不足",checked:false} ,{label:"等待时间过长",checked:false}])
function changeTagSel(item){
item.checked=!item.checked
}
watch(() => props.show, (newval) => {
modelShow.value = newval
})
watch(() => modelShow.value, (newval) => {
emits('update:show', newval)
if (newval) {
open()
} else {
close()
}
})
function toggleModelShow(show){
modelShow.value=show?true:false
}
function onModelClose() {
modelShow.value = false
}
function onModelOpen() {
modelShow.value = true
}
function open() {
model.value.open()
}
function close() {
model.value.close()
}
function confirm(){
emits('confirm')
}
</script>
<style>
</style>

View File

@ -5,8 +5,10 @@
<text class="color-666">桌位号</text>
<text class="font-bold">{{options.name}}</text>
</view>
<goods-list :data="orderDetail.goodsList"></goods-list>
<order-vue :data="orderDetail.info" :table="options"></order-vue>
<goods-list :data="orderDetail.goodsList" :seatFee="orderDetail.seatFee.totalAmount"
@tuicai="onTuiCai"></goods-list>
<extra-vue :data="orderDetail.seatFee"></extra-vue>
<order-vue :data="orderDetail.info" :table="options" :seatFee="orderDetail.seatFee"></order-vue>
<step-vue></step-vue>
<view style="height: 200rpx;"></view>
<view class="u-fixed bottom bg-fff ">
@ -21,6 +23,8 @@
</view>
</view>
</view>
<tuicai-vue @confirm="tuicaiConfirm" v-model:show="tuicai.show" :data="tuicai.selGoods"></tuicai-vue>
</view>
</template>
@ -30,6 +34,8 @@
import orderVue from './components/order.vue';
import goodsList from './components/list.vue';
import stepVue from './components/step.vue';
import extraVue from './components/extra.vue';
import tuicaiVue from './components/tuicai.vue';
import go from '@/commons/utils/go.js'
import {
onLoad,
@ -40,6 +46,24 @@
reactive
} from 'vue';
import OrderDetail from './page.js'
const tuicai = reactive({
show: false,
selGoods: ''
})
function onTuiCai(goods, index) {
tuicai.show = true
tuicai.selGoods = goods
}
async function tuicaiConfirm() {
const res=await Api.$returnCart({
cartId: tuicai.selGoods.id,
tableId:options.tableId,
})
tuicai.selGoods.status='return'
tuicai.show = false
}
const uiPage = new OrderDetail()
setTimeout(() => {
uiPage.setVal('user', {
@ -50,22 +74,27 @@
function diancan() {
go.to('PAGES_CREATE_ORDER', {
tableId: options.tableId,
tableName: options.name
tableName: options.name,
type: 'add'
})
}
function toPay() {
go.to('PAGES_CRESATE_ORDER_PAY', {
...orderDetail.info,
tableId: options.tableId,
tableName: options.name,
masterId: options.masterId,
orderId: orderDetail.info.id,
discount: 1
})
}
const orderDetail = reactive({
goodsList: [],
info: {}
info: {},
seatFee: {
totalAmount: 0
}
})
const options = reactive({})
async function init() {
@ -73,14 +102,16 @@
masterId
} = await Api.$getMasterId(options)
console.log(masterId);
options.masterId=masterId
options.masterId = masterId
const {
records
records,
seatFee
} = await Api.getCart({
...options,
masterId
})
orderDetail.goodsList = records
orderDetail.seatFee = seatFee
const info = await Api.$createOrder({
masterId,
vipUserId: '',
@ -91,16 +122,16 @@
})
orderDetail.info = info
}
function watchEmit(){
function watchEmit() {
uni.$off('orderDetail:update')
uni.$once('orderDetail:update',(newval)=>{
uni.$once('orderDetail:update', (newval) => {
console.log(newval);
init()
})
}
onShow(()=>{
onShow(() => {
watchEmit()
})
onLoad((opt) => {
Object.assign(options, opt)

View File

@ -25,32 +25,49 @@
</view>
</view>
<view class="bg-fff box-shadow u-p-t-30 u-p-l-50 u-p-r-50 card bottom border-r-12 ">
<my-tabs :list="pays.list"></my-tabs>
<view class="list">
<view class="item" @click="changePayType(index)" v-for="(item,index) in pays.payTypes.list"
:key="index">
<view class="u-flex u-row-between u-p-t-30 u-p-b-30 border-bottom">
<view class="u-flex">
<image class="icon" :src="item.icon" mode=""></image>
<text class="u-m-l-10">{{item.payName}}</text>
</view>
<view class="u-flex color-999 u-font-24">
<!-- <view class="u-m-r-20">
<text>余额</text>
<text>0.00</text>
</view> -->
<my-radio @click="changePayType(index)" :modelValue="index==pays.payTypes.selIndex">
</my-radio>
<my-tabs :list="pays.list" v-model="pays.selIndex"></my-tabs>
<template v-if="pays.selIndex==0">
<view class="list">
<view class="item" @click="changePayType(index)" v-for="(item,index) in pays.payTypes.list"
:key="index">
<view class="u-flex u-row-between u-p-t-30 u-p-b-30 border-bottom">
<view class="u-flex">
<image class="icon" :src="item.icon" mode=""></image>
<text class="u-m-l-10">{{item.payName}}</text>
</view>
<view class="u-flex color-999 u-font-24">
<!-- <view class="u-m-r-20">
<text>余额</text>
<text>0.00</text>
</view> -->
<my-radio @click="changePayType(index)" :modelValue="index==pays.payTypes.selIndex">
</my-radio>
</view>
</view>
</view>
</view>
</view>
<view class="u-m-t-60 u-p-b-30">
<my-button @click="payOrder">确认付款</my-button>
</view>
</template>
<template v-else>
<view class="">
<view class="u-font-32 u-m-t-40 u-text-center">请让顾客使用微信扫码</view>
<view class="u-flex u-row-center u-m-t-40">
<image style="width: 300rpx;height: 300rpx;" src="@/static/logo.png" mode=""></image>
</view>
</view>
</template>
</view>
<view class="u-m-t-60 u-p-b-30">
<my-button @click="payOrder">确认付款</my-button>
<view class="bg-fff box-shadow u-p-t-30 u-p-l-50 u-p-r-50 card top border-r-12 ">
</view>
<view class="bg-fff box-shadow u-p-t-30 u-p-l-50 u-p-r-50 card bottom border-r-12 ">
</view>
<edit-discount title="优惠金额" :ref="setModel" name="editMoney" :price="order.amount"></edit-discount>
</view>
@ -70,6 +87,7 @@
import editDiscount from '@/pagesCreateOrder/components/edit-discount.vue'
const pays = reactive({
list: ['扫码收款', '二维码收款'],
selIndex: 0,
payTypes: {
list: [],
selIndex: 0
@ -97,54 +115,70 @@
function changePayType(i) {
pays.payTypes.selIndex = i
}
//
function paySuccess(){
infoBox.showToast('支付成功')
setTimeout(() => {
// uni.$emit('orderDetail:update')
uni.navigateBack({delta:2})
}, 500)
}
async function payOrder() {
const payType = pays.payTypes.list[pays.payTypes.selIndex].payType
await Api.$payOrder({
tableId: order.tableId,
masterId: order.masterId,
orderId: order.id,
orderId: order.id||order.orderId,
payType,
vipUserId: order.userId,
discount: 1,
code: ''
})
infoBox.showToast('支付成功')
setTimeout(() => {
uni.$emit('orderDetail:update')
uni.navigateBack()
}, 500)
paySuccess()
}
onMounted(() => {
getPayType()
})
const order = reactive({
amount: 0
})
function saoma(){
function saomaPay() {
const item = pays.payTypes.list[pays.payTypes.selIndex]
uni.scanCode({
onlyFromCamera: true,
success: function (res) {
success:function (res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
Api.$payOrder({
"orderId": order.orderId, // id
"payType": item.payType, //
"discount": order.discount,
"code": res.result
}).then(res=>{
console.log(res);
paySuccess()
})
}
});
}
watch(() => pays.payTypes.selIndex, (index) => {
const item = pays.payTypes.list[index]
watch(() => pays.payTypes.selIndex, (newval) => {
const item = pays.payTypes.list[newval]
if (item.payType == "vipPay") {
return
return
}
if (item.payType == "deposit") {
//
return saoma()
return saomaPay('deposit')
}
if (item.payType == "scanCode") {
//
return saoma()
return saomaPay('scanCode')
}
})
onLoad((opt) => {
console.log(opt);
Object.assign(order, opt)
})
</script>

16
pagesCreateOrder/util.js Normal file
View File

@ -0,0 +1,16 @@
import {
returnBoolean
} from '@/commons/utils/format.js';
// 返回购物车未下单的数据
export function getNowCart(records) {
const nowCart = records.find(v => v.placeNum == 0)
const Cart = nowCart ? nowCart.info : []
const result = Cart.map(item => {
return {
...item,
isPack: returnBoolean(item.isPack),
isGift: returnBoolean(item.isGift)
}
})
return result
}

View File

@ -0,0 +1,36 @@
<template>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
<view class="u-flex u-row-between">
<view class="font-bold">附加费</view>
<my-button plain shape="circle" :width="160" :height="56">退菜</my-button>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>{{data.name||'餐位费'}}</view>
<view>x{{data.number}}</view>
<view>{{data.number}}</view>
</view>
</view>
</template>
<script setup>
const props = defineProps({
data: {
type: Object,
default: () => {}
},
table:{
type: Object,
default: () => {}
}
})
const statusMap={
unpaid:'未支付'
}
function returnStatus(status){
return statusMap[status]||''
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,144 @@
<template>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20" v-if="data.length">
<view class="u-font-32 font-bold">
<text></text>
<text class="color-main font-bold"> {{goodsNumber}}</text>
<text>份菜品</text>
</view>
<view class="u-m-b-20 u-m-t-20" v-for="(order,orderIndex) in data" :key="orderIndex">
<view class="u-font-32"> {{ order.placeNum }}次下单
</view>
<view class="u-m-t-20 list">
<view class="item u-m-b-20" v-for="(item,index) in order.info" :key="index">
<view class="u-flex u-col-top">
<view>
<image class="img" :src="item.coverImg" mode=""></image>
</view>
<view class="u-p-l-30 u-flex-1">
<view class="u-flex u-row-between u-col-top">
<view class="u-flex">
<view class="tui" v-if="item.status=='return'">
已退
</view>
<view :class="{'line-th':item.status=='return'}">{{item.name}}</view>
</view>
<view class="u-text-right">
<view>{{item.salePrice}}</view>
<view v-if="item.status=='return'" class="line-th color-666 u-font-24">{{item.salePrice}}</view>
<view class="u-m-t-10 u-font-24">X{{item.number}}</view>
</view>
</view>
</view>
</view>
<view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'">
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
<my-button :width="168" :height="60" plain shape="circle" @tap="tuicai(item,index)">退菜</my-button>
</view>
</view>
</view>
<view class="bg-gray u-p-20 u-m-t-20">
<view>备注</view>
<view class="u-m-t-10"></view>
</view>
</view>
<view class="u-m-t-40">
<view class="u-flex u-row-between border-bottom u-p-b-20">
<view class="tag no-pay">
未支付
</view>
<view>
<text>小计</text>
<text class="font-bold u-font-32">{{allPrice}}</text>
</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view></view>
<view>
<text>总计</text>
<text class="font-bold u-font-32">{{seatFee*1+allPrice*1}}</text>
</view>
</view>
<view class="u-m-t-30">
<my-button @tap="printOrder" type="cancel" :color="color.ColorMain">重新打印</my-button>
</view>
</view>
</view>
</template>
<script setup>
import {
computed
} from 'vue';
import color from '@/commons/color.js'
const emits=defineEmits(['tuicai'])
function tuicai(item,index){
emits('tuicai',item,index)
}
const props = defineProps({
data: {
type: Array,
default: () => []
},
seatFee:{
type:[String,Number],
default:0
}
})
const allPrice = computed(() => {
return props.data.reduce((prve, cur) => {
const curTotal=cur.info.filter(v=>v.isGift !== "true"&& v.status !== "return").reduce((a,b)=>{
return a+b.salePrice * b.number
},0)
return prve + curTotal
}, 0).toFixed(2)
})
const goodsNumber = computed(() => {
let result = 0
result = props.data.reduce((a, b) => {
const bTotal = b.info.reduce((prve, cur) => {
return prve + cur.number * 1;
}, 0);
return a + bTotal
}, 0)
return result
})
function printOrder(){
}
</script>
<style lang="scss" scoped>
.img {
width: 70rpx;
height: 70rpx;
}
.border-bottom {
border-color: rgb(240, 240, 240);
}
.line-th{
text-decoration: line-through;
}
.tag {
padding: 2rpx 8rpx;
border-radius: 8rpx;
&.no-pay {
background-color: rgb(170, 170, 170);
color: #fff;
}
}
.tui{
background-color: rgb(239, 239, 239);
border-radius: 4rpx;
margin-right: 6rpx;
color: #666;
padding: 0 4rpx;
font-size: 20rpx;
}
</style>

View File

@ -0,0 +1,66 @@
<template>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
<view class="u-flex u-row-between">
<view>订单状态</view>
<view>{{returnStatus(data.status)}}</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>订单类型</view>
<view>堂食</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>桌位号</view>
<view>{{table.name}}</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>就餐人数</view>
<view>{{seatFee.totalNumber}}</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>支付方式</view>
<view></view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>预约时间</view>
<view></view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>下单时间</view>
<view ><up-text v-if="data.createdAt" mode="date" :text="data.createdAt"></up-text></view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>订单编号</view>
<view>{{data.orderNo}}</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>商家备注</view>
<my-button plain shape="circle" :width="160" :height="60">编辑</my-button>
</view>
</view>
</template>
<script setup>
import orderEnum from '@/commons/orderEnum.js'
const props = defineProps({
data: {
type: Object,
default: () => {}
},
table:{
type: Object,
default: () => {}
},
seatFee:{
type: Object,
default: () => {totalNumber:0}
}
})
function returnStatus(status){
const item=orderEnum.status.find(v=>v.key==status)
return item?item.label:''
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,26 @@
<template>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
<up-steps :dot="true" current="0" direction="column">
<up-steps-item title="2024-09-02 09:19" :itemStyle="itemStyle" desc="[东风(id:124413)]使用代客下单提交。(未打印预结单)">
</up-steps-item>
<up-steps-item title="2024-09-02 09:19" desc="[东风(id:124413)]使用代客下单提交。(未打印预结单)">
</up-steps-item>
</up-steps>
</view>
</template>
<script setup>
import {
reactive
} from 'vue';
import color from '@/commons/color.js'
const itemStyle = reactive({
color: 'rgb(255,0,0)'
})
</script>
<style>
</style>

View File

@ -0,0 +1,100 @@
<template>
<my-model title="退菜" ref="model" @close="onModelClose" @open="onModelOpen">
<template #desc>
<view class="u-p-30 u-text-left">
<view>
{{data.name}}
</view>
<view class="u-flex u-m-t-32">
<up-number-box :buttonSize="44" :inputWidth="220" v-model="number"></up-number-box>
</view>
<view class="u-m-t-32">
<view class="u-font-24">
<text class="color-999">退菜理由</text>
<text class="color-red">*</text>
</view>
<view class="u-flex u-flex-wrap u-m-t-24">
<view class="u-flex u-m-r-16 u-m-b-16" v-for="(item,index) in tags" :key="index">
<up-tag @click="changeTagSel(item)" :text="item.label" plain v-if="item.checked"> </up-tag>
<up-tag @click="changeTagSel(item)" borderColor="#E5E5E5" color="#999" :text="item.label" plain v-else> </up-tag>
</view>
</view>
<view class="u-m-t-24">
<up-input placeholder="备注"></up-input>
</view>
</view>
</view>
</template>
<template #btn>
<view class="u-p-t-18 u-p-l-30 u-p-r-30 u-p-b-30">
<my-button box-shadow shape="circle" @tap="confirm">确认退菜</my-button>
<view class="u-m-t-10">
<my-button @tap="toggleModelShow" shape="circle" bgColor="#fff" type="cancel" box-shadow>取消</my-button>
</view>
</view>
</template>
</my-model>
</template>
<script setup>
import {
ref,
watch
} from 'vue';
const props = defineProps({
data: {
type: Object,
default: () => {}
},
show: {
type: Boolean,
default: false
}
})
const emits = defineEmits(['update:show','confirm'])
let model = ref(null)
let modelShow = ref(props.show)
let number = ref(1)
const tags=ref([{label:"点错",checked:false},{label:"不想要了",checked:false} ,{label:"食材不足",checked:false} ,{label:"等待时间过长",checked:false}])
function changeTagSel(item){
item.checked=!item.checked
}
watch(() => props.show, (newval) => {
modelShow.value = newval
})
watch(() => modelShow.value, (newval) => {
emits('update:show', newval)
if (newval) {
open()
} else {
close()
}
})
function toggleModelShow(show){
modelShow.value=show?true:false
}
function onModelClose() {
modelShow.value = false
}
function onModelOpen() {
modelShow.value = true
}
function open() {
model.value.open()
}
function close() {
model.value.close()
}
function confirm(){
emits('confirm')
}
</script>
<style>
</style>

View File

@ -0,0 +1,40 @@
<template>
<view class="u-font-28 default-box-padding u-relative bg-fff border-r-12 u-overflow-hide">
<view class="change u-absolute my-bg-main color-fff left-top" >切换</view>
<view class="u-flex u-row-between u-m-t-20 border-bottom u-p-b-20">
<view class="u-flex">
<up-avatar :size="30"></up-avatar>
<view class="color-666 u-m-l-30">未绑定手机号</view>
</view>
<view>
<my-button :height="60" plain shape="circle">他的订单</my-button>
</view>
</view>
<view class="u-flex u-m-t-20 u-row-between">
<view class="">
<view class="font-bold">0.00</view>
<view class="color-666 u-m-t-10">余额</view>
</view>
<view class="">
<view class="font-bold">0.00</view>
<view class="color-666 u-m-t-10">积分</view>
</view>
<view class="">
<view class="font-bold">0.00</view>
<view class="color-666 u-m-t-10">已消费</view>
</view>
</view>
</view>
</template>
<script>
</script>
<style lang="scss" scoped>
.change{
padding: 4rpx 16rpx;
border-radius: 0 0 16rpx 0;
z-index: 2;
}
</style>

View File

@ -0,0 +1,154 @@
<template>
<view class="min-page bg-gray u-font-28 u-p-30">
<user-vue></user-vue>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
<text class="color-666">桌位号</text>
<text class="font-bold">{{options.name}}</text>
</view>
<goods-list :data="orderDetail.goodsList" :seatFee="orderDetail.seatFee.totalAmount"
@tuicai="onTuiCai"></goods-list>
<extra-vue :data="orderDetail.seatFee"></extra-vue>
<order-vue :data="orderDetail.info" :table="options" :seatFee="orderDetail.seatFee"></order-vue>
<step-vue></step-vue>
<view style="height: 200rpx;"></view>
<view class="u-fixed bottom bg-fff ">
<view class="u-flex u-abso">
<template v-if="orderDetail.info.status=='unpaid'">
<view class="u-flex-1">
<my-button @tap="diancan" color="#fff" bgColor="rgb(57,53,52)" borderRadius="100rpx 0 0 100rpx"
shape="circle" plain type="primary">加菜</my-button>
</view>
<view class="u-flex-1">
<my-button @tap="toPay" borderRadius="0 100rpx 100rpx 0" shape="circle"
type="primary">结账</my-button>
</view>
</template>
</view>
</view>
<tuicai-vue @confirm="tuicaiConfirm" v-model:show="tuicai.show" :data="tuicai.selGoods"></tuicai-vue>
</view>
</template>
<script setup>
import * as Api from '@/http/yskApi/Instead.js'
import * as orderApi from '@/http/yskApi/order.js'
import userVue from './components/user.vue';
import orderVue from './components/order.vue';
import goodsList from './components/list.vue';
import stepVue from './components/step.vue';
import extraVue from './components/extra.vue';
import tuicaiVue from './components/tuicai.vue';
import go from '@/commons/utils/go.js'
import {
onLoad,
onShow,
onHide
} from '@dcloudio/uni-app';
import {
reactive
} from 'vue';
import OrderDetail from './page.js'
const tuicai = reactive({
show: false,
selGoods: {}
})
function onTuiCai(goods, index) {
tuicai.show = true
tuicai.selGoods = goods
}
async function tuicaiConfirm() {
const res=await Api.$returnCart({
cartId: tuicai.selGoods.id,
tableId:options.tableId,
})
tuicai.selGoods.status='return'
tuicai.show = false
}
const uiPage = new OrderDetail()
setTimeout(() => {
uiPage.setVal('user', {
name: 1
})
}, 1500)
function diancan() {
go.to('PAGES_CREATE_ORDER', {
tableId: options.tableId,
tableName: options.name,
type: 'add'
})
}
function toPay() {
go.to('PAGES_CRESATE_ORDER_PAY', {
tableId: options.tableId,
tableName: options.name,
masterId: options.masterId,
orderId: orderDetail.info.id,
discount: 1
})
}
const orderDetail = reactive({
goodsList: [],
info: {},
seatFee: {
totalAmount: 0
}
})
const options = reactive({})
async function init() {
const res= await orderApi.tbOrderInfoDetail(options.id)
const masterId=res.masterId
options.masterId = res.masterId
if(res.status=='unpaid'){
const {
records,
seatFee
} = await Api.getCart({
masterId,
tableId:res.tableId
})
orderDetail.goodsList = records
orderDetail.seatFee = seatFee
}else{
orderDetail.goodsList = res.detailList
}
orderDetail.info = res
}
function watchEmit() {
uni.$off('orderDetail:update')
uni.$once('orderDetail:update', (newval) => {
console.log(newval);
init()
})
}
onShow(() => {
watchEmit()
})
onLoad((opt) => {
Object.assign(options, opt)
console.log(options);
init()
})
</script>
<style lang="scss" scoped>
.bottom {
bottom: 0;
left: 0;
right: 0;
height: 68rpx;
.u-abso {
bottom: 84rpx;
left: 28rpx;
right: 28rpx;
}
}
</style>

23
pagesOrder/detail/page.js Normal file
View File

@ -0,0 +1,23 @@
import {
reactive, ref
} from 'vue';
function isSameType(a, b) {
return a instanceof b === true || b instanceof a === true;
}
class OrderDetail {
constructor(data) {
const user ={}
const table = {}
const goodsList =[]
const orderInfo = {}
this.data=reactive({
user,table,goodsList,orderInfo
})
Object.assign(this, data)
}
setVal(key,val){
this.data[key]=val
}
}
export default OrderDetail

View File

@ -0,0 +1,194 @@
<template>
<view>
<view class="u-flex bg-fff u-p-l-28 u-p-r-28 u-row-between">
<view class="u-rela time-item tranistion-2" @click="changeTimeDataSel(index)"
:class="{active:timeData.sel==index}" v-for="(item,index) in timeData.list" :key="index">
{{item.label}}
</view>
<view class="u-rela time-item tranistion-2" @click="changeTimeDataSel(-1)"
:class="{active:timeData.sel==-1}">自定义</view>
</view>
<view class="u-m-t-2 bg-fff u-col-center u-flex u-p-l-28 u-p-r-28 u-p-t-30 u-row-between">
<view class="status-item " @click="changeStatusSel(index)" :class="{active:statusData.sel==index}"
v-for="(item,index) in statusData.list" :key="index">
{{item.label}}
</view>
<view class="status-item u-flex" @click="moreShowOpen">
<image src="@/pagesOrder/static/image/icon-search.svg" style="width: 38rpx;height: 30rpx;" mode="">
</image>
</view>
</view>
<view class="u-p-l-28 u-flex u-p-r-28 u-p-t-10 bg-gray" v-if="time.length">
<view class="time-area u-font-24 color-main u-flex">
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="time[0]"></uni-dateformat>
<text class="u-p-l-10 u-p-r-10"></text>
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="time[1]"></uni-dateformat>
</view>
</view>
<my-date-pickerview @confirm="datePickerConfirm" ref="datePicker"></my-date-pickerview>
<!-- 更多状态选择筛选 -->
<up-popup :round="10" :show="statusData.moreShow" :closeable="true" @close="moreShowHide">
<view class="u-text-center font-bold u-font-32 u-p-t-30">选择状态</view>
<view style="height: 20rpx;"></view>
<view class="u-p-30 all-list u-flex u-flex-wrap gap-20">
<view class="all-list-item" :class="{active:statusItemIndex==statusData.allListSel}" @click="changeAllListSel(statusItemIndex)" v-for="(statusItem,statusItemIndex) in statusData.allList" :key="statusItemIndex">
{{statusItem.label}}
</view>
</view>
<view class="u-flex u-p-t-30 u-p-b-30 u-p-l-20 u-p-r-20 gap-20">
<up-button @click="moreShowHide">取消</up-button>
<up-button type="primary" @click="moreShowHide">确定</up-button>
</view>
</up-popup>
</view>
</template>
<script setup>
import orderEnum from '@/commons/orderEnum.js'
import * as $time from '@/commons/utils/dayjs-time.js';
import {
reactive,
ref,
watch
} from 'vue';
const props = defineProps({
time: {
type: Array,
default: () => []
},
status: {
type: [String, Number],
default: ''
}
})
let datePicker = ref(null)
const emits = defineEmits(['update:time', 'update:status'])
// 使
const today = $time.getTodayTimestamps();
const yesterday = $time.getYesterdayTimestamps();
const thisWeek = $time.getThisWeekTimestamps();
const thisMonth = $time.getThisMonthTimestamps();
const timeData = reactive({
list: [today, yesterday, thisWeek, thisMonth],
sel: 0
})
function changeTimeDataSel(i) {
timeData.sel = i
if (i == -1) {
datePicker.value.open()
}
}
watch(() => timeData.sel, (newval) => {
const data = timeData.list[newval]
if (newval != -1) {
emits('update:time', [data.start, data.end])
}
})
const statusData = reactive({
allList: orderEnum.status,
moreShow:false,
allListSel: -1,
list: [{
label: '全部',
value: ''
},
{
label: '待完成',
value: ''
},
{
label: '待退款',
value: ''
},
{
label: '未支付',
value: 'unpaid'
},
{
label: '已退款',
value: ''
}
],
sel: 0
})
function moreShowHide(){
statusData.moreShow=false
}
function moreShowOpen(){
statusData.moreShow=true
}
function changeStatusSel(i) {
statusData.sel = i
}
function datePickerConfirm(e) {
console.log(e);
emits('update:time', [e.start, e.end])
}
function changeAllListSel(i){
statusData.allListSel=i
}
</script>
<style lang="scss" scoped>
.status-item {
color: #666;
transition: all .2s ease-in-out;
padding-bottom: 24rpx;
&.active {
color: $my-main-color;
}
}
.all-list-item{
text-align: center;
width: 156rpx;
white-space: nowrap;
color: #666;
padding: 10rpx 20rpx;
border-radius: 8rpx;
transition: all .2s ease-in-out;
border: 1px solid #eee;
&.active {
color: $my-main-color;
border-color: $my-main-color;
}
}
.time-item {
color: #666;
padding-bottom: 20rpx;
&::after {
content: '';
display: block;
position: absolute;
height: 4rpx;
left: 0;
right: 0;
bottom: 0;
border-radius: 4rpx 4rpx 4rpx 4rpx;
}
&.active {
color: $my-main-color;
// font-size: 32rpx;
transform: scale(1.1);
transform-origin: center;
font-weight: 700;
&::after {
background: #318AFE;
}
}
}
.time-area {
background: #E6F0FF;
border-radius: 100px;
padding: 10rpx 20rpx;
}
</style>

View File

@ -0,0 +1,120 @@
<template>
<view class="bg-fff item" @click="toDetail">
<view class="u-flex u-p-b-22 border-bottom u-col-bottom u-row-between">
<view class="u-flex u-col-bottom">
<view class="u-font-40 color-333">{{data.tableName}}</view>
<view class="u-m-l-22">{{data.masterId}}</view>
</view>
<view class="u-flex">
<view>
<text :class="[data.status]">{{returnStatus(data.status)}}</text>
</view>
<view class="color-main u-m-l-24">
<text>
{{sendTypeFilter(data.sendType)}}
</text>
</view>
</view>
</view>
<view class="u-m-t-26">
<view class="u-flex u-col-bottom u-font-24 color-999">
<up-avatar :size="33"></up-avatar>
<view class="u-m-l-16">{{formatTime(data.createdAt)}}</view>
</view>
<view class="u-m-t-32">
<view class="u-font-32">1种商品共1件</view>
<view class="border-bottom u-p-b-32">
<view class="u-flex u-row-between u-m-t-24" v-for="(item,index) in data.detailList" :key="index">
<view>
<view class="color-666"> {{item.productName}}</view>
<view class="color-999 u-font-24 u-m-t-8">
{{item.productSkuName}}
</view>
</view>
<view class="u-flex">
<view>×1</view>
<view class="u-m-l-24">15.00</view>
</view>
</view>
</view>
</view>
<view class="u-flex u-row-between border-bottom u-m-t-32 u-p-b-32">
<view>订单备注</view>
<view>{{data.remark||'无'}}</view>
</view>
<view class="u-m-t-32">
<view class="u-flex u-row-right">
<text>小计</text>
<text class="font-bold u-font-32">{{data.orderAmount}}</text>
</view>
<view class="u-flex u-row-right u-m-t-24">
<view class="print">重新打印</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import dayjs from 'dayjs';
import orderEnum from '@/commons/orderEnum.js'
import go from '@/commons/utils/go.js'
const props = defineProps({
data: {
type: Object,
default: () => {}
},
index: {
type: [String, Number],
default: 0
}
})
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) {
return orderEnum.sendType.find(item => item.key == t).label;
} else {
return t;
}
}
function toDetail(){
go.to('PAGES_ORDER_DETAIL',{
id:props.data.id
})
}
</script>
<style lang="scss" scoped>
.border-bottom {
border-bottom: 1rpx solid #E5E5E5;
}
.u-font-40 {
font-size: 40rpx;
}
.item {
padding: 16rpx 24rpx 32rpx 24rpx;
border-radius: 18rpx 18rpx 18rpx 18rpx;
margin-bottom: 32rpx;
}
.unpaid {
color: #FD7B49;
}
.print{
padding: 6rpx 14rpx 8rpx 18rpx;
border:1px solid $my-main-color;
color:$my-main-color;
font-size: 24rpx;
border-radius: 100rpx;
}
</style>

View File

@ -0,0 +1,31 @@
<template>
<view class="list">
<view v-for="(item,index) in list" :key="index">
<order-item :data="item" :index="index"></order-item>
</view>
<view v-if="hasAjax&&!list.length">
<my-img-empty tips="亲,你还没有订单哦~"></my-img-empty>
</view>
</view>
</template>
<script setup>
import orderItem from './order-item.vue';
const props=defineProps({
list:{
type:Array,
default:()=>[]
},
hasAjax:{
type:Boolean,
default:false
}
})
</script>
<style lang="scss" scoped>
.list {
padding: 32rpx 28rpx;
}
</style>

View File

@ -0,0 +1,65 @@
<template>
<view class="min-page bg-gray u-font-28">
<view class="top">
<view class="search bg-fff u-p-t-32 u-p-l-28 u-p-r-28 u-p-b-32">
<up-search v-bind="search" v-model="search.val"></up-search>
</view>
<filter-vue v-model:time="pageData.order.query.createdAt"></filter-vue>
</view>
<order-list :hasAjax="pageData.order.hasAjax" :list="pageData.order.list"></order-list>
</view>
</template>
<script setup>
import * as Api from '@/http/yskApi/order.js'
import filterVue from './compoents/filter.vue';
import orderList from './compoents/order-list.vue';
import {
reactive, watch
} from 'vue';
const search = reactive({
val: '',
placeholder: '搜索单号/昵称/姓名/手机号码/商品名称',
shape: 'square',
inputStyle: {
borderRadius: '12rpx'
},
actionStyle: {
textAlign: 'right'
}
})
const pageData = reactive({
order: {
list: [],
hasAjax:false,
query: {
createdAt: [],
id: "",
orderNo: "",
orderType: "0",
page: 0,
pageSize: 10,
payType: "",
productName: "",
status: ""
}
}
})
watch(()=>pageData.order.query.createdAt,(newval)=>{
init()
})
async function init() {
const {content}=await Api.tbOrderInfoData(pageData.order.query)
pageData.order.hasAjax=true
pageData.order.list=content
console.log(content);
}
init()
</script>
<style>
.top {
background-color: #E5E5E5;
}
</style>

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="19.091" height="15" viewBox="0 0 19.091 15"><defs><style>.a{fill:#318afe;}</style></defs><path class="a" d="M64.682,160H82.409a.682.682,0,1,1,0,1.364H64.682a.682.682,0,1,1,0-1.364Zm0,13.636H76.955a.682.682,0,0,1,0,1.364H64.682a.682.682,0,0,1,0-1.364ZM80.773,170.5l2.045,3.136a.682.682,0,1,1-1.091.818l-2.045-3.136a10.526,10.526,0,0,1-2.045.273,4.773,4.773,0,1,1,4.773-4.773A5.15,5.15,0,0,1,80.773,170.5Zm-3.136-.273a3.409,3.409,0,1,0-3.409-3.409A3.376,3.376,0,0,0,77.636,170.227Zm-12.955-3.409h5.455a.682.682,0,1,1,0,1.364H64.682a.682.682,0,0,1,0-1.364Z" transform="translate(-64 -160)"/></svg>

After

Width:  |  Height:  |  Size: 641 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32"><defs><style>.a{fill:#80bcff;}.b{clip-path:url(#a);}.c{fill:#4c99fe;}.d{fill:#197dff;}</style><clipPath id="a"><rect class="a" width="32" height="32" transform="translate(121 613)"/></clipPath></defs><g class="b" transform="translate(-121 -613)"><path class="c" d="M157.133,65.1h-4.344a2.052,2.052,0,0,0-1.985-1.574h-2.153a1.807,1.807,0,0,0-3.349,0h-2.188a2.058,2.058,0,0,0-1.985,1.574h-4.344a2,2,0,0,0-1.985,2.053V89.246a2.023,2.023,0,0,0,1.985,2.053H157.1a2.088,2.088,0,0,0,2.085-2.053V67.155A2.034,2.034,0,0,0,157.133,65.1Zm-10.124.992a1.642,1.642,0,1,1-1.642,1.642A1.642,1.642,0,0,1,147.009,66.095Zm6.258,17a.76.76,0,0,1-.753.753H141.5a.76.76,0,0,1-.753-.753v-.685a.76.76,0,0,1,.753-.753h11.01a.76.76,0,0,1,.753.753Zm0-6.943a.76.76,0,0,1-.753.753H141.5a.76.76,0,0,1-.753-.753v-.685a.76.76,0,0,1,.753-.753h11.01a.76.76,0,0,1,.753.753Z" transform="translate(-11.01 550.904)"/><path class="c" d="M9.823,6.186a1.25,1.25,0,0,1,0-2.3.4.4,0,0,0,.228-.488,5.4,5.4,0,0,0-.264-.655.392.392,0,0,0-.5-.2A1.25,1.25,0,0,1,7.67.883.4.4,0,0,0,7.5.371,5.224,5.224,0,0,0,6.674.022.4.4,0,0,0,6.186.25a1.25,1.25,0,0,1-1.152.763A1.251,1.251,0,0,1,3.882.249.394.394,0,0,0,3.4.02a5.273,5.273,0,0,0-.767.319.4.4,0,0,0-.2.494A1.249,1.249,0,0,1,.824,2.447a.4.4,0,0,0-.493.2,5.077,5.077,0,0,0-.311.747.4.4,0,0,0,.228.491,1.25,1.25,0,0,1,.762,1.151A1.25,1.25,0,0,1,.248,6.186a.4.4,0,0,0-.228.491,5.223,5.223,0,0,0,.311.75.4.4,0,0,0,.493.2A1.249,1.249,0,0,1,2.433,9.24a.408.408,0,0,0,.211.5,5.192,5.192,0,0,0,.726.3.4.4,0,0,0,.506-.231,1.249,1.249,0,0,1,2.322,0,.4.4,0,0,0,.506.231,5.066,5.066,0,0,0,.528-.209.4.4,0,0,0,.219-.5A1.249,1.249,0,0,1,9.139,7.76a.4.4,0,0,0,.513-.166,5.211,5.211,0,0,0,.4-.916.4.4,0,0,0-.228-.492Zm-4.788.556a1.71,1.71,0,1,1,1.71-1.71A1.715,1.715,0,0,1,5.035,6.742Z" transform="translate(141.93 634.935)"/><path class="d" d="M18.394,28.9a5.28,5.28,0,0,1-.233-.59.4.4,0,0,1,.228-.49,1.25,1.25,0,0,0,0-2.3.4.4,0,0,1-.228-.491,5.157,5.157,0,0,1,.31-.747.4.4,0,0,1,.493-.2,1.25,1.25,0,0,0,1.608-1.614.4.4,0,0,1,.2-.5,5.323,5.323,0,0,1,.768-.319.393.393,0,0,1,.485.229,1.251,1.251,0,0,0,2.3,0,.41.41,0,0,1,.057-.095v3.668a1.71,1.71,0,1,0-.577,2.8A2.1,2.1,0,0,1,22.3,28.9Z" transform="translate(123.79 613.304)"/></g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB