业务交流通
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. onShow(){
  46. this.setData({
  47. currentIndex: 3
  48. })
  49. },
  50. // 前往登录页
  51. goLogin(e) {
  52. app.goLogin();
  53. },
  54. // 路由跳转
  55. goRouterPage(e) {
  56. let code = e.currentTarget.dataset.code;
  57. let customerid = this.data.user.customerId;
  58. if (!customerid && code != 'my-contact') {
  59. app.goLogin();
  60. return
  61. }
  62. let url = "";
  63. // 前往主页
  64. if (code == 'homepage') {
  65. url = "/pages/index/components/homepage/homepage";
  66. }
  67. // 前往发布的需求
  68. if (code == 'my-release') {
  69. url = "/pages/myModule/components/myRelease/myRelease";
  70. }
  71. // 前往收藏的需求
  72. if (code == 'my-collect') {
  73. url = "/pages/myModule/components/myCollect/myCollect";
  74. }
  75. // 前往关注的类型
  76. if (code == 'my-attention') {
  77. url = "/pages/myModule/components/myAttention/myAttention";
  78. }
  79. // 前往联系客服
  80. if (code == 'my-contact') {
  81. url = "/pages/outLink/outLink";
  82. }
  83. wx.navigateTo({
  84. url,
  85. success: function (res) {
  86. // 通过eventChannel向被打开页面传送数据
  87. res.eventChannel.emit('customerid', { customerid })
  88. }
  89. })
  90. },
  91. // 退出登录
  92. exitLogin(){
  93. wx.removeStorageSync('userInfo');
  94. wx.removeStorageSync('businessCommunicationCustomer');
  95. app.globalData.businessCommunicationCustomer = null;
  96. app.globalData.customerId = null;
  97. this.setData({
  98. user:{},
  99. isLogin:false
  100. })
  101. },
  102. /**
  103. * 用户点击右上角分享给朋友
  104. */
  105. onShareAppMessage() {
  106. return {
  107. title: "分享你一个需求交流平台!推荐你一起来关注~",
  108. imageUrl: '/images/home/ShareApp-index.png',
  109. path: 'pages/index/index'
  110. }
  111. },
  112. })