Compare commits

..

No commits in common. "638300113bebf7d4549c5e163c2c5e634ac68211" and "d59e994b3e5d4dd25a454b77ea75d0ee1dab7b32" have entirely different histories.

5 changed files with 14 additions and 30 deletions

View File

@ -5,14 +5,12 @@ import { useDark } from "@@/composables/useDark"
import { useWxStore } from "@/pinia/stores/wx"
import { tokenLogin } from '@/common/apis/ab98'
import { useAb98UserStore } from '@/pinia/stores/ab98-user'
import { useProductStore } from "./pinia/stores/product"
// const userStore = useUserStore()
const wxStore = useWxStore();
const route = useRoute();
const router = useRouter();
const ab98UserStore = useAb98UserStore();
const productStore = useProductStore();
const wxStore = useWxStore()
const route = useRoute()
const router = useRouter()
const ab98UserStore = useAb98UserStore()
const { isDark, initDark } = useDark()

View File

@ -10,9 +10,9 @@ export function getCabinetDetailApi() {
})
}
export function openCabinet(cabinetId: number, pinNo: number, data: OpenCabinetApiData) {
export function openCabinet(lockControlNo: number, pinNo: number, data: OpenCabinetApiData) {
return request<ApiResponseData<void>>({
url: `cabinet/openCabinet/${cabinetId}/${pinNo}`,
url: `cabinet/openCabinet/${lockControlNo}/${pinNo}`,
method: 'post',
data
})

View File

@ -5,13 +5,10 @@ import { GetOpenIdRequestParams } from './type'
/** 获取商品列表 */
export function getShopGoodsApi(shopId: number|null) {
export function getShopGoodsApi() {
return request<ShopGoodsResponseData>({
url: "shop/goods",
method: "get",
params: {
shopId: shopId ? shopId : undefined
}
method: "get"
})
}

View File

@ -133,7 +133,7 @@ const handleOpenLocker = async (locker: LockerItem) => {
openingLockerId.value = locker.lockerId
try {
//
await openCabinet(cabinetList.value[activeCabinet.value].cabinetId, locker.lockerNumber, {
await openCabinet(cabinetList.value[activeCabinet.value].lockControlNo, locker.lockerNumber, {
cellId: locker.lockerId,
userid: qyUserid.value,
isInternal: 2,

View File

@ -14,24 +14,12 @@ export interface Product {
export const useProductStore = defineStore("product", () => {
// 商品数据
const labels = ref<Array<{ id: number, name: string }>>([]);
const categories = ref<Product[]>([]);
const shopId = ref<number|null>(null);
const setShopId = (id: number|string) => {
shopId.value = Number(id);
getGoods();
}
const labels = ref<Array<{ id: number, name: string }>>([])
const categories = ref<Product[]>([])
const getGoods = async () => {
const urlParams = new URLSearchParams(window.location.search);
const shopIdParams = urlParams.get('shopId') || undefined;
if (shopIdParams) {
shopId.value = Number(shopIdParams);
}
try {
const { data } = await getShopGoodsApi(shopId.value);
const { data } = await getShopGoodsApi()
// 转换分类标签
labels.value = data.categoryList.map(c => ({
@ -54,7 +42,8 @@ export const useProductStore = defineStore("product", () => {
console.error("获取商品数据失败:", error)
}
}
return { labels, categories, shopId, getGoods, setShopId }
getGoods()
return { labels, categories, getGoods }
})
/**