1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
| const dateFmt = require('../../utils/date.js');
| const app = getApp()
| Component({
| data: {
| priceCode:'',
| userStyle:{},
| showRightCom:false,
| queryObj:{
|
| },
| },
| // 设置默认属性
| props: {
|
| },
| didMount(){
| console.log('aaa')
| this.setData({
| userStyle:app.userStyle,
| })
| },
| didUpdate(){
| console.log('a',this.data.queryObj)
|
|
| },
| didUnmount() {
| console.log('b')
| },
| methods: {
| changeData(){
| this.setData({
| showRightCom:false
| });
| this.props.onShowage(this.data.showRightCom);
| },
| getBeginTime(){
| my.datePicker({
| startDate: '2010-10-9',
| endDate: '2027-10-9',
| success: (res) => {
| this.setData({
| 'queryObj.startDay':res.date
| })
| },
| });
| },
| getEndTime(){
| my.datePicker({
| startDate: this.data.queryObj.beginTime,
| endDate: '2027-10-9',
| success: (res) => {
| this.setData({
| 'queryObj.endDay':res.date
| })
| },
| });
| },
| setCode(e){
| console.log(e)
| var startAmt,endAmt
| if(e.target.dataset.type=='price'|| e.target.dataset.type=='doPrice'){
| switch(e.target.dataset.code){
| case 1:
| startAmt = 0
| endAmt = 999
| break;
| case 2:
| startAmt = 1000
| endAmt = 1999
| break;
| case 3:
| startAmt = 2000
| endAmt = 4999
| break;
| case 4:
| startAmt = 5000
| endAmt = 99999
| break;
| }
| this.setData({
| 'queryObj.startAmt':startAmt,
| 'queryObj.endAmt':endAmt,
| priceCode:e.target.dataset.code
| })
| }else{
| var key = `queryObj.${e.target.dataset.type}`
| this.setData({
| [key]:e.target.dataset.code
| })
| }
|
| },
| // 重置按钮
| reset(){
| let obj = this.data.queryObj
| for(let key in obj){
| obj[key] = ''
| }
| this.setData({
| queryObj:{},
| // 'queryObj.startDay':'',
| // 'queryObj.endDay':'',
| })
| this.props.onGetFilterInfo(this.data.queryObj);
| },
| //确定按钮
| confirm(){
| this.props.onGetFilterInfo(this.data.queryObj);
| this.changeData()
| }
| },
| });
|
|