This commit is contained in:
2024-03-13 09:34:25 +08:00
parent 0f0249243b
commit 104a84e7bb
3 changed files with 10 additions and 14 deletions

View File

@ -177,7 +177,7 @@
} }
wxSportDecrypt(obj).then(Sportres => { wxSportDecrypt(obj).then(Sportres => {
if (Sportres.data && Sportres.data[0].step >= 5000) { if (Sportres.data && Sportres.data[0].step >= 5000) {
wxsportadd(this.userinfo.cardNo).then(sportaddres => { wxsportadd(this.userinfo.cardNo, Sportres.data[0].step).then(sportaddres => {
if (sportaddres.code == 200) { if (sportaddres.code == 200) {
let sportitem = { let sportitem = {
text: `${this.userinfo.cardNo}${Sportres.data[0].date}`, text: `${this.userinfo.cardNo}${Sportres.data[0].date}`,

View File

@ -77,14 +77,16 @@
pageSize: 10, pageSize: 10,
}, },
region: uni.getStorageSync('region'), region: uni.getStorageSync('region'),
list: null, list: [],
total: 0, total: 0,
score: 0, score: 0,
title: '', title: '',
orgNo: '', orgNo: '',
}; };
}, },
onLoad() { onShow() {
this.list = []
this.query.pageNum = 1
this.info(); this.info();
this.scoretotalinfo(); this.scoretotalinfo();
}, },
@ -112,7 +114,7 @@
}, },
info() { info() {
scorelist(this.query).then(res => { scorelist(this.query).then(res => {
this.list = res.rows this.list = [...this.list, ...res.rows]
this.total = res.total this.total = res.total
}) })
}, },
@ -153,17 +155,12 @@
onReachBottom() { // onReachBottom() { //
if (this.list.length >= this.total) {} else { if (this.list.length >= this.total) {} else {
this.query.pageNum++ this.query.pageNum++
scorelist(this.query).then(res => { this.info();
if (res.rows) {
res.rows.forEach(e => {
this.list.push(e)
})
}
})
} }
}, },
onPullDownRefresh() { // onPullDownRefresh() { //
this.query.pageNum = 1; this.query.pageNum = 1;
this.list = []
this.info(); this.info();
setTimeout(function() { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();

View File

@ -42,8 +42,7 @@
methods: { methods: {
tapstep(item) { tapstep(item) {
if (item.step >= 5000) { if (item.step >= 5000) {
console.log(item) wxsportaddV1(uni.getStorageSync('userinfo').cardNo, item.date, item.step).then(res => {
wxsportaddV1(uni.getStorageSync('userinfo').cardNo, item.date).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '新增积分成功', title: '新增积分成功',
@ -85,7 +84,7 @@
this.list = Sportres.data this.list = Sportres.data
if (!this.sportlist.some(e => e.text == identtime)) { if (!this.sportlist.some(e => e.text == identtime)) {
if (Sportres.data && Sportres.data[0].step >= 5000) { if (Sportres.data && Sportres.data[0].step >= 5000) {
wxsportadd(this.userinfo.cardNo).then(sportaddres => { wxsportadd(this.userinfo.cardNo, Sportres.data[0].step).then(sportaddres => {
if (sportaddres.code == 200) { if (sportaddres.code == 200) {
let sportitem = { let sportitem = {
text: `${this.userinfo.cardNo}${Sportres.data[0].date}`, text: `${this.userinfo.cardNo}${Sportres.data[0].date}`,