|
|
@ -246,11 +246,11 @@ |
|
|
|
isUpdate = true; |
|
|
|
} |
|
|
|
|
|
|
|
if (isUpdate) { |
|
|
|
if (isUpdate&&this.stepsNum>0) { |
|
|
|
this.$api.updateSteps({ |
|
|
|
steps: this.stepsNum |
|
|
|
}).then(res => { |
|
|
|
console.log(res, 'res更新') |
|
|
|
// console.log(res, 'res更新') |
|
|
|
uni.setStorageSync("stepsNum_date", { |
|
|
|
stepsNum: this.stepsNum, |
|
|
|
date: today, |
|
|
@ -258,7 +258,7 @@ |
|
|
|
}); |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log(this.stepsNum) |
|
|
|
// console.log(this.stepsNum) |
|
|
|
}, |
|
|
|
|
|
|
|
bannerClick(i) { |
|
|
@ -289,33 +289,33 @@ |
|
|
|
try { |
|
|
|
//整个应用设置一次即可,停止计步后需重新调用,所有接口调用必须先开启计步服务 |
|
|
|
StepCounter.startStep((res) => { |
|
|
|
console.log(res, '步数res'); |
|
|
|
// console.log(res, '步数res'); |
|
|
|
this.stepCount = res.stepCount |
|
|
|
this.stepsNum = res.stepCount; |
|
|
|
this.updateSteps(); |
|
|
|
//res.stepCount 当天累计步数 |
|
|
|
}, (res) => { |
|
|
|
console.log(res) |
|
|
|
// console.log(res) |
|
|
|
let callback = res.callback |
|
|
|
if (callback == "stepStatus") { |
|
|
|
let status = res.status; |
|
|
|
if (1 == status) { |
|
|
|
//安卓gps定位服务未开 |
|
|
|
console.log('安卓gps定位服务未开') |
|
|
|
// console.log('安卓gps定位服务未开') |
|
|
|
} else if (2 == status || 5 == status) { |
|
|
|
//权限被禁止 |
|
|
|
//this.gotoSettings() |
|
|
|
console.log('权限被禁止') |
|
|
|
// console.log('权限被禁止') |
|
|
|
} else if (3 == status) { |
|
|
|
//允许运动权限(处理安卓权限问题) |
|
|
|
//this.startStep() |
|
|
|
console.log('允许运动权限(处理安卓权限问题)') |
|
|
|
// console.log('允许运动权限(处理安卓权限问题)') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} catch (e) { |
|
|
|
console.error("获取步数出错", e) |
|
|
|
// console.error("获取步数出错", e) |
|
|
|
} |
|
|
|
}, |
|
|
|
startStep() { |
|
|
@ -323,15 +323,15 @@ |
|
|
|
StepCounter.getRecordStep((res) => { |
|
|
|
//res.result == true 获取记录成功,否则错误 |
|
|
|
//res.stepCount 记录的步数 |
|
|
|
console.log(res.result) |
|
|
|
console.log(res.stepCount) |
|
|
|
// console.log(res.result) |
|
|
|
// console.log(res.stepCount) |
|
|
|
}); |
|
|
|
}, |
|
|
|
resStartStep() { |
|
|
|
//如需重新记录,再次调用此接口即可 |
|
|
|
StepCounter.startRecordStep((res) => { |
|
|
|
//res.result == true 开始记录成功,否则错误 |
|
|
|
console.log(res.result) |
|
|
|
// console.log(res.result) |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
@ -343,7 +343,7 @@ |
|
|
|
uni.$u.toast(res.errMsg); |
|
|
|
} else { |
|
|
|
// #ifdef APP-PLUS |
|
|
|
console.log(res.url) |
|
|
|
// console.log(res.url) |
|
|
|
plus.runtime.openUrl(res.url) |
|
|
|
// #endif |
|
|
|
// #ifdef H5 |
|
|
@ -358,16 +358,16 @@ |
|
|
|
// 获取未读的公告 |
|
|
|
getNoReadNotice() { |
|
|
|
for (var i = 0; i < this.notice.length; i++) { |
|
|
|
if (this.notice[i].isRead == 'no') { |
|
|
|
if (this.notice[0].isRead == 'no') { |
|
|
|
this.contentFirst = this.notice[i].content |
|
|
|
this.noticeId = this.notice[i].id |
|
|
|
this.popupShow = true |
|
|
|
} |
|
|
|
} |
|
|
|
// 如果循环都是已读的就关闭弹框 |
|
|
|
if (!this.noticeId) { |
|
|
|
this.popupShow = false |
|
|
|
} |
|
|
|
// if (!this.noticeId) { |
|
|
|
// this.popupShow = false |
|
|
|
// } |
|
|
|
}, |
|
|
|
// 读公告 |
|
|
|
toRead() { |
|
|
@ -379,7 +379,8 @@ |
|
|
|
this.popupShow = false |
|
|
|
setTimeout(() => { |
|
|
|
this.noticeId = null; |
|
|
|
this.getNoReadNotice() |
|
|
|
this.messageList=[]; |
|
|
|
this.noticeList(); |
|
|
|
}, 1500) |
|
|
|
|
|
|
|
}, |
|
|
@ -520,7 +521,7 @@ |
|
|
|
|
|
|
|
methods: { |
|
|
|
receive(newValue, oldValue, ownerVm, vm) { |
|
|
|
console.log(newValue, '变化') |
|
|
|
// console.log(newValue, '变化') |
|
|
|
this.initEcharts() |
|
|
|
// if(!this.myChart){ |
|
|
|
// this.initEcharts() |
|
|
@ -573,8 +574,8 @@ |
|
|
|
}, |
|
|
|
itemStyle: { |
|
|
|
// 设置扇形的阴影 |
|
|
|
shadowBlur: 30, |
|
|
|
shadowColor: '#15141F', |
|
|
|
shadowBlur: 0, |
|
|
|
shadowColor: '#00E8A2', |
|
|
|
shadowOffsetX: 'center', |
|
|
|
shadowOffsetY: 'center', |
|
|
|
|
|
|
@ -584,23 +585,17 @@ |
|
|
|
name: '步数', |
|
|
|
itemStyle: { |
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ |
|
|
|
offset: .2, |
|
|
|
color: '#47BDFF' |
|
|
|
}, { |
|
|
|
offset: .5, |
|
|
|
color: '#34AEFF' |
|
|
|
}, { |
|
|
|
offset: 1, |
|
|
|
color: '#0589FF' |
|
|
|
}]), |
|
|
|
borderRadius: 800, |
|
|
|
color: '#00E8A2' |
|
|
|
}, ]), |
|
|
|
borderRadius: 0, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: (this.stepTarget - this.stepsNum) / this.stepTarget, |
|
|
|
name: '剩余步数', |
|
|
|
itemStyle: { |
|
|
|
color: '#15141F', |
|
|
|
color: '#A1A0A8', |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|