Merge branch 'ymf' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into test
This commit is contained in:
74
commons/goodsData.js
Normal file
74
commons/goodsData.js
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
import dayjs from "dayjs";
|
||||||
|
export const $types = [{
|
||||||
|
title: "计量商品",
|
||||||
|
desc: '单价购买',
|
||||||
|
value: 'normal'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "多规格",
|
||||||
|
desc: '多种不同规格',
|
||||||
|
value: 'sku'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "套餐组合",
|
||||||
|
desc: '选择多种组合',
|
||||||
|
value: 'group'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "称重商品",
|
||||||
|
desc: '按重量售卖',
|
||||||
|
value: 'weight'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "时价商品",
|
||||||
|
desc: '收银端可更改价格',
|
||||||
|
value: 'currentPrice'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
// 商品默认sku
|
||||||
|
export const $defaultSku = {
|
||||||
|
salePrice: '',
|
||||||
|
memberPrice: '',
|
||||||
|
costPrice: '',
|
||||||
|
originPrice: '',
|
||||||
|
// stockNumber: '',
|
||||||
|
firstShared: '',
|
||||||
|
suit: 1,
|
||||||
|
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 库存记录筛选类型
|
||||||
|
export const $invoicingType = [{
|
||||||
|
text: '全部',
|
||||||
|
value: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '供应商入库',
|
||||||
|
value: 'purveyor'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '供应商退货',
|
||||||
|
value: 'reject'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '其他入库',
|
||||||
|
value: 'purchase'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '其他出库',
|
||||||
|
value: 'other-out'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
// 页面常用数据
|
||||||
|
export const $pageData = {
|
||||||
|
query: {
|
||||||
|
page: 0,
|
||||||
|
size: 10
|
||||||
|
},
|
||||||
|
totalElements: 0,
|
||||||
|
list: [],
|
||||||
|
hasAjax: false,
|
||||||
|
}
|
||||||
@@ -30,5 +30,9 @@ export const $status = {
|
|||||||
cleaning: {
|
cleaning: {
|
||||||
label: "待清台",
|
label: "待清台",
|
||||||
type: "#FAAD14",
|
type: "#FAAD14",
|
||||||
|
},
|
||||||
|
unbind: {
|
||||||
|
label: "未绑定",
|
||||||
|
type: "rgb(221,221,221)",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
} from '@/commons/utils/encryptUtil.js'
|
} from '@/commons/utils/encryptUtil.js'
|
||||||
import infoBox from "@/commons/utils/infoBox.js"
|
import infoBox from "@/commons/utils/infoBox.js"
|
||||||
import go from '@/commons/utils/go.js';
|
import go from '@/commons/utils/go.js';
|
||||||
|
import { reject } from 'lodash';
|
||||||
// 测试服
|
// 测试服
|
||||||
let baseUrl = 'https://admintestpapi.sxczgkj.cn'
|
let baseUrl = 'https://admintestpapi.sxczgkj.cn'
|
||||||
|
|
||||||
@@ -127,8 +128,9 @@ function commonsProcess(showLoading, httpReqCallback) {
|
|||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
if(res.status==401){
|
if(res.status==401){
|
||||||
storageManage.token(null, true)
|
storageManage.token(null, true)
|
||||||
infoBox.showErrorToast('请登录').then(() => {
|
infoBox.showErrorToast(res.message||'请登录').then(() => {
|
||||||
go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH)
|
uni.redirectTo({url: '/pages/login/index'})
|
||||||
|
reject()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// if(res.status==400){
|
// if(res.status==400){
|
||||||
@@ -138,9 +140,7 @@ function commonsProcess(showLoading, httpReqCallback) {
|
|||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
if(res.status==500){
|
if(res.status==500){
|
||||||
storageManage.token(null, true)
|
infoBox.showErrorToast(res.message||'服务器异常').then(() => {
|
||||||
infoBox.showErrorToast('请登录').then(() => {
|
|
||||||
go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// if(res&&res.msg){
|
// if(res&&res.msg){
|
||||||
|
|||||||
@@ -24,3 +24,27 @@ export function $bind(data) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//获取台桌详情状态
|
||||||
|
export function $returnTableDetail(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/tbShopTable/state',
|
||||||
|
method: "get",
|
||||||
|
params: {
|
||||||
|
shopId: uni.getStorageSync('shopId'),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 选择台桌
|
||||||
|
export function $choseTable(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/place/choseTable',
|
||||||
|
method: "put",
|
||||||
|
data: {
|
||||||
|
shopId: uni.getStorageSync('shopId'),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
"quickapp" : {},
|
"quickapp" : {},
|
||||||
/* 快应用特有相关 */
|
/* 快应用特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "wxcbff1cfb27c1066c",
|
"appid" : "wxcf0fe8cdba153fd6",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false,
|
"urlCheck" : false,
|
||||||
"minified" : true,
|
"minified" : true,
|
||||||
|
|||||||
@@ -930,7 +930,7 @@
|
|||||||
import {
|
import {
|
||||||
$types,
|
$types,
|
||||||
$defaultSku
|
$defaultSku
|
||||||
} from '../goodsData.js'
|
} from '@/commons/goodsData.js'
|
||||||
import {
|
import {
|
||||||
$getProductDetail,
|
$getProductDetail,
|
||||||
$tbShopCategory,
|
$tbShopCategory,
|
||||||
|
|||||||
@@ -546,7 +546,7 @@
|
|||||||
import {
|
import {
|
||||||
$types,
|
$types,
|
||||||
$defaultSku
|
$defaultSku
|
||||||
} from '../goodsData.js'
|
} from '@/commons/goodsData.js'
|
||||||
import {
|
import {
|
||||||
$getProductDetail,
|
$getProductDetail,
|
||||||
$tbShopCategory,
|
$tbShopCategory,
|
||||||
|
|||||||
@@ -183,8 +183,9 @@
|
|||||||
import go from '@/commons/utils/go.js';
|
import go from '@/commons/utils/go.js';
|
||||||
import color from '@/commons/color.js';
|
import color from '@/commons/color.js';
|
||||||
import {
|
import {
|
||||||
|
$types,
|
||||||
$defaultSku
|
$defaultSku
|
||||||
} from '../goodsData.js'
|
} from '@/commons/goodsData.js'
|
||||||
import {
|
import {
|
||||||
$productSpec
|
$productSpec
|
||||||
} from '@/http/yskApi/goods.js';
|
} from '@/http/yskApi/goods.js';
|
||||||
|
|||||||
@@ -78,7 +78,8 @@
|
|||||||
import listItem from './components/list-item';
|
import listItem from './components/list-item';
|
||||||
import {
|
import {
|
||||||
$pageData
|
$pageData
|
||||||
} from '../goodsData.js'
|
} from '@/commons/goodsData.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
reactive,
|
reactive,
|
||||||
|
|||||||
@@ -93,8 +93,9 @@
|
|||||||
$getProductDetail,
|
$getProductDetail,
|
||||||
$getProductStockDetail,$getProductStockDetailSum
|
$getProductStockDetail,$getProductStockDetailSum
|
||||||
} from '@/http/yskApi/goods.js'
|
} from '@/http/yskApi/goods.js'
|
||||||
import {$invoicingType} from '../goodsData.js'
|
import {
|
||||||
|
$invoicingType
|
||||||
|
} from '@/commons/goodsData.js'
|
||||||
const search = reactive({
|
const search = reactive({
|
||||||
keyword: '',
|
keyword: '',
|
||||||
show: false
|
show: false
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
$types
|
$types
|
||||||
} from '@/pageProduct/goodsData.js'
|
} from '@/commons/goodsData.js'
|
||||||
export function returnSkuSnap(goods) {
|
export function returnSkuSnap(goods) {
|
||||||
const selectSpec = typeof goods.selectSpec === 'string' ? JSON.parse(goods.selectSpec) : goods.selectSpec
|
const selectSpec = typeof goods.selectSpec === 'string' ? JSON.parse(goods.selectSpec) : goods.selectSpec
|
||||||
let result = selectSpec.map(v => {
|
let result = selectSpec.map(v => {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<input v-model="search.keyword" @confirm="searchConfirm" type="text"
|
<input v-model="search.keyword" @confirm="searchConfirm" type="text"
|
||||||
placeholder-style="font-size:28rpx;" placeholder="搜索" />
|
placeholder-style="font-size:28rpx;" placeholder="搜索" />
|
||||||
</view>
|
</view>
|
||||||
<view @tap.stop="hideSearch" v-if="search.show">取消</view>
|
<view @tap.stop="clearSearch" v-if="search.show">取消</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view :style="{height:times.show?timesHeight:0}" class="tranistion status overflow-hide">
|
<view :style="{height:times.show?timesHeight:0}" class="tranistion status overflow-hide">
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<view :style="{height: status.bottomHeight+'px'}"></view>
|
<view :style="{height: status.bottomHeight+'px'}"></view>
|
||||||
</view>
|
</view>
|
||||||
<view :style="{height:status.show?statusHeight:0}" class="tranistion status overflow-hide">
|
<view :style="{height:status.show?statusHeight:0}" class="tranistion status overflow-hide">
|
||||||
<view @tap="changestatusActive(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
<view @tap="changestatusActive(index,item)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
||||||
v-for="(item,index) in status.list" :key="index">
|
v-for="(item,index) in status.list" :key="index">
|
||||||
<view>{{item.label}}</view>
|
<view>{{item.label}}</view>
|
||||||
<uni-icons v-if="status.active===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
<uni-icons v-if="status.active===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
||||||
@@ -55,10 +55,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="u-m-t-30 u-flex u-flex-wrap u-row-between">
|
<view class="u-m-t-30 ">
|
||||||
|
<template v-if="tables.list.length">
|
||||||
|
<view class="u-flex u-flex-wrap u-row-between">
|
||||||
<view class="u-m-b-30" v-for="(item,index) in tables.list" :key="index">
|
<view class="u-m-b-30" v-for="(item,index) in tables.list" :key="index">
|
||||||
<table-item @bind="unBind" @update="getTable" :areaMap="areaMap" @more="moreShow(item)" :data="item"></table-item>
|
<table-item @bind="unBind" @update="getTable" :areaMap="areaMap" @more="moreShow(item)" :data="item"></table-item>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<my-pagination :page="query.page" :totalElements="query.totalElements" :size="query.size"
|
||||||
|
@change="pageChange"></my-pagination>
|
||||||
|
</template>
|
||||||
|
|
||||||
<my-img-empty v-if="tables.hasAjax&&!tables.list.length" tips="未找到相关桌台"></my-img-empty>
|
<my-img-empty v-if="tables.hasAjax&&!tables.list.length" tips="未找到相关桌台"></my-img-empty>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -239,12 +246,16 @@
|
|||||||
|
|
||||||
function searchConfirm() {
|
function searchConfirm() {
|
||||||
hideSearch()
|
hideSearch()
|
||||||
filterTableList()
|
query.page=1;
|
||||||
|
getTable()
|
||||||
// tables.list = tables.originList.filter((v) =>
|
// tables.list = tables.originList.filter((v) =>
|
||||||
// v.name.includes(search.keyword.trim())
|
// v.name.includes(search.keyword.trim())
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
|
function clearSearch(){
|
||||||
|
search.keyword=''
|
||||||
|
hideSearch()
|
||||||
|
}
|
||||||
function hideSearch() {
|
function hideSearch() {
|
||||||
search.show = false
|
search.show = false
|
||||||
maskHide()
|
maskHide()
|
||||||
@@ -372,10 +383,17 @@
|
|||||||
mask.value.close()
|
mask.value.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
const query = {
|
const query = reactive({
|
||||||
page: 0,
|
page: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
areaId: 0
|
areaId: 0,
|
||||||
|
totalElements:0
|
||||||
|
})
|
||||||
|
// 页数改变事件
|
||||||
|
function pageChange(page) {
|
||||||
|
console.log(page);
|
||||||
|
query.page = page
|
||||||
|
getTable()
|
||||||
}
|
}
|
||||||
const tables = reactive({
|
const tables = reactive({
|
||||||
hasAjax: false,
|
hasAjax: false,
|
||||||
@@ -392,12 +410,14 @@
|
|||||||
query.areaId = item.id
|
query.areaId = item.id
|
||||||
}
|
}
|
||||||
async function getTable() {
|
async function getTable() {
|
||||||
|
let state=status.list[status.active].key
|
||||||
|
state=state?(state=='all'?'':state):''
|
||||||
const {
|
const {
|
||||||
content
|
content,total
|
||||||
} = await $table.get(query)
|
} = await $table.get({...query,name:search.keyword,state})
|
||||||
tables.hasAjax = true
|
tables.hasAjax = true
|
||||||
tables.originList = content
|
query.totalElements=total||0
|
||||||
filterTableList()
|
tables.list = content
|
||||||
}
|
}
|
||||||
const areaMap = ref({})
|
const areaMap = ref({})
|
||||||
async function getArea() {
|
async function getArea() {
|
||||||
@@ -415,28 +435,19 @@
|
|||||||
}
|
}
|
||||||
watch(() => tables.area.sel, (newval) => {
|
watch(() => tables.area.sel, (newval) => {
|
||||||
console.log(newval);
|
console.log(newval);
|
||||||
query.page = 0
|
query.page = 1
|
||||||
getTable()
|
getTable()
|
||||||
})
|
})
|
||||||
watch(() => status.active, (newval) => {
|
watch(() => status.active, (newval) => {
|
||||||
query.page = 0
|
query.page = 1
|
||||||
// if (newval === 0) {
|
// if (newval === 0) {
|
||||||
// return tables.list = tables.originList
|
// return tables.list = tables.originList
|
||||||
// }
|
// }
|
||||||
// tables.list = tables.originList.filter((v) => {
|
// tables.list = tables.originList.filter((v) => {
|
||||||
// return v.status == status.list[status.active].key
|
// return v.status == status.list[status.active].key
|
||||||
// });
|
// });
|
||||||
filterTableList()
|
getTable()
|
||||||
})
|
})
|
||||||
|
|
||||||
function filterTableList() {
|
|
||||||
tables.list = tables.originList.filter((v) => {
|
|
||||||
console.log(status.list[status.active].key);
|
|
||||||
return (status.active == 0 ? true : v.status == status.list[status.active].key) && (
|
|
||||||
v.name.includes(search.keyword.trim())
|
|
||||||
)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
watch(() => times.active, (newval) => {
|
watch(() => times.active, (newval) => {
|
||||||
setTimer()
|
setTimer()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -239,14 +239,10 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
// vdata.formData.username = '15699991111'
|
vdata.formData.username = '17792050546'
|
||||||
// vdata.formData.pwd = '123456'
|
vdata.formData.pwd = 'sy666888'
|
||||||
vdata.formData.username = ''
|
|
||||||
vdata.formData.pwd = ''
|
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
vdata.formData.username = ''
|
|
||||||
vdata.formData.pwd = ''
|
|
||||||
// vdata.formData.username = '15699991111'
|
// vdata.formData.username = '15699991111'
|
||||||
// vdata.formData.pwd = 'qwer1234'
|
// vdata.formData.pwd = 'qwer1234'
|
||||||
// #endif
|
// #endif
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
<view class="list ">
|
<view class="list ">
|
||||||
<view class=" bg-fff box bg-fff">
|
<view class=" bg-fff box bg-fff">
|
||||||
|
<template v-if="tables.list.length">
|
||||||
<view class="u-flex item u-row-between" v-for="(item,index) in tables.list" :key="index"
|
<view class="u-flex item u-row-between" v-for="(item,index) in tables.list" :key="index"
|
||||||
@tap="chooseTable(index,item)">
|
@tap="chooseTable(index,item)">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
@@ -45,6 +46,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<my-pagination :page="query.page" :totalElements="query.totalElements" :size="query.size"
|
||||||
|
@change="pageChange"></my-pagination>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<template v-if="tables.list.length<=0">
|
<template v-if="tables.list.length<=0">
|
||||||
<my-img-empty tips="未找到相关的桌台"></my-img-empty>
|
<my-img-empty tips="未找到相关的桌台"></my-img-empty>
|
||||||
</template>
|
</template>
|
||||||
@@ -95,9 +101,12 @@
|
|||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
let searchValue = ref('')
|
let searchValue = ref('')
|
||||||
function search(){
|
|
||||||
|
|
||||||
|
function search() {
|
||||||
|
query.page=1
|
||||||
|
getTable()
|
||||||
}
|
}
|
||||||
|
|
||||||
function chooseTable(index, item) {
|
function chooseTable(index, item) {
|
||||||
if (item.status == 'closed') {
|
if (item.status == 'closed') {
|
||||||
return uni.showToast({
|
return uni.showToast({
|
||||||
@@ -128,11 +137,20 @@
|
|||||||
function areaChange(e) {
|
function areaChange(e) {
|
||||||
area.defaultCateIndex = e.detail.value
|
area.defaultCateIndex = e.detail.value
|
||||||
area.sel = area.list[e.detail.value]
|
area.sel = area.list[e.detail.value]
|
||||||
|
query.page=1
|
||||||
|
getTable()
|
||||||
}
|
}
|
||||||
const query = {
|
const query = {
|
||||||
page: 0,
|
page: 1,
|
||||||
size: 100,
|
size: 10,
|
||||||
areaId: 0
|
areaId: 0,
|
||||||
|
totalElements:0
|
||||||
|
}
|
||||||
|
// 页数改变事件
|
||||||
|
function pageChange(page) {
|
||||||
|
console.log(page);
|
||||||
|
query.page = page
|
||||||
|
getTable()
|
||||||
}
|
}
|
||||||
const tables = reactive({
|
const tables = reactive({
|
||||||
hasAjax: false,
|
hasAjax: false,
|
||||||
@@ -141,14 +159,14 @@
|
|||||||
list: []
|
list: []
|
||||||
})
|
})
|
||||||
async function getTable() {
|
async function getTable() {
|
||||||
|
// let state=status.list[status.active].key
|
||||||
|
// state=state?(state=='all'?'':state):''
|
||||||
|
const areaId=area.list[area.defaultCateIndex].id
|
||||||
let {
|
let {
|
||||||
content
|
content,total
|
||||||
} = await $table.get(query)
|
} = await $table.get({...query,areaId,name:searchValue.value,state:'idle'})
|
||||||
tables.hasAjax = true
|
query.totalElements=total||0;
|
||||||
content = content.filter(v =>{
|
tables.hasAjax = true;
|
||||||
// return v.status == 'idle'||(v.status=='using')
|
|
||||||
return v.status == 'idle'
|
|
||||||
})
|
|
||||||
console.log(content);
|
console.log(content);
|
||||||
tables.list = content
|
tables.list = content
|
||||||
tables.selIndex = content.findIndex(v => v.tableId == option.tableId)
|
tables.selIndex = content.findIndex(v => v.tableId == option.tableId)
|
||||||
@@ -172,11 +190,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
watch(() => area.sel, (newval) => {
|
watch(() => area.sel, (newval) => {
|
||||||
if(!newval){
|
getTable()
|
||||||
tables.list = tables.originList
|
|
||||||
return
|
|
||||||
}
|
|
||||||
tables.list = tables.originList.filter(v => v.areaId == newval.id)
|
|
||||||
})
|
})
|
||||||
let option = {}
|
let option = {}
|
||||||
onLoad(opt => {
|
onLoad(opt => {
|
||||||
@@ -202,6 +216,7 @@
|
|||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
width: 18px;
|
width: 18px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
background-color: $my-main-color;
|
background-color: $my-main-color;
|
||||||
border-color: $my-main-color;
|
border-color: $my-main-color;
|
||||||
@@ -225,11 +240,14 @@
|
|||||||
.scale7 {
|
.scale7 {
|
||||||
transform: scale(0.7);
|
transform: scale(0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .uni-searchbar {
|
::v-deep .uni-searchbar {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search {
|
.search {
|
||||||
padding: 20rpx 28rpx 20rpx 28rpx;
|
padding: 20rpx 28rpx 20rpx 28rpx;
|
||||||
|
|
||||||
.icon-saoma {
|
.icon-saoma {
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
width: 34rpx;
|
width: 34rpx;
|
||||||
@@ -239,6 +257,7 @@
|
|||||||
|
|
||||||
.list {
|
.list {
|
||||||
padding: 32rpx 24rpx;
|
padding: 32rpx 24rpx;
|
||||||
|
|
||||||
.no-choose {
|
.no-choose {
|
||||||
padding: 36rpx 30rpx 36rpx 24rpx;
|
padding: 36rpx 30rpx 36rpx 24rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<view class="search bg-fff u-flex u-col-center ">
|
<view class="search bg-fff u-flex u-col-center ">
|
||||||
<view class="u-flex-1">
|
<view class="u-flex-1">
|
||||||
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="搜索" @confirm="search"
|
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="搜索" @confirm="search"
|
||||||
|
@clear="search"
|
||||||
v-model="query.name">
|
v-model="query.name">
|
||||||
</uni-search-bar>
|
</uni-search-bar>
|
||||||
</view>
|
</view>
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
<view>不选择用户</view>
|
<view>不选择用户</view>
|
||||||
<my-radio v-model="nouser" :size="18" border-color="#d1d1d1" @change="chooseUser"></my-radio>
|
<my-radio v-model="nouser" :size="18" border-color="#d1d1d1" @change="chooseUser"></my-radio>
|
||||||
</view>
|
</view>
|
||||||
|
<template v-if="list.length>0">
|
||||||
<view class="u-m-t-32 bg-fff box bg-fff">
|
<view class="u-m-t-32 bg-fff box bg-fff">
|
||||||
<view class="u-flex item u-row-between" v-for="(item,index) in list" :key="index"
|
<view class="u-flex item u-row-between" v-for="(item,index) in list" :key="index"
|
||||||
@tap="chooseUser(index,item)">
|
@tap="chooseUser(index,item)">
|
||||||
@@ -42,6 +44,16 @@
|
|||||||
border-color="#d1d1d1"></my-radio>
|
border-color="#d1d1d1"></my-radio>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="u-m-t-32">
|
||||||
|
<my-pagination :page="query.page" :totalElements="query.totalElements" :size="query.size"
|
||||||
|
@change="pageChange"></my-pagination>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<template v-if="hasAjax&&list.length<=0">
|
||||||
|
<my-img-empty tips="未找到相关用户"></my-img-empty>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -54,11 +66,13 @@
|
|||||||
onLoad
|
onLoad
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
import {
|
import {
|
||||||
reactive,onBeforeMount,
|
reactive,
|
||||||
|
onBeforeMount,
|
||||||
ref
|
ref
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
let nouser = ref(false)
|
let nouser = ref(false)
|
||||||
let timer = null
|
let timer = null
|
||||||
|
|
||||||
function emitChooser(data) {
|
function emitChooser(data) {
|
||||||
uni.$emit('choose-user', data)
|
uni.$emit('choose-user', data)
|
||||||
timer = setTimeout(() => {
|
timer = setTimeout(() => {
|
||||||
@@ -68,6 +82,7 @@
|
|||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
})
|
})
|
||||||
|
|
||||||
function chooseUser(index, item) {
|
function chooseUser(index, item) {
|
||||||
if (index === undefined || item === undefined) {
|
if (index === undefined || item === undefined) {
|
||||||
nouser.value = true
|
nouser.value = true
|
||||||
@@ -85,28 +100,38 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const query = reactive({
|
const query = reactive({
|
||||||
page: 0,
|
page: 1,
|
||||||
name: '',
|
name: '',
|
||||||
size: 300,
|
totalElements: 0,
|
||||||
|
size: 10,
|
||||||
isVip: 1
|
isVip: 1
|
||||||
})
|
})
|
||||||
const list = reactive([])
|
const list = reactive([])
|
||||||
|
let hasAjax=ref(false)
|
||||||
async function getUser() {
|
async function getUser() {
|
||||||
const {
|
const {
|
||||||
content
|
content,
|
||||||
|
totalElements
|
||||||
} = await Api.queryAllShopUser(query)
|
} = await Api.queryAllShopUser(query)
|
||||||
|
hasAjax.value=true
|
||||||
|
list.length=content.length
|
||||||
for (let i in content) {
|
for (let i in content) {
|
||||||
list.push({
|
list[i]={
|
||||||
...content[i],
|
...content[i],
|
||||||
checked: false
|
checked: false
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
query.totalElements = totalElements
|
||||||
console.log(list);
|
console.log(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pageChange(e) {
|
||||||
|
query.page=e
|
||||||
|
getUser()
|
||||||
|
}
|
||||||
|
|
||||||
function search() {
|
function search() {
|
||||||
query.page = 0
|
query.page = 1
|
||||||
list.length = 0
|
|
||||||
getUser()
|
getUser()
|
||||||
}
|
}
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page-gray color-333 u-font-28">
|
<view class="page-gray color-333 u-font-28">
|
||||||
<template v-if="true">
|
<template v-if="true">
|
||||||
<view class="block u-p-t-32 u-p-b-32">
|
<view class="block u-p-t-32 u-p-b-32" v-if="table&&table.tableId">
|
||||||
<view>桌位号</view>
|
<view>桌位号</view>
|
||||||
<view class="font-bold u-font-32 u-m-t-16">
|
<view class="font-bold u-font-32 u-m-t-16">
|
||||||
{{table.name||''}}
|
{{table.name||''}}
|
||||||
|
|||||||
@@ -63,8 +63,9 @@
|
|||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<up-modal title="提示" content="是否清空全部已添加的商品?" :show="modal.clear" showCancelButton closeOnClickOverlay @confirm="confirmModelConfirm"
|
<up-modal title="提示" content="是否清空全部已添加的商品?" :show="modal.clear" showCancelButton closeOnClickOverlay
|
||||||
@cancel="setModalShow('clear',false)" @close="setModalShow('clear',false)" width="300px"></up-modal>
|
@confirm="confirmModelConfirm" @cancel="setModalShow('clear',false)" @close="setModalShow('clear',false)"
|
||||||
|
width="300px"></up-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -163,6 +164,13 @@
|
|||||||
status,
|
status,
|
||||||
type
|
type
|
||||||
} = props.table
|
} = props.table
|
||||||
|
if (props.table.tableId == '') {
|
||||||
|
go.to('PAGES_CONFIRM_ORDER', {
|
||||||
|
masterId: props.masterId,
|
||||||
|
isCreateOrderToDetail: props.isCreateOrderToDetail ? 1 : 0
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
go.to('PAGES_CONFIRM_ORDER', {
|
go.to('PAGES_CONFIRM_ORDER', {
|
||||||
masterId: props.masterId,
|
masterId: props.masterId,
|
||||||
type,
|
type,
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
toRefs,
|
toRefs,
|
||||||
watch
|
watch
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
import util from '../util.js';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
img:{
|
img:{
|
||||||
type:Object,
|
type:Object,
|
||||||
@@ -99,7 +100,7 @@
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
item.isPauseSale ||
|
item.isPauseSale ||
|
||||||
(item.typeEnum !== "sku" && item.specList[0].stockNumber <= 0)
|
(item.typeEnum !== "sku" && item.isStock==1&& item.stockNumber <= 0)
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -103,8 +103,8 @@
|
|||||||
<list-goods-item :img="{width:'330rpx',height:'330rpx'}"
|
<list-goods-item :img="{width:'330rpx',height:'330rpx'}"
|
||||||
@chooseGuige="chooseGuige(goodsItem.goodsIndex,goodsItem.index)"
|
@chooseGuige="chooseGuige(goodsItem.goodsIndex,goodsItem.index)"
|
||||||
@add="searchGoodsUpdate(goodsItem,goodsIndex,true)"
|
@add="searchGoodsUpdate(goodsItem,goodsIndex,true)"
|
||||||
@reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)" :index="goodsItem.goodsIndex"
|
@reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)"
|
||||||
:data="goodsItem"></list-goods-item>
|
:index="goodsItem.goodsIndex" :data="goodsItem"></list-goods-item>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -122,20 +122,27 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 选择规格 -->
|
<!-- 选择规格 -->
|
||||||
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel"
|
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel" :goodsData="selGoods"
|
||||||
:goodsData="selGoods"
|
|
||||||
:title="guigeModelData.title" :sku-map="guigeModelData.chooseGoods.skuMap"
|
:title="guigeModelData.title" :sku-map="guigeModelData.chooseGoods.skuMap"
|
||||||
:skus="guigeModelData.chooseGoods.skus"></guige-model>
|
:skus="guigeModelData.chooseGoods.skus"></guige-model>
|
||||||
<!-- 添加附加费 -->
|
<!-- 添加附加费 -->
|
||||||
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge>
|
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge>
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<up-modal title="提示" content="该台桌购物车里有商品,是否清除该台桌里的商品?" :show="modal.clear" showCancelButton closeOnClickOverlay
|
||||||
|
@confirm="confirmModelConfirm" @cancel="confirmModelConfirm('cancel')" @close="setModalShow('clear',false)"
|
||||||
|
width="300px">
|
||||||
|
|
||||||
|
</up-modal>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import * as Api from '@/http/yskApi/Instead.js'
|
import * as Api from '@/http/yskApi/Instead.js'
|
||||||
import {
|
import {
|
||||||
$table
|
$table,
|
||||||
|
$choseTable,
|
||||||
|
$returnTableDetail
|
||||||
} from '@/http/yskApi/table.js'
|
} from '@/http/yskApi/table.js'
|
||||||
import {
|
import {
|
||||||
$tbShopCategory
|
$tbShopCategory
|
||||||
@@ -158,7 +165,8 @@
|
|||||||
reactive,
|
reactive,
|
||||||
ref,
|
ref,
|
||||||
nextTick,
|
nextTick,
|
||||||
watch,getCurrentInstance
|
watch,
|
||||||
|
getCurrentInstance
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import myCar from './components/car'
|
import myCar from './components/car'
|
||||||
import go from '@/commons/utils/go.js';
|
import go from '@/commons/utils/go.js';
|
||||||
@@ -173,7 +181,41 @@
|
|||||||
import {
|
import {
|
||||||
tbShopInfo
|
tbShopInfo
|
||||||
} from '@/http/yskApi/user.js'
|
} from '@/http/yskApi/user.js'
|
||||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
import {
|
||||||
|
hasPermission
|
||||||
|
} from '@/commons/utils/hasPermission.js'
|
||||||
|
|
||||||
|
|
||||||
|
const modal = reactive({
|
||||||
|
key: '',
|
||||||
|
clear: false,
|
||||||
|
data: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
async function confirmModelConfirm(isCancel = false) {
|
||||||
|
if (modal.key == 'clear') {
|
||||||
|
try {
|
||||||
|
await $choseTable({
|
||||||
|
masterId: data.masterId,
|
||||||
|
tableId: modal.data.tableId,
|
||||||
|
isClear: !isCancel ? true : false,
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
//TODO handle the exception
|
||||||
|
}
|
||||||
|
data.table = modal.data;
|
||||||
|
setModalShow('clear', false, '')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setModalShow(key = 'show', show = true, data) {
|
||||||
|
modal.key = key
|
||||||
|
modal[key] = show
|
||||||
|
modal.data = data
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const instance = getCurrentInstance();
|
const instance = getCurrentInstance();
|
||||||
let canXiadan = ref(false)
|
let canXiadan = ref(false)
|
||||||
async function xiadanClick() {
|
async function xiadanClick() {
|
||||||
@@ -333,9 +375,9 @@
|
|||||||
}
|
}
|
||||||
//加入购物车
|
//加入购物车
|
||||||
function addCart(par) {
|
function addCart(par) {
|
||||||
if (!data.table.tableId) {
|
// if (!data.table.tableId) {
|
||||||
return infoBox.showToast('请先选择桌台!')
|
// return infoBox.showToast('请先选择桌台!')
|
||||||
}
|
// }
|
||||||
const submitPar = {
|
const submitPar = {
|
||||||
masterId: data.masterId,
|
masterId: data.masterId,
|
||||||
tableId: data.table.tableId,
|
tableId: data.table.tableId,
|
||||||
@@ -413,6 +455,8 @@
|
|||||||
let $originGoods = []
|
let $originGoods = []
|
||||||
let $category = []
|
let $category = []
|
||||||
async function init() {
|
async function init() {
|
||||||
|
const masterRes = await getMasterId()
|
||||||
|
data.masterId = masterRes.masterId
|
||||||
const shopInfo = await tbShopInfo()
|
const shopInfo = await tbShopInfo()
|
||||||
$shop.value = shopInfo
|
$shop.value = shopInfo
|
||||||
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
|
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
|
||||||
@@ -440,10 +484,7 @@
|
|||||||
$originGoods = goods
|
$originGoods = goods
|
||||||
if (!data.table.tableId) {
|
if (!data.table.tableId) {
|
||||||
//无桌台
|
//无桌台
|
||||||
const {
|
|
||||||
masterId
|
|
||||||
} = await getMasterId()
|
|
||||||
data.masterId = masterId
|
|
||||||
setTabBar(category, goods, [])
|
setTabBar(category, goods, [])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -534,8 +575,27 @@
|
|||||||
|
|
||||||
function watchChooseTable() {
|
function watchChooseTable() {
|
||||||
uni.$off('choose-table')
|
uni.$off('choose-table')
|
||||||
uni.$on('choose-table', (tableData) => {
|
uni.$on('choose-table', async (item) => {
|
||||||
data.table = tableData
|
if (data.table.tableId || cars.length <= 0) {
|
||||||
|
data.table = item
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (item.status != "idle") {
|
||||||
|
return infoBox.showToast('该台桌已在使用中')
|
||||||
|
}
|
||||||
|
const res = await $returnTableDetail({
|
||||||
|
tableId: item.tableId,
|
||||||
|
});
|
||||||
|
if (res.cartCount > 0) {
|
||||||
|
setModalShow('clear', true, item)
|
||||||
|
} else {
|
||||||
|
await $choseTable({
|
||||||
|
masterId: data.masterId,
|
||||||
|
tableId: item.tableId,
|
||||||
|
isClear:false
|
||||||
|
});
|
||||||
|
data.table = item
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -698,6 +758,7 @@
|
|||||||
|
|
||||||
|
|
||||||
let selGoods = ref({})
|
let selGoods = ref({})
|
||||||
|
|
||||||
function chooseGuige(foodsindex, index) {
|
function chooseGuige(foodsindex, index) {
|
||||||
if (!canAddGoods()) {
|
if (!canAddGoods()) {
|
||||||
return infoBox.showToast('请先选择桌台', 0.5).then(res => {
|
return infoBox.showToast('请先选择桌台', 0.5).then(res => {
|
||||||
@@ -812,6 +873,7 @@
|
|||||||
function searchGoodsUpdate(goodsItem, goodsIndex, isAdd) {
|
function searchGoodsUpdate(goodsItem, goodsIndex, isAdd) {
|
||||||
goodsUpdate(goodsItem.goodsIndex, goodsItem.index, isAdd, goodsIndex)
|
goodsUpdate(goodsItem.goodsIndex, goodsItem.index, isAdd, goodsIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSearchGoods(index, chooseNumber) {
|
function setSearchGoods(index, chooseNumber) {
|
||||||
if (index !== undefined) {
|
if (index !== undefined) {
|
||||||
searchResult.value[index].chooseNumber = chooseNumber
|
searchResult.value[index].chooseNumber = chooseNumber
|
||||||
@@ -1231,10 +1293,12 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .uni-searchbar {
|
::v-deep .uni-searchbar {
|
||||||
padding-top: 12px !important;
|
padding-top: 12px !important;
|
||||||
padding-bottom: 16px !important;
|
padding-bottom: 16px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.right-box {
|
.right-box {
|
||||||
width: 572rpx;
|
width: 572rpx;
|
||||||
// background-color: rgb(250, 250, 250);
|
// background-color: rgb(250, 250, 250);
|
||||||
@@ -1258,6 +1322,7 @@
|
|||||||
.item-title {
|
.item-title {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
color: $my-main-color;
|
color: $my-main-color;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,12 @@
|
|||||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
|
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
|
<view>
|
||||||
<template v-if="data.status!='return'">
|
<template v-if="data.status!='return'">
|
||||||
<view class="u-flex u-row-between u-m-t-24">
|
<view class="u-flex u-row-between u-m-t-24">
|
||||||
<view>{{data.name||'餐位费'}}</view>
|
<view>{{data.name||'餐位费'}}</view>
|
||||||
<view>x{{data.number}}</view>
|
<view>x{{data.number}}</view>
|
||||||
<view>¥{{data.totalAmount}}</view>
|
<view class="price-min-width">¥{{data.totalAmount}}</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@@ -22,14 +23,32 @@
|
|||||||
<view class="line-th ">{{data.name||'餐位费'}}</view>
|
<view class="line-th ">{{data.name||'餐位费'}}</view>
|
||||||
<view class="tag yitui u-m-l-10">已退</view>
|
<view class="tag yitui u-m-l-10">已退</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line-th">x{{data.number}}</view>
|
<view class="line-th">x{{data.number||0}}</view>
|
||||||
<view class="line-th">¥{{data.totalAmount}}</view>
|
<view class="line-th">¥{{data.totalAmount}}</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- <view class="u-flex u-row-right u-m-t-24">
|
||||||
|
<template v-if="orderInfo.status=='unpaid'&&data.status!='return'">
|
||||||
|
<my-button plain shape="circle" :width="160" :height="56" @click="tuicai">退菜</my-button>
|
||||||
|
</template>
|
||||||
|
<template v-if="orderInfo.status=='closed'&&data.status!='return'">
|
||||||
|
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
|
||||||
|
</template>
|
||||||
|
</view> -->
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-between u-m-t-24" v-if="packeFee>0">
|
||||||
|
<view>打包费</view>
|
||||||
|
<view>x{{packeNumbber}}</view>
|
||||||
|
<view class="price-min-width">¥{{packeFee}}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import {
|
||||||
|
computed
|
||||||
|
} from 'vue'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -37,24 +56,47 @@
|
|||||||
},
|
},
|
||||||
orderInfo: {
|
orderInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {
|
||||||
|
return {
|
||||||
|
detailList: []
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const packeNumbber = computed(() => {
|
||||||
|
if (!props.orderInfo.detailList) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return props.orderInfo.detailList.reduce((prve, cur) => {
|
||||||
|
return prve + (cur.packAmount>0?cur.num:0)
|
||||||
|
}, 0)
|
||||||
|
})
|
||||||
|
const packeFee = computed(() => {
|
||||||
|
if (!props.orderInfo.detailList) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return props.orderInfo.detailList.reduce((prve, cur) => {
|
||||||
|
return prve + cur.packAmount
|
||||||
|
}, 0).toFixed(2)
|
||||||
|
})
|
||||||
|
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
unpaid: '未支付'
|
unpaid: '未支付'
|
||||||
}
|
}
|
||||||
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
||||||
|
|
||||||
function returnStatus(status) {
|
function returnStatus(status) {
|
||||||
return statusMap[status] || ''
|
return statusMap[status] || ''
|
||||||
}
|
}
|
||||||
|
|
||||||
function tuikuan() {
|
function tuikuan() {
|
||||||
emits('tuikuan', props.data)
|
emits('tuikuan', props.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
function tuicai() {
|
function tuicai() {
|
||||||
emits('tuicai', props.data)
|
emits('tuicai', props.data)
|
||||||
}
|
}
|
||||||
@@ -65,9 +107,14 @@
|
|||||||
padding: 0 6rpx;
|
padding: 0 6rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
|
||||||
&.yitui {
|
&.yitui {
|
||||||
background-color: rgb(188, 188, 188);
|
background-color: rgb(188, 188, 188);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.price-min-width{
|
||||||
|
min-width: 100rpx;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template v-if="orderInfo.status=='unpaid'">
|
<template v-if="orderInfo.status=='unpaid'&&orderInfo.useType!='dine-in-before'">
|
||||||
<view class="u-flex u-row-right gap-20 u-m-t-24" v-if="item.status!='return'">
|
<view class="u-flex u-row-right gap-20 u-m-t-24" v-if="item.status!='return'">
|
||||||
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
|
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
|
||||||
<my-button :width="128" :height="48" plain shape="circle"
|
<my-button :width="128" :height="48" plain shape="circle"
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
<goods-list @printOrder="onPrintOrder" @tuikuan="onTuikuan" :orderInfo="orderDetail.info"
|
<goods-list @printOrder="onPrintOrder" @tuikuan="onTuikuan" :orderInfo="orderDetail.info"
|
||||||
:data="orderDetail.goodsList" :seatFee="orderDetail.seatFee" @tuicai="onTuiCai"></goods-list>
|
:data="orderDetail.goodsList" :seatFee="orderDetail.seatFee" @tuicai="onTuiCai"></goods-list>
|
||||||
<template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount">
|
<!-- <template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount"> -->
|
||||||
|
<template v-if="true">
|
||||||
<extra-vue @tuicai="onSeatFeeTuicai" @tuikuan="onSeatFeeTuiKuan" :orderInfo="orderDetail.info"
|
<extra-vue @tuicai="onSeatFeeTuicai" @tuikuan="onSeatFeeTuiKuan" :orderInfo="orderDetail.info"
|
||||||
:data="orderDetail.seatFee"></extra-vue>
|
:data="orderDetail.seatFee"></extra-vue>
|
||||||
</template>
|
</template>
|
||||||
@@ -16,7 +17,7 @@
|
|||||||
<view style="height: 200rpx;"></view>
|
<view style="height: 200rpx;"></view>
|
||||||
<view class="u-fixed bottom bg-fff ">
|
<view class="u-fixed bottom bg-fff ">
|
||||||
<view class="u-flex u-abso">
|
<view class="u-flex u-abso">
|
||||||
<template v-if="orderDetail.info.useType=='takeout'">
|
<template v-if="orderDetail.info.useType=='takeout'||!orderDetail.info.tableId||orderDetail.info.useType=='dine-in-before'">
|
||||||
<view class="u-flex-1" v-if="orderDetail.info.status=='unpaid'">
|
<view class="u-flex-1" v-if="orderDetail.info.status=='unpaid'">
|
||||||
<my-button @tap="toPay" borderRadius="100rpx" shape="circle"
|
<my-button @tap="toPay" borderRadius="100rpx" shape="circle"
|
||||||
type="primary">结账</my-button>
|
type="primary">结账</my-button>
|
||||||
|
|||||||
@@ -30,8 +30,9 @@
|
|||||||
<view class="u-m-t-32">
|
<view class="u-m-t-32">
|
||||||
<view class="u-font-32">{{goosZhonglei}}种商品,共{{goodsNumber}}件</view>
|
<view class="u-font-32">{{goosZhonglei}}种商品,共{{goodsNumber}}件</view>
|
||||||
<view class="border-bottom u-p-b-32">
|
<view class="border-bottom u-p-b-32">
|
||||||
<view class="u-flex u-row-between u-col-top u-m-t-32" v-for="(item,index) in data.detailList"
|
<view class="" v-for="(item,index) in data.detailList"
|
||||||
:key="index">
|
:key="index">
|
||||||
|
<view class="u-flex u-row-between u-col-top u-m-t-32" v-if="item.productId!=-999">
|
||||||
<view>
|
<view>
|
||||||
<view class=""> {{item.productName}}</view>
|
<view class=""> {{item.productName}}</view>
|
||||||
<view class="color-999 u-font-24 u-m-t-8">
|
<view class="color-999 u-font-24 u-m-t-8">
|
||||||
@@ -40,12 +41,31 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-flex-1 u-row-right">
|
<view class="u-flex u-flex-1 u-row-right">
|
||||||
<view>×{{item.num}}</view>
|
<view>×{{item.num}}</view>
|
||||||
<view class="u-text-right" :style="computedPriceStyle()">¥{{item.priceAmount}}</view>
|
<view class="u-text-right u-relative" :style="computedPriceStyle()">
|
||||||
|
<text :class="{'line-th':item.gift}">¥{{goodsPriceAmount(item)}}</text>
|
||||||
|
<view class="u-absolute" style="bottom: 100%;right: 0;" v-if="item.gift">
|
||||||
|
¥0
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="border-bottom">
|
||||||
|
<view class="u-flex u-row-between u-m-t-32 u-col-top" v-if="data.packFee>0">
|
||||||
|
<view class="no-wrap u-m-r-32">打包费</view>
|
||||||
|
<view>¥{{data.packFee||0}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-between u-m-t-32 u-p-b-32 u-col-top" v-if="data.seatInfo&&data.seatInfo.priceAmount>0">
|
||||||
|
<view class="no-wrap u-m-r-32">{{data.seatInfo.productName}}</view>
|
||||||
|
<view>¥{{data.seatInfo.priceAmount}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="u-flex u-row-between border-bottom u-m-t-32 u-p-b-32 u-col-top">
|
<view class="u-flex u-row-between border-bottom u-m-t-32 u-p-b-32 u-col-top">
|
||||||
<view class="no-wrap u-m-r-32">订单备注</view>
|
<view class="no-wrap u-m-r-32">订单备注</view>
|
||||||
<view>{{data.remark||'无'}}</view>
|
<view>{{data.remark||'无'}}</view>
|
||||||
@@ -78,8 +98,15 @@
|
|||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
|
return{
|
||||||
|
packFee:0,
|
||||||
|
seatInfo:{
|
||||||
|
productName:'客座费',
|
||||||
|
priceAmount:0
|
||||||
|
},
|
||||||
detailList: []
|
detailList: []
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
index: {
|
index: {
|
||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
@@ -91,7 +118,14 @@
|
|||||||
let goodsNumber = ref(0)
|
let goodsNumber = ref(0)
|
||||||
|
|
||||||
const priceSize = 9
|
const priceSize = 9
|
||||||
|
function goodsPriceAmount(item){
|
||||||
|
return item.price*item.num
|
||||||
|
}
|
||||||
|
// const packeFee=computed(()=>{
|
||||||
|
// return props.data.detailList.reduce((prve,cur)=>{
|
||||||
|
// return prve+cur.packAmount
|
||||||
|
// },0).toFixed(2)
|
||||||
|
// })
|
||||||
function computedPriceStyle() {
|
function computedPriceStyle() {
|
||||||
const item = props.data.detailList.reduce((prev, current) => (`${prev.price}`.length > `${current.price}`
|
const item = props.data.detailList.reduce((prev, current) => (`${prev.price}`.length > `${current.price}`
|
||||||
.length) ? prev : current)
|
.length) ? prev : current)
|
||||||
|
|||||||
Reference in New Issue
Block a user