代客下单更新

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

View File

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

View File

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

View File

@@ -38,7 +38,7 @@
@clear="clearSearch" v-model="searchValue"> @clear="clearSearch" v-model="searchValue">
</uni-search-bar> </uni-search-bar>
</view> </view>
<view class="u-flex"> <view class="u-flex" @click="scanCode">
<image src="/pagesCreateOrder/static/images/icon-saoma.svg" class="icon-saoma" mode=""></image> <image src="/pagesCreateOrder/static/images/icon-saoma.svg" class="icon-saoma" mode=""></image>
</view> </view>
</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);
}
});
}