• 动画消除”保存的页面“


    html

    <view class="content">

      <block wx:for="{{list}}" wx:key="{{index}}">

        <view animation="{{item.value.animation}} class="list">

        <view class="title" bindtap="onLoadNews" data-key="{{item.key}}"

      {{item.value.title}}

    </view>

    js

    page ({

      data:{  

        list:[]

    }

    //监听显示

    onshow:function() {

      var animation=wx.createAnimation({

        duration:1000,

          timingFunction:"ease".

          this.animation=animation

     js

    onFavorite:function(e){

      var that=this,

        key=e.currentTarget.dataset.key

        value=e.currentTarget.dataset.value

        data=that.data.list

        this.animation.opacity(0).step();

        var animation=this.animation.export();

        var arrayTmp=[];

        hotapp.post(key.value.function(res){

          console.log(e.currentTarget.dataset.key);

        var newdata=data.map{function(item){

          if (item.key==key){

        item value.animation=animation;

        }else{

          that.animation.opacity(1).step();

          item.value.animation=that.animation.export();

        arrayTmp.push(item);

      }

        return item;

    });

        this.setData({list:newdata});

        setTimeout(function(){

        that.setData({list:arrayTmp});

        wx.showToast({

          title:"成功“,

          },

        icon:'success',

        duration:2000

        })

      },1200);

    })

        

  • 相关阅读:
    while...break 实例
    java ++ -- 异或 短路与 短路或 三目条件
    Java StringBuffer与StringBuider
    输入任意5个整数,输出它们的和。
    java输入年份和月份,输出天数
    进制转换
    luogu 4884 多少个1?
    SDOI2013 随机数生成器
    CQOI2018 破解D-H协议
    模板BSGS(SDOI2011计算器) 模板EXBSGS
  • 原文地址:https://www.cnblogs.com/aivnfjgj/p/6363647.html
Copyright © 2020-2023  润新知