Browse Source

修改关于我们和意见反馈邮箱和手机号码接口流程

Pq 1 năm trước cách đây
mục cha
commit
8a7b12eb30

+ 31 - 0
BaseLibrary/src/main/java/com/cooleshow/base/bean/ServiceContactBean.java

@@ -0,0 +1,31 @@
+package com.cooleshow.base.bean;
+
+/**
+ * Author by pq, Date on 2023/8/31.
+ */
+public class ServiceContactBean {
+
+    /**
+     * phone :
+     * email :
+     */
+
+    private String customerServicePhone;
+    private String customerServiceEmail;
+
+    public String getPhone() {
+        return customerServicePhone;
+    }
+
+    public void setPhone(String phone) {
+        this.customerServicePhone = phone;
+    }
+
+    public String getEmail() {
+        return customerServiceEmail;
+    }
+
+    public void setEmail(String email) {
+        this.customerServiceEmail = email;
+    }
+}

+ 4 - 0
BaseLibrary/src/main/java/com/cooleshow/base/data/api/UploadApi.java

@@ -2,9 +2,11 @@ package com.cooleshow.base.data.api;
 
 import com.cooleshow.base.bean.AddressBean;
 import com.cooleshow.base.bean.RecentPracticeBean;
+import com.cooleshow.base.bean.ServiceContactBean;
 import com.cooleshow.base.bean.UploadTokenInfoBean;
 import com.cooleshow.base.bean.UserDetailInfoBean;
 import com.cooleshow.base.bean.request.EditAddressEntry;
+import com.cooleshow.base.common.BaseConstant;
 import com.cooleshow.base.data.net.BaseResponse;
 import com.tencent.connect.UserInfo;
 
@@ -124,4 +126,6 @@ public interface UploadApi {
      */
     @GET(TEACHER_GROUP + "music/sheet/user/practice")
     Observable<BaseResponse<RecentPracticeBean>> queryStuRecentPracticeFromTeacher(@Query("userId") String userId);
+    @POST(AUTH_GROUP + "user/queryConfig")
+    Observable<BaseResponse<ServiceContactBean>> getCustomerServiceContact();
 }

+ 3 - 0
student/src/main/java/com/cooleshow/student/contract/AboutContract.java

@@ -1,5 +1,6 @@
 package com.cooleshow.student.contract;
 
+import com.cooleshow.base.bean.ServiceContactBean;
 import com.cooleshow.base.presenter.view.BaseView;
 
 /**
@@ -11,6 +12,8 @@ import com.cooleshow.base.presenter.view.BaseView;
 public interface AboutContract {
     interface AboutView extends BaseView {
 
+        void getCustomerServiceContactSuccess(ServiceContactBean data);
+
     }
     interface Presenter {
     }

+ 4 - 0
student/src/main/java/com/cooleshow/student/contract/FeedBackContract.java

@@ -1,5 +1,6 @@
 package com.cooleshow.student.contract;
 
+import com.cooleshow.base.bean.ServiceContactBean;
 import com.cooleshow.base.presenter.view.BaseView;
 
 /**
@@ -11,6 +12,9 @@ import com.cooleshow.base.presenter.view.BaseView;
 public interface FeedBackContract {
     interface FeedBackView extends BaseView {
         void addSuggestionSuccess(Object object);
+
+        void getCustomerServiceContactSuccess(ServiceContactBean data);
+
     }
     interface Presenter {
     }

+ 14 - 0
student/src/main/java/com/cooleshow/student/presenter/mine/AboutPresenter.java

@@ -1,6 +1,10 @@
 package com.cooleshow.student.presenter.mine;
 
+import com.cooleshow.base.bean.ServiceContactBean;
+import com.cooleshow.base.data.api.UploadApi;
 import com.cooleshow.base.presenter.BasePresenter;
+import com.cooleshow.base.rx.BaseObserver;
+import com.cooleshow.student.api.APIService;
 import com.cooleshow.student.contract.AboutContract;
 
 /**
@@ -11,4 +15,14 @@ import com.cooleshow.student.contract.AboutContract;
  */
 public class AboutPresenter extends BasePresenter<AboutContract.AboutView> implements AboutContract.Presenter {
 
+    public void getCustomerServiceContact() {
+        addSubscribe(create(UploadApi.class).getCustomerServiceContact(), new BaseObserver<ServiceContactBean>(getView()) {
+            @Override
+            protected void onSuccess(ServiceContactBean data) {
+                if (getView() != null) {
+                    getView().getCustomerServiceContactSuccess(data);
+                }
+            }
+        });
+    }
 }

