Junqin Wang %!s(int64=8) %!d(string=hai) anos
pai
achega
046149afe1
Modificáronse 60 ficheiros con 1254 adicións e 184 borrados
  1. 6 0
      app/AndroidManifest.xml
  2. 9 3
      app/app.iml
  3. 1 9
      app/build.gradle
  4. BIN=BIN
      app/res/drawable-hdpi/ico_pay_method_alipay.png
  5. BIN=BIN
      app/res/drawable-hdpi/ico_pay_method_wechat.png
  6. BIN=BIN
      app/res/drawable-hdpi/ico_recharge_checked.png
  7. BIN=BIN
      app/res/drawable-hdpi/ico_recharge_unchecked.png
  8. BIN=BIN
      app/res/drawable-hdpi/ico_trade_publish.png
  9. BIN=BIN
      app/res/drawable-mdpi/ico_pay_method_alipay.png
  10. BIN=BIN
      app/res/drawable-mdpi/ico_pay_method_wechat.png
  11. BIN=BIN
      app/res/drawable-mdpi/ico_recharge_checked.png
  12. BIN=BIN
      app/res/drawable-mdpi/ico_recharge_unchecked.png
  13. BIN=BIN
      app/res/drawable-mdpi/ico_trade_publish.png
  14. BIN=BIN
      app/res/drawable-xhdpi/ico_pay_method_alipay.png
  15. BIN=BIN
      app/res/drawable-xhdpi/ico_pay_method_wechat.png
  16. BIN=BIN
      app/res/drawable-xhdpi/ico_recharge_checked.png
  17. BIN=BIN
      app/res/drawable-xhdpi/ico_recharge_unchecked.png
  18. BIN=BIN
      app/res/drawable-xhdpi/ico_trade_publish.png
  19. BIN=BIN
      app/res/drawable-xxhdpi/ico_pay_method_alipay.png
  20. BIN=BIN
      app/res/drawable-xxhdpi/ico_pay_method_wechat.png
  21. BIN=BIN
      app/res/drawable-xxhdpi/ico_recharge_checked.png
  22. BIN=BIN
      app/res/drawable-xxhdpi/ico_recharge_unchecked.png
  23. BIN=BIN
      app/res/drawable-xxhdpi/ico_trade_publish.png
  24. BIN=BIN
      app/res/drawable-xxxhdpi/ico_pay_method_alipay.png
  25. BIN=BIN
      app/res/drawable-xxxhdpi/ico_pay_method_wechat.png
  26. BIN=BIN
      app/res/drawable-xxxhdpi/ico_recharge_checked.png
  27. BIN=BIN
      app/res/drawable-xxxhdpi/ico_recharge_unchecked.png
  28. BIN=BIN
      app/res/drawable-xxxhdpi/ico_trade_publish.png
  29. 9 0
      app/res/drawable/selector_radiobutton_recharge_style.xml
  30. 3 1
      app/res/layout/friends_phone_contacts.xml
  31. 29 1
      app/res/layout/mine_about_webview_activity.xml
  32. 22 7
      app/res/layout/mine_complaint_activity.xml
  33. 38 0
      app/res/layout/mine_feedback_activity.xml
  34. 49 0
      app/res/layout/trade_pay_method_activity.xml
  35. 137 0
      app/res/layout/trade_recharge_activity.xml
  36. 2 0
      app/src/com/sheishuo/app/common/util/net/INet.java
  37. 59 0
      app/src/com/sheishuo/app/common/util/net/NetImpl.java
  38. 2 1
      app/src/com/sheishuo/app/common/util/net/NetInfo.java
  39. 1 0
      app/src/com/sheishuo/app/common/util/pay/PayResult.java
  40. 74 0
      app/src/com/sheishuo/app/common/util/pay/PayUtil.java
  41. 10 0
      app/src/com/sheishuo/app/common/util/pay/PaymentListener.java
  42. 75 0
      app/src/com/sheishuo/app/common/util/pay/UnityTool.java
  43. 36 2
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/AboutWebViewActivity.java
  44. 43 4
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/ComplaintActivity.java
  45. 58 0
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/FeedbackActivity.java
  46. 137 81
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/PersonalSettingsActivity.java
  47. 7 0
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/SettingsActivity.java
  48. 9 2
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/UserInfoDetailActivity.java
  49. 127 15
      app/src/com/sheishuo/app/core_module/sheishuo/view/ui/TeamSettingsActivity.java
  50. 87 0
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/PayMethodActivity.java
  51. 78 0
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/RechargeActivity.java
  52. 57 17
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradePublishActivity.java
  53. 6 0
      app/src/com/sheishuo/app/main/activity/MainActivity.java
  54. 8 0
      app/src/com/sheishuo/app/main/fragment/HomeFragment.java
  55. 22 5
      app/src/com/sheishuo/app/main/fragment/SessionListFragment.java
  56. 2 2
      uikit/res/drawable/nim_recent_contact_sticky_selecter.xml
  57. 10 3
      uikit/res/drawable/rechage_button_selector.xml
  58. 30 29
      uikit/res/layout/gift_panel.xml
  59. 11 0
      uikit/src/com/netease/nim/uikit/recent/RecentContactsFragment.java
  60. 0 2
      uikit/uikit.iml

+ 6 - 0
app/AndroidManifest.xml

@@ -171,6 +171,8 @@
             android:theme="@style/AppTheme.NoActionBar"/>
         <activity android:name=".core_module.mine.view.ui.activity.ComplaintActivity"
             android:theme="@style/AppTheme.NoActionBar"/>
+        <activity android:name=".core_module.mine.view.ui.activity.FeedbackActivity"
+            android:theme="@style/AppTheme.NoActionBar"/>
 
         <!--交易帖相关Activity-->
         <activity android:name=".core_module.trade.view.ui.activity.TradeChangePriorityActivity"
@@ -181,6 +183,10 @@
             android:theme="@style/AppTheme.NoActionBar.Translucent"/>
         <activity android:name=".core_module.trade.view.ui.activity.TradeDetailsActivity"
             android:theme="@style/AppTheme.NoActionBar"/>
+        <activity android:name=".core_module.trade.view.ui.activity.RechargeActivity"
+            android:theme="@style/AppTheme.NoActionBar"/>
+        <activity android:name=".core_module.trade.view.ui.activity.PayMethodActivity"
+            android:theme="@style/AppTheme.NoActionBar"/>
 
         <!--联系人界面-->
         <activity android:name=".core_module.friends.activity.ContactsListActivity"

+ 9 - 3
app/app.iml

@@ -74,8 +74,6 @@
       <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
       <excludeFolder url="file://$MODULE_DIR$/build/.DS_Store" />
-      <excludeFolder url="file://$MODULE_DIR$/build/freeline" />
-      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/.DS_Store" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
@@ -93,7 +91,6 @@
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
-      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res.job" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
@@ -125,6 +122,7 @@
     <orderEntry type="library" exported="" scope="TEST" name="multidex-instrumentation-1.0.1" level="project" />
     <orderEntry type="library" exported="" name="reactive-streams-1.0.0" level="project" />
     <orderEntry type="library" exported="" name="nrtc-sdk" level="project" />
+    <orderEntry type="library" exported="" name="alipaySdk-20170710" level="project" />
     <orderEntry type="library" exported="" name="adapter-rxjava2-2.3.0" level="project" />
     <orderEntry type="library" exported="" name="okio-1.13.0" level="project" />
     <orderEntry type="library" exported="" name="retrofit-2.3.0" level="project" />
@@ -146,5 +144,13 @@
     <orderEntry type="library" exported="" name="support-compat-25.3.1" level="project" />
     <orderEntry type="library" exported="" name="animated-vector-drawable-25.3.1" level="project" />
     <orderEntry type="module" module-name="uikit" exported="" />
+    <orderEntry type="library" exported="" name="java-json" level="project" />
+    <orderEntry type="library" exported="" name="renderscript-v8" level="project" />
+    <orderEntry type="library" exported="" name="glide-3.7.0" level="project" />
+    <orderEntry type="library" exported="" name="nim-avchat-4.0.0" level="project" />
+    <orderEntry type="library" exported="" name="constraint-layout-solver-1.0.2" level="project" />
+    <orderEntry type="library" exported="" name="nim-basesdk-4.0.0" level="project" />
+    <orderEntry type="library" exported="" name="fastjson-1.1.34.android" level="project" />
+    <orderEntry type="library" exported="" name="nim-lucene-4.0.0" level="project" />
   </component>
 </module>

+ 1 - 9
app/build.gradle

