1
0

mine.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. // pages/mine/mine.js
  2. const app = getApp();
  3. const utils = require("../../utils/http");
  4. Page({
  5. data: {
  6. unreadNum: 0,
  7. personobj: {},
  8. mineObj: {},
  9. imgUrl: app.globalData.imgUrl,
  10. unfutureflag: false,
  11. paper: 0
  12. },
  13. onLoad: function () {
  14. var that = this;
  15. wx.showLoading({
  16. title: '加载中...',
  17. })
  18. this.setData({
  19. unreadNum: app.globalData.unreadNum
  20. })
  21. setTimeout(function () {
  22. wx.hideLoading()
  23. }, 1000)
  24. },
  25. closetap: function () {
  26. this.setData({
  27. unfutureflag: false
  28. })
  29. },
  30. unreadMsg: function () {
  31. var that = this;
  32. app.globalData.tokenflag = true;
  33. utils.$post({
  34. url: app.globalData.webUrl + 'api/user_msg/unreadCount',
  35. header: {
  36. 'Authorization': 'bearer ' + app.globalData.token
  37. },
  38. data: {},
  39. success: function (res) {
  40. if (res.data.code == '0') {
  41. that.setData({
  42. unreadNum: res.data.data > 99 ? '99+' : res.data.data,
  43. paper: res.data.paper
  44. })
  45. app.globalData.unreadNum = res.data.data > 99 ? '99+' : res.data.data;
  46. }
  47. }
  48. })
  49. },
  50. designerap() {
  51. wx.navigateTo({
  52. url: '/mycustomer/pages/setdesigner/setdesigner'
  53. })
  54. },
  55. onReady: function () {
  56. },
  57. onShow: function () {
  58. var that = this;
  59. that.setData({
  60. personobj: app.globalData.personMsg,
  61. })
  62. app.globalData.tabflag = true;
  63. // that.getTabBar().setData({
  64. // tabflag: true
  65. // })
  66. // if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  67. // this.getTabBar().setData({
  68. // selected: 3
  69. // })
  70. // }
  71. that.unreadMsg();
  72. },
  73. guestap: function (e) {
  74. var that = this;
  75. wx.navigateTo({
  76. url: '/mycustomer/pages/guestlook/guestlook',
  77. })
  78. },
  79. changeTap: function () {
  80. wx.navigateTo({
  81. url: '/pages/change/change'
  82. })
  83. },
  84. talktap: function () {
  85. // wx.navigateTo({
  86. // url: '/mycustomer/pages/mytalkskill/mytalkskill'
  87. // })
  88. wx.navigateTo({
  89. url: '/mycustomer/pages/mycreation/mycreation'
  90. })
  91. },
  92. sreenumtap() {
  93. wx.navigateTo({
  94. url: '/mycustomer/pages/screenset/screenset'
  95. })
  96. },
  97. mysharetap: function (e) {
  98. var that = this;
  99. wx.navigateTo({
  100. url: '/mycustomer/pages/myshare/myshare'
  101. })
  102. },
  103. mycollectap: function (e) {
  104. var that = this;
  105. wx.navigateTo({
  106. url: '/mycustomer/pages/mycollect/mycollect'
  107. })
  108. },
  109. mycompanytap: function () {
  110. wx.navigateTo({
  111. url: '/mycustomer/pages/mycompany/mycompany'
  112. })
  113. },
  114. teammanagertap: function () {
  115. wx.navigateTo({
  116. url: '/mycustomer/pages/managerdata/managerdata'
  117. })
  118. },
  119. setap: function () {
  120. wx.navigateTo({
  121. url: '/mycustomer/pages/set/set'
  122. })
  123. },
  124. persontap: function () {
  125. wx.navigateTo({
  126. url: '/mycustomer/pages/scoremsg/scoremsg'
  127. })
  128. },
  129. informTap: function (e) {
  130. var that = this;
  131. wx.navigateTo({
  132. url: '/mycustomer/pages/information/information',
  133. })
  134. },
  135. setTap: function () {
  136. var that = this;
  137. this.setData({
  138. unfutureflag: true
  139. })
  140. },
  141. servicetap: function (e) {
  142. wx.navigateTo({
  143. url: '/mycustomer/pages/scoremsg/scoremsg',
  144. })
  145. },
  146. testap: function (e) {
  147. wx.navigateTo({
  148. url: '/index/pages/testapprove/testapprove'
  149. })
  150. },
  151. aboutap: function (e) {
  152. wx.navigateTo({
  153. url: '/mycustomer/pages/about/about'
  154. })
  155. },
  156. /**
  157. * 生命周期函数--监听页面隐藏
  158. */
  159. onHide: function () {
  160. },
  161. /**
  162. * 生命周期函数--监听页面卸载
  163. */
  164. onUnload: function () {
  165. },
  166. /**
  167. * 页面相关事件处理函数--监听用户下拉动作
  168. */
  169. onPullDownRefresh: function () {
  170. this.unreadMsg();
  171. wx.stopPullDownRefresh();
  172. },
  173. dothis: function () {
  174. },
  175. /**
  176. * 页面上拉触底事件的处理函数
  177. */
  178. onReachBottom: function () {
  179. }
  180. })