|
@@ -38,17 +38,20 @@ Page({
|
|
|
},
|
|
},
|
|
|
getCurrent() {
|
|
getCurrent() {
|
|
|
currentSettlement().then(data => {
|
|
currentSettlement().then(data => {
|
|
|
|
|
+ const month = Number(data.data.currentSettlement.date.split('-')[1])
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- currentSettlement: data.data.currentSettlement
|
|
|
|
|
|
|
+ currentSettlement: data.data.currentSettlement,
|
|
|
|
|
+ text: month,
|
|
|
|
|
+ mouth: month,
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
next() {
|
|
next() {
|
|
|
- if (this.data.text < this.data.mouth) {
|
|
|
|
|
|
|
+ if (this.data.text !== this.data.mouth) {
|
|
|
this.selectComponent('.calendar').next()
|
|
this.selectComponent('.calendar').next()
|
|
|
this.getList(1)
|
|
this.getList(1)
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- text: new Date().getMonth() + 1,
|
|
|
|
|
|
|
+ text: this.data.mouth,
|
|
|
next: `${imgServerUrl}/images/clock/clock-arrow-righr-disabled.png`,
|
|
next: `${imgServerUrl}/images/clock/clock-arrow-righr-disabled.png`,
|
|
|
last: `${imgServerUrl}/images/clock/clock-arrow-left.png`,
|
|
last: `${imgServerUrl}/images/clock/clock-arrow-left.png`,
|
|
|
}, _ => {
|
|
}, _ => {
|
|
@@ -65,12 +68,12 @@ Page({
|
|
|
if (this.data.text === this.data.mouth) {
|
|
if (this.data.text === this.data.mouth) {
|
|
|
this.selectComponent('.calendar').last()
|
|
this.selectComponent('.calendar').last()
|
|
|
this.getList(2)
|
|
this.getList(2)
|
|
|
- if (new Date().getMonth() - 1 < 0) {
|
|
|
|
|
|
|
+ if (this.data.mouth - 1 <= 0) {
|
|
|
this.setData({
|
|
this.setData({
|
|
|
text: 12
|
|
text: 12
|
|
|
}, _ => {
|
|
}, _ => {
|
|
|
- let { year, month } = this.data
|
|
|
|
|
- const search_date = [year, month, 1].map(val => {
|
|
|
|
|
|
|
+ let { year, text } = this.data
|
|
|
|
|
+ const search_date = [year - 1, text, 1].map(val => {
|
|
|
const number = val.toString()
|
|
const number = val.toString()
|
|
|
return number[1] ? number : '0' + number
|
|
return number[1] ? number : '0' + number
|
|
|
}).join('-')
|
|
}).join('-')
|
|
@@ -79,7 +82,7 @@ Page({
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- text: new Date().getMonth()
|
|
|
|
|
|
|
+ text: this.data.mouth - 1
|
|
|
}, _ => {
|
|
}, _ => {
|
|
|
let { year, text } = this.data
|
|
let { year, text } = this.data
|
|
|
const search_date = [year, text, 1].map(val => {
|
|
const search_date = [year, text, 1].map(val => {
|
|
@@ -116,7 +119,7 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
*/
|
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -142,8 +145,6 @@ Page({
|
|
|
this.getCurrent()
|
|
this.getCurrent()
|
|
|
this.getDay(search_date)
|
|
this.getDay(search_date)
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- text: month,
|
|
|
|
|
- mouth: month,
|
|
|
|
|
year
|
|
year
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|