@ubrorg/card
Advanced tools
Comparing version 0.5.1 to 0.6.0
@@ -25,4 +25,3 @@ function qs(params) { | ||
maintain: false, | ||
arrow: true, | ||
onLikeTap: function onLikeTap() {} | ||
arrow: true | ||
}, | ||
@@ -47,3 +46,23 @@ data: { | ||
handleLikeTap: function handleLikeTap(e) { | ||
this.props.onLikeTap(e, this.props); | ||
var _this = this; | ||
var id = e.target.dataset.id; | ||
var favoriteStatus = this.props.favoriteStatus; | ||
var url = favoriteStatus ? '/api/users/favorites/del/1.0' : '/api/users/favorites/add/1.0'; | ||
this.$page.request({ | ||
url: url, | ||
method: 'POST', | ||
data: { | ||
ttid: 6, | ||
id: id | ||
}, | ||
success: function success() { | ||
_this.setData({ | ||
favoriteStatus: !favoriteStatus | ||
}); | ||
}, | ||
fail: function fail(res) { | ||
console.error(res); | ||
} | ||
}); | ||
}, | ||
@@ -50,0 +69,0 @@ handleNavigatorTap: function handleNavigatorTap(e) { |
{ | ||
"name": "@ubrorg/card", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "card", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
16978
104