Browse Source

1.对接支付宝微信支付

shihuiyun 2 years ago
parent
commit
7b07c1f1ed
33 changed files with 1372 additions and 124 deletions
  1. 0 1
      app/build.gradle
  2. 4 0
      app/src/main/AndroidManifest.xml
  3. 14 6
      app/src/main/java/com/zswc/creativity/activity/ArticleDetailActivity.kt
  4. 260 0
      app/src/main/java/com/zswc/creativity/activity/TibetanDetailsActivity.kt
  5. 33 20
      app/src/main/java/com/zswc/creativity/adapter/MsgAdapter.kt
  6. 0 1
      app/src/main/java/com/zswc/creativity/adapter/MyWalletAdapter.kt
  7. 1 2
      app/src/main/java/com/zswc/creativity/config/Config.kt
  8. 1 0
      app/src/main/java/com/zswc/creativity/config/ConfigRx.kt
  9. 10 19
      app/src/main/java/com/zswc/creativity/fragment/RecommendFragment.kt
  10. 19 0
      app/src/main/java/com/zswc/creativity/model/OrderPay.kt
  11. 17 0
      app/src/main/java/com/zswc/creativity/model/TibetaDetails.kt
  12. 94 0
      app/src/main/java/com/zswc/creativity/utils/PopuBuyUtils.kt
  13. 32 12
      app/src/main/java/com/zswc/creativity/utils/net/ApiService.kt
  14. 2 15
      app/src/main/java/com/zswc/creativity/vmodel/ArticleDetailVModel.kt
  15. 11 0
      app/src/main/java/com/zswc/creativity/vmodel/MsgVModel.kt
  16. 43 0
      app/src/main/java/com/zswc/creativity/vmodel/TibetanDetailsVModel.kt
  17. BIN
      app/src/main/res/drawable-xxhdpi/ct_copy.png
  18. BIN
      app/src/main/res/drawable-xxhdpi/ct_tr_alipay.webp
  19. BIN
      app/src/main/res/drawable-xxhdpi/ct_tr_chose_off.webp
  20. BIN
      app/src/main/res/drawable-xxhdpi/ct_tr_chose_on.webp
  21. BIN
      app/src/main/res/drawable-xxhdpi/ct_tr_wx.webp
  22. 17 0
      app/src/main/res/drawable/bg_chose_line.xml
  23. 11 0
      app/src/main/res/drawable/bg_pop_pay_off.xml
  24. 10 0
      app/src/main/res/drawable/bg_pop_pay_on.xml
  25. 11 0
      app/src/main/res/drawable/bg_pop_white.xml
  26. 3 3
      app/src/main/res/layout/activity_article_detail.xml
  27. 458 0
      app/src/main/res/layout/activity_tibetan_details.xml
  28. 3 1
      app/src/main/res/layout/item_msg.xml
  29. 264 0
      app/src/main/res/layout/item_pop_buy.xml
  30. 1 0
      app/src/main/res/values/strings.xml
  31. 50 42
      base/src/main/java/com/ysnows/base/base/BRRepository.kt
  32. 1 1
      base/src/main/res/values/colors.xml
  33. 2 1
      common-build.gradle

+ 0 - 1
app/build.gradle

@@ -147,5 +147,4 @@ dependencies {
     implementation 'cat.ereza:customactivityoncrash:2.3.0'
 
 
-
 }

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

@@ -122,6 +122,10 @@
         <activity android:name="com.zswc.creativity.activity.MyOrderActivity"/>
         <activity android:name="com.zswc.creativity.activity.ConsignmentOrderActivity"/>
         <activity android:name="com.zswc.creativity.activity.CertificationActivity"/>
+        <activity android:name="com.zswc.creativity.activity.TibetanDetailsActivity"
+               android:hardwareAccelerated="false"
+            />
+
 
 
 

+ 14 - 6
app/src/main/java/com/zswc/creativity/activity/ArticleDetailActivity.kt

@@ -8,14 +8,16 @@ import android.view.View
 import android.view.View.OnLongClickListener
 import android.webkit.WebSettings
 import android.webkit.WebView.HitTestResult
+import androidx.lifecycle.Observer
+import com.google.gson.Gson
+import com.hwangjr.rxbus.RxBus
 import com.zswc.creativity.base.MBActivity
+import com.zswc.creativity.config.ConfigRx
 import com.zswc.creativity.databinding.ActivityArticleDetailBinding
+import com.zswc.creativity.model.MsgList
 import com.zswc.creativity.utils.WebViewUtils
 import com.zswc.creativity.vmodel.ArticleDetailVModel
 import java.util.*
