1.优化商品分类 2.其他优化
This commit is contained in:
parent
48280f92df
commit
e13727e6ff
|
|
@ -19,27 +19,11 @@ VITE_API_PHP_URL = 'https://newblockwlx.sxczgkj.cn/index.php/api'
|
|||
# 正式 php 开票
|
||||
VITE_API_KP_URL = 'https://invoice.sxczgkj.cn/api'
|
||||
|
||||
# 杰哥
|
||||
# VITE_API_URL = 'http://192.168.1.34:10589/cashier-client'
|
||||
# 本地调试连接
|
||||
VITE_API_URL = 'http://192.168.1.31/'
|
||||
|
||||
# 测试
|
||||
# VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client'
|
||||
|
||||
# 预发布
|
||||
# VITE_API_URL = 'https://pre-cashierclient.sxczgkj.cn/cashier-client'
|
||||
|
||||
# 张松本地
|
||||
# VITE_API_URL = 'https://36z1017t45.goho.co/cashier-client'
|
||||
|
||||
# 谭凯凯
|
||||
# VITE_API_URL = 'http://192.168.1.35/'
|
||||
|
||||
# 阿伟
|
||||
# VITE_API_URL = 'http://192.168.1.21:8000/'
|
||||
|
||||
# 测试
|
||||
# 线上测试
|
||||
# VITE_API_URL = 'https://tapi.cashier.sxczgkj.cn'
|
||||
|
||||
# 正式
|
||||
VITE_API_URL = 'https://cashier.sxczgkj.com'
|
||||
|
||||
# 线上正式
|
||||
# VITE_API_URL = 'https://cashier.sxczgkj.com'
|
||||
|
|
@ -11,7 +11,4 @@ VITE_API_PHP_URL = 'https://newblockwlx.sxczgkj.cn/index.php/api'
|
|||
VITE_API_KP_URL = 'https://invoice.sxczgkj.cn/api'
|
||||
|
||||
# 线上环境接口地址
|
||||
VITE_API_URL = 'https://cashier.sxczgkj.com/'
|
||||
|
||||
# 预发布接口
|
||||
# VITE_API_URL = 'https://pre-cashierclient.sxczgkj.cn/cashier-client/'
|
||||
VITE_API_URL = 'https://cashier.sxczgkj.com/'
|
||||
16160
dist-electron/main.js
16160
dist-electron/main.js
File diff suppressed because one or more lines are too long
|
|
@ -67,7 +67,7 @@ body {
|
|||
font-weight: bold;
|
||||
}
|
||||
.print_view .number_wrap .info {
|
||||
margin-left: 10px;
|
||||
font-weight: bold;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
.print_view .time {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ body {
|
|||
font-weight: bold;
|
||||
}
|
||||
.info {
|
||||
margin-left: 10px;
|
||||
font-weight: bold;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
收银员:{{ store.userInfo.name }}
|
||||
</div>
|
||||
<div>
|
||||
<span style="color: #666">{{ dayjs(store.userInfo.loginTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
|
||||
<span style="color: #999">{{ dayjs(store.userInfo.loginTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="drawerbox_bo_top_ring">
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
</div> -->
|
||||
</div>
|
||||
<div class="drawerbox_bo_box">
|
||||
<div style="padding: 10px; color: #999; font-weight: bold">系统</div>
|
||||
<!-- <div style="padding: 10px 0; color: #999; font-weight: bold">系统</div> -->
|
||||
<div class="drawerbox_bo_box_itemb_felx">
|
||||
<!-- <div class="drawerbox_bo_box_itembox">
|
||||
<div class="drawerbox_bo_box_icon">
|
||||
|
|
@ -178,7 +178,7 @@ defineExpose({
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #ccc;
|
||||
border-bottom: 1px solid #47484b;
|
||||
|
||||
.drawerbox_bo_top_left {
|
||||
display: flex;
|
||||
|
|
@ -212,12 +212,12 @@ defineExpose({
|
|||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
padding: 20px 0;
|
||||
|
||||
.drawerbox_bo_box_itembox {
|
||||
width: 20%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 30px;
|
||||
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ export const useGoods = defineStore("goods", {
|
|||
|
||||
setTimeout(() => {
|
||||
this.goodsListLoading = false;
|
||||
}, 1000);
|
||||
}, 500);
|
||||
},
|
||||
// 获取购物车列表,数据必须由长链接返回
|
||||
async getCartList(arr) {
|
||||
|
|
|
|||
|
|
@ -207,6 +207,7 @@ export const useSocket = defineStore("socket", {
|
|||
this.orderList.splice(0, 1);
|
||||
}
|
||||
} catch (error) {
|
||||
this.orderList.splice(0, 1);
|
||||
console.log(error);
|
||||
}
|
||||
}, 2000);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
</div>
|
||||
<div class="number_wrap">
|
||||
<!-- <div class="num" v-if="printData.outNumber">{{ printData.outNumber }}</div> -->
|
||||
<div class="info" v-if="printData.masterId">座位号:{{ printData.masterId }}</div>
|
||||
<div class="info">座位号:{{ printData.masterId }}</div>
|
||||
</div>
|
||||
<div class="shop_info">
|
||||
<div class="name">{{ printData.name }}</div>
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
</div>
|
||||
<div class="btn_wrap">
|
||||
<div class="btn">
|
||||
<el-button plain style="width: 100%" @click="printHandle">
|
||||
<el-button plain style="width: 100%" :loading="printLoading" @click="printHandle">
|
||||
打印测试小票
|
||||
</el-button>
|
||||
</div>
|
||||
|
|
@ -120,6 +120,7 @@ const store = useUser();
|
|||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const printLoading = ref(false);
|
||||
const classifyRef = ref(null);
|
||||
const printList = ref([]);
|
||||
const feets = ref([0, 1, 2, 3, 4, 5, 8]);
|
||||
|
|
@ -168,11 +169,15 @@ const printHandle = _.throttle(function () {
|
|||
ElMessage.error("请选择打印设备");
|
||||
return;
|
||||
}
|
||||
printLoading.value = true;
|
||||
printData.value.deviceName = form.value.address
|
||||
ipcRenderer.send(
|
||||
"printerTagSync",
|
||||
JSON.stringify(printData.value)
|
||||
);
|
||||
setTimeout(() => {
|
||||
printLoading.value = false;
|
||||
}, 1000);
|
||||
}, 1500, { leading: true, trailing: false })
|
||||
|
||||
// 提交打印机
|
||||
|
|
@ -313,8 +318,8 @@ onMounted(() => {
|
|||
}
|
||||
|
||||
.info {
|
||||
margin-left: 12px;
|
||||
padding-bottom: 4px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<!-- 商品列表 -->
|
||||
<template>
|
||||
<div class="header">
|
||||
<div class="menus scroll-x">
|
||||
<div class="item" :class="{ active: goodsStore.categoryIndex == index }"
|
||||
<div class="menus scroll-x" ref="tabScrollRef">
|
||||
<div class="item tab-item" :class="{ active: goodsStore.categoryIndex == index }"
|
||||
v-for="(item, index) in goodsStore.categoryList" :key="item.id" @click="changeCategory(index)">
|
||||
<el-icon v-if="item.id === ''" class="icon" :class="{ active: goodsStore.goodsListLoading }">
|
||||
<RefreshRight />
|
||||
|
|
@ -241,26 +241,23 @@
|
|||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { nextTick, onMounted, ref } from 'vue'
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import _ from 'lodash'
|
||||
import useStorage from "@/utils/useStorage";
|
||||
import skuModal from '@/components/skuModal.vue'
|
||||
import WeightModal from './weightModal.vue'
|
||||
import GroupModal from './groupModal.vue'
|
||||
import { queryCategory, queryNewCommodityInfo, queryProductSku, productStatus, productStock, getUnitList, temporaryDishes } from '@/api/product'
|
||||
import { queryProductSku, productStock, getUnitList } from '@/api/product'
|
||||
import { useUser } from "@/store/user.js"
|
||||
import { useGoods } from '@/store/goods.js'
|
||||
import { Swiper, SwiperSlide } from 'swiper/vue'
|
||||
import "swiper/swiper-bundle.css";
|
||||
import { staffPermission } from '@/api/user.js'
|
||||
import { useGlobal } from '@/store/global.js'
|
||||
import { inputFilterFloat, clearNoNum } from '@/utils/index.js'
|
||||
import { clearNoNum } from '@/utils/index.js'
|
||||
import { productOnOff, markIsSoldOut } from '@/api/product_new.js'
|
||||
|
||||
const swiperRef = ref(null)
|
||||
|
||||
const global = useGlobal()
|
||||
|
||||
const store = useUser()
|
||||
const goodsStore = useGoods()
|
||||
|
||||
|
|
@ -271,15 +268,20 @@ const props = defineProps({
|
|||
}
|
||||
})
|
||||
|
||||
watch(() => goodsStore.categoryList, (newVal, oldVal) => {
|
||||
if (newVal.length) {
|
||||
setTimeout(() => {
|
||||
tabContentAni(goodsStore.categoryIndex)
|
||||
}, 300)
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['success', 'loading'])
|
||||
|
||||
const skuModalRef = ref(null)
|
||||
|
||||
const shopListType = ref('img')
|
||||
|
||||
const categorys = ref([])
|
||||
const categorysActive = ref(0)
|
||||
|
||||
const commdityName = ref('')
|
||||
|
||||
const loading = ref(false)
|
||||
|
|
@ -579,10 +581,43 @@ function localUpdateShopListType() {
|
|||
})
|
||||
}
|
||||
|
||||
// 切换分类
|
||||
// 切换分类;
|
||||
function changeCategory(index) {
|
||||
showPopover.value = false
|
||||
goodsStore.setCategoryIndex(index)
|
||||
tabContentAni(index)
|
||||
}
|
||||
|
||||
// 使tab平滑居中
|
||||
const tabScrollRef = ref(null);
|
||||
const activeTab = ref(0)
|
||||
function tabContentAni(index) {
|
||||
activeTab.value = index;
|
||||
const tabScroll = tabScrollRef.value;
|
||||
const tabItems = tabScroll.querySelectorAll('.tab-item');
|
||||
const clickedTab = tabItems[index];
|
||||
|
||||
const containerWidth = tabScroll.offsetWidth;
|
||||
const tabWidth = clickedTab.offsetWidth;
|
||||
// 使用 getBoundingClientRect 获取更准确的位置
|
||||
const tabRect = clickedTab.getBoundingClientRect();
|
||||
const containerRect = tabScroll.getBoundingClientRect();
|
||||
const tabOffsetLeft = tabRect.left - containerRect.left + tabScroll.scrollLeft;
|
||||
|
||||
// 计算需要滚动到的位置,使点击的 tab 居中
|
||||
let scrollTo = tabOffsetLeft - (containerWidth - tabWidth) / 2;
|
||||
|
||||
// 确保滚动位置不会小于 0
|
||||
scrollTo = Math.max(0, scrollTo);
|
||||
// 确保滚动位置不会超过最大可滚动距离
|
||||
const maxScroll = tabScroll.scrollWidth - containerWidth;
|
||||
scrollTo = Math.min(scrollTo, maxScroll);
|
||||
|
||||
// 平滑滚动到计算的位置
|
||||
tabScroll.scrollTo({
|
||||
left: scrollTo,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
|
||||
// 更新商品数据
|
||||
|
|
@ -779,6 +814,12 @@ defineExpose({
|
|||
clearDot,
|
||||
showPackage
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
if (goodsStore.categoryList.length) {
|
||||
tabContentAni(goodsStore.categoryIndex)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
|
|||
|
|
@ -134,12 +134,12 @@ async function printHandle(type) {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
setTimeout(() => {
|
||||
printLoading.value = false;
|
||||
}, 1500);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
printLoading.value = false;
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
async function show(row) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue