礼物盲盒基本逻辑
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlindBoxInfoModel extends BaseModel {
|
||||
/**
|
||||
* "info":[{"item_name":["麒麟勛章饰品","麒麟頭像框饰品","麒麟坐騎饰品","水晶项链礼物","夢幻水晶球礼物","心動泡泡礼物","蝴蝶少女礼物","金色唱片礼物","鑽石禮盒礼物","紙花船礼物"],"threshold_value":268,"threshold_dress_name":"麒麟坐騎","dress_threshold_value":0,"blind_box_type":1,"blind_box_id":1636},{"item_name":["金鳳勛章饰品","金鳳頭像框饰品","金鳳坐騎饰品","浪漫氣球礼物","捕夢網礼物","仙女棒礼物","藍寶石鈴鐺礼物","榮耀星礼物","童話屋礼物","夢幻許願池礼物"],"threshold_value":198,"threshold_dress_name":"金鳳坐騎","dress_threshold_value":0,"blind_box_type":2,"blind_box_id":1637},{"item_name":["神龍勛章饰品","神龍頭像框饰品","神龍坐騎饰品","水晶玫瑰礼物","sweet香水礼物","甜蜜熱氣球礼物","風鈴舞動礼物","音樂噴泉礼物","星空列車礼物","漂洋過海來看你礼物"],"threshold_value":128,"threshold_dress_name":"神龍坐騎","dress_threshold_value":0,"blind_box_type":3,"blind_box_id":1638}]
|
||||
*/
|
||||
@SerializedName("item_name")
|
||||
private List<String> itemName;
|
||||
@SerializedName("threshold_value")
|
||||
private String thresholdValue = "0";
|
||||
@SerializedName("threshold_dress_name")
|
||||
private String thresholdDressName;
|
||||
@SerializedName("dress_threshold_value")
|
||||
private String dressThresholdValue;
|
||||
@SerializedName("blind_box_type")
|
||||
private String blindBoxType;
|
||||
@SerializedName("blind_box_id")
|
||||
private String blindBoxId;
|
||||
|
||||
public List<String> getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setItemName(List<String> itemName) {
|
||||
this.itemName = itemName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getThresholdValue() {
|
||||
return thresholdValue;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setThresholdValue(String thresholdValue) {
|
||||
this.thresholdValue = thresholdValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getThresholdDressName() {
|
||||
return thresholdDressName;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setThresholdDressName(String thresholdDressName) {
|
||||
this.thresholdDressName = thresholdDressName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDressThresholdValue() {
|
||||
return dressThresholdValue;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setDressThresholdValue(String dressThresholdValue) {
|
||||
this.dressThresholdValue = dressThresholdValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBlindBoxType() {
|
||||
return blindBoxType;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setBlindBoxType(String blindBoxType) {
|
||||
this.blindBoxType = blindBoxType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBlindBoxId() {
|
||||
return blindBoxId;
|
||||
}
|
||||
|
||||
public BlindBoxInfoModel setBlindBoxId(String blindBoxId) {
|
||||
this.blindBoxId = blindBoxId;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public class LiveGiftBean {
|
||||
// public static final int MARK_LUCK = 3;
|
||||
|
||||
private int id;
|
||||
private int type;//0 普通礼物 1是贵族 2守护 3粉丝团
|
||||
private int type;//0 普通礼物 1是贵族 2守护 3粉丝团 5盲盒礼物
|
||||
private int mark;// 0 普通 1热门 2守护 3幸运
|
||||
private String name;
|
||||
private String price;
|
||||
@@ -34,6 +34,17 @@ public class LiveGiftBean {
|
||||
private String isweek;
|
||||
private String end_time;
|
||||
private String tag;
|
||||
@JSONField(name = "blind_box_type")
|
||||
private int blind_box_type = 0;
|
||||
|
||||
public int getBlind_box_type() {
|
||||
return blind_box_type;
|
||||
}
|
||||
|
||||
public LiveGiftBean setBlind_box_type(int blind_box_type) {
|
||||
this.blind_box_type = blind_box_type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.ContributeModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
@@ -17,11 +18,11 @@ import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
import com.yunbao.common.bean.LiveTaskModel;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
@@ -716,10 +717,17 @@ public interface PDLiveApi {
|
||||
*/
|
||||
@GET("/api/public/?service=Live.setLiveVote")
|
||||
Observable<ResponseModel<List<String>>> updateLiveVote(@Query("liveuid") String liveUid,
|
||||
@Query("option_content_key") String key);
|
||||
@Query("option_content_key") String key);
|
||||
|
||||
/**
|
||||
* 主动结束投票
|
||||
*/
|
||||
@GET("/api/public/?service=Live.endLiveVote")
|
||||
Observable<ResponseModel<List<String>>> endLiveVote(@Query("liveuid") String liveUid);
|
||||
|
||||
/**
|
||||
* 获取盲盒礼物当前数据
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getBlindBoxInfo")
|
||||
Observable<ResponseModel<List<BlindBoxInfoModel>>> getBlindBoxInfo();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.BlindBoxInfoModel;
|
||||
import com.yunbao.common.bean.CheckLiveModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.DiscountsModel;
|
||||
@@ -18,11 +19,11 @@ import com.yunbao.common.bean.LinkMicUserBeanV2;
|
||||
import com.yunbao.common.bean.ListInfoMessageModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveStetUpStatusModel;
|
||||
import com.yunbao.common.bean.LiveTaskModel;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
@@ -1522,6 +1523,33 @@ public class LiveNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取盲盒礼物信息
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
public void getBlindBoxInfo(HttpCallback<List<BlindBoxInfoModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getBlindBoxInfo()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<List<BlindBoxInfoModel>>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<List<BlindBoxInfoModel>> listResponseModel) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播间取消网络请求
|
||||
*/
|
||||
|
||||
23
common/src/main/res/drawable/bg_blind_progres.xml
Normal file
23
common/src/main/res/drawable/bg_blind_progres.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#65FB712D" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="3dp" />
|
||||
<gradient
|
||||
android:endColor="#FCCCA4"
|
||||
android:startColor="#FCAB6A" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
24
common/src/main/res/drawable/bg_blind_progress.xml
Normal file
24
common/src/main/res/drawable/bg_blind_progress.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#659FFBF6" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress" >
|
||||
<scale android:scaleWidth="100%" android:scaleHeight="6dp">
|
||||
<shape >
|
||||
<corners android:radius="3dp" />
|
||||
<gradient
|
||||
android:endColor="#10A5FB"
|
||||
android:startColor="#78E2FD" />
|
||||
</shape>
|
||||
</scale>
|
||||
|
||||
</item>
|
||||
</layer-list>
|
||||
23
common/src/main/res/drawable/bg_blind_progress1.xml
Normal file
23
common/src/main/res/drawable/bg_blind_progress1.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置ProgressBar背景色-->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<!--设置ProgressBar进度条圆角半径-->
|
||||
<corners android:radius="3dp" />
|
||||
<solid android:color="#65F8B334" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!--设置ProgressBar进度条颜色-->
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="3dp" />
|
||||
<gradient
|
||||
android:startColor="#FFF682"
|
||||
android:endColor="#FDF9C2" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -1160,7 +1160,7 @@
|
||||
<string name="live_vote_close_yes">是</string>
|
||||
<string name="live_vote_close_no">否</string>
|
||||
<string name="live_vote_hide_text">投票中</string>
|
||||
<string name="live_room_vote_over_tip">%s <br/> 問答框%s秒后消失</string>
|
||||
<string name="live_room_vote_over_tip">%s <br /> 問答框%s秒后消失</string>
|
||||
<string name="live_anchor_vote_tip">請完整填寫</string>
|
||||
<string name="complete_information_consumable">填寫“*”的選項可完成</string>
|
||||
<string name="love_powder">真愛粉\n頭像框(7天)</string>
|
||||
@@ -1172,4 +1172,9 @@
|
||||
<string name="complete_information_hint3">離開會讓您失去獎勵,您確認離開嗎?</string>
|
||||
<string name="complete_information_hint2">愛你,愛你</string>
|
||||
<string name="you_guide_me">指導下我好嗎</string>
|
||||
<string name="resend_win">再送%s个%s必得%s</string>
|
||||
<string name="have_already_win">已将%s发送至您的个性装扮</string>
|
||||
<string name="mini_blind_box">迷你盲盒</string>
|
||||
<string name="collection_blind_box">典藏盲盒</string>
|
||||
<string name="pd_blind_box">PD盲盒</string>
|
||||
</resources>
|
||||
|
||||
@@ -1178,4 +1178,11 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="complete_information_hint3">Leave without a gift</string>
|
||||
<string name="complete_information_hint2">Love you</string>
|
||||
<string name="you_guide_me">Can you guide me</string>
|
||||
<string name="resend_win">再送%s个%s必得%s</string>
|
||||
<string name="have_already_win">已将%s发送至您的个性装扮</string>
|
||||
<string name="mini_blind_box">迷你盲盒</string>
|
||||
<string name="collection_blind_box">典藏盲盒</string>
|
||||
<string name="pd_blind_box">PD盲盒</string>
|
||||
<string name="individual_dressing">个性装扮</string>
|
||||
<string name="random_availability">可随机获得,%s</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user