diff --git a/src/api/order/types.ts b/src/api/order/types.ts
index f7df99a..11a6336 100644
--- a/src/api/order/types.ts
+++ b/src/api/order/types.ts
@@ -4,6 +4,7 @@ export interface OrderBean {
allowIntegral: boolean;
bizId: string;
classify: number;
+ address: any,
companyId: string;
consignTime: string;
consumerId: string;
@@ -71,4 +72,7 @@ export interface OrderBean {
updated: boolean;
useGold: number;
wholePrice: number;
+
+ //extra field
+ countdown: number;
}
diff --git a/src/components/sku-dialog.vue b/src/components/sku-dialog.vue
index f8e1f64..8c3fc95 100644
--- a/src/components/sku-dialog.vue
+++ b/src/components/sku-dialog.vue
@@ -12,7 +12,8 @@
颜色
-
{{ item }}
@@ -22,11 +23,13 @@
尺码
{{ item.sizeName }}
+ 暂无库存
@@ -41,7 +44,9 @@
-
+
@@ -65,7 +70,7 @@ const popupRef = ref();
const goodsDetailBean = ref();
const skuColorList = ref([]);
const currentColorIndex = ref(0);
-const currentSizeIndex = ref(0);
+const currentSizeIndex = ref(-1);
const goodsCount = ref(1);
let callback: Function;
@@ -96,25 +101,31 @@ const show = async (goodsId: string, fn: Function) => {
sizeChange(sizeIndex || 0);
goodsCount.value = props.exists?.count;
}
+
+ if(skuSizeList) {
+ // skuSizeList.value![2].existingNumber = 2;
+ }
};
const skuSizeList = computed(() => {
const currentColorName = skuColorList.value[currentColorIndex.value];
- return goodsDetailBean.value?.stocks?.filter((res: { colorName: string }) => {
+ let sizeList = goodsDetailBean.value?.stocks?.filter((res: { colorName: string }) => {
return res.colorName === currentColorName;
});
+ currentSizeIndex.value = sizeList?.findIndex(res => res.existingNumber > 0) || 0;
+ return sizeList;
});
-const close = () => {
- popupRef.value.close();
-};
-
const colorChange = (index: number) => {
currentColorIndex.value = index;
};
const sizeChange = (index: number) => {
- currentSizeIndex.value = index;
+ if((skuSizeList.value![index].existingNumber || 0) <= 0) {
+ showToast('库存不足');
+ } else {
+ currentSizeIndex.value = index;
+ }
};
const countChange = (isPlus: boolean) => {
@@ -140,6 +151,10 @@ const confirm = () => {
popupRef.value.close();
};
+const close = () => {
+ popupRef.value.close();
+};
+
defineExpose({
show
});
@@ -262,6 +277,7 @@ defineExpose({
.primary-button {
width: 100%;
margin-top: 50rpx;
+ border: none;
}
}
}
diff --git a/src/components/tabbar/tabbar.vue b/src/components/tabbar/tabbar.vue
index 8468c84..17dce39 100644
--- a/src/components/tabbar/tabbar.vue
+++ b/src/components/tabbar/tabbar.vue
@@ -14,12 +14,17 @@