ソースを参照

风险管理9月2日提交代码-liu.bolan-云融大宗

Liu.bolan 4 年 前
コミット
aafba327b7
26 ファイル変更1495 行追加15 行削除
  1. 2 0
      RMA/app/src/main/AndroidManifest.xml
  2. 12 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt
  3. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  4. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/FutureMarket.kt
  5. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/bookingwarehouse/adapter/BookingAreCancelContentAdapter.java
  6. 26 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performance/PerformanceInformationViewModel.kt
  7. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/AreCancelContentAdapter.java
  8. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/AnnouncementViewHolder.kt
  9. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/NewHomeFragment.kt
  10. 663 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzHomeFragment.kt
  11. 108 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzHomeViewModel.kt
  12. 233 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzNoticeActivity.kt
  13. 55 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzNoticeViewModel.kt
  14. 8 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/IndexData.kt
  15. 114 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/IndexViewHolder.kt
  16. 177 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/YrdzMarketFragment.kt
  17. 31 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/YrdzMarketLabelViewHolder.kt
  18. 26 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/YrdzMarketViewModel.kt
  19. 11 0
      RMA/app/src/main/res/anim/slide_in_left.xml
  20. 11 0
      RMA/app/src/main/res/anim/slide_out_right.xml
  21. 6 0
      RMA/app/src/main/res/drawable/yrdz_label_bg.xml
  22. 1 1
      RMA/app/src/main/res/layout/item_fresco.xml
  23. BIN
      RMA/app/src/main/res/mipmap-xhdpi/yrdz_banner_placeholder.png
  24. BIN
      RMA/app/src/main/res/mipmap-xhdpi/yrdz_chart_icon.png
  25. BIN
      RMA/app/src/main/res/mipmap-xhdpi/yrdz_nctice_icon.png
  26. BIN
      RMA/app/src/main/res/mipmap-xhdpi/yrdz_topright_icon.png

+ 2 - 0
RMA/app/src/main/AndroidManifest.xml

@@ -451,6 +451,8 @@
         <activity android:name=".view.base.warehousereceipt.tradecircle.TradeCircleListedingActivity"/>
 
         <activity android:name=".view.base.hnstmain.spotwarehouse.bargain.BargainActivity"/>
+
+        <activity android:name=".view.base.home.yrdz.YrdzNoticeActivity"/>
     </application>
 
 </manifest>

+ 12 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt

@@ -19,6 +19,7 @@ import cn.muchinfo.rma.view.base.future.FutureFragment
 import cn.muchinfo.rma.view.base.hnstcdys.HnstcdysFragment
 import cn.muchinfo.rma.view.base.hnstmain.HnstMainFragment
 import cn.muchinfo.rma.view.base.home.NewHomeFragment
+import cn.muchinfo.rma.view.base.home.yrdz.YrdzHomeFragment
 import cn.muchinfo.rma.view.base.main.SeaKingMainFragment
 import cn.muchinfo.rma.view.base.platinumtreasure.PlatinumTreasureFragment
 import cn.muchinfo.rma.view.base.procurement.ProcurementFragment
@@ -49,6 +50,11 @@ class MainActivity : BaseActivity<MainViewModel>() {
         NewHomeFragment()
     }
 