@@ -105,8 +105,6 @@ dependencies {
     compile 'com.netease.nimlib:jsbridge:1.3.1'
     compile 'com.android.support:multidex:1.0.1'
     compile 'com.android.support:support-annotations:25.3.1'
-
-
     //RxJava 2 & RxAndroid
     compile 'io.reactivex.rxjava2:rxjava:2.1.1'
     compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
@@ -117,13 +115,7 @@ dependencies {
     compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
     compile 'com.squareup.retrofit2:converter-gson:2.3.0'
     //debugCompile project(':plugins:sf')
-
-
     //CardView
     compile 'com.android.support:cardview-v7:25.1.1'
-
-
-
-
-
+    compile files('libs/alipaySdk-20170710.jar')
 }

BIN=BIN
app/res/drawable-hdpi/ico_pay_method_alipay.png


BIN=BIN
app/res/drawable-hdpi/ico_pay_method_wechat.png


BIN=BIN
app/res/drawable-hdpi/ico_recharge_checked.png


BIN=BIN
app/res/drawable-hdpi/ico_recharge_unchecked.png


BIN=BIN
app/res/drawable-hdpi/ico_trade_publish.png


BIN=BIN
app/res/drawable-mdpi/ico_pay_method_alipay.png


BIN=BIN
app/res/drawable-mdpi/ico_pay_method_wechat.png


BIN=BIN
app/res/drawable-mdpi/ico_recharge_checked.png


BIN=BIN
app/res/drawable-mdpi/ico_recharge_unchecked.png


BIN=BIN
app/res/drawable-mdpi/ico_trade_publish.png


BIN=BIN
app/res/drawable-xhdpi/ico_pay_method_alipay.png


BIN=BIN
app/res/drawable-xhdpi/ico_pay_method_wechat.png


BIN=BIN
app/res/drawable-xhdpi/ico_recharge_checked.png


BIN=BIN
app/res/drawable-xhdpi/ico_recharge_unchecked.png


BIN=BIN
app/res/drawable-xhdpi/ico_trade_publish.png


BIN=BIN
app/res/drawable-xxhdpi/ico_pay_method_alipay.png


BIN=BIN
app/res/drawable-xxhdpi/ico_pay_method_wechat.png


BIN=BIN
app/res/drawable-xxhdpi/ico_recharge_checked.png


BIN=BIN
app/res/drawable-xxhdpi/ico_recharge_unchecked.png


BIN=BIN
app/res/drawable-xxhdpi/ico_trade_publish.png


BIN=BIN
app/res/drawable-xxxhdpi/ico_pay_method_alipay.png


BIN=BIN
app/res/drawable-xxxhdpi/ico_pay_method_wechat.png


BIN=BIN
app/res/drawable-xxxhdpi/ico_recharge_checked.png


BIN=BIN
app/res/drawable-xxxhdpi/ico_recharge_unchecked.png


BIN=BIN
app/res/drawable-xxxhdpi/ico_trade_publish.png


+ 9 - 0
app/res/drawable/selector_radiobutton_recharge_style.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:state_checked="false"
+        android:drawable="@drawable/ico_recharge_unchecked"/>
+
+    <item android:state_checked="true"
+        android:drawable="@drawable/ico_recharge_checked"/>
+</selector>

+ 3 - 1
app/res/layout/friends_phone_contacts.xml

@@ -27,7 +27,9 @@
             android:hint="搜索用户名或ID"
             android:textColorHint="@color/grey_light_light"
             android:gravity="center"
-            android:padding="4dp"/>
+            android:padding="4dp"
+            android:maxLines="1"
+            android:singleLine="true"/>
     </LinearLayout>
 
     <android.support.v7.widget.RecyclerView

+ 29 - 1
app/res/layout/mine_about_webview_activity.xml

@@ -19,5 +19,33 @@
     <WebView
         android:id="@+id/mine_about_webview"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"/>
+        android:layout_height="wrap_content"
+        android:layout_weight="9"/>
+
+    <LinearLayout
+        android:id="@+id/mine_about_webview_agreement_layout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:visibility="gone">
+        <Button
+            android:id="@+id/mine_about_webview_agree"
+            android:layout_weight="1"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:text="同意"
+            android:textColor="@color/white"
+            android:background="@drawable/btn1_selector"
+            android:layout_margin="8dp"/>
+        <Button
+            android:id="@+id/mine_about_webview_reject"
+            android:layout_weight="1"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:text="拒绝"
+            android:textColor="@color/white"
+            android:background="@drawable/btn1_selector"
+            android:layout_margin="8dp"/>
+    </LinearLayout>
+
 </LinearLayout>

+ 22 - 7
app/res/layout/mine_complaint_activity.xml

@@ -60,13 +60,28 @@
                     android:padding="16dp"/>
         </RadioGroup>
 
-        <Button
-            android:id="@+id/mine_complaint_submit_btn"
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/mine_complaint_reason_layout"
+        android:layout_width="match_parent"
+        android:layout_height="150dp"
+        android:visibility="gone">
+        <EditText
+            android:id="@+id/mine_complaint_reason_ET"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:background="@drawable/btn1_selector"
-            android:text="下一步"
-            android:textColor="@color/white"
-            android:layout_margin="16dp"/>
+            android:layout_height="match_parent"
+            android:hint="请输入投诉理由"
+            android:textColorHint="@color/grey_light"
+            android:gravity="start"/>
     </LinearLayout>
+    <Button
+        android:id="@+id/mine_complaint_submit_btn"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/btn1_selector"
+        android:text="下一步"
+        android:textColor="@color/white"
+        android:layout_margin="16dp"/>
 </LinearLayout>

+ 38 - 0
app/res/layout/mine_feedback_activity.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <android.support.design.widget.AppBarLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <com.sheishuo.app.common.views.BaseToolbar
+            android:id="@+id/toolbar"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            app:title="帮助与反馈"
+            app:left_text="返回"/>
+    </android.support.design.widget.AppBarLayout>
+
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:padding="16dp"
+        android:orientation="vertical">
+        <EditText
+            android:id="@+id/mine_feedback_ET"
+            android:layout_width="match_parent"
+            android:layout_height="300dp" />
+
+        <Button
+            android:id="@+id/mine_feedback_submit_btn"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/btn1_selector"
+            android:text="提交"
+            android:textColor="@color/white"/>
+    </LinearLayout>
+</LinearLayout>

+ 49 - 0
app/res/layout/trade_pay_method_activity.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <android.support.design.widget.AppBarLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <com.sheishuo.app.common.views.BaseToolbar
+            android:id="@+id/toolbar"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            app:title="支付方式" />
+    </android.support.design.widget.AppBarLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:gravity="center">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:orientation="horizontal">
+
+            <ImageView
+                android:id="@+id/trade_pay_method_wechat_img"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="32dp"
+                android:layout_marginRight="32dp"
+                android:src="@drawable/ico_pay_method_wechat" />
+
+            <ImageView
+                android:id="@+id/trade_pay_method_alipay_img"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="32dp"
+                android:layout_marginStart="32dp"
+                android:src="@drawable/ico_pay_method_alipay" />
+
+        </LinearLayout>
+    </LinearLayout>
+</LinearLayout>

+ 137 - 0
app/res/layout/trade_recharge_activity.xml

@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <android.support.v7.widget.Toolbar
+        android:id="@+id/toolbar"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/action_bar_height"
+        android:background="@color/colorPrimary"
+        app:title="充值"
+        app:titleTextColor="@color/GreyWhite" />
+
+
+    <com.netease.nim.uikit.views.MutipleRadioGroup
+        android:id="@+id/trade_recharge_radiogroup"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical">
+
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:orientation="horizontal">
+
+            <RadioButton
+                android:id="@+id/trade_recharge_rd1"
+                android:layout_width="0dp"
+                android:layout_height="64dp"
+                android:layout_margin="16dp"
+                android:layout_weight="1"
+                android:background="@drawable/selector_radiobutton_recharge_style"
+                android:button="@null"
+                android:gravity="center"
+                android:text="20元"
+                android:textSize="27sp" />
+
+            <RadioButton
+                android:id="@+id/trade_recharge_rd2"
+                android:layout_width="0dp"
+                android:layout_height="64dp"
+                android:layout_margin="16dp"
+                android:layout_weight="1"
+                android:background="@drawable/selector_radiobutton_recharge_style"
+                android:button="@null"
+                android:gravity="center"
+                android:text="30元"
+                android:textSize="27sp" />
+
+            <RadioButton
+                android:id="@+id/trade_recharge_rd3"
+                android:layout_width="0dp"
+                android:layout_height="64dp"
+                android:layout_margin="16dp"
+                android:layout_weight="1"
+                android:background="@drawable/selector_radiobutton_recharge_style"
+                android:button="@null"
+                android:gravity="center"
+                android:text="50元"
+                android:textSize="27sp" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:orientation="horizontal">
+
+            <RadioButton
+                android:id="@+id/trade_recharge_rd4"
+                android:layout_width="0dp"
+                android:layout_height="64dp"
+                android:layout_margin="16dp"
+                android:layout_weight="1"
+                android:background="@drawable/selector_radiobutton_recharge_style"
+                android:button="@null"
+                android:gravity="center"
+                android:text="100元"
+                android:textSize="27sp" />
+
+            <RadioButton
+                android:id="@+id/trade_recharge_rd5"
+                android:layout_width="0dp"
+                android:layout_height="64dp"
+                android:layout_margin="16dp"
+                android:layout_weight="1"
+                android:background="@drawable/selector_radiobutton_recharge_style"
+                android:button="@null"
+                android:gravity="center"
+                android:text="200元"
+                android:textSize="27sp" />
+
+            <RadioButton
+                android:id="@+id/trade_recharge_rd6"
+                android:layout_width="0dp"
+                android:layout_height="64dp"
+                android:layout_margin="16dp"
+                android:layout_weight="1"
+                android:background="@drawable/selector_radiobutton_recharge_style"
+                android:button="@null"
+                android:gravity="center"
+                android:text="300元"
+                android:textSize="27sp" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <RadioButton
+                android:id="@+id/trade_recharge_rd7"
+                android:layout_width="96dp"
+                android:layout_height="64dp"
+                android:layout_margin="16dp"
+                android:background="@drawable/selector_radiobutton_recharge_style"
+                android:button="@null"
+                android:gravity="center"
+                android:text="其他金额"
+                android:textSize="27sp" />
+        </LinearLayout>
+    </com.netease.nim.uikit.views.MutipleRadioGroup>
+
+
+    <Button
+        android:id="@+id/trade_recharge_btn"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="16dp"
+        android:background="@drawable/btn1_selector"
+        android:text="立刻充值"
+        android:textColor="@color/GreyWhite" />
+
+</LinearLayout>

+ 2 - 0
app/src/com/sheishuo/app/common/util/net/INet.java

@@ -41,4 +41,6 @@ public interface INet {
     void updateSocialInfo(SocialInfoBean bean,ResponseCallback callback);
     void getHobbyList(ResponseCallback callback);
     void sendInviteMsg(String phoneNum);
+    void submitComplaint(String targetId,String type,String reason);
+    void alipay(String money,ResponseCallback callback);
 }

+ 59 - 0
app/src/com/sheishuo/app/common/util/net/NetImpl.java

@@ -1007,5 +1007,64 @@ public class NetImpl implements INet {
         }).start();
     }
 
