shish hace 6 años
padre
commit
cf6ec57b0d
Se han modificado 2 ficheros con 20 adiciones y 3 borrados
  1. 20 2
      mall/src/pages/home/index.vue
  2. 0 1
      mall/src/pages/interest/invite.vue

+ 20 - 2
mall/src/pages/home/index.vue

@@ -10,17 +10,17 @@
     <app-trademark />
     <app-trademark />
   </div>
   </div>
 </template>
 </template>
-
 <script>
 <script>
 import { mapGetters } from "vuex";
 import { mapGetters } from "vuex";
 import AppSwiper from "@/components/app-swiper";
 import AppSwiper from "@/components/app-swiper";
 import AppTrademark from "@/components/module/app-trademark";
 import AppTrademark from "@/components/module/app-trademark";
-// 商品组件
 import goodsListBig from "@/pages/home/components/goods-list-big";
 import goodsListBig from "@/pages/home/components/goods-list-big";
 import goodsListMiddle from "@/pages/home/components/goods-list-middle";
 import goodsListMiddle from "@/pages/home/components/goods-list-middle";
 import goodsListSmall from "@/pages/home/components/goods-list-small";
 import goodsListSmall from "@/pages/home/components/goods-list-small";
 import { getMainIndex } from "@/api/home";
 import { getMainIndex } from "@/api/home";
 import { getOrderShop } from "@/utils/config";
 import { getOrderShop } from "@/utils/config";
+import { getShopUser } from "@/utils/auth";
+import { share } from "@/mixins";
 export default {
 export default {
   name: "home",
   name: "home",
   components: {
   components: {
@@ -30,6 +30,7 @@ export default {
     goodsListMiddle,
     goodsListMiddle,
     goodsListSmall
     goodsListSmall
   },
   },
+  mixins: [share],
   data() {
   data() {
     return {
     return {
       data: {},
       data: {},
@@ -51,6 +52,23 @@ export default {
         });
         });
       });
       });
       this._detail();
       this._detail();
+
+      getShopUser().then(res => {
+        // 设置分享
+        let shareParams = {
+          title: `${res.merchantName}`, // 分享标题
+          desc: "", // 分享内容
+          imgUrl: '',
+          // #ifdef H5
+          pagePath: `${window.location.protocol}//mall.${this.$constant.firstHost}.com/#/pages/home/index?account=${res.merchantId}&fromUserId=${res.id}`,
+          // #endif
+          // #ifndef H5
+          pagePath: `/pages/home/index?fromUserId=${res.id}`
+          // #endif
+        };
+        this.jweixinFn(shareParams);
+      });
+
     },
     },
     _detail() {
     _detail() {
       getMainIndex().then(res => {
       getMainIndex().then(res => {

+ 0 - 1
mall/src/pages/interest/invite.vue

@@ -112,7 +112,6 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import AlertModule from "@/components/plugin/alert";
 import AlertModule from "@/components/plugin/alert";
 import AppShareMask from "@/components/module/app-share-mask";
 import AppShareMask from "@/components/module/app-share-mask";
 import { share } from "@/mixins";
 import { share } from "@/mixins";
-// api
 import { getShopUser } from "@/utils/auth";
 import { getShopUser } from "@/utils/auth";
 import { getList, getProfile } from "@/api/invite";
 import { getList, getProfile } from "@/api/invite";
 export default {
 export default {