liukai 2 роки тому
батько
коміт
ad196472ef

+ 2 - 2
cpt_ewallet/src/main/java/com/hongyegroup/cpt_ewallet/router/EWalletComponentServiceImpl.kt

@@ -15,8 +15,8 @@ class EWalletComponentServiceImpl : IEWalletComponentServer {
         YYLogUtils.w("EWalletComponentServiceImpl-startWithdrawalPage")
     }
 
-    override fun obtainEWalletMainFragment(): Fragment {
-        return EWalletMainFragment()
+    override fun obtainEWalletMainFragment(needBackLayout: Boolean): Fragment {
+        return EWalletMainFragment(needBackLayout)
     }
 
     override fun init(context: Context?) {

+ 11 - 2
cpt_ewallet/src/main/java/com/hongyegroup/cpt_ewallet/ui/EWalletMainFragment.kt

@@ -1,16 +1,20 @@
 package com.hongyegroup.cpt_ewallet.ui
 
 import android.os.Bundle
+import android.view.View
+import com.guadou.cs_cptservices.YYConstants
 import com.guadou.cs_cptservices.base.fragment.YYBaseVDBFragment
 import com.guadou.cs_cptservices.interfaces.IFragmentRefresh
 import com.guadou.lib_baselib.bean.DataBindingConfig
 import com.guadou.lib_baselib.engine.toast
+import com.guadou.lib_baselib.ext.click
 import com.guadou.lib_baselib.ext.vertical
 import com.guadou.lib_baselib.utils.CommUtils
 import com.hongyegroup.cpt_ewallet.BR
 import com.hongyegroup.cpt_ewallet.R
 import com.hongyegroup.cpt_ewallet.databinding.FragmentEwalletMainBinding
 import com.hongyegroup.cpt_ewallet.mvvm.EWalletMainViewModel
+import com.jeremyliao.liveeventbus.LiveEventBus
 import com.scwang.smart.refresh.layout.api.RefreshLayout
 import com.scwang.smart.refresh.layout.listener.OnRefreshListener
 
@@ -18,8 +22,8 @@ import com.scwang.smart.refresh.layout.listener.OnRefreshListener
  * 用于MainActivity的子Fragment
  * 钱包的主页
  */
-class EWalletMainFragment : YYBaseVDBFragment<EWalletMainViewModel, FragmentEwalletMainBinding>(), IFragmentRefresh,
-    OnRefreshListener {
+class EWalletMainFragment(private val needBackLayout: Boolean) : YYBaseVDBFragment<EWalletMainViewModel, FragmentEwalletMainBinding>(),
+    IFragmentRefresh, OnRefreshListener {
 
     private val clickProxy by lazy { ClickProxy() }
 
@@ -70,6 +74,11 @@ class EWalletMainFragment : YYBaseVDBFragment<EWalletMainViewModel, FragmentEwal
     }
 
     private fun initListener() {
+        mBinding.easyTitleBar.backLayout.visibility = if (needBackLayout) View.VISIBLE else View.GONE
+        mBinding.easyTitleBar.backLayout.click {
+            LiveEventBus.get<Boolean>(YYConstants.ENENT_PART_TIME_BACK).post(true)
+        }
+
         mBinding.refreshLayout.setEnableNestedScroll(true)
         mBinding.refreshLayout.setEnableLoadMore(false)
         mBinding.refreshLayout.setEnableRefresh(true)

BIN
cpt_ewallet/src/main/res/drawable-xxhdpi/ewallet_appiontments_icon.webp


BIN
cpt_ewallet/src/main/res/drawable-xxhdpi/ewallet_withdraw_icon.webp


BIN
cpt_ewallet/src/main/res/drawable-xxhdpi/wallet_appointments_icon.webp


BIN
cpt_ewallet/src/main/res/drawable-xxhdpi/wallet_withdrawn_icon.webp


BIN
cpt_ewallet/src/main/res/drawable-xxhdpi/yypay_facial_fingerprinticon.webp


+ 121 - 60
cpt_ewallet/src/main/res/layout/fragment_ewallet_main.xml

@@ -27,7 +27,7 @@
             android:id="@+id/easy_title_bar"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            app:Easy_backLayoutState="gone"
+            app:Easy_backRes="@mipmap/back_white_icon"
             app:Easy_hasStatusPadding="true"
             app:Easy_lineState="gone"
             app:Easy_title="电子钱包"
@@ -172,74 +172,46 @@
 
 
                     <LinearLayout
+                        style="@style/SelectableItemBackground"
                         android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:orientation="horizontal">
+                        android:layout_height="@dimen/d_60dp"
+                        android:gravity="center_vertical"
+                        android:orientation="horizontal"
+                        android:paddingLeft="@dimen/d_18dp"
+                        android:paddingRight="@dimen/d_18dp"
+                        binding:clicks="@{click.gotoWithdrawalPage}">
 
+                        <ImageView
+                            android:layout_width="@dimen/d_26dp"
+                            android:layout_height="@dimen/d_26dp"
+                            android:src="@drawable/ewallet_withdraw_icon" />
 
-                        <LinearLayout
-                            style="@style/SelectableItemBackground"
-                            android:layout_width="0dp"
+                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                            android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
-                            android:layout_weight="1"
-                            android:gravity="center"
-                            android:orientation="vertical"
-                            binding:clicks="@{click.gotoWithdrawalPage}">
-
-                            <ImageView
-                                android:layout_width="@dimen/d_35dp"
-                                android:layout_height="@dimen/d_35dp"
-                                android:src="@drawable/wallet_withdrawn_icon" />
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_marginTop="@dimen/d_5dp"
-                                android:text="提现"
-                                android:textColor="@color/gray_76"
-                                android:textSize="@dimen/d_13sp" />
-
-                        </LinearLayout>
+                            android:layout_marginLeft="@dimen/d_8dp"
+                            android:text="提现"
+                            android:textColor="@color/gray_76"
+                            android:textSize="@dimen/d_15sp" />
 
                         <View
-                            android:layout_width="@dimen/d_1dp"
-                            android:layout_height="match_parent"
-                            android:layout_marginTop="@dimen/d_5dp"
-                            android:layout_marginBottom="@dimen/d_5dp"
-                            android:background="@color/divider_color" />
-
-                        <LinearLayout
-                            style="@style/SelectableItemBackground"
                             android:layout_width="0dp"
                             android:layout_height="wrap_content"
-                            android:layout_weight="1"
-                            android:gravity="center"
-                            android:orientation="vertical"
-                            binding:clicks="@{click.gotoAppointmentPage}">
-
-                            <ImageView
-                                android:layout_width="@dimen/d_35dp"
-                                android:layout_height="@dimen/d_35dp"
-                                android:src="@drawable/wallet_appointments_icon" />
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_marginTop="@dimen/d_5dp"
-                                android:text="提现预约记录"
-                                android:textColor="@color/gray_76"
-                                android:textSize="@dimen/d_13sp" />
+                            android:layout_weight="1" />
 
-                        </LinearLayout>
+                        <ImageView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:src="@drawable/more_gray_icon" />
 
                     </LinearLayout>
 
-                    <View
+                    <ImageView
                         android:layout_width="match_parent"
-                        android:layout_height="@dimen/d_10dp"
-                        android:layout_marginTop="@dimen/d_13dp"
-                        android:background="@color/page_bg" />
-
+                        android:layout_height="0.7dp"
+                        android:layout_marginLeft="@dimen/d_15dp"
+                        android:layout_marginRight="@dimen/d_15dp"
+                        android:src="@color/page_bg" />
 
                     <LinearLayout
                         style="@style/SelectableItemBackground"
@@ -249,18 +221,18 @@
                         android:orientation="horizontal"
                         android:paddingLeft="@dimen/d_18dp"
                         android:paddingRight="@dimen/d_18dp"
-                        binding:clicks="@{click.gotoSetPsdPage}">
+                        binding:clicks="@{click.gotoAppointmentPage}">
 
                         <ImageView
                             android:layout_width="@dimen/d_26dp"
                             android:layout_height="@dimen/d_26dp"
-                            android:src="@drawable/wallet_password_icon" />
+                            android:src="@drawable/ewallet_appiontments_icon" />
 
                         <com.guadou.lib_baselib.font_text_view.TextViewMedium
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="@dimen/d_8dp"
-                            android:text="支付密码设置"
+                            android:text="提现预约记录"
                             android:textColor="@color/gray_76"
                             android:textSize="@dimen/d_15sp" />
 
@@ -283,7 +255,6 @@
                         android:layout_marginRight="@dimen/d_15dp"
                         android:src="@color/page_bg" />
 
-
                     <LinearLayout
                         style="@style/SelectableItemBackground"
                         android:layout_width="match_parent"
@@ -361,6 +332,96 @@
 
                     </LinearLayout>
 
+                    <LinearLayout
+                        style="@style/SelectableItemBackground"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d_60dp"
+                        android:gravity="center_vertical"
+                        android:orientation="horizontal"
+                        android:paddingLeft="@dimen/d_18dp"
+                        android:paddingRight="@dimen/d_18dp"
+                        binding:clicks="@{click.gotoSetPsdPage}">
+
+                        <ImageView
+                            android:layout_width="@dimen/d_26dp"
+                            android:layout_height="@dimen/d_26dp"
+                            android:src="@drawable/wallet_password_icon" />
+
+                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_marginLeft="@dimen/d_8dp"
+                            android:text="支付密码设置"
+                            android:textColor="@color/gray_76"
+                            android:textSize="@dimen/d_15sp" />
+
+                        <View
+                            android:layout_width="0dp"
+                            android:layout_height="wrap_content"
+                            android:layout_weight="1" />
+
+                        <ImageView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:src="@drawable/more_gray_icon" />
+
+                    </LinearLayout>
+
+                    <ImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="0.7dp"
+                        android:layout_marginLeft="@dimen/d_15dp"
+                        android:layout_marginRight="@dimen/d_15dp"
+                        android:src="@color/page_bg" />
+
+                    <!--设置指纹-->
+                    <LinearLayout
+                        style="@style/SelectableItemBackground"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d_60dp"
+                        android:gravity="center_vertical"
+                        android:orientation="horizontal"
+                        android:paddingLeft="@dimen/d_18dp"
+                        android:paddingRight="@dimen/d_18dp">
+
+                        <ImageView
+                            android:layout_width="@dimen/d_26dp"
+                            android:layout_height="@dimen/d_26dp"
+                            android:src="@drawable/yypay_facial_fingerprinticon" />
+
+                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_marginLeft="@dimen/d_8dp"
+                            android:text="人脸/指纹"
+                            android:textColor="@color/gray_76"
+                            android:textSize="@dimen/d_15sp" />
+
+                        <View
+                            android:layout_width="0dp"
+                            android:layout_height="wrap_content"
+                            android:layout_weight="1" />
+
+                        <androidx.appcompat.widget.SwitchCompat
+                            android:id="@+id/switch_fingerprint"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:background="@drawable/selector_switch_bg"
+                            app:showText="false"
+                            app:splitTrack="false"
+                            app:theme="@style/scstyle"
+                            app:thumbTint="#00000000"
+                            app:trackTint="#00000000" />
+
+                    </LinearLayout>
+
+                    <ImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="0.7dp"
+                        android:layout_marginLeft="@dimen/d_15dp"
+                        android:layout_marginRight="@dimen/d_15dp"
+                        android:src="@color/page_bg" />
+
                     <com.guadou.lib_baselib.font_text_view.TextViewBold
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"

+ 2 - 2
cpt_main/src/main/java/com/hongyegroup/cpt_main/ui/MainActivity.kt

@@ -208,7 +208,7 @@ class MainActivity : YYBaseVDBActivity<MainViewModel, ActivityMainBinding>() {
     private fun initFragment() {
         // 正常情况下初始化
         mHomeFragment = HomeFragment()
-        mEWalletFragment = YYRouterService.eWalletComponentServer?.obtainEWalletMainFragment()
+        mEWalletFragment = YYRouterService.eWalletComponentServer?.obtainEWalletMainFragment(false)
         mNewsFeedFragment = YYRouterService.newsfeedComponentServer?.obtainNewsFeedMainFragment()
         mProfileFragment = ProfileFragment()
     }
@@ -232,7 +232,7 @@ class MainActivity : YYBaseVDBActivity<MainViewModel, ActivityMainBinding>() {
 
             // 复用
             mHomeFragment = f0 ?: HomeFragment()
-            mEWalletFragment = f1 ?: YYRouterService.eWalletComponentServer?.obtainEWalletMainFragment()
+            mEWalletFragment = f1 ?: YYRouterService.eWalletComponentServer?.obtainEWalletMainFragment(false)
             mNewsFeedFragment = f2 ?: YYRouterService.newsfeedComponentServer?.obtainNewsFeedMainFragment()
             mProfileFragment = f3 ?: ProfileFragment()
         }

+ 9 - 3
cpt_parttime/src/main/java/com/hongyegroup/cpt_parttime/ui/activity/PartTimeMainActivity.kt

@@ -4,6 +4,7 @@ import android.os.Bundle
 import androidx.fragment.app.Fragment
 import androidx.fragment.app.FragmentManager
 import androidx.fragment.app.FragmentTransaction
+import com.guadou.cs_cptservices.YYConstants
 import com.guadou.cs_cptservices.base.activity.YYBaseVDBActivity
 import com.guadou.cs_cptservices.interfaces.IFragmentRefresh
 import com.guadou.cs_router.YYRouterService
@@ -20,6 +21,7 @@ import com.hongyegroup.cpt_parttime.ui.main.PartTimeActivesFragment
 import com.hongyegroup.cpt_parttime.ui.main.PartTimeHomeFragment
 import com.hongyegroup.cpt_parttime.ui.main.PartTimeProfileFragment
 import com.hongyegroup.cpt_parttime.ui.main.PartTimeTrainFragment
+import com.jeremyliao.liveeventbus.LiveEventBus
 import dagger.hilt.android.AndroidEntryPoint
 
 /**
@@ -67,7 +69,11 @@ class PartTimeMainActivity : YYBaseVDBActivity<PartTimeMainViewModel, ActivityPa
     }
 
     override fun startObserve() {
-
+        //收到消息-回到第一个Tab
+        LiveEventBus.get<Boolean>(YYConstants.ENENT_PART_TIME_BACK).observe(this) {
+            mClickPage = 0
+            switchFragment(0)
+        }
     }
 
     override fun needRegistNetworkChangeObserver(): Boolean = true
@@ -233,7 +239,7 @@ class PartTimeMainActivity : YYBaseVDBActivity<PartTimeMainViewModel, ActivityPa
         // 正常情况下初始化
         mPartTimeHomeFragment = PartTimeHomeFragment()
         mPartTimeActiveFragment = PartTimeActivesFragment()
-        mPartTimeWalletFragment = YYRouterService.eWalletComponentServer?.obtainEWalletMainFragment()
+        mPartTimeWalletFragment = YYRouterService.eWalletComponentServer?.obtainEWalletMainFragment(true)
         mPartTimeTrainFragment = PartTimeTrainFragment()
         mPartTimeMeFragment = PartTimeProfileFragment()
     }
@@ -259,7 +265,7 @@ class PartTimeMainActivity : YYBaseVDBActivity<PartTimeMainViewModel, ActivityPa
             // 复用
             mPartTimeHomeFragment = f0 ?: PartTimeHomeFragment()
             mPartTimeActiveFragment = f1 ?: PartTimeActivesFragment()
-            mPartTimeWalletFragment = f2 ?: YYRouterService.eWalletComponentServer?.obtainEWalletMainFragment()
+            mPartTimeWalletFragment = f2 ?: YYRouterService.eWalletComponentServer?.obtainEWalletMainFragment(true)
             mPartTimeTrainFragment = f3 ?: PartTimeTrainFragment()
             mPartTimeMeFragment = f4 ?: PartTimeProfileFragment()
         }

+ 8 - 0
cs_cptServices/src/main/java/com/guadou/cs_cptservices/YYConstants.java

@@ -11,4 +11,12 @@ public class YYConstants {
     public static final int NEWS_FEED_TYPE_VIDEO = 1;
     public static final int NEWS_FEED_TYPE_BALLOT = 2;
     public static final int NEWS_FEED_TYPE_NEWS = 3;
+
+
+
+    public static final String ENENT_PART_TIME_BACK = "enent_part_time_back";   //兼职首页回到第一个Tab
+
+
+
+
 }

+ 1 - 1
cs_router/src/main/java/com/guadou/cs_router/ewallet/IEWalletComponentServer.kt

@@ -7,6 +7,6 @@ interface IEWalletComponentServer : IProvider {
 
     fun startWithdrawalPage()
 
-    fun obtainEWalletMainFragment(): Fragment
+    fun obtainEWalletMainFragment(needBackLayout: Boolean): Fragment
 
 }

+ 1 - 1
standalone/ewalletrunalone/src/main/java/com/guadou/ewalletrunalone/EWalletMainActivity.kt

@@ -15,7 +15,7 @@ import com.hongyegroup.cpt_ewallet.ui.EWalletMainFragment
 class EWalletMainActivity : BaseVMActivity<EmptyViewModel>() {
 
     private lateinit var mGroupTabWallet: View
-    private val mWalletFragment by lazy { EWalletMainFragment() }
+    private val mWalletFragment by lazy { EWalletMainFragment(false) }
 
     companion object {
         fun startInstance() {