my.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. // pages/my/my.js
  2. const app = getApp()
  3. import http from "../../utils/http"
  4. import util from "../../utils/util"
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. moreList:[
  11. {img:'../../static/index/my/my-5.png',title:'加入商家',url:'/service/merchant/merchant'},
  12. {img:'../../static/index/my/my-7.png',title:'提现绑定',url:'/service/account/account'},
  13. {img:'../../static/index/my/my-8.png',title:'平台公告',url:'/service/notice/notice'},
  14. {img:'../../static/index/my/my-9.png',title:'我的评价',url:'/service/comments/comments'},
  15. {img:'../../static/index/my/my-10.png',title:'培训中心',url: '/service/exercise/exercise'},
  16. {img:'../../static/index/my/my-11.png',title:'联系客服'},
  17. {img:'../../static/index/my/my-12.png',title:'意见反馈',url:'/service/feedback/feedback'},
  18. ],
  19. info: '',
  20. config: ''
  21. },
  22. /**
  23. * 生命周期函数--监听页面加载
  24. */
  25. onLoad(options) {
  26. },
  27. onLoadConfig(option){
  28. this.setData({
  29. config: app.globalData.config
  30. })
  31. },
  32. toserve(){
  33. util.authSkip('/service/serveList/serveList')
  34. },
  35. // 跳转信用
  36. tocredit(){
  37. util.authSkip('/service/credit/credit')
  38. },
  39. // 跳转余额
  40. toBalance(e){
  41. util.authSkip('/service/balance/balance?type='+e.currentTarget.dataset.type)
  42. },
  43. // 跳转保证金
  44. toEarnestMoney(){
  45. util.authSkip('/service/earnestMoney/earnestMoney')
  46. },
  47. toSet(){
  48. util.authSkip('/service/set/set')
  49. },
  50. toLogin(){
  51. util.skip('/service/login/login')
  52. },
  53. toServel(e){
  54. util.authSkip(e.currentTarget.dataset.url)
  55. },
  56. getInfo(){
  57. if(!wx.getStorageSync('token')) return
  58. http.post('skill/skillindex','',!this.data.info).then(res => {
  59. this.data.moreList[3].url = '/service/comments/comments?type=skill&id='+res.data.skill.id
  60. this.setData({
  61. info: res.data,
  62. moreList: this.data.moreList
  63. })
  64. })
  65. },
  66. /**
  67. * 生命周期函数--监听页面初次渲染完成
  68. */
  69. onReady() {
  70. },
  71. /**
  72. * 生命周期函数--监听页面显示
  73. */
  74. onShow() {
  75. this.getInfo()
  76. },
  77. /**
  78. * 生命周期函数--监听页面隐藏
  79. */
  80. onHide() {
  81. },
  82. /**
  83. * 生命周期函数--监听页面卸载
  84. */
  85. onUnload() {
  86. },
  87. /**
  88. * 页面相关事件处理函数--监听用户下拉动作
  89. */
  90. onPullDownRefresh() {
  91. },
  92. /**
  93. * 页面上拉触底事件的处理函数
  94. */
  95. onReachBottom() {
  96. },
  97. /**
  98. * 用户点击右上角分享
  99. */
  100. onShareAppMessage() {
  101. }
  102. })