+    @Override
+    public void submitComplaint(final String targetId, final String type, final String reason) {
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                FormBody body = new FormBody.Builder()
+                        .add("user_id",AccountCache.getAccount().getId())
+                        .add("target_id",targetId)
+                        .add("type",type)
+                        .add("msg",reason)
+                        .build();
+
+                Request request = new Request.Builder()
+                        .post(body)
+                        .url(SUBMIT_COMPLAINT)
+                        .build();
+
+                try{
+                    Response response = client.newCall(request).execute();
+                    Log.e("submitComplaint",response.body().string());
+                }catch (Exception e){
+                    e.printStackTrace();
+                }
+            }
+        }).start();
+    }
+
+    @Override
+    public void alipay(final String money, final ResponseCallback callback) {
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try{
+                    FormBody body = new FormBody.Builder()
+                            .add("user_id",AccountCache.getAccount().getId())
+                            .add("money",money)
+                            .build();
+
+                    Request request = new Request.Builder()
+                            .post(body)
+                            .url(ALIPAY_URL)
+                            .build();
+
+                    Response response = client.newCall(request).execute();
+                    if (200 == response.code()){
+                        String resultStr = response.body().string();
+                        callback.onSuccess(resultStr);
+                    }else {
+                        callback.onFailed();
+                    }
+
+                }catch (Exception e){
+                    e.printStackTrace();
+                    callback.onFailed();
+                }
+            }
+        }).start();
+    }
+
 
 }

+ 2 - 1
app/src/com/sheishuo/app/common/util/net/NetInfo.java

@@ -35,7 +35,8 @@ public class NetInfo {
     public final static String UPDATE_SOCIAL_INFO = INDEX + "?m=who&c=social&a=update_info";
     public final static String GET_HOBBY = INDEX + "?m=who&c=index&a=hobby_list";
     public final static String SEND_INVITE_MSG = INDEX + "?m=who&c=index&a=send_msg";
-
+    public final static String SUBMIT_COMPLAINT = INDEX + "?m=who&c=index&a=complain";
+    public final static String ALIPAY_URL = INDEX + "?m=who&c=index&a=alipay_order";
 
 
 

+ 1 - 0
app/src/com/sheishuo/app/common/util/pay/PayResult.java

@@ -0,0 +1 @@
+package com.sheishuo.app.common.util.pay;

import java.util.Map;

import android.text.TextUtils;

public class PayResult {
	private String resultStatus;
	private String result;
	private String memo;

	public PayResult(Map<String, String> rawResult) {
		if (rawResult == null) {
			return;
		}

		for (String key : rawResult.keySet()) {
			if (TextUtils.equals(key, "resultStatus")) {
				resultStatus = rawResult.get(key);
			} else if (TextUtils.equals(key, "result")) {
				result = rawResult.get(key);
			} else if (TextUtils.equals(key, "memo")) {
				memo = rawResult.get(key);
			}
		}
	}

	@Override
	public String toString() {
		return "resultStatus={" + resultStatus + "};memo={" + memo
				+ "};result={" + result + "}";
	}

	/**
	 * @return the resultStatus
	 */
	public String getResultStatus() {
		return resultStatus;
	}

	/**
	 * @return the memo
	 */
	public String getMemo() {
		return memo;
	}

	/**
	 * @return the result
	 */
	public String getResult() {
		return result;
	}
}

+ 74 - 0
app/src/com/sheishuo/app/common/util/pay/PayUtil.java

@@ -0,0 +1,74 @@
+package com.sheishuo.app.common.util.pay;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.os.Handler;
+import android.os.Message;
+
+import com.alipay.sdk.app.PayTask;
+
+import java.util.Map;
+
+/**
+ * Created by KN on 2017/8/31.
+ */
+
+public class PayUtil {
+    private static final int SDK_PAY_FLAG = 1;
+    private static final String RESULT_SUCCESS = "9000";
+    private static final String TIP_PAY_SUCCESS = "支付成功";
+    private static final String TIP_PAY_FAILED = "支付失败";
+    private Context context;
+    private String responseGameObject;
+    private PaymentListener listener;
+
+    public void init(Context context, PaymentListener listener) {
+        this.context = context;
+        this.listener = listener;
+    }
+
+
+    // 支付结果回调,仅作参考,以服务端确认为准!
+    @SuppressLint("HandlerLeak")
+    private Handler mHandler = new Handler() {
+        @SuppressWarnings("unused")
+        public void handleMessage(Message msg) {
+            switch (msg.what) {
+                case SDK_PAY_FLAG: {
+                    @SuppressWarnings("unchecked")
+                    PayResult payResult = new PayResult((Map<String, String>) msg.obj);
+                    String resultInfo = payResult.getResult();
+                    String resultStatus = payResult.getResultStatus();
+                    listener.onPaymentFinish(resultStatus.equals(RESULT_SUCCESS));
+
+                    break;
+                }
+                default:
+                    break;
+            }
+        }
+
+        ;
+    };
+
+
+    // Unity中调用
+    public void pay(final String orderInfo) {
+        Runnable payRunnable = new Runnable() {
+
+            @Override
+            public void run() {
+                PayTask alipay = new PayTask((Activity) context);
+                Map<String, String> result = alipay.payV2(orderInfo, true);
+                Message msg = new Message();
+                msg.what = SDK_PAY_FLAG;
+                msg.obj = result;
+                mHandler.sendMessage(msg);
+            }
+        };
+
+        Thread payThread = new Thread(payRunnable);
+        payThread.start();
+    }
+}

+ 10 - 0
app/src/com/sheishuo/app/common/util/pay/PaymentListener.java

@@ -0,0 +1,10 @@
+package com.sheishuo.app.common.util.pay;
+
+/**
+ * Created by KN on 2017/8/31.
+ */
+
+public interface PaymentListener {
+
+    void onPaymentFinish(Boolean isSuccess);
+}

+ 75 - 0
app/src/com/sheishuo/app/common/util/pay/UnityTool.java

@@ -0,0 +1,75 @@
+package com.sheishuo.app.common.util.pay;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.os.Handler;
+import android.os.Message;
+
+import com.alipay.sdk.app.PayTask;
+
+import java.util.Map;
+
+public class UnityTool
+{
+    private static final int SDK_PAY_FLAG = 1;
+    private static final String RESULT_SUCCESS = "9000";
+    private static final String TIP_PAY_SUCCESS = "支付成功";
+    private static final String TIP_PAY_FAILED = "支付失败";
+    private Context context;
+    private String responseGameObject;
+
+    public void init(Context context){
+        this.context = context;
+    }
+
+
+    // 支付结果回调,仅作参考,以服务端确认为准!
+    @SuppressLint("HandlerLeak")
+    private Handler mHandler = new Handler()
+    {
+        @SuppressWarnings("unused")
+        public void handleMessage(Message msg)
+        {
+            switch (msg.what)
+            {
+                case SDK_PAY_FLAG:
+                {
+                    @SuppressWarnings("unchecked")
+                    PayResult payResult = new PayResult((Map<String, String>) msg.obj);
+                    String resultInfo = payResult.getResult();
+                    String resultStatus = payResult.getResultStatus();
+                    break;
+                }
+                default:
+                    break;
+            }
+        }
+
+        ;
+    };
+
+
+
+    // Unity中调用
+    public void pay(final String orderInfo)
+    {
+        Runnable payRunnable = new Runnable()
+        {
+
+            @Override
+            public void run()
+            {
+                PayTask alipay = new PayTask((Activity) context);
+                Map<String, String> result = alipay.payV2(orderInfo, true);
+                Message msg = new Message();
+                msg.what = SDK_PAY_FLAG;
+                msg.obj = result;
+                mHandler.sendMessage(msg);
+            }
+        };
+
+        Thread payThread = new Thread(payRunnable);
+        payThread.start();
+    }
+}

+ 36 - 2
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/AboutWebViewActivity.java

@@ -1,8 +1,12 @@
 package com.sheishuo.app.core_module.mine.view.ui.activity;
 
+import android.content.Context;
+import android.content.Intent;
 import android.os.Bundle;
 import android.view.View;
 import android.webkit.WebView;
+import android.widget.Button;
+import android.widget.LinearLayout;
 
 import com.sheishuo.app.R;
 import com.sheishuo.app.common.views.BaseToolbar;
@@ -16,14 +20,24 @@ public class AboutWebViewActivity extends SheishuoUI{
 
     public final static String TITLE = "title";
     public final static String URL = "url";
+    public final static String IS_AGREEMENT = "is_agreement";
+
+
+    private String TAG = this.getClass().getSimpleName();
+    private Context context = this;
+
 
     private BaseToolbar toolbar;
 
     private WebView webView;
 
+    private LinearLayout agreementLayout;
+
+    private Button agreeBtn,rejectBtn;
 
     private String title = "";
     private String url = "";
+    private boolean isAgreement = false;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -31,7 +45,7 @@ public class AboutWebViewActivity extends SheishuoUI{
         setContentView(R.layout.mine_about_webview_activity);
         title = getIntent().getStringExtra(TITLE);
         url = getIntent().getStringExtra(URL);
-
+        isAgreement = getIntent().getBooleanExtra(IS_AGREEMENT,false);
         findViews();
         init();
     }
@@ -39,8 +53,10 @@ public class AboutWebViewActivity extends SheishuoUI{
 
     void findViews(){
         toolbar = findView(R.id.toolbar);
-
         webView = findView(R.id.mine_about_webview);
+        agreementLayout = findView(R.id.mine_about_webview_agreement_layout);
+        agreeBtn = findView(R.id.mine_about_webview_agree);
+        rejectBtn = findView(R.id.mine_about_webview_reject);
     }
 
     void init(){
@@ -56,5 +72,23 @@ public class AboutWebViewActivity extends SheishuoUI{
 
 
 
+        if (isAgreement){
+            agreementLayout.setVisibility(View.VISIBLE);
+
+            agreeBtn.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    startActivity(new Intent(context,PersonalSettingsActivity.class));
+                    finish();
+                }
+            });
+
+            rejectBtn.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    finish();
+                }
+            });
+        }
     }
 }

