hcj 2 months ago
parent 6e750da2c6
commit 2579f3972d
  1. 1
      pages/personal/grade/gradeTask.vue
  2. 22
      pages/personal/grade/gradeValue.vue

@ -34,6 +34,7 @@ export default {
this.phoneuserinfo = uni.getStorageSync('wxUserInfo'); this.phoneuserinfo = uni.getStorageSync('wxUserInfo');
this.http.quickGet('/getInfo', true).then(res => { this.http.quickGet('/getInfo', true).then(res => {
const { testerStatus } = res.data.user const { testerStatus } = res.data.user
console.log(testerStatus);
if (testerStatus == 1) { if (testerStatus == 1) {
this.taskArrays[0].state = true this.taskArrays[0].state = true
} else if (testerStatus == 2) { } else if (testerStatus == 2) {

@ -15,7 +15,8 @@
</p> </p>
</view> </view>
<view class="gradeSwiperWrap"> <view class="gradeSwiperWrap">
<swiper class="gradeSwiper" previous-margin="30rpx" next-margin="30rpx"> <swiper class="gradeSwiper" previous-margin="30rpx" :duration="swipeDuration" next-margin="30rpx"
:current="currentImgIndex" @change="changeswiper">
<swiper-item v-for="(index) in scoreArray.length - 1" :key="index"> <swiper-item v-for="(index) in scoreArray.length - 1" :key="index">
<view class="swiper-item gradeSwiperItem"> <view class="swiper-item gradeSwiperItem">
<view class="bothSide"> <view class="bothSide">
@ -89,10 +90,12 @@ export default {
data() { data() {
return { return {
scoreArray: Object.freeze(scoreArray), scoreArray: Object.freeze(scoreArray),
myScore: '1900', myScore: '0',
avatar: '', avatar: '',
phoneuserinfo: '', phoneuserinfo: '',
nickName: '', nickName: '',
currentImgIndex: 0,
swipeDuration:0,
stateMap: Object.freeze({ stateMap: Object.freeze({
'未达成': 'currentGrow3', '未达成': 'currentGrow3',
'已达成': 'currentGrow1', '已达成': 'currentGrow1',
@ -106,20 +109,25 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: `./${url}` url: `./${url}`
}) })
},
changeswiper(e) {
this.currentImgIndex = e.detail.current
} }
}, },
onShow() { onShow() {
this.http.quickGet('/getInfo',true).then(res=>{
const {growthValue} = res.data.user },
onLoad() {
this.http.quickGet('/getInfo', true).then(res => {
const { growthValue } = res.data.user
this.myScore = growthValue || 0 this.myScore = growthValue || 0
this.currentImgIndex = getLevel(this.myScore).level
this.swipeDuration = 500
}) })
this.phoneuserinfo = uni.getStorageSync('wxUserInfo'); this.phoneuserinfo = uni.getStorageSync('wxUserInfo');
this.avatar = uni.getStorageSync('avatar'); this.avatar = uni.getStorageSync('avatar');
this.nickName = uni.getStorageSync('nickName'); this.nickName = uni.getStorageSync('nickName');
}, },
created() {
console.log(this.scoreArray);
},
computed: { computed: {
level() { level() {
const { _, equity } = getLevel(this.myScore) const { _, equity } = getLevel(this.myScore)

Loading…
Cancel
Save