app/src/main/java/com/example/firstapp/activity/VipActivity.kt
@@ -252,8 +252,9 @@
                        Toast.makeText(this@VipActivity, "请勾选协议", Toast.LENGTH_LONG).show()
                        return@launch // 直接 return,不往下执行
                    }
                    Toast.makeText(this@VipActivity, "功能暂未开放", Toast.LENGTH_LONG).show()
                    return@launch
//                    Toast.makeText(this@VipActivity, "功能暂未开放", Toast.LENGTH_LONG).show()
//                    return@launch
                    doWechatPay()
                } catch (e: Exception) {
@@ -266,6 +267,23 @@
    }
    private fun doWechatPay() {
        val map=HashMap<String,String>()
        map["appId"]="wxb4ba3c02aa476ea1"
        map["partnerid"]="1900006771"
        map["package"]="Sign=WXPay"
        map["noncestr"]="2ac6c60ebfe7e549fbbc922ac54269bb"
        map["timeStamp"]="1606317975"
        map["prepayid"]="wx25232614962974fb29d1227819cc3e000g"
        map["sign"]="wx25232614962974fb29d1227819cc3e000g"
        PayAbility.wxPay(this, map, Observer { success ->
            if (success == 0) {
                Toast.makeText(this@VipActivity, "支付失败", Toast.LENGTH_LONG).show()
            } else {
                Toast.makeText(this@VipActivity, "支付成功", Toast.LENGTH_LONG).show()
            }
        })
    }
    private fun vipCardInit() {
        val recyclerView = findViewById<RecyclerView>(R.id.recycler_view)
@@ -378,13 +396,6 @@
                    )
                }
//                setPadding(
//                    TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 20f, resources.displayMetrics).toInt(), // left padding
//                    TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt(), // top padding
//                    TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 20f, resources.displayMetrics).toInt(), // right padding
//                    TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt()  // bottom padding
//                )
            }
            val textView = TextView(this).apply {
@@ -417,14 +428,14 @@
                ConstraintSet.TOP,
                previousViewId,
                if (index == 0) ConstraintSet.TOP else ConstraintSet.BOTTOM,
                16
                32
            )
            constraintSet.connect(
                iconView.id,
                ConstraintSet.START,
                ConstraintSet.PARENT_ID,
                ConstraintSet.START,
                16
                32
            )
            // Text 位置
@@ -434,7 +445,7 @@
                ConstraintSet.START,
                iconView.id,
                ConstraintSet.END,
                8
                32
            )
            // Check 位置
@@ -444,7 +455,7 @@
                ConstraintSet.END,
                ConstraintSet.PARENT_ID,
                ConstraintSet.END,
                16
                32
            )
            constraintSet.applyTo(container)