房间分享参数修改
This commit is contained in:
@@ -10,6 +10,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import com.mob.moblink.MobLink;
|
import com.mob.moblink.MobLink;
|
||||||
import com.mob.moblink.Scene;
|
import com.mob.moblink.Scene;
|
||||||
import com.mob.moblink.SceneRestorable;
|
import com.mob.moblink.SceneRestorable;
|
||||||
|
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||||
import com.yizhuan.erban.other.activity.SplashActivity;
|
import com.yizhuan.erban.other.activity.SplashActivity;
|
||||||
import com.yizhuan.xchat_android_core.linked.LinkedModel;
|
import com.yizhuan.xchat_android_core.linked.LinkedModel;
|
||||||
import com.yizhuan.xchat_android_core.linked.bean.LinkedInfo;
|
import com.yizhuan.xchat_android_core.linked.bean.LinkedInfo;
|
||||||
@@ -31,27 +32,44 @@ public class AgentActivity extends AppCompatActivity implements SceneRestorable
|
|||||||
public void onReturnSceneData(Scene scene) {
|
public void onReturnSceneData(Scene scene) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
HashMap<String, Object> params = scene.getParams();
|
HashMap<String, Object> hashMap = scene.getParams();
|
||||||
|
|
||||||
LinkedInfo info = LinkedModel.get().getLinkedInfo();
|
LogUtil.print("linkedme", hashMap);
|
||||||
if (info == null) {
|
//根据key获取传入的参数的值,该key关键字View可为任意值,由集成方规定,请与web端商议,一致即可
|
||||||
info = new LinkedInfo();
|
LinkedInfo linkedInfo = new LinkedInfo();
|
||||||
|
String roomuid = (String) hashMap.get("roomuid");
|
||||||
|
String uid = (String) hashMap.get("uid");
|
||||||
|
String type = (String) hashMap.get("type");
|
||||||
|
String familyId = (String) hashMap.get("familyId");
|
||||||
|
String url = (String) hashMap.get("url");
|
||||||
|
String worldId = (String) hashMap.get("worldId");
|
||||||
|
String dynamicId = (String) hashMap.get("dynamicId");
|
||||||
|
String inviteCode = (String) hashMap.get("inviteCode");
|
||||||
|
if (roomuid != null) {
|
||||||
|
linkedInfo.setRoomUid(roomuid);
|
||||||
|
}
|
||||||
|
if (uid != null) {
|
||||||
|
linkedInfo.setUid(uid);
|
||||||
|
}
|
||||||
|
if (type != null) {
|
||||||
|
linkedInfo.setType(type);
|
||||||
|
}
|
||||||
|
if (familyId != null) {
|
||||||
|
linkedInfo.setFamilyId(familyId);
|
||||||
|
}
|
||||||
|
if (url != null) {
|
||||||
|
linkedInfo.setUrl(url);
|
||||||
|
}
|
||||||
|
if (worldId != null) {
|
||||||
|
linkedInfo.setWorldId(worldId);
|
||||||
|
}
|
||||||
|
if (dynamicId != null) {
|
||||||
|
linkedInfo.setDynamicId(dynamicId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.get("mobLinkType") != null) {
|
linkedInfo.setInviteCode(inviteCode);
|
||||||
Integer mobLinkType = (Integer) params.get("mobLinkType");
|
|
||||||
info.setType(mobLinkType + "");
|
|
||||||
}
|
|
||||||
if (params.get("ROOM_UID") != null) {
|
|
||||||
String roomid = (String) params.get("ROOM_UID");
|
|
||||||
info.setRoomUid(roomid);
|
|
||||||
}
|
|
||||||
if (params.get("inviteCode") != null) {
|
|
||||||
String inviteCode = (String) params.get("inviteCode");
|
|
||||||
info.setInviteCode(inviteCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
LinkedModel.get().setLinkedInfo(info);
|
LinkedModel.get().setLinkedInfo(linkedInfo);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
@@ -578,6 +578,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
|||||||
.flatMap(userInfo -> ShareModel.get().shareRoom(
|
.flatMap(userInfo -> ShareModel.get().shareRoom(
|
||||||
platform,
|
platform,
|
||||||
currentRoomInfo.getUid(),
|
currentRoomInfo.getUid(),
|
||||||
|
userInfo.getErbanNo(),
|
||||||
currentRoomInfo.getTitle(),
|
currentRoomInfo.getTitle(),
|
||||||
currentRoomInfo.getAvatar()
|
currentRoomInfo.getAvatar()
|
||||||
))
|
))
|
||||||
|
@@ -19,7 +19,10 @@ public interface IShareModel extends IBaseCore {
|
|||||||
|
|
||||||
Single<String> shareH5(WebJsBeanInfo.DataBean webViewInfo, Platform platform, boolean httpsUrl);
|
Single<String> shareH5(WebJsBeanInfo.DataBean webViewInfo, Platform platform, boolean httpsUrl);
|
||||||
|
|
||||||
Single<String> shareRoom(Platform platform, long roomUid, String title, String avatar);
|
Single<String> shareRoom(Platform platform,
|
||||||
|
long roomUid,
|
||||||
|
long roomId,
|
||||||
|
String title, String room_avatar);
|
||||||
|
|
||||||
Single<String> shareFamily(Platform platform,
|
Single<String> shareFamily(Platform platform,
|
||||||
String familyId,
|
String familyId,
|
||||||
|
@@ -23,6 +23,7 @@ import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
|
|||||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import cn.sharesdk.facebook.Facebook;
|
import cn.sharesdk.facebook.Facebook;
|
||||||
@@ -135,7 +136,10 @@ public class ShareModel extends BaseModel implements IShareModel {
|
|||||||
* @param title 标题
|
* @param title 标题
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Single<String> shareRoom(Platform platform, final long roomUid, String title, String avatar) {
|
public Single<String> shareRoom(Platform platform,
|
||||||
|
final long roomUid,
|
||||||
|
long roomId,
|
||||||
|
String title, String room_avatar) {
|
||||||
return Single.create(new SingleOnSubscribe<String>() {
|
return Single.create(new SingleOnSubscribe<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void subscribe(SingleEmitter<String> emitter) throws Exception {
|
public void subscribe(SingleEmitter<String> emitter) throws Exception {
|
||||||
@@ -143,12 +147,13 @@ public class ShareModel extends BaseModel implements IShareModel {
|
|||||||
if (platform != null) {
|
if (platform != null) {
|
||||||
|
|
||||||
Platform.ShareParams sp = new Platform.ShareParams();
|
Platform.ShareParams sp = new Platform.ShareParams();
|
||||||
sp.setImageUrl(avatar);
|
sp.setImageUrl(room_avatar);
|
||||||
|
|
||||||
String tmpSiteUrl = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_ROOM_URL + AuthModel.get().getCurrentUid() + "&uid=" + roomUid + "&ROOM_UID=" + roomUid;
|
|
||||||
|
|
||||||
final String siteUrl = tmpSiteUrl;
|
|
||||||
|
|
||||||
|
final String siteUrl = UriProvider.IM_SERVER_URL + XChatConstants.SHARE_ROOM_URL +
|
||||||
|
AuthModel.get().getCurrentUid() + "&uid=" + roomUid + "&room_name=" +
|
||||||
|
URLEncoder.encode(title, "utf8") + "&room_id=" + roomId + "&room_avatar=" +
|
||||||
|
URLEncoder.encode(room_avatar, "utf8") + "&share_name=" +
|
||||||
|
URLEncoder.encode( UserModel.get().getCacheLoginUserInfo().getNick(), "utf8");
|
||||||
|
|
||||||
//facebook
|
//facebook
|
||||||
if (platform.getName().equals(Facebook.NAME)) {
|
if (platform.getName().equals(Facebook.NAME)) {
|
||||||
|
Reference in New Issue
Block a user