2 Star 9 Fork 2

hcoder / Grace Animation Library

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or Download
praise.vue 1.02 KB
Copy Edit Web IDE Raw Blame History
hcoder authored 2021-04-13 09:35 . 20210413
<template>
<view class="gal-body">
<view style="margin-top:50rpx;">
<text class="gal-block-text gal-h4 gal-color-gray">点赞按钮演示</text>
</view>
<view class="gal-margin-top-large">
<view class="praise-button">
<gal-praise-button
ref="praiseButton"
@tapme="tapme"
:number="number"></gal-praise-button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
// 点赞数量
number : 99
}
},
methods: {
tapme : function(){
// 判断是否已经赞过
if(this.$refs.praiseButton.status != 1){
if(this.$refs.praiseButton.status == 4){
uni.showToast({
title:"已经赞过了", icon:"none"
});
}
return ;
}
// 图标动画 ( 代表与后端交互加载动画 )
this.$refs.praiseButton.loading();
// 与后端交互完成展示结果动画
setTimeout(()=>{
this.number = 100;
this.$refs.praiseButton.stopLoading();
}, 3000);
}
}
}
</script>
<style>
.praise-button{width:200rpx; margin-left:235rpx;}
</style>

Comment ( 0 )

Sign in to post a comment

1
https://gitee.com/hcoder2016/grace-animation-library.git
git@gitee.com:hcoder2016/grace-animation-library.git
hcoder2016
grace-animation-library
Grace Animation Library
master

Search

161121 f78d6d6f 1850385 154831 86f8c370 1850385