+ 43 - 4
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/ComplaintActivity.java

@@ -5,10 +5,16 @@ import android.os.Bundle;
 import android.support.annotation.IdRes;
 import android.util.Log;
 import android.view.View;
+import android.widget.Button;
+import android.widget.CompoundButton;
+import android.widget.EditText;
+import android.widget.LinearLayout;
 import android.widget.RadioButton;
 import android.widget.RadioGroup;
 
 import com.sheishuo.app.R;
+import com.sheishuo.app.common.util.net.INet;
+import com.sheishuo.app.common.util.net.NetImpl;
 import com.sheishuo.app.impl.SheishuoUI;
 
 /**
@@ -22,19 +28,28 @@ public class ComplaintActivity extends SheishuoUI implements RadioGroup.OnChecke
     private String TAG = this.getClass().getSimpleName();
     private Context context = this;
 
-    RadioButton type1,type2,type3,type4,type5;
+    private RadioButton type1,type2,type3,type4,type5;
 
     private RadioGroup radioGroup;
 
+    private Button submitBtn;
+
+    private LinearLayout typeLayout,reasonLayout;
+
+    private EditText reasonET;
+
     private String userId = "";
 
     private String complaintType = "";
 
+    private INet net = new NetImpl();
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.mine_complaint_activity);
         userId = getIntent().getStringExtra(USER_ID);
+        findViews();
+        init();
     }
 
 
@@ -45,18 +60,42 @@ public class ComplaintActivity extends SheishuoUI implements RadioGroup.OnChecke
         type3 = findView(R.id.mine_complaint_type_illegal);
         type4 = findView(R.id.mine_complaint_type_politics);
         type5 = findView(R.id.mine_complaint_type_vulgar);
+        submitBtn = findView(R.id.mine_complaint_submit_btn);
+
+        reasonET = findView(R.id.mine_complaint_reason_ET);
+        typeLayout = findView(R.id.mine_complaint_type_layout);
+        reasonLayout = findView(R.id.mine_complaint_reason_layout);
 
     }
 
 
     void init(){
-
+        radioGroup.setOnCheckedChangeListener(this);
+        submitBtn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (complaintType.isEmpty()){
+                    showToast(context,"请选择投诉类型");
+                }else if (submitBtn.getText().toString().equals("下一步")){
+                    typeLayout.setVisibility(View.GONE);
+                    reasonLayout.setVisibility(View.VISIBLE);
+                    submitBtn.setText("提交投诉");
+                }else {
+                    String reason = reasonET.getText().toString();
+                    net.submitComplaint(userId,complaintType,reason);
+                    showToast(context,"提交投诉成功");
+                    finish();
+                }
+
+
+            }
+        });
     }
 
 
-
     @Override
     public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
-
+        complaintType = ((RadioButton)findView(checkedId)).getText().toString();
+        Log.e(TAG,complaintType);
     }
 }

+ 58 - 0
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/FeedbackActivity.java

@@ -0,0 +1,58 @@
+package com.sheishuo.app.core_module.mine.view.ui.activity;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+
+import com.sheishuo.app.R;
+import com.sheishuo.app.common.views.BaseToolbar;
+import com.sheishuo.app.impl.SheishuoUI;
+
+/**
+ * Created by KN on 2017/8/31.
+ */
+
+public class FeedbackActivity extends SheishuoUI {
+
+
+
+    private String TAG = this.getClass().getSimpleName();
+    private Context context = this;
+
+    private BaseToolbar toolbar;
+
+    private EditText feedbackET;
+
+    private Button submibtBtn;
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.mine_feedback_activity);
+        findViews();
+        init();
+    }
+
+
+    void findViews(){
+        feedbackET = findView(R.id.mine_feedback_ET);
+        submibtBtn = findView(R.id.mine_feedback_submit_btn);
+    }
+
+
+    void init(){
+
+        submibtBtn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String feedback = feedbackET.getText().toString();
+                showToast(context,"反馈成功");
+                finish();
+            }
+        });
+
+    }
+}

+ 137 - 81
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/PersonalSettingsActivity.java

@@ -1,26 +1,26 @@
 package com.sheishuo.app.core_module.mine.view.ui.activity;
 
 import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.os.Bundle;
+import android.support.v7.app.AlertDialog;
 import android.util.Log;
 import android.view.View;
 import android.widget.CompoundButton;
-import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.Switch;
 import android.widget.TextView;
 
 import com.bumptech.glide.Glide;
 import com.netease.nim.uikit.common.ui.imageview.HeadImageView;
-import com.netease.nim.uikit.common.ui.widget.SwitchButton;
 import com.netease.nimlib.sdk.NIMClient;
+import com.netease.nimlib.sdk.uinfo.UserInfoProvider;
 import com.netease.nimlib.sdk.uinfo.UserService;
 import com.netease.nimlib.sdk.uinfo.constant.UserInfoFieldEnum;
 import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
 import com.sheishuo.app.R;
 import com.sheishuo.app.cache.AccountCache;
-import com.sheishuo.app.cache.MineSocialCache;
 import com.sheishuo.app.cache.SocialInfoCache;
 import com.sheishuo.app.common.beans.SocialInfoBean;
 import com.sheishuo.app.common.util.net.INet;
@@ -33,6 +33,7 @@ import com.sheishuo.app.impl.SheishuoUI;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 
 import static com.sheishuo.app.core_module.location.LocationSelectActivity.LOCATION_AREA;
 import static com.sheishuo.app.core_module.location.LocationSelectActivity.LOCATION_CITY;
