12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- // 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,
- isLogin: false,
- },
- listData: [
- {
- title: "我发布的需求",
- code: "my-release",
- },
- {
- title: "我收藏的需求",
- code: "my-collect",
- },
- {
- title: "我关注的类型",
- code: "my-attention",
- },
- {
- title: "联系客服",
- code: "my-contact",
- },
- ],
- },
- // 前往登录页
- goLogin(e) {
- app.goLogin();
- },
- // 路由跳转
- goRouterPage(e) {
- let code = e.currentTarget.dataset.code;
- let customerid = this.data.user.customerId;
- if(!customerid){
- app.goLogin();
- }
- 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";
- }
- // 前往联系客服
- if (code == 'my-contact') {
- url = "/pages/outLink/outLink";
- }
- wx.navigateTo({
- url,
- success: function (res) {
- // 通过eventChannel向被打开页面传送数据
- res.eventChannel.emit('customerid', { customerid })
- }
- })
- },
- })
|