Commit 36b4ed06 authored by 郝聪敏's avatar 郝聪敏

优化网络刷新页面;添加签到开奖音效

parent ec09cbdb
......@@ -15,33 +15,33 @@ wepy.app({
// 同时存在 Page hook 和 App hook 时,优先执行 Page hook,返回值再交由 App hook 处
},
globalData: {
statusBarHeight:''
statusBarHeight: ''
},
onLaunch() {
// this.$options.globalData.info = '333';
let that = this;
wx.getSystemInfo({
success: function (res) {
that.$options.globalData.statusBarHeight = res.statusBarHeight
that.$options.globalData.statusBarHeight = res.statusBarHeight;
}
});
wx.checkSession({
success () {
console.log('已登录')
//session_key 未过期,并且在本生命周期一直有效
console.log('已登录');
// session_key 未过期,并且在本生命周期一直有效
},
fail () {
// session_key 已经失效,需要重新执行登录流程
wx.login({
success (res) {
if (res.code) {
//发起网络请求,告诉后端
wx.setStorageSync('wxCode',res.code);
// 发起网络请求,告诉后端
wx.setStorageSync('wxCode', res.code);
} else {
console.log('登录失败!' + res.errMsg)
console.log('登录失败!' + res.errMsg);
}
}
})
});
}
});
wx.setStorageSync('onNetworkStatusChange', true);
......
<template>
<div class="network-container">
<div class="network-container" :class="{'show': show}">
<div class="network-wrapper">
<span class="network-text">网络状况不佳,请刷新重试</span>
<van-button custom-class="network-button" round type="info" @tap="setIsConnected">刷新</van-button>
......@@ -12,9 +12,15 @@
import store from '../../store';
wepy.component({
data: {
show: false
},
store,
methods: {
...mapActions(['setIsConnected'])
},
created() {
this.show = true;
}
});
</script>
......@@ -27,7 +33,7 @@
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
z-index: -1;
.network-wrapper {
display: flex;
justify-content: center;
......@@ -35,19 +41,22 @@
flex-direction: column;
.network-text {
color: #AAA;
font-size: 12px;
font-size: 24rpx;
}
.network-button {
margin-top: 10px;
width: 90px;
font-size: 12px;
height: 28px;
line-height: 28px;
margin-top: 20rpx;
width: 180rpx;
font-size: 24rpx;
height: 56rpx;
line-height: 56rpx;
background: #FF6600;
border-color: #FF6600;
}
}
}
.show {
z-index: 10;
}
</style>
<config>
{
......
......@@ -39,6 +39,16 @@
setTimeout(() => {
this.opened = true;
setTimeout(() => {
const innerAudioContext = wx.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src = '/static/images/winning.mp3';
innerAudioContext.onPlay(() => {
console.log('开始播放');
});
innerAudioContext.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
});
this.showChest = false;
this.blur = true;
this.show = true;
......@@ -52,8 +62,8 @@
created() {
setTimeout(() => {
this.showAnimation = true;
this.click();
},1000);
// this.click();
}, 1000);
}
});
</script>
......
......@@ -115,7 +115,7 @@
},
total: {
type: Number,
value: 0,
value: 0
}
},
data: {
......@@ -129,8 +129,8 @@
_invalidUp: 0,
_invalidDown: 0,
_videoContexts: [],
progress:0,
progressStyle:'',
progress: 0,
progressStyle: '',
loading: false
},
watch: {
......@@ -142,7 +142,7 @@
},
attached() {
this.progress = 47;
this.progressStyle = 'width:'+this.progress+'%';
this.progressStyle = 'width:' + this.progress + '%';
this._videoContexts = [
wx.createVideoContext('video_0', this.$wx),
wx.createVideoContext('video_1', this.$wx),
......@@ -166,7 +166,7 @@
if (diff === 0) return;
this._last = current;
this.playCurrent(current);
// this.$emit('change', { activeId: this.curQueue[current].id });
this.$emit('change', { activeId: this.curQueue[current].id });
this.loading = true;
this.circular = false;
......@@ -217,8 +217,7 @@
// console.log('circular2');
// this.circular = false;
// }
})
});
},
onWaiting (e) {
this.trigger(e, 'wait');
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment