|
@@ -3,6 +3,7 @@ package com.android.chmo.ui.activity.model;
|
|
|
import android.app.Dialog;
|
|
import android.app.Dialog;
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
import android.support.v4.view.ViewPager;
|
|
import android.support.v4.view.ViewPager;
|
|
|
|
|
+import android.util.TypedValue;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewGroup;
|
|
@@ -17,6 +18,7 @@ import com.android.chmo.app.ChmoApplication;
|
|
|
import com.android.chmo.app.VChatManager;
|
|
import com.android.chmo.app.VChatManager;
|
|
|
import com.android.chmo.base.BaseActivity;
|
|
import com.android.chmo.base.BaseActivity;
|
|
|
import com.android.chmo.http.RequestCallback;
|
|
import com.android.chmo.http.RequestCallback;
|
|
|
|
|
+import com.android.chmo.http.response.CanChatResponse;
|
|
|
import com.android.chmo.http.response.ModelDetailRes;
|
|
import com.android.chmo.http.response.ModelDetailRes;
|
|
|
import com.android.chmo.http.response.ModelListRes;
|
|
import com.android.chmo.http.response.ModelListRes;
|
|
|
import com.android.chmo.http.response.Res;
|
|
import com.android.chmo.http.response.Res;
|
|
@@ -29,6 +31,7 @@ import com.android.chmo.model.ModelInfo;
|
|
|
import com.android.chmo.model.ModelLabel;
|
|
import com.android.chmo.model.ModelLabel;
|
|
|
import com.android.chmo.model.ModelPhoto;
|
|
import com.android.chmo.model.ModelPhoto;
|
|
|
import com.android.chmo.model.ModelSkill;
|
|
import com.android.chmo.model.ModelSkill;
|
|
|
|
|
+import com.android.chmo.ui.activity.me.RechargeActivity;
|
|
|
import com.android.chmo.ui.adpater.ImagePagerAdapter;
|
|
import com.android.chmo.ui.adpater.ImagePagerAdapter;
|
|
|
import com.android.chmo.ui.dialog.CallRewardDialog;
|
|
import com.android.chmo.ui.dialog.CallRewardDialog;
|
|
|
import com.android.chmo.ui.dialog.ConfirmDialog;
|
|
import com.android.chmo.ui.dialog.ConfirmDialog;
|
|
@@ -50,44 +53,50 @@ import butterknife.OnClick;
|
|
|
|
|
|
|
|
public class ModelDetailActivity extends BaseActivity {
|
|
public class ModelDetailActivity extends BaseActivity {
|
|
|
private ModelInfo model;
|
|
private ModelInfo model;
|
|
|
- private String modelPk;
|
|
|
|
|
|
|
+ private String modelPk;
|
|
|
|
|
|
|
|
private List<ModelSkill> skillList = new ArrayList<>();
|
|
private List<ModelSkill> skillList = new ArrayList<>();
|
|
|
- private List<String> honorList = new ArrayList<>();
|
|
|
|
|
- public List<ModelLabel> labelList = new ArrayList<>();
|
|
|
|
|
|
|
+ private List<String> honorList = new ArrayList<>();
|
|
|
|
|
+ public List<ModelLabel> labelList = new ArrayList<>();
|
|
|
|
|
|
|
|
@BindView(R.id.images)
|
|
@BindView(R.id.images)
|
|
|
- ViewPager imagePager;
|
|
|
|
|
|
|
+ ViewPager imagePager;
|
|
|
@BindView(R.id.imgIndex)
|
|
@BindView(R.id.imgIndex)
|
|
|
PageIndexView imgIndexView;
|
|
PageIndexView imgIndexView;
|
|
|
@BindView(R.id.status)
|
|
@BindView(R.id.status)
|
|
|
- ImageView statusView;
|
|
|
|
|
|
|
+ ImageView statusView;
|
|
|
@BindView(R.id.name)
|
|
@BindView(R.id.name)
|
|
|
- TextView nameView;
|
|
|
|
|
|
|
+ TextView nameView;
|
|
|
@BindView(R.id.star)
|
|
@BindView(R.id.star)
|
|
|
- StarView starView;
|
|
|
|
|
|
|
+ StarView starView;
|
|
|
|
|
+ @BindView(R.id.tv_skills)
|
|
|
|
|
+ TextView tvSkills;
|
|
|
@BindView(R.id.fansCount)
|
|
@BindView(R.id.fansCount)
|
|
|
- TextView fansCountView;
|
|
|
|
|
|
|
+ TextView fansCountView;
|
|
|
@BindView(R.id.follow_btn)
|
|
@BindView(R.id.follow_btn)
|
|
|
- Button followBtn;
|
|
|
|
|
|
|
+ LinearLayout followBtn;
|
|
|
|
|
+ @BindView(R.id.tv_follow)
|
|
|
|
|
+ TextView tvFollow;
|
|
|
@BindView(R.id.works)
|
|
@BindView(R.id.works)
|
|
|
- TextView worksView;
|
|
|
|
|
|
|
+ TextView worksView;
|
|
|
@BindView(R.id.video_price)
|
|
@BindView(R.id.video_price)
|
|
|
- TextView videoPice;
|
|
|
|
|
|
|
+ TextView videoPice;
|
|
|
@BindView(R.id.sign)
|
|
@BindView(R.id.sign)
|
|
|
- TextView signView;
|
|
|
|
|
|
|
+ TextView signView;
|
|
|
@BindView(R.id.height)
|
|
@BindView(R.id.height)
|
|
|
- TextView heightView;
|
|
|
|
|
|
|
+ TextView heightView;
|
|
|
@BindView(R.id.weight)
|
|
@BindView(R.id.weight)
|
|
|
- TextView weightView;
|
|
|
|
|
|
|
+ TextView weightView;
|
|
|
@BindView(R.id.three)
|
|
@BindView(R.id.three)
|
|
|
- TextView threeView;
|
|
|
|
|
|
|
+ TextView threeView;
|
|
|
@BindView(R.id.skill_container)
|
|
@BindView(R.id.skill_container)
|
|
|
- LinearLayout skillContainer;
|
|
|
|
|
|
|
+ LinearLayout skillContainer;
|
|
|
@BindView(R.id.honor_container)
|
|
@BindView(R.id.honor_container)
|
|
|
- LinearLayout honorContainer;
|
|
|
|
|
|
|
+ LinearLayout honorContainer;
|
|
|
@BindView(R.id.label_container)
|
|
@BindView(R.id.label_container)
|
|
|
- LinearLayout labelContainer;
|
|
|
|
|
|
|
+ LinearLayout labelContainer;
|
|
|
|
|
+ @BindView(R.id.profile_container)
|
|
|
|
|
+ LinearLayout profileContainer;
|
|
|
|
|
|
|
|
|
|
|
|
|
@OnClick(R.id.back)
|
|
@OnClick(R.id.back)
|
|
@@ -102,17 +111,17 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void initView() {
|
|
public void initView() {
|
|
|
- if(getIntent().hasExtra("model")) {
|
|
|
|
|
- model = (ModelInfo)getIntent().getSerializableExtra("model");
|
|
|
|
|
|
|
+ if (getIntent().hasExtra("model")) {
|
|
|
|
|
+ model = (ModelInfo) getIntent().getSerializableExtra("model");
|
|
|
modelPk = model.modelpk;
|
|
modelPk = model.modelpk;
|
|
|
- }else if(getIntent().hasExtra("modelPk")) {
|
|
|
|
|
|
|
+ } else if (getIntent().hasExtra("modelPk")) {
|
|
|
modelPk = getIntent().getStringExtra("modelPk");
|
|
modelPk = getIntent().getStringExtra("modelPk");
|
|
|
}
|
|
}
|
|
|
- int width = PixelUtils.getWindowWidth();
|
|
|
|
|
- FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams)imagePager.getLayoutParams();
|
|
|
|
|
- lp.width = width;
|
|
|
|
|
- lp.height = width;
|
|
|
|
|
- imagePager.setLayoutParams(lp);
|
|
|
|
|
|
|
+// int width = PixelUtils.getWindowWidth();
|
|
|
|
|
+// FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) imagePager.getLayoutParams();
|
|
|
|
|
+// lp.width = width;
|
|
|
|
|
+// lp.height = width;
|
|
|
|
|
+// imagePager.setLayoutParams(lp);
|
|
|
|
|
|
|
|
getModelInfo(modelPk);
|
|
getModelInfo(modelPk);
|
|
|
|
|
|
|
@@ -121,8 +130,13 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
loadDetail();
|
|
loadDetail();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected int getStatusBarStyle() {
|
|
|
|
|
+ return STATUS_BAR_STYLE_LIGHT_CONTENT;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void fillModelInfo() {
|
|
private void fillModelInfo() {
|
|
|
- if(null == model) {
|
|
|
|
|
|
|
+ if (null == model) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
modelPk = model.modelpk;
|
|
modelPk = model.modelpk;
|
|
@@ -130,26 +144,40 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
nameView.setText(model.name);
|
|
nameView.setText(model.name);
|
|
|
signView.setText(model.lname);
|
|
signView.setText(model.lname);
|
|
|
worksView.setText(model.occupation);
|
|
worksView.setText(model.occupation);
|
|
|
|
|
+ tvSkills.setText(model.skillnames);
|
|
|
|
|
|
|
|
- videoPice.setText(model.vprice + "币/分钟");
|
|
|
|
|
- heightView.setText(model.hei+"cm");
|
|
|
|
|
- weightView.setText(model.wei+"kg");
|
|
|
|
|
- threeView.setText(model.bust + "/" + model.wai + "/" + model.hip);
|
|
|
|
|
|
|
+ videoPice.setText(model.vprice + "M币/分钟");
|
|
|
|
|
+ heightView.setText(model.hei + "cm");
|
|
|
|
|
+ weightView.setText(model.wei + "kg");
|
|
|
|
|
+ threeView.setText(model.bust + "-" + model.wai + "-" + model.hip);
|
|
|
starView.setStar(model.star);
|
|
starView.setStar(model.star);
|
|
|
- if(model.is_a == 0) {
|
|
|
|
|
|
|
+ if (model.is_a == 0) {
|
|
|
statusView.setImageResource(R.mipmap.status_outline);
|
|
statusView.setImageResource(R.mipmap.status_outline);
|
|
|
- }else if (model.is_a == 1) {
|
|
|
|
|
|
|
+ } else if (model.is_a == 1) {
|
|
|
statusView.setImageResource(R.mipmap.status_online);
|
|
statusView.setImageResource(R.mipmap.status_online);
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
statusView.setImageResource(R.mipmap.status_calling);
|
|
statusView.setImageResource(R.mipmap.status_calling);
|
|
|
}
|
|
}
|
|
|
fillFollowBtn();
|
|
fillFollowBtn();
|
|
|
fillModelPic(model.modelphoto);
|
|
fillModelPic(model.modelphoto);
|
|
|
|
|
+
|
|
|
|
|
+ profileContainer.removeAllViews();
|
|
|
|
|
+ addProfile("接单总数", model.totalOrder);
|
|
|
|
|
+ addProfile("接听率", model.orderRate + "%");
|
|
|
|
|
+ addProfile("城市", model.areaname);
|
|
|
|
|
+ addProfile("年龄", model.age);
|
|
|
|
|
+ addProfile("职业", model.occupation);
|
|
|
|
|
+ addProfile("星座", model.constellation);
|
|
|
|
|
+ addProfile("毕业院校", model.college);
|
|
|
|
|
+ addProfile("兴趣爱好", model.hobby);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void fillFollowBtn() {
|
|
private void fillFollowBtn() {
|
|
|
- fansCountView.setText(model.fcount + "粉丝");
|
|
|
|
|
- followBtn.setBackgroundResource(model.isattention == 1 ? R.mipmap.cancel_follow : R.mipmap.add_follow);
|
|
|
|
|
|
|
+ fansCountView.setText("粉丝" + model.fcount);
|
|
|
|
|
+ followBtn.setSelected(model.isattention == 1);
|
|
|
|
|
+ tvFollow.setText(model.isattention == 1 ? "已关注" : "关注");
|
|
|
|
|
+ tvFollow.setTextSize(TypedValue.COMPLEX_UNIT_SP, model.isattention == 1 ? 12 : 13);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void fillModelPic(List<ModelPhoto> photos) {
|
|
private void fillModelPic(List<ModelPhoto> photos) {
|
|
@@ -167,10 +195,12 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
@Override
|
|
@Override
|
|
|
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
|
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void onPageSelected(int position) {
|
|
public void onPageSelected(int position) {
|
|
|
imgIndexView.setCurIndex(position);
|
|
imgIndexView.setCurIndex(position);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void onPageScrollStateChanged(int state) {
|
|
public void onPageScrollStateChanged(int state) {
|
|
|
}
|
|
}
|
|
@@ -179,12 +209,12 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
|
|
|
|
|
private void fillModelSkill() {
|
|
private void fillModelSkill() {
|
|
|
skillContainer.removeAllViews();
|
|
skillContainer.removeAllViews();
|
|
|
- LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
|
|
|
|
- lp.topMargin = 2;
|
|
|
|
|
|
|
+ LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
|
|
|
|
+ (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, getResources().getDisplayMetrics()));
|
|
|
for (ModelSkill skill : skillList) {
|
|
for (ModelSkill skill : skillList) {
|
|
|
- View view = LayoutInflater.from(this).inflate(R.layout.item_model_skill,null);
|
|
|
|
|
- TextView skillText = (TextView) view.findViewById(R.id.skill);
|
|
|
|
|
- TextView priceText = (TextView) view.findViewById(R.id.price);
|
|
|
|
|
|
|
+ View view = LayoutInflater.from(this).inflate(R.layout.item_model_info, null);
|
|
|
|
|
+ TextView skillText = view.findViewById(R.id.skill);
|
|
|
|
|
+ TextView priceText = view.findViewById(R.id.price);
|
|
|
skillText.setText(skill.name);
|
|
skillText.setText(skill.name);
|
|
|
priceText.setText(skill.price + "元/小时");
|
|
priceText.setText(skill.price + "元/小时");
|
|
|
|
|
|
|
@@ -194,28 +224,38 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
|
|
|
|
|
private void fillModelHonor() {
|
|
private void fillModelHonor() {
|
|
|
honorContainer.removeAllViews();
|
|
honorContainer.removeAllViews();
|
|
|
- LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
|
|
|
|
- lp.topMargin = 2;
|
|
|
|
|
|
|
+ LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
|
|
|
|
+ (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, getResources().getDisplayMetrics()));
|
|
|
for (String honor : honorList) {
|
|
for (String honor : honorList) {
|
|
|
- View view = LayoutInflater.from(this).inflate(R.layout.item_model_skill,null);
|
|
|
|
|
- TextView skillText = (TextView) view.findViewById(R.id.skill);
|
|
|
|
|
- skillText.setText(honor);
|
|
|
|
|
|
|
+ View view = LayoutInflater.from(this).inflate(R.layout.item_model_honor, null);
|
|
|
|
|
+ TextView tvName = view.findViewById(R.id.name);
|
|
|
|
|
+ tvName.setText(honor);
|
|
|
honorContainer.addView(view, lp);
|
|
honorContainer.addView(view, lp);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void fillModelLabel() {
|
|
private void fillModelLabel() {
|
|
|
labelContainer.removeAllViews();
|
|
labelContainer.removeAllViews();
|
|
|
- int[] labelBgs = new int[]{R.drawable.label1, R.drawable.label2,R.drawable.label3};
|
|
|
|
|
|
|
+ int[] labelBgs = new int[]{R.drawable.label1, R.drawable.label2, R.drawable.label3};
|
|
|
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, 60);
|
|
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, 60);
|
|
|
- lp.rightMargin =15;
|
|
|
|
|
- for (int i=0; i < labelList.size(); i++) {
|
|
|
|
|
- TextView view = (TextView)LayoutInflater.from(this).inflate(R.layout.label_item,null);
|
|
|
|
|
|
|
+ lp.rightMargin = 15;
|
|
|
|
|
+ for (int i = 0; i < labelList.size(); i++) {
|
|
|
|
|
+ TextView view = (TextView) LayoutInflater.from(this).inflate(R.layout.label_item, null);
|
|
|
view.setText(labelList.get(i).name);
|
|
view.setText(labelList.get(i).name);
|
|
|
view.setBackgroundResource(labelBgs[i]);
|
|
view.setBackgroundResource(labelBgs[i]);
|
|
|
- labelContainer.addView(view,lp);
|
|
|
|
|
|
|
+ labelContainer.addView(view, lp);
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ private void addProfile(String name, String value) {
|
|
|
|
|
+ LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
|
|
|
|
+ (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, getResources().getDisplayMetrics()));
|
|
|
|
|
+ View view = LayoutInflater.from(this).inflate(R.layout.item_model_info, null);
|
|
|
|
|
+ TextView tvName = view.findViewById(R.id.skill);
|
|
|
|
|
+ TextView tvValue = view.findViewById(R.id.price);
|
|
|
|
|
+ tvName.setText(name);
|
|
|
|
|
+ tvValue.setText(value);
|
|
|
|
|
+ profileContainer.addView(view, lp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void getModelInfo(String modelPk) {
|
|
private void getModelInfo(String modelPk) {
|
|
@@ -223,15 +263,16 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
@Override
|
|
@Override
|
|
|
public void onSuccess(String result) {
|
|
public void onSuccess(String result) {
|
|
|
ModelListRes res = new Gson().fromJson(result, ModelListRes.class);
|
|
ModelListRes res = new Gson().fromJson(result, ModelListRes.class);
|
|
|
- if(res.data != null && res.data.size()>0) {
|
|
|
|
|
|
|
+ if (res.data != null && res.data.size() > 0) {
|
|
|
model = res.data.get(0);
|
|
model = res.data.get(0);
|
|
|
fillModelInfo();
|
|
fillModelInfo();
|
|
|
loadVideoPrice();
|
|
loadVideoPrice();
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
showToast("模特信息获取失败");
|
|
showToast("模特信息获取失败");
|
|
|
finish();
|
|
finish();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void onFailure(String error) {
|
|
public void onFailure(String error) {
|
|
|
showToast("模特信息获取失败");
|
|
showToast("模特信息获取失败");
|
|
@@ -245,7 +286,7 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
@Override
|
|
@Override
|
|
|
public void onSuccess(String result) {
|
|
public void onSuccess(String result) {
|
|
|
ModelDetailRes res = new Gson().fromJson(result, ModelDetailRes.class);
|
|
ModelDetailRes res = new Gson().fromJson(result, ModelDetailRes.class);
|
|
|
- if(res.dogetprice != null) {
|
|
|
|
|
|
|
+ if (res.dogetprice != null) {
|
|
|
skillList = res.dogetprice;
|
|
skillList = res.dogetprice;
|
|
|
fillModelSkill();
|
|
fillModelSkill();
|
|
|
}
|
|
}
|
|
@@ -258,6 +299,7 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
fillModelLabel();
|
|
fillModelLabel();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void onFailure(String error) {
|
|
public void onFailure(String error) {
|
|
|
}
|
|
}
|
|
@@ -269,12 +311,13 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
ModelService.getModelVideoPrice(model.memberpk, new RequestCallback() {
|
|
ModelService.getModelVideoPrice(model.memberpk, new RequestCallback() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onSuccess(String result) {
|
|
public void onSuccess(String result) {
|
|
|
- VideoPriceRes res = new Gson().fromJson(result,VideoPriceRes.class);
|
|
|
|
|
- if(res.msg.equals("success")) {
|
|
|
|
|
|
|
+ VideoPriceRes res = new Gson().fromJson(result, VideoPriceRes.class);
|
|
|
|
|
+ if (res.msg.equals("success")) {
|
|
|
model.vprice = res.vprice;
|
|
model.vprice = res.vprice;
|
|
|
- videoPice.setText(model.vprice + "币/分钟");
|
|
|
|
|
|
|
+ videoPice.setText(model.vprice + "M币/分钟");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void onFailure(String error) {
|
|
public void onFailure(String error) {
|
|
|
}
|
|
}
|
|
@@ -284,7 +327,7 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
|
|
|
|
|
@OnClick(R.id.privateZone)
|
|
@OnClick(R.id.privateZone)
|
|
|
public void privateZone() {
|
|
public void privateZone() {
|
|
|
- Intent intent = new Intent(this,ModelZoneActivity.class);
|
|
|
|
|
|
|
+ Intent intent = new Intent(this, ModelZoneActivity.class);
|
|
|
intent.putExtra("model", model);
|
|
intent.putExtra("model", model);
|
|
|
openPage(intent);
|
|
openPage(intent);
|
|
|
}
|
|
}
|
|
@@ -292,37 +335,69 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
@OnClick(R.id.follow_btn)
|
|
@OnClick(R.id.follow_btn)
|
|
|
public void clickFollow() {
|
|
public void clickFollow() {
|
|
|
showLoading();
|
|
showLoading();
|
|
|
- int type = model.isattention == 1 ? 2: 1;
|
|
|
|
|
|
|
+ int type = model.isattention == 1 ? 2 : 1;
|
|
|
ModelService.setFollow(model.modelpk, type, new RequestCallback() {
|
|
ModelService.setFollow(model.modelpk, type, new RequestCallback() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onSuccess(String result) {
|
|
public void onSuccess(String result) {
|
|
|
hideLoading();
|
|
hideLoading();
|
|
|
- Res res = new Gson().fromJson(result,Res.class);
|
|
|
|
|
- if(res.msg.equals("success")) {
|
|
|
|
|
- if(model.isattention == 1) {
|
|
|
|
|
|
|
+ Res res = new Gson().fromJson(result, Res.class);
|
|
|
|
|
+ if (res.msg.equals("success")) {
|
|
|
|
|
+ if (model.isattention == 1) {
|
|
|
model.isattention = 0;
|
|
model.isattention = 0;
|
|
|
model.fcount--;
|
|
model.fcount--;
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
model.isattention = 1;
|
|
model.isattention = 1;
|
|
|
model.fcount++;
|
|
model.fcount++;
|
|
|
}
|
|
}
|
|
|
fillFollowBtn();
|
|
fillFollowBtn();
|
|
|
EventBus.getDefault().post("followChange");
|
|
EventBus.getDefault().post("followChange");
|
|
|
- }else {
|
|
|
|
|
- showToast(model.isattention == 1 ? "取消失败":"关注失败");
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ showToast(model.isattention == 1 ? "取消失败" : "关注失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onFailure(String error) {
|
|
public void onFailure(String error) {
|
|
|
hideLoading();
|
|
hideLoading();
|
|
|
- showToast(model.isattention == 1 ? "取消失败":"关注失败");
|
|
|
|
|
|
|
+ showToast(model.isattention == 1 ? "取消失败" : "关注失败");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@OnClick(R.id.talk)
|
|
@OnClick(R.id.talk)
|
|
|
public void talk() {
|
|
public void talk() {
|
|
|
|
|
+ showLoading();
|
|
|
|
|
+ UserService.canChat(new RequestCallback() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onSuccess(String result) {
|
|
|
|
|
+ hideLoading();
|
|
|
|
|
+ CanChatResponse response = new Gson().fromJson(result, CanChatResponse.class);
|
|
|
|
|
+ if (response.isCanChat()) {
|
|
|
|
|
+ NimUIKit.startP2PSession(ModelDetailActivity.this, model.memberpk);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ new ConfirmDialog(ModelDetailActivity.this)
|
|
|
|
|
+ .setButton("立即充值", "取消")
|
|
|
|
|
+ .setMsg("聊天功能仅对充值用户开放,立即充值即可聊天")
|
|
|
|
|
+ .setDialogListener(new ConfirmDialog.DialogListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onOk(Dialog dialog) {
|
|
|
|
|
+ openPage(RechargeActivity.class);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onCancel(Dialog dialog) {
|
|
|
|
|
+ dialog.dismiss();
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .show();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onFailure(String error) {
|
|
|
|
|
+ hideLoading();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
NimUIKit.startP2PSession(this, model.memberpk);
|
|
NimUIKit.startP2PSession(this, model.memberpk);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -350,13 +425,13 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
// 视频
|
|
// 视频
|
|
|
@OnClick(R.id.sendVideo)
|
|
@OnClick(R.id.sendVideo)
|
|
|
public void sendVideo() {
|
|
public void sendVideo() {
|
|
|
- VChatManager.getInstance().startVChat(this,model.memberpk, model.name, model.vprice);
|
|
|
|
|
|
|
+ VChatManager.getInstance().startVChat(this, model.memberpk, model.name, model.vprice);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 预约
|
|
// 预约
|
|
|
@OnClick(R.id.reserve)
|
|
@OnClick(R.id.reserve)
|
|
|
public void reserve() {
|
|
public void reserve() {
|
|
|
- Intent intent = new Intent(this,ModelReserveActivty.class);
|
|
|
|
|
|
|
+ Intent intent = new Intent(this, ModelReserveActivty.class);
|
|
|
intent.putExtra("model", model);
|
|
intent.putExtra("model", model);
|
|
|
openPage(intent);
|
|
openPage(intent);
|
|
|
}
|
|
}
|
|
@@ -364,7 +439,7 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
|
|
|
|
|
private void reward(final int value) {
|
|
private void reward(final int value) {
|
|
|
new ConfirmDialog(this)
|
|
new ConfirmDialog(this)
|
|
|
- .setMsg("确定要打赏"+ value+"元?")
|
|
|
|
|
|
|
+ .setMsg("确定要打赏" + value + "元?")
|
|
|
.setDialogListener(new ConfirmDialog.DialogListener() {
|
|
.setDialogListener(new ConfirmDialog.DialogListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onOk(Dialog dialog) {
|
|
public void onOk(Dialog dialog) {
|
|
@@ -374,11 +449,11 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
@Override
|
|
@Override
|
|
|
public void onSuccess(String result) {
|
|
public void onSuccess(String result) {
|
|
|
hideLoading();
|
|
hideLoading();
|
|
|
- Res res = new Gson().fromJson(result,Res.class);
|
|
|
|
|
|
|
+ Res res = new Gson().fromJson(result, Res.class);
|
|
|
if (res.msg.equals("success")) {
|
|
if (res.msg.equals("success")) {
|
|
|
showToast("打赏成功");
|
|
showToast("打赏成功");
|
|
|
LoginUtils.refreshUser();
|
|
LoginUtils.refreshUser();
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
showToast("打赏失败");
|
|
showToast("打赏失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -390,6 +465,7 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void onCancel(Dialog dialog) {
|
|
public void onCancel(Dialog dialog) {
|
|
|
dialog.dismiss();
|
|
dialog.dismiss();
|
|
@@ -400,7 +476,7 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
|
|
|
|
|
@OnClick(R.id.report)
|
|
@OnClick(R.id.report)
|
|
|
public void report() {
|
|
public void report() {
|
|
|
- Intent intent = new Intent(this,ModelReportActivity.class);
|
|
|
|
|
|
|
+ Intent intent = new Intent(this, ModelReportActivity.class);
|
|
|
intent.putExtra("modelPk", model.modelpk);
|
|
intent.putExtra("modelPk", model.modelpk);
|
|
|
openPage(intent);
|
|
openPage(intent);
|
|
|
}
|
|
}
|
|
@@ -409,37 +485,37 @@ public class ModelDetailActivity extends BaseActivity {
|
|
|
public void shield() {
|
|
public void shield() {
|
|
|
new ConfirmDialog(this).setMsg("是否确定屏蔽该模特?")
|
|
new ConfirmDialog(this).setMsg("是否确定屏蔽该模特?")
|
|
|
.setDialogListener(new ConfirmDialog.DialogListener() {
|
|
.setDialogListener(new ConfirmDialog.DialogListener() {
|
|
|
- @Override
|
|
|
|
|
- public void onOk(Dialog dialog) {
|
|
|
|
|
- dialog.dismiss();
|
|
|
|
|
- showLoading();
|
|
|
|
|
- UserService.shieldModel(model.modelpk, new RequestCallback() {
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void onSuccess(String result) {
|
|
|
|
|
- hideLoading();
|
|
|
|
|
- Res res = new Gson().fromJson(result,Res.class);
|
|
|
|
|
- if (res.msg.equals("success")) {
|
|
|
|
|
- showToast("屏蔽成功");
|
|
|
|
|
- EventBus.getDefault().post("modelChange");
|
|
|
|
|
- finish();
|
|
|
|
|
- }else {
|
|
|
|
|
- showToast("屏蔽失败");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ public void onOk(Dialog dialog) {
|
|
|
|
|
+ dialog.dismiss();
|
|
|
|
|
+ showLoading();
|
|
|
|
|
+ UserService.shieldModel(model.modelpk, new RequestCallback() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onSuccess(String result) {
|
|
|
|
|
+ hideLoading();
|
|
|
|
|
+ Res res = new Gson().fromJson(result, Res.class);
|
|
|
|
|
+ if (res.msg.equals("success")) {
|
|
|
|
|
+ showToast("屏蔽成功");
|
|
|
|
|
+ EventBus.getDefault().post("modelChange");
|
|
|
|
|
+ finish();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ showToast("屏蔽失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onFailure(String error) {
|
|
|
|
|
+ hideLoading();
|
|
|
|
|
+ showToast("屏蔽失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void onFailure(String error) {
|
|
|
|
|
- hideLoading();
|
|
|
|
|
- showToast("屏蔽失败");
|
|
|
|
|
|
|
+ public void onCancel(Dialog dialog) {
|
|
|
|
|
+ dialog.dismiss();
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onCancel(Dialog dialog) {
|
|
|
|
|
- dialog.dismiss();
|
|
|
|
|
- }
|
|
|
|
|
- }).show();
|
|
|
|
|
|
|
+ }).show();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|