业务交流通
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

index.js 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // pages/release/release.js
  2. // 获取应用实例
  3. const app = getApp()
  4. Page({
  5. data: {
  6. currentIndex: 3,
  7. user: {
  8. chatHeads: "https://wx.qlogo.cn/mmopen/vi_32/GhKAicgjqaCK1oZDfibe4ciaBWicWDnMFqibzWU0qp5diaE8tatUQCyTpDvlJIHJTbVprC1Dbwjh5WkWcgdmlO4VicJ8w/132",
  9. name: "微信昵称微信昵称微微信微信昵称微信昵称微微信",
  10. isPartner: true,
  11. address: "上海市·徐汇区",
  12. // customerId:666967,
  13. customerId: 666678,
  14. isLogin: false,
  15. },
  16. listData: [
  17. {
  18. title: "我发布的需求",
  19. code: "my-release",
  20. },
  21. {
  22. title: "我收藏的需求",
  23. code: "my-collect",
  24. },
  25. {
  26. title: "我关注的类型",
  27. code: "my-attention",
  28. },
  29. {
  30. title: "联系客服",
  31. code: "my-contact",
  32. },
  33. ],
  34. },
  35. // 前往登录页
  36. goLogin(e) {
  37. app.goLogin();
  38. },
  39. // 路由跳转
  40. goRouterPage(e) {
  41. let code = e.currentTarget.dataset.code;
  42. let customerid = this.data.user.customerId;
  43. if(!customerid){
  44. app.goLogin();
  45. }
  46. let url = "";
  47. // 前往主页
  48. if (code == 'homepage') {
  49. url = "/pages/index/components/homepage/homepage";
  50. }
  51. // 前往发布的需求
  52. if (code == 'my-release') {
  53. url = "/pages/myModule/components/myRelease/myRelease";
  54. }
  55. // 前往发布的需求
  56. if (code == 'my-release') {
  57. url = "/pages/myModule/components/myRelease/myRelease";
  58. }
  59. // 前往关注的类型
  60. if (code == 'my-attention') {
  61. url = "/pages/myModule/components/myAttention/myAttention";
  62. }
  63. // 前往联系客服
  64. if (code == 'my-contact') {
  65. url = "/pages/outLink/outLink";
  66. }
  67. wx.navigateTo({
  68. url,
  69. success: function (res) {
  70. // 通过eventChannel向被打开页面传送数据
  71. res.eventChannel.emit('customerid', { customerid })
  72. }
  73. })
  74. },
  75. })