| | |
| | | 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) { |
| | |
| | | |
| | | } |
| | | |
| | | 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) |