代客下单更新

1.去除选择桌台和用户搜索自动聚焦
2.增加扫描二维码
3.确认订单页面禁止切换桌台
This commit is contained in:
2024-10-10 18:00:28 +08:00
parent 8361ec77ec
commit 4c5199f9d8
4 changed files with 98 additions and 47 deletions

View File

@@ -4,7 +4,7 @@
<view class="search bg-fff u-flex u-col-center ">
<view class="u-flex-1">
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="输入桌号" @confirm="search"
:focus="true" v-model="searchValue">
v-model="searchValue">
</uni-search-bar>
</view>
<!-- <view class="u-flex">

View File

@@ -2,7 +2,7 @@
<view class="page-gray u-font-28">
<view class="search bg-fff u-flex u-col-center ">
<view class="u-flex-1">
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="搜索" @confirm="search" :focus="true"
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="搜索" @confirm="search"
v-model="query.name">
</uni-search-bar>
</view>
@@ -16,7 +16,8 @@
<my-radio v-model="nouser" :size="18" border-color="#d1d1d1" @change="chooseUser"></my-radio>
</view>
<view class="u-m-t-32 bg-fff box bg-fff">
<view class="u-flex item u-row-between" v-for="(item,index) in list" :key="index" @tap="chooseUser(index,item)">
<view class="u-flex item u-row-between" v-for="(item,index) in list" :key="index"
@tap="chooseUser(index,item)">
<view class="u-flex">
<view class="headimg u-flex u-row-center u-col-center">
<image v-if="item.headImg" :src="item.headImg" class="img" mode=""></image>
@@ -37,70 +38,84 @@
</view>
</view>
</view>
<my-radio @change="chooseUser(index,item)" v-model="item.checked" :size="18" border-color="#d1d1d1"></my-radio>
<my-radio @change="chooseUser(index,item)" v-model="item.checked" :size="18"
border-color="#d1d1d1"></my-radio>
</view>
</view>
</view>
</view>
</template>
<script setup>
import * as Api from '@/http/yskApi/shop-user.js'
import {onLoad} from '@dcloudio/uni-app'
import * as Api from '@/http/yskApi/shop-user.js'
import {
onLoad
} from '@dcloudio/uni-app'
import {
reactive,
ref
} from 'vue';
let nouser = ref(false)
function emitChooser(data){
uni.$emit('choose-user',data)
setTimeout(()=>{
function emitChooser(data) {
uni.$emit('choose-user', data)
setTimeout(() => {
uni.navigateBack()
},100)
}, 100)
}
function chooseUser(index,item){
if(index===undefined||item===undefined){
nouser.value=true
return emitChooser({id:''})
}
else{
list[index].checked=true
function chooseUser(index, item) {
if (index === undefined || item === undefined) {
nouser.value = true
return emitChooser({
id: '',
headImg: '',
telephone: '',
amount: '0.00',
totalScore: '0.00'
})
} else {
list[index].checked = true
emitChooser(item)
}
}
const query=reactive({
page:0,
name:'',
size:300
const query = reactive({
page: 0,
name: '',
size: 300
})
const list=reactive([])
async function getUser(){
const {content}=await Api.queryAllShopUser(query)
for(let i in content){
list.push({...content[i],checked:false})
const list = reactive([])
async function getUser() {
const {
content
} = await Api.queryAllShopUser(query)
for (let i in content) {
list.push({
...content[i],
checked: false
})
}
console.log(list);
}
function search(){
query.page=0
list.length=0
function search() {
query.page = 0
list.length = 0
getUser()
}
onLoad(()=>{
onLoad(() => {
getUser()
})
</script>
<style lang="scss" scoped>
.scale7{
.scale7 {
transform: scale(0.7);
}
.search {
padding-right: 28rpx;
@@ -113,32 +128,37 @@
.list {
padding: 32rpx 24rpx;
.no-choose {
padding: 36rpx 30rpx 36rpx 24rpx;
}
.box{
.box {
padding: 32rpx 30rpx 78rpx 24rpx;
.item{
.item {
padding: 24rpx 0;
.headimg{
.headimg {
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-size: 0;
width: 84rpx;
height: 84rpx;
background-color: #eee;
overflow: hidden;
.img{
.img {
width: 84rpx;
height: 84rpx;
}
}
}
.item:not(:first-child){
.item:not(:first-child) {
border-top: 1px solid #E5E5E5;
}
}
}
</style>

View File

@@ -1,6 +1,12 @@
<template>
<view class="page-gray color-333 u-font-28">
<template v-if="true">
<view class="block">
<view>桌位号</view>
<view class="font-bold u-font-40 u-m-t-20">
{{table.name||''}}
</view>
</view>
<view class="block">
<view class="u-p-b-24 u-m-b-24 border-bottom">
<view>选择用户</view>
@@ -22,7 +28,20 @@
<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 class=" ">
<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="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">
@@ -44,7 +63,7 @@
</view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
</view> -->
</view>

View File

@@ -38,7 +38,7 @@
@clear="clearSearch" v-model="searchValue">
</uni-search-bar>
</view>
<view class="u-flex">
<view class="u-flex" @click="scanCode">
<image src="/pagesCreateOrder/static/images/icon-saoma.svg" class="icon-saoma" mode=""></image>
</view>
</view>
@@ -201,6 +201,18 @@
}
function scanCode() {
// 只允许通过相机扫码
console.log('scanCode');
uni.scanCode({
onlyFromCamera: true,
success: function(res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
}
});
}