Browse Source

合并提交

master
j1ack 3 years ago
parent
commit
89681b0f03
  1. 19
      manifest.json
  2. 202
      pages/home/index.vue
  3. 1
      pages/withdrawal/withdrawal.vue

19
manifest.json

@ -1,6 +1,6 @@
{
"name" : "samehome",
"appid" : "__UNI__0CF38A0",
"appid" : "__UNI__C4028F6",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "101",
@ -48,7 +48,22 @@
/* SDK */
"sdkConfigs" : {}
},
"nativePlugins" : {}
"nativePlugins" : {
"HF-Step" : {
"__plugin_info__" : {
"name" : "原生计步器(Android和IOS)",
"description" : "计步器,原生计步器插件,安卓,IOS",
"platforms" : "Android,iOS",
"url" : "https://ext.dcloud.net.cn/plugin?id=6632",
"android_package_name" : "com.samehome",
"ios_bundle_id" : "com.samehome",
"isCloud" : true,
"bought" : 1,
"pid" : "6632",
"parameters" : {}
}
}
}
},
"h5" : {
"publicPath" : "/",

202
pages/home/index.vue

@ -19,8 +19,6 @@
</u-overlay>
</view>
<!-- 轮播图 -->
<!-- #ifdef APP-PLUS -->
<u-swiper class="swiper" :list="swiperList" @click="bannerClick" previousMargin="48rpx" nextMargin="80rpx" circular
:autoplay="true" radius="32rpx" bgColor="rgba(0,0,0,0)" height="360rpx">
@ -60,9 +58,14 @@
<view class="steps">
<view class="content">
<view class="title">{{ i18n.TodaySteps }}</view>
<view id="chart" :stepsNum="stepsNum" :stepTarget="stepTarget" :change:stepTarget="echarts.receive"
<view id="chart" :stepsNum="stepsNum" :stepTarget="stepTarget" :change:stepTarget="echarts.stepTargetReceive"
:change:stepsNum="echarts.receive" style="width: 280rpx;height:280rpx; font-size: 40rpx;">
</view>
<!-- <canvas id="chart" ref="chart" style="width: 280rpx;height:280rpx; font-size: 40rpx;"></canvas> -->
<u-button class="button" color="#00E8A2" @click="closeModalShow=true">{{ i18n.ReceiveEarnings }}
</u-button>
@ -88,7 +91,8 @@
<video class="video" v-show="videoShow" id="video" :enable-progress-gesture="false" autoplay="true"
:src="videoUrl" controls x5-video-player-type="h5-page" @fullscreenchange="ifStopVideo"></video>
<!-- 通知弹出层 -->
<u-popup class="popup" v-if="popupShow" round="32rpx" mode="center" @close="popupShow = false"
<view class="">
<u-popup class="popup" :show="popupShow" round="32rpx" mode="center" @close="popupShow = false"
@open="popupShow = true" bgColor="#211F32" :customStyle="{
margin: 'auto 102rpx auto 118rpx',
}">
@ -100,6 +104,8 @@
<u-button class="button" color="#00E8A2" @click="toRead" :throttleTime="500">OK</u-button>
</view>
</u-popup>
</view>
<!-- <view class="" @click="startStep">
开始记步
@ -122,7 +128,7 @@
// let videoPlayerObj = {};
let videoPlayer;
let myChart;
// let StepCounter = uni.requireNativePlugin('HF-Step-module');
let StepCounter = uni.requireNativePlugin('HF-Step-module');
export default {
name: 'home',
components: {
@ -145,7 +151,7 @@
languageShow: false,
langTrue: languageData[0].title || 'English',
languageData,
popupShow: true,
popupShow: false,
messageList: [],
swiperList: [
@ -156,22 +162,18 @@
videoList: [],
option: null,
stepsNum: 0, //
stepsNumString:'', //
stepTarget: 10000, //
stepTarget: 5000, //
myChart: null,
}
},
onLoad() {
this.stepsNum=uni.getStorageSync('coinTypeInfo').system_total_steps
this.stepsNum=parseInt(this.stepsNum)
this.stepsNumString=uni.getStorageSync('coinTypeInfo').system_total_steps
this.baseURL = constant.BASE_URL
this.getbanner();
this.noticeList();
this.getUserInfoBalance();
},
onShow() {
// this.getSept()
//
// this.videoList.forEach((item, index) => {
// const VideoPlayer = uni.createVideoContext(`video-${index}`, this)
@ -185,9 +187,17 @@
if (uni.getStorageSync('langTrue')) {
this.langTrue = uni.getStorageSync('langTrue')
}
// #ifdef APP-PLUS
this.getSept()
// this.startStep()
// this.resStartStep()
this.updateSteps();
// #endif
// #ifdef H5
this.stepsNum=0;
// #endif
},
onHide() {
this.stopAllVideoPlay()
},
@ -197,6 +207,48 @@
}
},
methods: {
//
updateSteps(){
var today=this.$index.formatyymmdd(new Date().getTime());
var stepsNum_date= uni.getStorageSync("stepsNum_date");
var isUpdate=false;
console.log(today)
console.log(uni.getStorageSync("stepsNum_date"))
console.log(stepsNum_date)
if(stepsNum_date){
if(today!=stepsNum_date.date){
uni.setStorageSync("stepsNum_date",null);
}else{
if(this.stepsNum==0){
this.stepsNum=stepsNum_date.stepsNum;
}
if(parseInt(this.stepsNum)>parseInt(stepsNum_date.stepsNum)){
isUpdate=true;
}
}
}else{
isUpdate=true;
}
if(isUpdate){
this.$api.updateSteps({
steps: this.stepsNum
}).then(res => {
console.log(res,'res更新')
uni.setStorageSync("stepsNum_date",{
stepsNum:this.stepsNum,
date:today
});
})
}
console.log(this.stepsNum)
},
bannerClick(i){
// #ifdef APP-PLUS
plus.runtime.openUrl(this.bannerList[i].adUrl)
@ -215,21 +267,21 @@
},
//
closeConfirm() {
this.$api.updateSteps({
steps: this.stepsNumString
}).then(res => {
this.$api.receivStepsAward().then(res => {
uni.$u.toast(this.$t("markets").Succeeded)
this.closeModalShow=false
})
})
},
//
getSept() {
try{
//
StepCounter.startStep((res) => {
console.log(res, '步数res');
this.stepCount = res.stepCount
this.stepsNum=res.stepCount;
this.updateSteps();
//res.stepCount
}, (res) => {
console.log(res)
@ -251,6 +303,9 @@
}
});
}catch(e){
console.error("获取步数出错",e)
}
},
startStep() {
//
@ -258,9 +313,7 @@
//res.result == true
//res.stepCount
console.log(res.result)
this.stepResult = res.result
console.log(res.stepCount)
this.stepResult = res.stepCount
});
},
resStartStep() {
@ -294,17 +347,15 @@
if (this.notice[i].isRead == 'no') {
this.contentFirst = this.notice[i].content
this.noticeId = this.notice[i].id
this.popupShow = true
}
}
//
if (!this.noticeId) {
this.popupShow = false
}
},
go(url) {
uni.navigateTo({
url: url
})
},
//
toRead() {
api.noticeRead({
noticeId: this.noticeId
@ -315,10 +366,15 @@
console.log(res, '已经读了吗')
})
},
go(url) {
uni.navigateTo({
url: url
})
},
//
noticeList() {
api.noticeList({}).then(res => {
this.notice = res;
for (var i = 0; i < res.length; i++) {
@ -421,81 +477,7 @@
},
initChart() {
// let myChart = echarts.init(this.$refs.chart);
// console.log(document);
// console.log(this.$refs.chart);
// this.myChart = echarts.init(document.getElementById('chart'));
// this.myChart = echarts.init(this.$refs.chart);
// myChart = echarts.init(document.getElementById('chart'))
this.option = {
title: {
text: this.stepsNum,
//
subtext: "",
//
itemGap: 0,
left: 'center',
top: 'center',
//
textStyle: {
fontSize: '20',
color: '#fff'
},
},
series: [{
name: '环形饼图',
type: 'pie',
radius: ['48%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
itemStyle: {
//
shadowBlur: 30,
shadowColor: '#15141F',
shadowOffsetX: 'center',
shadowOffsetY: 'center'
},
data: [{
value: +this.stepsNum / this.stepTarget,
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,
}
},
{
value: (this.stepTarget - this.stepsNum) / this.stepTarget,
name: '剩余步数',
itemStyle: {
color: '#15141F',
}
}
]
}]
}
// myChart.setOption(this.option, true);
// window.addEventListener('resize', () => {
// myChart.resize();
// });
}
}
}
</script>
@ -521,18 +503,24 @@
methods: {
receive(newValue, oldValue, ownerVm, vm) {
console.log('newValue', newValue)
console.log(newValue,'变化')
this.initEcharts()
// if(!this.myChart){
// this.initEcharts()
// }else{
// this.myChart.setOption(this.option)
// }
},
stepTargetReceive(newValue, oldValue, ownerVm, vm){
},
initEcharts() {
this.initChart()
myChart = echarts.init(document.getElementById('chart'))
this.myChart = echarts.init(document.getElementById('chart'))
// view 访
myChart.setOption(this.option)
},
updateEcharts(newValue, oldValue, ownerInstance, instance) {
// service
myChart.setOption(newValue)
this.myChart.setOption(this.option)
// console.log('initEcharts')
},
onClick(event, ownerInstance) {
// service

1
pages/withdrawal/withdrawal.vue

@ -306,6 +306,7 @@
this.selectCoinInfo = e
this.coinInfo.coinCode = e.enname
this.coinInfo.coinCode2 = e.code
this.coinAddress='';
},
//
getWithConfig() {

Loading…
Cancel
Save