liujiangyao лет назад: 8
Родитель
Сommit
054021bb33

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -294,6 +294,7 @@
         <activity android:name="com.sheep.gamegroup.view.activity.TaskDetailAddQQAct" android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActWeb" android:screenOrientation="portrait"/>
         <activity android:name="com.sheep.gamegroup.view.activity.ActMyMoney" android:screenOrientation="portrait"/>
+        <activity android:name="com.sheep.gamegroup.view.activity.FeedbackAct" android:screenOrientation="portrait"/>
         <!--友盟start-->
 
 

+ 3 - 0
app/src/main/java/com/kfzs/duanduan/fragment/FgtPersonalCenter.java

@@ -105,6 +105,9 @@ public class FgtPersonalCenter extends BaseCompatFragment {
                                         "关于我们"));
                 break;
             case R.id.feedbook_layout://意见反馈
+                Jump2View.getInstance()
+                        .goFeedbackAct(
+                                getActivity());
                 break;
             case R.id.recommend_friend_layout://推荐给好友
                 break;

+ 10 - 0
app/src/main/java/com/kfzs/duanduan/fragment/FgtSmallSheep.java

@@ -667,6 +667,16 @@ public class FgtSmallSheep extends BaseCompatFragment implements SmallSheepContr
     }
 
     @Override
+    public void successhomeList(BaseMessage baseMessage) {
+
+    }
+
+    @Override
+    public void failhomeList(BaseMessage baseMessage) {
+
+    }
+
+    @Override
     public void onResume() {
         super.onResume();
         if (pagePresenter != null) {

+ 5 - 4
app/src/main/java/com/kfzs/duanduan/react/MainTab.java

@@ -5,6 +5,7 @@ import android.support.v4.app.Fragment;
 import com.kfzs.duanduan.ActMain;
 import com.kfzs.duanduan.fragment.FgtMainCategory;
 import com.kfzs.duanduan.fragment.FgtMainGame;
+import com.kfzs.duanduan.fragment.FgtPersonalCenter;
 import com.kfzs.duanduan.fragment.FgtSmallSheep;
 import com.sheep.jiuyan.samllsheep.R;
 
@@ -24,7 +25,7 @@ public enum MainTab {
             return R.drawable.drawable_selector_task;
         }
     },
-    FgtMainGame(R.string.tab_viewpager_gamestore) {
+    /*FgtMainGame(R.string.tab_viewpager_gamestore) {
         @Override
         public Fragment getFragment() {
             return new FgtMainGame();
@@ -45,18 +46,18 @@ public enum MainTab {
         public int getDrawableId() {
             return R.drawable.drawable_selector_class;
         }
-    }/*,
+    },*/
     FgtPersonnalCenter(R.string.personal_center) {
         @Override
         public Fragment getFragment() {
-            return new FgtMainCategory();
+            return new FgtPersonalCenter();
         }
 
         @Override
         public int getDrawableId() {
             return R.drawable.drawable_selector_class;
         }
-    }*/
+    }
 //    ,
     //    Bp(R.string.tab_viewpager_borrowplay) {
 //        @Override

+ 12 - 0
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -346,4 +346,16 @@ public interface ApiService {
      */
     @GET("app/about_us")
     Observable<BaseMessage> aboutUs();
+
+    /**
+     * 首页list
+     */
+    @GET("app/home_list")
+    Observable<BaseMessage> homeList();
+
+    /**
+     * 关于我们
+     */
+    @POST("app/feedback")
+    Observable<BaseMessage> feedback(@Body JSONObject jsonObject);
 }

+ 33 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/FeedbackEntity.java

@@ -0,0 +1,33 @@
+package com.sheep.gamegroup.model.entity;
+
+/**
+ * 意见反馈
+ * Created by ljy on 2018/5/10.
+ */
+
+public class FeedbackEntity {
+    private String Email;//      string `orm:"column(email);size(255);null" description:"邮箱"`
+    private String Content;//   string `orm:"column(content);size(1024);null" description:"反馈的内容"`
+
+    public FeedbackEntity(String email, String content) {
+        Email = email;
+        Content = content;
+    }
+
+    public String getEmail() {
+
+        return Email;
+    }
+
+    public void setEmail(String email) {
+        Email = email;
+    }
+
+    public String getContent() {
+        return Content;
+    }
+
+    public void setContent(String content) {
+        Content = content;
+    }
+}

+ 4 - 0
app/src/main/java/com/sheep/gamegroup/presenter/SmallSheepContract.java

@@ -18,6 +18,8 @@ public interface SmallSheepContract {
 
         void  getAwardDetail();
 
+        void  homeList();
+
         void  slideshow(Object o);
         void  bulletin(Object o);
     }
@@ -33,6 +35,8 @@ public interface SmallSheepContract {
         void failbulletin(BaseMessage baseMessage);
         void successbulletin(BaseMessage baseMessage);
 
+        void successhomeList(BaseMessage baseMessage);
+        void failhomeList(BaseMessage baseMessage);
 
     }
 }

+ 18 - 0
app/src/main/java/com/sheep/gamegroup/presenter/SmallSheepPresenter.java

@@ -82,6 +82,24 @@ public class SmallSheepPresenter implements SmallSheepContract.Persenter {
     }
 
     @Override
+    public void homeList() {
+        apiService.homeList()
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        view.failhomeList(baseMessage);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        view.successhomeList(baseMessage);
+                    }
+                });
+    }
+
+    @Override
     public void slideshow(Object o) {
         apiService.slideshow(1)
                 .subscribeOn(Schedulers.io())

+ 10 - 0
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -43,6 +43,7 @@ import com.sheep.gamegroup.view.activity.CommitWxAct;
 import com.sheep.gamegroup.view.activity.CommitWxCodeAct;
 import com.sheep.gamegroup.view.activity.DialogActivity;
 import com.sheep.gamegroup.view.activity.DialogToastAct;
+import com.sheep.gamegroup.view.activity.FeedbackAct;
 import com.sheep.gamegroup.view.activity.LieMakeMoneyAct;
 import com.sheep.gamegroup.view.activity.LoginAct;
 import com.sheep.gamegroup.view.activity.MiddleAct;
@@ -709,4 +710,13 @@ public class Jump2View {
         intent.putExtra("time", time);
         context.startActivity(intent);
     }
+
+    /**
+     * 意见反馈
+     * @param context
+     */
+    public void goFeedbackAct(Context context) {
+        Intent intent = new Intent(context, FeedbackAct.class);
+        context.startActivity(intent);
+    }
 }

+ 94 - 0
app/src/main/java/com/sheep/gamegroup/view/activity/FeedbackAct.java

@@ -0,0 +1,94 @@
+package com.sheep.gamegroup.view.activity;
+
+import android.os.Bundle;
+import android.support.design.widget.TextInputEditText;
+
+import com.alibaba.fastjson.JSONObject;
+import com.googlecode.protobuf.format.util.TextUtils;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+import rx.android.schedulers.AndroidSchedulers;
+import rx.schedulers.Schedulers;
+
+/**
+ * 意见反馈
+ * Created by ljy on 2018/5/10.
+ */
+
+public class FeedbackAct extends BaseActivity {
+    @BindView(R.id.feedbook_et)
+    TextInputEditText feedbookEt;
+    @BindView(R.id.feedbook_email_et)
+    TextInputEditText feedbookEmailEt;
+
+    private String Content;
+    private String Email;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.act_feedback_layout;
+    }
+
+    @Override
+    public void initView() {
+
+        TitleBarUtils.getInstance()
+                .setTitle(this, "意见反馈")
+                .setTitleFinish(this);
+    }
+
+    @Override
+    public void initListener() {
+
+    }
+
+    @Override
+    public void initData() {
+
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        // TODO: add setContentView(...) invocation
+        ButterKnife.bind(this);
+    }
+
+    @OnClick(R.id.tv_submit)
+    public void onViewClicked() {
+        if(android.text.TextUtils.isEmpty(Content)){
+            G.showToast(getResources().getString(R.string.feedback_notice_input_advice));
+            return;
+        }
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("Content", Content);
+        jsonObject.put("Email", Email+"");
+        SheepApp.get(this)
+                .getNetComponent()
+                .getApiService()
+                .feedback(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(this) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        G.showToast(baseMessage.getMsg() +"");
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        G.showToast(baseMessage.getMsg() +"");
+                        finish();
+                    }
+                });
+    }
+}

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/WebviewAct.java

