| | |
| | | |
| | | val alipayAmount:TextView = findViewById(R.id.alipay_amount); |
| | | val wechatAmount:TextView = findViewById(R.id.wechat_amount); |
| | | val protocolDescLayout:TextView = findViewById(R.id.protocol_desc_layout); |
| | | |
| | | |
| | | alipayAmount.text=currentPrice.toString() |
| | | wechatAmount.text=currentPrice.toString() |
| | | protocolDescLayout.text="自动续费可随时取消,开通后每月按${currentPrice.toString()}元自动续费,可随时取消自动续费" |
| | | |
| | | |
| | | }catch (e: Exception) { |
| | | Toast.makeText(this@VipActivity, e.message, Toast.LENGTH_LONG).show() |
| | | Log.d("AliPayHelper","xuan: ${e.message}") |
| | | Log.d("AliPayHelper","支付失败: ${e.message}") |
| | | } |
| | | |
| | | val adapter = CardAdapter(cardList) { cardViewList, cardData, cardView -> |
| | |
| | | layoutParams = ConstraintLayout.LayoutParams( |
| | | TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt(), |
| | | TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt() |
| | | ) |
| | | ).apply { |
| | | // 设置 margin |
| | | setMargins( |
| | | TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 20f, resources.displayMetrics).toInt(), // left |
| | | TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt(), // top |
| | | TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 20f, resources.displayMetrics).toInt(), // right |
| | | TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt() // bottom |
| | | ) |
| | | } |
| | | |
| | | |
| | | // 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 { |
| | |
| | | wechatAmount.text=currentPrice.toString() |
| | | // 处理点击事件,这里我们只是简单地展示一个 Toast |
| | | // Toast.makeText(this, "点击了: ${title}", Toast.LENGTH_SHORT).show() |
| | | // 只有连续包月才展示 |
| | | val xieyiLayout:LinearLayout = findViewById(R.id.xieyi_layout); |
| | | if (title == "连续包月") { |
| | | xieyiLayout.visibility = View.VISIBLE |
| | | }else{ |
| | | xieyiLayout.visibility = View.GONE |
| | | } |
| | | |
| | | orderName = title |
| | | orderType=title |