业务交流通
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. },
  11. isLogin: false,
  12. listData: [
  13. {
  14. title: "我发布的需求",
  15. code: "my-release",
  16. },
  17. {
  18. title: "我收藏的需求",
  19. code: "my-collect",
  20. },
  21. {
  22. title: "我关注的类型",
  23. code: "my-attention",
  24. },
  25. {
  26. title: "联系客服",
  27. code: "my-contact",
  28. },
  29. ],
  30. },
  31. /**
  32. * 生命周期函数--监听页面加载
  33. */
  34. onLoad: function (options) {
  35. if (app.globalData.businessCommunicationCustomer) {
  36. this.setData({
  37. user: app.globalData.businessCommunicationCustomer,
  38. isLogin:true
  39. })
  40. console.log(`------------------当前登录用户-----------------------`)
  41. console.log(app.globalData.businessCommunicationCustomer);
  42. console.log(`------------------当前登录用户-----------------------`)
  43. }
  44. },
  45. // 前往登录页
  46. goLogin(e) {
  47. app.goLogin();
  48. },
  49. // 路由跳转
  50. goRouterPage(e) {
  51. let code = e.currentTarget.dataset.code;
  52. let customerid = this.data.user.customerId;
  53. if (!customerid && code != 'my-contact') {
  54. app.goLogin();
  55. return
  56. }
  57. let url = "";
  58. // 前往主页
  59. if (code == 'homepage') {
  60. url = "/pages/index/components/homepage/homepage";
  61. }
  62. // 前往发布的需求
  63. if (code == 'my-release') {
  64. url = "/pages/myModule/components/myRelease/myRelease";
  65. }
  66. // 前往收藏的需求
  67. if (code == 'my-collect') {
  68. url = "/pages/myModule/components/myCollect/myCollect";
  69. }
  70. // 前往关注的类型
  71. if (code == 'my-attention') {
  72. url = "/pages/myModule/components/myAttention/myAttention";
  73. }
  74. // 前往联系客服
  75. if (code == 'my-contact') {
  76. url = "/pages/outLink/outLink";
  77. }
  78. wx.navigateTo({
  79. url,
  80. success: function (res) {
  81. // 通过eventChannel向被打开页面传送数据
  82. res.eventChannel.emit('customerid', { customerid })
  83. }
  84. })
  85. },
  86. // 退出登录
  87. exitLogin(){
  88. wx.removeStorageSync('userInfo');
  89. wx.removeStorageSync('businessCommunicationCustomer');
  90. app.globalData.businessCommunicationCustomer = null;
  91. app.globalData.customerId = null;
  92. this.setData({
  93. user:{},
  94. isLogin:false
  95. })
  96. },
  97. })