ソースを参照

搞搞搞搞你妈个头

任一存 1 年間 前
コミット
e0722e5100
5 ファイル変更20 行追加17 行削除
  1. 0 0
      .env.mytest
  2. 1 1
      package.json
  3. 6 2
      src/app.vue
  4. 8 7
      src/components/Tags/goods-list.vue
  5. 5 7
      src/components/Tags/waterfall.vue

.env.testprod → .env.mytest


+ 1 - 1
package.json

@@ -6,7 +6,7 @@
     "serve": "vue-cli-service serve",
     "serve-prod": "vue-cli-service serve --mode prod",
     "serve-HK": "vue-cli-service serve --mode bendi",
-    "build-testprod": "vue-cli-service build --mode testprod",
+    "build-test": "vue-cli-service build --mode mytest",
     "build": "vue-cli-service build --mode prod",
     "lint": "vue-cli-service lint"
   },

+ 6 - 2
src/app.vue

@@ -295,6 +295,7 @@ const toggleMap = () => {
 const onClickTagInfo = (el) => {
   el.stopPropagation();
   let item = tags.value.find((item) => item.sid == el.target.dataset.id);
+  console.log('target item: ', item);
   if (item.type == 'commodity') {
     guideclicktag(item);
     store.commit('tag/setTagClickType', {
@@ -405,12 +406,14 @@ onMounted(async () => {
               browser.openLink(
                 '/subPackage/pages/activity/activity?pageId=' + hotcontent.couponLink,
                 `${metadata.value?.cdfProductSource?.cdfHost}/shop/${metadata.value?.cdfProductSource?.cdfMchId}/showactivity?pageId=${hotcontent.couponLink}`,
-                `/pages/showactivity/showactivity?pageId=${hotcontent.couponLink}`
+                `/pages/showactivity/showactivity?pageId=${hotcontent.couponLink}`,
                 `${metadata.value?.cdfProductSource?.cdfHostPc}/showactivity/${hotcontent.couponLink}`,
               );
 
               apis.burying_point({ type: 2 });
-            } catch (error) {}
+            } catch (error) {
+              console.error('点击优惠券操作出错:', error);
+            }
           }
           else if (tag.type == 'point_jump') {
             let hotcontent = typeof tag.hotContent == 'string' ? JSON.parse(tag.hotContent) : tag.hotContent;
@@ -557,6 +560,7 @@ onMounted(async () => {
     dataLoaded.value = true;
   });
   app.store.on('tags', (tags) => {
+    console.log("app.store.on('tags')", tags);
     store.commit('tag/load', tags);
   });
   app.Camera.on('mode.beforeChange', ({ fromMode, toMode, floorIndex }) => {

+ 8 - 7
src/components/Tags/goods-list.vue

@@ -102,7 +102,9 @@ const current = ref(0);
 
 const mysw = ref(null);
 
-const isShowNewGoodType = computed(()=>tagclick.value&&tagclick.value.data.productSource.mchType == 1);
+const isShowNewGoodType = computed(()=> {
+  return tagclick?.value?.data?.productSource?.mchType == 1
+});
 
 
 const viewDetail = (item) => {
@@ -111,9 +113,7 @@ const viewDetail = (item) => {
   }
   apis.burying_point({ type: 3, productId: item.id });
 
-  console.log(tagclick.value.data.productSource,'itemitemitem');
-
-  if (tagclick.value.data.productSource.mchType == 1) {
+  if (tagclick?.value?.data?.productSource?.mchType == 1) {
     if (browser.detectIOS()) {
       window.location.href = item.url;
     } else {
@@ -178,7 +178,8 @@ const addCart = async (item) => {
     return;
   }
   Loading.show();
-
+  console.log('addCart', item);
+  debugger
   let result = await apis.inCat({
     AccessToken: browser.getURLParam("AccessToken"),
     skuId: item.currentSku.id,
@@ -204,7 +205,7 @@ const addCart = async (item) => {
     browser.openLink(
       `/pages/login/login?callbackHttpUrl=${encodeURIComponent(callbackUrl)}`,
       `${tagclick.value.data.productSource.cdfHost}/shop/${tagclick.value.data.productSource.cdfMchId}/h5login?redirectUrl=${encodeURIComponent(callbackUrl)}`,
-      `/pages/login/login?callbackHttpUrl=${encodeURIComponent(callbackUrl)}`
+      `/pages/login/login?callbackHttpUrl=${encodeURIComponent(callbackUrl)}`,
       `${tagclick.value.data.productSource.cdfHostPc}/login?redirectUrl=${encodeURIComponent(callbackUrl)}`,
     );
   }
@@ -215,7 +216,7 @@ const close = () => {
 };
 
 const updateProductsById = async (idx) => {
-  if (tagclick.value.data.productSource.mchType == 1) {
+  if (tagclick?.value?.data?.productSource?.mchType == 1) {
     return
   }
   if (!tagclick.value.data.products[idx]) {

+ 5 - 7
src/components/Tags/waterfall.vue

@@ -46,15 +46,13 @@ const gotoGoods = (item) => {
   if (isshoppingguide.value) {
       return;
   }
-  store.commit('tag/setTagClickType', {
-    type: 'goodlist',
-    data: {
-      products: [item],
-    },
-  });
+  const temp = tagclick.value
+  temp.type = 'goodlist'
+  temp.data.products = [item]
+  store.commit('tag/setTagClickType', temp);
   // apis.burying_point({ type: 3, productId: item.id });
   // console.log(item,'item');
-  // if (tagclick.value.data.productSource.mchType == 1) {
+  // if (tagclick?.value?.data?.productSource?.mchType == 1) {
   //   if (browser.detectIOS()) {
   //     window.location.href = item.url;
   //   } else {