Merge branch 'ymf' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into test
This commit is contained in:
commit
d7db3dd7dd
|
|
@ -4,13 +4,19 @@
|
|||
"version" : "0.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
"app-plus" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"playground" : "custom",
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ class LIST{
|
|||
getVal(key){
|
||||
return this.data[key]
|
||||
}
|
||||
setQuery(key,val){
|
||||
this.data.query[key]=val
|
||||
}
|
||||
setVal(key,val){
|
||||
this.data[key]=val
|
||||
if(key=='page'){
|
||||
|
|
|
|||
|
|
@ -378,3 +378,15 @@ text {
|
|||
.filter-gray{
|
||||
filter: grayscale(1);
|
||||
}
|
||||
// .u-font-20{
|
||||
// font-size: 10px;
|
||||
// }
|
||||
// .u-font-24{
|
||||
// font-size: 12px;
|
||||
// }
|
||||
// .u-font-28{
|
||||
// font-size: 14px;
|
||||
// }
|
||||
// .u-font-32{
|
||||
// font-size: 16px;
|
||||
// }
|
||||
|
|
@ -0,0 +1,203 @@
|
|||
<template>
|
||||
<my-model ref="model" :title="title" iconColor="#000" @close="resetForm">
|
||||
<template #desc>
|
||||
<view class="u-text-left u-p-30 color-666">
|
||||
<view class="u-m-t-32 u-flex ">
|
||||
<view>应付金额</view>
|
||||
<view class="u-m-l-32">
|
||||
{{form.price}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-40 u-flex ">
|
||||
<view>实收金额</view>
|
||||
<view class="u-m-l-32 border-bottom u-flex-1">
|
||||
<uni-easyinput style="digit" @input="currentPriceInput" @change="currentPriceChange" paddingNone :inputBorder="false"
|
||||
v-model="form.currentPrice"
|
||||
placeholder="输入实际金额"></uni-easyinput>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-54 u-flex ">
|
||||
<view>优惠折扣</view>
|
||||
<view class="u-m-l-32 u-flex-1 u-flex border-bottom">
|
||||
<view class="u-flex-1">
|
||||
<uni-easyinput @input="discountInput" @change="discountChange" style="digit" paddingNone :inputBorder="false"
|
||||
v-model="form.discount"
|
||||
placeholder="输入折扣"></uni-easyinput>
|
||||
</view>
|
||||
<view class="u-font-32 color-333">%</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template #btn>
|
||||
<view class="u-p-30">
|
||||
<view class="u-m-t-10">
|
||||
<my-button @tap="confirm" shape="circle" >修改</my-button>
|
||||
<view class="">
|
||||
<my-button @tap="close" type="cancel" bgColor="#fff" >取消</my-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</my-model>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
nextTick,
|
||||
ref,watch
|
||||
} from 'vue';
|
||||
import myModel from '@/components/my-components/my-model.vue'
|
||||
import myButton from '@/components/my-components/my-button.vue'
|
||||
import myTabs from '@/components/my-components/my-tabs.vue'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
data: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
discount:{
|
||||
type: [Number,String],
|
||||
default:100
|
||||
},
|
||||
price: {
|
||||
type: [Number,String],
|
||||
default: 0
|
||||
}
|
||||
})
|
||||
function currentPriceInput(newval){
|
||||
form.discount=(newval*100/form.price).toFixed()
|
||||
}
|
||||
function discountInput(newval){
|
||||
form.currentPrice=(form.price*newval/100).toFixed(2)
|
||||
}
|
||||
function currentPriceChange(newval){
|
||||
if(newval<0){
|
||||
form.currentPrice=0
|
||||
form.discount=100
|
||||
return infoBox.showToast('实收金额不能小于0')
|
||||
}
|
||||
if(newval>props.price){
|
||||
form.currentPrice=props.price
|
||||
form.discount=0
|
||||
return infoBox.showToast('实收金额不能大于应付金额')
|
||||
}
|
||||
}
|
||||
function discountChange(newval){
|
||||
if(newval<0){
|
||||
form.currentPrice=props.price
|
||||
form.discount=0
|
||||
return infoBox.showToast('优惠折扣不能小于0')
|
||||
}
|
||||
if(newval>100){
|
||||
form.discount=100
|
||||
form.currentPrice=0
|
||||
return infoBox.showToast('优惠折扣不能大于100')
|
||||
}
|
||||
}
|
||||
|
||||
const $form = {
|
||||
price:props.price,
|
||||
currentPrice: props.price,
|
||||
discount: 100
|
||||
}
|
||||
const form = reactive({
|
||||
...$form
|
||||
})
|
||||
watch(()=>props.price,(newval)=>{
|
||||
console.log(newval);
|
||||
form.price=newval
|
||||
form.currentPrice=newval
|
||||
})
|
||||
function resetForm() {
|
||||
Object.assign(form, {
|
||||
...$form
|
||||
})
|
||||
}
|
||||
|
||||
const model = ref(null)
|
||||
|
||||
function open() {
|
||||
model.value.open()
|
||||
form.price=props.price
|
||||
form.currentPrice=props.price
|
||||
form.discount=props.discount
|
||||
}
|
||||
|
||||
function close() {
|
||||
model.value.close()
|
||||
}
|
||||
const emits = defineEmits(['confirm'])
|
||||
|
||||
function confirm() {
|
||||
console.log(form);
|
||||
emits('confirm',{...form,currentPrice:Number(form.currentPrice).toFixed(2)})
|
||||
close()
|
||||
}
|
||||
defineExpose({
|
||||
open,
|
||||
close
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.lh34 {
|
||||
line-height: 34rpx;
|
||||
}
|
||||
|
||||
.tag {
|
||||
background-color: #fff;
|
||||
border: 1px solid #E5E5E5;
|
||||
line-height: inherit;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
|
||||
&.active {
|
||||
border-color: #E6F0FF;
|
||||
color: $my-main-color;
|
||||
}
|
||||
}
|
||||
|
||||
.hover-class {
|
||||
background-color: #E5E5E5;
|
||||
}
|
||||
|
||||
.discount {
|
||||
.u-absolute {
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.bg1 {
|
||||
background: #F7F7FA;
|
||||
}
|
||||
|
||||
.tab {
|
||||
padding: 0 80rpx;
|
||||
}
|
||||
|
||||
.border {
|
||||
border: 1px solid #E5E5E5;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.input-box {
|
||||
padding: 22rpx 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.placeholder-class {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
watch
|
||||
} from 'vue';
|
||||
import { $uploadFile } from '@/http/yskApi/file.js'
|
||||
import { consumableBreakage , productBreakage ,tbConCheck} from '@/http/yskApi/breakage.js'
|
||||
import { consumableBreakage , productBreakage} from '@/http/yskApi/breakage.js'
|
||||
|
||||
const props = defineProps({
|
||||
show:{
|
||||
|
|
|
|||
|
|
@ -39,12 +39,26 @@
|
|||
const emits = defineEmits(['update:modelValue'])
|
||||
const images = ref(props.modelValue)
|
||||
|
||||
|
||||
|
||||
function uploadfile(par){
|
||||
let file=null;
|
||||
// #ifdef H5
|
||||
file= par.file
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
file= par
|
||||
// #endif
|
||||
return $uploadFile(file)
|
||||
}
|
||||
|
||||
function afterRead(e) {
|
||||
console.log(e);
|
||||
if (Array.isArray(e)) {
|
||||
if (Array.isArray(e.file)) {
|
||||
for (let i in e.file) {
|
||||
const file = e.file[i].file
|
||||
$uploadFile(file).then(res => {
|
||||
const file = e.file[i]
|
||||
console.log(file);
|
||||
uploadfile(file).then(res => {
|
||||
console.log(res);
|
||||
images.value.push({
|
||||
url: e.file[i].url,
|
||||
|
|
@ -64,8 +78,7 @@
|
|||
}
|
||||
}else{
|
||||
const i=0
|
||||
const file = e.file.file
|
||||
$uploadFile(file).then(res => {
|
||||
uploadfile(e.file).then(res => {
|
||||
console.log(res);
|
||||
images.value.push({
|
||||
url: e.file.url,
|
||||
|
|
|
|||
|
|
@ -207,13 +207,16 @@ function upload(uri, data, file, showLoading = true, extParams = {}) {
|
|||
url: baseUrl + uri,
|
||||
formData: data,
|
||||
name: "file",
|
||||
filePath: file.path,
|
||||
filePath: file.path||file.url,
|
||||
header: getHeader()
|
||||
}, extParams)
|
||||
).then((httpData) => {
|
||||
// uni.upload 返回bodyData 的是 string类型。 需要解析。
|
||||
httpData.data = JSON.parse(httpData.data)
|
||||
return Promise.resolve(httpData)
|
||||
}).catch(err=>{
|
||||
uni.hideLoading()
|
||||
infoBox.showErrorToast(`上传失败`)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,8 +21,7 @@
|
|||
"Geolocation" : {},
|
||||
"Maps" : {},
|
||||
"Barcode" : {},
|
||||
"Camera" : {},
|
||||
"Push" : {}
|
||||
"Camera" : {}
|
||||
},
|
||||
/* 模块配置 */
|
||||
"distribute" : {
|
||||
|
|
@ -82,17 +81,7 @@
|
|||
}
|
||||
},
|
||||
"ad" : {},
|
||||
"push" : {
|
||||
"unipush" : {
|
||||
"version" : "2",
|
||||
"offline" : false,
|
||||
"icons" : {
|
||||
"small" : {
|
||||
"hdpi" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"push" : {}
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
|
|
@ -224,15 +213,15 @@
|
|||
"/ysk" : ""
|
||||
}
|
||||
},
|
||||
"/ww" : {
|
||||
// 需要被代理的后台地址
|
||||
"target" : "http://192.168.1.15:8000",
|
||||
"changeOrigin" : true,
|
||||
"secure" : false,
|
||||
"pathRewrite" : {
|
||||
"/ww" : ""
|
||||
}
|
||||
}
|
||||
"/ww" : {
|
||||
// 需要被代理的后台地址
|
||||
"target" : "http://192.168.1.15:8000",
|
||||
"changeOrigin" : true,
|
||||
"secure" : false,
|
||||
"pathRewrite" : {
|
||||
"/ww" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view class="safe-page">
|
||||
<view class="safe-page min-page">
|
||||
<up-sticky>
|
||||
<view class="bg-fff u-p-l-30 u-p-r-30 u-p-b-30">
|
||||
<!-- <view class="myTabs ">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,483 @@
|
|||
<template>
|
||||
<view class="safe-page">
|
||||
<view class="goods-list u-p-30">
|
||||
<view class="u-m-b-32" v-for="(item,index) in pageData.list" :key="index">
|
||||
<my-category @del="categoryDel" @useTypeClick="categoryUseTypeClick"
|
||||
@editSort="popupShow($event,'sort',true)" @edit="actionsShow" @radioClick="goodsRadioClick"
|
||||
@isShowChange="isSHowChange" :index="index" :data="item" :showChecked="showChecked"
|
||||
:showDetail="pageData.showGoodsDetail"></my-category>
|
||||
</view>
|
||||
<view class="u-m-t-44">
|
||||
<my-pagination :size="pageData.query.size" :totalElements="pageData.totalElements"
|
||||
@change="pageChange"></my-pagination>
|
||||
<view style="height: 200rpx;"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 删除弹窗 -->
|
||||
<my-model desc="请确保此分类下没有任何商品确认删除?" ref="delModel" @confirm="delModelConfirm"></my-model>
|
||||
<view class="fixed-b">
|
||||
<my-button :height="80" shape="circle" showShadow @tap="toAddCategory">新建分组</my-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<edit-sort @save="updataGroup" :item="popup.selData" v-model:show="popup.sort.show"></edit-sort>
|
||||
|
||||
<up-action-sheet :round="10" @select="actionSelect" @close="actionsHide" cancelText="取消" :actions="actions.list"
|
||||
:show="actions.show"></up-action-sheet>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import myCategory from './components/category.vue'
|
||||
import infoBox from "@/commons/utils/infoBox.js"
|
||||
import editSort from './components/edit-sort.vue';
|
||||
import {
|
||||
tbProductGroupGet,
|
||||
tbProductGroupDelete,
|
||||
tbProductGroupPut,
|
||||
upGroupSort,
|
||||
tbProductGroupPost
|
||||
} from '@/http/yskApi/shop.js'
|
||||
const $productCategory = {
|
||||
add: tbProductGroupPost,
|
||||
del: tbProductGroupDelete,
|
||||
update: tbProductGroupPut,
|
||||
get: tbProductGroupGet
|
||||
}
|
||||
const actions = reactive({
|
||||
list: [{
|
||||
name: '排序',
|
||||
color: '#333',
|
||||
fontSize: '16'
|
||||
}, {
|
||||
name: '管理商品',
|
||||
color: '#333',
|
||||
fontSize: '16'
|
||||
}],
|
||||
show: false,
|
||||
})
|
||||
|
||||
function actionSelect(e) {
|
||||
console.log(e);
|
||||
if (e.name == '排序') {
|
||||
return popupShow(actions.selIndex, 'sort', true)
|
||||
}
|
||||
if (e.name == '管理商品') {
|
||||
const {id,isShow,name,sort}=actions.selData
|
||||
return go.to('PAGES_GOODS_GROUP_EDIT_GOODS', {
|
||||
id,isShow,name,sort
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function actionsHide() {
|
||||
actions.show = false
|
||||
}
|
||||
|
||||
function actionsShow(e) {
|
||||
console.log(e);
|
||||
actions.selData = pageData.list[e]
|
||||
actions.selIndex = e
|
||||
actions.show = true
|
||||
}
|
||||
|
||||
|
||||
const popup = reactive({
|
||||
selIndex: -1,
|
||||
selData: {
|
||||
sort: ''
|
||||
},
|
||||
sort: {
|
||||
show: false
|
||||
}
|
||||
})
|
||||
|
||||
function popupShow(e, key, show) {
|
||||
popup.selData = pageData.list[e]
|
||||
popup.selIndex = e
|
||||
popup[key].show = show
|
||||
}
|
||||
async function updataGroup(e) {
|
||||
console.log(e);
|
||||
const res = await $productCategory.update(e)
|
||||
popup.sort.show = false;
|
||||
pageData.list[popup.selIndex] = e
|
||||
infoBox.showToast('更新成功')
|
||||
}
|
||||
const tabsList = ['简洁', '详情']
|
||||
const statesTabsList = ['在售中', '已下架']
|
||||
const states1TabsList = ['全部', '已售罄']
|
||||
const control = ref(null)
|
||||
const delModel = ref(null)
|
||||
const goodsSortModel = ref(null)
|
||||
const goodsTypeModel = ref(null)
|
||||
let sort = ref(0)
|
||||
const goodsTypeModelData = reactive({
|
||||
selCategory: '',
|
||||
title: '',
|
||||
index: null,
|
||||
useTypes: [{
|
||||
name: '堂食',
|
||||
isOpen: true
|
||||
},
|
||||
{
|
||||
name: '自取',
|
||||
isOpen: true
|
||||
},
|
||||
{
|
||||
name: '外卖',
|
||||
isOpen: true
|
||||
},
|
||||
{
|
||||
name: '快递',
|
||||
isOpen: true
|
||||
}
|
||||
]
|
||||
})
|
||||
const pageData = reactive({
|
||||
stateCurrent: 0,
|
||||
stateCurrent1: 0,
|
||||
componentBottom: 264,
|
||||
search: {
|
||||
value: '',
|
||||
placeholder: '输入搜索的商品'
|
||||
},
|
||||
showGoodsDetail: false,
|
||||
query: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
sort: 'id',
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
},
|
||||
totalElements: 0,
|
||||
list: [],
|
||||
selCategory: ''
|
||||
})
|
||||
|
||||
async function init() {
|
||||
const res = await $productCategory.get(pageData.query)
|
||||
pageData.list = res.content
|
||||
pageData.totalElements = res.totalElements
|
||||
}
|
||||
onShow(() => {
|
||||
init()
|
||||
})
|
||||
|
||||
function toAddCategory() {
|
||||
go.to('PAGES_GOODS_GROUP_EDIT', {
|
||||
type: 'add'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
function goodsSortModelCancel() {
|
||||
console.log('goodsSortModelCancel');
|
||||
goodsSortModel.value.close()
|
||||
}
|
||||
async function goodsSortModelSave() {
|
||||
console.log('goodsSortModelSave');
|
||||
|
||||
const res = await $productCategory.update({
|
||||
...pageData.selCategory,
|
||||
sort: sort.value
|
||||
})
|
||||
infoBox.showToast('修改成功')
|
||||
goodsSortModelCancel()
|
||||
init()
|
||||
}
|
||||
|
||||
async function isSHowChange(data) {
|
||||
const res = await $productCategory.update({
|
||||
...data
|
||||
})
|
||||
infoBox.showToast('修改成功')
|
||||
// init()
|
||||
}
|
||||
|
||||
function categoryUseTypeClick(index) {
|
||||
goodsTypeModelData.index = index
|
||||
// goodsTypeModelData.useTypes=pageData.list[index].useTypes
|
||||
const cateItem = pageData.list[index]
|
||||
console.log(cateItem);
|
||||
goodsTypeModelData.selCategory = cateItem
|
||||
goodsTypeModelData.title = cateItem.name
|
||||
goodsTypeModel.value.open()
|
||||
}
|
||||
|
||||
|
||||
//点击修改按钮弹出修改商品弹窗
|
||||
function goodsChangeClick(index) {
|
||||
console.log(index);
|
||||
const goods = pageData.list[index]
|
||||
sort.value = goods.sort
|
||||
pageData.selCategory = goods
|
||||
goodsSortModel.value.open()
|
||||
}
|
||||
|
||||
function statesTableClick(index) {
|
||||
pageData.stateCurrent = index
|
||||
}
|
||||
|
||||
function states1TableClick(index) {
|
||||
pageData.stateCurrent1 = index
|
||||
}
|
||||
|
||||
let test = ref(false)
|
||||
|
||||
function tabsChange(i) {
|
||||
console.log(i);
|
||||
pageData.showGoodsDetail = i ? true : false
|
||||
}
|
||||
|
||||
|
||||
//改变商品的选中状态
|
||||
function changeGoodsChecked(checked, index) {
|
||||
if (index !== undefined) {
|
||||
pageData.list[index].checked = checked
|
||||
} else {
|
||||
pageData.list.map(v => {
|
||||
v.checked = checked
|
||||
})
|
||||
}
|
||||
control.value.setisSelectAll(isAllChecked() ? true : false)
|
||||
}
|
||||
|
||||
|
||||
// 获取已经选中的商品
|
||||
function getChechkedlist() {
|
||||
return pageData.list.filter(v => v.checked)
|
||||
}
|
||||
//是否全部选中
|
||||
function isAllChecked() {
|
||||
return getChechkedlist().length === pageData.list.length
|
||||
}
|
||||
// 是否有商品选中
|
||||
function isHasChekdGoods() {
|
||||
return getChechkedlist().length ? true : false
|
||||
}
|
||||
|
||||
function searchFunc() {
|
||||
console.log('searchFunc');
|
||||
}
|
||||
|
||||
let showChecked = ref(false)
|
||||
|
||||
//商品start
|
||||
|
||||
function goodsRadioClick(index) {
|
||||
var checked = !pageData.list[index].checked
|
||||
changeGoodsChecked(checked, index)
|
||||
}
|
||||
|
||||
|
||||
//下架
|
||||
function offShelf() {
|
||||
const hasCheckedArr = getChechkedlist()
|
||||
const hasChecked = isHasChekdGoods()
|
||||
if (!hasChecked) {
|
||||
return infoBox.showToast('您还没有选中商品!')
|
||||
}
|
||||
model.value.open()
|
||||
}
|
||||
let nowCateIndex = null
|
||||
|
||||
function categoryDel(index) {
|
||||
// nowCateIndex=index
|
||||
// delModel.value.open()
|
||||
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请确保此分类下没有任何商品确认删除?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
const islast = pageData.list.length === 1
|
||||
$productCategory.del([pageData.list[index].id]).then(res => {
|
||||
infoBox.showToast('删除成功')
|
||||
// if(islast&&pageData.query.page>=1){
|
||||
// pageData.query.page--
|
||||
// }
|
||||
init()
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
});
|
||||
}
|
||||
//删除分类确认
|
||||
function delModelConfirm() {
|
||||
console.log('confirm');
|
||||
pageData.list.splice(nowCateIndex, 1)
|
||||
delModel.value.close()
|
||||
}
|
||||
|
||||
//商品end
|
||||
|
||||
//控制条
|
||||
function controlChange(bol) {
|
||||
console.log(bol);
|
||||
showChecked.value = bol
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 全选
|
||||
function allCheckedChange(checked) {
|
||||
changeGoodsChecked(checked)
|
||||
}
|
||||
|
||||
// 页数改变事件
|
||||
function pageChange(page) {
|
||||
pageData.query.page = page - 1
|
||||
init()
|
||||
}
|
||||
|
||||
|
||||
//分类
|
||||
const category = ref(null)
|
||||
|
||||
function toggleCategory() {
|
||||
category.value.toggle()
|
||||
}
|
||||
|
||||
function cateClick(cate) {
|
||||
console.log(cate);
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.stock-btns {
|
||||
padding: 0 100rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.safe-page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.icon-guige {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
.bg-fff {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.myTabs {
|
||||
margin: 0 auto;
|
||||
width: 434rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
|
||||
.input-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 26rpx;
|
||||
background-color: $J-bg-ff;
|
||||
|
||||
.input-main {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 64rpx;
|
||||
|
||||
image {
|
||||
padding: 22rpx;
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
}
|
||||
|
||||
input {
|
||||
flex: 1;
|
||||
font-size: 27rpx;
|
||||
}
|
||||
|
||||
::v-deep uni-button {
|
||||
font-size: 28rpx;
|
||||
color: $my-main-color;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
::v-deep.uni-easyinput {
|
||||
.uni-easyinput__content {
|
||||
background-color: $J-bg-f5 !important;
|
||||
border-radius: $J-b-r12;
|
||||
|
||||
.uni-easyinput__content-input {
|
||||
padding-left: 0 !important;
|
||||
|
||||
.uni-input-input {
|
||||
border-radius: $J-b-r12 !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
}
|
||||
|
||||
.uni-input-placeholder {
|
||||
font-size: 27rpx;
|
||||
}
|
||||
|
||||
.uni-icons {
|
||||
color: rgba(230, 230, 230, 1) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.input-icon {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.search-button {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
background-color: transparent !important;
|
||||
color: transparent !important;
|
||||
}
|
||||
|
||||
.states1 {
|
||||
margin-top: 78rpx;
|
||||
|
||||
.item {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
margin-right: 70rpx;
|
||||
background: #F4F4F4;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
}
|
||||
|
||||
.item.active {
|
||||
background: #E6F0FF;
|
||||
color: $my-main-color;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.fixed-b {
|
||||
position: fixed;
|
||||
left: 110rpx;
|
||||
right: 110rpx;
|
||||
bottom: 110rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
<template>
|
||||
<view class="safe-page">
|
||||
<view class="goods-list u-p-30">
|
||||
|
||||
<view class="u-m-b-32" v-for="(item,index) in pageData.list" :key="index">
|
||||
<my-category @del="categoryDel" @useTypeClick="categoryUseTypeClick"
|
||||
@editSort="popupShow($event,'sort',true)" @edit="actionsShow" @radioClick="goodsRadioClick"
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
</view>
|
||||
|
||||
<my-action-sheet @itemClick="sheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
|
||||
<my-reportDamage ref="reportDamage" :title="'耗材报损'" :type="'consumable'" :show="report.show" :item="report.data" @affirm="affirm"></my-reportDamage>
|
||||
<!-- <my-reportDamage ref="reportDamage" :title="'耗材报损'" :type="'consumable'" :show="report.show" :item="report.data" @affirm="affirm"></my-reportDamage> -->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
<template>
|
||||
<view class="u-p-30 safe-page">
|
||||
<view class="u-p-30 safe-page min-page">
|
||||
<up-sticky v-if="option.type==='edit'" offset-top="20" zIndex="99">
|
||||
<myTabs :list="tabsList" v-model="tabsCurrent"></myTabs>
|
||||
</up-sticky>
|
||||
<view class="box">
|
||||
|
||||
<template v-if="tabsCurrent===0">
|
||||
<view class="basic">
|
||||
<uni-forms :model="FormData" :rules="rules" :border="true" label-position="top"
|
||||
|
|
|
|||
|
|
@ -109,9 +109,9 @@
|
|||
}
|
||||
function blur() {
|
||||
console.log('blur');
|
||||
setTimeout(()=>{
|
||||
popShow.value = false
|
||||
},100)
|
||||
// setTimeout(()=>{
|
||||
// popShow.value = false
|
||||
// },100)
|
||||
}
|
||||
onMounted(() => {
|
||||
setText()
|
||||
|
|
|
|||
|
|
@ -99,9 +99,9 @@
|
|||
}
|
||||
|
||||
function blur() {
|
||||
setTimeout(()=>{
|
||||
popShow.value = false
|
||||
},100)
|
||||
// setTimeout(()=>{
|
||||
// popShow.value = false
|
||||
// },100)
|
||||
}
|
||||
onMounted(() => {
|
||||
setText()
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
<view class="u-m-t-24">
|
||||
<template v-if="data.skuList.length>=2">
|
||||
<view class="u-flex u-flex-wrap w-full gap-10 u-col-top">
|
||||
<view class="u-font-24 info-p-l u-m-t-14">规格:</view>
|
||||
<view class="u-font-24 info-p-l u-m-t-6">规格:</view>
|
||||
<view class="skd" v-for="(item,index) in data.skuList" :key="index"
|
||||
@click="guigeClick(index)">
|
||||
<text>{{item.specSnap||item.name}}</text>
|
||||
|
|
@ -325,7 +325,7 @@
|
|||
}
|
||||
|
||||
.skd {
|
||||
padding: 20rpx 20rpx 14rpx 20rpx;
|
||||
padding: 10rpx 38rpx 8rpx 40rpx;
|
||||
background: #F0F2F5;
|
||||
border-radius: 4rpx;
|
||||
position: relative;
|
||||
|
|
@ -339,9 +339,10 @@
|
|||
right: 0;
|
||||
top: 0;
|
||||
font-size: 12rpx;
|
||||
height: 18rpx;
|
||||
line-height: 18rpx;
|
||||
right: 0;
|
||||
padding: 2rpx 4rpx;
|
||||
border-radius: 0rpx 4rpx 4rpx 4rpx;
|
||||
border-radius: 0rpx 2rpx 2rpx 8rpx;
|
||||
}
|
||||
|
||||
.tag-primary {
|
||||
|
|
|
|||
|
|
@ -50,8 +50,11 @@
|
|||
<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>
|
||||
<template v-if="pageData.goodsList.length">
|
||||
<my-pagination :totalElements="pageData.totalElements" :size="pageData.query.size"
|
||||
@change="pageChange"></my-pagination>
|
||||
</template>
|
||||
|
||||
<view style="height: 100rpx;"></view>
|
||||
</view>
|
||||
|
||||
|
|
@ -477,10 +480,14 @@
|
|||
});
|
||||
}
|
||||
|
||||
function resetQuery(){
|
||||
pageData.totalElements=0;
|
||||
pageData.query.page=0;
|
||||
}
|
||||
|
||||
function statesTableClick(index) {
|
||||
|
||||
pageData.stateCurrent = index
|
||||
pageData.stateCurrent = index;
|
||||
resetQuery()
|
||||
console.log(index);
|
||||
if(index==0){
|
||||
pageData.query.isPauseSale=''
|
||||
|
|
@ -540,6 +547,7 @@
|
|||
|
||||
function searchFunc() {
|
||||
console.log('searchFunc');
|
||||
resetQuery()
|
||||
getGoodsList()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@
|
|||
specificationsData.sellOut=false
|
||||
specificationsData.index=arr[0]
|
||||
specificationsData.optionIndex=arr[1]
|
||||
modelOpen()
|
||||
// modelOpen()
|
||||
}
|
||||
function pageChange(page) {
|
||||
pageData.query.page=page-1
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@
|
|||
import {
|
||||
$table
|
||||
} from '@/http/yskApi/table.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
const status = $status
|
||||
const emits = defineEmits(['more','update'])
|
||||
|
||||
|
|
@ -170,6 +171,7 @@
|
|||
status: "idle",
|
||||
qrcode: item.tableId,
|
||||
}).then(res=>{
|
||||
infoBox.showToast('清台成功')
|
||||
emits('update')
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@
|
|||
<view class="u-flex u-flex-1 u-row-between">
|
||||
<view class="u-flex u-p-t-30 u-p-b-30 u-flex-1 u-row-center" @tap="showsTimesToggle">
|
||||
<text class="u-m-r-12">{{times.list[times.active]}}秒</text>
|
||||
<image src="/pageInvoicing/static/images/icon-arrow-down-fill.svg" class="icon-arrow-down-fill"
|
||||
<image src="/pageTable/static/images/icon-arrow-down-fill.svg" class="icon-arrow-down-fill"
|
||||
mode="">
|
||||
</image>
|
||||
</view>
|
||||
<view class="u-flex u-p-t-30 u-p-b-30 u-flex-1 u-row-center" @tap="showstatusToggle">
|
||||
<text class="u-m-r-12"
|
||||
:class="{'color-main':status.active!=0}">{{status.list[status.active].label }}</text>
|
||||
<image src="/pageInvoicing/static/images/icon-arrow-down-fill.svg" class="icon-arrow-down-fill"
|
||||
<image src="/pageTable/static/images/icon-arrow-down-fill.svg" class="icon-arrow-down-fill"
|
||||
mode="">
|
||||
</image>
|
||||
</view>
|
||||
|
|
@ -109,6 +109,7 @@
|
|||
onBeforeUnmount,
|
||||
watch
|
||||
} from 'vue';
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
const refMoreSheet = ref(null)
|
||||
const actionSheet = reactive({
|
||||
list: ['结账', '清台','增减菜','换台','打印订单','历史订单'],
|
||||
|
|
@ -124,13 +125,30 @@
|
|||
|
||||
async function actionSheetClick(index) {
|
||||
console.log(index);
|
||||
const item=actionSheet.selTable
|
||||
//编辑
|
||||
// refTableShow()
|
||||
if (index == 0) {
|
||||
return
|
||||
}
|
||||
if (index == 1) {
|
||||
return
|
||||
//清台
|
||||
return uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要清台:' + item.name + '?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
$table.update({
|
||||
...item,
|
||||
status: "idle",
|
||||
qrcode: item.tableId,
|
||||
}).then(res=>{
|
||||
infoBox.showToast('清台成功')
|
||||
tableUpdate()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
if (index == 2) {
|
||||
return
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="8.42" height="4.945" viewBox="0 0 8.42 4.945"><defs><style>.a{fill:#333;}</style></defs><path class="a" d="M230.634,368.187a.7.7,0,0,0-.513-.187l-7,.047a.7.7,0,0,0-.513.187.676.676,0,0,0,0,.979l3.5,3.5c.047.047.14.093.187.14l.047.047a.731.731,0,0,0,.746-.14l3.5-3.546A.735.735,0,0,0,230.634,368.187Z" transform="translate(-222.4 -368)"/></svg>
|
||||
|
After Width: | Height: | Size: 390 B |
|
|
@ -52,9 +52,19 @@
|
|||
pageUrl: 'PAGES_QUICK_PAY',
|
||||
},
|
||||
{
|
||||
title: '设置中心',
|
||||
icon: '/static/indexImg/icon-cashier.svg',
|
||||
pageUrl: 'PAGES_SHOP_SETUP',
|
||||
title: '销售汇总',
|
||||
icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg',
|
||||
pageUrl: 'PAGES_SALES_SUMMARY'
|
||||
},
|
||||
{
|
||||
title: '代客下单',
|
||||
icon: '/static/indexImg/icon-substitute-ordering.svg',
|
||||
pageUrl: 'PAGES_CREATE_ORDER',
|
||||
},
|
||||
{
|
||||
title: '桌台',
|
||||
icon: '/static/indexImg/icon-table.svg',
|
||||
pageUrl: 'PAGES_TABLE'
|
||||
},
|
||||
{
|
||||
title: '商品管理',
|
||||
|
|
@ -72,7 +82,7 @@
|
|||
pageUrl: 'PAGES_CATEGORY',
|
||||
},
|
||||
{
|
||||
title: '用户管理',
|
||||
title: '会员管理',
|
||||
icon: '/static/indexImg/icon-user.svg',
|
||||
pageUrl: 'PAGES_USER_CONTROL',
|
||||
},{
|
||||
|
|
@ -81,18 +91,9 @@
|
|||
pageUrl: 'PAGES_STAFF'
|
||||
},
|
||||
{
|
||||
title: '桌台',
|
||||
icon: '/static/indexImg/icon-table.svg',
|
||||
pageUrl: 'PAGES_TABLE'
|
||||
}, {
|
||||
title: '排队',
|
||||
icon: '/static/indexImg/icon-table.svg',
|
||||
pageUrl: 'PAGES_LINE_UP'
|
||||
},
|
||||
{
|
||||
title: '代客下单',
|
||||
icon: '/static/indexImg/icon-substitute-ordering.svg',
|
||||
pageUrl: 'PAGES_CREATE_ORDER',
|
||||
title: '耗材管理',
|
||||
icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg',
|
||||
pageUrl: 'PAGES_SALES_CONSUMABLES'
|
||||
},
|
||||
{
|
||||
title: '订单管理',
|
||||
|
|
@ -100,63 +101,24 @@
|
|||
pageUrl: 'PAGES_ORDER_INDEX',
|
||||
},
|
||||
{
|
||||
title: '打印机',
|
||||
title: '设备管理',
|
||||
icon: '/static/indexImg/icon-printer.svg',
|
||||
pageUrl: 'PAGES_PRINTER_INDEX',
|
||||
},
|
||||
{
|
||||
title: '进销存',
|
||||
icon: '/static/indexImg/icon-invoicing.svg',
|
||||
pageUrl: 'PAGES_INVOICING_INDEX',
|
||||
},
|
||||
{
|
||||
title: '交班',
|
||||
icon: '/static/indexImg/icon-work.svg',
|
||||
pageUrl: 'PAGES_WORK_INDEX',
|
||||
},
|
||||
{
|
||||
title: '预定座位',
|
||||
icon: '/static/indexImg/icon-yuyue-zuo.svg',
|
||||
pageUrl: 'PAGES_RESERVE_SEAT_INDEX',
|
||||
title: '极速开票',
|
||||
icon: '/static/indexImg/red-envelope.svg',
|
||||
pageUrl: 'PAGES_INVOICE'
|
||||
},
|
||||
{
|
||||
title: '预约管理',
|
||||
icon: '/static/indexImg/icon-yuyue.svg',
|
||||
pageUrl: 'PAGES_BOOKING_INDEX',
|
||||
},
|
||||
{
|
||||
title: '充值管理',
|
||||
icon: '/static/indexImg/icon-recharge.svg',
|
||||
pageUrl: 'PAGES_RECHARGE_INDEX',
|
||||
},
|
||||
{
|
||||
title: '存酒管理',
|
||||
icon: '/static/indexImg/icon-wine.svg',
|
||||
pageUrl: 'PAGES_STORING_WINE_INDEX',
|
||||
},
|
||||
{
|
||||
title: '进件管理',
|
||||
icon: '/static/indexImg/icon-passage.svg',
|
||||
pageUrl: 'PAGES_APPLYMENT',
|
||||
entId: 'ENT_MCH_APPLYMENT_LIST'
|
||||
},
|
||||
{
|
||||
title: '商户管理',
|
||||
icon: '/static/indexImg/business.svg',
|
||||
pageUrl: 'PAGES_APPLYMENT_BUSINESS',
|
||||
entId: 'ENT_MCH_APPLYMENT_LIST'
|
||||
},
|
||||
{
|
||||
title: '门店管理',
|
||||
icon: '/static/indexImg/icon-store.svg',
|
||||
pageUrl: 'PAGES_STORE',
|
||||
entId: 'ENT_MCH_STORE'
|
||||
},
|
||||
{
|
||||
title: '设备管理',
|
||||
icon: '/static/indexImg/icon-calc.svg',
|
||||
pageUrl: 'PAGES_DEVICE_MAIN',
|
||||
entId: 'ENT_DEVICE'
|
||||
title: '排队',
|
||||
icon: '/static/indexImg/icon-line-up.svg',
|
||||
pageUrl: 'PAGES_LINE_UP'
|
||||
},
|
||||
{
|
||||
title: '成员管理',
|
||||
|
|
@ -164,55 +126,98 @@
|
|||
pageUrl: 'PAGES_USER'
|
||||
},
|
||||
{
|
||||
title: '数据中心',
|
||||
icon: '/static/indexImg/icon-pro.svg',
|
||||
pageUrl: 'PAGES_STAT',
|
||||
entId: 'ENT_ORDER_STATISTIC'
|
||||
},
|
||||
// {
|
||||
// title: '商户应用',
|
||||
// icon: '/static/indexImg/icon-app.svg',
|
||||
// pageUrl: 'PAGES_APP',
|
||||
// entId: 'ENT_MCH_APP_LIST'
|
||||
// },
|
||||
{
|
||||
title: '会员中心',
|
||||
icon: '/static/indexImg/icon-member.svg',
|
||||
pageUrl: 'PAGES_MEMBER_CENTER',
|
||||
entId: 'ENT_MCH_MEMBER'
|
||||
},
|
||||
{
|
||||
title: '广告管理',
|
||||
icon: '/static/indexImg/icon-ad.svg',
|
||||
pageUrl: 'PAGES_AD_LIST',
|
||||
entId: 'ENT_ADVERT_CONTROL'
|
||||
},
|
||||
{
|
||||
title: '营销红包',
|
||||
icon: '/static/indexImg/red-envelope.svg',
|
||||
pageUrl: 'PAGES_RED_INDEX',
|
||||
entId: 'ENT_MCH_MEMBER'
|
||||
},
|
||||
{
|
||||
title: '极速开票',
|
||||
icon: '/static/indexImg/red-envelope.svg',
|
||||
pageUrl: 'PAGES_INVOICE'
|
||||
},
|
||||
// {
|
||||
// title: '优惠券',
|
||||
// icon: '/static/indexImg/red-envelope.svg',
|
||||
// pageUrl: 'PAGES_COUPON_INDEX'
|
||||
// },
|
||||
{
|
||||
title: '销售汇总',
|
||||
icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg',
|
||||
pageUrl: 'PAGES_SALES_SUMMARY'
|
||||
},
|
||||
{
|
||||
title: '耗材管理',
|
||||
icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg',
|
||||
pageUrl: 'PAGES_SALES_CONSUMABLES'
|
||||
title: '设置中心',
|
||||
icon: '/static/indexImg/icon-cashier.svg',
|
||||
pageUrl: 'PAGES_SHOP_SETUP',
|
||||
},
|
||||
// // // {
|
||||
// // // title: '进销存',
|
||||
// // // icon: '/static/indexImg/icon-invoicing.svg',
|
||||
// // // pageUrl: 'PAGES_INVOICING_INDEX',
|
||||
// // // },
|
||||
|
||||
// // // {
|
||||
// // // title: '预定座位',
|
||||
// // // icon: '/static/indexImg/icon-yuyue-zuo.svg',
|
||||
// // // pageUrl: 'PAGES_RESERVE_SEAT_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '预约管理',
|
||||
// // // icon: '/static/indexImg/icon-yuyue.svg',
|
||||
// // // pageUrl: 'PAGES_BOOKING_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '充值管理',
|
||||
// // // icon: '/static/indexImg/icon-recharge.svg',
|
||||
// // // pageUrl: 'PAGES_RECHARGE_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '存酒管理',
|
||||
// // // icon: '/static/indexImg/icon-wine.svg',
|
||||
// // // pageUrl: 'PAGES_STORING_WINE_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '进件管理',
|
||||
// // // icon: '/static/indexImg/icon-passage.svg',
|
||||
// // // pageUrl: 'PAGES_APPLYMENT',
|
||||
// // // entId: 'ENT_MCH_APPLYMENT_LIST'
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '商户管理',
|
||||
// // // icon: '/static/indexImg/business.svg',
|
||||
// // // pageUrl: 'PAGES_APPLYMENT_BUSINESS',
|
||||
// // // entId: 'ENT_MCH_APPLYMENT_LIST'
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '门店管理',
|
||||
// // // icon: '/static/indexImg/icon-store.svg',
|
||||
// // // pageUrl: 'PAGES_STORE',
|
||||
// // // entId: 'ENT_MCH_STORE'
|
||||
// // // },
|
||||
// // {
|
||||
// // title: '设备管理',
|
||||
// // icon: '/static/indexImg/icon-calc.svg',
|
||||
// // pageUrl: 'PAGES_DEVICE_MAIN',
|
||||
// // entId: 'ENT_DEVICE'
|
||||
// // },
|
||||
|
||||
// {
|
||||
// title: '数据中心',
|
||||
// icon: '/static/indexImg/icon-pro.svg',
|
||||
// pageUrl: 'PAGES_STAT',
|
||||
// entId: 'ENT_ORDER_STATISTIC'
|
||||
// },
|
||||
// {
|
||||
// title: '商户应用',
|
||||
// icon: '/static/indexImg/icon-app.svg',
|
||||
// pageUrl: 'PAGES_APP',
|
||||
// entId: 'ENT_MCH_APP_LIST'
|
||||
// },
|
||||
// {
|
||||
// title: '会员中心',
|
||||
// icon: '/static/indexImg/icon-member.svg',
|
||||
// pageUrl: 'PAGES_MEMBER_CENTER',
|
||||
// entId: 'ENT_MCH_MEMBER'
|
||||
// },
|
||||
// {
|
||||
// title: '广告管理',
|
||||
// icon: '/static/indexImg/icon-ad.svg',
|
||||
// pageUrl: 'PAGES_AD_LIST',
|
||||
// entId: 'ENT_ADVERT_CONTROL'
|
||||
// },
|
||||
// {
|
||||
// title: '营销红包',
|
||||
// icon: '/static/indexImg/red-envelope.svg',
|
||||
// pageUrl: 'PAGES_RED_INDEX',
|
||||
// entId: 'ENT_MCH_MEMBER'
|
||||
// },
|
||||
|
||||
// {
|
||||
// title: '优惠券',
|
||||
// icon: '/static/indexImg/red-envelope.svg',
|
||||
// pageUrl: 'PAGES_COUPON_INDEX'
|
||||
// },
|
||||
|
||||
{
|
||||
title: '退出登录',
|
||||
icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg',
|
||||
|
|
|
|||
|
|
@ -213,8 +213,10 @@
|
|||
|
||||
})
|
||||
// #ifdef H5
|
||||
vdata.formData.username = '19502966242'
|
||||
vdata.formData.pwd = '11280923'
|
||||
vdata.formData.username = '18049104914'
|
||||
vdata.formData.pwd = '123456'
|
||||
// vdata.formData.username = '19502966242'
|
||||
// vdata.formData.pwd = '11280923'
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
vdata.formData.username = '15699991111'
|
||||
|
|
|
|||
|
|
@ -91,7 +91,10 @@
|
|||
uni.navigateBack()
|
||||
}, 100)
|
||||
}
|
||||
let searchValue=ref('')
|
||||
function search(){
|
||||
|
||||
}
|
||||
function chooseTable(index, item) {
|
||||
if (item.status == 'closed') {
|
||||
return uni.showToast({
|
||||
|
|
@ -187,7 +190,8 @@
|
|||
|
||||
.circle {
|
||||
background: #FFFFFF;
|
||||
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
&.active {
|
||||
background-color: $my-main-color;
|
||||
border-color: $my-main-color;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
function chooseUser(index,item){
|
||||
if(index===undefined||item===undefined){
|
||||
nouser.value=true
|
||||
return emitChooser()
|
||||
return emitChooser({id:''})
|
||||
}
|
||||
else{
|
||||
list[index].checked=true
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
const query=reactive({
|
||||
page:0,
|
||||
name:'',
|
||||
size:10
|
||||
size:300
|
||||
})
|
||||
const list=reactive([])
|
||||
async function getUser(){
|
||||
|
|
|
|||
|
|
@ -1,95 +1,95 @@
|
|||
<template>
|
||||
<view class="page-gray color-333 u-font-28">
|
||||
<view class="block">
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view>选择用户</view>
|
||||
<view class="u-m-t-24 u-flex u-row-between " @tap="chooseUser">
|
||||
<view v-if="!user">选择用户</view>
|
||||
<view class="u-flex" v-else>
|
||||
<up-avatar :src="user.headImg" shape="square" :size="30"></up-avatar>
|
||||
<!-- <view class="headeimg">
|
||||
<image class="img" :src="user.headImg" mode=""></image>
|
||||
</view> -->
|
||||
<view class="u-m-l-20">{{user.nickName}}</view>
|
||||
<view class="color-main u-m-l-10 u-font-24">{{user.isVip?'会员':'' }}</view>
|
||||
<view class="u-font-24 u-m-l-30"><text>余额:</text><text class="color-main">{{user.amount}}</text>
|
||||
</view>
|
||||
<view class="u-font-24 u-m-l-30"><text>积分:</text><text
|
||||
class="color-main">{{user.totalScore}}</text></view>
|
||||
</view>
|
||||
<uni-icons type="right" color="#999" size="16"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view>就餐类型</view>
|
||||
<view class="u-m-t-24 u-flex ">
|
||||
<view class="u-flex color-666">
|
||||
<up-radio-group :disabled="option.type=='add'" v-model="eatTypes.active" placement="row">
|
||||
<up-radio :customStyle="{marginRight: '30px'}" v-for="(item, index) in eatTypes.list"
|
||||
:key="index" :label="item.name" :name="item.value">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class=" " @tap="chooseTable">
|
||||
<view>选择桌码</view>
|
||||
<view class="u-m-t-24 u-flex u-row-between ">
|
||||
<view>
|
||||
<text v-if="table">{{table.name}}</text>
|
||||
<text v-else>不选择桌台</text>
|
||||
</view>
|
||||
<uni-icons type="right" color="#999" size="16"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<template v-if="user">
|
||||
<template v-if="true">
|
||||
<view class="block">
|
||||
<view class="">
|
||||
<view class="u-flex border-bottom u-p-b-24 ">
|
||||
<up-avatar :src="user.headImg" shape="square" :size="60"></up-avatar>
|
||||
<!-- <image class="headeimg" src="@/static/uni.png" mode=""></image> -->
|
||||
<view class="u-m-l-32">
|
||||
<view class="">{{user.nickName}}</view>
|
||||
<view class="color-main u-font-24">{{user.isVip?'会员':'' }}</view>
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view>选择用户</view>
|
||||
<view class="u-m-t-24 u-flex u-row-between " @tap="chooseUser">
|
||||
<view v-if="!user">选择用户</view>
|
||||
<view class="u-flex" v-else>
|
||||
<up-avatar :src="user.headImg" shape="square" :size="30"></up-avatar>
|
||||
<!-- <view class="headeimg">
|
||||
<image class="img" :src="user.headImg" mode=""></image>
|
||||
</view> -->
|
||||
<view class="u-m-l-20">{{user.nickName}}</view>
|
||||
<view class="color-main u-m-l-10 u-font-24">{{user.isVip?'会员':'' }}</view>
|
||||
<view class="u-font-24 u-m-l-30"><text>余额:</text><text class="color-main">{{user.amount}}</text>
|
||||
</view>
|
||||
<view class="u-font-24 u-m-l-30"><text>积分:</text><text
|
||||
class="color-main">{{user.totalScore}}</text></view>
|
||||
</view>
|
||||
<uni-icons type="right" color="#999" size="16"></uni-icons>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-24 u-row-between u-font-24 color-999">
|
||||
<view class="u-flex">
|
||||
<view>余额</view>
|
||||
<view class="color-333 u-m-l-10"> {{user.amount}}</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<view>积分</view>
|
||||
<view class="color-333 u-m-l-10"> {{user.totalScore}}</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<view>已消费</view>
|
||||
<view class="color-333 u-m-l-10"> 0.00</view>
|
||||
</view>
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view>就餐类型</view>
|
||||
<view class="u-m-t-24 u-flex ">
|
||||
<view class="u-flex color-666">
|
||||
<up-radio-group :disabled="option.type=='add'" v-model="eatTypes.active" placement="row">
|
||||
<up-radio :customStyle="{marginRight: '30px'}" v-for="(item, index) in eatTypes.list"
|
||||
:key="index" :label="item.name" :name="item.value">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="!$shop.isTableFee">
|
||||
<!-- 不免餐位费 -->
|
||||
<view class="block">
|
||||
<view class=" ">
|
||||
<view>用餐人数(人)</view>
|
||||
<picker @change="userNumberChange" :value="userNumbers.defaultCateIndex" :range="userNumbers.list">
|
||||
<view class="u-m-t-24 u-flex u-row-between ">
|
||||
<view class="color-333">{{userNumbers.defaultCateIndex||''}}</view>
|
||||
<uni-icons type="right" color="#999" size="16"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view class=" " @tap="chooseTable">
|
||||
<view>选择桌码</view>
|
||||
<view class="u-m-t-24 u-flex u-row-between ">
|
||||
<view>
|
||||
<text v-if="table">{{table.name}}</text>
|
||||
<text v-else>不选择桌台</text>
|
||||
</view>
|
||||
<uni-icons type="right" color="#999" size="16"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<template v-if="user">
|
||||
<view class="block">
|
||||
<view class="">
|
||||
<view class="u-flex border-bottom u-p-b-24 ">
|
||||
<up-avatar :src="user.headImg" shape="square" :size="60"></up-avatar>
|
||||
<!-- <image class="headeimg" src="@/static/uni.png" mode=""></image> -->
|
||||
<view class="u-m-l-32">
|
||||
<view class="">{{user.nickName}}</view>
|
||||
<view class="color-main u-font-24">{{user.isVip?'会员':'' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-24 u-row-between u-font-24 color-999">
|
||||
<view class="u-flex">
|
||||
<view>余额</view>
|
||||
<view class="color-333 u-m-l-10"> {{user.amount}}</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<view>积分</view>
|
||||
<view class="color-333 u-m-l-10"> {{user.totalScore}}</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<view>已消费</view>
|
||||
<view class="color-333 u-m-l-10"> 0.00</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="!$shop.isTableFee">
|
||||
<!-- 不免餐位费 -->
|
||||
<view class="block">
|
||||
<view class=" ">
|
||||
<view>用餐人数(人)</view>
|
||||
<picker @change="userNumberChange" :value="userNumbers.defaultCateIndex" :range="userNumbers.list">
|
||||
<view class="u-m-t-24 u-flex u-row-between ">
|
||||
<view class="color-333">{{userNumbers.defaultCateIndex||''}}</view>
|
||||
<uni-icons type="right" color="#999" size="16"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<view class="block">
|
||||
<view class="u-p-b-24 ">
|
||||
|
|
@ -149,7 +149,7 @@
|
|||
</view>
|
||||
|
||||
<scroll-view scroll-x="true" v-if="index==goods.sel">
|
||||
<view class="u-m-t-32 u-flex no-wrap">
|
||||
<view class="u-m-t-32 u-flex no-wrap u-p-b-12">
|
||||
<!-- <view class="u-flex u-m-r-20 u-m-b-20">
|
||||
<button class="tag" hover-class="hover-class" @tap="showModel('discount')">单品打折</button>
|
||||
</view> -->
|
||||
|
|
@ -175,7 +175,7 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-flex u-row-between u-m-t-30 u-p-b-34 border-bottom">
|
||||
<view class="u-flex u-row-between u-m-t-18 u-p-b-34 border-bottom">
|
||||
<view>
|
||||
<text v-if="eatTypes.active=='takeout'">包装费</text>
|
||||
<text v-else>桌位费</text>
|
||||
|
|
@ -492,7 +492,7 @@
|
|||
console.log(res);
|
||||
if ($shop.value.registerType == 'munchies') {
|
||||
//先付
|
||||
return go.to('PAGES_CRESATE_ORDER_PAY', {
|
||||
return go.to('PAGES_ORDER_PAY', {
|
||||
orderId: res.id
|
||||
})
|
||||
} else {
|
||||
|
|
@ -519,6 +519,7 @@
|
|||
}
|
||||
|
||||
onLoad((opt) => {
|
||||
console.log('opt');
|
||||
console.log(opt);
|
||||
Object.assign(option, opt)
|
||||
if (opt) {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -120,10 +120,10 @@
|
|||
if(props.data.length<=0){
|
||||
return infoBox.showToast('还没有选择商品')
|
||||
}
|
||||
const {tableId,name,maxCapacity,status,type}=props.table
|
||||
go.to('PAGES_CONFIRM_ORDER',{
|
||||
...props.user,
|
||||
masterId:props.masterId,
|
||||
...props.table,
|
||||
masterId:props.masterId,type,
|
||||
tableId,name,maxCapacity,status
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -227,12 +227,9 @@
|
|||
.car {
|
||||
padding: 0 28rpx;
|
||||
position: relative;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: #fff;
|
||||
padding-top: 10rpx;
|
||||
bottom: 0;
|
||||
padding-bottom: calc(1px + env(safe-area-inset-bottom));
|
||||
padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
|
||||
/* #ifdef H5 */
|
||||
padding-bottom: 68rpx;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,11 @@
|
|||
index: {
|
||||
type: Number,
|
||||
},
|
||||
isSeatFee:{
|
||||
//是否为餐位费
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-10">
|
||||
<my-button @tap="close" type="cancel" v-if="isAllDisabled||!goods.isGrounding"><view class="color-999">已下架</view></my-button>
|
||||
<my-button @tap="close" type="cancel" v-if="isAllDisabled||!goods.isGrounding"><view class="color-999">已下架/售罄</view></my-button>
|
||||
<my-button @tap="confirm" v-else>添加</my-button>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,618 +0,0 @@
|
|||
<template>
|
||||
<view class="u-wrap">
|
||||
|
||||
<view class="top bg-fff w-full">
|
||||
<view class="u-flex u-row-between choose-user" @tap="chooseUser">
|
||||
<view>
|
||||
<view v-if="!user">选择用户</view>
|
||||
<view class="u-flex" v-else>
|
||||
<image class="headeimg" src="@/static/uni.png" mode=""></image>
|
||||
<view class="u-m-l-20">{{user.name}}</view>
|
||||
<view class="color-main u-m-l-10 u-font-24">{{user.isVip?'永久会员':'' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<uni-icons type="right" size="20" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<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">
|
||||
</uni-search-bar>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<image src="/pagesCreateOrder/static/images/icon-saoma.svg" class="icon-saoma" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-menu-wrap">
|
||||
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="data.scrollTop"
|
||||
:scroll-into-view="data.itemId">
|
||||
<view v-for="(item,index) in data.tabbar" :key="index" class="u-tab-item"
|
||||
:class="[data.current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
|
||||
<text class="u-line-1">{{item.name}}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<scroll-view :scroll-top="data.scrollRightTop" scroll-y scroll-with-animation class="right-box"
|
||||
@scroll="rightScroll">
|
||||
<view class="page-view u-p-l-24">
|
||||
<view class="lingshi" @tap="toLinshi">
|
||||
<uni-icons type="plus-filled" size="24" :color="color.ColorMain"></uni-icons>
|
||||
<view class="u-m-t-24 color-main">临时菜</view>
|
||||
</view>
|
||||
<view class="class-item" :id="'item' + index" v-for="(item , index) in data.tabbar" :key="index">
|
||||
<view class="item-title">
|
||||
<text>{{item.name}}</text>
|
||||
</view>
|
||||
<view class="item-container">
|
||||
<view class="thumb-box" v-for="(goodsItem, goodsIndex) in item.foods" :key="goodsIndex">
|
||||
|
||||
<!-- <image class="item-menu-image" :src="item1.icon" mode=""></image>
|
||||
<view class="item-menu-name">{{item1.name}}</view> -->
|
||||
<goods-item @chooseGuige="chooseGuige($event,index)" @add="goodsAdd($event,index)"
|
||||
@reduce="goodsReduce($event,index)" :index="goodsIndex"
|
||||
:data="goodsItem"></goods-item>
|
||||
|
||||
</view>
|
||||
<template v-if="item.name==='附加费'">
|
||||
<view class="addCai" @tap="surchargeShow">
|
||||
<uni-icons type="plus-filled" size="24" :color="color.ColorMain"></uni-icons>
|
||||
<view class="u-m-t-24 color-main">自定义添加</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="bottom w-full">
|
||||
<my-car :data="cars"></my-car>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 选择规格 -->
|
||||
<guige-model @confirm="guigeConfirm" ref="chooseGuigeModel" :title="guigeModelData.title"
|
||||
:data="guigeModelData.chooseGoods.skus"></guige-model>
|
||||
<!-- 添加附加费 -->
|
||||
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge>
|
||||
</template>
|
||||
<script setup>
|
||||
import * as Api from '@/http/yskApi/Instead.js'
|
||||
import {
|
||||
$tbShopCategory
|
||||
} from '@/http/yskApi/goods.js'
|
||||
|
||||
import classifyData from './classify.data.js';
|
||||
import color from '@/commons/color.js';
|
||||
import guigeModel from './components/guige'
|
||||
import goodsItem from './components/goods-item'
|
||||
import mySurcharge from './components/surcharge'
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onPullDownRefresh
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
onBeforeUnmount,
|
||||
computed,
|
||||
reactive,
|
||||
ref,
|
||||
nextTick
|
||||
} from 'vue';
|
||||
import myCar from './components/car'
|
||||
import go from '@/commons/utils/go.js';
|
||||
|
||||
async function init() {
|
||||
const {
|
||||
content
|
||||
} = await $tbShopCategory({
|
||||
page: 0,
|
||||
size: 300
|
||||
})
|
||||
const category = content.reduce((prve, cur) => {
|
||||
prve.push({
|
||||
...cur,
|
||||
childrenList: null
|
||||
});
|
||||
return [...prve, ...cur.childrenList];
|
||||
}, []);
|
||||
console.log(category);
|
||||
const {records}= await Api.getGoodsLists({
|
||||
page: 0,
|
||||
size: 300
|
||||
})
|
||||
const goods=records
|
||||
console.log(goods);
|
||||
}
|
||||
|
||||
// 监听选择用户事件
|
||||
let user = ref(null)
|
||||
|
||||
function watchChooseuser() {
|
||||
uni.$off('choose-user')
|
||||
uni.$on('choose-user', (data) => {
|
||||
user.value = data
|
||||
console.log(user.value);
|
||||
})
|
||||
}
|
||||
watchChooseuser()
|
||||
onBeforeUnmount(() => {
|
||||
|
||||
})
|
||||
|
||||
const surcharge = ref(null)
|
||||
|
||||
function surchargeConfirm(e) {
|
||||
data.tabbar[data.tabbar.length - 1].foods.unshift({
|
||||
...e,
|
||||
chooseNumber: 0
|
||||
})
|
||||
}
|
||||
|
||||
function surchargeShow() {
|
||||
surcharge.value.open()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let searchValue = ref('')
|
||||
|
||||
function search() {
|
||||
|
||||
}
|
||||
|
||||
function chooseUser() {
|
||||
go.to('PAGES_CHOOSE_USER')
|
||||
}
|
||||
|
||||
function toLinshi() {
|
||||
go.to('PAGES_ADD_TEMP_CUISINE')
|
||||
}
|
||||
|
||||
const chooseGuigeModel = ref(null)
|
||||
const guigeModelData = reactive({
|
||||
title: '',
|
||||
chooseGoods: {
|
||||
item: '',
|
||||
skus: [{
|
||||
title: '口味',
|
||||
skds: [{
|
||||
title: '麻辣',
|
||||
id: 1
|
||||
},
|
||||
{
|
||||
title: '中辣',
|
||||
id: 2
|
||||
},
|
||||
{
|
||||
title: '微辣',
|
||||
id: 3
|
||||
},
|
||||
{
|
||||
title: '不辣',
|
||||
id: 4
|
||||
},
|
||||
{
|
||||
title: '三鲜',
|
||||
id: 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '辣度',
|
||||
skds: [{
|
||||
title: '麻辣',
|
||||
id: 1
|
||||
},
|
||||
{
|
||||
title: '中辣',
|
||||
id: 2
|
||||
},
|
||||
{
|
||||
title: '微辣',
|
||||
id: 3
|
||||
},
|
||||
{
|
||||
title: '不辣',
|
||||
id: 4
|
||||
},
|
||||
{
|
||||
title: '三鲜',
|
||||
id: 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '配料',
|
||||
skds: [{
|
||||
title: '丸子',
|
||||
id: 1
|
||||
},
|
||||
{
|
||||
title: '五花肉',
|
||||
id: 2
|
||||
},
|
||||
{
|
||||
title: '鸡块',
|
||||
id: 3
|
||||
},
|
||||
{
|
||||
title: '排骨',
|
||||
id: 4
|
||||
},
|
||||
{
|
||||
title: '火腿',
|
||||
id: 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
function chooseGuige(foodsindex, index) {
|
||||
const $goods = data.tabbar[index].foods[foodsindex]
|
||||
guigeModelData.title = $goods.name
|
||||
chooseGuigeModel.value.open()
|
||||
}
|
||||
|
||||
function guigeConfirm(e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
|
||||
function goodsAdd(foodsindex, index) {
|
||||
const $goods = data.tabbar[index].foods[foodsindex]
|
||||
const newval = $goods.chooseNumber + 1
|
||||
$goods.chooseNumber = newval
|
||||
let item = cars.find(v => v.id == $goods.id)
|
||||
if (item) {
|
||||
item.number += 1
|
||||
} else {
|
||||
cars.push({
|
||||
...$goods,
|
||||
number: 1
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function goodsReduce(foodsindex, index) {
|
||||
const $goods = data.tabbar[index].foods[foodsindex]
|
||||
const newval = $goods.chooseNumber - 1
|
||||
$goods.chooseNumber = newval <= 0 ? 0 : newval
|
||||
}
|
||||
|
||||
const cars = reactive([])
|
||||
const tabbar = classifyData.map(v => {
|
||||
return {
|
||||
...v,
|
||||
foods: v.foods.map((goods, index) => {
|
||||
return {
|
||||
...goods,
|
||||
chooseNumber: 0,
|
||||
price: Math.ceil(Math.random() * 100),
|
||||
isDan: index % 2 === 0
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
tabbar.push({
|
||||
name: '附加费',
|
||||
foods: [{
|
||||
name: "小费",
|
||||
price: Math.ceil(Math.random() * 10),
|
||||
chooseNumber: 0,
|
||||
isDan: true
|
||||
},
|
||||
{
|
||||
name: "打包费",
|
||||
price: 1,
|
||||
chooseNumber: 0,
|
||||
isDan: true
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const data = reactive({
|
||||
scrollTop: 0, //tab标题的滚动条位置
|
||||
oldScrollTop: 0,
|
||||
current: 0, // 预设当前项的值
|
||||
menuHeight: 0, // 左边菜单的高度
|
||||
menuItemHeight: 0, // 左边菜单item的高度
|
||||
itemId: '', // 栏目右边scroll-view用于滚动的id
|
||||
tabbar: tabbar,
|
||||
menuItemPos: [],
|
||||
arr: [],
|
||||
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
|
||||
timer: null, // 定时器
|
||||
topZhanwei: 136 + 24
|
||||
})
|
||||
onReady(() => {
|
||||
getMenuItemTop()
|
||||
})
|
||||
// 点击左边的栏目切换
|
||||
async function swichMenu(index) {
|
||||
if (data.arr.length == 0) {
|
||||
await getMenuItemTop();
|
||||
}
|
||||
if (index == data.current) return;
|
||||
data.scrollRightTop = data.oldScrollTop;
|
||||
nextTick(function() {
|
||||
data.scrollRightTop = data.arr[index] + data.topZhanwei;
|
||||
data.current = index;
|
||||
leftMenuStatus(index);
|
||||
})
|
||||
}
|
||||
// 获取一个目标元素的高度
|
||||
function getElRect(elClass, dataVal) {
|
||||
new Promise((resolve, reject) => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('.' + elClass).fields({
|
||||
size: true
|
||||
}, res => {
|
||||
// 如果节点尚未生成,res值为null,循环调用执行
|
||||
if (!res) {
|
||||
setTimeout(() => {
|
||||
getElRect(elClass);
|
||||
}, 10);
|
||||
return;
|
||||
}
|
||||
data[dataVal] = res.height;
|
||||
resolve();
|
||||
}).exec();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 观测元素相交状态
|
||||
async function observer() {
|
||||
tabbar.map((val, index) => {
|
||||
let observer = uni.createIntersectionObserver(this);
|
||||
// 检测右边scroll-view的id为itemxx的元素与right-box的相交状态
|
||||
// 如果跟.right-box底部相交,就动态设置左边栏目的活动状态
|
||||
observer.relativeTo('.right-box', {
|
||||
top: 0
|
||||
}).observe('#item' + index, res => {
|
||||
if (res.intersectionRatio > 0) {
|
||||
let id = res.id.substring(4);
|
||||
leftMenuStatus(id);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 设置左边菜单的滚动状态
|
||||
async function leftMenuStatus(index) {
|
||||
data.current = index;
|
||||
// 如果为0,意味着尚未初始化
|
||||
if (data.menuHeight == 0 || data.menuItemHeight == 0) {
|
||||
await getElRect('menu-scroll-view', 'menuHeight');
|
||||
await getElRect('u-tab-item', 'menuItemHeight');
|
||||
}
|
||||
// 将菜单活动item垂直居中
|
||||
data.scrollTop = index * data.menuItemHeight + data.menuItemHeight / 2 - data.menuHeight / 2;
|
||||
}
|
||||
|
||||
// 获取右边菜单每个item到顶部的距离
|
||||
function getMenuItemTop() {
|
||||
new Promise(resolve => {
|
||||
let selectorQuery = uni.createSelectorQuery();
|
||||
selectorQuery.selectAll('.class-item').boundingClientRect((rects) => {
|
||||
// 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
|
||||
if (!rects.length) {
|
||||
setTimeout(() => {
|
||||
getMenuItemTop();
|
||||
}, 10);
|
||||
return;
|
||||
}
|
||||
rects.forEach((rect) => {
|
||||
// 这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
|
||||
data.arr.push(rect.top - rects[0].top);
|
||||
resolve();
|
||||
})
|
||||
}).exec()
|
||||
})
|
||||
}
|
||||
|
||||
// 右边菜单滚动
|
||||
async function rightScroll(e) {
|
||||
data.oldScrollTop = e.detail.scrollTop;
|
||||
if (data.arr.length == 0) {
|
||||
await getMenuItemTop();
|
||||
}
|
||||
if (data.timer) return;
|
||||
if (!data.menuHeight) {
|
||||
await getElRect('menu-scroll-view', 'menuHeight');
|
||||
}
|
||||
setTimeout(() => { // 节流
|
||||
data.timer = null;
|
||||
// scrollHeight为右边菜单垂直中点位置
|
||||
let scrollHeight = e.detail.scrollTop + data.menuHeight / 2 + data.topZhanwei / 2;
|
||||
for (let i = 0; i < data.arr.length; i++) {
|
||||
let height1 = data.arr[i];
|
||||
let height2 = data.arr[i + 1];
|
||||
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
|
||||
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
|
||||
leftMenuStatus(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}, 10)
|
||||
}
|
||||
onLoad(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.choose-user {
|
||||
background: #F9F9F9;
|
||||
padding: 22rpx 28rpx;
|
||||
}
|
||||
|
||||
.search {
|
||||
padding-right: 28rpx;
|
||||
}
|
||||
|
||||
.icon-saoma {
|
||||
margin-left: 20rpx;
|
||||
width: 34rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
$u-tips-color: $my-main-color;
|
||||
$u-primary: $my-main-color;
|
||||
$u-main-color: $my-main-color;
|
||||
|
||||
.u-wrap {
|
||||
height: calc(100vh);
|
||||
/* #ifdef H5 */
|
||||
height: calc(100vh - var(--window-top));
|
||||
/* #endif */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.headeimg {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
|
||||
.u-menu-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.u-search-inner {
|
||||
// background-color: rgb(234, 234, 234);
|
||||
background-color: #fff;
|
||||
border-radius: 100rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10rpx 16rpx;
|
||||
}
|
||||
|
||||
.u-search-text {
|
||||
font-size: 26rpx;
|
||||
color: $u-tips-color;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.u-tab-view {
|
||||
width: 178rpx;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.u-tab-item {
|
||||
height: 110rpx;
|
||||
background: #f6f6f6;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.u-tab-item-active {
|
||||
position: relative;
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.u-tab-item-active::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
border-left: 4px solid $u-primary;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.u-tab-view {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.addCai {
|
||||
width: 250rpx;
|
||||
height: 272rpx;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
box-sizing: border-box;
|
||||
border: 4rpx solid #90BDF6;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.lingshi {
|
||||
width: 250rpx;
|
||||
height: 136px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 4rpx solid #90BDF6;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.right-box {
|
||||
width: 572rpx;
|
||||
// background-color: rgb(250, 250, 250);
|
||||
background-color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
.page-view {
|
||||
// padding: 24rpx 28rpx 24rpx 24rpx;
|
||||
}
|
||||
|
||||
.class-item {
|
||||
margin-bottom: 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.class-item:last-child {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
font-size: 26rpx;
|
||||
color: $u-main-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.item-menu-name {
|
||||
font-weight: normal;
|
||||
font-size: 24rpx;
|
||||
color: $u-main-color;
|
||||
}
|
||||
|
||||
.item-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.thumb-box {
|
||||
margin-right: 24rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.item-menu-image {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,407 +0,0 @@
|
|||
<template>
|
||||
<view class="u-flex u-flex-col u-row-between page">
|
||||
<view class="top bg-fff w-full">
|
||||
<view class="u-flex u-row-between choose-user" @tap="chooseUser">
|
||||
<view>选择用户</view>
|
||||
<view class="u-flex">
|
||||
<uni-icons type="right" size="20" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<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">
|
||||
</uni-search-bar>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<image src="/pagesCreateOrder/static/images/icon-saoma.svg" class="icon-saoma" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list u-flex w-full u-flex-1">
|
||||
<view class="category u-flex" :style="computedCatrgoryStyle">
|
||||
<scroll-view scroll-with-animation class="scroll-view_style menu-scroll-view" :scroll-into-view="category.intoviewId"
|
||||
scroll-y="true" :scroll-top="category.scrollTop" :style="{height:listHeight+'px'}">
|
||||
<view>
|
||||
<view :id="'category'+index" class="item u-tab-item" @tap="changeCategoryActive(index)"
|
||||
:class="{active:index==category.active}" v-for="(item,index) in category.list" :key="index">
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
<view class="goods-list u-flex-1 u-p-l-24">
|
||||
<scroll-view @scroll="goodsScroll" scroll-with-animation class="scroll-view_style"
|
||||
:scroll-top="goods.scrollTop" :scroll-into-view="goods.intoviewId" scroll-y="true"
|
||||
:style="{height:listHeight+'px'}">
|
||||
<view class="">
|
||||
<view class="item" :class="{active:index==category.active}" v-for="(item,index) in goods.list"
|
||||
:key="index">
|
||||
<view class="color-main">{{item.title}}</view>
|
||||
<view class="u-m-t-24 u-m-b-24 u-flex u-flex-wrap">
|
||||
<view :id="'goods'+index" class="u-m-r-24 u-m-b-24 class-item"
|
||||
v-for="(goodsItem,goodsIndex) in item.list" :key="goodsIndex">
|
||||
<goods-item @chooseGuige="chooseGuige($event,index)" @add="goodsAdd($event,index)" @reduce="goodsReduce($event,index)"
|
||||
:index="goodsIndex" :data="goodsItem"></goods-item>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom w-full">
|
||||
<my-car :data="cars"></my-car>
|
||||
</view>
|
||||
|
||||
<!-- 选择规格 -->
|
||||
<my-model ref="guigeModel" :title="guigeModelData.title">
|
||||
<template #desc>
|
||||
<view v-for="(item,index) in guigeModelData.chooseGoods.skus" :key="index">
|
||||
|
||||
</view>
|
||||
</template>
|
||||
</my-model>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onPullDownRefresh
|
||||
} from '@dcloudio/uni-app';
|
||||
import myModel from '@/components/my-components/my-model.vue'
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref,nextTick
|
||||
} from 'vue';
|
||||
import myCar from './components/car'
|
||||
import goodsItem from './components/goods-item'
|
||||
|
||||
const guigeModel=ref(null)
|
||||
const guigeModelData=reactive({
|
||||
title:'',
|
||||
chooseGoods:{
|
||||
skus:[{
|
||||
title:'',
|
||||
skds:[]
|
||||
}]
|
||||
}
|
||||
})
|
||||
|
||||
function chooseGuige(listindex, index){
|
||||
const $goods=goods.list[index].list[listindex]
|
||||
guigeModelData.title=$goods.title
|
||||
guigeModel.value.open()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let searchValue = ref('')
|
||||
const categoryArr = new Array(20).fill(1).map((v, index) => {
|
||||
if (index % 2 === 0) {
|
||||
return {
|
||||
title: '围炉茶煮'
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
title: '主食'
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
let pageHeight = ref(0)
|
||||
const category = reactive({
|
||||
list: categoryArr,
|
||||
active: 0,
|
||||
height: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
statusbarHeight: 0,
|
||||
intoviewId: '',
|
||||
scrollTop: 0
|
||||
})
|
||||
|
||||
const goodslist = new Array(20).fill(1).map((v, index) => {
|
||||
if (index % 2 === 0) {
|
||||
return {
|
||||
title: '围炉茶煮' + index,
|
||||
list: new Array(10).fill(1).map((g, gIndex) => {
|
||||
return {
|
||||
id:gIndex,
|
||||
title: '拿铁咖啡' + gIndex,
|
||||
price: 28,
|
||||
isDan: gIndex % 2 == 0,
|
||||
chooseNumber: 0
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
title: '主食' + index,
|
||||
list: new Array(10).fill(1).map((g, gIndex) => {
|
||||
return {
|
||||
id:10000+gIndex,
|
||||
title: '意大利面' + gIndex,
|
||||
price: 28,
|
||||
isDan: gIndex % 2 == 0,
|
||||
chooseNumber: 0
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
let goods = reactive({
|
||||
intoviewId: '',
|
||||
scrollTop: 0,
|
||||
list: goodslist
|
||||
})
|
||||
|
||||
const cars=reactive([])
|
||||
|
||||
function chooseUser() {
|
||||
goods.intoviewId = 'goods' + 5
|
||||
}
|
||||
|
||||
function goodsAdd(listindex, index) {
|
||||
const $goods=goods.list[index].list[listindex]
|
||||
const newval =$goods.chooseNumber + 1
|
||||
$goods.chooseNumber = newval
|
||||
let item=cars.find(v=>v.id==$goods.id)
|
||||
if(item){
|
||||
item.number+=1
|
||||
}else{
|
||||
cars.push({...$goods,number:1})
|
||||
}
|
||||
}
|
||||
|
||||
function goodsReduce(listindex, index) {
|
||||
const $goods = goods.list[index].list[listindex]
|
||||
const newval = $goods.chooseNumber - 1
|
||||
$goods.chooseNumber = newval <= 0 ? 0 : newval
|
||||
}
|
||||
|
||||
async function changeCategoryActive(index) {
|
||||
if(rightArr.length == 0) {
|
||||
await getMenuItemTop();
|
||||
}
|
||||
if (index == category.active) return;
|
||||
goods.scrollTop =oldScrollTop;
|
||||
|
||||
nextTick (function(){
|
||||
goods.scrollTop = rightArr[index];
|
||||
category.active = index;
|
||||
leftMenuStatus(index);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
let oldScrollTop=0;
|
||||
let rightArr=[]
|
||||
// 获取右边菜单每个item到顶部的距离
|
||||
function getMenuItemTop() {
|
||||
new Promise(resolve => {
|
||||
let selectorQuery = uni.createSelectorQuery();
|
||||
selectorQuery.selectAll('.class-item').boundingClientRect((rects) => {
|
||||
// 如果节点尚未生成,rects值为[](因为用selectAll,所以返回的是数组),循环调用执行
|
||||
if(!rects.length) {
|
||||
setTimeout(() => {
|
||||
getMenuItemTop();
|
||||
}, 10);
|
||||
return ;
|
||||
}
|
||||
rects.forEach((rect) => {
|
||||
// 这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
|
||||
rightArr.push(rect.top - rects[0].top);
|
||||
resolve();
|
||||
})
|
||||
}).exec()
|
||||
})
|
||||
}
|
||||
|
||||
let timer=null
|
||||
let menuHeight=0 // 左边菜单的高度
|
||||
// 获取一个目标元素的高度
|
||||
function getElRect(elClass, dataVal) {
|
||||
new Promise((resolve, reject) => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('.' + elClass).fields({
|
||||
size: true
|
||||
}, res => {
|
||||
// 如果节点尚未生成,res值为null,循环调用执行
|
||||
if (!res) {
|
||||
setTimeout(() => {
|
||||
getElRect(elClass);
|
||||
}, 10);
|
||||
return;
|
||||
}
|
||||
if(dataVal==='menuHeight'){
|
||||
menuHeight=res.height
|
||||
}
|
||||
if(dataVal==='menuItemHeight'){
|
||||
menuItemHeight=res.height
|
||||
}
|
||||
resolve();
|
||||
}).exec();
|
||||
})
|
||||
}
|
||||
let menuItemHeight=0
|
||||
// 设置左边菜单的滚动状态
|
||||
async function leftMenuStatus(index) {
|
||||
category.active = index;
|
||||
// 如果为0,意味着尚未初始化
|
||||
if (menuHeight == 0 || menuItemHeight == 0) {
|
||||
await getElRect('menu-scroll-view', 'menuHeight');
|
||||
await getElRect('u-tab-item', 'menuItemHeight');
|
||||
}
|
||||
// 将菜单活动item垂直居中
|
||||
category.scrollTop = index * menuItemHeight + menuItemHeight / 2 - menuHeight / 2;
|
||||
}
|
||||
async function goodsScroll(e) {
|
||||
oldScrollTop = e.detail.scrollTop;
|
||||
if (rightArr.length == 0) {
|
||||
await getMenuItemTop();
|
||||
}
|
||||
if (timer) return;
|
||||
if (!menuHeight) {
|
||||
await getElRect('menu-scroll-view', 'menuHeight');
|
||||
}
|
||||
setTimeout(() => { // 节流
|
||||
timer = null;
|
||||
// scrollHeight为右边菜单垂直中点位置
|
||||
let scrollHeight = e.detail.scrollTop + menuHeight / 2;
|
||||
for (let i = 0; i < rightArr.length; i++) {
|
||||
let height1 = rightArr[i];
|
||||
let height2 = rightArr[i + 1];
|
||||
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
|
||||
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
|
||||
leftMenuStatus(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}, 10)
|
||||
}
|
||||
|
||||
onReady(() => {
|
||||
initCategory()
|
||||
getMenuItemTop()
|
||||
})
|
||||
|
||||
|
||||
|
||||
function initCategory() {
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
pageHeight.value = res.windowHeight
|
||||
const screenHeight = res.windowHeight; // 屏幕可用高度
|
||||
const topinfo = uni.createSelectorQuery().select(".top");
|
||||
const bottominfo = uni.createSelectorQuery().select(".bottom");
|
||||
topinfo.boundingClientRect(function(data) { //data - 各种参数
|
||||
category.top = data.height + category.statusbarHeight
|
||||
}).exec()
|
||||
bottominfo.boundingClientRect(function(data) { //data - 各种参数
|
||||
category.bottom = data.height
|
||||
}).exec()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const listHeight = computed(() => {
|
||||
return pageHeight.value - category.bottom - category.top
|
||||
})
|
||||
const computedCatrgoryStyle = computed(() => {
|
||||
return `
|
||||
top:${category.top}px;
|
||||
bottom:${category.bottom}px;
|
||||
`
|
||||
})
|
||||
|
||||
|
||||
|
||||
function search() {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* 针对微信小程序的滚动条样式 */
|
||||
::v-deep.scroll-view_style::-webkit-scrollbar {
|
||||
width: 8rpx;
|
||||
}
|
||||
|
||||
::v-deep.scroll-view_style::-webkit-scrollbar-thumb {
|
||||
background: #90BDF6;
|
||||
border-radius: 5px;
|
||||
/* 设置滚动条圆角 */
|
||||
}
|
||||
|
||||
::v-deep.scroll-view_style::-webkit-scrollbar-track {
|
||||
background-color: #f1f1f1;
|
||||
/* 设置滚动条轨道颜色 */
|
||||
}
|
||||
|
||||
.page {
|
||||
height: calc(100vh - 44px);
|
||||
}
|
||||
|
||||
.goods-list {
|
||||
box-sizing: border-box;
|
||||
width: 572rpx;
|
||||
}
|
||||
|
||||
.category {
|
||||
box-sizing: border-box;
|
||||
// position: fixed;
|
||||
width: 178rpx;
|
||||
|
||||
// left: 0;
|
||||
.item {
|
||||
padding: 36rpx 32rpx;
|
||||
position: relative;
|
||||
background: #F9F9F9;
|
||||
transition: all .2s ease-in-out;
|
||||
|
||||
&.active {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
&.active::after {
|
||||
background-color: $my-main-color;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.choose-user {
|
||||
background: #F9F9F9;
|
||||
padding: 22rpx 28rpx;
|
||||
}
|
||||
|
||||
.search {
|
||||
padding-right: 28rpx;
|
||||
}
|
||||
|
||||
.icon-saoma {
|
||||
margin-left: 20rpx;
|
||||
width: 34rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -35,6 +35,7 @@
|
|||
<view class="search u-flex u-col-center ">
|
||||
<view class="u-flex-1">
|
||||
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="搜索店内商品" @confirm="search"
|
||||
@clear="clearSearch"
|
||||
v-model="searchValue">
|
||||
</uni-search-bar>
|
||||
</view>
|
||||
|
|
@ -43,43 +44,58 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-menu-wrap">
|
||||
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="data.scrollTop"
|
||||
:scroll-into-view="data.itemId">
|
||||
<view v-for="(item,index) in data.tabbar" :key="index" class="u-tab-item"
|
||||
:class="[data.current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
|
||||
<text class="u-line-1">{{item.name}}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<scroll-view :scroll-top="data.scrollRightTop" scroll-y scroll-with-animation class="right-box"
|
||||
@scroll="rightScroll">
|
||||
<view class="page-view u-p-l-24">
|
||||
<view class="lingshi" @tap="toLinshi">
|
||||
<uni-icons type="plus-filled" size="24" :color="color.ColorMain"></uni-icons>
|
||||
<view class="u-m-t-24 color-main">临时菜</view>
|
||||
<template v-if="!isSearch">
|
||||
<view class="u-menu-wrap">
|
||||
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="data.scrollTop"
|
||||
:scroll-into-view="data.itemId">
|
||||
<view v-for="(item,index) in data.tabbar" :key="index" class="u-tab-item"
|
||||
:class="[data.current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
|
||||
<text class="u-line-1">{{item.name}}</text>
|
||||
</view>
|
||||
<view class="class-item" :id="'item' + index" v-for="(item , index) in data.tabbar" :key="index">
|
||||
<view class="item-title">
|
||||
<text>{{item.name}}</text>
|
||||
</view>
|
||||
<view class="item-container">
|
||||
<view class="thumb-box" v-for="(goodsItem, goodsIndex) in item.foods" :key="goodsIndex">
|
||||
<goods-item @chooseGuige="chooseGuige($event,index)"
|
||||
@add="goodsUpdate($event,index,true)" @reduce="goodsUpdate($event,index,false)"
|
||||
:index="goodsIndex" :data="goodsItem"></goods-item>
|
||||
|
||||
</view>
|
||||
<template v-if="item.name==='附加费'">
|
||||
<view class="addCai" @tap="surchargeShow">
|
||||
</scroll-view>
|
||||
<scroll-view :scroll-top="data.scrollRightTop" scroll-y scroll-with-animation class="right-box"
|
||||
@scroll="rightScroll">
|
||||
<view class="page-view u-p-l-24">
|
||||
<view class="list-tight-top">
|
||||
<template v-if="lingshi.show">
|
||||
<view id="lingshi" class="lingshi" @tap="toLinshi" >
|
||||
<uni-icons type="plus-filled" size="24" :color="color.ColorMain"></uni-icons>
|
||||
<view class="u-m-t-24 color-main">自定义添加</view>
|
||||
<view class="u-m-t-24 color-main">临时菜</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view style="height: 24px;"></view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="class-item" :id="'item' + index" v-for="(item , index) in data.tabbar" :key="index">
|
||||
<view class="item-title">
|
||||
<text>{{item.name}}</text>
|
||||
</view>
|
||||
<view class="item-container">
|
||||
<view class="thumb-box" v-for="(goodsItem, goodsIndex) in item.foods" :key="goodsIndex">
|
||||
<goods-item @chooseGuige="chooseGuige($event,index)"
|
||||
@add="goodsUpdate($event,index,true)" @reduce="goodsUpdate($event,index,false)"
|
||||
:index="goodsIndex" :data="goodsItem"></goods-item>
|
||||
|
||||
</view>
|
||||
<!-- <template v-if="item.name==='附加费'">
|
||||
<view class="addCai" @tap="surchargeShow">
|
||||
<uni-icons type="plus-filled" size="24" :color="color.ColorMain"></uni-icons>
|
||||
<view class="u-m-t-24 color-main">自定义添加</view>
|
||||
</view>
|
||||
</template> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="u-menu-wrap">
|
||||
11
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view class="bottom w-full">
|
||||
<my-car @updateNumber="carsNumberChange" :user="data.vipUser" :masterId="data.masterId" :table="data.table"
|
||||
:data="cars" @clear="onClearCart"></my-car>
|
||||
|
|
@ -102,7 +118,6 @@
|
|||
$tbShopCategory
|
||||
} from '@/http/yskApi/goods.js'
|
||||
import util from './util.js';
|
||||
import classifyData from './classify.data.js';
|
||||
import color from '@/commons/color.js';
|
||||
import guigeModel from './components/guige'
|
||||
import goodsItem from './components/goods-item'
|
||||
|
|
@ -119,7 +134,7 @@
|
|||
computed,
|
||||
reactive,
|
||||
ref,
|
||||
nextTick,
|
||||
nextTick,getCurrentInstance ,
|
||||
watch
|
||||
} from 'vue';
|
||||
import myCar from './components/car'
|
||||
|
|
@ -134,6 +149,17 @@
|
|||
import {
|
||||
tbShopInfo
|
||||
} from '@/http/yskApi/user.js'
|
||||
const instance = getCurrentInstance();
|
||||
//临时菜
|
||||
const lingshi=reactive({
|
||||
show:false
|
||||
})
|
||||
//附加费
|
||||
const extraFee=reactive({
|
||||
show:false
|
||||
})
|
||||
|
||||
|
||||
const cars = reactive([])
|
||||
const data = reactive({
|
||||
scrollTop: 0, //tab标题的滚动条位置
|
||||
|
|
@ -174,6 +200,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
function setTabBar(category, goods, cars) {
|
||||
const goodsCategoryMap = goods.reduce((prve, cur) => {
|
||||
if (!prve.hasOwnProperty(cur.categoryId)) {
|
||||
|
|
@ -203,22 +230,17 @@
|
|||
})
|
||||
}
|
||||
})
|
||||
tabbar.push({
|
||||
name: '附加费',
|
||||
foods: [{
|
||||
name: "小费",
|
||||
price: Math.ceil(Math.random() * 10),
|
||||
chooseNumber: 0,
|
||||
isDan: true
|
||||
},
|
||||
{
|
||||
name: "打包费",
|
||||
price: 1,
|
||||
chooseNumber: 0,
|
||||
isDan: true
|
||||
}
|
||||
]
|
||||
})
|
||||
// tabbar.push({
|
||||
// name: '附加费',
|
||||
// foods: [{
|
||||
// name: "餐位费",
|
||||
// price:$shop.value.tableFee,
|
||||
// chooseNumber: 0,
|
||||
// isSeatFee:true,
|
||||
// isDan: true
|
||||
// }
|
||||
// ]
|
||||
// })
|
||||
tabbar = tabbar.filter(v => {
|
||||
return v.foods.length
|
||||
})
|
||||
|
|
@ -266,7 +288,7 @@
|
|||
//加入购物车
|
||||
function addCart(par) {
|
||||
if(!data.table.tableId){
|
||||
return infoBox.showToast('请先选择台桌!')
|
||||
return infoBox.showToast('请先选择桌台!')
|
||||
}
|
||||
const submitPar = {
|
||||
masterId: data.masterId,
|
||||
|
|
@ -330,7 +352,7 @@
|
|||
}
|
||||
|
||||
|
||||
//获取台桌信息
|
||||
//获取桌台信息
|
||||
async function getTableInfo(){
|
||||
const res=await $table.get({qrcode:data.table.tableId})
|
||||
console.log(res);
|
||||
|
|
@ -339,7 +361,11 @@
|
|||
}
|
||||
}
|
||||
async function init() {
|
||||
getTbShopInfo()
|
||||
const shopInfo = await tbShopInfo()
|
||||
$shop.value = shopInfo
|
||||
const useType=data.table.status=='using'?data.table.useType:$returnUseType(shopInfo)
|
||||
uni.setStorageSync('useType',useType)
|
||||
console.log(shopInfo);
|
||||
getTableInfo()
|
||||
const categoryRes = await getCategory()
|
||||
const category = categoryRes.content.reduce((prve, cur) => {
|
||||
|
|
@ -359,7 +385,7 @@
|
|||
return isShow;
|
||||
});
|
||||
if(!data.table.tableId){
|
||||
//无台桌
|
||||
//无桌台
|
||||
setTabBar(category, goods, [])
|
||||
return
|
||||
}
|
||||
|
|
@ -397,11 +423,15 @@
|
|||
|
||||
|
||||
let searchValue = ref('')
|
||||
|
||||
let isSearch=ref(false)
|
||||
function search() {
|
||||
// isSearch.value=true
|
||||
console.log(searchValue.value);
|
||||
console.log(data.tabbar );
|
||||
}
|
||||
function clearSearch(){
|
||||
// isSearch.value=false
|
||||
}
|
||||
|
||||
function chooseUser() {
|
||||
go.to('PAGES_CHOOSE_USER')
|
||||
|
|
@ -578,6 +608,9 @@
|
|||
}
|
||||
|
||||
function chooseGuige(foodsindex, index) {
|
||||
if(!canAddGoods()){
|
||||
return infoBox.showToast('清先选择桌台')
|
||||
}
|
||||
const $goods = data.tabbar[index].foods[foodsindex]
|
||||
guigeModelData.title = $goods.name
|
||||
const specList = $goods.specList;
|
||||
|
|
@ -674,7 +707,13 @@
|
|||
} : false
|
||||
}
|
||||
|
||||
function canAddGoods(){
|
||||
return data.table.tableId
|
||||
}
|
||||
async function goodsUpdate(foodsindex, index, isAdd) {
|
||||
if(!canAddGoods()){
|
||||
return infoBox.showToast('清先选择桌台')
|
||||
}
|
||||
const $goods = data.tabbar[index].foods[foodsindex]
|
||||
if ($goods.isDan) {
|
||||
//单规格
|
||||
|
|
@ -726,6 +765,9 @@
|
|||
|
||||
|
||||
onReady(() => {
|
||||
getElRect('list-tight-top').then(res=>{
|
||||
data.topZhanwei=res.height
|
||||
})
|
||||
getMenuItemTop()
|
||||
})
|
||||
|
||||
|
|
@ -746,8 +788,8 @@
|
|||
}
|
||||
// 获取一个目标元素的高度
|
||||
function getElRect(elClass, dataVal) {
|
||||
new Promise((resolve, reject) => {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
return new Promise((resolve, reject) => {
|
||||
const query = uni.createSelectorQuery().in(instance.proxy);
|
||||
query.select('.' + elClass).fields({
|
||||
size: true
|
||||
}, res => {
|
||||
|
|
@ -758,8 +800,11 @@
|
|||
}, 10);
|
||||
return;
|
||||
}
|
||||
data[dataVal] = res.height;
|
||||
resolve();
|
||||
console.log(res);
|
||||
if(dataVal){
|
||||
data[dataVal] = res.height;
|
||||
}
|
||||
resolve(res);
|
||||
}).exec();
|
||||
})
|
||||
}
|
||||
|
|
@ -879,7 +924,7 @@
|
|||
uni.setStorageSync('useType',opt.useType)
|
||||
}
|
||||
// if (!opt.tableId) {
|
||||
// infoBox.showErrorToast('暂不支持不选择台桌下载,请从桌台点餐')
|
||||
// infoBox.showErrorToast('暂不支持不选择桌台下载,请从桌台点餐')
|
||||
// return setTimeout(() => {
|
||||
// go.back()
|
||||
// }, 1500)
|
||||
|
|
@ -1014,7 +1059,6 @@
|
|||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.right-box {
|
||||
|
|
@ -1034,7 +1078,7 @@
|
|||
}
|
||||
|
||||
.class-item:last-child {
|
||||
min-height: 100vh;
|
||||
min-height: 50vh;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
|
|
|
|||
|
|
@ -76,7 +76,8 @@
|
|||
import {
|
||||
reactive,
|
||||
onMounted,
|
||||
watch
|
||||
watch,
|
||||
ref
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad
|
||||
|
|
@ -84,6 +85,7 @@
|
|||
import * as Api from '@/http/yskApi/Instead.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
import editDiscount from '/pagesCreateOrder/components/edit-discount.vue'
|
||||
import {queryAllShopUser} from '@/http/yskApi/shop-user.js'
|
||||
const pays = reactive({
|
||||
list: ['扫码收款', '二维码收款'],
|
||||
selIndex: 0,
|
||||
|
|
@ -106,6 +108,7 @@
|
|||
model && model.open()
|
||||
}
|
||||
|
||||
let user=ref({})
|
||||
async function getPayType() {
|
||||
const payTypeList = await Api.$getPayType()
|
||||
pays.payTypes.list = payTypeList
|
||||
|
|
@ -181,6 +184,11 @@
|
|||
onLoad((opt) => {
|
||||
console.log(opt);
|
||||
Object.assign(order, opt)
|
||||
if(order.userId){
|
||||
queryAllShopUser({id:opt.userId}).then(res=>{
|
||||
user.value=res.content[0]||opt
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
</view>
|
||||
<view class="bg-gray u-p-20 u-m-t-20">
|
||||
<view>备注</view>
|
||||
<view class="u-m-t-10">无</view>
|
||||
<view class="u-m-t-10">{{orderInfo.remark}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
if (!useType) {
|
||||
return ''
|
||||
}
|
||||
return useType == "takeout" ? '堂食' : '自取';
|
||||
return useType == "takeout" ? '自取' : '堂食';
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
})
|
||||
const recoders = reactive({
|
||||
list:[
|
||||
{title:'2024-09-15 11:20:30',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'},
|
||||
{title:'2024-09-15 ',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'},
|
||||
{title:'2024-09-15 ',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'}
|
||||
{title:'2024-09-15',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'},
|
||||
{title:'2024-09-15',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'},
|
||||
{title:'2024-09-15',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'}
|
||||
],
|
||||
active:0
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,20 +5,20 @@
|
|||
</template>
|
||||
<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>
|
||||
<up-avatar :size="30" :src="user.headImg"></up-avatar>
|
||||
<view class="color-666 u-m-l-30">{{user.telephone||'未绑定手机号'}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<my-button :height="60" plain shape="circle">他的订单</my-button>
|
||||
<my-button @click="toOrder" :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="font-bold">{{user.amount}}</view>
|
||||
<view class="color-666 u-m-t-10">余额</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="font-bold">0.00</view>
|
||||
<view class="font-bold">{{user.totalScore}}</view>
|
||||
<view class="color-666 u-m-t-10">积分</view>
|
||||
</view>
|
||||
<view class="">
|
||||
|
|
@ -34,14 +34,31 @@
|
|||
const props = defineProps({
|
||||
orderInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
status:''
|
||||
}
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
return {
|
||||
id:'',
|
||||
headImg:'',
|
||||
telephone:'',
|
||||
amount:'0.00',
|
||||
totalScore:'0.00'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function toOrder(){
|
||||
go.to('PAGES_ORDER_INDEX',{
|
||||
userId:props.user.id||'',
|
||||
type:'user'
|
||||
})
|
||||
}
|
||||
|
||||
function chooseUser() {
|
||||
go.to('PAGES_CHOOSE_USER')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="min-page bg-gray u-font-28 u-p-30">
|
||||
<user-vue :orderInfo="orderDetail.info"></user-vue>
|
||||
<user-vue :orderInfo="orderDetail.info" :user="user"></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">{{orderDetail.info.tableName}}</text>
|
||||
|
|
@ -8,7 +8,8 @@
|
|||
<goods-list @printOrder="onPrintOrder" @tuikuan="onTuikuan" :orderInfo="orderDetail.info"
|
||||
:data="orderDetail.goodsList" :seatFee="orderDetail.seatFee.totalAmount" @tuicai="onTuiCai"></goods-list>
|
||||
<template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount">
|
||||
<extra-vue @tuicai="onSeatFeeTuicai" @tuikuan="onSeatFeeTuiKuan" :orderInfo="orderDetail.info" :data="orderDetail.seatFee"></extra-vue>
|
||||
<extra-vue @tuicai="onSeatFeeTuicai" @tuikuan="onSeatFeeTuiKuan" :orderInfo="orderDetail.info"
|
||||
:data="orderDetail.seatFee"></extra-vue>
|
||||
</template>
|
||||
<order-vue :data="orderDetail.info" :table="options" :seatFee="orderDetail.seatFee"></order-vue>
|
||||
<step-vue></step-vue>
|
||||
|
|
@ -36,6 +37,7 @@
|
|||
<script setup>
|
||||
import * as Api from '@/http/yskApi/Instead.js'
|
||||
import * as orderApi from '@/http/yskApi/order.js'
|
||||
import {queryAllShopUser} from '@/http/yskApi/shop-user.js'
|
||||
import {
|
||||
objToArrary
|
||||
} from '@/commons/utils/returrn-data.js'
|
||||
|
|
@ -59,20 +61,43 @@
|
|||
import OrderDetail from './page.js'
|
||||
const tuicai = reactive({
|
||||
show: false,
|
||||
isSeatFee:false,
|
||||
isSeatFee: false,
|
||||
selGoods: {}
|
||||
})
|
||||
|
||||
function onSeatFeeTuicai(seatFee){
|
||||
function onSeatFeeTuicai(seatFee) {
|
||||
tuicai.show = true
|
||||
tuicai.isSeatFee = seatFee
|
||||
tuicai.selGoods = seatFee
|
||||
}
|
||||
function onSeatFeeTuiKuan(seatFee){
|
||||
go.to('PAGES_ORDER_TUIKUAN', {
|
||||
|
||||
function onSeatFeeTuiKuan(seatFee) {
|
||||
console.log(seatFee);
|
||||
const {
|
||||
id,
|
||||
productId,
|
||||
productSkuId,
|
||||
productName,
|
||||
productSkuName,
|
||||
cartId,
|
||||
num,
|
||||
priceAmount,
|
||||
price
|
||||
} = seatFee
|
||||
go.to('PAGES_ORDER_TUIKUAN', {
|
||||
id,
|
||||
cartId,
|
||||
productId,
|
||||
productSkuId,
|
||||
productName,
|
||||
num,
|
||||
number: 0,
|
||||
productSkuName: productSkuName || '',
|
||||
priceAmount,
|
||||
price
|
||||
})
|
||||
}
|
||||
|
||||
function onTuiCai(goods, index) {
|
||||
console.log(goods);
|
||||
tuicai.show = true
|
||||
|
|
@ -115,7 +140,17 @@
|
|||
}
|
||||
|
||||
function onTuikuan(goods, index) {
|
||||
const {id,productId,productSkuId,productName,productSkuName,cartId,num,priceAmount,price}=goods
|
||||
const {
|
||||
id,
|
||||
productId,
|
||||
productSkuId,
|
||||
productName,
|
||||
productSkuName,
|
||||
cartId,
|
||||
num,
|
||||
priceAmount,
|
||||
price
|
||||
} = goods
|
||||
go.to('PAGES_ORDER_TUIKUAN', {
|
||||
id,
|
||||
cartId,
|
||||
|
|
@ -123,9 +158,10 @@
|
|||
productSkuId,
|
||||
productName,
|
||||
num,
|
||||
number:0,
|
||||
productSkuName:productSkuName||'',
|
||||
priceAmount,price
|
||||
number: 0,
|
||||
productSkuName: productSkuName || '',
|
||||
priceAmount,
|
||||
price
|
||||
})
|
||||
|
||||
}
|
||||
|
|
@ -147,12 +183,14 @@
|
|||
}
|
||||
|
||||
function toPay() {
|
||||
const userId=orderDetail.info.userId||''
|
||||
go.to('PAGES_ORDER_PAY', {
|
||||
tableId: options.tableId,
|
||||
tableId: options.tableId|| orderDetail.info.tableId,
|
||||
tableName: options.name,
|
||||
masterId: options.masterId,
|
||||
orderId: orderDetail.info.id,
|
||||
discount: 1
|
||||
discount: 1,
|
||||
userId
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -166,6 +204,15 @@
|
|||
const options = reactive({})
|
||||
async function init() {
|
||||
const res = await orderApi.tbOrderInfoDetail(options.id)
|
||||
if(res.userId){
|
||||
queryAllShopUser({id:res.userId}).then(res=>{
|
||||
if(res.content[0]){
|
||||
user.value=res.content[0]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (res.detailList.length) {
|
||||
uni.setStorageSync('useType', res.detailList[0].useType)
|
||||
}
|
||||
|
|
@ -222,12 +269,17 @@
|
|||
}
|
||||
|
||||
// 监听选择用户事件
|
||||
let user = ref(null)
|
||||
let user = ref({
|
||||
headImg:'',
|
||||
telephone:'',
|
||||
amount:'0.00',
|
||||
totalScore:'0.00'
|
||||
})
|
||||
//更新选择用户
|
||||
function setUser(par) {
|
||||
const submitPar = {
|
||||
masterId: options.masterId,
|
||||
tableId: options.tableId,
|
||||
tableId: options.tableId|| orderDetail.info.tableId,
|
||||
vipUserId: user.value.id ? user.value.id : '',
|
||||
type: user.value.id ? 0 : 1 //0 设置 1 取消
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<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">
|
||||
|
|
@ -18,6 +19,29 @@
|
|||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="type&&userShow">
|
||||
<view class="u-p-l-28 u-flex u-p-r-28 u-p-t-10 bg-gray" v-if="userShow">
|
||||
<view class="time-area u-font-24 color-main u-flex">
|
||||
<up-avatar :size="22" :src="user.headImg"></up-avatar>
|
||||
<view class="u-m-l-10 u-m-r-10">
|
||||
<text v-if="user.id">{{user.telephone||user.nickName}}</text>
|
||||
<text v-else>服务员下单</text>
|
||||
</view>
|
||||
<up-icon name="close-circle-fill" :color="color.ColorMain" @click="userShowClose"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-l-28 u-flex u-p-r-28 u-p-t-10 bg-gray" v-else>
|
||||
<view class="time-area u-font-24 color-main u-flex">
|
||||
<up-avatar :size="22" ></up-avatar>
|
||||
<view class="u-m-l-10 u-m-r-10">
|
||||
服务员下单
|
||||
</view>
|
||||
<up-icon name="close-circle-fill" :color="color.ColorMain" @click="userShowClose"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<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>
|
||||
|
|
@ -31,7 +55,9 @@
|
|||
<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">
|
||||
<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>
|
||||
|
|
@ -47,11 +73,20 @@
|
|||
<script setup>
|
||||
import orderEnum from '@/commons/orderEnum.js'
|
||||
import * as $time from '@/commons/utils/dayjs-time.js';
|
||||
import color from '@/commons/color.js';
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
|
||||
const emits = defineEmits(['update:time', 'update:status','clearUser'])
|
||||
|
||||
function userShowClose() {
|
||||
userShow.value = false
|
||||
emits('clearUser')
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
time: {
|
||||
type: Array,
|
||||
|
|
@ -60,10 +95,31 @@
|
|||
status: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
userId: ''
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
type:{
|
||||
type:String,
|
||||
default:''//user 查看具体用户订单
|
||||
}
|
||||
})
|
||||
let userShow = ref(props.type? true : false)
|
||||
console.log(props.type);
|
||||
watch(() => props.type, (newval) => {
|
||||
console.log(newval);
|
||||
if (newval) {
|
||||
userShow.value = true
|
||||
}
|
||||
})
|
||||
|
||||
let datePicker = ref(null)
|
||||
const emits = defineEmits(['update:time', 'update:status'])
|
||||
// 示例使用
|
||||
const today = $time.getTodayTimestamps();
|
||||
const yesterday = $time.getYesterdayTimestamps();
|
||||
|
|
@ -90,7 +146,7 @@
|
|||
|
||||
const statusData = reactive({
|
||||
allList: orderEnum.status,
|
||||
moreShow:false,
|
||||
moreShow: false,
|
||||
allListSel: -1,
|
||||
list: [{
|
||||
label: '全部',
|
||||
|
|
@ -115,12 +171,15 @@
|
|||
],
|
||||
sel: 0
|
||||
})
|
||||
function moreShowHide(){
|
||||
statusData.moreShow=false
|
||||
|
||||
function moreShowHide() {
|
||||
statusData.moreShow = false
|
||||
}
|
||||
function moreShowOpen(){
|
||||
statusData.moreShow=true
|
||||
|
||||
function moreShowOpen() {
|
||||
statusData.moreShow = true
|
||||
}
|
||||
|
||||
function changeStatusSel(i) {
|
||||
statusData.sel = i
|
||||
}
|
||||
|
|
@ -129,8 +188,9 @@
|
|||
console.log(e);
|
||||
emits('update:time', [e.start, e.end])
|
||||
}
|
||||
function changeAllListSel(i){
|
||||
statusData.allListSel=i
|
||||
|
||||
function changeAllListSel(i) {
|
||||
statusData.allListSel = i
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
@ -144,7 +204,8 @@
|
|||
color: $my-main-color;
|
||||
}
|
||||
}
|
||||
.all-list-item{
|
||||
|
||||
.all-list-item {
|
||||
text-align: center;
|
||||
width: 156rpx;
|
||||
white-space: nowrap;
|
||||
|
|
@ -153,11 +214,13 @@
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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="order.data.query.createdAt"></filter-vue>
|
||||
<filter-vue @clearUser="clearQueryUser" v-model:time="order.data.query.createdAt" :user="user" :type="option.type"></filter-vue>
|
||||
</view>
|
||||
<order-list @printOrder="onPrintOrder" :hasAjax="order.data.hasAjax" :list="order.data.list"></order-list>
|
||||
<my-pagination @change="pageChange" :totalElements="order.data.total"></my-pagination>
|
||||
|
|
@ -15,13 +15,16 @@
|
|||
<script setup>
|
||||
import {onLoad,onShow,onPullDownRefresh} from '@dcloudio/uni-app'
|
||||
import * as Api from '@/http/yskApi/order.js'
|
||||
import {queryAllShopUser} from '@/http/yskApi/shop-user.js'
|
||||
|
||||
|
||||
import LIST from '@/commons/class/list.js'
|
||||
import {$printOrder} from '@/http/yskApi/Instead.js'
|
||||
import filterVue from './compoents/filter.vue';
|
||||
import orderList from './compoents/order-list.vue';
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
import {
|
||||
reactive, watch
|
||||
reactive, ref, watch
|
||||
} from 'vue';
|
||||
|
||||
const search = reactive({
|
||||
|
|
@ -47,9 +50,13 @@
|
|||
pageSize: 10,
|
||||
payType: "",
|
||||
productName: "",
|
||||
status: ""
|
||||
status: "",
|
||||
userId:''
|
||||
}
|
||||
})
|
||||
function clearQueryUser(){
|
||||
order.setQuery('userId','')
|
||||
}
|
||||
function pageChange(e){
|
||||
order.setVal('page',e)
|
||||
console.log(e);
|
||||
|
|
@ -62,6 +69,9 @@
|
|||
watch(()=>order.data.query.createdAt,(newval)=>{
|
||||
init()
|
||||
})
|
||||
watch(()=>order.data.query.userId,(newval)=>{
|
||||
init()
|
||||
})
|
||||
async function init() {
|
||||
const {content,totalElements}=await Api.tbOrderInfoData({...order.data.query,page:order.data.page})
|
||||
uni.stopPullDownRefresh()
|
||||
|
|
@ -71,10 +81,25 @@
|
|||
order.setVal('hasAjax',true)
|
||||
}
|
||||
onPullDownRefresh(()=>{
|
||||
pageData.order.query.page=0
|
||||
order.setQuery('page',0)
|
||||
init()
|
||||
})
|
||||
|
||||
let user=ref({
|
||||
userId:''
|
||||
})
|
||||
const option=reactive({type:''})
|
||||
onLoad((opt)=>{
|
||||
Object.assign(option,opt)
|
||||
if(opt&&JSON.stringify(opt)!='{}'){
|
||||
order.setQuery('userId',opt.userId?opt.userId:'')
|
||||
if(opt.userId){
|
||||
queryAllShopUser({id:opt.userId}).then(res=>{
|
||||
user.value=res.content[0]||opt
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
onShow(init)
|
||||
async function printOrder(item){
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
<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"
|
||||
<view class="item" @click="changePayType(index,item)" 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">
|
||||
|
|
@ -45,11 +45,11 @@
|
|||
<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">
|
||||
<view class="u-m-r-20" v-if="item.payType=='vipPay'">
|
||||
<text>余额:</text>
|
||||
<text>¥0.00</text>
|
||||
</view> -->
|
||||
<my-radio @click="changePayType(index)"
|
||||
<text>¥{{user.amount||'0'}}</text>
|
||||
</view>
|
||||
<my-radio @click="changePayType(index,item)"
|
||||
:modelValue="index==pays.payTypes.selIndex">
|
||||
</my-radio>
|
||||
</view>
|
||||
|
|
@ -117,14 +117,17 @@
|
|||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import * as Api from '@/http/yskApi/Instead.js'
|
||||
import {queryAllShopUser} from '@/http/yskApi/shop-user.js'
|
||||
import * as orderApi from '@/http/yskApi/order.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
import editDiscount from '@/pagesCreateOrder/components/edit-discount.vue'
|
||||
import editDiscount from '@/components/my-components/edit-discount.vue'
|
||||
|
||||
let payStatus = ref(null) //loading success
|
||||
|
||||
let timer = null
|
||||
|
||||
let user=ref({amount:0});
|
||||
|
||||
function clear() {
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
|
|
@ -182,7 +185,10 @@
|
|||
pays.payTypes.list = payTypeList
|
||||
}
|
||||
|
||||
function changePayType(i) {
|
||||
function changePayType(i,item) {
|
||||
if(item.payType=='vipPay'&&user.value.amount*1<order.amount*1){
|
||||
return infoBox.showToast('余额不足')
|
||||
}
|
||||
pays.payTypes.selIndex = i
|
||||
}
|
||||
//支付成功回调
|
||||
|
|
@ -247,26 +253,25 @@
|
|||
});
|
||||
}
|
||||
watch(() => pays.payTypes.selIndex, (newval) => {
|
||||
const item = pays.payTypes.list[newval]
|
||||
if (item.payType == "vipPay") {
|
||||
return
|
||||
}
|
||||
if (item.payType == "deposit") {
|
||||
//储值卡支付
|
||||
return saomaPay('deposit')
|
||||
}
|
||||
if (item.payType == "scanCode") {
|
||||
//扫码支付
|
||||
return saomaPay('scanCode')
|
||||
}
|
||||
// const item = pays.payTypes.list[newval]
|
||||
// if (item.payType == "vipPay") {
|
||||
// return
|
||||
// }
|
||||
// if (item.payType == "deposit") {
|
||||
// //储值卡支付
|
||||
// return saomaPay('deposit')
|
||||
// }
|
||||
// if (item.payType == "scanCode") {
|
||||
// //扫码支付
|
||||
// return saomaPay('scanCode')
|
||||
// }
|
||||
})
|
||||
let payCodeUrl = ref('')
|
||||
async function init() {
|
||||
|
||||
const res = await orderApi.tbOrderInfoDetail(order.orderId)
|
||||
Object.assign(order, res)
|
||||
}
|
||||
onLoad((opt) => {
|
||||
onLoad(async(opt) => {
|
||||
orderApi.$getOrderPayUrl({
|
||||
orderId: opt.orderId
|
||||
}).then(res => {
|
||||
|
|
@ -274,6 +279,13 @@
|
|||
})
|
||||
console.log(opt);
|
||||
Object.assign(order, opt)
|
||||
const payTypeList = await Api.$getPayType()
|
||||
pays.payTypes.list = payTypeList
|
||||
if(order.userId){
|
||||
queryAllShopUser({id:opt.userId}).then(res=>{
|
||||
user.value=res.content[0]||opt
|
||||
})
|
||||
}
|
||||
init()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -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,.e{fill:#fff;}.d{font-size:9px;font-family:SourceHanSansCN-Heavy, Source Han Sans CN;font-weight:800;}.f{fill:#197dff;}</style><clipPath id="a"><rect class="a" width="32" height="32" transform="translate(337 724)"/></clipPath></defs><g class="b" transform="translate(-337 -724)"><rect class="c" width="30" height="12" rx="2" transform="translate(338 728)"/><path class="c" d="M0,0H19a0,0,0,0,1,0,0V17a2,2,0,0,1-2,2H2a2,2,0,0,1-2-2V0A0,0,0,0,1,0,0Z" transform="translate(344 736)"/><text class="d" transform="translate(348 750)"><tspan x="0" y="0">01</tspan></text><rect class="e" width="23" height="2" rx="1" transform="translate(342 734)"/><path class="f" d="M6,13V9H25v4Z" transform="translate(338 727)"/></g></svg>
|
||||
|
After Width: | Height: | Size: 915 B |
Loading…
Reference in New Issue