|
@@ -66,7 +66,6 @@ |
|
@@ -66,7 +66,6 @@ |
66
|
methods: {
|
66
|
methods: {
|
67
|
// 单选选择数板
|
67
|
// 单选选择数板
|
68
|
select(id, index) {
|
68
|
select(id, index) {
|
69
|
- console.log(id)
|
|
|
70
|
let t = this;
|
69
|
let t = this;
|
71
|
let newselect_id = t.select_id;
|
70
|
let newselect_id = t.select_id;
|
72
|
let newselectarr = t.selectarr;
|
71
|
let newselectarr = t.selectarr;
|
|
@@ -90,7 +89,6 @@ |
|
@@ -90,7 +89,6 @@ |
90
|
if(t.select_id.length==t.selectarr.length){
|
89
|
if(t.select_id.length==t.selectarr.length){
|
91
|
t.select_all=true
|
90
|
t.select_all=true
|
92
|
}
|
91
|
}
|
93
|
- console.log('99998888', t.select_id);
|
|
|
94
|
uni.setStorageSync("select_id",t.select_id);
|
92
|
uni.setStorageSync("select_id",t.select_id);
|
95
|
uni.setStorageSync("totalmoney",t.totalmoney);
|
93
|
uni.setStorageSync("totalmoney",t.totalmoney);
|
96
|
uni.setStorageSync("totalnum",t.totalnum)
|
94
|
uni.setStorageSync("totalnum",t.totalnum)
|
|
@@ -99,7 +97,6 @@ |
|
@@ -99,7 +97,6 @@ |
99
|
|
97
|
|
100
|
|
98
|
|
101
|
// select(id, index) {
|
99
|
// select(id, index) {
|
102
|
- // console.log(index)
|
|
|
103
|
// let newselectarr = this.selectarr;
|
100
|
// let newselectarr = this.selectarr;
|
104
|
// let newtotalmoney = this.totalmoney;
|
101
|
// let newtotalmoney = this.totalmoney;
|
105
|
// let newtotaljilu = this.totaljilu;
|
102
|
// let newtotaljilu = this.totaljilu;
|
|
@@ -111,7 +108,6 @@ |
|
@@ -111,7 +108,6 @@ |
111
|
// newtotalmoney = Number(newtotalmoney) - Number(newselectarr[index].pay_money)
|
108
|
// newtotalmoney = Number(newtotalmoney) - Number(newselectarr[index].pay_money)
|
112
|
// newtotaljilu = Number(newtotaljilu)-1
|
109
|
// newtotaljilu = Number(newtotaljilu)-1
|
113
|
// }
|
110
|
// }
|
114
|
- // console.log(newtotalmoney)
|
|
|
115
|
// this.totalmoney = newtotalmoney.toFixed("2");
|
111
|
// this.totalmoney = newtotalmoney.toFixed("2");
|
116
|
// this.selectarr = newselectarr;
|
112
|
// this.selectarr = newselectarr;
|
117
|
// this.totaljilu = newtotaljilu
|
113
|
// this.totaljilu = newtotaljilu
|
|
@@ -133,7 +129,7 @@ |
|
@@ -133,7 +129,7 @@ |
133
|
selectall() {
|
129
|
selectall() {
|
134
|
let t = this;
|
130
|
let t = this;
|
135
|
let newselectarr = t.selectarr;
|
131
|
let newselectarr = t.selectarr;
|
136
|
- let newtotalmoney = t.totalmoney;
|
132
|
+ let newtotalmoney = 0;
|
137
|
let newtotalnum = t.totalnum;
|
133
|
let newtotalnum = t.totalnum;
|
138
|
t.select_all = !t.select_all;
|
134
|
t.select_all = !t.select_all;
|
139
|
let newselect_id = t.select_id
|
135
|
let newselect_id = t.select_id
|
|
@@ -144,7 +140,6 @@ |
|
@@ -144,7 +140,6 @@ |
144
|
newselect_id.push(newselectarr[i].id)
|
140
|
newselect_id.push(newselectarr[i].id)
|
145
|
newtotalmoney = Number(newtotalmoney) + Number(newselectarr[i].pay_money);
|
141
|
newtotalmoney = Number(newtotalmoney) + Number(newselectarr[i].pay_money);
|
146
|
newtotalnum = newselectarr.length
|
142
|
newtotalnum = newselectarr.length
|
147
|
- console.log(newselectarr.length, "数组的长度")
|
|
|
148
|
} else {
|
143
|
} else {
|
149
|
newselectarr[i].select = false;
|
144
|
newselectarr[i].select = false;
|
150
|
newtotalmoney = 0;
|
145
|
newtotalmoney = 0;
|
|
@@ -159,7 +154,6 @@ |
|
@@ -159,7 +154,6 @@ |
159
|
uni.setStorageSync("select_id",t.select_id)
|
154
|
uni.setStorageSync("select_id",t.select_id)
|
160
|
uni.setStorageSync("totalmoney",t.totalmoney)
|
155
|
uni.setStorageSync("totalmoney",t.totalmoney)
|
161
|
uni.setStorageSync("totalnum",t.totalnum)
|
156
|
uni.setStorageSync("totalnum",t.totalnum)
|
162
|
- console.log('808080', t.select_id);
|
|
|
163
|
},
|
157
|
},
|
164
|
// 选择消费记录
|
158
|
// 选择消费记录
|
165
|
choose_jilu() {
|
159
|
choose_jilu() {
|
|
@@ -167,9 +161,7 @@ |
|
@@ -167,9 +161,7 @@ |
167
|
let url = "api/person/choosePayList";
|
161
|
let url = "api/person/choosePayList";
|
168
|
let param = {};
|
162
|
let param = {};
|
169
|
app.post(url, param, 'post').then(r => {
|
163
|
app.post(url, param, 'post').then(r => {
|
170
|
- console.log(r)
|
|
|
171
|
for (var i = 0; i < r.length; i++) {
|
164
|
for (var i = 0; i < r.length; i++) {
|
172
|
- console.log(r[i])
|
|
|
173
|
r[i]['select'] = false
|
165
|
r[i]['select'] = false
|
174
|
}
|
166
|
}
|
175
|
t.selectarr = r;
|
167
|
t.selectarr = r;
|
|
@@ -177,16 +169,16 @@ |
|
@@ -177,16 +169,16 @@ |
177
|
|
169
|
|
178
|
|
170
|
|
179
|
let newselect_id=uni.getStorageSync("select_id");
|
171
|
let newselect_id=uni.getStorageSync("select_id");
|
180
|
- console.log('7777',newselect_id)
|
|
|
181
|
let newselectarr=t.selectarr;
|
172
|
let newselectarr=t.selectarr;
|
182
|
- console.log('6666',newselectarr)
|
173
|
+ let select_count = 0;
|
183
|
for(var i=0;i<newselectarr.length;i++){
|
174
|
for(var i=0;i<newselectarr.length;i++){
|
184
|
- for(var j=0;j<newselect_id.length;j++){
|
|
|
185
|
- if(newselectarr[i].id==newselect_id[j]){
|
|
|
186
|
- console.log('888888')
|
175
|
+ if(newselectarr.indexOf(newselectarr[i].id)){
|
|
|
176
|
+ select_count++;
|
187
|
newselectarr[i].select=true
|
177
|
newselectarr[i].select=true
|
188
|
}
|
178
|
}
|
189
|
}
|
179
|
}
|
|
|
180
|
+ if(select_count == newselectarr.length) {
|
|
|
181
|
+ t.select_all = true
|
190
|
}
|
182
|
}
|
191
|
|
183
|
|
192
|
t.selectarr=newselectarr;
|
184
|
t.selectarr=newselectarr;
|
|
@@ -198,9 +190,8 @@ |
|
@@ -198,9 +190,8 @@ |
198
|
t.totalnum=uni.getStorageSync("totalnum");
|
190
|
t.totalnum=uni.getStorageSync("totalnum");
|
199
|
}
|
191
|
}
|
200
|
|
192
|
|
201
|
- console.log('99999900000',this.selectarr);
|
|
|
202
|
}).catch(err => {
|
193
|
}).catch(err => {
|
203
|
- console.log(err)
|
194
|
+
|
204
|
})
|
195
|
})
|
205
|
},
|
196
|
},
|
206
|
//下一步
|
197
|
//下一步
|
|
@@ -210,12 +201,10 @@ |
|
@@ -210,12 +201,10 @@ |
210
|
let t = this;
|
201
|
let t = this;
|
211
|
let id = t.select_id;
|
202
|
let id = t.select_id;
|
212
|
let pages = getCurrentPages();
|
203
|
let pages = getCurrentPages();
|
213
|
- console.log('5555',pages)
|
|
|
214
|
|
204
|
|
215
|
// let currPage = pages[pages.length - 1]; //当前页面
|
205
|
// let currPage = pages[pages.length - 1]; //当前页面
|
216
|
let prevPage = pages[pages.length - 2]; //上一个页面
|
206
|
let prevPage = pages[pages.length - 2]; //上一个页面
|
217
|
|
207
|
|
218
|
- // console.log(e.currentTarget.dataset.id)
|
|
|
219
|
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
|
208
|
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
|
220
|
prevPage.setData({
|
209
|
prevPage.setData({
|
221
|
selectId: id,
|
210
|
selectId: id,
|
|
@@ -235,7 +224,6 @@ |
|
@@ -235,7 +224,6 @@ |
235
|
}
|
224
|
}
|
236
|
},
|
225
|
},
|
237
|
onLoad(options) {
|
226
|
onLoad(options) {
|
238
|
- console.log(options);
|
|
|
239
|
|
227
|
|
240
|
},
|
228
|
},
|
241
|
onShow() {
|
229
|
onShow() {
|
|
@@ -251,7 +239,6 @@ |
|
@@ -251,7 +239,6 @@ |
251
|
// let currPage = pages[pages.length - 1]; //当前页面
|
239
|
// let currPage = pages[pages.length - 1]; //当前页面
|
252
|
let prevPage = pages[pages.length - 2]; //上一个页面
|
240
|
let prevPage = pages[pages.length - 2]; //上一个页面
|
253
|
|
241
|
|
254
|
- // console.log(e.currentTarget.dataset.id)
|
|
|
255
|
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
|
242
|
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
|
256
|
prevPage.setData({
|
243
|
prevPage.setData({
|
257
|
selectId: id,
|
244
|
selectId: id,
|