+ 13 - 0
student/src/main/java/com/cooleshow/student/presenter/mine/FeedBackPresenter.java

@@ -1,5 +1,7 @@
 package com.cooleshow.student.presenter.mine;
 
+import com.cooleshow.base.bean.ServiceContactBean;
+import com.cooleshow.base.data.api.UploadApi;
 import com.cooleshow.base.data.net.ApiException;
 import com.cooleshow.base.presenter.BasePresenter;
 import com.cooleshow.base.rx.BaseObserver;
@@ -47,4 +49,15 @@ public class FeedBackPresenter extends BasePresenter<FeedBackContract.FeedBackVi
         });
     }
 
+
+    public void getCustomerServiceContact() {
+        addSubscribe(create(UploadApi.class).getCustomerServiceContact(), new BaseObserver<ServiceContactBean>(getView()) {
+            @Override
+            protected void onSuccess(ServiceContactBean data) {
+                if (getView() != null) {
+                    getView().getCustomerServiceContactSuccess(data);
+                }
+            }
+        });
+    }
 }

+ 18 - 0
student/src/main/java/com/cooleshow/student/ui/mine/AboutActivity.java

@@ -4,6 +4,7 @@ import android.os.Bundle;
 import android.view.View;
 
 import com.alibaba.android.arouter.facade.annotation.Route;
+import com.cooleshow.base.bean.ServiceContactBean;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.AppUtils;
@@ -47,7 +48,24 @@ public class AboutActivity extends BaseMVPActivity<ActivityAboutBinding, AboutPr
     }
 
     @Override
+    protected void onResume() {
+        super.onResume();
+        presenter.getCustomerServiceContact();
+    }
+
+    @Override
     protected AboutPresenter createPresenter() {
         return new AboutPresenter();
     }
+
+    @Override
+    public void getCustomerServiceContactSuccess(ServiceContactBean data) {
+        if(!checkActivityExist()){
+            return;
+        }
+        if (data != null) {
+            viewBinding.tvConnectNum.setText(data.getPhone());
+            viewBinding.tvEmail.setText(data.getEmail());
+        }
+    }
 }

+ 17 - 0
student/src/main/java/com/cooleshow/student/ui/mine/FeedBackActivity.java

@@ -7,6 +7,7 @@ import android.view.View;
 import androidx.annotation.Nullable;
 
 import com.alibaba.android.arouter.facade.annotation.Route;
+import com.cooleshow.base.bean.ServiceContactBean;
 import com.cooleshow.base.constanst.StyleConfig;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
@@ -71,6 +72,12 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackBinding, F
     }
 
     @Override
+    protected void onResume() {
+        super.onResume();
+        presenter.getCustomerServiceContact();
+    }
+
+    @Override
     protected ActivityFeedbackBinding getLayoutView() {
         return ActivityFeedbackBinding.inflate(getLayoutInflater());
     }
@@ -85,4 +92,14 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackBinding, F
         ToastUtil.getInstance().showShort("提交成功");
         finish();
     }
+
+    @Override
+    public void getCustomerServiceContactSuccess(ServiceContactBean data) {
+        if (!checkActivityExist()) {
+            return;
+        }
+        if (data != null) {
+            viewBinding.tvContactText.setText(getString(R.string.custom_service_tip, data.getPhone(), data.getEmail()));
+        }
+    }
 }

