|
@@ -1,3 +1,4 @@
|
|
|
|
+const FriendApi = require('../net/FriendApi');
|
|
|
|
|
|
cc.Class({
|
|
cc.Class({
|
|
extends: cc.Component,
|
|
extends: cc.Component,
|
|
@@ -38,16 +39,16 @@ cc.Class({
|
|
|
|
|
|
} else if (CC_WECHATGAME) {
|
|
} else if (CC_WECHATGAME) {
|
|
wx.setClipboardData({
|
|
wx.setClipboardData({
|
|
- data: this.userId,
|
|
|
|
|
|
+ data: this.userId.toString(),
|
|
success(res) {
|
|
success(res) {
|
|
wx.getClipboardData({
|
|
wx.getClipboardData({
|
|
success(res) {
|
|
success(res) {
|
|
- GameGlobal.commonAlert.showCommonErrorAlert('复制成功');
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
fail() {
|
|
fail() {
|
|
- GameGlobal.commonAlert.showCommonErrorAlert('复制失败请重试');
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
@@ -56,8 +57,11 @@ cc.Class({
|
|
},
|
|
},
|
|
|
|
|
|
addFriend() {
|
|
addFriend() {
|
|
|
|
+ FriendApi.getByFriendId(this.userId, (responseData) => {
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ }, (error) => {
|
|
|
|
|
|
|
|
+ });
|
|
|
|
+ }
|
|
// update (dt) {},
|
|
// update (dt) {},
|
|
});
|
|
});
|