|
@ -20,27 +20,29 @@ |
|
|
</view> |
|
|
</view> |
|
|
<!-- 轮播图 --> |
|
|
<!-- 轮播图 --> |
|
|
<!-- #ifdef APP-PLUS --> |
|
|
<!-- #ifdef APP-PLUS --> |
|
|
<u-swiper class="swiper" :list="swiperList" @click="bannerClick" previousMargin="48rpx" nextMargin="80rpx" circular |
|
|
<u-swiper class="swiper" :list="swiperList" @click="bannerClick" previousMargin="48rpx" nextMargin="80rpx" |
|
|
:autoplay="true" radius="32rpx" bgColor="rgba(0,0,0,0)" height="360rpx"> |
|
|
circular :autoplay="true" radius="32rpx" bgColor="rgba(0,0,0,0)" height="360rpx"> |
|
|
<!-- #endif --> |
|
|
<!-- #endif --> |
|
|
<!-- #ifdef H5 --> |
|
|
<!-- #ifdef H5 --> |
|
|
<u-swiper class="swiper" :list="swiperList" @click="bannerClick" previousMargin="48rpx" nextMargin="80rpx" circular |
|
|
<u-swiper class="swiper" :list="swiperList" @click="bannerClick" previousMargin="48rpx" |
|
|
:autoplay="true" radius="32rpx" bgColor="rgba(0,0,0,0)" height="360rpx" style="margin-top: 145rpx;"> |
|
|
nextMargin="80rpx" circular :autoplay="true" radius="32rpx" bgColor="rgba(0,0,0,0)" height="360rpx" |
|
|
|
|
|
style="margin-top: 145rpx;"> |
|
|
<!-- #endif --> |
|
|
<!-- #endif --> |
|
|
</u-swiper> |
|
|
</u-swiper> |
|
|
<!-- 消息 --> |
|
|
<!-- 消息 --> |
|
|
<view class="message" @click="go('/pages/me/notification')"> |
|
|
<view class="message" @click="go('/pages/me/notification')"> |
|
|
<u-icon class="icon" name="../../static/home/ic_proclamation.png" size="60rpx" width="60rpx"></u-icon> |
|
|
<u-icon class="icon" name="../../static/home/ic_proclamation.png" size="60rpx" width="60rpx"> |
|
|
|
|
|
</u-icon> |
|
|
<!-- <view class="text">{{ i18n.homeMessage }}</view> --> |
|
|
<!-- <view class="text">{{ i18n.homeMessage }}</view> --> |
|
|
<u-notice-bar class="notice" :text="messageList" icon="" fontSize="24rpx" bgColor="#211F32" color="#fff" |
|
|
<u-notice-bar class="notice" :text="messageList" icon="" fontSize="24rpx" bgColor="#211F32" |
|
|
direction="column" > |
|
|
color="#fff" direction="column"> |
|
|
</u-notice-bar> |
|
|
</u-notice-bar> |
|
|
</view> |
|
|
</view> |
|
|
<!-- 三个按钮 --> |
|
|
<!-- 三个按钮 --> |
|
|
<view class="btnDiv"> |
|
|
<view class="btnDiv"> |
|
|
<view class="item" @click="goto('recharge')"> |
|
|
<view class="item" @click="goto('recharge')"> |
|
|
<u--image class="img" :showLoading="true" src="../../static/home/img_recharge.png" width="144rpx" |
|
|
<u--image class="img" :showLoading="true" src="../../static/home/img_recharge.png" |
|
|
height="144rpx"></u--image> |
|
|
width="144rpx" height="144rpx"></u--image> |
|
|
<view class="text">{{ i18n.Recharge }}</view> |
|
|
<view class="text">{{ i18n.Recharge }}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="item" @click="goto('mine')"> |
|
|
<view class="item" @click="goto('mine')"> |
|
@ -49,8 +51,8 @@ |
|
|
<view class="text">{{ i18n.Mine }}</view> |
|
|
<view class="text">{{ i18n.Mine }}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="item" @click="goto('subcription')"> |
|
|
<view class="item" @click="goto('subcription')"> |
|
|
<u--image class="img" :showLoading="true" src="../../static/home/img_Subcription.png" width="144rpx" |
|
|
<u--image class="img" :showLoading="true" src="../../static/home/img_Subcription.png" |
|
|
height="144rpx"></u--image> |
|
|
width="144rpx" height="144rpx"></u--image> |
|
|
<view class="text">{{ i18n.Subcription }}</view> |
|
|
<view class="text">{{ i18n.Subcription }}</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
@ -61,8 +63,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view id="chart" :stepsNum="stepsNum" :stepTarget="stepTarget" :change:stepTarget="echarts.stepTargetReceive" |
|
|
<view id="chart" :stepsNum="stepsNum" :stepTarget="stepTarget" |
|
|
:change:stepsNum="echarts.receive" style="width: 280rpx;height:280rpx; font-size: 40rpx;"> |
|
|
:change:stepTarget="echarts.stepTargetReceive" :change:stepsNum="echarts.receive" |
|
|
|
|
|
style="width: 280rpx;height:280rpx; font-size: 40rpx;"> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -156,7 +159,7 @@ |
|
|
swiperList: [ |
|
|
swiperList: [ |
|
|
|
|
|
|
|
|
], |
|
|
], |
|
|
bannerList:[], |
|
|
bannerList: [], |
|
|
videoShow: false, |
|
|
videoShow: false, |
|
|
videoUrl: '', |
|
|
videoUrl: '', |
|
|
videoList: [], |
|
|
videoList: [], |
|
@ -194,7 +197,7 @@ |
|
|
this.updateSteps('show'); |
|
|
this.updateSteps('show'); |
|
|
// #endif |
|
|
// #endif |
|
|
// #ifdef H5 |
|
|
// #ifdef H5 |
|
|
this.stepsNum=0; |
|
|
this.stepsNum = 0; |
|
|
// #endif |
|
|
// #endif |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -208,57 +211,57 @@ |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 更新步数逻辑 |
|
|
// 更新步数逻辑 |
|
|
updateSteps(soucre){ |
|
|
updateSteps(soucre) { |
|
|
var today=this.$index.formatyymmdd(new Date().getTime()); |
|
|
var today = this.$index.formatyymmdd(new Date().getTime()); |
|
|
var stepsNum_date= uni.getStorageSync("stepsNum_date"); |
|
|
var stepsNum_date = uni.getStorageSync("stepsNum_date"); |
|
|
|
|
|
|
|
|
var isUpdate=false; |
|
|
var isUpdate = false; |
|
|
console.log(today) |
|
|
// console.log(today) |
|
|
console.log(uni.getStorageSync("stepsNum_date")) |
|
|
// console.log(uni.getStorageSync("stepsNum_date")) |
|
|
console.log(stepsNum_date) |
|
|
// console.log(stepsNum_date) |
|
|
|
|
|
|
|
|
if(stepsNum_date){ |
|
|
if (stepsNum_date) { |
|
|
if(today!=stepsNum_date.date){ |
|
|
if (today != stepsNum_date.date) { |
|
|
uni.setStorageSync("stepsNum_date",null); |
|
|
uni.setStorageSync("stepsNum_date", null); |
|
|
|
|
|
|
|
|
}else{ |
|
|
} else { |
|
|
if(this.stepsNum==0){ |
|
|
if (this.stepsNum == 0) { |
|
|
this.stepsNum=stepsNum_date.newStepsNum; |
|
|
this.stepsNum = stepsNum_date.newStepsNum; |
|
|
} |
|
|
} |
|
|
if(parseInt(this.stepsNum)>parseInt(stepsNum_date.stepsNum)){ |
|
|
if (parseInt(this.stepsNum) > parseInt(stepsNum_date.stepsNum)) { |
|
|
|
|
|
|
|
|
uni.setStorageSync("stepsNum_date",{ |
|
|
uni.setStorageSync("stepsNum_date", { |
|
|
stepsNum:stepsNum_date.stepsNum, |
|
|
stepsNum: stepsNum_date.stepsNum, |
|
|
date:today, |
|
|
date: today, |
|
|
newStepsNum:this.stepsNum |
|
|
newStepsNum: this.stepsNum |
|
|
}); |
|
|
}); |
|
|
if(soucre){ |
|
|
if (soucre) { |
|
|
isUpdate=true; |
|
|
isUpdate = true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
} else { |
|
|
isUpdate=true; |
|
|
isUpdate = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(isUpdate){ |
|
|
if (isUpdate) { |
|
|
this.$api.updateSteps({ |
|
|
this.$api.updateSteps({ |
|
|
steps: this.stepsNum |
|
|
steps: this.stepsNum |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
console.log(res,'res更新') |
|
|
console.log(res, 'res更新') |
|
|
uni.setStorageSync("stepsNum_date",{ |
|
|
uni.setStorageSync("stepsNum_date", { |
|
|
stepsNum:this.stepsNum, |
|
|
stepsNum: this.stepsNum, |
|
|
date:today, |
|
|
date: today, |
|
|
newStepsNum:this.stepsNum |
|
|
newStepsNum: this.stepsNum |
|
|
}); |
|
|
}); |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
console.log(this.stepsNum) |
|
|
console.log(this.stepsNum) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
bannerClick(i){ |
|
|
bannerClick(i) { |
|
|
// #ifdef APP-PLUS |
|
|
// #ifdef APP-PLUS |
|
|
plus.runtime.openUrl(this.bannerList[i].adUrl) |
|
|
plus.runtime.openUrl(this.bannerList[i].adUrl) |
|
|
// #endif |
|
|
// #endif |
|
@ -278,18 +281,17 @@ |
|
|
closeConfirm() { |
|
|
closeConfirm() { |
|
|
this.$api.receivStepsAward().then(res => { |
|
|
this.$api.receivStepsAward().then(res => { |
|
|
uni.$u.toast(this.$t("markets").Succeeded) |
|
|
uni.$u.toast(this.$t("markets").Succeeded) |
|
|
this.closeModalShow=false |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
this.closeModalShow = false |
|
|
}, |
|
|
}, |
|
|
// 开启计步服务 |
|
|
// 开启计步服务 |
|
|
getSept() { |
|
|
getSept() { |
|
|
try{ |
|
|
try { |
|
|
//整个应用设置一次即可,停止计步后需重新调用,所有接口调用必须先开启计步服务 |
|
|
//整个应用设置一次即可,停止计步后需重新调用,所有接口调用必须先开启计步服务 |
|
|
StepCounter.startStep((res) => { |
|
|
StepCounter.startStep((res) => { |
|
|
console.log(res, '步数res'); |
|
|
console.log(res, '步数res'); |
|
|
this.stepCount = res.stepCount |
|
|
this.stepCount = res.stepCount |
|
|
this.stepsNum=res.stepCount; |
|
|
this.stepsNum = res.stepCount; |
|
|
this.updateSteps(); |
|
|
this.updateSteps(); |
|
|
//res.stepCount 当天累计步数 |
|
|
//res.stepCount 当天累计步数 |
|
|
}, (res) => { |
|
|
}, (res) => { |
|
@ -312,8 +314,8 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
}catch(e){ |
|
|
} catch (e) { |
|
|
console.error("获取步数出错",e) |
|
|
console.error("获取步数出错", e) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
startStep() { |
|
|
startStep() { |
|
@ -374,10 +376,12 @@ |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
this.noticeId = null; |
|
|
|
|
|
this.popupShow = false |
|
|
this.popupShow = false |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.noticeId = null; |
|
|
this.getNoReadNotice() |
|
|
this.getNoReadNotice() |
|
|
console.log(res, '已经读了吗') |
|
|
}, 1500) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
go(url) { |
|
|
go(url) { |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
@ -402,7 +406,7 @@ |
|
|
api.indexBanner({ |
|
|
api.indexBanner({ |
|
|
'mark': 'APP_INDEX' |
|
|
'mark': 'APP_INDEX' |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
this.bannerList=res |
|
|
this.bannerList = res |
|
|
for (var i = 0; i < res.length; i++) { |
|
|
for (var i = 0; i < res.length; i++) { |
|
|
this.swiperList.push(this.baseURL + res[i].adImgPath) |
|
|
this.swiperList.push(this.baseURL + res[i].adImgPath) |
|
|
} |
|
|
} |
|
@ -516,7 +520,7 @@ |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
receive(newValue, oldValue, ownerVm, vm) { |
|
|
receive(newValue, oldValue, ownerVm, vm) { |
|
|
console.log(newValue,'变化') |
|
|
console.log(newValue, '变化') |
|
|
this.initEcharts() |
|
|
this.initEcharts() |
|
|
// if(!this.myChart){ |
|
|
// if(!this.myChart){ |
|
|
// this.initEcharts() |
|
|
// this.initEcharts() |
|
@ -525,7 +529,7 @@ |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
stepTargetReceive(newValue, oldValue, ownerVm, vm){ |
|
|
stepTargetReceive(newValue, oldValue, ownerVm, vm) { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
initEcharts() { |
|
|
initEcharts() { |
|
|