Commit bff94e60 authored by mengcuiguang's avatar mengcuiguang

添加新人匹配逻辑,非0.01用户首次进来进入视频播放页面

parent 1b93e86e
......@@ -15,6 +15,7 @@ object Constant {
const val FIRST_SPLASH = "first_splash"
const val IS_FIRST_AGREE_BTN = "is_first_agree_btn"
const val IS_FIRST_VIP_BTN = "is_first_agree_btn"
const val IS_FIRST_VEDIO = "is_first_vedio"
const val TAG_NAME = "SUN"
const val MINTS_APP_NAME = "河狸短视频"
const val MINTS_PKG_NAME = "com.xinfu.helivideo"
......
......@@ -4,6 +4,11 @@ import android.content.Context;
import android.util.Log;
import com.google.gson.JsonObject;
import com.xinfu.helivideo.common.Constant;
import com.xinfu.helivideo.manager.LocalVedioManager;
import com.xinfu.helivideo.mvp.model.IndexList;
import com.xinfu.helivideo.mvp.model.VedioBean;
import com.xinfu.helivideo.utils.AppPreferencesManager;
import com.xinfu.library.net.neterror.BaseSubscriber;
import com.xinfu.library.net.neterror.Throwable;
import com.xinfu.helivideo.MintsApplication;
......@@ -106,6 +111,7 @@ public class TrackPresenter extends BaseTrackPresenter {
switch (baseResponse.getStatus()) {
case 200: {
getMyInfo();
getSoltVedio();
}
}
}
......@@ -217,4 +223,31 @@ public class TrackPresenter extends BaseTrackPresenter {
}
});
}
public void getSoltVedio() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.getSoltVedio(),
new BaseSubscriber<BaseResponse<IndexList>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<IndexList> baseResponse) {
switch (baseResponse.getStatus()) {
case 200: {
IndexList data = baseResponse.getData();
if (data != null && data.getVedioMsg() != null) {
AppPreferencesManager.INSTANCE.get().put(Constant.IS_FIRST_VEDIO, true);
LocalVedioManager.INSTANCE.commitVedio(data.getVedioMsg());
}
}
}
}
});
}
}
......@@ -12,6 +12,7 @@ import com.xinfu.helivideo.mvp.model.HotStyleTypesList;
import com.xinfu.helivideo.mvp.model.IndexList;
import com.xinfu.helivideo.mvp.model.OrderRecordBean;
import com.xinfu.helivideo.mvp.model.UserBean;
import com.xinfu.helivideo.mvp.model.VedioBean;
import com.xinfu.helivideo.mvp.model.Version;
import com.xinfu.helivideo.mvp.model.VipBean;
import com.xinfu.helivideo.mvp.model.WxPayParamBean;
......@@ -268,6 +269,12 @@ public interface LoanService {
@POST("api/vvedio/init")
Observable<BaseResponse<Object>> commitCsjShotInfo(@Body Map<String, Object> vo);
/**
* 推荐
*/
@POST("api/vedio/firstVedio")
Observable<BaseResponse<IndexList>> getSoltVedio();
/**
* 默认http工厂
*/
......
......@@ -10,6 +10,7 @@ import com.xinfu.helivideo.ad.splash.SplashManager
import com.xinfu.helivideo.common.Constant
import com.xinfu.helivideo.common.Constant.PRIVACY_URL
import com.xinfu.helivideo.common.Constant.REGISTER_URL
import com.xinfu.helivideo.manager.LocalVedioManager
import com.xinfu.helivideo.manager.TrackManager
import com.xinfu.helivideo.manager.UserManager
import com.xinfu.helivideo.ui.activitys.base.BaseActivity
......@@ -144,14 +145,35 @@ class SplashActivity : BaseActivity() {
private fun goToMainActivity() {
// val vipEnter = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VIP_BTN, false)
// if ((UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) || !vipEnter) {
if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
val firstVedio = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VEDIO, false)
if (firstVedio) {
// 匹配用户 进来后直接播放剧
AppPreferencesManager.get().put(Constant.IS_FIRST_VEDIO, false)
val cacheVedio = LocalVedioManager.getCacheVedio()
if (cacheVedio != null) {
LocalVedioManager.startVedioDetailActivityForType(this, cacheVedio)
} else {
if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
// AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_BTN, true)
// 匹配用户 且 不是vip
val bundle = Bundle()
bundle.putBoolean(VipActivity.IS_GUIDE, true)
readyGoThenKill(VipActivity::class.java, bundle)
// 匹配用户 且 不是vip
val bundle = Bundle()
bundle.putBoolean(VipActivity.IS_GUIDE, true)
readyGoThenKill(VipActivity::class.java, bundle)
} else {
readyGoThenKill(MainActivity::class.java)
}
}
} else {
readyGoThenKill(MainActivity::class.java)
if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
// AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_BTN, true)
// 匹配用户 且 不是vip
val bundle = Bundle()
bundle.putBoolean(VipActivity.IS_GUIDE, true)
readyGoThenKill(VipActivity::class.java, bundle)
} else {
readyGoThenKill(MainActivity::class.java)
}
}
}
......
......@@ -8,6 +8,7 @@ import com.xinfu.helivideo.R
import com.xinfu.helivideo.ad.AdStatusListener
import com.xinfu.helivideo.ad.splash.SplashManager
import com.xinfu.helivideo.common.Constant
import com.xinfu.helivideo.manager.LocalVedioManager
import com.xinfu.helivideo.manager.UserManager
import com.xinfu.helivideo.ui.activitys.base.BaseActivity
import com.xinfu.helivideo.ui.widgets.countdowntimer.CountDownTimerSupport
......@@ -95,16 +96,37 @@ class SplashAdActivity : BaseActivity() {
* 跳转到主页面
*/
private fun goToMainActivity() {
// val vipEnter = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VIP_BTN, false)
// val vipEnter = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VIP_BTN, false)
// if ((UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) || !vipEnter) {
if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
val firstVedio = AppPreferencesManager.get().getBoolean(Constant.IS_FIRST_VEDIO, false)
if (firstVedio) {
// 匹配用户 进来后直接播放剧
AppPreferencesManager.get().put(Constant.IS_FIRST_VEDIO, false)
val cacheVedio = LocalVedioManager.getCacheVedio()
if (cacheVedio != null) {
LocalVedioManager.startVedioDetailActivityForType(this, cacheVedio)
} else {
if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
// AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_BTN, true)
// 匹配用户 且 不是vip
val bundle = Bundle()
bundle.putBoolean(VipActivity.IS_GUIDE, true)
readyGoThenKill(VipActivity::class.java, bundle)
// 匹配用户 且 不是vip
val bundle = Bundle()
bundle.putBoolean(VipActivity.IS_GUIDE, true)
readyGoThenKill(VipActivity::class.java, bundle)
} else {
readyGoThenKill(MainActivity::class.java)
}
}
} else {
readyGoThenKill(MainActivity::class.java)
if (UserManager.getInstance().newFlag && !UserManager.getInstance().vipFlag) {
// AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_BTN, true)
// 匹配用户 且 不是vip
val bundle = Bundle()
bundle.putBoolean(VipActivity.IS_GUIDE, true)
readyGoThenKill(VipActivity::class.java, bundle)
} else {
readyGoThenKill(MainActivity::class.java)
}
}
}
......
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