+ 1 - 0
student/src/main/res/layout/activity_feedback.xml

@@ -60,6 +60,7 @@
         android:visibility="gone" />
 
     <TextView
+        android:id="@+id/tv_contact_text"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginLeft="17dp"

+ 1 - 1
student/src/main/res/values/strings.xml

@@ -39,5 +39,5 @@
     <string name="live_snap_up_tip_str">%1$s 正在抢购</string>
     <string name="save_pic_str">保存图片</string>
     <string name="share_tip_str">立即分享</string>
-
+    <string name="custom_service_tip">或通过以下方式联系我们:\n客服电话:%s\n邮箱:%s</string>
 </resources>

+ 3 - 0
teacher/src/main/java/com/cooleshow/teacher/contract/AboutContract.java

@@ -1,5 +1,6 @@
 package com.cooleshow.teacher.contract;
 
+import com.cooleshow.base.bean.ServiceContactBean;
 import com.cooleshow.base.presenter.view.BaseView;
 
 /**
@@ -11,6 +12,8 @@ import com.cooleshow.base.presenter.view.BaseView;
 public interface AboutContract {
     interface AboutView extends BaseView {
 
+        void getCustomerServiceContactSuccess(ServiceContactBean data);
+
     }
     interface Presenter {
     }

+ 4 - 0
teacher/src/main/java/com/cooleshow/teacher/contract/FeedBackContract.java

@@ -1,5 +1,6 @@
 package com.cooleshow.teacher.contract;
 
+import com.cooleshow.base.bean.ServiceContactBean;
 import com.cooleshow.base.presenter.view.BaseView;
 
 /**
@@ -11,6 +12,9 @@ import com.cooleshow.base.presenter.view.BaseView;
 public interface FeedBackContract {
     interface FeedBackView extends BaseView {
         void addSuggestionSuccess(Object object);
+
+        void getCustomerServiceContactSuccess(ServiceContactBean data);
+
     }
     interface Presenter {
     }

+ 13 - 1
teacher/src/main/java/com/cooleshow/teacher/presenter/mine/AboutPresenter.java

@@ -1,6 +1,9 @@
 package com.cooleshow.teacher.presenter.mine;
 
+import com.cooleshow.base.bean.ServiceContactBean;
+import com.cooleshow.base.data.api.UploadApi;
 import com.cooleshow.base.presenter.BasePresenter;
+import com.cooleshow.base.rx.BaseObserver;
 import com.cooleshow.teacher.contract.AboutContract;
 
 /**
@@ -10,5 +13,14 @@ import com.cooleshow.teacher.contract.AboutContract;
  * 类说明:
  */
 public class AboutPresenter extends BasePresenter<AboutContract.AboutView> implements AboutContract.Presenter {
-
+    public void getCustomerServiceContact() {
+        addSubscribe(create(UploadApi.class).getCustomerServiceContact(), new BaseObserver<ServiceContactBean>(getView()) {
+            @Override
+            protected void onSuccess(ServiceContactBean data) {
+                if (getView() != null) {
+                    getView().getCustomerServiceContactSuccess(data);
+                }
+            }
+        });
+    }
 }

+ 13 - 0
teacher/src/main/java/com/cooleshow/teacher/presenter/mine/FeedBackPresenter.java

@@ -1,5 +1,7 @@
 package com.cooleshow.teacher.presenter.mine;
 
+import com.cooleshow.base.bean.ServiceContactBean;
+import com.cooleshow.base.data.api.UploadApi;
 import com.cooleshow.base.data.net.ApiException;
 import com.cooleshow.base.presenter.BasePresenter;
 import com.cooleshow.base.rx.BaseObserver;
@@ -48,4 +50,15 @@ public class FeedBackPresenter extends BasePresenter<FeedBackContract.FeedBackVi
         });
     }
 