@@ -52,31 +53,15 @@ public class PersonalSettingsActivity extends SheishuoUI {
     public static final int REQUEST_IDNUM = 5403;
 
 
-
-
-
     private String TAG = this.getClass().getSimpleName();
     private Context context = this;
 
 
     private BaseToolbar toolbar;
 
-    private LinearLayout avatarLayout
-            ,nicknameLayout
-            ,genderLayout
-            ,locationLayout
-            ,ageLayout
-            ,hobbyLayout
-            ,realNameLayout
-            ,idNumLayout;
-
-    private TextView nicknameTV
-            ,genderTV
-            ,locationTV
-            ,ageTV
-            ,hobbyTV
-            ,realNameTV
-            ,idNumTV;
+    private LinearLayout avatarLayout, nicknameLayout, genderLayout, locationLayout, ageLayout, hobbyLayout, realNameLayout, idNumLayout;
+
+    private TextView nicknameTV, genderTV, locationTV, ageTV, hobbyTV, realNameTV, idNumTV;
 
     private HeadImageView avatarImg;
 
@@ -89,11 +74,11 @@ public class PersonalSettingsActivity extends SheishuoUI {
     private ResponseCallback callback;
 
 
-    public static void start(Context context){
-        start(context,null);
+    public static void start(Context context) {
+        start(context, null);
     }
 
-    public static void start(Context context , Intent data){
+    public static void start(Context context, Intent data) {
         Intent intent = new Intent();
         intent.setClass(context, PersonalSettingsActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
@@ -113,8 +98,7 @@ public class PersonalSettingsActivity extends SheishuoUI {
     }
 
 
-
-    void findViews(){
+    void findViews() {
         toolbar = findView(R.id.toolbar);
 
         avatarLayout = findView(R.id.personal_settings_avatar_layout);
@@ -157,7 +141,7 @@ public class PersonalSettingsActivity extends SheishuoUI {
 
             @Override
             public void onFailed() {
-                showToast(context,"更新设置失败,请重试");
+                showToast(context, "更新设置失败,请重试");
             }
         };
 
@@ -167,12 +151,12 @@ public class PersonalSettingsActivity extends SheishuoUI {
     }
 
 
-    private void initSettings(){
+    private void initSettings() {
         bean = SocialInfoCache.get(AccountCache.getAccount().getId());
         NimUserInfo userInfo = NIMClient.getService(UserService.class)
                 .getUserInfo(AccountCache.getAccount().getId());
 
-        if (!userInfo.getAvatar().isEmpty()){
+        if (!userInfo.getAvatar().isEmpty()) {
             Glide.with(context)
                     .load(userInfo.getAvatar())
                     .into(avatarImg);
@@ -180,30 +164,62 @@ public class PersonalSettingsActivity extends SheishuoUI {
 
         nicknameTV.setText(getName(AccountCache.getAccount().getId()));
 
-        //暂无性别
+
+
+        switch (userInfo.getGenderEnum().getValue()) {
+            case 0:
+                genderTV.setText("保密");
+                break;
+            case 1:
+                genderTV.setText("男");
+                break;
+            case 2:
+                genderTV.setText("女");
+                break;
+        }
+
 
         locationTV.setText(bean.getCity() + " " + bean.getDistrict());
 
-        if (bean.getShow_age().equals("1")){
+        if (bean.getShow_age().equals("1")) {
             ageIsPublicSwitch.setChecked(true);
         }
 
         if (!bean.getAge().isEmpty()) ageTV.setText(bean.getAge());
 
-        if (!bean.getHobby().isEmpty()) hobbyTV.setText(bean.getHobby().substring(0,6));
+        if (!bean.getHobby().isEmpty()) hobbyTV.setText(bean.getHobby().substring(0, 6));
 
-        if (!bean.getReal_name().isEmpty()) realNameTV.setText(bean.getReal_name());
 
-        if (!bean.getId_number().isEmpty()) idNumTV.setText(bean.getId_number());
+        //隐藏真实姓名
+        if (!bean.getReal_name().isEmpty()){
+            String realName = bean.getReal_name();
+            String hideRealName = "";
+            for (int i = 0;i < realName.length() - 1;i++){
+                hideRealName += "*";
+            }
+            realName = hideRealName + realName.charAt(realName.length() - 1);
+            realNameTV.setText(realName);
+        }
+
+        //隐藏身份证号
+        if (!bean.getId_number().isEmpty()){
+            String idNum = bean.getId_number();
+            String hideIdNum = "";
+            for (int i = 0;i < idNum.length() - 4;i++){
+                hideIdNum += "*";
+            }
+            idNum = hideIdNum + idNum.substring(idNum.length() - 4,idNum.length());
+            idNumTV.setText(idNum);
+        }
 
 
         //公开年龄Switch监听
         ageIsPublicSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                if (isChecked){
+                if (isChecked) {
                     bean.setShow_age("1");
-                }else {
+                } else {
                     bean.setShow_age("0");
                 }
 
@@ -213,15 +229,23 @@ public class PersonalSettingsActivity extends SheishuoUI {
         });
 
 
+        //性别修改
+        genderLayout.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                selectGender(NIMClient.getService(UserService.class));
+            }
+        });
+
 
         //昵称修改
         nicknameLayout.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 Intent intent = new Intent(context, SettingTextEditActivity.class);
-                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT_TITLE,"修改昵称");
-                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT,nicknameTV.getText().toString());
-                startActivityForResult(intent,REQUEST_NICKNAME);
+                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT_TITLE, "修改昵称");
+                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT, nicknameTV.getText().toString());
+                startActivityForResult(intent, REQUEST_NICKNAME);
 
             }
         });
@@ -232,9 +256,9 @@ public class PersonalSettingsActivity extends SheishuoUI {
             @Override
             public void onClick(View v) {
                 Intent intent = new Intent(context, SettingTextEditActivity.class);
-                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT_TITLE,"修改年龄");
-                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT,ageTV.getText().toString());
-                startActivityForResult(intent,REQUEST_AGE);
+                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT_TITLE, "修改年龄");
+                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT, ageTV.getText().toString());
+                startActivityForResult(intent, REQUEST_AGE);
 
             }
         });
@@ -244,9 +268,9 @@ public class PersonalSettingsActivity extends SheishuoUI {
             @Override
             public void onClick(View v) {
                 Intent intent = new Intent(context, SettingTextEditActivity.class);
-                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT_TITLE,"修改真实姓名");
-                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT,realNameTV.getText().toString());
-                startActivityForResult(intent,REQUEST_REALNAME);
+                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT_TITLE, "修改真实姓名");
+                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT, bean.getReal_name());
+                startActivityForResult(intent, REQUEST_REALNAME);
 
             }
         });
@@ -257,9 +281,9 @@ public class PersonalSettingsActivity extends SheishuoUI {
             @Override
             public void onClick(View v) {
                 Intent intent = new Intent(context, SettingTextEditActivity.class);
-                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT_TITLE,"修改身份证号码");
-                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT,idNumTV.getText().toString());
-                startActivityForResult(intent,REQUEST_IDNUM);
+                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT_TITLE, "修改身份证号码");
+                intent.putExtra(SettingTextEditActivity.SETTING_CONTENT, bean.getId_number());
+                startActivityForResult(intent, REQUEST_IDNUM);
 
             }
         });
@@ -268,7 +292,7 @@ public class PersonalSettingsActivity extends SheishuoUI {
         locationLayout.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                startActivityForResult(new Intent(context,LocationSelectActivity.class),0);
+                startActivityForResult(new Intent(context, LocationSelectActivity.class), 0);
             }
         });
 
@@ -277,7 +301,7 @@ public class PersonalSettingsActivity extends SheishuoUI {
             @Override
             public void onClick(View v) {
 
-                startActivityForResult(new Intent(context,HobbySelectActivity.class),0);
+                startActivityForResult(new Intent(context, HobbySelectActivity.class), 0);
             }
         });
 
