helpDetail.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // pages/personal/helpDetail/helpDetail.js
  2. var app = getApp()
  3. const util = require('../../../utils/utils.js')
  4. Page({
  5. data: {
  6. show: '',
  7. currentNum: 0,
  8. inputVal: '',
  9. phone:[],
  10. img:app.globalData.imgUrl
  11. },
  12. onLoad: function (options) {
  13. console.log(options.show)
  14. let that = this;
  15. var phones = wx.getStorageSync('home').customer_service_phone
  16. this.setData({
  17. phone: this.data.phone.concat(phones),
  18. show: options.show
  19. })
  20. },
  21. input(e) {
  22. if (e.detail.value) {
  23. this.setData({
  24. currentNum: e.detail.cursor,
  25. inputVal: e.detail.value
  26. })
  27. }
  28. },
  29. refund(){
  30. wx.navigateTo({
  31. url: '/pages/personal/deposit/deposit',
  32. })
  33. },
  34. rule(){
  35. wx.navigateTo({
  36. url: '/pages/accounting_rules/accounting_rules',
  37. })
  38. },
  39. card(){
  40. wx.navigateTo({
  41. url: '/pages/personal/mine/mine',
  42. })
  43. },
  44. submit: util.throttle(function (e) {
  45. var that = this;
  46. let len = that.data.nowLength
  47. if (!that.data.inputVal) {
  48. wx.showModal({
  49. title: '提示',
  50. content: '反馈信息不能为空',
  51. })
  52. } else {
  53. //提交反馈接口
  54. if (that.data.currentNum < 10) {
  55. wx.showModal({
  56. title: '提示',
  57. content: '反馈信息不能小于10个字',
  58. })
  59. } else {
  60. if (app.globalData.req) {
  61. var data = {
  62. question: that.data.inputVal,
  63. area_id: wx.getStorageSync('home').id
  64. }
  65. app.request('/question', data, 'POST', app.globalData.req).then(res => {
  66. console.log(res)
  67. 200 == res.statusCode && wx.showToast({
  68. title: '提交成功',
  69. }), that.setData({
  70. currentNum: 0,
  71. inputVal: ''
  72. })
  73. }).catch(err => {
  74. console.log(err)
  75. })
  76. } else {
  77. wx.showToast({
  78. title: '您的操作过于频繁,请稍后再试~',
  79. icon: 'none'
  80. })
  81. }
  82. }
  83. }
  84. }, 1000),
  85. service(){
  86. var phone = this.data.phone[0];
  87. if(phone!==''&&phone!==undefined){
  88. wx.makePhoneCall({
  89. phoneNumber: phone,
  90. })
  91. }else{
  92. wx.makePhoneCall({
  93. phoneNumber:"037163211915",
  94. })
  95. }
  96. },
  97. onReady: function () {
  98. },
  99. onShow: function () {
  100. },
  101. onHide: function () {
  102. },
  103. onUnload: function () {
  104. },
  105. onPullDownRefresh: function () {
  106. },
  107. onReachBottom: function () {
  108. }
  109. })