...
|
...
|
@@ -72,15 +72,24 @@ |
|
|
let newtotalmoney = t.totalmoney;
|
|
|
let newtotalnum = t.totalnum;
|
|
|
newselectarr[index].select = !newselectarr[index].select;
|
|
|
if (newselectarr[index].select) {
|
|
|
console.log('909090707070',newselectarr[index].select)
|
|
|
console.log(newselectarr[index].select)
|
|
|
if (newselectarr[index].select==true) {
|
|
|
newtotalmoney = Number(newtotalmoney) + Number(newselectarr[index].pay_money);
|
|
|
newtotalnum = Number(newtotalnum) + 1
|
|
|
newselect_id.push(id)
|
|
|
} else {
|
|
|
console.log(88888800000)
|
|
|
newtotalmoney = Number(newtotalmoney) - Number(newselectarr[index].pay_money);
|
|
|
newtotalnum = Number(newtotalnum) - 1
|
|
|
t.select_all = false;
|
|
|
newselect_id.splice(index, 1)
|
|
|
newtotalnum = Number(newtotalnum) - 1;
|
|
|
for(var i=0;i<newselect_id.length;i++){
|
|
|
if(id==newselect_id[i]){
|
|
|
newselect_id.splice(i, 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
console.log(newselect_id)
|
|
|
}
|
|
|
t.selectarr = newselectarr;
|
|
|
t.totalmoney = newtotalmoney.toFixed("2");
|
...
|
...
|
@@ -88,6 +97,8 @@ |
|
|
t.select_id = newselect_id;
|
|
|
if(t.select_id.length==t.selectarr.length){
|
|
|
t.select_all=true
|
|
|
}else{
|
|
|
t.select_all = false;
|
|
|
}
|
|
|
uni.setStorageSync("select_id",t.select_id);
|
|
|
uni.setStorageSync("totalmoney",t.totalmoney);
|
...
|
...
|
@@ -96,36 +107,7 @@ |
|
|
},
|
|
|
|
|
|
|
|
|
// select(id, index) {
|
|
|
// let newselectarr = this.selectarr;
|
|
|
// let newtotalmoney = this.totalmoney;
|
|
|
// let newtotaljilu = this.totaljilu;
|
|
|
// newselectarr[index].select = !newselectarr[index].select;
|
|
|
// if (newselectarr[index].select == true) {
|
|
|
// newtotalmoney = Number(newtotalmoney) + Number(newselectarr[index].pay_money)
|
|
|
// newtotaljilu = Number(newtotaljilu)+1
|
|
|
// } else {
|
|
|
// newtotalmoney = Number(newtotalmoney) - Number(newselectarr[index].pay_money)
|
|
|
// newtotaljilu = Number(newtotaljilu)-1
|
|
|
// }
|
|
|
// this.totalmoney = newtotalmoney.toFixed("2");
|
|
|
// this.selectarr = newselectarr;
|
|
|
// this.totaljilu = newtotaljilu
|
|
|
// },
|
|
|
|
|
|
//选择全部板数
|
|
|
// selectall() {
|
|
|
// let newselectarr = this.selectarr;
|
|
|
// let newtotalmoney = this.totalmoney;
|
|
|
// for (var obj of newselectarr) {
|
|
|
// obj.select = true;
|
|
|
// newtotalmoney = Number(newtotalmoney) + Number(obj.pay_money)
|
|
|
// }
|
|
|
//
|
|
|
// this.totalmoney = newtotalmoney.toFixed("2");
|
|
|
// this.selectarr = newselectarr;
|
|
|
//
|
|
|
// },
|
|
|
|
|
|
selectall() {
|
|
|
let t = this;
|
|
|
let newselectarr = t.selectarr;
|
...
|
...
|
@@ -171,16 +153,33 @@ |
|
|
let newselect_id=uni.getStorageSync("select_id");
|
|
|
let newselectarr=t.selectarr;
|
|
|
let select_count = 0;
|
|
|
for(var i=0;i<newselectarr.length;i++){
|
|
|
if(newselectarr.indexOf(newselectarr[i].id)){
|
|
|
select_count++;
|
|
|
newselectarr[i].select=true
|
|
|
if(newselect_id!=''){
|
|
|
for(var i=0;i<newselectarr.length;i++){
|
|
|
if(newselect_id.indexOf(newselectarr[i].id)!=-1){
|
|
|
select_count++;
|
|
|
newselectarr[i].select=true
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
if(select_count == newselectarr.length) {
|
|
|
|
|
|
if(select_count==newselectarr.length){
|
|
|
t.select_all = true
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// for(var i=0;i<newselectarr.length;i++){
|
|
|
// console.log('999000888',typeof(newselectarr.indexOf(newselectarr[i].id)))
|
|
|
// if(newselectarr.indexOf(newselectarr[i].id)!=-1){
|
|
|
// select_count++;
|
|
|
// newselectarr[i].select=true
|
|
|
// }
|
|
|
// }
|
|
|
// if(select_count == newselectarr.length) {
|
|
|
// t.select_all = true
|
|
|
// }
|
|
|
|
|
|
t.selectarr=newselectarr;
|
|
|
|
|
|
if(uni.getStorageSync("totalmoney")!=''){
|
...
|
...
|
@@ -229,6 +228,10 @@ |
|
|
onShow() {
|
|
|
// 选择消费记录
|
|
|
this.choose_jilu();
|
|
|
let newselect_id=uni.getStorageSync("select_id");
|
|
|
if(newselect_id!=''){
|
|
|
this.select_id=newselect_id
|
|
|
}
|
|
|
|
|
|
},
|
|
|
onUnload: function() {
|
...
|
...
|
|