作者 李洪娟

合并分支 'lhj' 到 'master'

32323



查看合并请求 !1
@@ -346,6 +346,16 @@ @@ -346,6 +346,16 @@
346 // } 346 // }
347 }, 347 },
348 onShow() { 348 onShow() {
  349 +
  350 + let totalmoney=uni.getStorageSync("totalmoney");
  351 + console.log('9090902222',totalmoney)
  352 + if(totalmoney!=''){
  353 +
  354 + this.fapiaomoney=totalmoney;
  355 + console.log('77777777',this.fapiaomoney)
  356 + }
  357 +
  358 +
349 let obj=uni.getStorageSync("canshu"); 359 let obj=uni.getStorageSync("canshu");
350 if(obj!=''){ 360 if(obj!=''){
351 this.selectid=obj.selectid; 361 this.selectid=obj.selectid;
@@ -356,7 +366,7 @@ @@ -356,7 +366,7 @@
356 this.phone=obj.phone; 366 this.phone=obj.phone;
357 this.bank=obj.bank; 367 this.bank=obj.bank;
358 this.banknum=obj.banknum; 368 this.banknum=obj.banknum;
359 - this.fapiaomoney=obj.fapiaomoney; 369 + // this.fapiaomoney=obj.fapiaomoney;
360 this.shouname=obj.shouname; 370 this.shouname=obj.shouname;
361 this.shouphone=obj.shouphone; 371 this.shouphone=obj.shouphone;
362 this.shouaddress=obj.shouaddress; 372 this.shouaddress=obj.shouaddress;
@@ -72,15 +72,24 @@ @@ -72,15 +72,24 @@
72 let newtotalmoney = t.totalmoney; 72 let newtotalmoney = t.totalmoney;
73 let newtotalnum = t.totalnum; 73 let newtotalnum = t.totalnum;
74 newselectarr[index].select = !newselectarr[index].select; 74 newselectarr[index].select = !newselectarr[index].select;
75 - if (newselectarr[index].select) { 75 + console.log('909090707070',newselectarr[index].select)
  76 + console.log(newselectarr[index].select)
  77 + if (newselectarr[index].select==true) {
76 newtotalmoney = Number(newtotalmoney) + Number(newselectarr[index].pay_money); 78 newtotalmoney = Number(newtotalmoney) + Number(newselectarr[index].pay_money);
77 newtotalnum = Number(newtotalnum) + 1 79 newtotalnum = Number(newtotalnum) + 1
78 newselect_id.push(id) 80 newselect_id.push(id)
79 } else { 81 } else {
  82 + console.log(88888800000)
80 newtotalmoney = Number(newtotalmoney) - Number(newselectarr[index].pay_money); 83 newtotalmoney = Number(newtotalmoney) - Number(newselectarr[index].pay_money);
81 - newtotalnum = Number(newtotalnum) - 1  
82 - t.select_all = false;  
83 - newselect_id.splice(index, 1) 84 + newtotalnum = Number(newtotalnum) - 1;
  85 + for(var i=0;i<newselect_id.length;i++){
  86 + if(id==newselect_id[i]){
  87 + newselect_id.splice(i, 1);
  88 + }
  89 + }
  90 +
  91 +
  92 + console.log(newselect_id)
84 } 93 }
85 t.selectarr = newselectarr; 94 t.selectarr = newselectarr;
86 t.totalmoney = newtotalmoney.toFixed("2"); 95 t.totalmoney = newtotalmoney.toFixed("2");
@@ -88,6 +97,8 @@ @@ -88,6 +97,8 @@
88 t.select_id = newselect_id; 97 t.select_id = newselect_id;
89 if(t.select_id.length==t.selectarr.length){ 98 if(t.select_id.length==t.selectarr.length){
90 t.select_all=true 99 t.select_all=true
  100 + }else{
  101 + t.select_all = false;
91 } 102 }
92 uni.setStorageSync("select_id",t.select_id); 103 uni.setStorageSync("select_id",t.select_id);
93 uni.setStorageSync("totalmoney",t.totalmoney); 104 uni.setStorageSync("totalmoney",t.totalmoney);
@@ -96,36 +107,7 @@ @@ -96,36 +107,7 @@
96 }, 107 },
97 108
98 109
99 - // select(id, index) {  
100 - // let newselectarr = this.selectarr;  
101 - // let newtotalmoney = this.totalmoney;  
102 - // let newtotaljilu = this.totaljilu;  
103 - // newselectarr[index].select = !newselectarr[index].select;  
104 - // if (newselectarr[index].select == true) {  
105 - // newtotalmoney = Number(newtotalmoney) + Number(newselectarr[index].pay_money)  
106 - // newtotaljilu = Number(newtotaljilu)+1  
107 - // } else {  
108 - // newtotalmoney = Number(newtotalmoney) - Number(newselectarr[index].pay_money)  
109 - // newtotaljilu = Number(newtotaljilu)-1  
110 - // }  
111 - // this.totalmoney = newtotalmoney.toFixed("2");  
112 - // this.selectarr = newselectarr;  
113 - // this.totaljilu = newtotaljilu  
114 - // },  
115 -  
116 - //选择全部板数  
117 - // selectall() {  
118 - // let newselectarr = this.selectarr;  
119 - // let newtotalmoney = this.totalmoney;  
120 - // for (var obj of newselectarr) {  
121 - // obj.select = true;  
122 - // newtotalmoney = Number(newtotalmoney) + Number(obj.pay_money)  
123 - // }  
124 - //  
125 - // this.totalmoney = newtotalmoney.toFixed("2");  
126 - // this.selectarr = newselectarr;  
127 - //  
128 - // }, 110 +
129 selectall() { 111 selectall() {
130 let t = this; 112 let t = this;
131 let newselectarr = t.selectarr; 113 let newselectarr = t.selectarr;
@@ -171,16 +153,33 @@ @@ -171,16 +153,33 @@
171 let newselect_id=uni.getStorageSync("select_id"); 153 let newselect_id=uni.getStorageSync("select_id");
172 let newselectarr=t.selectarr; 154 let newselectarr=t.selectarr;
173 let select_count = 0; 155 let select_count = 0;
174 - for(var i=0;i<newselectarr.length;i++){  
175 - if(newselectarr.indexOf(newselectarr[i].id)){  
176 - select_count++;  
177 - newselectarr[i].select=true 156 + if(newselect_id!=''){
  157 + for(var i=0;i<newselectarr.length;i++){
  158 + if(newselect_id.indexOf(newselectarr[i].id)!=-1){
  159 + select_count++;
  160 + newselectarr[i].select=true
  161 + }
  162 +
178 } 163 }
179 } 164 }
180 - if(select_count == newselectarr.length) { 165 +
  166 + if(select_count==newselectarr.length){
181 t.select_all = true 167 t.select_all = true
182 } 168 }
183 169
  170 +
  171 +
  172 + // for(var i=0;i<newselectarr.length;i++){
  173 + // console.log('999000888',typeof(newselectarr.indexOf(newselectarr[i].id)))
  174 + // if(newselectarr.indexOf(newselectarr[i].id)!=-1){
  175 + // select_count++;
  176 + // newselectarr[i].select=true
  177 + // }
  178 + // }
  179 + // if(select_count == newselectarr.length) {
  180 + // t.select_all = true
  181 + // }
  182 +
184 t.selectarr=newselectarr; 183 t.selectarr=newselectarr;
185 184
186 if(uni.getStorageSync("totalmoney")!=''){ 185 if(uni.getStorageSync("totalmoney")!=''){
@@ -229,6 +228,10 @@ @@ -229,6 +228,10 @@
229 onShow() { 228 onShow() {
230 // 选择消费记录 229 // 选择消费记录
231 this.choose_jilu(); 230 this.choose_jilu();
  231 + let newselect_id=uni.getStorageSync("select_id");
  232 + if(newselect_id!=''){
  233 + this.select_id=newselect_id
  234 + }
232 235
233 }, 236 },
234 onUnload: function() { 237 onUnload: function() {