|
|
@@ -1,126 +1,145 @@
|
|
|
const _Http = getApp().globalData.http,
|
|
|
- getHeight = require("../../utils/getRheRemainingHeight");
|
|
|
-
|
|
|
+ getHeight = require("../../utils/getRheRemainingHeight");
|
|
|
|
|
|
Page({
|
|
|
- data: {
|
|
|
- list: [],
|
|
|
- },
|
|
|
- onLoad(options) {},
|
|
|
- /* 日历加载完成 */
|
|
|
- handleCalendarLoad({
|
|
|
- detail
|
|
|
- }) {
|
|
|
- console.log("日历加载完成", detail)
|
|
|
- /* let {
|
|
|
- year,
|
|
|
- month,
|
|
|
- day
|
|
|
- } = detail.date;
|
|
|
- month = month < 10 ? "0" + month : month;
|
|
|
- day = day < 10 ? "0" + day : day;
|
|
|
- this.querySignIn(year + '-' + month + '-' + day) */
|
|
|
- },
|
|
|
- /* 日期发生变化 */
|
|
|
- handleCalendarDateChange({
|
|
|
- detail
|
|
|
- }) {
|
|
|
- console.log("日期发生变化", detail)
|
|
|
- this.setData({
|
|
|
- list: []
|
|
|
- })
|
|
|
- if (detail.date.marker) {
|
|
|
- let {
|
|
|
- year,
|
|
|
- month,
|
|
|
- day
|
|
|
- } = detail.date;
|
|
|
- month = month < 10 ? "0" + month : month;
|
|
|
- day = day < 10 ? "0" + day : day;
|
|
|
- this.querySignIn(year + '-' + month + '-' + day)
|
|
|
- }
|
|
|
- },
|
|
|
- /* 查询签到日 */
|
|
|
- checkIn(content) {
|
|
|
- _Http.basic({
|
|
|
- "accesstoken": "3614131fa126be7f41ea07d99b5d9fe6",
|
|
|
- "id": 20221229150001,
|
|
|
- content
|
|
|
- }).then(res => {
|
|
|
- console.log("查询签到日", content, res)
|
|
|
- if (res.data.length) {
|
|
|
- this.selectComponent("#calendar").setMarkers(res.data.map(v => {
|
|
|
- let date = v.split("-");
|
|
|
- return {
|
|
|
- year: date[0],
|
|
|
- month: date[1],
|
|
|
- day: date[2],
|
|
|
- type: "schedule",
|
|
|
- mark: '签到',
|
|
|
- color: '#2a97ff',
|
|
|
- bgColor: '#cce6ff'
|
|
|
- }
|
|
|
- }))
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- /* 查询签到记录 */
|
|
|
- querySignIn(signindate) {
|
|
|
- _Http.basic({
|
|
|
- "id": 20221229150101,
|
|
|
- "content": {
|
|
|
- signindate,
|
|
|
- pageSize: 999
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log('查询签到记录', res)
|
|
|
- this.setData({
|
|
|
- list: res.data
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- /* 日期范围发生变化 */
|
|
|
- handleCalendarRangeChange({
|
|
|
- detail
|
|
|
- }) {
|
|
|
- console.log("日期范围变化", detail)
|
|
|
- let {
|
|
|
- year,
|
|
|
- month,
|
|
|
- day
|
|
|
- } = detail.curr;
|
|
|
+ data: {
|
|
|
+ list: [],
|
|
|
+ querysubhr: false
|
|
|
+ },
|
|
|
+ /* 切换查看列表 */
|
|
|
+ onChange() {
|
|
|
+ this.setData({
|
|
|
+ querysubhr: !this.data.querysubhr
|
|
|
+ });
|
|
|
+ this.querySignIn(this.data.signindate)
|
|
|
+ },
|
|
|
+ onLoad(options) {},
|
|
|
+ /* 日历加载完成 */
|
|
|
+ handleCalendarLoad({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ console.log("日历加载完成", detail)
|
|
|
+ /* let {
|
|
|
+ year,
|
|
|
+ month,
|
|
|
+ day
|
|
|
+ } = detail.date;
|
|
|
+ month = month < 10 ? "0" + month : month;
|
|
|
+ day = day < 10 ? "0" + day : day;
|
|
|
+ this.querySignIn(year + '-' + month + '-' + day) */
|
|
|
+ },
|
|
|
+ /* 日期发生变化 */
|
|
|
+ handleCalendarDateChange({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ console.log("日期发生变化", detail)
|
|
|
+ this.setData({
|
|
|
+ list: []
|
|
|
+ })
|
|
|
+ if (detail.date.marker) {
|
|
|
+ let {
|
|
|
+ year,
|
|
|
+ month,
|
|
|
+ day
|
|
|
+ } = detail.date;
|
|
|
+ month = month < 10 ? "0" + month : month;
|
|
|
+ day = day < 10 ? "0" + day : day;
|
|
|
+ this.querySignIn(year + '-' + month + '-' + day)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /* 查询签到日 */
|
|
|
+ checkIn(content) {
|
|
|
+ _Http.basic({
|
|
|
+ "accesstoken": "3614131fa126be7f41ea07d99b5d9fe6",
|
|
|
+ "id": 20221229150001,
|
|
|
+ content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("查询签到日", content, res)
|
|
|
+ if (res.data.length) {
|
|
|
+ this.selectComponent("#calendar").setMarkers(res.data.map(v => {
|
|
|
+ let date = v.split("-");
|
|
|
+ return {
|
|
|
+ year: date[0],
|
|
|
+ month: date[1],
|
|
|
+ day: date[2],
|
|
|
+ type: "schedule",
|
|
|
+ mark: '签到',
|
|
|
+ color: '#2a97ff',
|
|
|
+ bgColor: '#cce6ff'
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 查询签到记录 */
|
|
|
+ querySignIn(signindate) {
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221229150101,
|
|
|
+ "content": {
|
|
|
+ signindate,
|
|
|
+ pageSize: 999,
|
|
|
+ querysubhr: this.data.querysubhr ? 1 : 0
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log('查询签到记录', res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ list: res.data,
|
|
|
+ signindate
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 日期范围发生变化 */
|
|
|
+ handleCalendarRangeChange({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ console.log("日期范围变化", detail)
|
|
|
+ let {
|
|
|
+ year,
|
|
|
+ month,
|
|
|
+ day
|
|
|
+ } = detail.curr;
|
|
|
|
|
|
- this.checkIn({
|
|
|
- year,
|
|
|
- month
|
|
|
- });
|
|
|
+ this.checkIn({
|
|
|
+ year,
|
|
|
+ month
|
|
|
+ });
|
|
|
|
|
|
- this.setData({
|
|
|
- list: []
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ list: []
|
|
|
+ })
|
|
|
|
|
|
- month = month < 10 ? "0" + month : month;
|
|
|
- day = day < 10 ? "0" + day : day;
|
|
|
- this.querySignIn(year + '-' + month + '-' + day)
|
|
|
- },
|
|
|
- /* 更新日期数据 */
|
|
|
- toDate(date) {
|
|
|
- this.selectComponent("#calendar").toDate(date)
|
|
|
- },
|
|
|
- toSignIn() {
|
|
|
- wx.navigateTo({
|
|
|
- url: '/packageA/clockIn/signIn',
|
|
|
- })
|
|
|
- },
|
|
|
- onReady() {
|
|
|
- this.setListHeight();
|
|
|
- },
|
|
|
- setListHeight() {
|
|
|
- getHeight.getHeight('.head', this).then(res => {
|
|
|
- if (this.data.listHeight != res)
|
|
|
- this.setData({
|
|
|
- listHeight: res
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
+ month = month < 10 ? "0" + month : month;
|
|
|
+ day = day < 10 ? "0" + day : day;
|
|
|
+ this.querySignIn(year + '-' + month + '-' + day)
|
|
|
+ },
|
|
|
+ /* 更新日期数据 */
|
|
|
+ toDate(date) {
|
|
|
+ this.selectComponent("#calendar").toDate(date);
|
|
|
+ this.querySignIn(date);
|
|
|
+ let a1 = date.split("-");
|
|
|
+ this.checkIn({
|
|
|
+ year: a1[0],
|
|
|
+ month: a1[1]
|
|
|
+ });
|
|
|
+ },
|
|
|
+ toSignIn() {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/packageA/clockIn/signIn',
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onReady() {
|
|
|
+ this.setListHeight();
|
|
|
+ },
|
|
|
+ setListHeight() {
|
|
|
+ getHeight.getHeight('.head', this).then(res => {
|
|
|
+ if (this.data.listHeight != res)
|
|
|
+ this.setData({
|
|
|
+ listHeight: res
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
})
|