@@ -287,47 +311,79 @@ public class PersonalSettingsActivity extends SheishuoUI {
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
-        if (SettingTextEditActivity.SETTING_CONTENT_RESULT_CODE == resultCode){
+        if (SettingTextEditActivity.SETTING_CONTENT_RESULT_CODE == resultCode) {
             String resultStr = data.getStringExtra(SettingTextEditActivity.SETTING_CONTENT_RESULT);
-            switch (requestCode){
-               case REQUEST_NICKNAME:
-                   nicknameTV.setText(resultStr);
-                   Map<UserInfoFieldEnum,Object> fieldMap = new HashMap<>();
-                   fieldMap.put(UserInfoFieldEnum.Name,resultStr);
-                   NIMClient.getService(UserService.class).updateUserInfo(fieldMap);
-                   bean.setNick(resultStr);
-                   net.updateSocialInfo(bean,callback);
-                   break;
-               case REQUEST_AGE:
-                   ageTV.setText(resultStr);
-                   bean.setAge(resultStr);
-                   net.updateSocialInfo(bean,callback);
-                   break;
-               case REQUEST_REALNAME:
-                   realNameTV.setText(resultStr);
-                   bean.setReal_name(resultStr);
-                   net.updateSocialInfo(bean,callback);
-                   break;
-               case REQUEST_IDNUM:
-                   idNumTV.setText(resultStr);
-                   bean.setId_number(resultStr);
-                   net.updateSocialInfo(bean,callback);
-                   break;
-           }
-        }else if (resultCode == LOCATION_SELECTED_RESULT_CODE){
+            switch (requestCode) {
+                case REQUEST_NICKNAME:
+                    nicknameTV.setText(resultStr);
+                    Map<UserInfoFieldEnum, Object> fieldMap = new HashMap<>();
+                    fieldMap.put(UserInfoFieldEnum.Name, resultStr);
+                    NIMClient.getService(UserService.class).updateUserInfo(fieldMap);
+                    bean.setNick(resultStr);
+                    net.updateSocialInfo(bean, callback);
+                    break;
+                case REQUEST_AGE:
+                    ageTV.setText(resultStr);
+                    bean.setAge(resultStr);
+                    net.updateSocialInfo(bean, callback);
+                    break;
+                case REQUEST_REALNAME:
+                    realNameTV.setText(resultStr);
+                    bean.setReal_name(resultStr);
+                    net.updateSocialInfo(bean, callback);
+                    break;
+                case REQUEST_IDNUM:
+                    idNumTV.setText(resultStr);
+                    bean.setId_number(resultStr);
+                    net.updateSocialInfo(bean, callback);
+                    break;
+            }
+        } else if (resultCode == LOCATION_SELECTED_RESULT_CODE) {
 
             //更新地理位置
             bean.setProvince(data.getStringExtra(LOCATION_PROVINCE));
             bean.setCity(data.getStringExtra(LOCATION_CITY));
             bean.setDistrict(data.getStringExtra(LOCATION_AREA));
 
-            locationTV.setText(data.getStringExtra(LOCATION_CITY) +" "+ data.getStringExtra(LOCATION_AREA));
+            locationTV.setText(data.getStringExtra(LOCATION_CITY) + " " + data.getStringExtra(LOCATION_AREA));
 
-            net.updateLocation(bean.getProvince(),bean.getCity(),bean.getDistrict(),callback);
+            net.updateLocation(bean.getProvince(), bean.getCity(), bean.getDistrict(), callback);
 
-        }else if (HobbySelectActivity.HOBBY_RESULT_CODE == resultCode){
+        } else if (HobbySelectActivity.HOBBY_RESULT_CODE == resultCode) {
             String hobby = data.getStringExtra(HobbySelectActivity.RESULT_HOBBY);
             hobbyTV.setText(hobby);
         }
     }
+
+
+    private void selectGender(final UserService userService) {
+        final int[] yourChoice = new int[1];
+        final String[] items = {"保密", "男", "女"};
+        yourChoice[0] = -1;
+        AlertDialog.Builder singleChoiceDialog =
+                new AlertDialog.Builder(context);
+        singleChoiceDialog.setTitle("请选择性别");
+        // 第二个参数是默认选项,此处设置为0
+        singleChoiceDialog.setSingleChoiceItems(items, 0,
+                new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+                        yourChoice[0] = which;
+                    }
+                });
+        singleChoiceDialog.setPositiveButton("确定",
+                new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+                        if (yourChoice[0] != -1) {
+                            Map<UserInfoFieldEnum,Object> fieldMap = new HashMap<>();
+                            fieldMap.put(UserInfoFieldEnum.GENDER,yourChoice[0]);
+                            userService.updateUserInfo(fieldMap);
+                            init();
+                        }
+                    }
+                });
+        singleChoiceDialog.show();
+
+    }
 }

+ 7 - 0
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/SettingsActivity.java

@@ -110,6 +110,13 @@ public class SettingsActivity extends SheishuoUI {
             }
         });
 
+        //初始化帮助与反馈
+        feedbackLayout.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                startActivity(new Intent(context,FeedbackActivity.class));
+            }
+        });
 
         //初始化关于
         aboutLayout.setOnClickListener(new View.OnClickListener() {

+ 9 - 2
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/UserInfoDetailActivity.java

@@ -21,6 +21,7 @@ import com.netease.nimlib.sdk.friend.model.AddFriendData;
 import com.netease.nimlib.sdk.uinfo.UserService;
 import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
 import com.sheishuo.app.R;
+import com.sheishuo.app.cache.AccountCache;
 import com.sheishuo.app.cache.SocialInfoCache;
 import com.sheishuo.app.common.beans.CircleBean;
 import com.sheishuo.app.common.beans.SocialInfoBean;
@@ -76,8 +77,14 @@ public class UserInfoDetailActivity extends SheishuoUI {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.mine_user_info_details);
         userId = getIntent().getStringExtra(USER_ID);
-        findViews();
-        init();
+        if (userId.equals(AccountCache.getAccount().getId())){
+            startActivity(new Intent(context,PersonalSettingsActivity.class));
+            finish();
+        }else {
+            findViews();
+            init();
+        }
+
     }
 
 

+ 127 - 15
app/src/com/sheishuo/app/core_module/sheishuo/view/ui/TeamSettingsActivity.java

@@ -1,8 +1,12 @@
 package com.sheishuo.app.core_module.sheishuo.view.ui;
 
+import android.app.Activity;
 import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.os.Bundle;
+import android.support.v7.app.AlertDialog;
+import android.util.Log;
 import android.view.View;
 import android.widget.Button;
 import android.widget.CompoundButton;
@@ -12,9 +16,14 @@ import android.widget.Switch;
 import android.widget.TextView;
 
 import com.bumptech.glide.Glide;
-import com.netease.nim.uikit.common.ui.imageview.HeadImageView;
+import com.netease.nim.uikit.recent.RecentContactsFragment;
+import com.netease.nim.uikit.session.helper.MessageListPanelHelper;
+import com.netease.nim.uikit.team.activity.AdvancedTeamMemberActivity;
 import com.netease.nimlib.sdk.NIMClient;
 import com.netease.nimlib.sdk.RequestCallback;
+import com.netease.nimlib.sdk.msg.MsgService;
+import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
+import com.netease.nimlib.sdk.msg.model.RecentContact;
 import com.netease.nimlib.sdk.team.TeamService;
 import com.netease.nimlib.sdk.team.constant.TeamFieldEnum;
 import com.netease.nimlib.sdk.team.model.Team;
@@ -25,6 +34,7 @@ import com.sheishuo.app.R;
 import com.sheishuo.app.common.util.img.ImgUtil;
 import com.sheishuo.app.core_module.mine.view.ui.activity.UserInfoDetailActivity;
 import com.sheishuo.app.impl.SheishuoUI;
+import com.sheishuo.app.session.activity.MessageHistoryActivity;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -46,12 +56,14 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
 
     private LinearLayout teamNameLayout, teamIntroductionLayout, teamMemberCountLayout, teamMemberAvatarLayout, chatRecordLayout, clearChatRecordLayout;
 
-    private TextView teamNameTV, teamIntroductionTV,getTeamIntroductionTitleTV, teamMemberCountTV;
+    private TextView teamNameTV, teamIntroductionTV, getTeamIntroductionTitleTV, teamMemberCountTV;
 
     private Switch muteSwitch, pinSwitch;
 
     private Button quitBtn;
 
+    private Team team;
+
     private String teamRoomId = "";
 
     @Override
@@ -86,7 +98,7 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
 
 
     void init() {
-        Team team = getTeamService().queryTeamBlock(teamRoomId);
+        team = getTeamService().queryTeamBlock(teamRoomId);
         teamNameTV.setText(team.getName());
         teamIntroductionTV.setText(team.getIntroduce());
         teamMemberCountTV.setText(team.getMemberCount() + "人");
@@ -104,8 +116,49 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
             }
         });
 
-        //置顶功能暂未实现
-        //TO DO
+        //置顶功能
+        NIMClient.getService(MsgService.class).queryRecentContacts().setCallback(new RequestCallback<List<RecentContact>>() {
+            @Override
+            public void onSuccess(final List<RecentContact> recentContacts) {
+
+                for (RecentContact recent : recentContacts) {
+                    if (recent.getContactId().equals(team.getId()) && 1 == recent.getTag()){
+                        pinSwitch.setChecked(true);
+                    }
+                }
+
+                pinSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+                    @Override
+                    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                        for (RecentContact recent : recentContacts) {
+                            if (team.getId().equals(recent.getContactId())) {
+                                Log.e(TAG, team.getId());
+                                if (isChecked){
+                                    recent.setTag(1);
+                                    Log.e(TAG, String.valueOf(recent.getTag()));
+                                }else {
+                                    recent.setTag(0);
+                                    Log.e(TAG, String.valueOf(recent.getTag()));
+                                }
+                                NIMClient.getService(MsgService.class).updateRecent(recent);
+                            }
+                        }
+                    }
+                });
+            }
+
+            @Override
+            public void onFailed(int i) {
+
+            }
+
+            @Override
+            public void onException(Throwable throwable) {
+
+            }
+        });
+
+
 
 
         //注册点击事件
@@ -117,7 +170,7 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
         quitBtn.setOnClickListener(this);
 
         //加载类型
-        if (!isSystemTeam(team)){
+        if (!isSystemTeam(team)) {
             getTeamIntroductionTitleTV.setText("群公告");
         }
 
@@ -144,6 +197,31 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
 
             }
         });
+
+        //聊天记录
+        chatRecordLayout.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                MessageHistoryActivity.start(context,team.getId(), SessionTypeEnum.Team);
+            }
+        });
+
+
+        //群成员
+        teamMemberCountLayout.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                AdvancedTeamMemberActivity.startActivityForResult((Activity) context,team.getId(),0);
+            }
+        });
+
+        //清空聊天记录
+        clearChatRecordLayout.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showClearChatHistoryDialog();
+            }
+        });
     }
 
 
