浏览代码

feature:增加h5多频多台的分享回调功能

zeng.chen 9 月之前
父节点
当前提交
9b7c9efbbc
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 1 1
      src/pages/share/channels.vue
  2. 5 1
      src/pages/share/list.vue

+ 1 - 1
src/pages/share/channels.vue

@@ -44,7 +44,7 @@ export default {
   methods: {
     getDetail(item) {
       uni.navigateTo({
-        url: `?page=/pages/share/list&channelId=${item.id}&userId=${this.userId}`,
+        url: `?page=/pages/share/list&channelId=${item.id}&userId=${this.userId}&categoryId=${this.categoryId}`,
       })
     },
   }

+ 5 - 1
src/pages/share/list.vue

@@ -56,13 +56,17 @@ export default {
     if (e.userId) {
       this.form.userId = e.userId
       this.form.channelId = e.channelId
+      this.form.categoryId = e.categoryId
       // 频道详情
       channelDetail({
         channelId: e.channelId,
+        categoryId: e.categoryId,
         userId: e.userId
       }).then(res => {
         if (res.code === 0) {
           this.data = res.data
+          // 返回给APP的
+          this.data.categoryId = this.data.categoryId ?? e.categoryId
         }
       })
       this.getList()
@@ -93,7 +97,7 @@ export default {
     // },
     // 打开app
     open() {
-      this.openApp(`?page=/mobile/channelSinglePage&channel=${this.data.channelId}&channelId=${this.data.id}`)
+      this.openApp(`?page=/mobile/channelSinglePage&channel=${this.data.channelId}&channelId=${this.data.id}&categoryId=${this.data.categoryId}`)
     }
   }
 }