123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- // pages/recordPages/pdjl/pdjl.js
- import {
- xcxsxph
- } from "../../../apis/index"
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- infos: {},
- nowTime: "",
- timer: null
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- let that = this
- that.init(options)
- that.setData({
- nowTime: that.getTime()
- })
- },
- init(e) {
- let that = this
- if (e) {
- if (e.infos) {
- let infos = JSON.parse(e.infos)
- that.setData({
- infos: infos
- })
- that.sx()
- }
- }
- },
- sx() {
- let that = this
- let infos = that.data.infos
- wx.showLoading({
- title: '加载中...',
- })
- xcxsxph({
- bsfwtDm: infos.bsfwtDm,
- phhm: infos.ticketNum,
- qpsj: infos.createTime
- }).then(res => {
- wx.hideLoading()
- if (res.code == 200) {
- that.setData({
- infos: res.data
- })
- if (res.data.phzt == 0) {} else {
- if (res.data.fwztDm == 0) {
- wx.showModal({
- title: '提示',
- content: '当前已叫到您的号码,请立即前往' + res.data.ckhm + "窗口进行办理业务。",
- })
- } else {
- wx.showModal({
- title: '提示',
- content: '当前号码已经叫过了,请前往' + res.data.ckhm + "窗口进行咨询。"
- })
- }
- }
- } else {
- wx.showToast({
- title: res.msg || res.message,
- icon: "none",
- duration: 5000
- })
- }
- })
- },
- getTime() {
- let date = new Date()
- let y = date.getFullYear()
- let m = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
- let d = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
- let h = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
- let mm = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
- let ss = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
- return y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + ss
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- let that = this
- let timer = that.data.timer
- clearInterval(timer)
- timer = setInterval(() => {
- that.setData({
- nowTime: that.getTime()
- })
- }, 1000);
- that.setData({
- timer: timer
- })
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- let that = this
- let timer = that.data.timer
- clearInterval(timer)
- that.setData({
- timer: null
- })
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- let that = this
- let timer = that.data.timer
- clearInterval(timer)
- that.setData({
- timer: null
- })
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- }
- })
|