效果:效果为动态
一:wxml片段
<scroll-view scroll-y="true">
<!-- 页面内容 -->
</scroll-view>
<view>
<image wx:for="{
{snows}}" wx:key="index" src="/img/snow.png" style="left:{
{snows[index]}}rpx" animation="{
{animation[index]}}" class='snow' data-index='{
{index}}' />
</view>
二:JS片段
// pages/snows/snows.js
var i = 0;
Page({
/**
* 页面的初始数据
*/
data: {
snows: [],
animation: [],
dateTime: "",
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this