@@ -248,8 +326,8 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
                 for (final NimUserInfo info : nimUserInfos) {
                     ImageView avatar = new ImageView(context);
                     avatar.setAdjustViewBounds(true);
-                    avatar.setMaxWidth((int) ImgUtil.convertDpToPixel(48,context));
-                    avatar.setMaxHeight((int) ImgUtil.convertDpToPixel(48,context));
+                    avatar.setMaxWidth((int) ImgUtil.convertDpToPixel(48, context));
+                    avatar.setMaxHeight((int) ImgUtil.convertDpToPixel(48, context));
 
                     avatar.setOnClickListener(new View.OnClickListener() {
                         @Override
@@ -291,20 +369,54 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
 
     /**
      * 判断是否为系统群
+     *
      * @param team
      * @return
      */
-    public boolean isSystemTeam(Team team){
+    public boolean isSystemTeam(Team team) {
         if (team.getName().contains("国家")
-                ||team.getName().contains("省")
-                ||team.getName().contains("市")
-                ||team.getName().contains("区")
-                ||team.getName().contains("县")
-                ||team.getName().contains("自治")
-                ||team.getName().contains("特别行政区")){
+                || team.getName().contains("省")
+                || team.getName().contains("市")
+                || team.getName().contains("区")
+                || team.getName().contains("县")
+                || team.getName().contains("自治")
+                || team.getName().contains("特别行政区")) {
             return true;
         }
 
         return false;
     }
+
+
+    /**
+     * 清空聊天记录确认对话框
+     */
+    private void showClearChatHistoryDialog(){
+
+        final AlertDialog.Builder normalDialog =
+                new AlertDialog.Builder(context);
+        normalDialog.setTitle("清空聊天记录");
+        normalDialog.setMessage("确定清空聊天记录?");
+        normalDialog.setPositiveButton("确定",
+                new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+                        NIMClient.getService(MsgService.class).clearChattingHistory(team.getId(), SessionTypeEnum.Team);
+                        //通知消息更新
+                        MessageListPanelHelper.getInstance().notifyClearMessages(team.getId());
+
+
+                        showToast(context,"清除消息成功");
+                    }
+                });
+        normalDialog.setNegativeButton("取消",
+                new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+
+                    }
+                });
+        // 显示
+        normalDialog.show();
+    }
 }

+ 87 - 0
app/src/com/sheishuo/app/core_module/trade/view/ui/activity/PayMethodActivity.java

@@ -0,0 +1,87 @@
+package com.sheishuo.app.core_module.trade.view.ui.activity;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ImageView;
+
+import com.sheishuo.app.R;
+import com.sheishuo.app.cache.AccountCache;
+import com.sheishuo.app.common.util.net.INet;
+import com.sheishuo.app.common.util.net.NetImpl;
+import com.sheishuo.app.common.util.net.ResponseCallback;
+import com.sheishuo.app.common.util.pay.PayUtil;
+import com.sheishuo.app.common.util.pay.PaymentListener;
+import com.sheishuo.app.impl.SheishuoUI;
+
+/**
+ * Created by KN on 2017/8/31.
+ */
+
+public class PayMethodActivity extends SheishuoUI implements PaymentListener{
+
+    public final static String MONEY = "money";
+
+
+    private String TAG = this.getClass().getSimpleName();
+    private Context context = this;
+
+
+    private ImageView wechatImg,alipayImg;
+
+    private int money;
+
+    private PayUtil pay = new PayUtil();
+
+    private INet net = new NetImpl();
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.trade_pay_method_activity);
+        money = getIntent().getIntExtra(MONEY,0);
+        findViews();
+        init();
+    }
+
+    void findViews(){
+        wechatImg = findView(R.id.trade_pay_method_wechat_img);
+        alipayImg = findView(R.id.trade_pay_method_alipay_img);
+    }
+
+
+    void init(){
+        pay.init(context,PayMethodActivity.this);
+
+        alipayImg.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                net.alipay(String.valueOf(money), new ResponseCallback() {
+                    @Override
+                    public void onSuccess(Object object) {
+                        pay.pay((String) object);
+                    }
+
+                    @Override
+                    public void onFailed() {
+                        showToast(context,"创建订单失败");
+                    }
+                });
+            }
+        });
+
+    }
+
+    @Override
+    public void onPaymentFinish(Boolean isSuccess) {
+        if (isSuccess){
+            showToast(context,"充值成功");
+            int originMoney = Integer.parseInt(AccountCache.getAccount().getCoin());
+            String nowMoney = String.valueOf(originMoney + money);
+            AccountCache.getAccount().setCoin(nowMoney);
+            finish();
+        }else {
+            showToast(context,"充值失败,请重试");
+        }
+    }
+}

+ 78 - 0
app/src/com/sheishuo/app/core_module/trade/view/ui/activity/RechargeActivity.java

@@ -0,0 +1,78 @@
+package com.sheishuo.app.core_module.trade.view.ui.activity;
+
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.annotation.IdRes;
+import android.view.View;
+import android.widget.Button;
+import android.widget.RadioButton;
+
+import com.netease.nim.uikit.views.MutipleRadioGroup;
+import com.sheishuo.app.R;
+import com.sheishuo.app.impl.SheishuoUI;
+
+/**
+ * Created by KN on 2017/8/31.
+ */
+
+public class RechargeActivity extends SheishuoUI {
+
+    private String TAG = this.getClass().getSimpleName();
+    private Context context = this;
+
+    private MutipleRadioGroup radioGroup;
+
+    private RadioButton rb1, rb2, rb3, rb4, rb5, rb6, rb7;
+
+    private Button submitBtn;
+
+    private int money = 0;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.trade_recharge_activity);
+        findViews();
+        init();
+    }
+
+
+    void findViews() {
+        radioGroup = findView(R.id.trade_recharge_radiogroup);
+        submitBtn = findView(R.id.trade_recharge_btn);
+    }
+
+
+    void init() {
+        radioGroup.setOnCheckedChangeListener(new MutipleRadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(MutipleRadioGroup group, @IdRes int checkedId) {
+                String text = ((RadioButton) findView(checkedId)).getText().toString();
+                if (text.contains("元")){
+                    money = Integer.valueOf(text.replace("元",""));
+
+                }
+            }
+        });
+
+
+
+        submitBtn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (0 == money){
+                    showToast(context,"请选择充值金额");
+                    return;
+                }
+                Intent intent = new Intent(context,PayMethodActivity.class);
+                intent.putExtra(PayMethodActivity.MONEY,money);
+                startActivity(intent);
+                finish();
+            }
+        });
+    }
+
+
+
+}

+ 57 - 17
app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradePublishActivity.java

@@ -25,9 +25,13 @@ import com.netease.nim.uikit.common.media.picker.PickImageHelper;
 import com.netease.nim.uikit.common.media.picker.model.PhotoInfo;
 import com.sheishuo.app.R;
 import com.sheishuo.app.cache.AccountCache;
+import com.sheishuo.app.cache.SocialInfoCache;
+import com.sheishuo.app.common.beans.SocialInfoBean;
 import com.sheishuo.app.common.util.img.ImgUtil;
 import com.sheishuo.app.common.util.net.NetImpl;
+import com.sheishuo.app.common.util.net.NetInfo;
 import com.sheishuo.app.common.util.net.ResponseCallback;
+import com.sheishuo.app.core_module.mine.view.ui.activity.AboutWebViewActivity;
 import com.sheishuo.app.core_module.trade.model.TradeModel;
 import com.sheishuo.app.core_module.trade.presenter.TradePresenter;
 import com.sheishuo.app.core_module.trade.view.adapter.TradeItemAdapter;
@@ -132,7 +136,8 @@ public class TradePublishActivity extends SheishuoUI {
         rechargeTV.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                startActivity(new Intent(context,GiftRechargeActivity.class));
+                startActivity(new Intent(context,RechargeActivity.class));
+                finish();
             }
         });
         //设置Spinner
@@ -178,30 +183,41 @@ public class TradePublishActivity extends SheishuoUI {
         sellRadioBtn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                if(RADIO_CHECKED == R.id.gift_panel_sell_radio_btn){
-                    sellRadioBtn.setChecked(false);
-                    return;
-                }
-                if (isChecked) {
-                    tradeLayout.setVisibility(View.VISIBLE);
-                    emptyTipTV.setVisibility(View.GONE);
-                    TRADE_TYPE = TradeModel.TYPE_SELL;
+
+                if (checkCertification()){
+                    if(RADIO_CHECKED == R.id.gift_panel_sell_radio_btn){
+                        sellRadioBtn.setChecked(false);
+                        return;
+                    }
+                    if (isChecked) {
+                        tradeLayout.setVisibility(View.VISIBLE);
+                        emptyTipTV.setVisibility(View.GONE);
+                        TRADE_TYPE = TradeModel.TYPE_SELL;
+                    }
+                }else {
+                    startIdCertification();
                 }
+
             }
         });
 
         buyRadioBtn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                if(RADIO_CHECKED == R.id.gift_panel_buy_radio_btn){
-                    buyRadioBtn.setChecked(false);
-                    return;
-                }
-                if (isChecked) {
-                    tradeLayout.setVisibility(View.VISIBLE);
-                    emptyTipTV.setVisibility(View.GONE);
-                    TRADE_TYPE = TradeModel.TYPE_BUY;
+                if (checkCertification()){
+                    if(RADIO_CHECKED == R.id.gift_panel_buy_radio_btn){
+                        buyRadioBtn.setChecked(false);
+                        return;
+                    }
+                    if (isChecked) {
+                        tradeLayout.setVisibility(View.VISIBLE);
+                        emptyTipTV.setVisibility(View.GONE);
+                        TRADE_TYPE = TradeModel.TYPE_BUY;
+                    }
+                }else {
+                    startIdCertification();
                 }
+
             }
         });
 
