|
|
@@ -1496,21 +1496,36 @@ public class Jump2View {
|
|
|
if (SysAppUtil.isNewSmallSheep()) {//新版本只显示引导页面,不展示弹窗和开屏广告
|
|
|
return;
|
|
|
}
|
|
|
- SheepApp.getInstance().getNetComponent().getApiService().getAdvertising(2)
|
|
|
- .subscribeOn(Schedulers.io())
|
|
|
- .observeOn(AndroidSchedulers.mainThread())
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(activity) {
|
|
|
- @Override
|
|
|
- public void onNext(BaseMessage baseMessage) {
|
|
|
- Advertising advertising = baseMessage.getData(Advertising.class);
|
|
|
- ViewUtil.showHalfScreenAd(activity, advertising, container);
|
|
|
- }
|
|
|
+ CommonUtil.getInstance().callActionWithUserInfo(new Action1<UserEntity>() {
|
|
|
+ @Override
|
|
|
+ public void call(UserEntity userEntity) {
|
|
|
+ if(userEntity.alreadyFinishAllNewTask() && !userEntity.alreadyExchangeCoupon()){//已经完成所有新手任务且没有兑换过优惠券时,显示商城优惠券
|
|
|
+ Advertising advertising = new Advertising();
|
|
|
+ advertising.setName("兑换商城优惠券,优惠多多");
|
|
|
+// advertising.setDesc("点击兑换商城优惠券,优惠多多");
|
|
|
+ advertising.setDisplay_type(Advertising.TYPE_IMG);
|
|
|
+ advertising.setDisplay_src(ViewUtil.getNetImgByName("homepage_xinshourw"));
|
|
|
+ advertising.setLinkType(IDConstant.JUMP_EXCHANGE_COUPON);
|
|
|
+ ViewUtil.showHalfScreenAd(activity, advertising, container);
|
|
|
+ } else {
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().getAdvertising(2)
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(activity) {
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ Advertising advertising = baseMessage.getData(Advertising.class);
|
|
|
+ ViewUtil.showHalfScreenAd(activity, advertising, container);
|
|
|
+ }
|
|
|
|
|
|
- @Override
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
- tryShowReservation(activity);
|
|
|
- }
|
|
|
- });
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ tryShowReservation(activity);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
public void tryShowReservation(final Activity activity) {
|