作者 刘朕

个人中心、发票全选金额及选中问题修改

... ... @@ -185,7 +185,7 @@
this.peopleinfo = peopleinfo
this.name = peopleinfo.username;
this.avatar=peopleinfo.avatar;
this.bangdingpeople=peopleinfo.recommender
this.bangdingpeople=peopleinfo.company_name
console.log(this.bangdingpeople)
},
... ...
... ... @@ -19,7 +19,7 @@
</view>
<view class="infoheadleft">
<view class="infotui">推荐人</view>
<view class="infoji" v-if="token!=''">{{peopleinfo.recommender==''?'暂无':peopleinfo.recommender}}</view>
<view class="infoji" v-if="token!=''">{{peopleinfo.company_name==''?'暂无':peopleinfo.company_name}}</view>
<view class="infoji" v-else>{{tuijianren}}</view>
</view>
... ...
... ... @@ -66,7 +66,6 @@
methods: {
// 单选选择数板
select(id, index) {
console.log(id)
let t = this;
let newselect_id = t.select_id;
let newselectarr = t.selectarr;
... ... @@ -90,7 +89,6 @@
if(t.select_id.length==t.selectarr.length){
t.select_all=true
}
console.log('99998888', t.select_id);
uni.setStorageSync("select_id",t.select_id);
uni.setStorageSync("totalmoney",t.totalmoney);
uni.setStorageSync("totalnum",t.totalnum)
... ... @@ -99,7 +97,6 @@
// select(id, index) {
// console.log(index)
// let newselectarr = this.selectarr;
// let newtotalmoney = this.totalmoney;
// let newtotaljilu = this.totaljilu;
... ... @@ -111,7 +108,6 @@
// newtotalmoney = Number(newtotalmoney) - Number(newselectarr[index].pay_money)
// newtotaljilu = Number(newtotaljilu)-1
// }
// console.log(newtotalmoney)
// this.totalmoney = newtotalmoney.toFixed("2");
// this.selectarr = newselectarr;
// this.totaljilu = newtotaljilu
... ... @@ -133,7 +129,7 @@
selectall() {
let t = this;
let newselectarr = t.selectarr;
let newtotalmoney = t.totalmoney;
let newtotalmoney = 0;
let newtotalnum = t.totalnum;
t.select_all = !t.select_all;
let newselect_id = t.select_id
... ... @@ -144,7 +140,6 @@
newselect_id.push(newselectarr[i].id)
newtotalmoney = Number(newtotalmoney) + Number(newselectarr[i].pay_money);
newtotalnum = newselectarr.length
console.log(newselectarr.length, "数组的长度")
} else {
newselectarr[i].select = false;
newtotalmoney = 0;
... ... @@ -159,7 +154,6 @@
uni.setStorageSync("select_id",t.select_id)
uni.setStorageSync("totalmoney",t.totalmoney)
uni.setStorageSync("totalnum",t.totalnum)
console.log('808080', t.select_id);
},
// 选择消费记录
choose_jilu() {
... ... @@ -167,9 +161,7 @@
let url = "api/person/choosePayList";
let param = {};
app.post(url, param, 'post').then(r => {
console.log(r)
for (var i = 0; i < r.length; i++) {
console.log(r[i])
r[i]['select'] = false
}
t.selectarr = r;
... ... @@ -177,16 +169,16 @@
let newselect_id=uni.getStorageSync("select_id");
console.log('7777',newselect_id)
let newselectarr=t.selectarr;
console.log('6666',newselectarr)
let select_count = 0;
for(var i=0;i<newselectarr.length;i++){
for(var j=0;j<newselect_id.length;j++){
if(newselectarr[i].id==newselect_id[j]){
console.log('888888')
if(newselectarr.indexOf(newselectarr[i].id)){
select_count++;
newselectarr[i].select=true
}
}
if(select_count == newselectarr.length) {
t.select_all = true
}
t.selectarr=newselectarr;
... ... @@ -198,9 +190,8 @@
t.totalnum=uni.getStorageSync("totalnum");
}
console.log('99999900000',this.selectarr);
}).catch(err => {
console.log(err)
})
},
//下一步
... ... @@ -210,12 +201,10 @@
let t = this;
let id = t.select_id;
let pages = getCurrentPages();
console.log('5555',pages)
// let currPage = pages[pages.length - 1]; //当前页面
let prevPage = pages[pages.length - 2]; //上一个页面
// console.log(e.currentTarget.dataset.id)
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
prevPage.setData({
selectId: id,
... ... @@ -235,7 +224,6 @@
}
},
onLoad(options) {
console.log(options);
},
onShow() {
... ... @@ -251,7 +239,6 @@
// let currPage = pages[pages.length - 1]; //当前页面
let prevPage = pages[pages.length - 2]; //上一个页面
// console.log(e.currentTarget.dataset.id)
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
prevPage.setData({
selectId: id,
... ...