Commit 2b6b7a9a by 高淑倩

add: 点击事件

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