@@ -350,4 +366,28 @@ public class TradePublishActivity extends SheishuoUI {
     public void onAllPhotosUploaded(){
         publishBtn.setEnabled(true);
     }
+
+
+
+    //检查是否实名认证
+    public boolean checkCertification(){
+        SocialInfoBean bean = SocialInfoCache.get(AccountCache.getAccount().getId());
+        if (bean.getReal_name().isEmpty() || bean.getId_number().isEmpty()){
+            showToast(context,"请先完成实名认证");
+            return false;
+        }
+
+        return true;
+    }
+
+
+    //打开实名认证界面
+    public void startIdCertification(){
+        Intent intent = new Intent(context,AboutWebViewActivity.class);
+        intent.putExtra(AboutWebViewActivity.TITLE,"互联网管理方法");
+        intent.putExtra(AboutWebViewActivity.URL, NetInfo.LAW_URL);
+        intent.putExtra(AboutWebViewActivity.IS_AGREEMENT,true);
+        startActivity(intent);
+        finish();
+    }
 }

+ 6 - 0
app/src/com/sheishuo/app/main/activity/MainActivity.java

@@ -75,6 +75,12 @@ public class MainActivity extends SheishuoUI {
         context.startActivity(intent);
     }
 
+    @Override
+    protected void onPause() {
+        super.onPause();
+        mainFragment.onPause();
+    }
+
     // 注销
     public static void logout(Context context, boolean quit) {
         Intent extra = new Intent();

+ 8 - 0
app/src/com/sheishuo/app/main/fragment/HomeFragment.java

@@ -225,12 +225,20 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
         super.onResume();
         enableMsgNotification(false);
         //quitOtherActivities();
+        for (Fragment fragment : getFragmentManager().getFragments()) {
+            if (fragment instanceof SessionListFragment)
+                fragment.setUserVisibleHint(true);
+        }
     }
 
     @Override
     public void onPause() {
         super.onPause();
         enableMsgNotification(true);
+        for (Fragment fragment : getFragmentManager().getFragments()) {
+            if (fragment instanceof SessionListFragment)
+                fragment.setUserVisibleHint(false);
+        }
     }
 
     @Override

+ 22 - 5
app/src/com/sheishuo/app/main/fragment/SessionListFragment.java

@@ -1,7 +1,10 @@
 package com.sheishuo.app.main.fragment;
 
+import android.app.FragmentTransaction;
 import android.content.Intent;
 import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.util.Log;
 import android.view.View;
 import android.widget.TextView;
 import android.widget.Toast;
@@ -10,6 +13,7 @@ import com.netease.nim.uikit.common.activity.UI;
 import com.netease.nim.uikit.common.util.log.LogUtil;
 import com.netease.nim.uikit.recent.RecentContactsCallback;
 import com.netease.nim.uikit.recent.RecentContactsFragment;
+import com.netease.nim.uikit.session.extension.GiftAttachment;
 import com.netease.nimlib.sdk.NIMClient;
 import com.netease.nimlib.sdk.Observer;
 import com.netease.nimlib.sdk.StatusCode;
@@ -101,6 +105,7 @@ public class SessionListFragment extends MainTabFragment {
         super.onDestroy();
     }
 
+
     @Override
     protected void onInit() {
         findViews();
@@ -170,17 +175,27 @@ public class SessionListFragment extends MainTabFragment {
                     startActivity(new Intent(getActivity(), AddNewFriendActivity.class));
                 }
             });
+            parent.setSupportActionBar(toolbar);
         }
-
-
-        parent.setSupportActionBar(toolbar);
-
     }
 
     @Override
     public void setUserVisibleHint(boolean isVisibleToUser) {
         super.setUserVisibleHint(isVisibleToUser);
-        if (isVisibleToUser && toolbar != null) initToolbar();
+        Log.e(TAG,"isVisible" + isVisibleToUser);
+        if (fragment != null) fragment.setUserVisibleHint(isVisibleToUser);
+        if (isVisibleToUser){
+            onInit();
+        }else {
+            if (fragment != null){
+                Log.e(TAG,"remove fragment");
+                android.support.v4.app.FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
+                transaction.remove(fragment);
+                transaction.commit();
+            }
+        }
+
+
     }
 
 
@@ -318,6 +333,8 @@ public class SessionListFragment extends MainTabFragment {
                     return "[贴图]";
                 } else if (attachment instanceof SnapChatAttachment) {
                     return "[阅后即焚]";
+                } else if (attachment instanceof GiftAttachment){
+                    return "[礼物]";
                 }
 
                 return null;

+ 2 - 2
uikit/res/drawable/nim_recent_contact_sticky_selecter.xml

@@ -2,7 +2,7 @@
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
     <item android:drawable="@color/im_list_select_hover" android:state_pressed="true"></item>
-    <item android:drawable="@color/green_4DC0A4" android:state_pressed="false"></item>
-    <item android:drawable="@color/green_4DC0A4"></item>
+    <item android:drawable="@color/colorPrimary" android:state_pressed="false"></item>
+    <item android:drawable="@color/colorPrimary"></item>
 
 </selector>

+ 10 - 3
uikit/res/drawable/rechage_button_selector.xml

@@ -2,10 +2,17 @@
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
     <item android:state_checked="true"
-        android:state_enabled="true"
-        android:drawable="@color/green_4DC0A4"/>
+        android:state_enabled="true">
+        <shape>
+            <corners android:radius="15dp"/>
+            <stroke android:width="1dp"
+                android:color="@color/green_4DC0A4"/>
+        </shape>
+    </item>
+
+    <item android:state_checked="false"
+        android:drawable="@drawable/recharge_botton_unchecked"/>
 
-    <item android:drawable="@color/GreyWhite"/>
 
 
 </selector>

+ 30 - 29
uikit/res/layout/gift_panel.xml

@@ -90,6 +90,36 @@
                 android:layout_height="wrap_content" />
         </LinearLayout>
 
+
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:padding="8dp">
+
+            <TextView
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="2"
+                android:text="置顶数量" />
+
+            <SeekBar
+                android:id="@+id/gift_panel_num_seekbar"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="9"
+                android:max="25"
+                android:progress="1" />
+
+            <TextView
+                android:id="@+id/gift_panel_num_TV"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:gravity="center"
+                android:text="1" />
+        </LinearLayout>
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
@@ -123,35 +153,6 @@
                 android:textColor="@color/white" />
         </LinearLayout>
 
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            android:padding="8dp">
-
-            <TextView
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="2"
-                android:text="置顶数量" />
-
-            <SeekBar
-                android:id="@+id/gift_panel_num_seekbar"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="9"
-                android:max="25"
-                android:progress="1" />
-
-            <TextView
-                android:id="@+id/gift_panel_num_TV"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:gravity="center"
-                android:text="1" />
-        </LinearLayout>
-
         <HorizontalScrollView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content">

+ 11 - 0
uikit/src/com/netease/nim/uikit/recent/RecentContactsFragment.java

@@ -4,6 +4,7 @@ import android.os.Bundle;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -84,6 +85,14 @@ public class RecentContactsFragment extends TFragment {
 
     private UserInfoObservable.UserInfoObserver userInfoObserver;
 
+
+    @Override
+    public void setUserVisibleHint(boolean isVisibleToUser) {
+        super.setUserVisibleHint(isVisibleToUser);
+        Log.e("RecentContactsFragment", "is " + isVisibleToUser);
+        refreshMessages(false);
+    }
+
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);
@@ -272,8 +281,10 @@ public class RecentContactsFragment extends TFragment {
             public void onClick() {
                 if (isTagSet(recent, RECENT_TAG_STICKY)) {
                     removeTag(recent, RECENT_TAG_STICKY);
+                    Log.e("recent tag", String.valueOf(recent.getTag()));
                 } else {
                     addTag(recent, RECENT_TAG_STICKY);
+                    Log.e("recent tag", String.valueOf(recent.getTag()));
                 }
                 NIMClient.getService(MsgService.class).updateRecent(recent);
 

+ 0 - 2
uikit/uikit.iml

@@ -73,8 +73,6 @@
       <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
-      <excludeFolder url="file://$MODULE_DIR$/build/.DS_Store" />
-      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/.DS_Store" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />