Commit 228ee11e authored by 张释方's avatar 张释方

添加限时福利

parent 60de44cc
......@@ -319,10 +319,8 @@
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tencent1111016251" />
</intent-filter>
</activity>
......
......@@ -218,6 +218,8 @@ object Constant {
const val HOT_ACTIVITY_CPD = "TO_CPD"
const val HOT_ACTIVITY_CALLSHOW = "TO_CALLSHOW"
const val HOT_ACTIVITY_MOKU = "TO_MOKU"
const val HOT_ACTIVITY_GZH = "showedWechatTips"
// 打开激活
const val FIRST_DEVICE_FLAG = "first_device_flag"
......
package com.mints.goodmoney.mvp.model;
public class FlActivityBean {
import java.io.Serializable;
import java.util.List;
public class FlActivityBean implements Serializable {
private List<FlActivityBean.ActiveTipsConfigDTO> activeTipsConfig;
public List<FlActivityBean.ActiveTipsConfigDTO> getActiveTipsConfig() {
return activeTipsConfig;
}
public void setActiveTipsConfig(List<FlActivityBean.ActiveTipsConfigDTO> activeTipsConfig) {
this.activeTipsConfig = activeTipsConfig;
}
public class ActiveTipsConfigDTO implements Serializable {
private String title;
private String context;
private String url;
private String key;
private String activeKey;
private String hotTitle;
private ParmasDTO parmas;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getActiveKey() {
return activeKey;
}
public void setActiveKey(String activeKey) {
this.activeKey = activeKey;
}
public String getHotTitle() {
return hotTitle;
}
public void setHotTitle(String hotTitle) {
this.hotTitle = hotTitle;
}
public ParmasDTO getParmas() {
return parmas;
}
public void setParmas(ParmasDTO parmas) {
this.parmas = parmas;
}
public class ParmasDTO implements Serializable {
private String xmPlaceIdInTurn;
private String title;
public String getXmPlaceIdInTurn() {
return xmPlaceIdInTurn;
}
public void setXmPlaceIdInTurn(String xmPlaceIdInTurn) {
this.xmPlaceIdInTurn = xmPlaceIdInTurn;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
}
}
\ No newline at end of file
......@@ -7,10 +7,7 @@ import com.mints.goodmoney.common.DeviceInfo
import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.manager.ShumeiManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.model.MainVideoMsgBean
import com.mints.goodmoney.mvp.model.UserBean
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.views.HomeView
import com.mints.goodmoney.utils.DeviceUuidFactory
import com.mints.goodmoney.utils.IPUtil
......@@ -23,6 +20,39 @@ import java.util.*
class HomePresenter : BasePresenter<HomeView>() {
/**
* 获取限时福利活动数据
*/
fun canActiveListMsg(){
AppHttpManager.getInstance(loanApplication)
.call(loanService.canActiveListMsg(),
object : BaseSubscriber<BaseResponse<FlActivityBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<FlActivityBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
when (code) {
200 -> view.getFlActivityMsg(baseResponse.getData())
else -> {
view.showToast(message)
}
}
}
})
}
/**
* 打开激活
*/
......@@ -82,12 +112,17 @@ class HomePresenter : BasePresenter<HomeView>() {
view.getHallBaseMsgFail()
}
override fun onNext(baseResponse: BaseResponse<UserTaskMsgBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
when (code) {
200 -> view.getHallBaseMsgSuc(baseResponse.getData())
200 -> {
canActiveListMsg()
view.getHallBaseMsgSuc(baseResponse.getData())
}
else -> {
view.showToast(message)
}
......@@ -250,4 +285,38 @@ class HomePresenter : BasePresenter<HomeView>() {
}
})
}
/**
* 限时福利参数传递
*/
fun activeGuidanceTips(status: Int,activeKey:String) {
val vo = HashMap<String, Any>()
vo["status"] = status
vo["activeKey"]=activeKey
AppHttpManager.getInstance(loanApplication)
.call(loanService.activeGuidanceTips(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
val code: Int = baseResponse.getStatus()
val message: String = baseResponse.getMessage()
when (code) {
200 -> {
}
else -> {
view.showToast(message)
}
}
}
})
}
}
\ No newline at end of file
package com.mints.goodmoney.mvp.views
import com.mints.goodmoney.mvp.model.FlActivityBean
import com.mints.goodmoney.mvp.model.MainVideoMsgBean
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
......@@ -8,4 +9,5 @@ interface HomeView : BaseView {
fun getHallBaseMsgSuc(data: UserTaskMsgBean)
fun getHallBaseMsgFail()
fun getHomeVedioMsgSuc(data: MainVideoMsgBean)
fun getFlActivityMsg(data: FlActivityBean)
}
......@@ -11,6 +11,7 @@ import com.mints.goodmoney.mvp.model.ClickTurnBean;
import com.mints.goodmoney.mvp.model.CommonParamBean;
import com.mints.goodmoney.mvp.model.DrawcashBean;
import com.mints.goodmoney.mvp.model.DrawcashRecordBean;
import com.mints.goodmoney.mvp.model.FlActivityBean;
import com.mints.goodmoney.mvp.model.FriendHallMsgBean;
import com.mints.goodmoney.mvp.model.GoldRecordBean;
import com.mints.goodmoney.mvp.model.KylBean;
......@@ -631,6 +632,14 @@ public interface LoanService {
@POST("api/setWechatTipsStatus")
Observable<BaseResponse<JsonObject>> setWechatTipsStatus(@Body Map<String, Object> vo);
/**
* 传递判断参数(限时福利弹框)
*/
@POST("api/activeGuidanceTips")
Observable<BaseResponse<JsonObject>> activeGuidanceTips(@Body Map<String, Object> vo);
@POST("api/canActiveListMsg")
Observable<BaseResponse<FlActivityBean>> canActiveListMsg();
/**
* 获取权重信息
*
......
......@@ -1262,10 +1262,8 @@ class MyFragment : BaseFragment(),
private fun initManager() {
BannerManager.init()
videoAdingManager = VideoAdingManager.getInstance(activity)
LogUtil.d("lixianshouyi", "进入到initManager。。。。。。。。。。。。。。。。。。。。。。。。。。")
//登录成功
if (!TextUtils.isEmpty(userManager.userID)) {
LogUtil.d("lixianshouyi", "用户登陆成功!!!。。。。。。。。。。。。。。。。。。。。。。。。。。")
// 登录成功的用户初始化鱼丸盒子
if (userManager.userIsLogin()) {
YwhzManager.init(baseApplication)
......
......@@ -2,6 +2,8 @@ package com.mints.goodmoney.ui.widgets.dialog
import android.content.Context
import android.text.Spanned
import com.mints.goodmoney.mvp.model.FlActivityBean
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import java.lang.ref.WeakReference
object DialogUtils {
......@@ -64,6 +66,17 @@ object DialogUtils {
bonusDialog.show()
dialogListener.setDialog(bonusDialog)
}
/**
* 限时福利弹框
*/
fun showFlDialog(data: FlActivityBean.ActiveTipsConfigDTO, ctx: Context, dialogListener: DialogListener) {
val weakReference = WeakReference<Context>(ctx)
val bonusDialog = FlDialog(data, weakReference.get()!!, dialogListener)
bonusDialog.show()
dialogListener.setDialog(bonusDialog)
}
/**
*
* 权限请求弹框
......@@ -74,21 +87,23 @@ object DialogUtils {
bonusDialog.show()
dialogListener.setDialog(bonusDialog)
}
/**
* 提现弹框
*/
fun showTxDialog(ctx: Context,dialogListener: DialogListener){
fun showTxDialog(ctx: Context, dialogListener: DialogListener) {
val weakReference = WeakReference<Context>(ctx)
val bonusDialog = TxDialog(weakReference.get()!!, dialogListener)
bonusDialog.show()
dialogListener.setDialog(bonusDialog)
}
/**
* 中奖弹窗
*/
fun showWinDialog(ctx: Context,str1:String,str2:String,dialogListener: DialogListener){
fun showWinDialog(ctx: Context, str1: String, str2: String, dialogListener: DialogListener) {
val weakReference = WeakReference<Context>(ctx)
val bonusDialog = WinDialog(weakReference.get()!!, dialogListener,str1,str2)
val bonusDialog = WinDialog(weakReference.get()!!, dialogListener, str1, str2)
bonusDialog.show()
dialogListener.setDialog(bonusDialog)
}
......
package com.mints.goodmoney.ui.widgets.dialog
class FlDialog {
import android.app.Dialog
import android.content.Context
import android.text.Html
import android.view.Gravity
import android.view.KeyEvent
import android.view.WindowManager
import android.widget.ImageView
import android.widget.TextView
import com.bumptech.glide.Glide
import com.mints.goodmoney.R
import com.mints.goodmoney.mvp.model.FlActivityBean
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils
import com.mints.goodmoney.utils.SpanUtils
class FlDialog(data: FlActivityBean.ActiveTipsConfigDTO, context: Context, private val listener: DialogListener) :
Dialog(context, R.style.dialog) {
private val lp: WindowManager.LayoutParams
private val iv_Close: ImageView
private val tv_focus: TextView
private val iv_fl: ImageView
private val tv_1: TextView
private val tv_2: TextView
init {
setContentView(R.layout.dialog_fl)
// 设置window属性
lp = window!!.attributes
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.WRAP_CONTENT
lp.windowAnimations = R.style.DialogAnimBottom
window!!.attributes = lp
// 设置外部不可关闭
setCancelable(false)
setCanceledOnTouchOutside(false)
setOnKeyListener { _, i, _ ->
i == KeyEvent.KEYCODE_BACK
}
// 查找View
tv_focus = findViewById(R.id.tv_focus)
iv_Close = findViewById(R.id.iv_Close)
iv_fl = findViewById(R.id.iv_fl)
tv_1 = findViewById(R.id.tv_1)
tv_2 = findViewById(R.id.tv_2)
tv_1.text=data.title
tv_2.text=data.hotTitle
//显示图片
Glide.with(context).load(data.url).into(iv_fl)
tv_focus.setOnClickListener {
listener.onClick(it)
}
iv_Close.setOnClickListener {
listener.onClick(it)
}
}
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ import android.view.KeyEvent
import android.view.WindowManager
import android.widget.ImageView
import android.widget.TextView
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
/**
* 关注公众号
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="#2196F3" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="30dip" />
</selector>
\ No newline at end of file
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="#D62D20" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="5dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="300dp"
android:layout_height="400dp"
android:background="@mipmap/bg_fl">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<ImageView
android:id="@+id/iv_Close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|end"
android:layout_marginTop="60dp"
android:layout_marginEnd="10dp"
android:padding="6dp"
android:src="@mipmap/iv_close_tx" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_gravity="bottom|center_horizontal"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<TextView
android:id="@+id/tv_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:gravity="center"
android:text="限时福利"
android:textColor="#ffffff"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginBottom="20dp"
android:layout_toRightOf="@id/tv_1"
android:background="@mipmap/bg_fl_iv"
android:paddingLeft="5dp"
android:paddingTop="3dp"
android:paddingRight="5dp"
android:paddingBottom="3dp"
android:text="3天有效"
android:textColor="#D23E1B"
android:textSize="12sp" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="10dp"
android:lineHeight="20dp"
android:text="恭喜获得加速赚钱特权,赚取金币\n快人一步!"
android:textColor="#CCffffff"
android:textSize="16sp" />
<ImageView
android:id="@+id/iv_fl"
android:layout_width="240dp"
android:layout_height="140dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="10dp"
android:gravity="center"
android:padding="6dp" />
<TextView
android:id="@+id/tv_focus"
android:layout_width="150dp"
android:layout_height="36dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:background="@mipmap/bg_fl_btn"
android:gravity="center"
android:text="参与活动"
android:textSize="20sp"
android:drawableRight="@mipmap/bg_fl_btn_enter"
android:paddingRight="20dp"
android:paddingLeft="20dp"
android:textColor="#C61800" />
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment