// pages/release/release.js // 获取应用实例 const app = getApp() Page({ data: { currentIndex: 3, user: { chatHeads: "https://wx.qlogo.cn/mmopen/vi_32/GhKAicgjqaCK1oZDfibe4ciaBWicWDnMFqibzWU0qp5diaE8tatUQCyTpDvlJIHJTbVprC1Dbwjh5WkWcgdmlO4VicJ8w/132", name: "微信昵称微信昵称微微信微信昵称微信昵称微微信", isPartner: true, address: "上海市·徐汇区", // customerId:666967, customerId:666678, }, listData: [ { title: "我发布的需求", code: "my-release", }, { title: "我收藏的需求", code: "my-collect", }, { title: "我关注的类型", code: "my-attention", }, { title: "联系客服", code: "my-contact", }, ], }, // 路由跳转 goRouterPage(e) { let code = e.currentTarget.dataset.code; let customerid = this.data.user.customerId; let url = ""; // 前往主页 if (code == 'homepage') { url = "/pages/index/components/homepage/homepage"; } // 前往发布的需求 if (code == 'my-release') { url = "/pages/myModule/components/myRelease/myRelease"; } // 前往发布的需求 if (code == 'my-release') { url = "/pages/myModule/components/myRelease/myRelease"; } // 前往关注的类型 if (code == 'my-attention') { url = "/pages/myModule/components/myAttention/myAttention"; } wx.navigateTo({ url, success: function (res) { // 通过eventChannel向被打开页面传送数据 res.eventChannel.emit('customerid', { customerid }) } }) }, })