+    /** 云融大宗首页 **/
+    val yrdzHomeFragment by lazy {
+        YrdzHomeFragment()
+    }
+
     /** 采购页面 **/
     val procurementFragment by lazy {//client_po
         ProcurementFragment()
@@ -134,7 +140,12 @@ class MainActivity : BaseActivity<MainViewModel>() {
 
     fun initFragmentData() {
 
-        newFragments.add(homeFragment)
+        if (SPUtils.getInstance().getString(Constant.oem) == "yrdz"){
+            newFragments.add(yrdzHomeFragment)
+        }else{
+            newFragments.add(homeFragment)
+        }
+
         newTabText.add("首页")
         newNormalIcon.add(R.mipmap.main_tab_1)
         newSelectIcon.add(R.mipmap.rma_select_main_tab_1)

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt

@@ -14,13 +14,13 @@ object Constant {
 
 
 //    const val baseurl = "http://192.168.31.93:8080/cfg?key=test_93"//李倩企业风管 18611112222
-    const val baseurl = "http://192.168.31.104:8080/cfg?key=test_104"//李倩云融 18611112222
+//    const val baseurl = "http://192.168.31.104:8080/cfg?key=test_104"//李倩云融 18611112222
 //
 //    const val baseurl = "http://192.168.31.135:8080/cfg?key=test_135"// 瑶姐 云融 130000000001 123456
 
 //    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
-//    const val baseurl: String = "http://192.168.31.174:8080/cfg?key=test_174"// 邓工
+    const val baseurl: String = "http://192.168.31.139:8080/cfg?key=test_139"// 邓工
 //
 //    const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176" // 9999  123123  黄老板千海金
 //    const val baseurl = "http://192.168.31.171:8080/cfg?key=test_171" // 邓工 签约解约环境

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/FutureMarket.kt

@@ -44,7 +44,7 @@ class FutureMarket : BaseFragment<FutureMarketModel>() {
     }
     // 页面,和对应的tab对应
     private val tabFragments : ArrayList<Fragment> = arrayListOf()
-//endregion
+    //endregion
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
@@ -61,7 +61,7 @@ class FutureMarket : BaseFragment<FutureMarketModel>() {
     ): View? {
         _view = inflater.inflate(R.layout.future_market, container, false)
         if (viewModel.ermcpGoodsSortByPositionDataList.value.isNullOrEmpty().not()){
-            initViews(viewModel.ermcpGoodsSortByPositionDataList?.value ?: arrayListOf())
+            initViews(viewModel.ermcpGoodsSortByPositionDataList.value ?: arrayListOf())
         }
         return _view
     }

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/bookingwarehouse/adapter/BookingAreCancelContentAdapter.java

@@ -119,7 +119,7 @@ public class BookingAreCancelContentAdapter extends RecyclerView.Adapter<Booking
                     setPosition(i);
             }
         });
-        if (data.getWrtradeorderstatus().equals("3") || data.getWrtradeorderstatus().equals("10")){
+        if (data.getWrtradeorderstatus().equals("3") || data.getWrtradeorderstatus().equals("7")){
             itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
         }else {
             itemViewHolder.invoice_register.setVisibility(View.GONE);

+ 26 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performance/PerformanceInformationViewModel.kt

@@ -126,7 +126,19 @@ class PerformanceInformationViewModel : BaseViewModel(){
             //仓库
             newRightData.add(it.warehousename?.isBlankString() ?: "-")
             //类型
-            newRightData.add(if (it.haswr == "0"){"仓单预售"}else{"仓单贸易"} )
+            var type = ""
+            type = if (it.performancetype == "1"){
+                "交收"
+            }else if (it.performancetype == "2"){
+                if (it.haswr == "0"){
+                    "仓单预售"
+                }else{
+                    "仓单贸易"
+                }
+            }else{
+                "其他"
+            }
+            newRightData.add(type)
             //交收月
             newRightData.add(it.activatemonth?.isBlankString() ?: "-") // 接口缺少
             //付款方式
@@ -204,7 +216,19 @@ class PerformanceInformationViewModel : BaseViewModel(){
             //仓库
             newRightData.add(it.warehousename?.isBlankString() ?: "-")
             //类型
-            newRightData.add(if (it.haswr == "0"){"仓单预售"}else{"仓单贸易"} )
+            var type = ""
+            type = if (it.performancetype == "1"){
+                "交收"
+            }else if (it.performancetype == "2"){
+                if (it.haswr == "0"){
+                    "仓单预售"
+                }else{
+                    "仓单贸易"
+                }
+            }else{
+                "其他"
+            }
+            newRightData.add(type)
             //交收月
             newRightData.add(it.activatemonth?.isBlankString() ?: "-") // 接口缺少
             //付款方式

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/AreCancelContentAdapter.java

@@ -119,7 +119,7 @@ public class AreCancelContentAdapter extends RecyclerView.Adapter<AreCancelConte
             }
         });
         itemViewHolder.details.setVisibility(View.VISIBLE);
-        if (data.getWrtradeorderstatus().equals("3") || data.getWrtradeorderstatus().equals("10")) {
+        if (data.getWrtradeorderstatus().equals("3") || data.getWrtradeorderstatus().equals("7")) {
             itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
         } else {
             itemViewHolder.invoice_register.setVisibility(View.GONE);

+ 3 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/AnnouncementViewHolder.kt

@@ -4,6 +4,7 @@ import android.content.Intent
 import android.graphics.Typeface
 import android.text.TextUtils
 import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
 import androidx.fragment.app.Fragment
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.NoticeData
@@ -20,9 +21,8 @@ import mtp.polymer.com.information_management.hnstocks.message.MessageDetailsAct
 import org.jetbrains.anko.*
 
 class AnnouncementViewHolder(
-    private val baseFragment: Fragment,
-    private val viewModel: HomeViewModel
-) : BaseViewHolder<NoticeData>(baseFragment.context!!) {
+    private val activity: AppCompatActivity
+) : BaseViewHolder<NoticeData>(activity) {
     override val itemSize: IntArray = intArrayOf(matchParent, autoSize(160))
 
     override fun _FrameLayout.createContentView() {

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/NewHomeFragment.kt

@@ -545,7 +545,7 @@ class NewAnnouncementUI(private val baseFragment: Fragment, private val viewModu
     lateinit var recyclerView: RecyclerView
 
     private val announcementAdapter: BaseAdapter<NoticeData, AnnouncementViewHolder> =
-        BaseAdapter { _, _ -> AnnouncementViewHolder(baseFragment, viewModule) }
+        BaseAdapter { _, _ -> AnnouncementViewHolder(baseFragment.getAppCompatActivity()) }
 
     val root = _FrameLayout(baseFragment.context!!).apply {
         verticalLayout {
@@ -591,7 +591,7 @@ class MessageUI(
     lateinit var recyclerView: RecyclerView
 
     private val announcementAdapter: BaseAdapter<NoticeData, AnnouncementViewHolder> =
-        BaseAdapter { _, _ -> AnnouncementViewHolder(baseFragment, viewModule) }
+        BaseAdapter { _, _ -> AnnouncementViewHolder(baseFragment.getAppCompatActivity()) }
 
     val root = _FrameLayout(baseFragment.context!!).apply {
         verticalLayout {

+ 663 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzHomeFragment.kt

@@ -0,0 +1,663 @@
+package cn.muchinfo.rma.view.base.home.yrdz
+
+import android.content.Intent
+import android.graphics.Rect
+import android.graphics.Typeface
+import android.net.Uri
+import android.os.Bundle
+import android.text.TextUtils
+import android.view.Gravity
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.FrameLayout
+import android.widget.TextView
+import android.widget.ViewFlipper
+import androidx.annotation.NonNull
+import androidx.annotation.Nullable
+import androidx.cardview.widget.CardView
+import androidx.fragment.app.Fragment
+import androidx.fragment.app.FragmentPagerAdapter
+import androidx.viewpager.widget.ViewPager
+import cn.bingoogolapple.bgabanner.BGABanner
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.BannerData
+import cn.muchinfo.rma.global.data.NoticeData
+import cn.muchinfo.rma.global.toShowTime3
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.lifecycle.getAppCompatActivity
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseFragment
+import cn.muchinfo.rma.view.base.WebActivity
+import cn.muchinfo.rma.view.base.app.Constant
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.hnstmain.bookingwarehouse.BookingWarehouseActivity
+import cn.muchinfo.rma.view.base.hnstmain.performancetemplate.PerformanceTemplateActivity
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.reference.ReferenceActivity
+import cn.muchinfo.rma.view.base.home.set.SettingActivity
+import cn.muchinfo.rma.view.base.home.yrdz.market.IndexData
+import cn.muchinfo.rma.view.base.home.yrdz.market.IndexViewHolder
+import cn.muchinfo.rma.view.base.home.yrdz.market.YrdzMarketFragment
+import cn.muchinfo.rma.view.eventbus.MainTabSelectMessageEvent
+import com.blankj.utilcode.util.*
+import com.facebook.drawee.view.SimpleDraweeView
+import com.qmuiteam.qmui.util.QMUIDisplayHelper
+import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
+import com.qmuiteam.qmui.widget.tab.QMUITabSegment
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.information_management.hnstocks.message.MessageDetailsActivity
+import org.greenrobot.eventbus.EventBus
+import org.jetbrains.anko.*
+import org.jetbrains.anko.support.v4.UI
+import org.jetbrains.anko.support.v4.viewPager
+
+/**
+ * 云融大宗的首页
+ */
+class YrdzHomeFragment : BaseFragment<YrdzHomeViewModel>(){
+
+    companion object {
+        fun newInstance() = YrdzHomeFragment()
+    }
+
+    // 下拉刷新
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    lateinit var segment: QMUITabSegment
+    lateinit var segment1: QMUITabSegment
+    var selectedTabIndex: Int = 0
+    private lateinit var viewPager: ViewPager
+
+
+    //viewpager的适配器
+    private var newPagerAdapter: FragmentPagerAdapter? = null
+
+    //tabSegment标题
+    private val newTabsArray: ArrayList<String> = arrayListOf()
+
+    //viewpager绑定的页面集合
+    private val newTabFragment: ArrayList<Fragment> = arrayListOf()
+
+    lateinit var noticeViewFlipper : ViewFlipper
+
+
+
+    //
+    val indexAdapter: BaseAdapter<IndexData, IndexViewHolder> =
+        BaseAdapter { _, _ ->
+            IndexViewHolder(
+                this
+            )
+        }
+
+
+    fun initMenuData() {
+        newTabsArray.add("通用塑料")
+        newTabFragment.add(YrdzMarketFragment.getInstance("通用塑料"))
+
+        newTabsArray.add("工程塑料")
+        newTabFragment.add(YrdzMarketFragment.getInstance("工程塑料"))
+
+        newTabsArray.add("特种工程塑料")
+        newTabFragment.add(YrdzMarketFragment.getInstance("特种工程塑料"))
+
+        newTabsArray.add("合金塑料")
+        newTabFragment.add(YrdzMarketFragment.getInstance("合金塑料"))
+
+        newTabsArray.add("热塑弹性体")
+        newTabFragment.add(YrdzMarketFragment.getInstance("热塑弹性体"))
+
+        newTabsArray.add("降解塑料")
+        newTabFragment.add(YrdzMarketFragment.getInstance("降解塑料"))
+
+        newTabsArray.add("热固性塑料")
+        newTabFragment.add(YrdzMarketFragment.getInstance("降解塑料"))
+
+        newPagerAdapter = object : FragmentPagerAdapter(
+            getAppCompatActivity().supportFragmentManager,
+            BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
+        ) {
+            @NonNull
+            override fun getItem(position: Int): Fragment {
+                return newTabFragment[position]
+            }
+
+            override fun getCount(): Int {
+                return newTabFragment.size
+            }
+
+            @Nullable
+            override fun getPageTitle(position: Int): CharSequence? {
+                return newTabsArray[position]
+            }
+        }
+    }
+
+    private fun initViewFlipper(notice: List<NoticeData>) {
+        for (i in 0 until notice.size) {
+            val view = TextView(context)
+            val params = FrameLayout.LayoutParams(
+                ViewGroup.LayoutParams.WRAP_CONTENT,
+                ViewGroup.LayoutParams.WRAP_CONTENT
+            )
+            params.gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+            view.layoutParams = params
+            view.text = notice[i].title
+            view.maxLines = 1
+            view.ellipsize = TextUtils.TruncateAt.END
+            view.setTextColor(context?.resources?.getColor(R.color.rma_black_33)!!)
+            view.textSize = 12f
+            view.setOnClickListener(View.OnClickListener {
+                val intent = Intent()
+                intent.putExtra("data",notice.get(i))
+                intent.setClass(context!!, MessageDetailsActivity::class.java)
+                ActivityUtils.startActivity(intent)
+            })
+            noticeViewFlipper.addView(view)
+        }
+        //是否自动开始滚动
+        noticeViewFlipper.isAutoStart = true
+        //滚动时间
+        noticeViewFlipper.flipInterval = 3000
+        //开始滚动
+        noticeViewFlipper.startFlipping()
+        //出入动画
+        noticeViewFlipper.setOutAnimation(context, R.anim.slide_out_right)
+        noticeViewFlipper.setInAnimation(context, R.anim.slide_in_left)
+    }
+
+
+    override fun onCreateView(
+        inflater: LayoutInflater,
+        container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        return UI {
+            initMenuData()
+            viewModel.getBanner()
+            viewModel.setDataList()
+            viewModel.queryNotice()
+            verticalLayout {
+                linearLayout {
+                    background = resources.getDrawable(R.color.main_title_bg_color)
+                    verticalLayout {
+                       gravity = Gravity.CENTER
+                        textView {
+                            text = "云融"
+                            textColorInt = R.color.white
+                            textSizeAuto = 36
+                        }.lparams(wrapContent, wrapContent) {
+                            gravity = Gravity.CENTER_HORIZONTAL
+                        }
+
+                    }.lparams(autoSize(620), autoSize(90)) {
+                        marginStart = autoSize(140)
+                    }
+
+                    imageView {
+                        onThrottleFirstClick {
+                            val intent = Intent()
+                            intent.setClass(context, YrdzNoticeActivity::class.java)
+                            ActivityUtils.startActivity(intent)
+                        }
+                        imageResource = R.mipmap.yrdz_topright_icon
+                    }.lparams(autoSize(45), autoSize(45)) {
+                        marginStart = autoSize(32)
+                        topMargin = autoSize(20)
+                    }
+
+                }.lparams(matchParent, autoSize(120))
+
+                relativeLayout {
+                    nestedScrollView{
+                        setOnScrollChangeListener(object : View.OnScrollChangeListener {
+                            override fun onScrollChange(
+                                p0: View?,
+                                p1: Int,
+                                p2: Int,
+                                p3: Int,
+                                p4: Int
+                            ) {
+                                val scrollRect = Rect()
+                                getHitRect(scrollRect)
+                                LogUtils.eTag("adakhsfkjahsfa", "x = " + p1 + "y = " + p2)
+                                if (p2 > 1000) {
+                                    segment1.visibility = View.VISIBLE
+                                } else {
+                                    segment1.visibility = View.INVISIBLE
+                                }
+                            }
+                        })
+                        verticalLayout {
+                            background = resources.getDrawable(R.color.white)
+                            inflateLayout<BGABanner>(R.layout.banner) {
+                                // TODO 目前没有banner
+                                viewModel.bannerList.bindOptional(context) {
+                                    setData(
+                                        R.layout.item_fresco,
+                                        it,
+                                        null
+                                    )
+                                }
+                                setDelegate { banner, itemView, model, position ->
+                                    val data = model as BannerData
+                                    val intent = Intent()
+                                    intent.putExtra("url",data.url)
+                                    intent.putExtra("title",data.title)
+                                    intent.setClass(context, WebActivity::class.java)
+                                    ActivityUtils.startActivity(intent)
+                                }
+//                                setDelegate(new BGABanner.Delegate() {
+//                                    @Override
+//                                    public void onBannerItemClick(BGABanner banner, View itemView, @Nullable Object model, int position) {
+//
+//                                    }
+//                                });
+
+
+                                setAdapter(object : BGABanner.Adapter<CardView, BannerData> {
+                                    override fun fillBannerItem(
+                                        banner: BGABanner?,
+                                        itemView: CardView?,
+                                        model: BannerData?,
+                                        position: Int
+                                    ) {
+                                        val simpleDraweeView: SimpleDraweeView =
+                                            itemView!!.findViewById(R.id.sdv_item_fresco_content)
+                                        simpleDraweeView.setImageURI(
+                                            Uri.parse(
+                                                SPUtils.getInstance().getString(
+                                            Constant.openApiUrl) + model?.imagepath?.substring(1)))
+                                    }
+                                })
+
+                            }.lparams(matchParent, autoSize(400))
+
+                            itemView()
+
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL
+                                imageView {
+                                    imageResource = R.mipmap.yrdz_nctice_icon
+                                }.lparams(autoSize(36), autoSize(36)){
+                                    marginStart = autoSize(36)
+                                }
+
+                                viewFlipper {
+                                    noticeViewFlipper = this
+                                    viewModel.noticeDataList.bindOptional(context){
+                                        initViewFlipper(it ?: arrayListOf())
+                                    }
+                                }.lparams(matchParent, autoSize(72)){
+                                    marginStart = autoSize(36)
+                                }
+
+                            }.lparams(matchParent, autoSize(72))
+
+                            itemView()
+
+                            linearLayout {
+                                //参考行情
+                                relativeLayout {
+                                    verticalLayout {
+                                        onThrottleFirstClick {
+                                            val intent = Intent()
+                                            intent.setClass(
+                                                context,
+                                                ReferenceActivity::class.java
+                                            )
+                                            ActivityUtils.startActivity(intent)
+                                        }
+                                        imageView {
+                                            imageResource = R.mipmap.yrdz_reference_prices
+                                        }.lparams(autoSize(72), autoSize(72)) {
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+
+                                        textView {
+                                            text = "参考行情"
+                                            textColorInt = R.color.black
+                                            textSizeAuto = 26
+                                        }.lparams(wrapContent, wrapContent) {
+                                            topMargin = autoSize(20)
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+                                    }.lparams(matchParent, matchParent)
+
+                                    textView {
+                                        visibility = View.GONE
+                                        textColorInt = R.color.p_global_write_color
+                                        textSizeAuto = 15
+                                        setPadding(
+                                            autoSize(10),
+                                            autoSize(6),
+                                            autoSize(10),
+                                            autoSize(6)
+                                        )
+                                        backgroundDrawable =
+                                            createRoundRectDrawable("#fe671a", 45)
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(130)
+                                    }
+                                }.lparams(autoSize(225), matchParent)
+
+                                relativeLayout {
+                                    verticalLayout {
+                                        onThrottleFirstClick {
+                                            EventBus.getDefault().post(MainTabSelectMessageEvent(1))// 黄老板说的要跳去仓单贸易
+                                        }
+                                        imageView {
+                                            imageResource = R.mipmap.yrdz_home_wymh_icon
+                                        }.lparams(autoSize(72), autoSize(72)) {
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+
+                                        textView {
+                                            text = "我要买货"
+                                            textColorInt = R.color.black
+                                            textSizeAuto = 26
+                                        }.lparams(wrapContent, wrapContent) {
+                                            topMargin = autoSize(20)
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+                                    }.lparams(matchParent, matchParent)
+
+                                    textView {
+                                        visibility = View.GONE
+                                        textColorInt = R.color.p_global_write_color
+                                        textSizeAuto = 15
+                                        setPadding(
+                                            autoSize(10),
+                                            autoSize(6),
+                                            autoSize(10),
+                                            autoSize(6)
+                                        )
+                                        backgroundDrawable =
+                                            createRoundRectDrawable("#fe671a", 45)
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(130)
+                                    }
+                                }.lparams(autoSize(225), matchParent)
+
+                                relativeLayout {
+                                    verticalLayout {
+                                        onThrottleFirstClick {
+                                            val intent = Intent()
+                                            intent.setClass(
+                                                context,
+                                                BookingWarehouseActivity::class.java
+                                            )
+                                            ActivityUtils.startActivity(intent)
+                                        }
+                                        imageView {
+                                            imageResource = R.mipmap.yrdz_home_wyys_icon
+                                        }.lparams(autoSize(72), autoSize(72)) {
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+
+                                        textView {
+                                            text = "我要预售"
+                                            textColorInt = R.color.black
+                                            textSizeAuto = 26
+                                        }.lparams(wrapContent, wrapContent) {
+                                            topMargin = autoSize(20)
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+                                    }.lparams(matchParent, matchParent)
+
+                                    textView {
+                                        visibility = View.GONE
+                                        textColorInt = R.color.p_global_write_color
+                                        textSizeAuto = 15
+                                        setPadding(
+                                            autoSize(10),
+                                            autoSize(6),
+                                            autoSize(10),
+                                            autoSize(6)
+                                        )
+                                        backgroundDrawable =
+                                            createRoundRectDrawable("#fe671a", 45)
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(130)
+                                    }
+                                }.lparams(autoSize(225), matchParent)
+
+                                relativeLayout {
+                                    verticalLayout {
+                                        onThrottleFirstClick {
+                                            val intent = Intent()
+                                            intent.setClass(
+                                                context,
+                                                PerformanceTemplateActivity::class.java
+                                            )
+                                            ActivityUtils.startActivity(intent)
+                                        }
+                                        imageView {
+                                            imageResource = R.mipmap.main_business_5
+                                        }.lparams(autoSize(72), autoSize(72)) {
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+
+                                        textView {
+                                            text = "履约管理"
+                                            textColorInt = R.color.black
+                                            textSizeAuto = 26
+                                        }.lparams(wrapContent, wrapContent) {
+                                            topMargin = autoSize(20)
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+                                    }.lparams(matchParent, matchParent)
+
+                                    textView {
+                                        visibility = View.GONE
+                                        textColorInt = R.color.p_global_write_color
+                                        textSizeAuto = 15
+                                        setPadding(
+                                            autoSize(10),
+                                            autoSize(6),
+                                            autoSize(10),
+                                            autoSize(6)
+                                        )
+                                        backgroundDrawable =
+                                            createRoundRectDrawable("#fe671a", 45)
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(130)
+                                    }
+                                }.lparams(autoSize(225), matchParent)
+
+                            }.lparams(matchParent, autoSize(140)) {
+                                topMargin = autoSize(40)
+                            }
+
+                            tabSegment {
+                                segment = this
+                                background = resources.getDrawable(R.color.white)
+                                addOnTabSelectedListener(object :
+                                    QMUITabSegment.OnTabSelectedListener {
+                                    override fun onDoubleTap(index: Int) {}
+                                    override fun onTabReselected(index: Int) {}
+                                    override fun onTabUnselected(index: Int) {}
+                                    override fun onTabSelected(index: Int) {
+                                        selectedTabIndex = index
+                                    }
+                                })
+                                mode = QMUITabSegment.MODE_SCROLLABLE
+                                setIndicator(
+                                    QMUITabIndicator(
+                                        QMUIDisplayHelper.dp2px(context, 2),
+                                        false,
+                                        true
+                                    )
+                                )
+                                setDefaultTextSize(
+                                    ConvertUtils.sp2px(16f),
+                                    ConvertUtils.sp2px(18f)
+                                )
+
+                            }.lparams(matchParent, autoSize(100))
+
+                            view {
+                                background = resources.getDrawable(R.color.main_hit_bg_color)
+                            }.lparams(matchParent, autoSize(1)) {
+                                marginStart = autoSize(32)
+                                marginEnd = autoSize(32)
+                            }
+                            viewPager {
+                                id = R.id.view_pager
+                                background = resources.getDrawable(R.color.white)
+                                viewPager = this
+                                adapter = newPagerAdapter
+                            }.lparams(matchParent, autoSize(150))
+
+                            segment.setupWithViewPager(viewPager)
+                            segment.selectTab(selectedTabIndex)
+
+
+
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL
+
+                                view {
+                                    background = resources.getDrawable(R.color.rma_blue_color)
+                                }.lparams(autoSize(12), autoSize(43))
+
+                                textView {
+                                    text = "云融"
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_black_33
+                                    typeface = Typeface.defaultFromStyle(Typeface.BOLD)
+                                }.lparams(wrapContent, wrapContent) {
+                                    marginStart = autoSize(36)
+                                }
+
+                                emptyView()
+
+                                imageView {
+                                    imageResource = R.mipmap.yrdz_chart_icon
+                                }.lparams(autoSize(36), autoSize(36)) {
+                                    marginEnd = autoSize(36)
+                                }
+                            }.lparams(matchParent, autoSize(80))
+
+                            linearLayout {
+                                linearLayout {
+
+                                }.lparams(0, autoSize(70), 1f)
+
+                                linearLayout {
+                                    gravity = Gravity.CENTER
+                                    textView {
+                                        text = TimeUtils.millis2String(TimeUtils.getNowMills().minus(86400))
+                                            ?.toShowTime3("dd") + "日"
+                                        textSizeAuto = 29
+                                        textColorInt = R.color.hint_text_color
+                                    }.lparams(wrapContent, wrapContent)
+                                }.lparams(0, autoSize(70), 1f)
+
+                                linearLayout {
+                                    gravity = Gravity.CENTER
+                                    textView {
+                                        text = TimeUtils.millis2String(TimeUtils.getNowMills().minus(172800))
+                                            ?.toShowTime3("dd") + "日"
+                                        textSizeAuto = 29
+                                        textColorInt = R.color.hint_text_color
+                                    }.lparams(wrapContent, wrapContent)
+                                }.lparams(0, autoSize(70), 1f)
+
+                                linearLayout {
+                                    gravity = Gravity.CENTER
+                                    textView {
+                                        text = "涨跌"
+                                        textSizeAuto = 29
+                                        textColorInt = R.color.hint_text_color
+                                    }.lparams(wrapContent, wrapContent)
+                                }.lparams(0, autoSize(70), 1f)
+
+                                linearLayout {
+                                    gravity = Gravity.CENTER
+                                    textView {
+                                        text = "涨幅"
+                                        textSizeAuto = 29
+                                        textColorInt = R.color.hint_text_color
+                                    }.lparams(wrapContent, wrapContent)
+                                }.lparams(0, autoSize(70), 1f)
+                            }.lparams(matchParent, autoSize(70))
+
+                            statusLayout(contentBlock = {
+                                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                                setRetryAction {
+
+                                }
+                                swipeToLoadLayout {
+                                    swipeToLayout = this
+                                    setEnableRefresh(false)
+                                    setEnableLoadMore(false)
+                                    setOnRefreshListener {
+
+                                    }
+                                    setEnableScrollContentWhenLoaded(false)
+                                    setEnableLoadMoreWhenContentNotFull(false)
+
+                                    // 未提交列表
+                                    recyclerView {
+                                        background = resources.getDrawable(R.color.white)
+                                        adapter = indexAdapter
+                                    }.lparams(matchParent, matchParent)
+                                }
+                            }, emptyBlock = {
+                                emptyView(hint = resources.getString(R.string.now_no_data))
+                            }).lparams(matchParent, matchParent)
+
+                            viewModel.dataList.bindOptional(context) {
+                                if (it?.isEmpty() == true || it?.size == 0) {
+                                    statusLayout.showEmpty()
+                                } else {
+                                    if (swipeToLayout.getIsRefreshing()) {
+                                        swipeToLayout.finishRefresh()
+                                    }
+                                    statusLayout.showSuccess()
+                                    indexAdapter.setNewData(it)
+                                }
+                            }
+
+                        }
+                    }.lparams(matchParent, matchParent)
+
+                    tabSegment {
+                        visibility = View.GONE
+                        segment1 = this
+                        visibility = View.INVISIBLE
+                        background = resources.getDrawable(R.color.white)
+                        addOnTabSelectedListener(object : QMUITabSegment.OnTabSelectedListener {
+                            override fun onDoubleTap(index: Int) {}
+                            override fun onTabReselected(index: Int) {}
+                            override fun onTabUnselected(index: Int) {}
+                            override fun onTabSelected(index: Int) {
+                                selectedTabIndex = index
+                            }
+                        })
+                        setIndicator(
+                            QMUITabIndicator(
+                                QMUIDisplayHelper.dp2px(context, 2),
+                                false,
+                                true
+                            )
+                        )
+                        setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
+//                        setHasIndicator(true)
+//                        setDefaultNormalColor(Color.parseColor("#000000"))
+//                        setDefaultSelectedColor(Color.parseColor("#60a1e3"))
+//                        setTabTextSize(ConvertUtils.sp2px(16f))
+                    }.lparams(matchParent, autoSize(100))
+
+                    segment1.setupWithViewPager(viewPager)
+                    segment1.selectTab(selectedTabIndex)
+                }
+            }
+        }.view
+    }
+
+}

+ 108 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzHomeViewModel.kt

@@ -0,0 +1,108 @@
+package cn.muchinfo.rma.view.base.home.yrdz
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.BannerData
+import cn.muchinfo.rma.global.data.NoticeData
+import cn.muchinfo.rma.netManage.base.ResponseCallback
+import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.autoWidget.remove
+import cn.muchinfo.rma.view.base.BaseViewModel
+import cn.muchinfo.rma.view.base.app.BaseResult
+import cn.muchinfo.rma.view.base.app.Constant
+import cn.muchinfo.rma.view.base.home.yrdz.market.IndexData
+import com.blankj.utilcode.util.LogUtils
+import com.blankj.utilcode.util.SPUtils
+import mtp.polymer.com.autowidget.utils.TaskUiModel
+import okhttp3.Call
+import java.lang.Exception
+
+/**
+ * 云融大宗
+ */
+class YrdzHomeViewModel : BaseViewModel(){
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    val bannerList : MutableLiveData<List<BannerData>> = MutableLiveData()
+
+    //数据
+    val dataList : MutableLiveData<List<IndexData>> = MutableLiveData()
+
+    /**
+     * 公告信息
+     */
+    val noticeDataList : MutableLiveData<List<NoticeData>> = MutableLiveData()
+
+    fun setDataList(){
+        val list = arrayListOf(
+            IndexData(name = "ABS",firstNumber = 18234.0,secondNumber = 18673.0),
+            IndexData(name = "PA6",firstNumber = 17134.0,secondNumber = 16993.0),
+            IndexData(name = "PA67",firstNumber = 18312.0,secondNumber = 18893.0),
+            IndexData(name = "PC",firstNumber = 19782.0,secondNumber = 17293.0),
+            IndexData(name = "PE",firstNumber = 16128.0,secondNumber = 16993.0),
+            IndexData(name = "PVC",firstNumber = 15123.0,secondNumber = 15193.0)
+        )
+
+        dataList.postValue(list)
+    }
+
+
+
+    /**
+     * 通知公告查询
+     */
+    fun queryNotice(){
+//        noticeDataList.postValue(arrayListOf(NoticeData(autoid = "1",title = "djahskdhakjshkahskjhakjsdhakjdshkjashdkjahdskjahsdjkad"),
+//            NoticeData(autoid = "2",title = "贺卡活动空间啊会死的恐惧啊会死的恐惧啊会死的恐惧啊还得看撒"),
+//            NoticeData(autoid = "3",title = "打卡是否看来佛 i 啊UFO i 啊 u 上帝啊 u 都 i 啊 u 山东 iu 阿斯哦独傲"),
+//            NoticeData(autoid = "4",title = "打卡大课间活动空间啊会多少空间啊会的恐惧啊会死肯德基哈开机速度和空间啊会的")))
+        val params = mutableMapOf<String, String>().apply {
+            put("loginID", GlobalDataCollection.instance?.loginRsp?.loginID.toString())
+            put("msgType","1")
+        }
+
+        MyApplication.getInstance()?.commonManager?.queryNotice(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                noticeDataList.postValue(respData)
+            }
+        }
+    }
+
+
+    /**
+     * 在请求之前先获取数据库存储的banner信息
+     */
+    fun getBanner(){
+        val params = mutableMapOf<String,String>()
+        params.put("imageType","1")
+        MyOkHttpUtils().query(URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Common/QueryImageConfigs",
+            callback = object : ResponseCallback<BaseResult<List<BannerData>>>() {
+                override fun onResponse(response: BaseResult<List<BannerData>>?, id: Int) {
+                    getBannerUrlList(response?.data ?: arrayListOf())
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    LogUtils.eTag("asdasdadasa",e?.message)
+                }
+
+            },params = params,type = "1")
+    }
+
+    /**
+     * @param datalist List<BannerEntity>
+     */
+    fun getBannerUrlList(datalist : List<BannerData>){
+        val bannerUrlList = arrayListOf<String>()
+        datalist.forEach {
+            bannerUrlList.add(SPUtils.getInstance().getString(Constant.openApiUrl) + it.imagepath.substring(1))
+        }
+        bannerList.postValue(datalist.remove {
+            it.isshow == "0"
+        })
+    }
+
+}

+ 233 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzNoticeActivity.kt

@@ -0,0 +1,233 @@
+package cn.muchinfo.rma.view.base.home.yrdz
+
+import android.content.Intent
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import android.view.ViewGroup
+import androidx.appcompat.app.AppCompatActivity
+import androidx.fragment.app.Fragment
+import androidx.recyclerview.widget.RecyclerView
+import androidx.viewpager.widget.PagerAdapter
+import androidx.viewpager.widget.ViewPager
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.NoticeData
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.home.AnnouncementViewHolder
+import com.blankj.utilcode.util.ConvertUtils
+import com.qmuiteam.qmui.util.QMUIDisplayHelper
+import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
+import com.qmuiteam.qmui.widget.tab.QMUITabSegment
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
+import org.jetbrains.anko.*
+import org.jetbrains.anko.support.v4.viewPager
+
+/**
+ * 云融大宗消息通知activity
+ */
+class YrdzNoticeActivity : BaseActivity<YrdzNoticeViewModel>() {
+
+    lateinit var segment: QMUITabSegment
+    var selectedTabIndex: Int = 0
+    private lateinit var viewPager: ViewPager
+
+    private val yrdzAnnouncementUI by lazy { YrdzAnnouncementUI(this, viewModel) }//当前库存ui
+    private val yrdzMessageUI by lazy { YrdzMessageUI(this, viewModel) }//申请记录ui
+
+    //viewpager的适配器
+    private var newPagerAdapter: PagerAdapter? = null
+
+    //tabSegment标题
+    private val newTabsArray: ArrayList<String> = arrayListOf()
+
+    //暂存的页面组
+    private val uiList: ArrayList<_FrameLayout> = arrayListOf()
+
+    fun initMenuData() {
+
+        newTabsArray.add("公告")
+        uiList.add(yrdzAnnouncementUI.root)
+
+        newTabsArray.add("消息")
+        uiList.add(yrdzMessageUI.root)
+
+        newPagerAdapter = object : PagerAdapter() {
+
+            override fun getPageTitle(position: Int): CharSequence? = newTabsArray[position]
+
+            override fun instantiateItem(container: ViewGroup, position: Int): Any {
+                return uiList.get(position).apply {
+                    container.addView(
+                        this,
+                        ViewGroup.LayoutParams(matchParent, matchParent)
+                    )
+                }
+            }
+
+            override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
+                (`object` as? View)?.let { container.removeView(it) }
+            }
+
+            override fun isViewFromObject(view: View, `object`: Any): Boolean = view == `object`
+
+            override fun getCount(): Int = newTabsArray.size
+
+        }
+
+    }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        initMenuData()
+        verticalLayout {
+
+            background = resources.getDrawable(R.color.main_hit_bg_color)
+            //页面标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "现货市价"
+                }
+            }
+
+
+            tabSegment {
+                segment = this
+                background = resources.getDrawable(R.color.segtabment_bg_color)
+                addOnTabSelectedListener(object :
+                    QMUITabSegment.OnTabSelectedListener {
+                    override fun onDoubleTap(index: Int) {}
+                    override fun onTabReselected(index: Int) {}
+                    override fun onTabUnselected(index: Int) {}
+                    override fun onTabSelected(index: Int) {
+                        selectedTabIndex = index
+                    }
+                })
+                setIndicator(
+                    QMUITabIndicator(
+                        QMUIDisplayHelper.dp2px(context, 2),
+                        false,
+                        true
+                    )
+                )
+                setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
+            }.lparams(matchParent, autoSize(80))
+
+            view {
+                background = resources.getDrawable(R.color.main_hit_bg_color)
+            }.lparams(matchParent, autoSize(1)) {
+                marginStart = autoSize(32)
+                marginEnd = autoSize(32)
+            }
+            viewPager {
+                background = resources.getDrawable(R.color.white)
+                viewPager = this
+                adapter = newPagerAdapter
+            }.lparams(matchParent, matchParent)
+
+            segment.setupWithViewPager(viewPager)
+            segment.selectTab(selectedTabIndex)
+
+        }
+    }
+
+}
+
+
+/**
+ * 公告
+ */
+class YrdzAnnouncementUI(
+    private val activity: AppCompatActivity,
+    private val viewModule: YrdzNoticeViewModel
+) {
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    lateinit var recyclerView: RecyclerView
+
+    private val announcementAdapter: BaseAdapter<NoticeData, AnnouncementViewHolder> =
+        BaseAdapter { _, _ -> AnnouncementViewHolder(activity) }
+
+    val root = _FrameLayout(activity).apply {
+        verticalLayout {
+            viewModule.queryNotice()
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(false)
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = announcementAdapter
+                        isNestedScrollingEnabled = false
+                    }.lparams(matchParent, matchParent) {
+                        marginStart = autoSize(32)
+                        marginEnd = autoSize(20)
+                    }
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+            viewModule.noticeDataList.bindOptional(context) {
+                announcementAdapter.setNewData(it)
+            }
+        }
+    }
+}
+
+/**
+ * 消息
+ */
+class YrdzMessageUI(
+    private val activity: AppCompatActivity,
+    private val viewModule: YrdzNoticeViewModel
+) {
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    lateinit var recyclerView: RecyclerView
+
+    private val announcementAdapter: BaseAdapter<NoticeData, AnnouncementViewHolder> =
+        BaseAdapter { _, _ -> AnnouncementViewHolder(activity) }
+
+    val root = _FrameLayout(activity).apply {
+        verticalLayout {
+            viewModule.queryMessage()
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(false)
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = announcementAdapter
+                        isNestedScrollingEnabled = false
+                    }.lparams(matchParent, matchParent) {
+                        marginStart = autoSize(32)
+                        marginEnd = autoSize(20)
+                    }
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+            viewModule.messageDataList.bindOptional(context) {
+                announcementAdapter.setNewData(it)
+            }
+        }
+    }
+}

+ 55 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/YrdzNoticeViewModel.kt

@@ -0,0 +1,55 @@
+package cn.muchinfo.rma.view.base.home.yrdz
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.NoticeData
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.base.BaseViewModel
+
+/**
+ * 云融大宗消息通知页面viewmodel
+ */
+class YrdzNoticeViewModel : BaseViewModel(){
+
+    /**
+     * 公告信息
+     */
+    val noticeDataList : MutableLiveData<List<NoticeData>> = MutableLiveData()
+
+    /**
+     * 首页消息
+     */
+    val messageDataList : MutableLiveData<List<NoticeData>> = MutableLiveData()
+
+    /**
+     * 通知公告查询
+     */
+    fun queryNotice(){
+        val params = mutableMapOf<String, String>().apply {
+            put("loginID", GlobalDataCollection.instance?.loginRsp?.loginID.toString())
+            put("msgType","1")
+        }
+
+        MyApplication.getInstance()?.commonManager?.queryNotice(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                noticeDataList.postValue(respData)
+            }
+        }
+    }
+
+    /**
+     * 通知公告查询
+     */
+    fun queryMessage(){
+        val params = mutableMapOf<String, String>().apply {
+            put("loginID", GlobalDataCollection.instance?.loginRsp?.loginID.toString())
+            put("msgType","2")
+        }
+
+        MyApplication.getInstance()?.commonManager?.queryNotice(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                messageDataList.postValue(respData)
+            }
+        }
+    }
+}

+ 8 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/IndexData.kt

@@ -0,0 +1,8 @@
+package cn.muchinfo.rma.view.base.home.yrdz.market
+
+//指数数据
+data class IndexData(
+    var name : String = "",//指数名
+    var firstNumber : Double = 0.0,//前天的均价
+    var secondNumber : Double = 0.0//昨天的均价
+)

+ 114 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/IndexViewHolder.kt

@@ -0,0 +1,114 @@
+package cn.muchinfo.rma.view.base.home.yrdz.market
+
+import android.annotation.SuppressLint
+import android.view.Gravity
+import androidx.fragment.app.Fragment
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+class IndexViewHolder(private val fragment : Fragment) : BaseViewHolder<IndexData>(fragment.context!!){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    @SuppressLint("SetTextI18n")
+    override fun _FrameLayout.createContentView() {
+
+        verticalLayout {
+            linearLayout {
+                //名称
+                linearLayout {
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {
+                        data.bindOptional(context){
+                            text = it?.name
+                        }
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_blue_color
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(0, autoSize(80),1f)
+
+                //前天均价
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        data.bindOptional(context){
+                            text = it?.firstNumber?.toString()
+                        }
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+
+                }.lparams(0, autoSize(80),1f)
+
+                //昨天军舰
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        data.bindOptional(context){
+                            text = it?.secondNumber?.toString()
+                            val difference = it?.secondNumber?.minus(it.firstNumber)
+                            if (difference ?: 0.0 > 0){
+                                textColorInt = R.color.rma_red_color
+                            }else if (difference ?: 0.0 < 0){
+                                textColorInt = R.color.rma_green_color
+                            }else{
+                                textColorInt = R.color.rma_black_33
+                            }
+                        }
+                        textSizeAuto = 31
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(80),1f)
+
+                //涨跌额
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        data.bindOptional(context){
+                            val difference = it?.secondNumber?.minus(it.firstNumber)
+                            if (difference ?: 0.0 > 0){
+                                textColorInt = R.color.rma_red_color
+                            }else if (difference ?: 0.0 < 0){
+                                textColorInt = R.color.rma_green_color
+                            }else{
+                                textColorInt = R.color.rma_black_33
+                            }
+                            text = NumberUtils.roundNum(difference ?: 0.0,2)
+                        }
+                        textSizeAuto = 31
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(80),1f)
+
+                //涨跌幅
+                linearLayout {
+                    gravity = Gravity.CENTER
+                    textView {
+                        data.bindOptional(context){
+                            val difference = it?.secondNumber?.minus(it.firstNumber)
+                            if (difference ?: 0.0 > 0){
+                                textColorInt = R.color.rma_red_color
+                            }else if (difference ?: 0.0 < 0){
+                                textColorInt = R.color.rma_green_color
+                            }else{
+                                textColorInt = R.color.rma_black_33
+                            }
+                            text = NumberUtils.roundNum(difference?.div(it.firstNumber) ?: 0.0,2) + "%"
+                        }
+                        textSizeAuto = 31
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(0, autoSize(80),1f)
+            }.lparams(matchParent, autoSize(94))
+
+            itemView()
+        }.lparams(matchParent, wrapContent)
+
+    }
+
+}

+ 177 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/YrdzMarketFragment.kt

@@ -0,0 +1,177 @@
+package cn.muchinfo.rma.view.base.home.yrdz.market
+
+import android.annotation.SuppressLint
+import android.graphics.Typeface
+import android.os.Bundle
+import android.view.Gravity
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.account.loginQeruy.ExternalExchanges
+import cn.muchinfo.rma.global.toShowTime3
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseFragment
+import cn.muchinfo.rma.view.base.future.markets.MarketFragment
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import com.blankj.utilcode.util.TimeUtils
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import org.jetbrains.anko.*
+import org.jetbrains.anko.support.v4.UI
+
+/**
+ * 云融大宗的首页行情fragment
+ */
+class YrdzMarketFragment(title: String) : BaseFragment<YrdzMarketViewModel>() {
+
+    var data: String? = title
+
+    companion object {
+        fun getInstance(title: String) = YrdzMarketFragment(title)
+    }
+
+    //label adapter
+    val labelAdapter: BaseAdapter<String, YrdzMarketLabelViewHolder> =
+        BaseAdapter { _, _ ->
+            YrdzMarketLabelViewHolder(
+                this
+            )
+        }
+
+
+
+    @SuppressLint("SetTextI18n")
+    override fun onCreateView(
+        inflater: LayoutInflater,
+        container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        return UI {
+            viewModel.setDataList()
+            verticalLayout {
+                background = resources.getDrawable(R.color.white)
+
+               verticalLayout {
+                   linearLayout {
+                       gravity = Gravity.CENTER_VERTICAL
+                       textView {
+                           setPadding(autoSize(25), 0, autoSize(25),0)
+                           text = "ABC"
+                           textSizeAuto = 29
+                           textColorStr = "#888888"
+                           backgroundResource = R.drawable.yrdz_label_bg
+                       }.lparams(wrapContent, autoSize(48)){
+                           marginStart = autoSize(20)
+                       }
+
+                       textView {
+                           setPadding(autoSize(25), 0, autoSize(25),0)
+                           text = "ABS高胶粉"
+                           textSizeAuto = 29
+                           textColorStr = "#888888"
+                           backgroundResource = R.drawable.yrdz_label_bg
+                       }.lparams(wrapContent, autoSize(48)){
+                           marginStart = autoSize(20)
+                       }
+
+                       textView {
+                           setPadding(autoSize(25), 0, autoSize(25),0)
+                           text = "AS(SAN)"
+                           textSizeAuto = 29
+                           textColorStr = "#888888"
+                           backgroundResource = R.drawable.yrdz_label_bg
+                       }.lparams(wrapContent, autoSize(48)){
+                           marginStart = autoSize(20)
+                       }
+
+                       textView {
+                           setPadding(autoSize(25), 0, autoSize(25),0)
+                           text = "EPS"
+                           textSizeAuto = 29
+                           textColorStr = "#888888"
+                           backgroundResource = R.drawable.yrdz_label_bg
+                       }.lparams(wrapContent, autoSize(48)){
+                           marginStart = autoSize(20)
+                       }
+
+                       textView {
+                           setPadding(autoSize(25), 0, autoSize(25),0)
+                           text = "CA"
+                           textSizeAuto = 29
+                           textColorStr = "#888888"
+                           backgroundResource = R.drawable.yrdz_label_bg
+                       }.lparams(wrapContent, autoSize(48)){
+                           marginStart = autoSize(20)
+                       }
+
+                       textView {
+                           setPadding(autoSize(25), 0, autoSize(25),0)
+                           text = "EAA"
+                           textSizeAuto = 29
+                           textColorStr = "#888888"
+                           backgroundResource = R.drawable.yrdz_label_bg
+                       }.lparams(wrapContent, autoSize(48)){
+                           marginStart = autoSize(20)
+                       }
+                   }.lparams(matchParent, autoSize(75))
+
+                   linearLayout {
+                       gravity = Gravity.CENTER_VERTICAL
+                       textView {
+                           setPadding(autoSize(25), 0, autoSize(25),0)
+                           text = "EVA"
+                           textSizeAuto = 29
+                           textColorStr = "#888888"
+                           backgroundResource = R.drawable.yrdz_label_bg
+                       }.lparams(wrapContent, autoSize(48)){
+                           marginStart = autoSize(20)
+                       }
+
+                       textView {
+                           setPadding(autoSize(25), 0, autoSize(25),0)
+                           text = "GPPS"
+                           textSizeAuto = 29
+                           textColorStr = "#888888"
+                           backgroundResource = R.drawable.yrdz_label_bg
+                       }.lparams(wrapContent, autoSize(48)){
+                           marginStart = autoSize(20)
+                       }
+
+                       textView {
+                           setPadding(autoSize(25), 0, autoSize(25),0)
+                           text = "HDPE"
+                           textSizeAuto = 29
+                           textColorStr = "#888888"
+                           backgroundResource = R.drawable.yrdz_label_bg
+                       }.lparams(wrapContent, autoSize(48)){
+                           marginStart = autoSize(20)
+                       }
+
+                       textView {
+                           setPadding(autoSize(25), 0, autoSize(25),0)
+                           text = "K(Q)胶"
+                           textSizeAuto = 29
+                           textColorStr = "#888888"
+                           backgroundResource = R.drawable.yrdz_label_bg
+                       }.lparams(wrapContent, autoSize(48)){
+                           marginStart = autoSize(20)
+                       }
+
+                       textView {
+                           setPadding(autoSize(25), 0, autoSize(25),0)
+                           text = "HIPS"
+                           textSizeAuto = 29
+                           textColorStr = "#888888"
+                           backgroundResource = R.drawable.yrdz_label_bg
+                       }.lparams(wrapContent, autoSize(48)){
+                           marginStart = autoSize(20)
+                       }
+                   }.lparams(matchParent, autoSize(75))
+               }.lparams(matchParent, autoSize(250))
+
+            }
+        }.view
+    }
+
+}

+ 31 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/YrdzMarketLabelViewHolder.kt

@@ -0,0 +1,31 @@
+package cn.muchinfo.rma.view.base.home.yrdz.market
+
+import android.view.Gravity
+import androidx.fragment.app.Fragment
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+class YrdzMarketLabelViewHolder(private val fragment : Fragment) : BaseViewHolder<String>(fragment.context!!){
+    override val itemSize: IntArray = intArrayOf(wrapContent, autoSize(50))
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            gravity = Gravity.CENTER
+            backgroundResource = R.drawable.yrdz_label_bg
+            setPadding(autoSize(10),0, autoSize(10),0)
+            textView {
+                data.bindOptional(context){
+                    text = it
+                }
+                textSizeAuto = 29
+                textColorInt = R.color.rma_black_33
+            }.lparams(wrapContent, wrapContent)
+        }.lparams(wrapContent, autoSize(50))
+    }
+
+}

+ 26 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/yrdz/market/YrdzMarketViewModel.kt

@@ -0,0 +1,26 @@
+package cn.muchinfo.rma.view.base.home.yrdz.market
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.view.base.BaseViewModel
+
+/**
+ * 云融大宗
+ */
+class YrdzMarketViewModel : BaseViewModel(){
+
+    //数据
+    val dataList : MutableLiveData<List<IndexData>> = MutableLiveData()
+
+    fun setDataList(){
+        val list = arrayListOf(
+            IndexData(name = "ABS",firstNumber = 18234.0,secondNumber = 18673.0),
+            IndexData(name = "PA6",firstNumber = 17134.0,secondNumber = 16993.0),
+            IndexData(name = "PA67",firstNumber = 18312.0,secondNumber = 18893.0),
+            IndexData(name = "PC",firstNumber = 19782.0,secondNumber = 17293.0),
+            IndexData(name = "PE",firstNumber = 16128.0,secondNumber = 16993.0),
+            IndexData(name = "PVC",firstNumber = 15123.0,secondNumber = 15193.0))
+
+        dataList.postValue(list)
+    }
+
+}

+ 11 - 0
RMA/app/src/main/res/anim/slide_in_left.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+  <translate
+      android:duration="500"
+      android:fromXDelta="0"
+      android:toXDelta="-100%p" />
+  <alpha
+      android:duration="500"
+      android:fromAlpha="0.0"
+      android:toAlpha="1.0" />
+</set>

+ 11 - 0
RMA/app/src/main/res/anim/slide_out_right.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+  <translate
+      android:duration="500"
+      android:fromXDelta="100%p"
+      android:toXDelta="0" />
+  <alpha
+      android:duration="500"
+      android:fromAlpha="0.0"
+      android:toAlpha="1.0" />
+</set>

+ 6 - 0
RMA/app/src/main/res/drawable/yrdz_label_bg.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape
+    xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#EEEEEE"/>
+    <corners android:radius="5dp"/>
+</shape>

+ 1 - 1
RMA/app/src/main/res/layout/item_fresco.xml

@@ -10,6 +10,6 @@
         android:id="@+id/sdv_item_fresco_content"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        app:placeholderImage="@mipmap/banner"/>
+        app:placeholderImage="@mipmap/yrdz_banner_placeholder"/>
 
 </androidx.cardview.widget.CardView>

BIN
RMA/app/src/main/res/mipmap-xhdpi/yrdz_banner_placeholder.png


BIN
RMA/app/src/main/res/mipmap-xhdpi/yrdz_chart_icon.png


BIN
RMA/app/src/main/res/mipmap-xhdpi/yrdz_nctice_icon.png


BIN
RMA/app/src/main/res/mipmap-xhdpi/yrdz_topright_icon.png