Commit 2b6b7a9a by 高淑倩

add: 点击事件

parent 9acfc40c
......@@ -43,33 +43,36 @@ Component({
* 组件的方法列表
*/
methods: {
_updateData (data) {
_handleGo() {
this.triggerEvent('handleGo')
},
_updateData(data) {
if (data) {
this.setData(data)
}
},
_showChange (newV, oldV) {
_showChange(newV, oldV) {
if (newV !== oldV) {
this._updateData({
show: newV
})
}
},
_showDefalutChange (newV, oldV) {
_showDefalutChange(newV, oldV) {
if (newV !== oldV) {
this._updateData({
showDefalut: newV
})
}
},
_configChange (newV, oldV) {
_configChange(newV, oldV) {
if (newV !== oldV) {
this._updateData({
config: newV
})
}
},
_close (e) {
_close(e) {
let o = e.currentTarget.dataset
if (this.data.stopMask && o.id === 'mask') {
return false
......
......@@ -7,15 +7,15 @@
<view class='content' style="background-image: url('{{dialog.image}}');">
<view class="">恭喜你,领取成功!</view>
<view class="p">可在{{dialog.content}}中查看奖励哦~</view>
<view class="tip-text">{{dialog.tip}}</view>
<view class="tip-text" bindtap='_handleGo'>{{dialog.tip}}</view>
</view>
</view>
<view class="close" bindtap='_close'></view>
</view>
<view class='dialog-body' bindtap='_close' wx:if="{{showDefalut && dialog.state === 'success'}}">
<view wx:if="{{dialog.image}}">
<image class="image" mode="widthFix" src='{{dialog.image}}'></image>
</view>
<image class="image" mode="widthFix" src='{{dialog.image}}'></image>
</view>
</view>
<slot name="after"></slot>
</view>
......
......@@ -67,7 +67,7 @@
border-radius: 0 0 20rpx 20rpx; }
.dialog-body .tip-text {
padding-top: 102rpx;
padding: 102rpx;
color: rgba(255, 255, 255, 1);
box-sizing: border-box;
font-size: 36rpx;
......
......@@ -25,7 +25,10 @@ wxService.page({
onLoad: function (options) {
},
handleGo(){
console.log('handleGo')
wxService.router(`/pages/coupons/coupons`)
},
handleToGet() {
let dialog = this.data.dialog
dialog.show = true
......
......@@ -30,4 +30,4 @@
</view>
<view class="detail-desc" />
<x-dialog dialog="{{dialog}}" show="{{dialog.show}}"></x-dialog>
\ No newline at end of file
<x-dialog dialog="{{dialog}}" bind:handleGo="handleGo" show="{{dialog.show}}"></x-dialog>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment