record.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. // pages/record/record.js
  2. import {
  3. xcxpdjl,
  4. xcxyyjl
  5. } from "../../apis/index"
  6. import {
  7. getYytjjl
  8. } from "../../apis/sfzy"
  9. Page({
  10. /**
  11. * 页面的初始数据
  12. */
  13. data: {
  14. // 大 tabbar
  15. bigTabBar: [{
  16. label: "排队取号",
  17. value: 0
  18. },
  19. {
  20. label: "税费争议",
  21. value: 1
  22. }
  23. ],
  24. bigTabBarIndex: 0,
  25. // 小 tabbar
  26. tabbar: [{
  27. label: "手机取号记录",
  28. value: 1
  29. },
  30. {
  31. label: "预约取号记录",
  32. value: 1
  33. }
  34. ],
  35. tabbarIndex: 0,
  36. // 小 tabbar1
  37. tabbar1: [{
  38. label: "在线调节记录",
  39. value: 1
  40. },
  41. {
  42. label: "预约调节记录",
  43. value: 1
  44. }
  45. ],
  46. tabbar1Index: 0,
  47. // 下拉刷新状态
  48. isBrush: false,
  49. // 排队叫号排队记录
  50. pdjlList: [],
  51. pdjlPage: 1,
  52. // 排队叫号预约记录
  53. yyjlList: [],
  54. yyjlPage: 1,
  55. // 税费争议在线记录
  56. sfzyZxtjPage: 1,
  57. sfzyZxtjList: [],
  58. // 税费争议预约记录
  59. sfzyYyjlPage: 1,
  60. sfzyYyjlList: []
  61. },
  62. /**
  63. * 生命周期函数--监听页面加载
  64. */
  65. onLoad(options) {
  66. let that = this
  67. },
  68. bigTabBarAction(e) {
  69. let that = this
  70. let item = e.currentTarget.dataset.item
  71. let index = e.currentTarget.dataset.index
  72. that.setData({
  73. bigTabBarIndex: index
  74. })
  75. if (index == 0) {
  76. if (that.data.pdjlList.length == 0) {
  77. that.init()
  78. }
  79. }
  80. if (index == 1) {
  81. if (that.data.yyjlList.length == 0) {
  82. that.init()
  83. }
  84. }
  85. },
  86. init(e) {
  87. let that = this
  88. let bigTabBarIndex = that.data.bigTabBarIndex
  89. if (bigTabBarIndex == 0) {
  90. let tabbarIndex = that.data.tabbarIndex
  91. if (tabbarIndex == 0) {
  92. that.getPdjl()
  93. } else if (tabbarIndex == 1) {
  94. that.getYyjl()
  95. }
  96. } else if (bigTabBarIndex == 1) {
  97. let tabbar1Index = that.data.tabbar1Index
  98. if (tabbar1Index == 0) {
  99. that.getSfzyZxjl()
  100. } else if (tabbar1Index == 1) {
  101. that.getSfzyYyjl()
  102. }
  103. }
  104. },
  105. /** 排队取号 */
  106. downBrush(e) {
  107. let that = this
  108. let type = e.currentTarget.dataset.type
  109. if (type == 0) {
  110. that.setData({
  111. pdjlPage: 1,
  112. pdjlList: []
  113. })
  114. that.getPdjl()
  115. } else if (type == 1) {
  116. that.setData({
  117. yyjlPage: 1,
  118. yyjlList: []
  119. })
  120. that.getYyjl()
  121. }
  122. },
  123. upBrush(e) {
  124. let that = this
  125. let type = e.currentTarget.dataset.type
  126. if (type == 0) {
  127. that.getPdjl()
  128. } else if (type == 1) {
  129. that.getYyjl()
  130. }
  131. },
  132. tabbarAction(e) {
  133. let that = this
  134. let index = e.currentTarget.dataset.index || 0
  135. if (index == 0) {
  136. if (that.data.pdjlList.length == 0) {
  137. that.setData({
  138. pdjlPage: 1,
  139. pdjlList: []
  140. })
  141. that.getPdjl()
  142. }
  143. } else if (index == 1) {
  144. if (that.data.yyjlList.length == 0) {
  145. that.setData({
  146. yyjlPage: 1,
  147. yyjlList: []
  148. })
  149. that.getYyjl()
  150. }
  151. }
  152. that.setData({
  153. tabbarIndex: index
  154. })
  155. },
  156. getPdjl() {
  157. let that = this
  158. wx.showLoading({
  159. title: '正在查询取号记录...',
  160. })
  161. let form = {
  162. unionid: wx.getStorageSync('PUBLIC_ID').unionid,
  163. sjDm: "",
  164. pageNum: that.data.pdjlPage
  165. }
  166. xcxpdjl(form).then(res => {
  167. wx.hideLoading()
  168. that.setData({
  169. isBrush: false
  170. })
  171. if (res.code == 200) {
  172. if (res.list.length > 0) {
  173. let pdjllist = that.data.pdjlList
  174. pdjllist = [...pdjllist, ...res.list]
  175. that.setData({
  176. pdjlList: pdjllist,
  177. pdjlPage: that.data.pdjlPage + 1
  178. })
  179. }
  180. }
  181. })
  182. },
  183. getYyjl() {
  184. let that = this
  185. wx.showLoading({
  186. title: '正在查询预约记录...',
  187. })
  188. let form = {
  189. unionid: wx.getStorageSync('PUBLIC_ID').unionid,
  190. sjDm: "",
  191. pageNum: that.data.yyjlPage
  192. }
  193. xcxyyjl(form).then(res => {
  194. wx.hideLoading()
  195. that.setData({
  196. isBrush: false
  197. })
  198. if (res.code == 200) {
  199. if (res.list.length > 0) {
  200. let yyjlList = that.data.yyjlList
  201. yyjlList = [...yyjlList, ...res.list]
  202. that.setData({
  203. yyjlList: yyjlList,
  204. yyjlPage: that.data.yyjlPage + 1
  205. })
  206. }
  207. }
  208. })
  209. },
  210. pdjl(e) {
  211. let that = this
  212. let item = e.currentTarget.dataset.item
  213. wx.navigateTo({
  214. url: '../recordPages/pdjl/pdjl?infos=' + JSON.stringify(item),
  215. })
  216. },
  217. yyjl(e) {
  218. let that = this
  219. let item = e.currentTarget.dataset.item
  220. wx.navigateTo({
  221. url: '../recordPages/yyjl/yyjl?infos=' + JSON.stringify(item),
  222. })
  223. },
  224. /** 税费争议 */
  225. downBrush1(e) {
  226. let that = this
  227. let type = e.currentTarget.dataset.type
  228. if (type == 0) {
  229. that.setData({
  230. sfzyZxtjPage: 1,
  231. sfzyZxtjList: []
  232. })
  233. that.getSfzyZxjl()
  234. } else if (type == 1) {
  235. that.setData({
  236. sfzyYyjlPage: 1,
  237. sfzyYyjlList: []
  238. })
  239. that.getSfzyYyjl()
  240. }
  241. },
  242. upBrush1(e) {
  243. let that = this
  244. let type = e.currentTarget.dataset.type
  245. if (type == 0) {
  246. that.getSfzyZxjl()
  247. } else if (type == 1) {
  248. that.getSfzyYyjl()
  249. }
  250. },
  251. tabbar1Action1(e) {
  252. let that = this
  253. let index = e.currentTarget.dataset.index || 0
  254. if (index == 0) {
  255. if (that.data.sfzyZxtjList.length == 0) {
  256. that.setData({
  257. sfzyZxtjPage: 1,
  258. sfzyZxtjList: []
  259. })
  260. that.getSfzyZxjl()
  261. }
  262. } else if (index == 1) {
  263. if (that.data.sfzyYyjlList.length == 0) {
  264. that.setData({
  265. sfzyYyjlPage: 1,
  266. sfzyYyjlList: []
  267. })
  268. that.getSfzyYyjl()
  269. }
  270. }
  271. that.setData({
  272. tabbar1Index: index
  273. })
  274. },
  275. getSfzyZxjl() {
  276. let that = this
  277. wx.showLoading({
  278. title: '正在查询在线调节记录...',
  279. })
  280. let form = {
  281. unionid: wx.getStorageSync('PUBLIC_ID').unionid,
  282. tjlx: "2",
  283. pageNum: that.data.sfzyZxtjPage
  284. }
  285. getYytjjl(form).then(res => {
  286. wx.hideLoading()
  287. that.setData({
  288. isBrush: false
  289. })
  290. if (res.code == 200) {
  291. if (res.data.records.length > 0) {
  292. let sfzyZxtjList = that.data.sfzyZxtjList
  293. sfzyZxtjList = [...sfzyZxtjList, ...res.data.records]
  294. that.setData({
  295. sfzyZxtjList: sfzyZxtjList,
  296. sfzyZxtjPage: that.data.sfzyZxtjPage + 1
  297. })
  298. }
  299. }
  300. })
  301. },
  302. getSfzyYyjl() {
  303. let that = this
  304. wx.showLoading({
  305. title: '正在查询在线调节记录...',
  306. })
  307. let form = {
  308. unionid: wx.getStorageSync('PUBLIC_ID').unionid,
  309. tjlx: "1",
  310. pageNum: that.data.sfzyYyjlPage
  311. }
  312. getYytjjl(form).then(res => {
  313. wx.hideLoading()
  314. that.setData({
  315. isBrush: false
  316. })
  317. if (res.code == 200) {
  318. if (res.data.records.length > 0) {
  319. let sfzyYyjlList = that.data.sfzyYyjlList
  320. sfzyYyjlList = [...sfzyYyjlList, ...res.data.records]
  321. that.setData({
  322. sfzyYyjlList: sfzyYyjlList,
  323. sfzyYyjlPage: that.data.sfzyYyjlPage + 1
  324. })
  325. }
  326. }
  327. })
  328. },
  329. sfzzYyjl(e) {
  330. let that = this
  331. let item = e.currentTarget.dataset.item
  332. wx.navigateTo({
  333. url: '../recordPages/sfzyYyjl/sfzyYyjl?infos=' + JSON.stringify(item),
  334. })
  335. },
  336. /**
  337. * 生命周期函数--监听页面初次渲染完成
  338. */
  339. onReady() {
  340. },
  341. /**
  342. * 生命周期函数--监听页面显示
  343. */
  344. onShow() {
  345. let that = this
  346. that.setData({
  347. pdjlPage: 1,
  348. pdjlList: [],
  349. yyjlPage: 1,
  350. yyjlList: [],
  351. sfzyZxtjPage: 1,
  352. sfzyZxtjList: [],
  353. sfzyYyjlPage: 1,
  354. sfzyYyjlList: []
  355. })
  356. that.init()
  357. },
  358. /**
  359. * 生命周期函数--监听页面隐藏
  360. */
  361. onHide() {
  362. },
  363. /**
  364. * 生命周期函数--监听页面卸载
  365. */
  366. onUnload() {
  367. },
  368. /**
  369. * 页面相关事件处理函数--监听用户下拉动作
  370. */
  371. onPullDownRefresh() {
  372. },
  373. /**
  374. * 页面上拉触底事件的处理函数
  375. */
  376. onReachBottom() {
  377. },
  378. /**
  379. * 用户点击右上角分享
  380. */
  381. onShareAppMessage() {
  382. }
  383. })