-import androidx.lifecycle.Observer
-import com.hwangjr.rxbus.RxBus
-import com.zswc.creativity.config.ConfigRx
 
 
 /**
@@ -28,16 +30,22 @@ class ArticleDetailActivity: MBActivity<ArticleDetailVModel, ActivityArticleDeta
         super.init(savedInstanceState)
         initWeb() //初始化
 
-        var type=intent.extras?.getInt("type",0)
+        var type=intent.extras?.getString("type","0")
         vm.chsoe.value=intent.extras?.getString("chose","1")
 
         titleBar()!!.setBackgroundColor(Color.parseColor("#ffffff"))
 
-        if(type==-1){
+        if(type.equals("-1")){
+            vm.isShow.value=true
+
+            var data=intent.extras?.getString("content")
+            val item: MsgList = Gson().fromJson(data, MsgList::class.java)
+            vm.msgGetInfo.value=item
             vm.isShow.value=true
-            vm.getMsgDetails(intent.extras?.getString("id","")!!)
+
             titleBar()!!.setTitle("消息详情")
 
+
             //刷新我的界面-消息数量
             RxBus.get().post(ConfigRx.REFRESH_USER_DATA, "")
 

+ 260 - 0
app/src/main/java/com/zswc/creativity/activity/TibetanDetailsActivity.kt

@@ -0,0 +1,260 @@
+package com.zswc.creativity.activity
+
+import android.os.Build
+import android.os.Build.VERSION.SDK_INT
+import android.os.Bundle
+import android.os.Handler
+import android.os.Message
+import android.text.TextUtils
+import android.util.Log
+import android.view.View
+import androidx.lifecycle.lifecycleScope
+import coil.Coil
+import coil.ImageLoader
+import coil.decode.GifDecoder
+import coil.decode.ImageDecoderDecoder
+import coil.load
+import com.hwangjr.rxbus.annotation.Subscribe
+import com.hwangjr.rxbus.annotation.Tag
+import com.ysnows.base.binding.ViewBindingAdapter
+import com.ysnows.base.utils.UiSwitch
+import com.ysnows.base.utils.UiUtils
+import com.zswc.creativity.R
+import com.zswc.creativity.base.MBActivity
+import com.zswc.creativity.config.ConfigRx
+import com.zswc.creativity.databinding.ActivityTibetanDetailsBinding
+import com.zswc.creativity.utils.net.NetEngine
+import com.zswc.creativity.vmodel.TibetanDetailsVModel
+import kotlinx.coroutines.launch
+import java.io.File
+import java.lang.reflect.Modifier
+import java.text.DecimalFormat
+import kotlin.math.log
+
+/**
+ * 藏品详情
+ *on 2022/7/23
+ */
+class TibetanDetailsActivity : MBActivity<TibetanDetailsVModel, ActivityTibetanDetailsBinding>() {
+
+    var sumSecond = 300//5分钟的总的秒数
+
+    override fun init(savedInstanceState: Bundle?) {
+        super.init(savedInstanceState)
+        titleBar()?.imgRight?.setImageResource(R.drawable.ct_share)
+        var id = intent?.extras?.getString("id")
+        vm.getInfo(id!!)
+
+        vm.data.observe(this) {
+
+            if (!TextUtils.isEmpty(it.detail_img)) {
+                //获取文件后缀
+                var ss = it.detail_img.substring(it.detail_img.length - 3, it.detail_img.length);
+
+                if (ss == "gif" || ss == "GIF") {
+                    binding.imageView.visibility = View.GONE
+                    //设置图片加载gif
+                    val imageLoader=ImageLoader.Builder(context = this)
+                            .componentRegistry{
+                                if (SDK_INT>28){
+                                    add(ImageDecoderDecoder())
+                                }else{
+                                    add(GifDecoder())
+                                }
+                            }.build()
+                    Coil.setImageLoader(imageLoader)
+                    binding.imageGifView.load(it.detail_img)
+                    binding.imageGifView.visibility = View.VISIBLE
+                } else {
+                    binding.imageView.visibility = View.VISIBLE
+                    binding.imageGifView.visibility = View.GONE
+                }
+            }
+        }
+
+
+    }
+
+
+    override fun listeners() {
+        super.listeners()
+
+//        screenHeightPixels = UiUtils.getScreenHeightPixels(getContext());
+//
+//        obscroll.setOnScrollListener(object : OnScrollChangedListener() {
+//            /**
+//             * @param x
+//             * @param y
+//             * @param oldX
+//             * @param oldY
+//             */
+//            fun onScrollChanged(x: Int, y: Int, oldX: Int, oldY: Int) {
+//                if (islide) {
+//                    if (affix_type != null && affix_type.equals("3")) {
+//                        return
+//                    }
+//                    if (y == 0) {
+//                        tvTitleName.setVisibility(View.INVISIBLE)
+//                        lineL.setAlpha(0)
+//                        tvTitleName.setAlpha(1)
+//                        bar.setBackgroundColor(Color.parseColor("#00000000"))
+//                    } else if (y - oldY > 0) {
+//                        if (screenHeightPixels <= 960) {
+//                            setBarVisibility(y, 100)
+//                        } else {
+//                            setBarVisibility(y, 200)
+//                        }
+//                    } else if (y - oldY < 0) {
+//                    }
+//                }
+//            }
+//        })
+
+    }
+
+//    private fun setBarVisibility(y: Int, height: Int) {
+//        if (y > 0 && y < height) {
+//            line.setVisibility(View.GONE)
+//            bar.setVisibility(View.VISIBLE)
+//            val df = DecimalFormat("0.00")
+//            val s: String = df.format(y.toFloat() / height)
+//            val a = s.toFloat() //0~1
+//
+//            // float a = y / height;//0~1
+//            val ratio = 255 - (255 * a).toInt() //255-(0~255)=255~0
+//            val bgColor: Int = ColorUtils.getColorWithAlpha(Color.parseColor("#FFFFFF"), ratio)
+//            bar.setBackgroundColor(bgColor)
+//            tvTitleName.setAlpha(a)
+//            line.setAlpha(a)
+//        } else if (y > height) {
+//            bar.setBackgroundColor(Color.WHITE)
+//            bar.setVisibility(View.VISIBLE)
+//            lineL.setVisibility(View.VISIBLE)
+//            lineL.setAlpha(1)
+//            tvTitleName.setAlpha(1)
+//            tvTitleName.setVisibility(View.VISIBLE)
+//        }
+//    }
+
+
+    override fun binding(): ActivityTibetanDetailsBinding {
+        return ActivityTibetanDetailsBinding.inflate(layoutInflater)
+    }
+
+    override fun vmClass(): Class<TibetanDetailsVModel> {
+        return TibetanDetailsVModel::class.java
+    }
+
+    override fun title(): String? {
+        return "商品详情"
+    }
+
+    override val isRxbus: Boolean
+        get() = true
+
+    //倒计时
+
+
+    fun initOrderCancelTime(pay_time_long: String?) {
+        //-------
+
+        sumSecond = pay_time_long!!.toInt()
+
+        vm.time.value = "请在 " + formatTime(sumSecond) + "内支付"
+
+
+        addProgress()
+    }
+
+    private fun addProgress() {
+
+
+        Log.e("-shy-", "isUp=" + vm.isUp)
+        if (sumSecond == 0) {
+            //结束 todo:
+//            vm.isUp = false
+//
+//            vm.bean.value?.state = 9
+            //去取消订单
+            // vm.toCancerOrderTo()
+
+        } else {
+            if (vm.isUp) {
+                sumSecond--
+                handler.sendEmptyMessageDelayed(0x101, 1000)
+            }
+
+        }
+    }
+
+    private val handler: Handler = object : Handler() {
+        override fun handleMessage(msg: Message) {
+            super.handleMessage(msg)
+            //计算进度
+
+
+            vm.time.value = "请在 " + formatTime(sumSecond) + "内支付"
+            addProgress()
+        }
+    }
+
+    /**
+     * 将秒转化为 HH:mm:io.agora.rtc.ss 的格式
+     *
+     * @param time 秒
+     * @return
+     */
+    /**
+     * 将秒转化为 HH:mm:io.agora.rtc.ss 的格式
+     *
+     * @param time 秒
+     * @return
+     */
+    var decimalFormat: DecimalFormat? = null
+
+    private fun formatTime(time: Int): String? {
+        if (decimalFormat == null) {
+            decimalFormat = DecimalFormat("00")
+        }
+        val hh: String = decimalFormat!!.format(time / 3600)
+        val mm: String = decimalFormat!!.format(time % 3600 / 60)
+        val ss: String = decimalFormat!!.format(time % 60)
+        // return "$hh:$mm:$io.agora.rtc.ss"
+        return "$mm:$ss"
+    }
+
+
+    @Subscribe(tags = [Tag(ConfigRx.CHOSE_PAY_TYPE)])
+    fun setChosePay(type: String) {
+
+
+        lifecycleScope.launch {
+
+            //todo:测试 0.01
+            val it = vm.repository().lreq { NetEngine.service.amountAdd("0.01",type) }
+
+            if (it.ok(false)) {
+                if (type == "1") {//支付宝
+                    val orderInfo = it.data!!.alipay
+
+                    CpAlipay.pay(vm.repository().context!!, orderInfo)
+                } else {//微信
+                    if (WeChatUtil.isWeixinAvilible(context())) {
+                        WeChatUtil.toWXPay(context(), it.datas!!)
+                    }
+                }
+            }
+
+        }
+
+
+        if(type == "1"){//支付宝
+
+       }else{//微信
+
+       }
+    }
+
+
+
+}

+ 33 - 20
app/src/main/java/com/zswc/creativity/adapter/MsgAdapter.kt

@@ -1,13 +1,18 @@
 package com.zswc.creativity.adapter
 
 import android.graphics.Color
+import android.graphics.Typeface
 import android.os.Bundle
 import android.text.Spannable
 import android.text.SpannableStringBuilder
+import android.text.Spanned
 import android.text.TextUtils
+import android.text.style.AbsoluteSizeSpan
 import android.text.style.ForegroundColorSpan
