瀏覽代碼

[领券弹出问卷调查][增加]:领券弹出问卷调查弹框

tags/2.2.7
meo 6 年之前
父節點
當前提交
6b82fc28be
共有 3 個檔案被更改,包括 21 行新增9 行删除
  1. +18
    -5
      components/questionnaire/questionnaire.js
  2. +1
    -2
      components/questionnaire/questionnaire.wxml
  3. +2
    -2
      components/questionnaire/questionnaire.wxss

+ 18
- 5
components/questionnaire/questionnaire.js 查看文件

@@ -15,7 +15,8 @@ Component({
alphaData: null,
scaleData: null,
skewData: null,
matrixData: null
matrixData: null,
zindex:null,
},
methods:{
close:function(){
@@ -33,14 +34,26 @@ Component({
this.queueClick();
},
queueClick: function () {
let that = this;
var animation = wx.createAnimation({});
animation.translate((this.data.widthScreen - 0), 0).scale(0).opacity(0.5).step({ duration: 3000 })
this.setData({ queueData: animation.export() })
animation.translate((this.data.widthScreen - 0), 0).scale(0).opacity(0.5).step({ duration: 1000 })
that.setData({ queueData: animation.export()})
setTimeout(function () {
that.setData({
flag: true
})
}, 1000)
},
alphaClick: function (even) {
let that = this;
var animation = wx.createAnimation({})
animation.opacity(0).step({ duration: 2000 })
this.setData({ alphaData: animation.export() })
animation.opacity(0).step({ duration: 1000 })
that.setData({ alphaData: animation.export()});
setTimeout(function(){
that.setData({
flag:true
})
},1000)
}
},
onLoad(){


+ 1
- 2
components/questionnaire/questionnaire.wxml 查看文件

@@ -1,4 +1,4 @@
<view class="b1" hidden="{{flag}}" animation="{{alphaData}}">
<view class="b1" hidden="{{flag}}" style='z-index:{{zindex}};' animation="{{alphaData}}">
<view class='con' animation="{{queueData}}">
<image class='close' mode='widthFix' src="./../../assets/img/closed.png" bindtap="close"></image>
<image class='image' src="./../../assets/img/headbg.png" mode='widthFix'></image>
@@ -10,5 +10,4 @@
</view>
</view>
</view>
<!-- <view style='width:60px;height:60px;background-color:yellow;' animation="{{queueData}}" bindtap='queueClick'>移动\n变小\n透明</view> -->
</view>

+ 2
- 2
components/questionnaire/questionnaire.wxss 查看文件

@@ -41,8 +41,8 @@
.ques {
width: 511rpx;
margin: 0 auto;
height: 86rpx;
line-height: 86rpx;
height: 105rpx;
line-height: 105rpx;
text-align: center;
font-size: 30rpx;
color: #333;


Loading…
取消
儲存