123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418 |
- // pages/record/record.js
- import {
- xcxpdjl,
- xcxyyjl
- } from "../../apis/index"
- import {
- getYytjjl
- } from "../../apis/sfzy"
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- // 大 tabbar
- bigTabBar: [{
- label: "排队取号",
- value: 0
- },
- {
- label: "税费争议",
- value: 1
- }
- ],
- bigTabBarIndex: 0,
- // 小 tabbar
- tabbar: [{
- label: "手机取号记录",
- value: 1
- },
- {
- label: "预约取号记录",
- value: 1
- }
- ],
- tabbarIndex: 0,
- // 小 tabbar1
- tabbar1: [{
- label: "在线调节记录",
- value: 1
- },
- {
- label: "预约调节记录",
- value: 1
- }
- ],
- tabbar1Index: 0,
- // 下拉刷新状态
- isBrush: false,
- // 排队叫号排队记录
- pdjlList: [],
- pdjlPage: 1,
- // 排队叫号预约记录
- yyjlList: [],
- yyjlPage: 1,
- // 税费争议在线记录
- sfzyZxtjPage: 1,
- sfzyZxtjList: [],
- // 税费争议预约记录
- sfzyYyjlPage: 1,
- sfzyYyjlList: []
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- let that = this
- },
- bigTabBarAction(e) {
- let that = this
- let item = e.currentTarget.dataset.item
- let index = e.currentTarget.dataset.index
- that.setData({
- bigTabBarIndex: index
- })
- if (index == 0) {
- if (that.data.pdjlList.length == 0) {
- that.init()
- }
- }
- if (index == 1) {
- if (that.data.yyjlList.length == 0) {
- that.init()
- }
- }
- },
- init(e) {
- let that = this
- let bigTabBarIndex = that.data.bigTabBarIndex
- if (bigTabBarIndex == 0) {
- let tabbarIndex = that.data.tabbarIndex
- if (tabbarIndex == 0) {
- that.getPdjl()
- } else if (tabbarIndex == 1) {
- that.getYyjl()
- }
- } else if (bigTabBarIndex == 1) {
- let tabbar1Index = that.data.tabbar1Index
- if (tabbar1Index == 0) {
- that.getSfzyZxjl()
- } else if (tabbar1Index == 1) {
- that.getSfzyYyjl()
- }
- }
- },
- /** 排队取号 */
- downBrush(e) {
- let that = this
- let type = e.currentTarget.dataset.type
- if (type == 0) {
- that.setData({
- pdjlPage: 1,
- pdjlList: []
- })
- that.getPdjl()
- } else if (type == 1) {
- that.setData({
- yyjlPage: 1,
- yyjlList: []
- })
- that.getYyjl()
- }
- },
- upBrush(e) {
- let that = this
- let type = e.currentTarget.dataset.type
- if (type == 0) {
- that.getPdjl()
- } else if (type == 1) {
- that.getYyjl()
- }
- },
- tabbarAction(e) {
- let that = this
- let index = e.currentTarget.dataset.index || 0
- if (index == 0) {
- if (that.data.pdjlList.length == 0) {
- that.setData({
- pdjlPage: 1,
- pdjlList: []
- })
- that.getPdjl()
- }
- } else if (index == 1) {
- if (that.data.yyjlList.length == 0) {
- that.setData({
- yyjlPage: 1,
- yyjlList: []
- })
- that.getYyjl()
- }
- }
- that.setData({
- tabbarIndex: index
- })
- },
- getPdjl() {
- let that = this
- wx.showLoading({
- title: '正在查询取号记录...',
- })
- let form = {
- unionid: wx.getStorageSync('PUBLIC_ID').unionid,
- sjDm: "",
- pageNum: that.data.pdjlPage
- }
- xcxpdjl(form).then(res => {
- wx.hideLoading()
- that.setData({
- isBrush: false
- })
- if (res.code == 200) {
- if (res.list.length > 0) {
- let pdjllist = that.data.pdjlList
- pdjllist = [...pdjllist, ...res.list]
- that.setData({
- pdjlList: pdjllist,
- pdjlPage: that.data.pdjlPage + 1
- })
- }
- }
- })
- },
- getYyjl() {
- let that = this
- wx.showLoading({
- title: '正在查询预约记录...',
- })
- let form = {
- unionid: wx.getStorageSync('PUBLIC_ID').unionid,
- sjDm: "",
- pageNum: that.data.yyjlPage
- }
- xcxyyjl(form).then(res => {
- wx.hideLoading()
- that.setData({
- isBrush: false
- })
- if (res.code == 200) {
- if (res.list.length > 0) {
- let yyjlList = that.data.yyjlList
- yyjlList = [...yyjlList, ...res.list]
- that.setData({
- yyjlList: yyjlList,
- yyjlPage: that.data.yyjlPage + 1
- })
- }
- }
- })
- },
- pdjl(e) {
- let that = this
- let item = e.currentTarget.dataset.item
- wx.navigateTo({
- url: '../recordPages/pdjl/pdjl?infos=' + JSON.stringify(item),
- })
- },
- yyjl(e) {
- let that = this
- let item = e.currentTarget.dataset.item
- wx.navigateTo({
- url: '../recordPages/yyjl/yyjl?infos=' + JSON.stringify(item),
- })
- },
- /** 税费争议 */
- downBrush1(e) {
- let that = this
- let type = e.currentTarget.dataset.type
- if (type == 0) {
- that.setData({
- sfzyZxtjPage: 1,
- sfzyZxtjList: []
- })
- that.getSfzyZxjl()
- } else if (type == 1) {
- that.setData({
- sfzyYyjlPage: 1,
- sfzyYyjlList: []
- })
- that.getSfzyYyjl()
- }
- },
- upBrush1(e) {
- let that = this
- let type = e.currentTarget.dataset.type
- if (type == 0) {
- that.getSfzyZxjl()
- } else if (type == 1) {
- that.getSfzyYyjl()
- }
- },
- tabbar1Action1(e) {
- let that = this
- let index = e.currentTarget.dataset.index || 0
- if (index == 0) {
- if (that.data.sfzyZxtjList.length == 0) {
- that.setData({
- sfzyZxtjPage: 1,
- sfzyZxtjList: []
- })
- that.getSfzyZxjl()
- }
- } else if (index == 1) {
- if (that.data.sfzyYyjlList.length == 0) {
- that.setData({
- sfzyYyjlPage: 1,
- sfzyYyjlList: []
- })
- that.getSfzyYyjl()
- }
- }
- that.setData({
- tabbar1Index: index
- })
- },
- getSfzyZxjl() {
- let that = this
- wx.showLoading({
- title: '正在查询在线调节记录...',
- })
- let form = {
- unionid: wx.getStorageSync('PUBLIC_ID').unionid,
- tjlx: "2",
- pageNum: that.data.sfzyZxtjPage
- }
- getYytjjl(form).then(res => {
- wx.hideLoading()
- that.setData({
- isBrush: false
- })
- if (res.code == 200) {
- if (res.data.records.length > 0) {
- let sfzyZxtjList = that.data.sfzyZxtjList
- sfzyZxtjList = [...sfzyZxtjList, ...res.data.records]
- that.setData({
- sfzyZxtjList: sfzyZxtjList,
- sfzyZxtjPage: that.data.sfzyZxtjPage + 1
- })
- }
- }
- })
- },
- getSfzyYyjl() {
- let that = this
- wx.showLoading({
- title: '正在查询在线调节记录...',
- })
- let form = {
- unionid: wx.getStorageSync('PUBLIC_ID').unionid,
- tjlx: "1",
- pageNum: that.data.sfzyYyjlPage
- }
- getYytjjl(form).then(res => {
- wx.hideLoading()
- that.setData({
- isBrush: false
- })
- if (res.code == 200) {
- if (res.data.records.length > 0) {
- let sfzyYyjlList = that.data.sfzyYyjlList
- sfzyYyjlList = [...sfzyYyjlList, ...res.data.records]
- that.setData({
- sfzyYyjlList: sfzyYyjlList,
- sfzyYyjlPage: that.data.sfzyYyjlPage + 1
- })
- }
- }
- })
- },
- sfzzYyjl(e) {
- let that = this
- let item = e.currentTarget.dataset.item
- wx.navigateTo({
- url: '../recordPages/sfzyYyjl/sfzyYyjl?infos=' + JSON.stringify(item),
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- let that = this
- that.setData({
- pdjlPage: 1,
- pdjlList: [],
- yyjlPage: 1,
- yyjlList: [],
- sfzyZxtjPage: 1,
- sfzyZxtjList: [],
- sfzyYyjlPage: 1,
- sfzyYyjlList: []
- })
- that.init()
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- }
- })
|