Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckyFarm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
LuckyFarm
Commits
74afb344
Commit
74afb344
authored
Nov 04, 2020
by
wangxuewei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :多多菜园 [实现方案] :红包列表
parent
258eb285
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
517 additions
and
0 deletions
+517
-0
GameActivity.kt
app/src/main/java/com/ym/game/GameActivity.kt
+141
-0
IUnitySendMessageCallback.kt
app/src/main/java/com/ym/game/IUnitySendMessageCallback.kt
+3
-0
RedPackDoubleReceiveEntity.java
...n/java/com/ym/game/module/RedPackDoubleReceiveEntity.java
+192
-0
RedPackListEntity.java
app/src/main/java/com/ym/game/module/RedPackListEntity.java
+63
-0
RedPackReceiveEntity.java
...rc/main/java/com/ym/game/module/RedPackReceiveEntity.java
+73
-0
IGameApi.kt
app/src/main/java/com/ym/game/net/IGameApi.kt
+29
-0
dialog_get_water_drop.xml
app/src/main/res/layout/dialog_get_water_drop.xml
+10
-0
img_receive_six_reward.png
app/src/main/res/mipmap-xhdpi/img_receive_six_reward.png
+0
-0
NetConfig.java
library/src/main/java/com/ym/library/net/NetConfig.java
+6
-0
No files found.
app/src/main/java/com/ym/game/GameActivity.kt
View file @
74afb344
...
...
@@ -381,6 +381,147 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
})
}
fun
onGetRedPackList
(
callback
:
IUnitySendMessageCallback
?)
{
GameApiClient
.
gameApi
.
getRedPackList
()
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
List
<
RedPackListEntity
>>()
{
override
fun
onSuccess
(
result
:
List
<
RedPackListEntity
>?)
{
if
(
result
!=
null
)
{
Log
.
d
(
"wxw"
,
"redPack==="
+
"{\"redPackList\":"
+
Utils
.
obj2Str
(
result
)
+
"}"
)
callback
?.
onRedPackListSuccess
(
true
,
"{\"redPackList\":"
+
Utils
.
obj2Str
(
result
)
+
"}"
)
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
callback
?.
onRedPackListSuccess
(
false
,
"红包列表失败"
)
}
})
}
fun
onRedPackReceive
(
redPackId
:
Int
,
moneyNum
:
String
)
{
Log
.
d
(
"wxw"
,
"redId"
+
redPackId
)
GameApiClient
.
gameApi
.
getRedPackReceive
(
redPackId
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
RedPackReceiveEntity
>()
{
override
fun
onSuccess
(
result
:
RedPackReceiveEntity
?)
{
// if (result != null) {
// callUnity("RedPackList", "redPackListDataUpdate", "")
// callUnity("TitleView", "getHomeInfo", "")
// GameEvent("show_receive_redPack_dialog_success", "展示红包领取弹窗成功")
// //签到双倍领取弹窗显示
// CenterDialog.getTaskRewardDialog(
// act,
// "+${moneyNum}元",
// View.OnClickListener {
// GameEvent("click_receive_redPack_double", "点击六倍领取")
// Log.d("wxw", "签到翻倍广告点击")
// AdManager.loadRewardVideoAd(
// ADConfig.AD_REWARD_VIDIO,
// act,
// object : ZXADVideoListener {
// override fun onFail() {
// }
//
// override fun onSuccess() {
// }
//
// override fun onError() {
//
// }
//
// override fun onRewardVideoCached() {
// }
//
// override fun setRewardAdInteractionListener() {
// }
//
// override fun onRewardVerify() {
// }
//
// override fun onVideoError() {
//// showToponWaterVideo()
// }
//
// override fun onRewardVideoAdLoad() {
//
// }
//
// override fun onRewardVideoAdLoad(entity: NewsEntity) {
//
// }
//
// override fun onAdShow() {
// }
//
// override fun onAdVideoBarClick(newsEntity: NewsEntity) {
// }
//
// override fun onAdClose() {
// //看视频上报
// getVideoAcceleratorsReceive();
// onRedPackAwardReceive(result.doubleX.multipleSid)
// }
//
// override fun onVideoComplete() {
// }
//
// override fun onSkippedVideo() {
// }
//
// override fun onFullScreenVideoCached() {
// }
//
// override fun onLoadVideoAd(rewardVideoAD: ZXADRewardVideo) {
// }
// })
// })
// }
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
GameEvent
(
"show_receive_redPack_dialog_fail"
,
"展示红包领取弹窗失败"
)
}
})
}
fun
onRedPackAwardReceive
(
doubleId
:
String
)
{
Log
.
d
(
"wxw"
,
"double"
+
doubleId
)
GameApiClient
.
gameApi
.
getRedPackAwardReceive
(
doubleId
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
RedPackDoubleReceiveEntity
>()
{
override
fun
onSuccess
(
result
:
RedPackDoubleReceiveEntity
?)
{
if
(
result
!=
null
)
{
GameEvent
(
"show_receive_redPack_double_success"
,
"六倍领取成功"
)
var
allMoneyNum
=
"总共获得奖励+${result.rewardContentList[0].totalRewardNum / 100.toDouble()}元"
;
ToastUtil
.
showImageToas
(
act
,
allMoneyNum
)
callUnity
(
"RedPackList"
,
"redPackListDataUpdate"
,
""
)
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
GameEvent
(
"show_receive_redPack_double_fail"
,
"六倍领取失败"
)
}
})
}
/**
* 云朵加速
* */
...
...
app/src/main/java/com/ym/game/IUnitySendMessageCallback.kt
View file @
74afb344
...
...
@@ -45,6 +45,9 @@ interface IUnitySendMessageCallback {
//判断新手
fun
onGetGuideSuccess
(
isSuccess
:
Boolean
,
result
:
String
)
//红包列表成功
fun
onRedPackListSuccess
(
isSuccess
:
Boolean
,
result
:
String
)
//判断是否云朵加速
fun
onGetCheckCloud
(
isSuccess
:
Boolean
,
result
:
String
)
}
\ No newline at end of file
app/src/main/java/com/ym/game/module/RedPackDoubleReceiveEntity.java
0 → 100644
View file @
74afb344
package
com
.
ym
.
game
.
module
;
import
java.util.List
;
/**
* @author (wangXuewei)
* @datetime 2020-10-30 19:55 GMT+8
* @detail :
*/
public
class
RedPackDoubleReceiveEntity
{
/**
* recode : 1
* msg : 领取成功
* rewardContentList : [{"rewardNum":200,"totalRewardNum":240,"currencyTypeEnum":"CENT","currencyType":10,"rate":null,"cash":0}]
* overRewardContentList : null
* ore : null
* cents : null
* taskId : null
* centTemp : null
* oreTemp : null
* doublingRpk : null
* ext : null
*/
private
int
recode
;
private
String
msg
;
private
Object
overRewardContentList
;
private
Object
ore
;
private
Object
cents
;
private
Object
taskId
;
private
Object
centTemp
;
private
Object
oreTemp
;
private
Object
doublingRpk
;
private
Object
ext
;
private
List
<
RewardContentListBean
>
rewardContentList
;
public
int
getRecode
()
{
return
recode
;
}
public
void
setRecode
(
int
recode
)
{
this
.
recode
=
recode
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
Object
getOverRewardContentList
()
{
return
overRewardContentList
;
}
public
void
setOverRewardContentList
(
Object
overRewardContentList
)
{
this
.
overRewardContentList
=
overRewardContentList
;
}
public
Object
getOre
()
{
return
ore
;
}
public
void
setOre
(
Object
ore
)
{
this
.
ore
=
ore
;
}
public
Object
getCents
()
{
return
cents
;
}
public
void
setCents
(
Object
cents
)
{
this
.
cents
=
cents
;
}
public
Object
getTaskId
()
{
return
taskId
;
}
public
void
setTaskId
(
Object
taskId
)
{
this
.
taskId
=
taskId
;
}
public
Object
getCentTemp
()
{
return
centTemp
;
}
public
void
setCentTemp
(
Object
centTemp
)
{
this
.
centTemp
=
centTemp
;
}
public
Object
getOreTemp
()
{
return
oreTemp
;
}
public
void
setOreTemp
(
Object
oreTemp
)
{
this
.
oreTemp
=
oreTemp
;
}
public
Object
getDoublingRpk
()
{
return
doublingRpk
;
}
public
void
setDoublingRpk
(
Object
doublingRpk
)
{
this
.
doublingRpk
=
doublingRpk
;
}
public
Object
getExt
()
{
return
ext
;
}
public
void
setExt
(
Object
ext
)
{
this
.
ext
=
ext
;
}
public
List
<
RewardContentListBean
>
getRewardContentList
()
{
return
rewardContentList
;
}
public
void
setRewardContentList
(
List
<
RewardContentListBean
>
rewardContentList
)
{
this
.
rewardContentList
=
rewardContentList
;
}
public
static
class
RewardContentListBean
{
/**
* rewardNum : 200
* totalRewardNum : 240
* currencyTypeEnum : CENT
* currencyType : 10
* rate : null
* cash : 0
*/
private
int
rewardNum
;
private
int
totalRewardNum
;
private
String
currencyTypeEnum
;
private
int
currencyType
;
private
Object
rate
;
private
int
cash
;
public
int
getRewardNum
()
{
return
rewardNum
;
}
public
void
setRewardNum
(
int
rewardNum
)
{
this
.
rewardNum
=
rewardNum
;
}
public
int
getTotalRewardNum
()
{
return
totalRewardNum
;
}
public
void
setTotalRewardNum
(
int
totalRewardNum
)
{
this
.
totalRewardNum
=
totalRewardNum
;
}
public
String
getCurrencyTypeEnum
()
{
return
currencyTypeEnum
;
}
public
void
setCurrencyTypeEnum
(
String
currencyTypeEnum
)
{
this
.
currencyTypeEnum
=
currencyTypeEnum
;
}
public
int
getCurrencyType
()
{
return
currencyType
;
}
public
void
setCurrencyType
(
int
currencyType
)
{
this
.
currencyType
=
currencyType
;
}
public
Object
getRate
()
{
return
rate
;
}
public
void
setRate
(
Object
rate
)
{
this
.
rate
=
rate
;
}
public
int
getCash
()
{
return
cash
;
}
public
void
setCash
(
int
cash
)
{
this
.
cash
=
cash
;
}
}
}
app/src/main/java/com/ym/game/module/RedPackListEntity.java
0 → 100644
View file @
74afb344
package
com
.
ym
.
game
.
module
;
/**
* @author (wangXuewei)
* @datetime 2020-10-30 16:21 GMT+8
* @detail :
*/
public
class
RedPackListEntity
{
/**
* id : 1
* coins : 100
* countDownSecond : 0
* totalSecond : 180
*/
private
int
id
;
private
int
coins
;
private
int
countDownSecond
;
private
int
totalSecond
;
private
String
coinsStr
;
public
String
getCoinsStr
()
{
return
coinsStr
;
}
public
void
setCoinsStr
(
String
coinsStr
)
{
this
.
coinsStr
=
coinsStr
;
}
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
int
getCoins
()
{
return
coins
;
}
public
void
setCoins
(
int
coins
)
{
this
.
coins
=
coins
;
}
public
int
getCountDownSecond
()
{
return
countDownSecond
;
}
public
void
setCountDownSecond
(
int
countDownSecond
)
{
this
.
countDownSecond
=
countDownSecond
;
}
public
int
getTotalSecond
()
{
return
totalSecond
;
}
public
void
setTotalSecond
(
int
totalSecond
)
{
this
.
totalSecond
=
totalSecond
;
}
}
app/src/main/java/com/ym/game/module/RedPackReceiveEntity.java
0 → 100644
View file @
74afb344
package
com
.
ym
.
game
.
module
;
import
com.google.gson.annotations.SerializedName
;
/**
* @author (wangXuewei)
* @datetime 2020-10-30 19:25 GMT+8
* @detail :
*/
public
class
RedPackReceiveEntity
{
/**
* totalCoins : 240
* totalCents : 37678
* double : {"multipleSid":"70028e066fcc4efda63a8e9f7d403892","buttonText":"看视频3-5倍奖励"}
*/
private
int
totalCoins
;
private
int
totalCents
;
@SerializedName
(
"double"
)
private
DoubleBean
doubleX
;
public
int
getTotalCoins
()
{
return
totalCoins
;
}
public
void
setTotalCoins
(
int
totalCoins
)
{
this
.
totalCoins
=
totalCoins
;
}
public
int
getTotalCents
()
{
return
totalCents
;
}
public
void
setTotalCents
(
int
totalCents
)
{
this
.
totalCents
=
totalCents
;
}
public
DoubleBean
getDoubleX
()
{
return
doubleX
;
}
public
void
setDoubleX
(
DoubleBean
doubleX
)
{
this
.
doubleX
=
doubleX
;
}
public
static
class
DoubleBean
{
/**
* multipleSid : 70028e066fcc4efda63a8e9f7d403892
* buttonText : 看视频3-5倍奖励
*/
private
String
multipleSid
;
private
String
buttonText
;
public
String
getMultipleSid
()
{
return
multipleSid
;
}
public
void
setMultipleSid
(
String
multipleSid
)
{
this
.
multipleSid
=
multipleSid
;
}
public
String
getButtonText
()
{
return
buttonText
;
}
public
void
setButtonText
(
String
buttonText
)
{
this
.
buttonText
=
buttonText
;
}
}
}
app/src/main/java/com/ym/game/net/IGameApi.kt
View file @
74afb344
...
...
@@ -189,6 +189,35 @@ interface IGameApi {
@POST
(
NetConfig
.
Game
.
URL_GAME_FARM_RANK_RECEIVE
)
fun
getRankReceive
():
Observable
<
Response
<
RankReceiveEntity
>>
/**
* 红包列表
* @param
* @paramq
* @return
*/
@GET
(
NetConfig
.
Game
.
URL_GAME_RED_PACK_LIST
)
fun
getRedPackList
():
Observable
<
Response
<
List
<
RedPackListEntity
>>>
/**
* 红包领取
* @param
* @paramq
* @return
*/
@POST
(
NetConfig
.
Game
.
URL_GAME_RED_PACK_RECEIVE
)
fun
getRedPackReceive
(
@Query
(
"id"
)
id
:
Int
):
Observable
<
Response
<
RedPackReceiveEntity
>>
/**
* 红包倍数领取
* @param
* @paramq
* @return
*/
@POST
(
NetConfig
.
Game
.
URL_GAME_RED_PACK_AWARD_RECEIVE
)
fun
getRedPackAwardReceive
(
@Query
(
"sid"
)
id
:
String
):
Observable
<
Response
<
RedPackDoubleReceiveEntity
>>
/*
兑换列表
*/
...
...
app/src/main/res/layout/dialog_get_water_drop.xml
View file @
74afb344
...
...
@@ -157,8 +157,18 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/id_ll_content"
android:visibility=
"gone"
android:layout_centerHorizontal=
"true"
android:background=
"@drawable/btn_selector"
/>
<TextView
android:id=
"@+id/btn_get_six_reward"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/id_ll_content"
android:layout_centerHorizontal=
"true"
android:background=
"@mipmap/img_receive_six_reward"
/>
</RelativeLayout>
</RelativeLayout>
...
...
app/src/main/res/mipmap-xhdpi/img_receive_six_reward.png
0 → 100644
View file @
74afb344
40.1 KB
library/src/main/java/com/ym/library/net/NetConfig.java
View file @
74afb344
...
...
@@ -245,6 +245,12 @@ public class NetConfig {
public
static
final
String
URL_GAME_ACCELERATORS_TASK_RECEIVE
=
"app/v1/game/ddcy/accelerators_task_receive"
;
//兑换记录
public
static
final
String
URL_GAME_USER_GUIDE
=
"app/v1/game/ddcy/user_guide"
;
//兑换记录
public
static
final
String
URL_GAME_RED_PACK_LIST
=
"app/v1/game/farm/rp_list"
;
//红包列表
public
static
final
String
URL_GAME_RED_PACK_RECEIVE
=
"app/v1/game/farm/rp/receive"
;
//拆红包 参数传红包id
public
static
final
String
URL_GAME_RED_PACK_AWARD_RECEIVE
=
"app/v3/common/award/multiple"
;
//翻倍领取接口
public
static
final
String
URL_GAME_CLOUD_CHECK
=
"app/v1/game/farm/cloud_check"
;
//云朵加速判断
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment