lmw
2024-07-09 b13afc751dbbce24753d008f1f87d2c5e133a4ad
app/src/main/java/com/dollearn/student/ui/welfare/GoodsDetailActivity.kt
@@ -39,6 +39,12 @@
    override fun initClick() {
        tv_action.setOnClickListener {
            if (score<goods?.good?.integral?:0){
                val tipDialog = TipDialog()
                tipDialog.arguments = bundleOf("isAlert" to true,"msg" to "兑换失败,当前剩余积分不足!","ok" to "关闭")
                tipDialog.show(supportFragmentManager,"tip")
                return@setOnClickListener
            }
            tv_action.isEnabled = false
            showDialog()
            HttpManager.redeemNow(id).request(this,false, {_,data->
@@ -88,7 +94,7 @@
                tv_value.paintFlags = tv_value.paintFlags or Paint.STRIKE_THRU_TEXT_FLAG
                tv_name.text = good.name
                tv_category.text = goodTypes?.joinToString ("|"){ it.name }
                tv_sold.text = "剩余数量:%d|可换数量:%d|%d人已换".format(good.surplus,good.userCount,good.inventory?:0)
                tv_sold.text = "%s%s%d人已换".format(if (residueNumber == null) "" else "剩余数量:${residueNumber}|",if (good.userCount == null) "" else "可换数量:${good.userCount}|", exchangeNumber)
                val sHead =
                    "<html><head><meta name=\"viewport\" content=\"width=device-width, " + "initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes\" />" + "<style>img{max-width:100% !important;height:auto !important;}</style>" + "<style>body{max-width:100% !important;}</style>" + "</head><body>"
                webView!!.loadDataWithBaseURL(null, sHead + good.detail, "text/html", "utf-8", null)