业务交流通
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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