zxtj.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // pages/taxDisputes/taxDisputesPages/zxtj/zxtj.js
  2. import {
  3. selectTel,
  4. sfzyDhtjLog
  5. } from "../../../../apis/sfzy"
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. hall: "",
  12. phones: []
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad(options) {
  18. let that = this
  19. that.getPhones()
  20. },
  21. getPhones() {
  22. let that = this
  23. wx.showLoading({
  24. title: '正在获取大厅信息...',
  25. })
  26. let form = {
  27. bsfwtDm: wx.getStorageSync('MY_HALL').bsfwtDm
  28. }
  29. selectTel(form).then(res => {
  30. wx.hideLoading()
  31. if (res.code == 200) {
  32. that.setData({
  33. hall: wx.getStorageSync('MY_HALL').bsfwtmc,
  34. phones: [res.dhhm, res.sjhm]
  35. })
  36. } else {
  37. wx.showToast({
  38. title: res.msg || res.message,
  39. icon: "none"
  40. })
  41. }
  42. })
  43. },
  44. call(e) {
  45. let that = this
  46. let phone = e.currentTarget.dataset.phone
  47. wx.makePhoneCall({
  48. phoneNumber: phone,
  49. success(res) {
  50. that.addLog()
  51. }
  52. })
  53. },
  54. calls() {
  55. let that = this
  56. let phones = that.data.phones
  57. wx.showActionSheet({
  58. itemList: phones,
  59. success(res) {
  60. wx.makePhoneCall({
  61. phoneNumber: phones[res.tapIndex],
  62. success(res) {
  63. that.addLog()
  64. }
  65. })
  66. },
  67. })
  68. },
  69. addLog() {
  70. let that = this
  71. let hall = wx.getStorageSync('MY_HALL')
  72. let userinfo = wx.getStorageSync('USERINFO')
  73. let form = {
  74. bsfwtDm: hall.bsfwtDm,
  75. unionid: wx.getStorageSync('PUBLIC_ID').unionid,
  76. xm: userinfo.name,
  77. sfzh: userinfo.idcard,
  78. sjhm: userinfo.phone
  79. }
  80. sfzyDhtjLog(form).then(res => {
  81. console.log(res)
  82. })
  83. },
  84. /**
  85. * 生命周期函数--监听页面初次渲染完成
  86. */
  87. onReady() {
  88. },
  89. /**
  90. * 生命周期函数--监听页面显示
  91. */
  92. onShow() {
  93. },
  94. /**
  95. * 生命周期函数--监听页面隐藏
  96. */
  97. onHide() {
  98. },
  99. /**
  100. * 生命周期函数--监听页面卸载
  101. */
  102. onUnload() {
  103. },
  104. /**
  105. * 页面相关事件处理函数--监听用户下拉动作
  106. */
  107. onPullDownRefresh() {
  108. },
  109. /**
  110. * 页面上拉触底事件的处理函数
  111. */
  112. onReachBottom() {
  113. },
  114. /**
  115. * 用户点击右上角分享
  116. */
  117. onShareAppMessage() {
  118. }
  119. })