Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into test
This commit is contained in:
3
App.vue
3
App.vue
@@ -3,10 +3,7 @@
|
|||||||
App.vue本身不是页面,这里不能编写视图元素,也就是没有<template>
|
App.vue本身不是页面,这里不能编写视图元素,也就是没有<template>
|
||||||
-->
|
-->
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive } from 'vue';
|
|
||||||
import appConfig from '@/config/appConfig.js';
|
|
||||||
import { onLaunch } from '@dcloudio/uni-app';
|
import { onLaunch } from '@dcloudio/uni-app';
|
||||||
import { checkCurrVersion, getExtStoreId } from '@/commons/utils/versionManage.js';
|
|
||||||
|
|
||||||
onLaunch(() => {
|
onLaunch(() => {
|
||||||
// console.log(uni.getExtConfigSync(),'uni.getExtConfigSync()')
|
// console.log(uni.getExtConfigSync(),'uni.getExtConfigSync()')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// 桌台管理
|
// 桌台管理
|
||||||
import http from './http.js'
|
import http from './http.js'
|
||||||
|
const request=http.request
|
||||||
import $API from '@/http/classApi.js'
|
import $API from '@/http/classApi.js'
|
||||||
import appConfig from '@/config/appConfig.js'
|
import appConfig from '@/config/appConfig.js'
|
||||||
import {
|
import {
|
||||||
@@ -11,4 +12,15 @@ import infoBox from '@/commons/utils/infoBox.js'
|
|||||||
export const $tableArea=new $API('/api/tbShopArea',http.req)
|
export const $tableArea=new $API('/api/tbShopArea',http.req)
|
||||||
/* 台桌 */
|
/* 台桌 */
|
||||||
export const $table=new $API('/api/tbShopTable',http.req)
|
export const $table=new $API('/api/tbShopTable',http.req)
|
||||||
|
/* 绑定 */
|
||||||
|
// export const $bind=new $API('/api/tbShopTable/bind',http.req)
|
||||||
|
export function $bind(data) {
|
||||||
|
return request({
|
||||||
|
url: "/api/tbShopTable/bind",
|
||||||
|
method: "post",
|
||||||
|
data: {
|
||||||
|
shopId: uni.getStorageSync('shopId'),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -99,9 +99,6 @@
|
|||||||
import {
|
import {
|
||||||
formatPrice
|
formatPrice
|
||||||
} from "@/commons/utils/format.js";
|
} from "@/commons/utils/format.js";
|
||||||
import {
|
|
||||||
TRUE
|
|
||||||
} from 'sass';
|
|
||||||
|
|
||||||
function priceFormat(item, key, val) {
|
function priceFormat(item, key, val) {
|
||||||
let min = 0;
|
let min = 0;
|
||||||
|
|||||||
@@ -115,12 +115,12 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
* {
|
// * {
|
||||||
padding: 0;
|
// padding: 0;
|
||||||
margin: 0;
|
// margin: 0;
|
||||||
text-decoration: none;
|
// text-decoration: none;
|
||||||
outline: none;
|
// outline: none;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,11 @@
|
|||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="u-flex u-row-center u-m-t-16">
|
<view class="u-flex u-row-center u-m-t-16">
|
||||||
<template v-if="data.tableId">
|
<template v-if="data.tableId">
|
||||||
|
<template v-if="data.status =='unbind' ">
|
||||||
|
<my-button color="#333" :width="200" :height="56" type="default" @click="bind">
|
||||||
|
绑定码牌
|
||||||
|
</my-button>
|
||||||
|
</template>
|
||||||
<template v-if="data.status=='idle'||(data.status=='using'&&!data.orderId) ">
|
<template v-if="data.status=='idle'||(data.status=='using'&&!data.orderId) ">
|
||||||
<my-button color="#333" :width="150" :height="56" type="default" @click="diancan">
|
<my-button color="#333" :width="150" :height="56" type="default" @click="diancan">
|
||||||
选择
|
选择
|
||||||
@@ -80,7 +85,7 @@
|
|||||||
} from '@/http/yskApi/table.js'
|
} from '@/http/yskApi/table.js'
|
||||||
import infoBox from '@/commons/utils/infoBox.js'
|
import infoBox from '@/commons/utils/infoBox.js'
|
||||||
const status = $status
|
const status = $status
|
||||||
const emits = defineEmits(['more', 'update'])
|
const emits = defineEmits(['more', 'update', 'bind'])
|
||||||
|
|
||||||
function returnStutasText(key) {
|
function returnStutasText(key) {
|
||||||
key = returnIsUseing(key)
|
key = returnIsUseing(key)
|
||||||
@@ -146,6 +151,10 @@
|
|||||||
}
|
}
|
||||||
emits('more')
|
emits('more')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function bind() {
|
||||||
|
emits('bind',props.data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async function diancan() {
|
async function diancan() {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<view class="u-m-t-30 u-flex u-flex-wrap u-row-between">
|
<view class="u-m-t-30 u-flex u-flex-wrap u-row-between">
|
||||||
<view class="u-m-b-30" v-for="(item,index) in tables.list" :key="index">
|
<view class="u-m-b-30" v-for="(item,index) in tables.list" :key="index">
|
||||||
<table-item @update="getTable" :areaMap="areaMap" @more="moreShow(item)" :data="item"></table-item>
|
<table-item @bind="unBind" @update="getTable" :areaMap="areaMap" @more="moreShow(item)" :data="item"></table-item>
|
||||||
</view>
|
</view>
|
||||||
<my-img-empty v-if="tables.hasAjax&&!tables.list.length" tips="未找到相关桌台"></my-img-empty>
|
<my-img-empty v-if="tables.hasAjax&&!tables.list.length" tips="未找到相关桌台"></my-img-empty>
|
||||||
</view>
|
</view>
|
||||||
@@ -80,7 +80,8 @@
|
|||||||
} from '@/commons/table-status.js'
|
} from '@/commons/table-status.js'
|
||||||
import {
|
import {
|
||||||
$table,
|
$table,
|
||||||
$tableArea
|
$tableArea,
|
||||||
|
$bind
|
||||||
} from '@/http/yskApi/table.js'
|
} from '@/http/yskApi/table.js'
|
||||||
import {
|
import {
|
||||||
objToArrary
|
objToArrary
|
||||||
@@ -111,7 +112,7 @@
|
|||||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
||||||
const refMoreSheet = ref(null)
|
const refMoreSheet = ref(null)
|
||||||
const actionSheet = reactive({
|
const actionSheet = reactive({
|
||||||
list: ['结账', '清台', '增减菜', '换台', '打印订单', '历史订单'],
|
list: ['结账', '清台', '增减菜', '换台', '打印订单', '历史订单','绑定码牌'],
|
||||||
title: '',
|
title: '',
|
||||||
selTable: ''
|
selTable: ''
|
||||||
})
|
})
|
||||||
@@ -175,10 +176,51 @@
|
|||||||
//打印订单
|
//打印订单
|
||||||
const res = await $fun.printOrder(actionSheet.selTable.tableId)
|
const res = await $fun.printOrder(actionSheet.selTable.tableId)
|
||||||
return
|
return
|
||||||
|
}
|
||||||
|
if (index == 6) {
|
||||||
|
//打印订单
|
||||||
|
scanCode(item)
|
||||||
|
// const res = await $fun.printOrder(actionSheet.selTable.tableId)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
infoBox.showToast('待开放,请敬请期待!')
|
infoBox.showToast('待开放,请敬请期待!')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function unBind (item) {
|
||||||
|
scanCode(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
function scanCode(item) {
|
||||||
|
if ( item.status != 'unbind') {
|
||||||
|
infoBox.showToast('当前桌台已绑定')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.scanCode({
|
||||||
|
onlyFromCamera: true,
|
||||||
|
success: function(res) {
|
||||||
|
console.log('条码类型:' + res.scanType);
|
||||||
|
console.log('条码内容:' + res.result);
|
||||||
|
let params = getQueryString(res.result);
|
||||||
|
$bind({
|
||||||
|
"code": params.code,
|
||||||
|
"id": item.id,
|
||||||
|
}).then(res => {
|
||||||
|
getTable()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getQueryString(url) { //解码
|
||||||
|
let params = {};
|
||||||
|
// 正则表达式来匹配URL中的查询字符串
|
||||||
|
let reg = /(?:\?|#|&){1}([^=]*)=([^&]*)/g;
|
||||||
|
url.replace(reg, (match, key, value) => {
|
||||||
|
params[key] = value;
|
||||||
|
});
|
||||||
|
return params;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const refTable = ref(null)
|
const refTable = ref(null)
|
||||||
|
|
||||||
|
|||||||
18
pages.json
18
pages.json
@@ -9,22 +9,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pages": [
|
"pages": [
|
||||||
// {
|
|
||||||
// "path": "pages/adStart/adStart",
|
|
||||||
// "style": {
|
|
||||||
// "navigationBarTitleText": "开屏广告",
|
|
||||||
// "navigationStyle": "custom"
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// "pageId": "PAGES_INDEX",
|
|
||||||
// "path": "pages/index/indexCopy",
|
|
||||||
// "style": {
|
|
||||||
// "navigationBarTitleText": "首页",
|
|
||||||
// "navigationStyle": "custom",
|
|
||||||
// "enablePullDownRefresh": true
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
"pageId": "PAGES_INDEX",
|
"pageId": "PAGES_INDEX",
|
||||||
"path": "pages/index/index",
|
"path": "pages/index/index",
|
||||||
@@ -1120,7 +1104,7 @@
|
|||||||
"iconPath": "static/tabImg/index.png",
|
"iconPath": "static/tabImg/index.png",
|
||||||
"selectedIconPath": "static/tabImg/index-select.png",
|
"selectedIconPath": "static/tabImg/index-select.png",
|
||||||
"text": "首页"
|
"text": "首页"
|
||||||
}
|
},
|
||||||
{
|
{
|
||||||
"pagePath": "pages/user/user",
|
"pagePath": "pages/user/user",
|
||||||
"iconPath": "static/tabImg/user.png",
|
"iconPath": "static/tabImg/user.png",
|
||||||
|
|||||||
@@ -36,17 +36,12 @@
|
|||||||
} from '@/http/apiManager.js';
|
} from '@/http/apiManager.js';
|
||||||
import go from '@/commons/utils/go.js';
|
import go from '@/commons/utils/go.js';
|
||||||
import Stats from './components/Stats.vue';
|
import Stats from './components/Stats.vue';
|
||||||
import registerPush from '@/commons/utils/pushmsg/registerPush.js';
|
|
||||||
import pushMsgManage from '@/commons/utils/pushmsg/pushMsgManage.js';
|
|
||||||
import statistics from './components/statistics.vue'
|
import statistics from './components/statistics.vue'
|
||||||
import {
|
import {
|
||||||
onPullDownRefresh,
|
onPullDownRefresh,
|
||||||
onLoad
|
onLoad
|
||||||
} from '@dcloudio/uni-app';
|
} from '@dcloudio/uni-app';
|
||||||
import storageManage from '@/commons/utils/storageManage.js';
|
import storageManage from '@/commons/utils/storageManage.js';
|
||||||
import {
|
|
||||||
$adList
|
|
||||||
} from '@/http/apiManager.js';
|
|
||||||
import {
|
import {
|
||||||
hasPermission
|
hasPermission
|
||||||
} from '@/commons/utils/hasPermission.js'
|
} from '@/commons/utils/hasPermission.js'
|
||||||
@@ -256,7 +251,6 @@
|
|||||||
navList.splice(index, 1);
|
navList.splice(index, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const statsRef = ref();
|
|
||||||
|
|
||||||
const vdata = reactive({
|
const vdata = reactive({
|
||||||
noticeList: [], // 公告列表
|
noticeList: [], // 公告列表
|
||||||
|
|||||||
@@ -191,12 +191,6 @@
|
|||||||
const loginFormRef = ref()
|
const loginFormRef = ref()
|
||||||
const envChangeTipsRef = ref()
|
const envChangeTipsRef = ref()
|
||||||
const refAgr = ref()
|
const refAgr = ref()
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
// 控制 音乐播放 和暂停
|
|
||||||
import {
|
|
||||||
getPushStatus
|
|
||||||
} from "@/commons/utils/pushmsg/wxTextToSpeach.js"
|
|
||||||
// #endif
|
|
||||||
const rules = {
|
const rules = {
|
||||||
merchantName: {
|
merchantName: {
|
||||||
rules: [formUtil.rules.requiredInputShowToast('商户号')],
|
rules: [formUtil.rules.requiredInputShowToast('商户号')],
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<view class="page-cell">
|
<view class="page-cell">
|
||||||
<view class="label">头像</view>
|
<view class="label">头像</view>
|
||||||
<view class="right" @tap="uploadImg.preview()">
|
<view class="right" @tap="uploadImg.preview()">
|
||||||
<up-avatar class="fileImg" :src="vdata.shopInfo.coverImg?vdata.shopInfo.coverImg:''"></up-avatar>
|
<up-avatar class="fileImg" :src="vdata.shopInfo.coverImg?vdata.shopInfo.coverImg:''" mode="aspectFill"></up-avatar>
|
||||||
<view class="file" @tap="chooseAndUploadAvatar('coverImg')"></view>
|
<view class="file" @tap="chooseAndUploadAvatar('coverImg')"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Reference in New Issue
Block a user