+import android.text.style.StyleSpan
 import android.view.View
 import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
+import com.google.gson.Gson
 import com.qmuiteam.qmui.kotlin.onClick
 import com.zswc.creativity.R
 import com.zswc.creativity.activity.ArticleDetailActivity
@@ -21,28 +26,36 @@ import com.ysnows.base.utils.UiSwitch
 class MsgAdapter(var vm: MsgVModel) : BAdapter<MsgList, BaseDataBindingHolder<ItemMsgBinding>>(R.layout.item_msg) {
 
     override fun convert(holder: BaseDataBindingHolder<ItemMsgBinding>, item: MsgList) {
-        holder.dataBinding?.vm=vm
+        holder.dataBinding?.vm = vm
         holder.dataBinding?.item = item
 
-        var title=item.title+"·"
-        var ss=title.split(".")
-        var spannableString= SpannableStringBuilder(title)
-        spannableString.setSpan(ForegroundColorSpan(Color.BLUE),ss.size-2, ss.size-1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
-        holder.dataBinding?.tvTitle?.text = spannableString
-
-
-//        if(item.is_read){//已读
-//            holder.dataBinding?.tvTitle?.text=item.title
-//        }else{
-//
-//            var title=item.title+"·"
-//            var ss=title.split(".")
-//            var spannableString= SpannableStringBuilder(title)
-//            spannableString.setSpan(ForegroundColorSpan(Color.BLUE),ss.size-2, ss.size-1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
-//            holder.dataBinding?.tvTitle?.text = spannableString
-//
-//
-//        }
+        if (item.is_read) {//已读
+            holder.dataBinding?.tvTitle?.text = item.title
+        } else {
+
+            var title = item.title + "·"
+            var spannableString = SpannableStringBuilder(title)
+            //设置颜色
+            spannableString.setSpan(ForegroundColorSpan(Color.RED), title.length - 1, title.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
+            //设置大小
+            spannableString.setSpan(AbsoluteSizeSpan(30, true), title.length - 1, title.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
+            //设置字体
+            spannableString.setSpan(StyleSpan(Typeface.BOLD), title.length - 1, title.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+            holder.dataBinding?.tvTitle?.text = spannableString
+
+
+        }
+        holder.dataBinding?.ll!!.onClick {
+            item.is_read = true
+
+            UiSwitch.bundle(context, ArticleDetailActivity::class.java, Bundle().apply {
+                putString("type", "-1")
+                putString("content", Gson().toJson(item))
+            })
+
+
+        }
+
 
     }
 }

+ 0 - 1
app/src/main/java/com/zswc/creativity/adapter/MyWalletAdapter.kt

@@ -6,7 +6,6 @@ import android.view.View
 import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
 import com.qmuiteam.qmui.kotlin.onClick
 import com.zswc.creativity.R
-import com.zswc.creativity.activity.ArticleDetailActivity
 import com.zswc.creativity.databinding.ItemMsgBinding
 import com.zswc.creativity.model.MsgList
 import com.zswc.creativity.utils.VerifyUtils

+ 1 - 2
app/src/main/java/com/zswc/creativity/config/Config.kt

@@ -28,9 +28,8 @@ object  Config : IConfig {
     }
 
     override fun buglyAppId(): String? {
-       // return "577d2c7c52"//正式的bugly
 
-        return "3837125332"//测试的bugly
+        return "4e13ff1813"
     }
 
     override fun ossEndpoint(): String? {

+ 1 - 0
app/src/main/java/com/zswc/creativity/config/ConfigRx.kt

@@ -29,6 +29,7 @@ object ConfigRx {
 
     const val REFRESH_USER_DATA = "REFRESH_USER_DATA" //刷新用户信息
 
+    const val CHOSE_PAY_TYPE = "CHOSE_PAY_TYPE" //支付方式  //1支付宝 2微信  //默认支付宝
 
 
 

+ 10 - 19
app/src/main/java/com/zswc/creativity/fragment/RecommendFragment.kt

@@ -10,6 +10,10 @@ import com.zswc.creativity.databinding.FragmentRecommendBinding
 import com.zswc.creativity.model.CollectionList
 import com.zswc.creativity.vmodel.RecommendVModel
 import com.tencent.mmkv.MMKV
+import com.ysnows.base.utils.B
+import com.ysnows.base.utils.UiSwitch
+import com.zswc.creativity.activity.ArticleDetailActivity
+import com.zswc.creativity.activity.TibetanDetailsActivity
 
 /**
  * 精选推荐
@@ -45,26 +49,13 @@ class RecommendFragment : MBFragment<RecommendVModel, FragmentRecommendBinding>(
          adapter.addData(list)
 
         adapter.setOnItemClickListener { adapter, view, position ->
-            var isEnable= MMKV.defaultMMKV().getBoolean("Enable",false)
-            if(isEnable) {
-                //拨打电话
-//                launch {
-//                    val requestPermissions = PermissionManager.requestPermissions(
-//                            this@SpaceDetailActivity, 1000, Manifest.permission.CALL_PHONE
-//                    )
-//                    if (requestPermissions is PermissionResult.PermissionGranted) {
-//                        //拨打电话
-//                        vm.bean.value?.fishpond_tel?.let {
-//
-//                            PopuCallPhoneUtils.show(context(), it, binding.imgCallPhone)
-//
-//                        }
-//                    }
-//                }
-            }else{
-                //  toast("抱歉,您未同意用户隐私协议,无法获得相应权限,无法应用该功能")
 
-            }
+
+            vm.list.value?.get(position)?.id
+
+            UiSwitch.bundle(context, TibetanDetailsActivity::class.java,
+                    B().putString("id", vm.list.value?.get(position)?.id)
+                            .ok())
         }
 
 

+ 19 - 0
app/src/main/java/com/zswc/creativity/model/OrderPay.kt

@@ -0,0 +1,19 @@
+package com.zswc.creativity.model
+
+import com.ysnows.base.inter.IModel
+
+/**
+ *Created by shihuiyun
+ *on 2020/12/21
+ */
+data class OrderPay(
+        var dragonpay: String,
+        var alipay: String,
+        var wechat: WechatBean) : IModel {
+
+    data class WechatBean(var appid: String, var partnerid: String,
+                          var prepayid: String, var noncestr: String, var sign: String,
+                          var timestamp: String) : IModel {
+
+    }
+}

+ 17 - 0
app/src/main/java/com/zswc/creativity/model/TibetaDetails.kt

@@ -0,0 +1,17 @@
+package com.zswc.creativity.model
+
+import com.ysnows.base.inter.IModel
+
+/**
+ *Created by shihuiyun
+ *on 2020/9/25
+ */
+data class TibetaDetails(var auth_name:String, var auth_img:String, var buy_count:String,
+                         var buy_notice:String, var cover:String,var describe:List<String>,
+                         var detail_img:String, var first_cid:String, var first_time:String,
+                         var format:String, var id:String, var instructions:String,
+                         var issuer:String, var label:String, var name:String,
+                         var price:String, var sell_time:String, var share_img:String,
+                         var state:String, var warm_prompt:String,var inventory:String,
+): IModel {
+}

+ 94 - 0
app/src/main/java/com/zswc/creativity/utils/PopuBuyUtils.kt

@@ -0,0 +1,94 @@
+package com.zswc.creativity.utils
+
+import android.content.Context
+import android.content.Intent
+import android.net.Uri
+import android.view.LayoutInflater
+import android.view.View
+import android.widget.*
+import com.hwangjr.rxbus.RxBus
+import com.qmuiteam.qmui.kotlin.onClick
+import com.qmuiteam.qmui.layout.QMUIFrameLayout
+import com.qmuiteam.qmui.skin.QMUISkinValueBuilder
+import com.qmuiteam.qmui.util.QMUIDisplayHelper
+import com.qmuiteam.qmui.widget.popup.QMUIPopup
+import com.qmuiteam.qmui.widget.popup.QMUIPopups
+import com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
+import com.zswc.creativity.R
+import com.zswc.creativity.config.ConfigRx
+
+/**
+ * 导航-调用手机自带的 高德/百度
+ *
+ *on 2020/9/21
+ */
+object PopuBuyUtils {
+
+    fun show(context: Context, view: View) {
+
+        var mNormalPopup = QMUIPopups.fullScreenPopup(context)
+        val builder: QMUISkinValueBuilder = QMUISkinValueBuilder.acquire()
+        val frameLayout = QMUIFrameLayout(context)
+        //自定义布局
+        val layoutInflater = context?.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
+        var layout = layoutInflater.inflate(R.layout.item_pop_buy, null)
+        val llAlipay: LinearLayout = layout.findViewById(R.id.ll_alipay)
+        val llWx: LinearLayout = layout.findViewById(R.id.ll_wx)
+        val tvPay: TextView = layout.findViewById(R.id.tv_pay)
+
+        val ll: LinearLayout = layout.findViewById(R.id.ll)
+        val butCancel: ImageView = layout.findViewById(R.id.img_close)
+
+        var choseType = 1//1支付宝 2微信  //默认支付宝
+
+         // mNormalPopup.dismiss()
+
+        llAlipay.onClick {
+            choseType=1
+            llAlipay.setBackgroundResource(R.drawable.bg_pop_pay_on)
+            llWx.setBackgroundResource(R.drawable.bg_pop_pay_off)
+
+
+        }
+        llWx.onClick {
+            choseType=2
+            llWx.setBackgroundResource(R.drawable.bg_pop_pay_on)
+            llAlipay.setBackgroundResource(R.drawable.bg_pop_pay_off)
+
+        }
+        tvPay.onClick {
+            RxBus.get().post(ConfigRx.CHOSE_PAY_TYPE,choseType.toString() )
+
+        }
+
+        butCancel.onClick {
+            mNormalPopup.dismiss()
+        }
+        ll.onClick {
+            mNormalPopup.dismiss()
+        }
+
+        builder.release();
+
+        val size = QMUIDisplayHelper.getScreenWidth(context)
+        val height = QMUIDisplayHelper.getScreenHeight(context)
+
+
+        val lp: FrameLayout.LayoutParams = FrameLayout.LayoutParams(size,
+                height)
+        frameLayout.addView(layout, lp)
+
+
+        mNormalPopup.addView(frameLayout)
+        mNormalPopup.onDismiss() {
+        }
+
+        mNormalPopup.dismissIfOutsideTouch(false)
+        mNormalPopup.animStyle(QMUIPopup.ANIM_GROW_FROM_CENTER)
+        mNormalPopup.show(view)
+
+
+    }
+
+
+}

+ 32 - 12
app/src/main/java/com/zswc/creativity/utils/net/ApiService.kt

@@ -73,13 +73,6 @@ interface ApiService {
 
 
     /**
-     * 消息-已读
-     * @return
-     */
-    @GET("api/msg/msgRead")
-    suspend fun msgRead(@Query("arr") arr: String?): Resp<Any>
-
-    /**
      * 消息-分页
      * @return
      */
@@ -90,6 +83,15 @@ interface ApiService {
             @Field("page") page: Int?
     ): PageResp<MsgList>
 
+    /**
+     * 消息-已读
+     * @return
+     */
+    @GET("Index/CollectionDetail")
+    suspend fun CollectionDetail(@Query("id") id: String?): Resp<TibetaDetails>
+
+
+
 
 
 
@@ -102,6 +104,14 @@ interface ApiService {
 //////----------------------------------
 
     /**
+     * 消息-已读
+     * @return
+     */
+    @GET("api/msg/msgRead")
+    suspend fun msgRead(@Query("arr") arr: String?): Resp<Any>
+
+
+    /**
      * 地址列表
      * @return
      */
@@ -650,16 +660,26 @@ interface ApiService {
     fun getCard(): Observable<Resp<Card>>
 
 
+//    /**
+//     * 资金充值-资金
+//     * @return
+//     */
+//    @POST("api/amount/amountAdd")
+//    @FormUrlEncoded
+//    fun amountAdd(
+//            @Field("money") money: String?,
+//            @Field("pic") pic: String?
+//    ): Observable<Resp<Any>>
+
     /**
      * 资金充值-资金
      * @return
      */
-    @POST("api/amount/amountAdd")
+    @POST("api/amount/recharge2")
     @FormUrlEncoded
-    fun amountAdd(
-            @Field("money") money: String?,
-            @Field("pic") pic: String?
-    ): Observable<Resp<Any>>
+    suspend fun amountAdd(@Field("money") money: String?,
+                          @Field("pay_type") pay_type: String?
+    ): Resp<OrderPay>
 
 
     /**

+ 2 - 15
app/src/main/java/com/zswc/creativity/vmodel/ArticleDetailVModel.kt

@@ -8,6 +8,7 @@ import com.zswc.creativity.model.MsgGet
 import com.zswc.creativity.utils.net.NetEngine
 import com.ysnows.base.base.BRepository
 import com.ysnows.base.base.BViewModel
+import com.zswc.creativity.model.MsgList
 import kotlinx.coroutines.launch
 
 class ArticleDetailVModel(application: Application) : BViewModel<BRepository>(application) {
@@ -16,7 +17,7 @@ class ArticleDetailVModel(application: Application) : BViewModel<BRepository>(ap
     var bean: MutableLiveData<ArticleInfo> = MutableLiveData()
     var isShow:MutableLiveData<Boolean> = MutableLiveData(false)
 
-    var msgGetInfo: MutableLiveData<MsgGet> = MutableLiveData()
+    var msgGetInfo: MutableLiveData<MsgList> = MutableLiveData()
 
     var chsoe=MutableLiveData<String>()
 
@@ -36,21 +37,7 @@ class ArticleDetailVModel(application: Application) : BViewModel<BRepository>(ap
 
     }
 
-    fun getMsgDetails(id:String){
 
 
 
-        viewModelScope.launch {
-
-            var it= repository().preq {NetEngine.service.msgGet(id)   }
-            if (it.ok()) {
-                msgGetInfo.value=it.data()
-
-            }
-
-        }
-
-    }
-
-
 }

+ 11 - 0
app/src/main/java/com/zswc/creativity/vmodel/MsgVModel.kt

@@ -1,6 +1,7 @@
 package com.zswc.creativity.vmodel
 
 import android.app.Application
+import android.graphics.Color
 import androidx.lifecycle.viewModelScope
 import com.hwangjr.rxbus.RxBus
 import com.zswc.creativity.config.ConfigRx
@@ -27,6 +28,16 @@ class MsgVModel(application: Application) : BRViewModel<BRRepository>(applicatio
 //
 //    }
 
+
+    fun isRedColor(isRead: Boolean): Int {
+        if (isRead) {
+            return Color.parseColor("#777777")
+        }
+        return Color.parseColor("#222222")
+
+    }
+
+
     override fun apiFunc(): suspend () -> IResp<*> {
         return { NetEngine.service.msgListPage(10,repository().page) }
     }

+ 43 - 0
app/src/main/java/com/zswc/creativity/vmodel/TibetanDetailsVModel.kt

@@ -0,0 +1,43 @@
+package com.zswc.creativity.vmodel
+
+import android.app.Application
+import android.view.View
+import androidx.lifecycle.MutableLiveData
+import androidx.lifecycle.viewModelScope
+import com.ysnows.base.base.BRepository
+import com.ysnows.base.base.BViewModel
+import com.zswc.creativity.model.TibetaDetails
+import com.zswc.creativity.utils.PopuBuyUtils
+import com.zswc.creativity.utils.net.NetEngine
+import kotlinx.coroutines.launch
+
+class TibetanDetailsVModel(application: Application) : BViewModel<BRepository>(application)  {
+
+    var data= MutableLiveData<TibetaDetails>()
+    //倒计时
+    var isUp = true
+    var time = MutableLiveData<String>()
+
+
+
+    fun getInfo(id:String){
+        viewModelScope.launch {
+            var it=repository().lreq { NetEngine.service.CollectionDetail(id) }
+            if(it.ok()){
+
+                data.value=it.data
+
+            }
+
+        }
+    }
+
+    fun  toBuy(view :View){//支付弹框
+        PopuBuyUtils.show(repository().context!!,  view)
+
+    }
+
+
+
+
+}

BIN
app/src/main/res/drawable-xxhdpi/ct_copy.png


BIN
app/src/main/res/drawable-xxhdpi/ct_tr_alipay.webp


BIN
app/src/main/res/drawable-xxhdpi/ct_tr_chose_off.webp


BIN
app/src/main/res/drawable-xxhdpi/ct_tr_chose_on.webp


BIN
app/src/main/res/drawable-xxhdpi/ct_tr_wx.webp


+ 17 - 0
app/src/main/res/drawable/bg_chose_line.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+android:shape="rectangle" >
+
+<!-- 填充的颜色-->
+
+    <gradient
+        android:angle="180"
+        android:startColor="#59D8ED"
+        android:endColor="#38D3D3" />
+
+    <corners
+       android:radius="2dp"
+       >
+    </corners>
+
+</shape >

+ 11 - 0
app/src/main/res/drawable/bg_pop_pay_off.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+
+    <stroke
+        android:width="1dp"
+        android:color="#DFDFDF" />
+
+    <corners android:radius="4dp"></corners>
+</shape>

+ 10 - 0
app/src/main/res/drawable/bg_pop_pay_on.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+android:shape="rectangle" >
+
+    <stroke
+        android:width="1dp"
+        android:color="#3BD3D5" />
+
+    <corners android:radius="4dp"></corners>
+</shape >

+ 11 - 0
app/src/main/res/drawable/bg_pop_white.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+android:shape="rectangle" >
+
+
+    <solid android:color="@color/white" />
+
+    <corners android:topLeftRadius="@dimen/dp_16"
+        android:topRightRadius="@dimen/dp_16"
+        />
+</shape >

+ 3 - 3
app/src/main/res/layout/activity_article_detail.xml

@@ -30,7 +30,7 @@
                 tools:text="功能上新:新增用户评价功能"
                  android:textSize="16sp"
                 android:textColor="#26292F"
-                android:text="@{vm.msgGetInfo.msg.title}"
+                android:text="@{vm.msgGetInfo.title}"
                 android:layout_marginStart="27dp"
                 android:layout_height="wrap_content"/>
 
@@ -40,7 +40,7 @@
                 android:textSize="11sp"
                 android:textColor="#8B8B8B"
                 android:layout_marginTop="9dp"
-                android:text="@{vm.msgGetInfo.msg.create_time}"
+                android:text="@{vm.msgGetInfo.create_at}"
                 android:layout_marginStart="27dp"
                 android:layout_height="wrap_content"/>
 
@@ -52,7 +52,7 @@
                 android:textColor="#545556"
                 android:layout_marginEnd="45dp"
                 android:layout_marginTop="26dp"
-                android:text="@{vm.msgGetInfo.msg.content}"
+                android:text="@{vm.msgGetInfo.content}"
                 android:layout_marginStart="27dp"
                 android:layout_height="wrap_content"/>
 

+ 458 - 0
app/src/main/res/layout/activity_tibetan_details.xml

@@ -0,0 +1,458 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <data>
+
+        <variable
+            name="vm"
+            type="com.zswc.creativity.vmodel.TibetanDetailsVModel" />
+
+    </data>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/white"
+        android:orientation="vertical">
+
+        <androidx.core.widget.NestedScrollView
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1"
+            android:scrollbars="none">
+
+
+            <FrameLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+                <ImageView
+                    android:id="@+id/image_gif_view"
+                    android:layout_width="match_parent"
+                    android:layout_height="360dp"
+                    android:scaleType="centerCrop"
+                     />
+
+                <ImageView
+                    android:id="@+id/image_view"
+                    android:layout_width="match_parent"
+                    android:layout_height="360dp"
+                    android:scaleType="centerCrop"
+                    app:url="@{vm.data.detail_img}"
+                    android:src="@drawable/bg_need_error" />
+
+                <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="336dp"
+                    android:orientation="vertical"
+                    app:qmui_backgroundColor="@color/white"
+                    app:qmui_borderColor="@color/translucent"
+                    app:qmui_radius="16dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_horizontal"
+                        android:layout_marginTop="8dp"
+                        android:text="@{vm.data.name}"
+                        android:textColor="#141414"
+                        android:textSize="22sp"
+                        android:textStyle="bold" />
+
+                    <LinearLayout
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_horizontal"
+                        android:layout_marginTop="5dp">
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:background="#38D3D3"
+                            android:hint="限量"
+                            android:paddingStart="9dp"
+                            android:paddingTop="2dp"
+                            android:paddingEnd="9dp"
+                            android:textSize="@dimen/dp_11"
+                            android:paddingBottom="2dp" />
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:background="@drawable/bg_kuang_blue"
+                            android:hint="100份"
+                            android:text="@{vm.data.inventory+`份`}"
+                            android:paddingStart="9dp"
+                            android:paddingTop="2dp"
+                            android:paddingEnd="9dp"
+                            android:textSize="@dimen/dp_11"
+                            android:paddingBottom="2dp"
+                            android:textColor="#54D7E9"
+                            android:textColorHint="#54D7E9" />
+
+                    </LinearLayout>
+
+                    <LinearLayout
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="15dp"
+                        android:layout_marginTop="11dp"
+                        android:gravity="center_vertical"
+                        android:orientation="horizontal">
+
+                        <View
+                            android:layout_width="4dp"
+                            android:layout_height="14dp"
+                            android:background="@drawable/bg_chose_line" />
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_marginStart="4dp"
+                            android:text="认证信息"
+                            android:textColor="#222222"
+                            android:textSize="16sp"
+                            android:textStyle="bold" />
+
+
+                    </LinearLayout>
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="15dp"
+                        android:layout_marginTop="8dp"
+                        android:gravity="center_vertical"
+                        android:orientation="horizontal">
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="区块链"
+                            android:textColor="#333333"
+                            android:textSize="12sp" />
+
+                        <TextView
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginEnd="14dp"
+                            android:gravity="right"
+                            android:text="蚂蚁链LASH"
+                            android:textColor="#333333"
+                            android:textSize="12sp" />
+
+
+                    </LinearLayout>
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="15dp"
+                        android:layout_marginTop="8dp"
+                        android:gravity="center_vertical"
+                        android:orientation="horizontal">
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="合约地址"
+                            android:textColor="#333333"
+                            android:textSize="12sp" />
+
+                        <TextView
+                            android:layout_width="0dp"
+                            android:layout_height="wrap_content"
+                            android:layout_marginStart="12dp"
+                            android:layout_marginEnd="6dp"
+                            android:layout_weight="1"
+                            android:gravity="right"
+                            android:text="蚂蚁链LASH"
+                            android:textColor="#333333"
+                            android:textSize="12sp" />
+
+                        <ImageView
+                            android:layout_width="17dp"
+                            android:layout_height="17dp"
+                            android:layout_marginEnd="14dp"
+                            android:src="@drawable/ct_copy" />
+
+
+                    </LinearLayout>
+
+                    <LinearLayout
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="15dp"
+                        android:layout_marginTop="11dp"
+                        android:gravity="center_vertical"
+                        android:orientation="horizontal">
+
+                        <View
+                            android:layout_width="4dp"
+                            android:layout_height="14dp"
+                            android:background="@drawable/bg_chose_line" />
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_marginStart="4dp"
+                            android:text="藏品描述"
+                            android:textColor="#222222"
+                            android:textSize="16sp"
+                            android:textStyle="bold" />
+
+
+                    </LinearLayout>
+
+                    <com.qmuiteam.qmui.widget.QMUIRadiusImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="15dp"
+                        android:layout_marginTop="10dp"
+                        android:layout_marginEnd="15dp"
+                        app:qmui_border_color="@color/translucent"
+                        app:url="@{vm.data.describe[0]}"
+                        android:src="@drawable/bg_need_error" />
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="15dp"
+                        android:layout_marginTop="14dp"
+                        android:gravity="center_vertical"
+                        android:orientation="horizontal">
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="发行方"
+                            android:textColor="#333333"
+                            android:textSize="13sp" />
+
+                        <TextView
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginEnd="14dp"
+                            android:gravity="right"
+                            android:text="@{vm.data.issuer}"
+                            android:textColor="#333333"
+                            android:textSize="13sp" />
+
+
+                    </LinearLayout>
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="15dp"
+                        android:layout_marginTop="14dp"
+                        android:gravity="center_vertical"
+                        android:orientation="horizontal">
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="发行时间"
+                            android:textColor="#333333"
+                            android:textSize="13sp" />
+
+                        <TextView
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginEnd="14dp"
+                            android:gravity="right"
+                            android:text="@{vm.data.sell_time}"
+                            android:textColor="#333333"
+                            android:textSize="13sp" />
+
+
+                    </LinearLayout>
+                    <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
+                        android:layout_width="match_parent"
+                        app:qmui_borderColor="@color/translucent"
+                        app:qmui_backgroundColor="#F1F9F9"
+                        android:paddingEnd="10dp"
+                        android:paddingStart="10dp"
+                        android:paddingTop="10dp"
+                        android:paddingBottom="6dp"
+                        android:orientation="vertical"
+                        app:qmui_radius="8dp"
+                        android:layout_height="wrap_content">
+
+                        <LinearLayout
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:gravity="center_vertical"
+                            android:orientation="horizontal">
+
+                            <View
+                                android:layout_width="4dp"
+                                android:layout_height="14dp"
+                                android:background="@drawable/bg_chose_line" />
+
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:layout_marginStart="4dp"
+                                android:text="藏品简介"
+                                android:textColor="#222222"
+                                android:textSize="16sp"
+                                android:textStyle="bold" />
+
+
+                        </LinearLayout>
+                        <TextView
+                            android:layout_width="match_parent"
+                            android:layout_marginTop="6dp"
+                            android:textSize="11sp"
+                            android:textColor="#B5B5B5"
+                            android:text="@{vm.data.instructions}"
+                            android:layout_height="wrap_content"/>
+
+
+                    </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>
+
+
+                    <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
+                        android:layout_width="match_parent"
+                        app:qmui_borderColor="@color/translucent"
+                        app:qmui_backgroundColor="#F1F9F9"
+                        android:layout_marginTop="16dp"
+                        android:paddingEnd="10dp"
+                        android:paddingStart="10dp"
+                        android:paddingTop="10dp"
+                        android:paddingBottom="6dp"
+                        android:orientation="vertical"
+                        app:qmui_radius="8dp"
+                        android:layout_height="wrap_content">
+
+                        <LinearLayout
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:gravity="center_vertical"
+                            android:orientation="horizontal">
+
+                            <View
+                                android:layout_width="4dp"
+                                android:layout_height="14dp"
+                                android:background="@drawable/bg_chose_line" />
+
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:layout_marginStart="4dp"
+                                android:text="购买须知"
+                                android:textColor="#222222"
+                                android:textSize="16sp"
+                                android:textStyle="bold" />
+
+
+                        </LinearLayout>
+                        <TextView
+                            android:layout_width="match_parent"
+                            android:layout_marginTop="6dp"
+                            android:textSize="11sp"
+                            android:textColor="#B5B5B5"
+                            android:text="@{vm.data.buy_notice}"
+                            android:layout_height="wrap_content"/>
+
+
+                    </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>
+
+
+                    <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
+                        android:layout_width="match_parent"
+                        app:qmui_borderColor="@color/translucent"
+                        app:qmui_backgroundColor="#F1F9F9"
+                        android:layout_marginTop="16dp"
+                        android:paddingEnd="10dp"
+                        android:paddingStart="10dp"
+                        android:paddingTop="10dp"
+                        android:paddingBottom="6dp"
+                        android:orientation="vertical"
+                        app:qmui_radius="8dp"
+                        android:layout_height="wrap_content">
+
+                        <LinearLayout
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:gravity="center_vertical"
+                            android:orientation="horizontal">
+
+                            <View
+                                android:layout_width="4dp"
+                                android:layout_height="14dp"
+                                android:background="@drawable/bg_chose_line" />
+
+                            <TextView
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:layout_marginStart="4dp"
+                                android:text="温馨提示"
+                                android:textColor="#222222"
+                                android:textSize="16sp"
+                                android:textStyle="bold" />
+
+
+                        </LinearLayout>
+                        <TextView
+                            android:layout_width="match_parent"
+                            android:layout_marginTop="6dp"
+                            android:textSize="11sp"
+                            android:textColor="#B5B5B5"
+                            android:text="@{vm.data.warm_prompt}"
+
+                            android:layout_height="wrap_content"/>
+
+
+                    </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>
+
+
+                    <View
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/dp_20"/>
+
+
+
+
+
+                </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>
+
+
+            </FrameLayout>
+
+        </androidx.core.widget.NestedScrollView>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:orientation="horizontal"
+            android:layout_height="83dp">
+            <TextView
+                android:text="¥79.9"
+                android:textColor="@color/text_title"
+                android:textSize="30sp"
+                android:layout_marginStart="16dp"
+                android:layout_gravity="center_vertical"
+                android:layout_width="0dp"
+                android:layout_weight="1"
+                android:layout_height="wrap_content"/>
+
+            <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
+                android:layout_width="180dp"
+                android:layout_height="40dp"
+                app:qmui_radius="4dp"
+                app:qmui_backgroundColor="#C2C2C2"
+                app:qmui_borderColor="@color/translucent"
+                android:layout_marginTop="8dp"
+                android:text="已售罄"
+                android:textSize="16sp"
+                android:textColor="@color/white"
+                android:layout_marginEnd="25dp"
+                />
+
+
+        </LinearLayout>
+
+    </LinearLayout>
+</layout>

+ 3 - 1
app/src/main/res/layout/item_msg.xml

@@ -37,7 +37,7 @@
             android:id="@+id/tv_title"
             android:hint="4月21日最新公告"
             android:textSize="15sp"
-            android:textColor="#222222"
+            android:textColor="@{vm.isRedColor(item.is_read)}"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"/>
 
@@ -46,6 +46,8 @@
             android:textSize="12sp"
             android:layout_marginTop="10dp"
             android:textColor="#777777"
+            android:lines="3"
+            android:ellipsize="end"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"/>
 

+ 264 - 0
app/src/main/res/layout/item_pop_buy.xml

@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:gravity="center"
+    android:orientation="vertical">
+
+
+    <LinearLayout
+        android:id="@+id/ll"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        android:orientation="vertical">
+
+    </LinearLayout>
+
+
+    <LinearLayout xmlns:tools="http://schemas.android.com/tools"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/bg_pop_white"
+            android:orientation="vertical"
+            android:paddingStart="15dp"
+            android:paddingEnd="15dp">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="16dp"
+                android:orientation="horizontal">
+
+                <ImageView
+                    android:id="@+id/img_close"
+                    android:layout_width="20dp"
+                    android:layout_height="20dp"
+                    android:paddingLeft="2dp"
+                    android:src="@drawable/ic_back_black" />
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="22dp"
+                    android:gravity="center_horizontal"
+                    android:text="立即购买"
+                    android:textColor="@color/text_title"
+                    android:textSize="18sp"
+                    android:textStyle="bold" />
+
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="24dp"
+                android:orientation="horizontal">
+
+                <com.qmuiteam.qmui.widget.QMUIRadiusImageView
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:src="@drawable/bg_need_error"
+                    app:qmui_border_color="@color/translucent"
+                    app:qmui_corner_radius="16dp" />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="14dp"
+                    android:orientation="vertical">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="元宇宙IP热梗盲盒"
+                        android:textColor="#222222"
+                        android:textSize="16sp"
+                        android:textStyle="bold" />
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="20dp"
+                        android:orientation="horizontal">
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="¥"
+                            android:textColor="#F14351"
+                            android:textSize="14sp" />
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:text="20.00"
+                            android:textColor="#F14351"
+                            android:textSize="20sp" />
+
+                        <View
+                            android:layout_width="0dp"
+                            android:layout_height="match_parent"
+                            android:layout_weight="1" />
+
+                        <TextView
+                            android:layout_width="25dp"
+                            android:layout_height="25dp"
+                            android:gravity="center"
+                            android:text="-"
+                            android:textColor="#666666"
+                            android:textSize="18sp" />
+
+                        <EditText
+                            android:layout_width="40dp"
+                            android:layout_height="20dp"
+                            android:background="#E5E5E5"
+                            android:gravity="center"
+                            android:inputType="number"
+                            android:paddingStart="@dimen/dp_2"
+                            android:text="1"
+                            android:textColor="#666666"
+                            android:textSize="13sp" />
+
+                        <TextView
+                            android:layout_width="25dp"
+                            android:layout_height="25dp"
+                            android:gravity="center"
+                            android:text="+"
+                            android:textColor="#666666"
+                            android:textSize="18sp" />
+
+
+                    </LinearLayout>
+
+
+                </LinearLayout>
+
+
+            </LinearLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/dp_1"
+                android:layout_marginTop="16dp"
+                android:background="#F3F3F3" />
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="48dp"
+                android:gravity="center_vertical"
+                android:text="选择支付方式"
+                android:textColor="@color/text_title"
+                android:textSize="14sp" />
+
+            <LinearLayout
+                android:id="@+id/ll_alipay"
+                android:layout_width="match_parent"
+                android:layout_height="48dp"
+                android:gravity="center"
+                android:orientation="horizontal"
+                android:paddingStart="20dp"
+                android:paddingEnd="21dp"
+                android:background="@drawable/bg_pop_pay_on"
+
+               >
+
+                <ImageView
+                    android:layout_width="20dp"
+                    android:layout_height="20dp"
+                    android:src="@drawable/ct_tr_alipay" />
+
+                <TextView
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="9dp"
+                    android:layout_weight="1"
+                    android:text="支付宝支付"
+                    android:textColor="@color/text_title"
+                    android:textSize="14sp" />
+
+                <ImageView
+                    android:layout_width="16dp"
+                    android:layout_height="16dp"
+                    android:src="@{vm.isWx?@drawable/ct_tr_chose_on:@drawable/ct_tr_chose_off}"
+                    tools:src="@drawable/ct_tr_chose_off" />
+
+
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:id="@+id/ll_wx"
+                android:layout_width="match_parent"
+                android:layout_height="48dp"
+                android:gravity="center"
+                android:layout_marginTop="20dp"
+                android:orientation="horizontal"
+                android:paddingStart="20dp"
+                android:paddingEnd="21dp"
+                android:background="@drawable/bg_pop_pay_off"
+               >
+
+                <ImageView
+                    android:layout_width="20dp"
+                    android:layout_height="20dp"
+                    android:src="@drawable/ct_tr_wx" />
+
+                <TextView
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="9dp"
+                    android:layout_weight="1"
+                    android:text="微信支付"
+                    android:textColor="@color/text_title"
+                    android:textSize="14sp" />
+
+                <ImageView
+                    android:layout_width="16dp"
+                    android:layout_height="16dp"
+                    android:src="@{vm.isWx?@drawable/ct_tr_chose_on:@drawable/ct_tr_chose_off}"
+                    tools:src="@drawable/ct_tr_chose_off" />
+
+
+            </LinearLayout>
+
+            <TextView
+                android:textSize="10sp"
+                android:textColor="#999999"
+                android:text="支付说明"
+                android:layout_marginTop="14dp"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"/>
+            <TextView
+                android:textSize="10sp"
+                android:textColor="#999999"
+                android:text="@string/pay_tips"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"/>
+
+            <TextView
+                android:id="@+id/tv_pay"
+                android:layout_width="match_parent"
+                android:layout_height="46dp"
+                android:layout_marginTop="32dp"
+                android:layout_marginBottom="39dp"
+                android:background="@drawable/bg_logo_but"
+                android:gravity="center"
+                android:text="立即支付"
+                android:textColor="@color/white"
+                android:textSize="20sp" />
+
+
+        </LinearLayout>
+
+
+    </LinearLayout>
+
+</LinearLayout>

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

@@ -522,6 +522,7 @@ Api 已达到使用限制
     <string name="buy_insure_off">购买保险</string>
     <string name="buy_insure_on">已购买保险</string>
     <string name="slash">/</string>
+    <string name="pay_tips">数字藏品未虚拟数字商品,而非实物,仅限实名认证的中国大陆用户购买、抽取或者获取空投。数字藏品的版权由发行方或原创者所有,除另行取得版权拥有者书面同意外,用户不得将数字藏品用于任何商业用途。商品一经出售,不支持退换。</string>
     <string name="test_tips">前创持文化发售了山水画《秋山瑞松图》赢得了广大藏家的关注,今天将公布第二波《如画江山多锦绣》限量发售,欢迎大家踊跃参与。\r\n\r\n发售详情:\r\n发售时间:7月20日\r\n发售数量:1600份\r\n优先购时间:12:15-12:15\r\n普通购时间:12:30\r\n发售价格:49.9元/份\r\n\r\n备注:拥有《秋山瑞松图》可参与优先购</string>
 
 

+ 50 - 42
base/src/main/java/com/ysnows/base/base/BRRepository.kt

@@ -8,6 +8,7 @@ import com.ysnows.base.emptyview.callback.TimeoutCallback
 import com.ysnows.base.emptyview.callback.ToLoginCallback
 import com.ysnows.base.net.IResp
 import com.ysnows.base.net.NetCode
+import com.ysnows.base.net.PageResp
 import com.ysnows.base.net.Resp
 import com.ysnows.base.utils.exception.ExceptionUtils
 import com.ysnows.base.view.BRView
@@ -37,8 +38,8 @@ open class BRRepository : BRepository() {
      * */
 
     private suspend fun <T : IResp<*>> reqList(
-        pageLoading: Boolean = true,
-        func: suspend () -> T
+            pageLoading: Boolean = true,
+            func: suspend () -> T
     ): T {
 
         try {
@@ -73,7 +74,11 @@ open class BRRepository : BRepository() {
 
 
                     } else {
-                        view().adapter().setList(resp.data() as Collection<Nothing>)
+                        if (resp is PageResp<*>) {
+                            view().adapter().setList(resp.data()?.list as Collection<Nothing>)
+                        } else {
+                            view().adapter().setList(resp.data() as Collection<Nothing>)
+                        }
 
                         bView.loadService?.showSuccess()
 //                        if (pageLoading) {
@@ -81,8 +86,11 @@ open class BRRepository : BRepository() {
 //                        }
                     }
                 } else {
-
-                    view().adapter().addData(resp.data() as Collection<Nothing>)
+                    if (resp is PageResp<*>) {
+                        view().adapter().addData(resp.data()?.list as Collection<Nothing>)
+                    } else {
+                        view().adapter().addData(resp.data() as Collection<Nothing>)
+                    }
                 }
 
                 when {
@@ -124,8 +132,8 @@ open class BRRepository : BRepository() {
 
 
             return Resp<Any>(
-                NetCode.CODE_EXCEPTION,
-                msg = ExceptionUtils.getExceptionName(e)
+                    NetCode.CODE_EXCEPTION,
+                    msg = ExceptionUtils.getExceptionName(e)
             ) as T
         }
     }
@@ -143,8 +151,8 @@ open class BRRepository : BRepository() {
 
 
     fun rxReqFirstPage(
-        api: Observable<IResp<Collection<Any>>>,
-        pagable: Boolean
+            api: Observable<IResp<Collection<Any>>>,
+            pagable: Boolean
     ): Observable<IResp<Collection<Any>>> {
         this.api = api;
         page = 1
@@ -163,50 +171,50 @@ open class BRRepository : BRepository() {
 
     @SuppressLint("CheckResult")
     fun rxReqList(
-        observable: Observable<IResp<Collection<Any>>>,
-        pageLoading: Boolean
+            observable: Observable<IResp<Collection<Any>>>,
+            pageLoading: Boolean
     ): Observable<IResp<Collection<Any>>> {
         return Observable.create { emitter: ObservableEmitter<IResp<Collection<Any>>> ->
             rxReq(observable, pageLoading, false)
-                .doOnError { throwable: Throwable ->
-                    throwable.printStackTrace()
-                    if (page >= 1) {
-                        view().adapter().loadMoreModule.loadMoreFail()
-                        page -= 1
+                    .doOnError { throwable: Throwable ->
+                        throwable.printStackTrace()
+                        if (page >= 1) {
+                            view().adapter().loadMoreModule.loadMoreFail()
+                            page -= 1
+                        }
+                        emitter.onError(throwable)
                     }
-                    emitter.onError(throwable)
-                }
-                .subscribe({ res: IResp<Collection<Any>> ->
-                    view().onListReceive(res)
-                    if (page <= 1) {
-                        if (res.empty()) { //如果没有数据
-                            view().refreshing(false)
-                            view().loadService!!.showCallback(EmptyCallback::class.java)
-                        } else {
-                            view().refreshing(false)
-                            //Object data = res.data();
+                    .subscribe({ res: IResp<Collection<Any>> ->
+                        view().onListReceive(res)
+                        if (page <= 1) {
+                            if (res.empty()) { //如果没有数据
+                                view().refreshing(false)
+                                view().loadService!!.showCallback(EmptyCallback::class.java)
+                            } else {
+                                view().refreshing(false)
+                                //Object data = res.data();
 //                                if (data instanceof IResultList) {
 //                                    adapter.setList(((IResultList) data).list());
 //                                }
-                            view().adapter().setList(res.data() as Collection<Nothing>)
-                            view().loadService!!.showSuccess()
-                        }
-                        view().getTotal(res.total())
-                    } else {
+                                view().adapter().setList(res.data() as Collection<Nothing>)
+                                view().loadService!!.showSuccess()
+                            }
+                            view().getTotal(res.total())
+                        } else {
 //                            Object data = res.data();
 //                            if (data instanceof IResultList) {
 //                                view().getAdapter().addData((((IResultList) data).list()));
 //                            }
-                        view().adapter().addData(res.data() as Collection<Nothing>)
-                    }
-                    if (res.more(page)) {
-                        view().adapter().loadMoreModule.loadMoreComplete()
-                    } else {
-                        //数据全部加载完毕
-                        view().adapter().loadMoreModule.loadMoreEnd()
-                    }
-                    emitter.onNext(res)
-                }, { throwable: Throwable? -> }) { emitter.onComplete() }
+                            view().adapter().addData(res.data() as Collection<Nothing>)
+                        }
+                        if (res.more(page)) {
+                            view().adapter().loadMoreModule.loadMoreComplete()
+                        } else {
+                            //数据全部加载完毕
+                            view().adapter().loadMoreModule.loadMoreEnd()
+                        }
+                        emitter.onNext(res)
+                    }, { throwable: Throwable? -> }) { emitter.onComplete() }
         }
     }
 

+ 1 - 1
base/src/main/res/values/colors.xml

@@ -21,7 +21,7 @@
     <color name="text_hint" >#9D9D9D</color >
     <color name="progress_bg" >#eeeeee</color >
     <color name="wechat_color" >#58B478</color >
-    <color name="black" >#222222</color >
+    <color name="black" >#000000</color >
     <color name="white" >#FFFFFF</color >
 
     <color name="but_color_off" >#FFBC00</color >

+ 2 - 1
common-build.gradle

@@ -71,7 +71,8 @@ dependencies {
 
     implementation 'com.yanzhenjie:permission:2.0.3'
 
-    implementation("io.coil-kt:coil:1.2.1")
+    implementation("io.coil-kt:coil:1.3.2")
+    implementation 'io.coil-kt:coil-gif:1.3.2'
 
     implementation "com.google.dagger:hilt-android:$hilt_version"
     kapt "com.google.dagger:hilt-android-compiler:$hilt_version"