@@ -120,8 +120,8 @@ public class WebviewAct extends BaseActivity {
                         .getNetComponent()
                         .getApiService()
                         .aboutUs()
-                        .observeOn(Schedulers.io())
-                        .subscribeOn(AndroidSchedulers.mainThread())
+                        .subscribeOn(Schedulers.io())
+                        .observeOn(AndroidSchedulers.mainThread())
                         .subscribe(new SheepSubscriber<BaseMessage>(this) {
                             @Override
                             public void onError(BaseMessage baseMessage) {

+ 101 - 0
app/src/main/res/layout/act_feedback_layout.xml

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:background="@color/bg_gray">
+
+    <include
+        layout="@layout/title"/>
+
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:scrollbars="none">
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:padding="@dimen/common_margin_10">
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@drawable/x_shap_shadow_bg_rectgangle_white"
+                android:padding="@dimen/common_margin_10">
+                <TextView
+                    android:id="@+id/feedbook_notice_top_tv"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:text="@string/feedback_notice_hellow"
+                    style="@style/txt_style_15_black"/>
+                <TextView
+                    android:id="@+id/feedbook_notice_end_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/feedback_notice_end"
+                    style="@style/txt_style_15_black"
+                    android:layout_below="@+id/feedbook_notice_top_tv"
+                    android:layout_alignParentRight="true"
+                    android:layout_marginTop="@dimen/content_padding_15"/>
+
+                <android.support.design.widget.TextInputEditText
+                    android:id="@+id/feedbook_et"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:minHeight="@dimen/view_size_130"
+                    android:cursorVisible="false"
+                    android:layout_below="@+id/feedbook_notice_end_tv"
+                    android:layout_marginTop="@dimen/content_padding"
+                    android:hint="@string/feedback_notice_input_advice"
+                    android:gravity="top"
+                    android:text=""
+                    style="@style/edt_style"
+                    android:layout_marginBottom="@dimen/content_padding_20"/>
+                <LinearLayout
+                    android:id="@+id/feedbook_email_layout"
+                    android:layout_below="@+id/feedbook_et"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:gravity="center_vertical">
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        style="@style/txt_style_15_black"
+                        android:text="@string/contact_qq_email"
+                        android:layout_gravity="center_vertical"/>
+
+                    <android.support.design.widget.TextInputEditText
+                        android:id="@+id/feedbook_email_et"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:cursorVisible="false"
+                        android:hint="@string/feedback_notice_input_email_address"
+                        android:gravity="top"
+                        android:text=""
+                        android:lines="2"
+                        android:inputType="textEmailAddress"
+                        style="@style/edt_style"
+                        android:layout_gravity="center_vertical"/>
+                </LinearLayout>
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    style="@style/nomal_txt_style"
+                    android:text="@string/input_notice_feedback"
+                    android:layout_below="@+id/feedbook_email_layout"
+                    android:layout_marginBottom="@dimen/content_padding_10"
+                    android:layout_marginTop="@dimen/content_padding_10"/>
+            </RelativeLayout>
+            <TextView
+                android:id="@+id/tv_submit"
+                style="@style/style_button_no_margin"
+                android:layout_marginTop="@dimen/view_size_30"
+                android:text="提交建议" />
+
+        </LinearLayout>
+    </ScrollView>
+
+</LinearLayout>

+ 8 - 0
app/src/main/res/values/dd_styles.xml

@@ -31,6 +31,14 @@
         <item name="android:layout_margin">@dimen/content_padding_15</item>
         <item name="android:textSize">@dimen/text_size_15</item>
     </style>
+    <style name="style_button_no_margin" parent="button">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">40dp</item>
+        <item name="android:gravity">center</item>
+        <item name="android:background">@drawable/selector_button_full_main</item>
+        <item name="android:textColor">@color/btn_color_main</item>
+        <item name="android:textSize">@dimen/text_size_15</item>
+    </style>
     <style name="style_button_small" parent="button">
         <item name="android:layout_width">70dp</item>
         <item name="android:layout_height">30dp</item>

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

@@ -19,4 +19,11 @@
     <string name="agent_extract">代理提成:%s元</string>
     <string name="recharge_amount">充值金额:%s元</string>
     <string name="available_amount">可提现金额:%s元</string>
+
+    <string name="feedback_notice_hellow">致亲爱的您,\n &#160;&#160;&#160;&#160;&#160;我们会重视您提出的每一个建议。您的批评与意见是我们产品前进的动力,感谢您对小绵羊APP的支持!</string>
+    <string name="feedback_notice_end">小绵羊项目组全体人员</string>
+    <string name="feedback_notice_input_advice">请输入您的建议...</string>
+    <string name="feedback_notice_input_email_address">请输入您的邮箱地址</string>
+    <string name="contact_qq_email">联系QQ/邮箱</string>
+    <string name="input_notice_feedback">请留下您的联系方式,我们会不定期地给予优质建议提供丰厚奖励哦!</string>
 </resources>