Explorar o código

添加元旦活动提示框

zengjiebin %!s(int64=7) %!d(string=hai) anos
pai
achega
54b401e3c0

+ 57 - 7
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -60,19 +60,19 @@ public interface ApiService {
     Observable<BaseMessage> changePassword(@Body JSONObject jsonObject);
 
     /**
-     * @param page          页数
-     * @param per_page      每页显示条数
-     * @param user_id       integer (query) 用户ID
-     * @param type          integer (query) 1:通知 2:活动 3:模块上线 4:任务上线 5:金额入账 6:任务失败 默认0:全部
+     * @param page     页数
+     * @param per_page 每页显示条数
+     * @param user_id  integer (query) 用户ID
+     * @param type     integer (query) 1:通知 2:活动 3:模块上线 4:任务上线 5:金额入账 6:任务失败 默认0:全部
      * @return 消息中心列表
      */
     @GET(ApiKey.system_notification)
     Observable<BaseMessage> getMessageCenter(@Query("page") int page, @Query("per_page") int per_page, @Query("user_id") String user_id, @SystemNotification.TYPE @Query("type") int type);
 
     /**
-     * @param page          页数
-     * @param per_page      每页显示条数
-     * @param user_id       integer (query) 用户ID
+     * @param page     页数
+     * @param per_page 每页显示条数
+     * @param user_id  integer (query) 用户ID
      * @return 回复互动列表
      */
     @GET("app/message/system_message/")
@@ -373,6 +373,7 @@ public interface ApiService {
     @GET("app/accepted_task/status")
     Observable<BaseMessage> taskStatus(@Query("id") int id, @Query("screenshots") String screenshots,
                                        @Query("remark") String remark, @Query("package_name") String package_name, @Query("status") String status, @Query("device") String device);
+
     /**
      * 修改任务进度
      */
@@ -1174,6 +1175,7 @@ public interface ApiService {
      */
     @POST("app/game_user/focus_user")
     Observable<BaseMessage> postGameUserFocusUser(@Query("focus_user_id") int focus_user_id);
+
     /**
      * 热门用户列表
      * page * integer (query) 页码
@@ -1181,6 +1183,7 @@ public interface ApiService {
      */
     @GET(ApiKey.getGameUserUserFocusHotUser)
     Observable<BaseMessage> getGameUserUserFocusHotUser(@Query("page") int page, @Query("per_page") int per_page);
+
     /**
      * 关注的用户列表
      * page * integer (query) 页码
@@ -1188,6 +1191,7 @@ public interface ApiService {
      */
     @GET(ApiKey.getGameUserUserFocusList)
     Observable<BaseMessage> getGameUserUserFocusList(@Query("page") int page, @Query("per_page") int per_page);
+
     /**
      * 关注的游戏列表
      * page * integer (query) 页码
@@ -1384,21 +1388,25 @@ public interface ApiService {
      */
     @GET("app/user_sign/signs")
     Observable<BaseMessage> getUserSignSigns();
+
     /**
      * 获取下次刮奖金额
      */
     @GET("app/user_sign/scratch_amount")
     Observable<BaseMessage> getUserSignScratch_amount();
+
     /**
      * 获取最后一次刮奖结果
      */
     @GET("app/user_sign/last_scratch")
     Observable<BaseMessage> getUserSignLastScratch();
+
     /**
      * 每日签到
      */
     @POST("app/user_sign/sign_in")
     Observable<BaseMessage> postUserSignSignIn();
+
     /**
      * 分享
      */
@@ -1435,6 +1443,7 @@ public interface ApiService {
      */
     @POST("app/top_search_statistics/click_top_search")
     Observable<BaseMessage> postTopSearchStatisticsClickTopSearch(@Query("link_id") int link_id, @IHomePageSearch.LINK_TYPE @Query("link_type") int link_type);
+
     /**
      * 根据任务名(游戏名)模糊搜索
      * search_content * string (query) 任务名(游戏名)
@@ -1485,6 +1494,7 @@ public interface ApiService {
      */
     @POST("app/user/add_user_footprint")
     Observable<BaseMessage> postUserAddUserFootPrint(@Body UserFootprint UserFootprint);
+
     /**
      * 小绵羊3.4.5
      * 查询足迹/我的足迹
@@ -1494,6 +1504,7 @@ public interface ApiService {
      */
     @GET(ApiKey.getUserFootPrintList)
     Observable<BaseMessage> getUserFootPrintList(@Query("page") int page, @Query("per_page") int per_page, @Query("date") String date);
+
     /**
      * 小绵羊3.4.5
      * 查询足迹/我的足迹日期数量列表
@@ -1504,11 +1515,13 @@ public interface ApiService {
     Observable<BaseMessage> getUserFootPrintDateCount(@Query("start_date") String start_date, @Query("end_date") String end_date);
 //---------------------------end 小绵羊3.4.5 足迹-------------------------------------
 //---------------------------start 小绵羊3.4.5 分享-----------------------------------
+
     /**
      * 获取每日分享列表
      */
     @GET("app/share/shares")
     Observable<BaseMessage> getShareList();
+
     /**
      * 每日分享结果
      */
@@ -1524,42 +1537,50 @@ public interface ApiService {
      */
     @POST("app/video")
     Observable<BaseMessage> postVideo(@Body JSONObject jsonObject);
+
     /**
      * 小绵羊3.4.5新增 -- 查询视频详情
      * video_id * integer (query) 视频id
      */
     @GET("app/video/detail")
     Observable<BaseMessage> getVideoDetail(@Query("video_id") int video_id);
+
     /**
      * 小绵羊3.4.5新增 -- 视频点赞
      */
     @POST("app/video/like")
     Observable<BaseMessage> postVideoLike(@Query("video_id") int video_id);
+
     /**
      * 小绵羊3.4.5新增 -- 查询视频列表
      */
     @GET(ApiKey.getVideoList)
     Observable<BaseMessage> getVideoList(@Query("page_no") int page, @Query("page_size") int per_page);
+
     /**
      * 小绵羊3.4.5新增 -- 查询音乐列表
      */
     @GET(ApiKey.getVideoMusic)
     Observable<BaseMessage> getVideoMusic();
+
     /**
      * 小绵羊3.4.5新增 -- 视频分享回调
      */
     @POST("app/video/share")
     Observable<BaseMessage> postVideoShare(@Query("video_id") int video_id);
+
     /**
      * 小绵羊3.4.5新增 -- 查询贴纸列表
      */
     @GET(ApiKey.getVideoSticker)
     Observable<BaseMessage> getVideoSticker();
+
     /**
      * 小绵羊3.4.5新增 -- 获取七牛上传凭证
      */
     @GET("app/video/token")
     Observable<BaseMessage> getVideoToken();
+
     /**
      * 小绵羊3.4.5新增 -- 查询话题列表
      */
@@ -1567,6 +1588,7 @@ public interface ApiService {
     Observable<BaseMessage> getVideoTopic();
 //---------------------------end 小绵羊3.4.5 视频-------------------------------------
 //---------------------------start 插件配置相关-------------------------------------
+
     /**
      * 客户端插件更新/插件获取
      * package_name * string (query) 包名
@@ -1577,6 +1599,7 @@ public interface ApiService {
     Observable<BaseMessage> getPackageVersion(@Query("package_name") String package_name, @Query("type") String type, @Query("version") int version);
 //---------------------------end 插件配置相关-------------------------------------
 //---------------------------start 商城相关-------------------------------------
+
     /**
      * 领取商城优惠券
      * type * integer (query) 代金券类型 1:新手任务完成领取 2:h5任务领取 默认1
@@ -1584,6 +1607,7 @@ public interface ApiService {
      */
     @POST("app/yf_shop/receive_coupons")
     Observable<BaseMessage> postYfShopReceiveCoupons(@Query("type") int type, @Query("amount") float amount);
+
     /**
      * 查询领取商城优惠券
      * type * integer (query) 代金券类型 1:新手任务完成领取 2:h5任务领取 默认1
@@ -1592,6 +1616,7 @@ public interface ApiService {
     Observable<BaseMessage> getYfShopReceiveCouponsCheck(@Query("type") int type);
 //---------------------------end 商城相关-------------------------------------
 //---------------------------start 小绵羊3.4.7新增 -- vip相关-------------------------------------
+
     /**
      * 用户充值vip
      * level:	integer ($int32) 1:VIP
@@ -1600,5 +1625,30 @@ public interface ApiService {
     @POST("app/user/buy_vip")
     Observable<BaseMessage> postBuyVip(@Body JSONObject jsonObject);
 //---------------------------end 小绵羊3.4.7新增 -- vip相关-------------------------------------
+//---------------------------start 小绵羊3.4.7新增 -- 活动相关(如:元旦活动)-------------------------------------
+
+    /**
+     * 用户充值vip
+     * root_id:	integer ($int32) 2:元旦活动
+     */
+    @POST("app/mission/apply")
+    Observable<BaseMessage> postMissionApply(@Body JSONObject jsonObject);
+
+    /**
+     * 查看自己的任务状态
+     * root_id:	integer ($int32) 2:元旦活动
+     */
+    @GET("app/mission/self/{root_id}")
+    Observable<BaseMessage> getMissionSelfRootId(@Path("root_id") int root_id);
+//---------------------------end 小绵羊3.4.7新增 -- 活动相关(如:元旦活动)-------------------------------------
+//---------------------------start 小绵羊3.4.7新增 -- app/user_address 用户收货地址-------------------------------------
+
+    /**
+     * 查询用户地址信息
+     * 返回 UserAddressInfo
+     */
+    @GET("app/user_address/apply")
+    Observable<BaseMessage> getUserAddressApply();
+//---------------------------end 小绵羊3.4.7新增 -- app/user_address 用户收货地址-------------------------------------
 
 }

+ 198 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/Mission.java

@@ -0,0 +1,198 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * Created by realicing on 2018/12/28.
+ * realicing@sina.com
+ *
+ * {
+ *             "id": 7,
+ *             "user_id": 63418,
+ *             "follow_id": 0,
+ *             "refer_id": 0,
+ *             "origin_id": 2,
+ *             "type": 2,
+ *             "action": 0,
+ *             "status": 0,
+ *             "title": "",
+ *             "detail": "",
+ *             "url": "",
+ *             "extra": "27555863",
+ *             "create_time": 1545978171,
+ *             "update_time": 1545978171,
+ *             "amount": 0,
+ *             "total": 50,
+ *             "quantity": 0
+ *         }
+ */
+public class Mission {
+    public static final int ROOT_ID_YD = 2;//元旦活动
+    private int id;
+
+    private int user_id;
+
+    private int follow_id;
+
+    private int refer_id;
+
+    private int origin_id;
+
+    private int type;
+
+    private int action;
+
+    private int status;
+
+    private String title;
+
+    private String detail;
+
+    private String url;
+
+    private String extra;
+
+    private int create_time;
+
+    private int update_time;
+
+    private int amount;
+
+    private int total;
+
+    private int quantity;
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public int getUser_id() {
+        return user_id;
+    }
+
+    public void setUser_id(int user_id) {
+        this.user_id = user_id;
+    }
+
+    public int getFollow_id() {
+        return follow_id;
+    }
+
+    public void setFollow_id(int follow_id) {
+        this.follow_id = follow_id;
+    }
+
+    public int getRefer_id() {
+        return refer_id;
+    }
+
+    public void setRefer_id(int refer_id) {
+        this.refer_id = refer_id;
+    }
+
+    public int getOrigin_id() {
+        return origin_id;
+    }
+
+    public void setOrigin_id(int origin_id) {
+        this.origin_id = origin_id;
+    }
+
+    public int getType() {
+        return type;
+    }
+
+    public void setType(int type) {
+        this.type = type;
+    }
+
+    public int getAction() {
+        return action;
+    }
+
+    public void setAction(int action) {
+        this.action = action;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getDetail() {
+        return detail;
+    }
+
+    public void setDetail(String detail) {
+        this.detail = detail;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getExtra() {
+        return extra;
+    }
+
+    public void setExtra(String extra) {
+        this.extra = extra;
+    }
+
+    public int getCreate_time() {
+        return create_time;
+    }
+
+    public void setCreate_time(int create_time) {
+        this.create_time = create_time;
+    }
+
+    public int getUpdate_time() {
+        return update_time;
+    }
+
+    public void setUpdate_time(int update_time) {
+        this.update_time = update_time;
+    }
+
+    public int getAmount() {
+        return amount;
+    }
+
+    public void setAmount(int amount) {
+        this.amount = amount;
+    }
+
+    public int getTotal() {
+        return total;
+    }
+
+    public void setTotal(int total) {
+        this.total = total;
+    }
+
+    public int getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(int quantity) {
+        this.quantity = quantity;
+    }
+}

+ 91 - 0
app/src/main/java/com/sheep/gamegroup/module/user/model/Area.java

@@ -0,0 +1,91 @@
+package com.sheep.gamegroup.module.user.model;
+
+/**
+ * Created by realicing on 2018/12/28.
+ * realicing@sina.com
+ *
+ * adcode:	integer ($int64)
+ * 行政区域编码
+ * area_id:	integer ($int64)
+ * create_time:	integer ($int64)
+ * 创建时间
+ * level:	integer ($int64)
+ * 层级,大区设置为1,省级设置为2,市级3,区县级4,乡镇级5
+ * name:	string
+ * 名称
+ * p_adcode:	integer ($int64)
+ * 上级的adcode
+ * update_time:	integer ($int64)
+ * 自动更新时间
+ */
+public class Area {
+    private int adcode;
+
+    private int area_id;
+
+    private int create_time;
+
+    private int level;
+
+    private String name;
+
+    private int p_adcode;
+
+    private int update_time;
+
+    public int getAdcode() {
+        return adcode;
+    }
+
+    public void setAdcode(int adcode) {
+        this.adcode = adcode;
+    }
+
+    public int getArea_id() {
+        return area_id;
+    }
+
+    public void setArea_id(int area_id) {
+        this.area_id = area_id;
+    }
+
+    public int getCreate_time() {
+        return create_time;
+    }
+
+    public void setCreate_time(int create_time) {
+        this.create_time = create_time;
+    }
+
+    public int getLevel() {
+        return level;
+    }
+
+    public void setLevel(int level) {
+        this.level = level;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getP_adcode() {
+        return p_adcode;
+    }
+
+    public void setP_adcode(int p_adcode) {
+        this.p_adcode = p_adcode;
+    }
+
+    public int getUpdate_time() {
+        return update_time;
+    }
+
+    public void setUpdate_time(int update_time) {
+        this.update_time = update_time;
+    }
+}

+ 152 - 0
app/src/main/java/com/sheep/gamegroup/module/user/model/UserAddress.java

@@ -0,0 +1,152 @@
+package com.sheep.gamegroup.module.user.model;
+
+import com.alibaba.fastjson.annotation.JSONField;
+
+/**
+ * Created by realicing on 2018/12/28.
+ * realicing@sina.com
+ *
+ * default:	integer ($int32)
+ * 默认地址 1:是 2:否
+ * update_time:	integer ($int64)
+ * area_map:	string
+ * 地区map
+ * area_id:	integer ($int64)
+ * 对应map表的id
+ * postcode:	string
+ * 邮编
+ * phone:	string
+ * 电话
+ * user_id:	integer ($int64)
+ * 用户id
+ * create_time:	integer ($int64)
+ * address:	string
+ * 地址
+ * id:	integer ($int64)
+ * address_detail:	string
+ * 地址详情
+ * user_name:	string
+ * 姓名
+ */
+public class UserAddress {
+    private String address;
+
+    private String address_detail;
+
+    private int area_id;
+
+    private String area_map;
+
+    private int create_time;
+
+    @JSONField(name = "default")
+    private int _default;
+
+    private int id;
+
+    private String phone;
+
+    private String postcode;
+
+    private int update_time;
+
+    private int user_id;
+
+    private String user_name;
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getAddress_detail() {
+        return address_detail;
+    }
+
+    public void setAddress_detail(String address_detail) {
+        this.address_detail = address_detail;
+    }
+
+    public int getArea_id() {
+        return area_id;
+    }
+
+    public void setArea_id(int area_id) {
+        this.area_id = area_id;
+    }
+
+    public String getArea_map() {
+        return area_map;
+    }
+
+    public void setArea_map(String area_map) {
+        this.area_map = area_map;
+    }
+
+    public int getCreate_time() {
+        return create_time;
+    }
+
+    public void setCreate_time(int create_time) {
+        this.create_time = create_time;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getPostcode() {
+        return postcode;
+    }
+
+    public void setPostcode(String postcode) {
+        this.postcode = postcode;
+    }
+
+    public int getUpdate_time() {
+        return update_time;
+    }
+
+    public void setUpdate_time(int update_time) {
+        this.update_time = update_time;
+    }
+
+    public int getUser_id() {
+        return user_id;
+    }
+
+    public void setUser_id(int user_id) {
+        this.user_id = user_id;
+    }
+
+    public String getUser_name() {
+        return user_name;
+    }
+
+    public void setUser_name(String user_name) {
+        this.user_name = user_name;
+    }
+
+    public int get_default() {
+        return _default;
+    }
+
+    public void set_default(int _default) {
+        this._default = _default;
+    }
+}

+ 28 - 0
app/src/main/java/com/sheep/gamegroup/module/user/model/UserAddressInfo.java

@@ -0,0 +1,28 @@
+package com.sheep.gamegroup.module.user.model;
+
+import java.util.List;
+
+/**
+ * Created by realicing on 2018/12/28.
+ * realicing@sina.com
+ */
+public class UserAddressInfo {
+    private List<Area> area;
+    private UserAddress userAddress;
+
+    public List<Area> getArea() {
+        return area;
+    }
+
+    public void setArea(List<Area> area) {
+        this.area = area;
+    }
+
+    public UserAddress getUserAddress() {
+        return userAddress;
+    }
+
+    public void setUserAddress(UserAddress userAddress) {
+        this.userAddress = userAddress;
+    }
+}

+ 52 - 2
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -36,6 +36,7 @@ import com.sheep.gamegroup.model.entity.GameListTag;
 import com.sheep.gamegroup.model.entity.GameListType;
 import com.sheep.gamegroup.model.entity.HomeListEntity;
 import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.entity.Mission;
 import com.sheep.gamegroup.model.entity.NewbieTask;
 import com.sheep.gamegroup.model.entity.NewbieTaskRecord;
 import com.sheep.gamegroup.model.entity.RouserArticlesEntity;
@@ -1495,6 +1496,7 @@ public class Jump2View {
         }
     }
 
+    //尝试显示弹窗广告
     public void tryShowHalfScreenAd(final Activity activity, final Container<Action1<Integer>> container) {
         if (SysAppUtil.isNewSmallSheep()) {//新版本只显示引导页面,不展示弹窗和开屏广告
             return;
@@ -1532,7 +1534,7 @@ public class Jump2View {
                                         return;
                                     }
                                 }
-                                //显示商城
+                                //显示弹窗广告
                                 SheepApp.getInstance().getNetComponent().getApiService().getAdvertising(2)
                                         .subscribeOn(Schedulers.io())
                                         .observeOn(AndroidSchedulers.mainThread())
@@ -1545,13 +1547,61 @@ public class Jump2View {
 
                                             @Override
                                             public void onError(BaseMessage baseMessage) {
-                                                tryShowReservation(activity);
+                                                tryShowYfShopAskDialog(activity);
                                             }
                                         });
                             }
                         }));
     }
 
+    //尝试显示元旦活动完成一个阶段,有礼品时提示用户
+    public void tryShowYfShopAskDialog(final Activity activity) {
+        SheepApp.getInstance().getNetComponent().getApiService().getMissionSelfRootId(Mission.ROOT_ID_YD)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(activity) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        Mission mission = baseMessage.getData(Mission.class);
+                        if(mission != null) {
+                            if(mission.getQuantity() == 10) {//邀请10个后有奖品
+                                tryCheckUserAddress(activity, mission);
+                                return;
+                            } else if(mission.getQuantity() == 50) {//邀请50个时有奖品
+                                tryCheckUserAddress(activity, mission);
+                                return;
+                            }
+                        }
+                        tryShowReservation(activity);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        tryShowReservation(activity);
+                    }
+                });
+    }
+    //尝试获取收货地址,来显示用户获取到礼品后,显示的状态
+    public void tryCheckUserAddress(final Activity activity, Mission mission) {
+        SheepApp.getInstance().getNetComponent().getApiService().getUserAddressApply()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        String content = activity.getString(R.string.yf_shop_ask_tip, mission.getExtra());
+                        ViewUtil.showYfShopAsk(activity, true, content);
+
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        String content = activity.getString(R.string.yf_shop_ask_tip_2, mission.getExtra());
+                        ViewUtil.showYfShopAsk(activity, false, content);
+                    }
+                });
+    }
+    //显示下载预约的游戏可以下载的提示
     public void tryShowReservation(final Activity activity) {
         SheepApp.getInstance().getNetComponent().getApiService().getFindAppDownloadsStatus()
                 .subscribeOn(Schedulers.io())

+ 15 - 8
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -74,6 +74,7 @@ import com.sheep.gamegroup.model.entity.DialogConfig;
 import com.sheep.gamegroup.model.entity.GameAccountEntity;
 import com.sheep.gamegroup.model.entity.GiftBagApp;
 import com.sheep.gamegroup.model.entity.Lp;
+import com.sheep.gamegroup.model.entity.Mission;
 import com.sheep.gamegroup.model.entity.PayEntity;
 import com.sheep.gamegroup.model.entity.RobTask;
 import com.sheep.gamegroup.model.entity.TaskEty;
@@ -847,9 +848,9 @@ public class ViewUtil {
         /* URL */
         UMWeb web = new UMWeb(url);
         /* 标题 */
-        web.setTitle(!TextUtils.isEmpty(title) ? "赚钱就来小绵羊" : title);
+        web.setTitle(TextUtils.isEmpty(title) ? "赚钱就来小绵羊" : title);
         web.setThumb(image);
-        web.setDescription(!TextUtils.isEmpty(content) ? "更懂你的赚钱工具,超多福利,超多赏金,拿到你手软!" : content);
+        web.setDescription(TextUtils.isEmpty(content) ? "更懂你的赚钱工具,超多福利,超多赏金,拿到你手软!" : content);
         switch (media) {
             case WEIXIN_CIRCLE:
                 web.setTitle(web.getTitle() + "\n" + web.getDescription());
@@ -1488,7 +1489,7 @@ public class ViewUtil {
 //                    }
                     ACache aCache = ACache.get(SheepApp.getInstance());
                     aCache.put(advertising.getDisplay_src(), String.format(Locale.CHINA, "%d;%d", dialog_center_ll.getWidth(), dialog_center_ll.getHeight()));
-                    Jump2View.getInstance().tryShowReservation(activity);
+                    Jump2View.getInstance().tryShowYfShopAskDialog(activity);
                 }
             });
             if (TextUtils.isEmpty(advertising.getDesc())) {
@@ -1559,7 +1560,7 @@ public class ViewUtil {
             dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
                 @Override
                 public void onDismiss(DialogInterface dialogInterface) {
-                    Jump2View.getInstance().tryShowReservation(activity);
+                    Jump2View.getInstance().tryShowYfShopAskDialog(activity);
                 }
             });
             try {
@@ -1570,7 +1571,7 @@ public class ViewUtil {
         }
     }
     //3.4.7添加 -- 展示 元旦活动中 提示用户邀请人数到达一定数量时,获得了礼品,需要填写收件地址 对话框
-    public static void showYfShopAsk(final Activity activity) {
+    public static void showYfShopAsk(final Activity activity, boolean willGo, String content) {
         if (activity != null) {
             View dialog_parent = View.inflate(activity, R.layout.dialog_parent, null);
             final AlertDialog dialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
@@ -1587,11 +1588,13 @@ public class ViewUtil {
             TextView dialog_yf_shop_ask_title_tv = view.findViewById(R.id.dialog_yf_shop_ask_title_tv);
             TextView dialog_yf_shop_ask_content_tv = view.findViewById(R.id.dialog_yf_shop_ask_content_tv);
             TextView dialog_yf_shop_ask_btn_tv = view.findViewById(R.id.dialog_yf_shop_ask_btn_tv);
+
+            ViewUtil.setText(dialog_yf_shop_ask_content_tv, content);
             float per = (G.WIDTH - G.getRealPix(80)) / 920.0f;
             LayoutParamsUtil.resetLayoutParams(dialog_yf_shop_ask_title_tv, new Lp(per).setTopMargin(50));
             LayoutParamsUtil.resetLayoutParams(dialog_yf_shop_ask_content_tv, new Lp(per).setHeight(650).setLeftMargin(200).setRightMargin(200));
             LayoutParamsUtil.resetLayoutParams(dialog_yf_shop_ask_btn_tv, new Lp(per).setBottomMargin(50));
-            ViewUtil.setText(dialog_yf_shop_ask_btn_tv, "前\t往");
+            ViewUtil.setText(dialog_yf_shop_ask_btn_tv, willGo ? "前\t往" : "知道了");
             dialog_close.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
@@ -1601,8 +1604,12 @@ public class ViewUtil {
             dialog_yf_shop_ask_btn_tv.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
-                    Jump2View.getInstance().goActUserAddrInfo(activity);
-                    USER_INFO_ADDR.onEvent();
+                    if(willGo) {
+                        Jump2View.getInstance().goActUserAddrInfo(activity);
+                        USER_INFO_ADDR.onEvent();
+                    } else {
+                        dialog.dismiss();
+                    }
                 }
             });
             dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {

+ 26 - 2
app/src/main/java/com/sheep/gamegroup/util/js/KFZSJs.java

@@ -4,6 +4,7 @@ import android.app.Activity;
 import android.text.TextUtils;
 import android.webkit.JavascriptInterface;
 
+import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.absBase.AbsObserver;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
@@ -26,11 +27,11 @@ import com.sheep.jiuyan.samllsheep.utils.G;
 import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
 import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
-import com.umeng.socialize.UMShareListener;
-import com.umeng.socialize.bean.SHARE_MEDIA;
 
 import java.util.Locale;
 
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
 import rx.functions.Action1;
 
 /**
@@ -220,6 +221,29 @@ public class KFZSJs {
         });
     }
     @JavascriptInterface
+    public void postMissionApply(int root_id){
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("root_id", root_id);
+        SheepApp.getInstance().getNetComponent().getApiService().postMissionApply(jsonObject)
+                        .subscribeOn(Schedulers.io())
+                        .observeOn(AndroidSchedulers.mainThread())
+                        .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                            @Override
+                            public void onNext(BaseMessage baseMessage) {
+                            }
+
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                                G.showToast(baseMessage);
+                            }
+                        });
+        switch (root_id){
+            case 2://领取元旦活动后,跳转邀请界面
+                Jump2View.getInstance().goActInvitation(activity);
+                break;
+        }
+    }
+    @JavascriptInterface
     public void buyVip(int level, int pay_type){
         buyVip(activity, new BuyVipReq());
     }

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtPersonalCenter.java

@@ -296,8 +296,8 @@ public class FgtPersonalCenter extends BaseFragment {
         sheepNumTv.setText(String.format(Locale.CHINA, "绵羊号:%s", userEntity.getInvitation_code()));
         GlideImageLoader.setAvatar(iconImgIv, userEntity.getAvatar(), Color.argb(128, 255, 255, 255));
         ViewUtil.setVisibility(vipFlagView, userEntity.isVIP());
-        ViewUtil.setVisibility(fgt_pc_item_vip_v, userEntity.isVIP());
-        ViewUtil.setVisibility(fgt_pc_item_vip_ll, userEntity.isVIP());
+        ViewUtil.setVisibility(fgt_pc_item_vip_v, !userEntity.isVIP());
+        ViewUtil.setVisibility(fgt_pc_item_vip_ll, !userEntity.isVIP());
     }
 
     /**

+ 1 - 1
app/src/main/res/layout/dialog_yf_shop_ask.xml

@@ -30,7 +30,7 @@
         android:layout_marginEnd="30dp"
         android:gravity="center_vertical"
         android:lineSpacingExtra="2dp"
-        android:text="恭喜XXX(绵羊ID)用户,元旦邀新活动,你已获得礼品,请前往填写收件信息,羊羊乐园的工作人员将尽快的为你安排发货,请耐心等待!"
+        android:text="@string/yf_shop_ask_tip"
         android:textColor="#ff999999"
         android:textSize="13sp" />
 

+ 2 - 0
app/src/main/res/values/strings.xml

@@ -210,5 +210,7 @@
     <string name="get_money_x_yuan">账户入账通知 尊敬的羊羊用户,恭喜元宝账户收入XXX元。</string>
     <string name="yf_shop_quan_tip">恭喜你获得%s元商品劵,你可前往商城,直接选择心仪的商品哦~</string>
     <string name="yf_shop_quan_title">—— 商城优惠券  ——</string>
+    <string name="yf_shop_ask_tip">恭喜%s用户,元旦邀新活动,你已获得礼品,请前往填写收件信息,羊羊乐园的工作人员将尽快的为你安排发货,请耐心等待!</string>
+    <string name="yf_shop_ask_tip_2">恭喜%s用户,元旦邀新活动,你已获得礼品。请耐心等待,羊羊乐园的工作人员将尽快的为你安排发货,!</string>
 
 </resources>