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