yangxiaolei 2 年之前
父节点
当前提交
7aac352068

+ 59 - 20
app/src/main/java/com/sheep/gamegroup/model/entity/NewAboutUs.java

@@ -19,70 +19,109 @@ public class NewAboutUs {
 
     private String CooperationQq;
 
+    private String CustomerWechat;
+
+    private String CustomerWechatQr;
+
     private int CreateTime;
 
     private int UpdateTime;
 
     private int Id;
 
-    public void setWechatPlatform(String WechatPlatform){
+    public void setWechatPlatform(String WechatPlatform) {
         this.WechatPlatform = WechatPlatform;
     }
-    public String getWechatPlatform(){
+
+    public String getWechatPlatform() {
         return this.WechatPlatform;
     }
-    public void setOfficialAddress(String OfficialAddress){
+
+    public void setOfficialAddress(String OfficialAddress) {
         this.OfficialAddress = OfficialAddress;
     }
-    public String getOfficialAddress(){
+
+    public String getOfficialAddress() {
         return this.OfficialAddress;
     }
-    public void setComplaintQq(String ComplaintQq){
+
+    public void setComplaintQq(String ComplaintQq) {
         this.ComplaintQq = ComplaintQq;
     }
-    public String getComplaintQq(){
+
+    public String getComplaintQq() {
         return this.ComplaintQq;
     }
-    public void setTitle(String Title){
+
+    public void setCustomerWechat(String CustomerWechat) {
+        this.CustomerWechat = CustomerWechat;
+    }
+
+    public String getCustomerWechat() {
+        return this.CustomerWechat;
+    }
+
+    public void setCustomerWechatQr(String CustomerWechatQr) {
+        this.CustomerWechatQr = CustomerWechatQr;
+    }
+
+    public String getCustomerWechatQr() {
+        return this.CustomerWechatQr;
+    }
+
+    public void setTitle(String Title) {
         this.Title = Title;
     }
-    public String getTitle(){
+
+    public String getTitle() {
         return this.Title;
     }
-    public void setContent(String Content){
+
+    public void setContent(String Content) {
         this.Content = Content;
     }
-    public String getContent(){
+
+    public String getContent() {
         return this.Content;
     }
-    public void setMailbox(String Mailbox){
+
+    public void setMailbox(String Mailbox) {
         this.Mailbox = Mailbox;
     }
-    public String getMailbox(){
+
+    public String getMailbox() {
         return this.Mailbox;
     }
-    public void setCooperationQq(String CooperationQq){
+
+    public void setCooperationQq(String CooperationQq) {
         this.CooperationQq = CooperationQq;
     }
-    public String getCooperationQq(){
+
+    public String getCooperationQq() {
         return this.CooperationQq;
     }
-    public void setCreateTime(int CreateTime){
+
+    public void setCreateTime(int CreateTime) {
         this.CreateTime = CreateTime;
     }
-    public int getCreateTime(){
+
+    public int getCreateTime() {
         return this.CreateTime;
     }
-    public void setUpdateTime(int UpdateTime){
+
+    public void setUpdateTime(int UpdateTime) {
         this.UpdateTime = UpdateTime;
     }
-    public int getUpdateTime(){
+
+    public int getUpdateTime() {
         return this.UpdateTime;
     }
-    public void setId(int Id){
+
+    public void setId(int Id) {
         this.Id = Id;
     }
-    public int getId(){
+
+    public int getId() {
         return this.Id;
     }
 

+ 40 - 0
app/src/main/java/com/sheep/gamegroup/util/ApiUtil.java

@@ -121,6 +121,46 @@ public class ApiUtil {
                             }
                         });
     }
+
+    public static void getNewAboutUsCustomerWechat(final Action1<String> action1) {
+        final NewAboutUs newAboutUs = DataUtil.getInstance().getCacheResult(ApiKey.new_about_us, NewAboutUs.class);
+        if(newAboutUs != null && !TextUtils.isEmpty(newAboutUs.getCustomerWechat())){
+            Observable.just(newAboutUs.getCustomerWechat())
+                    .observeOn(AndroidSchedulers.mainThread())
+                    .subscribe(new AbsObserver<String>() {
+                        @Override
+                        public void onNext(String wechatUrl) {
+                            action1.call(wechatUrl);
+                        }
+                    });
+            newAboutUs.setComplaintQq(null);//设置为空任务标记已经读取,下面的接口不用调用call
+        }
+        SheepApp.getInstance().getNetComponent().getApiService().getNewAboutUs()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        if(newAboutUs != null && TextUtils.equals(newAboutUs.getCustomerWechat(), "hasRead")){
+                            return;
+                        }
+                        NewAboutUs item = baseMessage.getData(NewAboutUs.class);
+                        if(item != null && !TextUtils.isEmpty(item.getCustomerWechat())){
+                            action1.call(item.getCustomerWechat());
+                        } else {
+                            action1.call("https://work.weixin.qq.com/kfid/kfc770ad220d79c6657");
+                        }
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        if(newAboutUs != null && TextUtils.equals(newAboutUs.getComplaintQq(), "hasRead")){
+                            return;
+                        }
+                        action1.call("https://work.weixin.qq.com/kfid/kfc770ad220d79c6657");
+                    }
+                });
+    }
     //点击热门搜索后,统计点击次数
     public static void postTopSearchStatisticsClickTopSearch(@Nullable IHomePageSearch item) {
         if(item != null)

+ 8 - 0
app/src/main/java/com/sheep/gamegroup/util/QQUtil.java

@@ -42,6 +42,14 @@ public class QQUtil {
         }
     }
 
+    public static void skip4(Activity activity, String url) {
+        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
+        // 跳转前先判断Uri是否存在,如果打开一个不存在的Uri,App可能会崩溃
+        if (isValidIntent(activity, intent)) {
+            activity.startActivity(intent);
+        }
+    }
+
     /**
      * 判断 用户是否安装QQ客户端
      */

+ 2 - 2
gradle.properties

@@ -17,8 +17,8 @@
 # org.gradle.parallel=true
 #android.injected.build.model.only.versioned = 3
 
-VERSION_NAME=3.9.0
-VERSION_CODE=3009000
+VERSION_NAME=3.9.1
+VERSION_CODE=3009001
 ANDROID_COMPILE_SDK_VERSION=30
 ANDROID_MIN_SDK_VERSION=19
 ANDORID_TARGET_SDK_VERSION=28