tremble hace 3 años
padre
commit
46936cc021

+ 0 - 1
src/app.vue

@@ -257,7 +257,6 @@ onMounted(async () => {
                 }
               });
             } else {
-              
             }
           } else if (tag.type == "link_scene") {
             let sceneFirstView = tag.hotContent.sceneFirstView;

+ 3 - 1
src/components/Tags/goods-list.vue

@@ -71,7 +71,7 @@ import { onMounted, watch, toRaw, computed, defineEmits, ref, defineProps, nextT
 import { useApp, getApp } from "@/app";
 import { useStore } from "vuex";
 import * as apis from "@/apis/index.js";
-import { Loading } from "@/global_components/";
+import { Loading,Dialog } from "@/global_components/";
 import browser from "@/utils/browser";
 
 // get_product_info
@@ -124,6 +124,8 @@ const addCart = async (item) => {
     num: item.cartnum,
   });
   Loading.hide();
+  return Dialog.alert({ title: '提示', content: '添加成功', okText: '确定' })
+  
 };
 
 const updateProductsById = async (idx) => {

+ 16 - 1
src/components/Tags/treasure.vue

@@ -14,6 +14,8 @@
 import { onMounted, watch, defineEmits, computed, ref, nextTick, defineProps } from "vue";
 import { useApp, getApp } from "@/app";
 import { useStore } from "vuex";
+import browser from "@/utils/browser";
+
 const store = useStore();
 
 const tagclick = computed(() => store.getters["tag/tagClickType"]);
@@ -21,8 +23,21 @@ const tagclick = computed(() => store.getters["tag/tagClickType"]);
 const emit = defineEmits(["close"]);
 
 const goto_now = () => {
-  // wx.miniProgram.navigateTo({url: `/pages/shared/shared?img_url=${encodeURIComponent(uploadRes.data.url)}&companyId=${this.serve.info.companyId}&shareImg=${encodeURIComponent(this.serve.info.shareWxQrCode)}&vrLink=${encodeURIComponent(`${window.location.origin}${location.pathname}?m=${this.$config.projectNum}`)}`})
   emit("close");
+  if (browser.detectWeixin()) {
+    //ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
+    wx.miniProgram.getEnv((res) => {
+      if (res.miniprogram) {
+        //在小程序里
+        wx.miniProgram.navigateTo({
+          url: tag.hotContent.couponLink,
+        });
+      } else {
+        // 不在小程序里
+      }
+    });
+  } else {
+  }
 };
 </script>
 

+ 20 - 1
src/components/Tags/waterfall.vue

@@ -7,7 +7,7 @@
           <ui-icon @click="emit('close')" type="close"></ui-icon>
         </div>
         <ul class="wfcon">
-          <li v-for="(item,i) in tagclick.data.products" :key="i">
+          <li @click.stop="gotoGoods(item)" v-for="(item,i) in tagclick.data.products" :key="i">
             <img v-if="i<=2" :src="require(`@/assets/images/icon/${i+1}.svg`)" alt="">
             <span v-else>{{i+1}}</span>
             <div class="wfavatar" :style="{backgroundImage:`url(${item.pic})`}"></div>
@@ -26,11 +26,30 @@
 import { onMounted, watch, defineEmits, computed, ref, nextTick, defineProps } from "vue";
 import { useApp, getApp } from "@/app";
 import { useStore } from "vuex";
+import browser from "@/utils/browser";
+
 const store = useStore();
 
 const tagclick = computed(() => store.getters["tag/tagClickType"]);
 
 const emit = defineEmits(["close"]);
+const gotoGoods = (item) =>{
+   if (browser.detectWeixin()) {
+    //ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
+    wx.miniProgram.getEnv((res) => {
+      if (res.miniprogram) {
+        //在小程序里
+        wx.miniProgram.navigateTo({ url: `/pages/item/item?productId=${item.id}` });
+      } else {
+        // 不在小程序里
+        window.location.href = `https://m.cdfmembers.com/shop/600667208/item?productId=${item.id}`
+      }
+    });
+  }
+  else {
+        window.location.href = `https://m.cdfmembers.com/shop/600667208/item?productId=${item.id}`
+  }
+}
 
 </script>