소스 검색

商城设置分享

wangn 5 년 전
부모
커밋
028b6a53a3
1개의 변경된 파일21개의 추가작업 그리고 3개의 파일을 삭제
  1. 21 3
      mallApp/src/pages/home/course.vue

+ 21 - 3
mallApp/src/pages/home/course.vue

@@ -19,7 +19,7 @@
       <block v-else>
         <view class="nodata">
           <view>
-            <image src="http://img.huaml.com/common/nodata.png"></image>
+            <image :src="`${constant.imgUrl}/common/nodata.png`"></image>
             <view>暂无课程~</view>
           </view>
         </view>
@@ -30,8 +30,10 @@
 </template>
 
 <script>
-import AppWrapperEmpty from '@/components/app-wrapper-empty'
-import { pxClassList } from '@/api/px-class/index'
+import AppWrapperEmpty from '@/components/app-wrapper-empty';
+import { pxClassList } from '@/api/px-class/index';
+import { share } from "@/mixins";
+import { getShopUser } from "@/utils/auth";
 export default {
   components: {
 		AppWrapperEmpty
@@ -42,6 +44,7 @@ export default {
       pageList: []
     }
   },
+  mixins: [share],
   onShow () {
     uni.hideTabBar();
   },
@@ -51,6 +54,21 @@ export default {
     },
     init() {
       this.pxClassList()
+      let account = uni.getStorageSync('account')
+      
+      getShopUser().then(res => {
+        // 设置分享
+        let shareParams = {
+          title: `${res.name}`, // 分享标题
+          desc: "", // 分享内容
+          imgUrl: '',
+          // #ifndef H5
+          pagePath: `/pages/home/course?fromUserId=${res.id}&account=${account}`
+          // #endif
+        }
+        this.jweixinFn(shareParams)
+        console.log('分享地址',`/pages/home/course?fromUserId=${res.id}&account=${account}`)
+      })
     },
     signUp(item) {
       this.pageTo({