my.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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-1.png',title:'加入申请',url:'/service/applicant/applicant'},
  12. {img:'../../static/index/my/my-2.png',title:'意见反馈',url:'/service/feedback/feedback'},
  13. {img:'../../static/index/my/my-3.png',title:'平台公告',url:'/service/notice/notice'},
  14. {img:'../../static/index/my/my-4.png',title:'店铺评价',url:'/service/comments/comments'},
  15. {img:'../../static/index/my/my-5.png',title:'培训中心',url:'/service/exercise/exercise'},
  16. {img:'../../static/index/my/my-6.png',title:'联系客服'},
  17. {img:'../../static/index/my/my-7.png',title:'提现绑定',url:'/service/account/account'},
  18. {img:'../../static/index/my/my-8.png',title:'提现审核',url:'../../service/txAudit/txAudit'},
  19. {img:'../../static/index/my/my-9.png',title:'提现设置',url:'../../service/txIntendant/txIntendant'},
  20. {img:'../../static/index/my/my-11.png',title:'优惠券管理',url:'/service/yhq/yhq'},
  21. {img:'../../static/index/my/my-10.png',title:'设置',url:'/service/set/set'},
  22. ],
  23. service:false,
  24. info: '',
  25. config: ''
  26. },
  27. onLoadConfig(option){
  28. this.setData({
  29. config: app.globalData.config
  30. })
  31. },
  32. copy(event){
  33. wx.setClipboardData({
  34. data: ``+event.currentTarget.dataset.content,
  35. success (res) {
  36. util.toast('已复制')
  37. },
  38. fail:(e)=>{
  39. console.log(e)
  40. }
  41. })
  42. },
  43. toServel(e){
  44. util.authSkip(e.currentTarget.dataset.url)
  45. },
  46. // 跳转余额
  47. toBalance(){
  48. util.authSkip('/service/balance/balance')
  49. },
  50. //保证金
  51. toEarnestMoney(){
  52. util.authSkip('/service/earnestMoney/earnestMoney')
  53. },
  54. // 跳转服务者
  55. toserviceStaff(){
  56. util.authSkip('/service/serviceStaff/serviceStaff')
  57. },
  58. //跳转平台项目
  59. toserveList(){
  60. util.authSkip('/service/serveList/serveList')
  61. },
  62. //跳转店铺项目
  63. tostoreItem(){
  64. util.authSkip('/service/toreItem/toreItem')
  65. },
  66. tologin(){
  67. util.skip('/service/login/login')
  68. },
  69. getInfo(){
  70. if(!wx.getStorageSync('token')) return
  71. http.post('shop/shopindex','',!this.data.info).then(res => {
  72. this.data.moreList[3].url = '/service/comments/comments?type=shop&id='+res.data.shopInfo.id
  73. this.setData({
  74. info: res.data,
  75. moreList: this.data.moreList
  76. })
  77. })
  78. },
  79. /**
  80. * 生命周期函数--监听页面加载
  81. */
  82. onLoad(options) {
  83. },
  84. /**
  85. * 生命周期函数--监听页面显示
  86. */
  87. onShow() {
  88. this.getInfo()
  89. },
  90. /**
  91. * 生命周期函数--监听页面隐藏
  92. */
  93. onHide() {
  94. },
  95. /**
  96. * 生命周期函数--监听页面卸载
  97. */
  98. onUnload() {
  99. },
  100. /**
  101. * 页面相关事件处理函数--监听用户下拉动作
  102. */
  103. onPullDownRefresh() {
  104. },
  105. /**
  106. * 页面上拉触底事件的处理函数
  107. */
  108. onReachBottom() {
  109. },
  110. /**
  111. * 用户点击右上角分享
  112. */
  113. onShareAppMessage() {
  114. }
  115. })