| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <template>
- <view class="time-box" @click="out()">
- 交易取消{{s}}{{!s?'':'s'}}
- </view>
- </template>
- <script>
- export default {
- data(){
- return{
- s:'',
- timeServer:'',
- }
- },
- mounted() {
-
- },
- methods:{
- out(){
- clearInterval(this.timeServer);
- uni.reLaunch({
- url:'/pages/index/index'
- })
- },
- timeFun(){
- this.s = 180
- this.timeServer = setInterval(() => {
- --this.s;
- if (this.s <= 0) {
- clearInterval(this.timeServer);
- uni.reLaunch({
- url:'/pages/index/index'
- })
- }
- }, 1000);
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .time-box{
- width: 223rpx;
- height: 57rpx;
- line-height: 57rpx;
- text-align: center;
- border-radius: 104rpx;
- border: 2rpx solid #CCCCCC;
- font-size: 28rpx;
- color: #666;
- }
- </style>
|