Commit 1ef34785 authored by 郝聪敏's avatar 郝聪敏

添加充值克币动画

parent ca35f130
......@@ -15,7 +15,7 @@
</template>
<script>
import wepy from '@wepy/core';
let showMenusTimer = null;
wepy.component({
props: {
showMenus: {
......@@ -34,7 +34,8 @@
watch: {
showMenus(v) {
if (!v) {
setTimeout(() => {
if (showMenusTimer) clearTimeout(showMenusTimer);
showMenusTimer = setTimeout(() => {
this.show = false;
}, 300);
} else {
......@@ -61,7 +62,7 @@
created() {
let statusHeight = this.$app.$options.globalData.statusBarHeight || '';
statusHeight && (this.popupStyle = 'top:' + (statusHeight + 56) + 'px');
}
},
});
</script>
<style lang="less">
......
......@@ -57,6 +57,7 @@
share: '/static/images/share@2x.png',
lottery: '/static/images/lottery@2x.png'
};
let addGoldTimer = null;
wepy.component({
store,
data: {
......@@ -126,7 +127,13 @@
},
watch: {
isReceive(newVal, oldVal) {
this.addGold = true;
this.addGold = newVal;
if (newVal) {
if (addGoldTimer) clearTimeout(addGoldTimer);
addGoldTimer = setTimeout(() => {
this.$emit('resetAddGold');
}, 1000);
}
},
des(newVal, oldVal) {
if (this.type === 'gold') {
......
......@@ -171,7 +171,7 @@
<image v-if="!authmodal" @tap="showMenu(!showModal)" :src="userInfo.avatarUrl" mode="cover" class="userimage"></image>
</view>
<view>
<gold type="gold" :des="mainInfo && mainInfo.account && mainInfo.account.quantity || 0" :gold="sign" :isReceive="isReceive" @showCorn="cornModalShow"></gold>
<gold type="gold" :des="mainInfo && mainInfo.account && mainInfo.account.quantity || 0" :gold="sign" :isReceive="isReceive" @resetAddGold="resetAddGold" @showCorn="cornModalShow"></gold>
<sign type="sign" des="签到" :sign="sign" @sign-in="signIn"></sign>
<lottery type="lottery" des="抽奖" @getAwards="getAwards" @getUserInfo="getUserInfo" :authmodal="authmodal"></lottery>
<share type="share" des="分享"></share>
......@@ -220,7 +220,7 @@
isReceive: false, // 是否显示领取克币动画
cornModal:false,
cornCode: '', //克币充值码
cornText:'',
cornText:'充值码无效,请重新输入',
cornTextShow: false,
},
......@@ -420,6 +420,8 @@
if(data.code === 0){
//充值成功
this.cornModal = false;
this.mainInfo.account.quantity = data.accountCoins;
this.isReceive = true;
} else {
const msgindex = data.code+2;
this.cornText = msg[msgindex];
......@@ -428,6 +430,9 @@
});
},
resetAddGold() {
this.isReceive = false;
}
},
async onLoad (options) {
// 获取分享人openid
......
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