增加部分公共样式

修改部分公共组件代码
修改台桌,代课下单逻辑代码
增加支付页面
修改用户列表页面
This commit is contained in:
YeMingfei666 2024-09-09 17:45:19 +08:00
parent da5f7ca916
commit 34853b8783
31 changed files with 1182 additions and 99 deletions

View File

@ -275,9 +275,6 @@ text {
min-height: 100vh;
/* #endif */
}
.bg-gray{
background-color: #F9F9F9;
}
.w-full{
width: 100%;
}

View File

@ -4,7 +4,7 @@
<slot name="title">
</slot>
<view class="item" @tap.stop="itemClick(index)" v-for="(item,index) in props.list" :key="index">
<button class="bg-fff" hover-class="btn-hover-class">{{item}}</button>
<button class="bg-fff btn" hover-class="btn-hover-class">{{item}}</button>
</view>
<view class="bock-gary"></view>
<view class="cancel-btn" @tap="close">
@ -82,6 +82,9 @@ import { ref } from 'vue';
text-align: center;
font-size: 32rpx;
border-bottom: 1px solid $bg;
.btn{
border-radius: 0;
}
}
}
}

View File

@ -10,9 +10,14 @@
<script setup>
import {
computed,
ref
ref,
watch
} from 'vue';
const props = defineProps({
show:{
type: Boolean,
default: false
},
zIndex: {
type: [Number, String]
},
@ -22,7 +27,10 @@
}
})
const emits = defineEmits(['close', 'toggle', 'open'])
let show = ref(false)
watch(()=>props.show,(newval)=>{
show.value=newval
})
let show = ref(props.show)
function close() {
show.value = false

View File

@ -20,12 +20,12 @@
},
borderColor:{
type: String,
default: '#707070',
default: '#bbb',
},
size: {
//px
type: Number,
default: 14,
default: 16,
},
// v-modal
modelValue: {
@ -56,6 +56,7 @@
if(props.disabled){
return
}
emits('click')
let currentVal=props.modelValue
let type=typeof currentVal
if(type==='number'){

View File

@ -1,11 +1,27 @@
<template>
<view class="u-flex tabs">
<view class="u-flex-1 u-text-center item"
:class="{active:index===current}"
@tap="changeCurrent(index)" v-for="(item,index) in props.list" :key="index">
{{item}}
<view class="u-relative bg border-r-16">
<view class="u-flex tabs zhanwei u-relative">
<view class="active-block" :style="computedBlockStyle">
</view>
<view class="u-flex-1 u-text-center item"
:class="{active:index===current}"
@tap="changeCurrent(index)" v-for="(item,index) in props.list" :key="index">
{{item}}
</view>
</view>
<view class="u-flex tabs u-absolute position-all">
<view class="u-flex-1 u-text-center item"
:class="{active:index===current}"
@tap="changeCurrent(index)" v-for="(item,index) in props.list" :key="index">
{{item}}
</view>
</view>
</view>
</template>
<script setup>
@ -28,6 +44,14 @@ import { computed, ref, watch } from 'vue';
current.value=index
emit('update:modelValue',index)
}
const computedBlockStyle=computed(()=>{
const oneWidth= 100/props.list.length
const left= current.value*oneWidth
return{
width:oneWidth+'%',
left:left+'%'
}
})
watch(()=>current.value,()=>{
emit('change',current.value)
})
@ -35,20 +59,57 @@ import { computed, ref, watch } from 'vue';
</script>
<style lang="scss" scoped>
.tabs{
padding: 4rpx 10rpx;
.zhanwei{
.item{
opacity: 0;
}
}
.bg{
background: #E6F0FF;
border-radius: 16rpx 16rpx 16rpx 16rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
padding: 4rpx 10rpx;
}
.border-r-16{
border-radius: 16rpx;
}
.active-block{
background-color: $my-main-color;
color: #fff;
top: 4rpx;
bottom: 4rpx;
left: 10rpx;
position: absolute;
border-radius: 8rpx;
transition: all .2s ease-in-out;
overflow: hidden;
z-index: 1;
}
.tabs{
border-radius: 16rpx;
font-size: 28rpx;
color: #318AFE;
z-index: 2;
.active-block{
background-color: $my-main-color;
color: #fff;
top: 4rpx;
bottom: 4rpx;
left: 0;
position: absolute;
border-radius: 8rpx;
transition: all .2s ease-in-out;
overflow: hidden;
z-index: 1;
}
.item{
padding: 8rpx 0;
transition: all .3s ease-in-out;
transition: all .2s ease-in-out;
position: relative;
background-color: transparent;
z-index: 2;
}
.item.active{
border-radius: 8rpx 8rpx 8rpx 8rpx;
background-color: $my-main-color;
border-radius: 8rpx;
// background-color: $my-main-color;
color: #fff;
}
}

View File

@ -0,0 +1,33 @@
import http from './http.js'
const request=http.request
/**
* 增加打印机
* @returns
*/
export function tbPrintMachine(data, method = 'post') {
return request({
url: '/api/tbPrintMachine',
method: method,
data: {
shopId: uni.getStorageSync('shopId'),
...data
}
})
}
/**
* 打印机列表
* @returns
*/
export function tbPrintMachineGet(params) {
return request({
url: '/api/tbPrintMachine',
method: 'get',
params: {
shopId: uni.getStorageSync('shopId'),
sort: '',
...params
}
})
}

View File

@ -0,0 +1,216 @@
<template>
<view class="page-gray color-333 u-font-28">
<view class="block">
<picker-item title="打印机类型" v-model="brands.selIndex" rangeKey="name" :list="brands.list"></picker-item>
<view class="u-p-b-24 u-m-b-24 border-bottom">
<view class="title">设备尺寸</view>
<view class="u-m-t-16">
<radio-group class="u-flex u-flex-wrap" @change="sizeChange">
<label class="radio u-m-r-60" v-for="(item,index) in deciveSize.list" :key="index">
<radio :value="''+index" :checked="index === deciveSize.selIndex" class="scale7" />
<text>{{item.label}}</text>
</label>
</radio-group>
</view>
</view>
<view class="u-p-b-14 u-m-b-24 border-bottom">
<view class="title">名称</view>
<view class="">
<uni-easyinput :inputBorder="false" :padding-none="true" v-model="form.form"
placeholder="设置打印机名称"></uni-easyinput>
</view>
</view>
<view class="u-p-b-14 u-m-b-24 border-bottom">
<view class="title">设备号</view>
<view class="">
<uni-easyinput :inputBorder="false" :padding-none="true" v-model="form.form"
placeholder="输入设备号"></uni-easyinput>
</view>
</view>
<picker-item title="打印份数" v-model="printerNums.selIndex" rangeKey="label"
:list="printerNums.list"></picker-item>
<picker-item title="出品模式" v-model="form.config.model" rangeKey="name" rangeValue="value"
:list="models"></picker-item>
<picker-item title="打印类型" v-model="form.subType" rangeKey="name" rangeValue="value"
:list="subTypes"></picker-item>
<picker-item title="尾部留空"
v-model="form.config.feet" rangeKey="name" rangeValue="value"
:list="feets"></picker-item>
<view class="u-p-b-24 u-flex u-row-between u-m-b-24 border-bottom">
<view class="title">自动切刀</view>
<view class="">
<my-switch v-model="form.config.autoCut"></my-switch>
</view>
</view>
<view class="u-p-b-24 u-flex u-row-between u-m-b-24 border-bottom">
<view class="title">状态</view>
<view class="">
<my-switch v-model="form.config.autoCut"></my-switch>
</view>
</view>
<view class="u-p-b-24 u-flex u-row-between u-m-b-24 border-bottom">
<view class="title">排序</view>
<view class="">
<uni-number-box v-model="form.sort" ></uni-number-box>
</view>
</view>
<view class="u-p-b-24 u-m-b-24 border-bottom">
<view class="title font-bold">商品分类</view>
<view class="u-m-t-16 u-flex u-row-between " @click="categoryShow">
<view class="color-333" v-if="form.sort">{{form.sort}}</view>
<view class="color-999" v-else>请选择</view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
</view>
<view style="height: 60rpx;"></view>
<view class="">
<view class="btn">
<my-button shape="circle" @click="save">保存</my-button>
</view>
</view>
<!-- 选择分类 -->
<choose-category v-model="chooseCategoryShow"></choose-category>
</view>
</template>
<script setup>
import {
devices,
models,
subTypes
} from '@/pagePrinter/devices.js'
import {
onLoad,
onShow
} from '@dcloudio/uni-app'
import {
ref,
onBeforeUnmount,
reactive,
computed,
watch
} from 'vue';
import go from '@/commons/utils/go.js';
import pickerItem from './components/picker-item.vue';
import myRadioGroup from './components/my-radio-group.vue';
import * as Api from '@/http/yskApi/devices.js'
import chooseCategory from './components/choose-category.vue';
//
let chooseCategoryShow=ref(false)
function categoryShow(){
chooseCategoryShow.value=true
}
//
const brands = reactive({
list: devices,
selIndex: '',
})
//
const deciveSize = reactive({
list: [{
label: '58mm',
value: '0'
},
{
label: '80mm',
value: '1'
},
],
selIndex: 1
})
function sizeChange(e) {
deciveSize.selIndex = e.detail.value
}
//
const printerNums = reactive({
list: new Array(4).fill(1).map((v, index) => {
return {
label: index * 1 + 1 + '份',
value: '' + index
}
}),
selIndex: 0
})
//
const feets = ref([0,1,2,3,4,5,8].map(v=>{
return v+'行'
}))
const form = reactive({
id: '',
contentType: '',
config: {
width: '80mm', //
printerNum: 1, //
categoryList: '', //
model: 'normal', // ,
feet: '0',
autoCut: 0
},
name: '',
subType: 'kitchen', //
status: 0,
sort: ''
})
function save() {
}
watch(() => form.config.model, (newval) => {
console.log(newval);
})
const option = reactive({})
onLoad((opt) => {
console.log(opt);
Object.assign(option, opt)
})
onBeforeUnmount(() => {
})
onShow(() => {})
</script>
<style lang="scss" scoped>
.page-gray {
padding: 32rpx 28rpx;
}
.block {
background-color: #fff;
padding: 32rpx 24rpx;
border-radius: 18rpx;
margin-bottom: 32rpx;
box-shadow: 0 0 5px #eee;
}
.title {
font-weight: 700;
}
.radio {
display: flex;
align-items: center;
}
.fixed_b{
left: 30rpx;
right: 30rpx;
bottom: calc(env(safe-area-inset-bottom) + 10rpx);
/* #ifdef H5 */
bottom: 30rpx;
/* #endif */
}
</style>

View File

@ -0,0 +1,46 @@
<template>
<my-mask :show="modelValue">
<view class="bg-fff content">
<view class="u-flex u-row-between u-p-30">
<view>选择分类</view>
<view>
<uni-icons @click="changeShow" type="closeempty"></uni-icons>
</view>
</view>
<scroll-view scroll-y="true" style="height: 70vh;">
</scroll-view>
<view class="u-flex u-row-between gap-20 u-p-30">
<view class="u-flex-1">
<my-button type="cancel" @tap="changeShow">取消</my-button>
</view>
<view class="u-flex-1">
<my-button>确定</my-button>
</view>
</view>
</view>
</my-mask>
</template>
<script setup>
const props=defineProps({
modelValue:{
type: Boolean,
default: false
}
})
const emits=defineEmits(['update:modelValue'])
function changeShow(isShow){
const show=isShow?true:false
emits('update:modelValue',show)
}
</script>
<style lang="scss" scoped>
.content{
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
</style>

View File

@ -0,0 +1,70 @@
<template>
<radio-group class="u-flex u-flex-wrap" @change="change">
<label class="radio u-m-r-60" v-for="(item,itemIndex) in list" :key="index">
<radio :value="index" :checked="itemChecked(item,itemIndex)" class="scale7" />
<text>{{item.label}}</text>
</label>
</radio-group>
</template>
<script setup>
import {
computed,
ref,
watch
} from 'vue';
const props = defineProps({
rangeValue: {
type: [String, Number],
default: ''
},
rangeKey: {
type: String,
default: 'label'
},
list: {
type: Array,
default: () => []
},
title: {
type: String,
default: '标题'
},
modelValue: {
type: [String, Number],
default: ''
}
})
function itemChecked(item,itemIndex){
if(!props.rangeValue){
return itemIndex==index.value
}
return item[props.rangeValue]=props.list[index.value][props.rangeKey]
}
function findIndex() {
return props.list.findIndex(v => v[props.rangeValue] == props.modelValue)
}
function findValue() {
return props.list[index.value][props.rangeValue]
}
const computedIndex = props.rangeValue ? findIndex() : props.modelValue
const index = ref(computedIndex)
const emits = defineEmits(['update:modelValue'], )
watch(() => index.value, (newval) => {
const value = props.rangeValue ? findValue() : newval
console.log(value);
emits('update:modelValue', value)
})
function change(e) {
index.value = e.detail.value
}
const selText = computed(() => {
const item = props.list[index.value]
return item ? item[props.rangeKey] : ''
})
</script>
<style>
</style>

View File

@ -0,0 +1,87 @@
<template>
<view class="u-p-b-24 u-m-b-24 border-bottom">
<view class="title font-bold">{{title}}</view>
<picker
@change="change"
:range-key="rangeKey"
:value="index"
:range="list">
<view class="u-m-t-16 u-flex u-row-between ">
<view class="color-333" v-if="selText">{{selText}}</view>
<view class="color-999" v-else>请选择</view>
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</picker>
</view>
</template>
<script setup>
import {
computed,
ref, watch
} from 'vue';
const props = defineProps({
rangeValue:{
type: [String, Number],
default: ''
},
rangeKey:{
type:String,
default:'label'
},
list: {
type: Array,
default: () => []
},
title: {
type: String,
default: '标题'
},
modelValue: {
type: [String, Number],
default: ''
}
})
function isObj(obj){
return typeof obj ==='object'
}
function findIndex(){
return props.list.findIndex(v=>{
if(isObj(v)){
return v[props.rangeValue]==props.modelValue
}else{
return v==props.modelValue
}
})
}
function findValue(){
const item=props.list[index.value]
if(isObj(item)){
return item[props.rangeValue]
}else{
return item
}
}
const computedIndex=props.rangeValue? findIndex(): props.modelValue
const index = ref(computedIndex)
const emits = defineEmits(['update:modelValue'], )
watch(()=>index.value,(newval)=>{
const value=props.rangeValue?findValue() :newval
console.log(value);
emits('update:modelValue',value)
})
function change(e){
index.value=e.detail.value
}
const selText=computed(()=>{
const item=props.list[index.value]
if(item&&isObj(item)){
return item?item[props.rangeKey]:''
}else{
return item
}
})
</script>
<style>
</style>

View File

@ -0,0 +1,44 @@
export const devices = [
{
value: 'printer',
name: '本地'
},
{
value: 'yxyPrinter',
name: '云想印'
},
{
value: 'fePrinter',
name: '飞鹅'
}
]
export const models = [
{
value: 'normal',
name: '普通出单'
},
{
value: 'one',
name: '一菜一品'
},
{
value: 'category',
name: '分类出单'
}
]
export const subTypes = [
{
value: 'kitchen',
name: '出品'
},
{
value: 'cash',
name: '小票'
},
{
value: 'label',
name: '标签'
}
]

View File

@ -0,0 +1,106 @@
<template>
<view class="default-box-padding bg-fff u-font-28 border-r-12 box-shadow u-m-b-30">
<view class="u-flex u-row-between u-p-b-24 border-bottom">
<view class="u-flex">
<!-- <text>{{ subTypesName(data.subType)}}</text> -->
<text>{{ data.name}}</text>
<text class="color-999 u-font-24">{{data.address}}</text>
</view>
<view class="u-flex u-col-center">
<template v-if="data.status">
<text class="online" >在线状态正常</text>
</template>
<template v-else>
<image class="icon-warning" src="/pagePrinter/static/icon/icon-warning.svg" mode=""></image>
<text class="leave u-m-l-10" >离线</text>
</template>
</view>
</view>
<view class="u-m-t-24">
<view class="u-flex u-row-between">
<view class="u-flex u-col-center">
<image class="icon" src="/pagePrinter/static/icon/icon-setting.svg" mode=""></image>
<view class="color-666 u-m-l-10">设置</view>
</view>
<view>
{{modelsName(data.config.model)}}
</view>
</view>
<view class="u-flex u-row-between u-m-t-32">
<view class="u-flex u-col-center">
<image class="icon" src="/pagePrinter/static/icon/icon-type.svg" mode=""></image>
<view class="color-666 u-m-l-10">类型</view>
</view>
<view>
{{subTypesName(data.subType)}}
</view>
</view>
<view class="u-flex u-row-between u-m-t-32">
<view class="u-flex u-col-center">
<image class="icon" src="/pagePrinter/static/icon/icon-category.svg" mode=""></image>
<view class="color-666 u-m-l-10">分类</view>
</view>
<view>
{{devicesName(data.contentType)}}
</view>
</view>
<view class="u-m-t-32 u-flex u-row-right gap-20">
<my-button shape="circle" :width="140" :height="56" type="cancel" plain>删除</my-button>
<my-button shape="circle" :width="140" :height="56" plain>编辑</my-button>
</view>
</view>
</view>
</template>
<script setup>
import { devices, models, subTypes } from '@/pagePrinter/devices.js'
const props = defineProps({
data: {
type: Object,
default: () => {}
}
})
function devicesName(value) {
return devices.find(item => item.value == value).name
}
function modelsName(value) {
return models.find(item => item.value == value).name
}
function subTypesName(value) {
return subTypes.find(item => item.value == value).name
}
function timeFilter(s) {
return dayjs(s).format('YYYY-MM-DD HH:mm:ss')
}
</script>
<style lang="scss" scoped>
.border-bottom{
border-bottom: 1px solid rgb(240,240,240);
}
.box-shadow {
box-shadow: 0 0 5px #eee;
}
.online{
color: #0FC161;
}
.leave{
color:#999 ;
}
.icon-warning{
width: 34rpx;
height: 30rpx;
}
.icon{
width: 24rpx;
height: 24rpx;
}
</style>

View File

@ -0,0 +1,63 @@
<template>
<view class="min-page bg-gray u-p-30 u-flex u-flex-col u-row-center">
<div class="w-full" v-for="item in pageData.list " :key="item.id">
<printer-item :data="item"></printer-item>
</div>
<view v-if="!pageData.list.length&&pageData.hasAjax">
<my-img-empty ></my-img-empty>
</view>
<view style="height: 100rpx;"></view>
<view class="fixed_b u-fixed">
<my-button shape="circle" @tap="toAdd">
<view>
<text>+</text>
<text>添加云打印机</text>
</view>
</my-button>
</view>
</view>
</template>
<script setup>
import go from '@/commons/utils/go.js'
import {
onMounted,
reactive
} from 'vue';
import printerItem from './components/printer-item.vue';
import * as Api from '@/http/yskApi/devices.js'
const pageData = reactive({
list: [],
hasAjax:false,
query: {
sort: '',
name: '',
contentType: ''
}
})
function toAdd(){
go.to('PAGES_PRINTER_ADD',{
a:1
})
}
async function init() {
const res =await Api.tbPrintMachineGet(pageData.query)
pageData.hasAjax=true
console.log(res);
pageData.list = res.filter(v=>v.address)
}
onMounted(() => {
init()
})
</script>
<style lang="scss" scoped>
.fixed_b{
left: 110rpx;
right: 110rpx;
bottom: calc(env(safe-area-inset-bottom) + 10rpx);
/* #ifdef H5 */
bottom: 30rpx;
/* #endif */
}
</style>

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12"><defs><style>.a{fill:#ebd4d4;}.b{clip-path:url(#a);}.c{fill:#666;}</style><clipPath id="a"><circle class="a" cx="6" cy="6" r="6" transform="translate(94 212)"/></clipPath></defs><g class="b" transform="translate(-94 -212)"><path class="c" d="M71.825,64a.672.672,0,0,1,.711.711v.711h.711a.672.672,0,0,1,.711.711v4.98a.672.672,0,0,1-.711.711h-.711v1.423a.672.672,0,0,1-.711.711H66.134a.672.672,0,0,1-.711-.711V71.825h-.711A.672.672,0,0,1,64,71.114v-4.98a.672.672,0,0,1,.711-.711h.711v-.711A.672.672,0,0,1,66.134,64Zm0,5.691H66.134v3.557h5.691Zm1.423-3.557H64.711v4.98h.711V69.691a.672.672,0,0,1,.711-.711h5.691a.672.672,0,0,1,.711.711v1.423h.711Zm-.711.711v.711h-.711v-.711Zm-.711-2.134H66.134v.711h5.691Z" transform="translate(31.02 149.02)"/></g></svg>

After

Width:  |  Height:  |  Size: 878 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12"><defs><style>.a{fill:#ebd4d4;}.b{clip-path:url(#a);}.c{fill:#666;}</style><clipPath id="a"><circle class="a" cx="6" cy="6" r="6" transform="translate(107 189)"/></clipPath></defs><g class="b" transform="translate(-107 -189)"><path class="c" d="M11.347,4.3c-.067-.354-.283-.583-.551-.583h-.058a1.4,1.4,0,0,1-1.4-1.4,1.6,1.6,0,0,1,.122-.535.736.736,0,0,0-.248-.89L9.192.875,7.77.085,7.752.077a.751.751,0,0,0-.3-.061.814.814,0,0,0-.579.236A2.054,2.054,0,0,1,5.764.873,2.058,2.058,0,0,1,4.648.241.814.814,0,0,0,4.065,0a.75.75,0,0,0-.3.059L3.751.066,2.279.875,2.261.887a.735.735,0,0,0-.25.889,1.585,1.585,0,0,1,.123.536,1.4,1.4,0,0,1-1.4,1.4H.672c-.267,0-.483.229-.55.583A7.288,7.288,0,0,0,0,5.421a7.287,7.287,0,0,0,.12,1.123c.067.354.283.583.551.583H.731a1.4,1.4,0,0,1,1.4,1.4,1.6,1.6,0,0,1-.122.535.737.737,0,0,0,.248.89l.017.012,1.4.78.018.008a.742.742,0,0,0,.3.061.8.8,0,0,0,.583-.246A2.053,2.053,0,0,1,5.7,9.91a2.071,2.071,0,0,1,1.14.673.8.8,0,0,0,.587.251h0a.741.741,0,0,0,.3-.059l.018-.008,1.446-.8.017-.012a.736.736,0,0,0,.249-.889,1.614,1.614,0,0,1-.123-.536,1.4,1.4,0,0,1,1.4-1.4H10.8c.268,0,.484-.229.551-.583a7.223,7.223,0,0,0,.12-1.123A7.259,7.259,0,0,0,11.347,4.3ZM4,10.006l-1.22-.682A2.331,2.331,0,0,0,2.94,8.53,2.208,2.208,0,0,0,.9,6.328a6.122,6.122,0,0,1-.094-.906A6.136,6.136,0,0,1,.9,4.515a2.207,2.207,0,0,0,2.038-2.2,2.33,2.33,0,0,0-.163-.792l1.3-.713h0a3.876,3.876,0,0,0,.493.418,2.1,2.1,0,0,0,1.2.454A2.106,2.106,0,0,0,6.95,1.234a3.857,3.857,0,0,0,.49-.41h0l1.252.7a2.332,2.332,0,0,0-.163.793,2.207,2.207,0,0,0,2.038,2.2,6.154,6.154,0,0,1,.094.907,6.13,6.13,0,0,1-.094.907,2.207,2.207,0,0,0-2.038,2.2,2.329,2.329,0,0,0,.163.793l-1.267.7a3.935,3.935,0,0,0-.495-.437A2.1,2.1,0,0,0,5.7,9.1a2.1,2.1,0,0,0-1.216.473A3.966,3.966,0,0,0,4,10.006ZM7.74,5.414a2.03,2.03,0,1,0-2.03,2.03A2.033,2.033,0,0,0,7.74,5.414ZM5.71,4.189A1.225,1.225,0,1,1,4.485,5.414,1.226,1.226,0,0,1,5.71,4.189Z" transform="translate(107.266 189.583)"/></g></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12"><defs><style>.a{fill:#ebd4d4;}.b{clip-path:url(#a);}.c{fill:#666;}</style><clipPath id="a"><circle class="a" cx="6" cy="6" r="6" transform="translate(92 207)"/></clipPath></defs><g class="b" transform="translate(-92 -207)"><g transform="translate(8.104 122.991)"><path class="c" d="M94.819,87.957,90.794,89.44a1.178,1.178,0,0,1-.8,0L85.816,87.96a.738.738,0,0,1,0-1.4l4.179-1.485a1.177,1.177,0,0,1,.8,0l4.025,1.483a.738.738,0,0,1,0,1.392Zm-.262-.713-4.025-1.483a.42.42,0,0,0-.284,0l-4.179,1.485a.014.014,0,0,0-.012.017.014.014,0,0,0,.012.017l4.179,1.485a.417.417,0,0,0,.284,0l4.025-1.483a.014.014,0,0,0,.012-.016.014.014,0,0,0-.012-.018Zm-8.742,5.4,4.421,1.6a.457.457,0,0,0,.315,0l4.259-1.6a.37.37,0,1,1,.262.692l-4.259,1.6a1.208,1.208,0,0,1-.422.076,1.2,1.2,0,0,1-.409-.072l-4.422-1.6a.37.37,0,1,1,.254-.695Z" transform="translate(-0.414)"/><path class="c" d="M89.978,501.885a1.2,1.2,0,0,1-.409-.072l-4.422-1.6a.37.37,0,1,1,.253-.7l4.421,1.6a.459.459,0,0,0,.315,0l4.259-1.6a.37.37,0,0,1,.262.692l-4.259,1.6a1.2,1.2,0,0,1-.421.077Z" transform="translate(0 -409.627)"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="17.37" height="15" viewBox="0 0 17.37 15"><defs><style>.a{fill:#ff9f2e;}</style></defs><path class="a" d="M104.051,176.877h17.37l-8.684-15Zm9.474-2.369h-1.579V172.93h1.579Zm0-3.157h-1.579v-3.158h1.579Z" transform="translate(-104.051 -161.877)"/></svg>

After

Width:  |  Height:  |  Size: 298 B

View File

@ -21,7 +21,7 @@
</view>
<view class="u-m-t-24">
{{item.selectSpecResult}}
<uni-data-checkbox @change="createResult" multiple :selectedColor="color.ColorMain"
v-model="item.selectSpecResult" :localdata="item.value"></uni-data-checkbox>

View File

@ -3,7 +3,7 @@
<view class="my-bg-main" :style="{'background-color':returnStutasColor(data.status)}">
<view class="u-flex u-row-between">
<view class="u-font-32 ">{{data.name}}</view>
<view class="u-flex" @tap="more">
<view class="u-flex" @tap.stop="more">
<uni-icons type="more-filled" color="#fff" size="16"></uni-icons>
</view>
</view>

View File

@ -21,7 +21,8 @@
<view class="search-box">
<view class="search-btn u-flex" @tap="showSearch" :style="{width:search.show?'694rpx':'164rpx'}">
<image src="@/static/iconImg/icon-search.svg" class="input-icon" />
<view class="u-flex-1 u-p-l-10"><input v-model="search.keyword" @confirm="searchConfirm" type="text"
<view class="u-flex-1 u-p-l-10">
<input v-model="search.keyword" @confirm="searchConfirm" type="text"
placeholder-style="font-size:28rpx;" placeholder="搜索" /></view>
<view @tap.stop="hideSearch" v-if="search.show">取消</view>
</view>
@ -54,22 +55,6 @@
<view class="u-m-t-10">0/12</view>
</view>
</view>
<!-- <view class=" u-p-l-28 item" >
<view>室内</view>
<view class="u-m-t-10 ">0/12</view>
</view>
<view class="item u-p-l-28">
<view>室外</view>
<view class="u-m-t-10">0/12</view>
</view>
<view class="item u-p-l-28">
<view>小桌</view>
<view class="u-m-t-10">0/12</view>
</view>
<view class="item u-p-l-28">
<view>测试桌</view>
<view class="u-m-t-10">0/12</view>
</view> -->
</view>
<view class="u-m-t-30 u-flex u-flex-wrap u-row-between">
@ -341,6 +326,10 @@
return v.status == status.list[status.active].key
});
})
watch(() => times.active, (newval) => {
setTimer()
})
function tableUpdate() {
query.page = 0
@ -364,7 +353,7 @@
setTimer()
})
onHide(()=>{
clearInterval(timer)
})
onShow(opt => {
setTimer()

View File

@ -23,16 +23,16 @@
<view class="u-p-30">
<view class="data-statistics">
<view class="u-font-32">数据统计</view>
<view class="u-m-t-40 u-flex">
<view class="u-flex-1 after-r">
<view class="u-m-t-40 u-flex u-row-between">
<view class=" ">
<view>会员数</view>
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.userTotal}}</view>
</view>
<view class="u-flex-1 after-r">
<view class="line-l-r u-p-l-30 u-p-r-30">
<view>会员余额</view>
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.balanceTotal}}</view>
</view>
<view class="u-flex-1">
<view class="">
<view>充值金额</view>
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.chageTotal}}</view>
</view>
@ -367,14 +367,31 @@
}
</style>
<style lang="scss" scoped>
.after-r {
.after-r,.after-l {
position: relative;
}
.line-l-r{
position: relative;
&::after,&:before{
position: absolute;
content: '';
top: 0;
bottom: 0;
width: 2px;
border-radius: 2px;
background-color: rgba(255, 255, 255, .3);
}
&::after{
right: 0;
}
&::before{
left: 0;
}
}
.after-r::after {
position: absolute;
content: '';
right: 40rpx;
right: -40rpx;
top: 0;
bottom: 0;
width: 2px;

View File

@ -1002,6 +1002,14 @@
{
"navigationBarTitleText" : "订单详情"
}
},
{
"pageId": "PAGES_CRESATE_ORDER_PAY",
"path" : "pay-order/pay-order",
"style" :
{
"navigationBarTitleText" : "结账"
}
}
]
@ -1194,6 +1202,27 @@
"navigationBarTitleText" : "记录详情"
}
}]
},{
"root": "pagePrinter",
"pages": [{
"pageId": "PAGES_PRINTER_INDEX",
"path" : "index/index",
"style" :
{
"navigationBarTitleText" : "打印机"
}
},
{
"pageId": "PAGES_PRINTER_ADD",
"path" : "add-printer/add-printer",
"style" :
{
// "navigationBarTitleText" : "添加/编辑云打印机"
"navigationBarTitleText" : ""
}
}
]
}
],
"globalStyle": {

View File

@ -89,6 +89,11 @@
icon: '/static/indexImg/icon-substitute-ordering.svg',
pageUrl: 'PAGES_CREATE_ORDER',
},
{
title: '打印机',
icon: '/static/indexImg/icon-printer.svg',
pageUrl: 'PAGES_PRINTER_INDEX',
},
{
title: '进销存',
icon: '/static/indexImg/icon-invoicing.svg',

View File

@ -9,9 +9,10 @@
</view>
</view>
<view class="u-m-t-40 u-flex ">
<view>应付金额</view>
<view>实收金额</view>
<view class="u-m-l-32 border-bottom u-flex-1">
<uni-easyinput style="digit" @input="currentPriceChange" paddingNone :inputBorder="false" v-model="form.currentPrice"
<uni-easyinput style="digit" @input="currentPriceInput" @change="currentPriceChange" paddingNone :inputBorder="false"
v-model="form.currentPrice"
placeholder="输入实际金额"></uni-easyinput>
</view>
</view>
@ -19,7 +20,8 @@
<view>优惠折扣</view>
<view class="u-m-l-32 u-flex-1 u-flex border-bottom">
<view class="u-flex-1">
<uni-easyinput @input="discountChange" style="digit" paddingNone :inputBorder="false" v-model="form.discount"
<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>
@ -32,7 +34,7 @@
<view class="u-p-30">
<view class="u-m-t-10">
<my-button @tap="confirm" shape="circle" showShadow>修改</my-button>
<my-button type="cancel" bgColor="#fff" >取消</my-button>
<my-button @tap="close" type="cancel" bgColor="#fff" >取消</my-button>
</view>
</view>
</template>
@ -43,11 +45,12 @@
import {
reactive,
nextTick,
ref
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,
@ -57,23 +60,42 @@
type: Array,
default: []
},
price:{
type:Number,
default:0
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){
nextTick(()=>{
form.discount=(newval*100/form.price).toFixed()
})
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){
nextTick(()=>{
form.currentPrice=(form.price*newval/100).toFixed(2)
})
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,
@ -82,7 +104,11 @@
const form = reactive({
...$form
})
watch(()=>props.price,(newval)=>{
console.log(newval);
form.price=newval
form.currentPrice=newval
})
function resetForm() {
Object.assign(form, {
...$form

View File

@ -78,12 +78,17 @@
import {
reactive,
nextTick,
ref
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'
const props = defineProps({
price: {
type: [Number,String],
default: 0
},
title: {
type: String,
default: ''
@ -93,7 +98,9 @@
default: []
}
})
function changeCauses(item) {
item.checked = !item.checked
}
@ -151,7 +158,11 @@
const form = reactive({
...$form
})
watch(()=>props.price,(newval)=>{
console.log(newval);
form.price=newval
form.currentPrice=newval
})
function resetForm() {
Object.assign(form, {
...$form

View File

@ -207,10 +207,10 @@
</view>
<model-discount title="菜品打折/减免" :ref="setModel" name="discount"></model-discount>
<model-discount title="菜品打折/减免" :ref="setModel" name="discount" :price="allPrice"></model-discount>
<give-food title="赠菜" :ref="setModel" name="giveFood"></give-food>
<my-remark title="单品备注" :ref="setModel" name="remark"></my-remark>
<edit-discount title="优惠金额" :ref="setModel" name="editMoney"></edit-discount>
<edit-discount title="优惠金额" :ref="setModel" name="editMoney" :price="allPrice"></edit-discount>
</view>
@ -230,7 +230,7 @@
import modelDiscount from './components/discount'
import giveFood from './components/give-food'
import myRemark from './components/remark'
import editDiscount from './components/edit-discount'
import editDiscount from '@/pagesCreateOrder/components/edit-discount.vue'
import go from '@/commons/utils/go.js';
import {
returnBoolean
@ -362,7 +362,6 @@
})
const allPrice = computed(() => {
return goods.list.reduce((prve, cur) => {
console.log(cur.salePrice * cur.number);
return prve + cur.salePrice * cur.number * (cur.isGift ? 0 : 1)
}, 0).toFixed(2)
})

View File

@ -1,5 +1,5 @@
<template>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
<view class="default-box-padding bg-fff border-r-12 u-m-t-20" v-if="data.length">
<view class="u-font-32">
<text></text>
<text class="color-main font-bold"> {{goodsNumber}}</text>
@ -39,7 +39,7 @@
</view>
<view>
<text>小计</text>
<text class="font-bold u-font-32">16.00</text>
<text class="font-bold u-font-32">{{allPrice}}</text>
</view>
</view>
@ -47,10 +47,12 @@
<view></view>
<view>
<text>总计</text>
<text class="font-bold u-font-32">16.00</text>
<text class="font-bold u-font-32">{{allPrice}}</text>
</view>
</view>
<my-button type="cancel" :color="color.ColorMain">重新打印</my-button>
<view class="u-m-t-30">
<my-button type="cancel" :color="color.ColorMain">重新打印</my-button>
</view>
</view>
</view>
</template>
@ -86,7 +88,9 @@
width: 70rpx;
height: 70rpx;
}
.border-bottom{
border-color: rgb(240, 240, 240);
}
.tag {
padding: 2rpx 8rpx;
border-radius: 8rpx;

View File

@ -2,7 +2,7 @@
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
<view class="u-flex u-row-between">
<view>订单状态</view>
<view>未支付</view>
<view>{{returnStatus(data.status)}}</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>订单类型</view>
@ -10,7 +10,7 @@
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>桌位号</view>
<view>A6</view>
<view>{{table.name}}</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>就餐人数</view>
@ -28,10 +28,6 @@
<view>下单时间</view>
<view>2024-08-31 15:54:40</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>下单时间</view>
<view>2024-08-31 15:54:40</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view>订单编号</view>
<view>2024083115544056362</view>
@ -44,6 +40,23 @@
</template>
<script setup>
const props = defineProps({
data: {
type: Object,
default: () => {}
},
table:{
type: Object,
default: () => {}
}
})
const statusMap={
unpaid:'未支付'
}
function returnStatus(status){
return statusMap[status]||''
}
</script>
<style lang="scss" scoped>

View File

@ -3,10 +3,10 @@
<user-vue></user-vue>
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
<text class="color-666">桌位号</text>
<text class="font-bold">A6</text>
<text class="font-bold">{{options.name}}</text>
</view>
<goods-list :data="orderDetail.goodsList"></goods-list>
<order-vue></order-vue>
<order-vue :data="orderDetail.info" :table="options"></order-vue>
<step-vue></step-vue>
<view style="height: 200rpx;"></view>
<view class="u-fixed bottom bg-fff ">
@ -16,7 +16,8 @@
shape="circle" plain type="primary">加菜</my-button>
</view>
<view class="u-flex-1">
<my-button borderRadius="0 100rpx 100rpx 0" shape="circle" type="primary" >结账</my-button>
<my-button @tap="toPay" borderRadius="0 100rpx 100rpx 0" shape="circle"
type="primary">结账</my-button>
</view>
</view>
</view>
@ -31,36 +32,76 @@
import stepVue from './components/step.vue';
import go from '@/commons/utils/go.js'
import {
onLoad,onHide
onLoad,
onShow,
onHide
} from '@dcloudio/uni-app';
import {
reactive
} from 'vue';
import OrderDetail from './page.js'
const uiPage=new OrderDetail()
setTimeout(()=>{
uiPage.setVal('user',{name:1})
},1500)
const uiPage = new OrderDetail()
setTimeout(() => {
uiPage.setVal('user', {
name: 1
})
}, 1500)
function diancan() {
go.to('PAGES_CREATE_ORDER', {
tableId: options.tableId,
tableName: options.name
})
}
const orderDetail=reactive({
goodsList:[]
function toPay() {
go.to('PAGES_CRESATE_ORDER_PAY', {
...orderDetail.info,
tableId: options.tableId,
tableName: options.name,
masterId: options.masterId,
})
}
const orderDetail = reactive({
goodsList: [],
info: {}
})
const options = reactive({})
async function init(){
const {masterId}=await Api.$getMasterId(options)
async function init() {
const {
masterId
} = await Api.$getMasterId(options)
console.log(masterId);
const {records} = await Api.getCart({
...options,masterId
options.masterId=masterId
const {
records
} = await Api.getCart({
...options,
masterId
})
orderDetail.goodsList=records
orderDetail.goodsList = records
const info = await Api.$createOrder({
masterId,
vipUserId: '',
tableId: options.tableId,
note: '',
postPay: true,
orderld: ''
})
orderDetail.info = info
}
function watchEmit(){
uni.$off('orderDetail:update')
uni.$once('orderDetail:update',(newval)=>{
console.log(newval);
init()
})
}
onShow(()=>{
watchEmit()
})
onLoad((opt) => {
Object.assign(options, opt)
console.log(options);

View File

@ -0,0 +1,209 @@
<template>
<view class="bg-gray min-page u-p-30 u-font-28">
<view class="u-p-t-60 u-p-b-60 u-text-center">
<view class="u-font-32 ">
<text class="price-fuhao"></text>
<text class="font-bold price">{{order.amount}}</text>
</view>
<view class="u-m-t-10 color-999 old-price">
<text class=""></text>
<text class=" ">{{order.amount}}</text>
</view>
<view class="u-m-t-10 u-flex u-row-center color-main">
<view @click="showModel('editMoney',true)">修改</view>
</view>
</view>
<view class="bg-fff box-shadow u-p-t-30 u-p-l-50 u-p-r-50 card top border-r-12 u-m-t-30">
<view class="u-flex border-bottom-dashed u-row-between u-p-b-30">
<view>优惠券</view>
<view class="color-999 u-flex u-col-center">
<text>选择优惠券</text>
<view class="u-flex u-col-center">
<uni-icons type="right"></uni-icons>
</view>
</view>
</view>
</view>
<view class="bg-fff box-shadow u-p-t-30 u-p-l-50 u-p-r-50 card bottom border-r-12 ">
<my-tabs :list="pays.list"></my-tabs>
<view class="list">
<view class="item" @click="changePayType(index)" v-for="(item,index) in pays.payTypes.list"
:key="index">
<view class="u-flex u-row-between u-p-t-30 u-p-b-30 border-bottom">
<view class="u-flex">
<image class="icon" :src="item.icon" mode=""></image>
<text class="u-m-l-10">{{item.payName}}</text>
</view>
<view class="u-flex color-999 u-font-24">
<!-- <view class="u-m-r-20">
<text>余额</text>
<text>0.00</text>
</view> -->
<my-radio @click="changePayType(index)" :modelValue="index==pays.payTypes.selIndex">
</my-radio>
</view>
</view>
</view>
</view>
</view>
<view class="u-m-t-60 u-p-b-30">
<my-button @click="payOrder">确认付款</my-button>
</view>
<edit-discount title="优惠金额" :ref="setModel" name="editMoney" :price="order.amount"></edit-discount>
</view>
</template>
<script setup>
import {
reactive,
onMounted
} from 'vue';
import {
onLoad
} from '@dcloudio/uni-app'
import * as Api from '@/http/yskApi/Instead.js'
import infoBox from '@/commons/utils/infoBox.js'
import editDiscount from '@/pagesCreateOrder/components/edit-discount.vue'
const pays = reactive({
list: ['普通支付', '混合支付'],
payTypes: {
list: [],
selIndex: 0
}
})
const models = new Map();
function setModel(el) {
if (el && el.$attrs['name']) {
models.set(el.$attrs['name'], el);
}
}
function showModel(key) {
const model = models.get(key)
model && model.open()
}
async function getPayType() {
const payTypeList = await Api.$getPayType()
pays.payTypes.list = payTypeList.filter(v=>v.payType!='scanCode')
}
function changePayType(i) {
pays.payTypes.selIndex = i
}
async function payOrder() {
const payType=pays.payTypes.list[pays.payTypes.selIndex].payType
await Api.$payOrder({
tableId: order.tableId,
masterId: order.masterId,
orderId: order.id,
payType,
vipUserId: order.userId,
discount: 1,
code: ''
})
infoBox.showToast('支付成功')
setTimeout(()=>{
uni.$emit('orderDetail:update')
uni.navigateBack()
},500)
}
onMounted(() => {
getPayType()
})
const order = reactive({
amount: 0
})
onLoad((opt) => {
Object.assign(order, opt)
})
</script>
<style lang="scss" scoped>
.box-shadow {
box-shadow: 0 0 5px #eee;
}
.icon {
width: 40rpx;
height: 40rpx;
}
.border-bottom-dashed {
border-bottom: 1px dashed #bbb;
}
.border-bottom {
border-color: rgb(240, 240, 240);
}
.list {
.item:last-child {
.border-bottom {
border-bottom: none;
}
}
}
.old-price {
text-decoration: line-through;
}
.price-fuhao {
font-size: 24px;
}
.price {
font-size: 32px;
}
$dotSize: 20rpx;
$position: calc($dotSize / (-2));
.card {
position: relative;
&::after,
&:before {
content: '';
display: block;
position: absolute;
background-color: #F9F9F9;
width: $dotSize;
height: $dotSize;
box-shadow: 0 0 5px #eee;
border-radius: 50%;
}
&.top {
&::after {
right: $position;
bottom: $position;
}
&:before {
left: $position;
bottom: $position;
}
}
&.bottom {
&::after {
right: $position;
top: $position;
}
&:before {
left: $position;
top: $position;
}
}
}
</style>

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32"><defs><style>.a{fill:#80bcff;}.b{clip-path:url(#a);}.c{fill:#4c99fe;}.d{fill:#fff;}.e{fill:#197dff;}</style><clipPath id="a"><rect class="a" width="32" height="32" transform="translate(290 721)"/></clipPath></defs><g class="b" transform="translate(-290 -721)"><rect class="c" width="20" height="14" rx="1" transform="translate(296 723)"/><path class="c" d="M7.112,17H3a3,3,0,0,1-3-3V3A3,3,0,0,1,3,0H29a3,3,0,0,1,3,3V14a3,3,0,0,1-3,3h-4.11V12.769a1,1,0,0,0-1-1H8.112a1,1,0,0,0-1,1V17Z" transform="translate(290 733)"/><circle class="d" cx="1" cy="1" r="1" transform="translate(316 739)"/><path class="e" d="M7,14a1,1,0,0,1-1-1V10H26v3a1,1,0,0,1-1,1Z" transform="translate(290 723)"/><rect class="e" width="12" height="2" rx="1" transform="translate(300 746)"/></g></svg>

After

Width:  |  Height:  |  Size: 895 B