+
+    public void getCustomerServiceContact() {
+        addSubscribe(create(UploadApi.class).getCustomerServiceContact(), new BaseObserver<ServiceContactBean>(getView()) {
+            @Override
+            protected void onSuccess(ServiceContactBean data) {
+                if (getView() != null) {
+                    getView().getCustomerServiceContactSuccess(data);
+                }
+            }
+        });
+    }
 }

+ 18 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/mine/AboutActivity.java

@@ -4,6 +4,7 @@ import android.os.Bundle;
 import android.view.View;
 
 import com.alibaba.android.arouter.facade.annotation.Route;
+import com.cooleshow.base.bean.ServiceContactBean;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.AppUtils;
@@ -41,13 +42,29 @@ public class AboutActivity extends BaseMVPActivity<ActivityAboutBinding, AboutPr
     }
 
     @Override
+    protected void onResume() {
+        super.onResume();
+        presenter.getCustomerServiceContact();
+    }
+
+    @Override
     protected ActivityAboutBinding getLayoutView() {
         return ActivityAboutBinding.inflate(getLayoutInflater());
-
     }
 
     @Override
     protected AboutPresenter createPresenter() {
         return new AboutPresenter();
     }
+
+    @Override
+    public void getCustomerServiceContactSuccess(ServiceContactBean data) {
+        if(!checkActivityExist()){
+            return;
+        }
+        if (data != null) {
+            viewBinding.tvConnectNum.setText(data.getPhone());
+            viewBinding.tvEmail.setText(data.getEmail());
+        }
+    }
 }

+ 20 - 2
teacher/src/main/java/com/cooleshow/teacher/ui/mine/FeedBackActivity.java

@@ -7,6 +7,7 @@ import android.view.View;
 import androidx.annotation.Nullable;
 
 import com.alibaba.android.arouter.facade.annotation.Route;
+import com.cooleshow.base.bean.ServiceContactBean;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.ToastUtil;
@@ -34,10 +35,10 @@ import io.rong.imkit.utils.StatusBarUtil;
 public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackBinding, FeedBackPresenter> implements FeedBackContract.FeedBackView, View.OnClickListener {
     @Override
     public void onClick(View view) {
-        switch (view.getId()){
+        switch (view.getId()) {
             case R.id.tv_submit:
                 String content = viewBinding.etContent.getText().toString().trim();
-                if (TextUtils.isEmpty(content)){
+                if (TextUtils.isEmpty(content)) {
                     ToastUtil.getInstance().showShort("请输入您的反馈意见");
                     break;
                 }
@@ -53,6 +54,7 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackBinding, F
                 break;
         }
     }
+
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -66,6 +68,12 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackBinding, F
     }
 
     @Override
+    protected void onResume() {
+        super.onResume();
+        presenter.getCustomerServiceContact();
+    }
+
+    @Override
     protected ActivityFeedbackBinding getLayoutView() {
         return ActivityFeedbackBinding.inflate(getLayoutInflater());
     }
@@ -80,4 +88,14 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackBinding, F
         ToastUtil.getInstance().showShort("提交成功");
         finish();
     }
+
+    @Override
+    public void getCustomerServiceContactSuccess(ServiceContactBean data) {
+        if (!checkActivityExist()) {
+            return;
+        }
+        if (data != null) {
+            viewBinding.tvContactText.setText(getString(R.string.custom_service_tip, data.getPhone(), data.getEmail()));
+        }
+    }
 }

+ 1 - 0
teacher/src/main/res/layout/activity_feedback.xml

@@ -57,6 +57,7 @@
         android:textSize="@dimen/sp_16" />
 
     <TextView
+        android:id="@+id/tv_contact_text"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginLeft="17dp"

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

@@ -49,4 +49,6 @@
     <string name="search">搜索</string>
     <string name="no_bind_bank_card_tip">未绑定</string>
     <string name="home_page_empty_tip">还没有内容,请「编辑」</string>
+    <string name="custom_service_tip">或通过以下方式联系我们:\n客服电话:%s\n邮箱:%s</string>
+
 </resources>