Переглянути джерело

判断商品数据丢失情况

tremble 3 роки тому
батько
коміт
b7520c0fa1
1 змінених файлів з 6 додано та 0 видалено
  1. 6 0
      src/components/Tags/goods-list.vue

+ 6 - 0
src/components/Tags/goods-list.vue

@@ -129,6 +129,12 @@ const addCart = async (item) => {
 };
 };
 
 
 const updateProductsById = async (idx) => {
 const updateProductsById = async (idx) => {
+  console.log();
+  if(!tagclick.value.data.products[idx]){
+    Dialog.toast({ content: `获取商品详情失败,请稍后再试`, type: 'error' })
+    emit('close')
+    return
+  }
   Loading.show();
   Loading.show();
   let res = await apis.get_product_info({
   let res = await apis.get_product_info({
     // productId: 'p15677829'
     // productId: 'p15677829'