From ef4ad6195ba5cf2e61e50c86b735a65aec63b4e9 Mon Sep 17 00:00:00 2001 From: tj <1378534974@qq.com> Date: 星期五, 28 三月 2025 15:00:21 +0800 Subject: [PATCH] 1.vip续费页面-会员权益 2.vip续费页面-更多权益 3.vip续费页面-付费面板 --- app/src/main/java/com/example/firstapp/adapter/CardAdapter.kt | 2 .idea/deploymentTargetSelector.xml | 4 app/src/main/res/layout/item_card_yearly.xml | 58 ++ app/src/main/res/mipmap/vip_life_insurance.png | 0 app/src/main/res/layout/item_card_single_month.xml | 33 + app/src/main/java/com/example/firstapp/activity/VipActivity.kt | 311 +++++++++++++ app/src/main/res/layout/vip_protocol_dialog_custom_bak.xml | 52 ++ app/src/main/res/mipmap/vip_cancel_link.png | 0 app/src/main/res/mipmap/vip_circle_pie.png | 0 app/src/main/res/drawable/more_benefit_shape.xml | 10 app/src/main/res/mipmap/vip_no.png | 0 .idea/misc.xml | 2 app/src/main/res/mipmap/vip.png | 0 app/src/main/res/mipmap/vip_wechat.png | 0 app/src/main/res/mipmap/vip_copy.png | 0 app/src/main/java/com/example/firstapp/ui/notifications/NotificationsFragment.kt | 42 - app/src/main/res/drawable/ic_reminder.xml | 12 app/src/main/res/mipmap/vip_more.png | 0 .idea/gradle.xml | 3 app/src/main/res/mipmap/vip_ad_no.png | 0 app/src/main/res/mipmap/vip_free_member.png | 0 app/src/main/res/mipmap/vip_alipay.png | 0 app/src/main/res/layout/vip_protocol_dialog_custom.xml | 44 ++ app/src/main/res/drawable/checkbox_round.xml | 7 app/src/main/res/layout/fragment_member_info_card.xml | 84 ++- app/src/main/res/mipmap/vip_bar_sta.png | 0 app/src/main/java/com/example/firstapp/model/MoreMemberBenefitItem.kt | 4 app/src/main/res/mipmap/vip_card.png | 0 app/src/main/res/mipmap/vip_cancel.png | 0 app/src/main/res/drawable/alipay_shape.xml | 6 app/src/main/java/com/example/firstapp/database/service/ApiService.kt | 5 app/src/main/res/layout/activity_vip.xml | 521 +++++++++++++++++++++-- app/src/main/java/com/example/firstapp/model/CardData.kt | 2 app/src/main/java/com/example/firstapp/model/MemberBenefitItem.kt | 5 app/src/main/res/drawable/wechat_shape.xml | 6 app/src/main/res/drawable/checkbox_round_selected.xml | 7 app/src/main/res/mipmap/vip_ling.png | 0 app/src/main/res/mipmap/vip_ai_ass_icon.png | 0 app/src/main/res/drawable/ic_check.xml | 4 app/src/main/res/mipmap/vip_right.png | 0 app/src/main/res/drawable/dialog_background.xml | 16 app/src/main/res/drawable/black_button_background.xml | 6 app/src/main/res/drawable/ic_stats.xml | 12 app/src/main/res/layout/item_card_continue_monthly.xml | 33 + 44 files changed, 1,111 insertions(+), 180 deletions(-) diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml index 3b8cd93..e918287 100644 --- a/.idea/deploymentTargetSelector.xml +++ b/.idea/deploymentTargetSelector.xml @@ -4,10 +4,10 @@ <selectionStates> <SelectionState runConfigName="app"> <option name="selectionMode" value="DROPDOWN" /> - <DropdownSelection timestamp="2025-02-25T09:44:45.437232500Z"> + <DropdownSelection timestamp="2025-03-28T01:17:48.834725500Z"> <Target type="DEFAULT_BOOT"> <handle> - <DeviceId pluginId="PhysicalDevice" identifier="serial=88Y5T19C14010323" /> + <DeviceId pluginId="PhysicalDevice" identifier="serial=HMQNW19A24001406" /> </handle> </Target> </DropdownSelection> diff --git a/.idea/gradle.xml b/.idea/gradle.xml index ad84da2..cb865f6 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,9 +4,8 @@ <component name="GradleSettings"> <option name="linkedExternalProjectsSettings"> <GradleProjectSettings> - <option name="testRunner" value="CHOOSE_PER_TEST" /> <option name="externalProjectPath" value="$PROJECT_DIR$" /> - <option name="gradleJvm" value="17" /> + <option name="gradleJvm" value="jbr-17" /> <option name="modules"> <set> <option value="$PROJECT_DIR$" /> diff --git a/.idea/misc.xml b/.idea/misc.xml index d7916a5..8978d23 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ <project version="4"> <component name="ExternalStorageConfigurationManager" enabled="true" /> - <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/build/classes" /> </component> <component name="ProjectType"> diff --git a/app/src/main/java/com/example/firstapp/activity/VipActivity.kt b/app/src/main/java/com/example/firstapp/activity/VipActivity.kt index 183cd41..56df585 100644 --- a/app/src/main/java/com/example/firstapp/activity/VipActivity.kt +++ b/app/src/main/java/com/example/firstapp/activity/VipActivity.kt @@ -1,24 +1,47 @@ package com.example.firstapp.activity +import android.app.AlertDialog import android.graphics.Color import android.os.Bundle +import android.util.TypedValue +import android.view.Gravity +import android.view.LayoutInflater +import android.view.View +import android.widget.Button +import android.widget.CheckBox +import android.widget.CompoundButton +import android.widget.EditText +import android.widget.ImageView +import android.widget.LinearLayout +import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.cardview.widget.CardView +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.constraintlayout.widget.ConstraintSet import androidx.core.content.ContextCompat +import androidx.lifecycle.Observer +import androidx.lifecycle.lifecycleScope import androidx.navigation.ui.AppBarConfiguration import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.example.firstapp.R import com.example.firstapp.adapter.CardAdapter +import com.example.firstapp.database.service.RetrofitClient import com.example.firstapp.databinding.ActivityVipBinding -import com.example.firstapp.entity.CardData +import com.example.firstapp.model.CardData +import com.example.firstapp.model.MemberBenefitItem +import com.example.firstapp.pay.PayAbility import com.example.firstapp.utils.Log +import com.google.android.material.dialog.MaterialAlertDialogBuilder +import kotlinx.coroutines.launch + class VipActivity : AppCompatActivity() { private lateinit var appBarConfiguration: AppBarConfiguration private lateinit var binding: ActivityVipBinding + private var isPaymentSelected = false // 全局变量,默认未选中 override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -41,52 +64,297 @@ finish() } +// 会员卡片初始化 + vipCardInit() + +// 会员权益初始化 + memberBenefitInit() + + // 支付宝点击事件 + handleAlipayClick() + + // 微信点击事件 + handleWechatClick() + + // 勾选协议点击事件 + handlePrototalClick() + } + + + private fun handlePrototalClick(){ + val protocol: CheckBox = findViewById(R.id.protocol_checkbox); + + // 监听 RadioButton 选中状态 + protocol.setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener { buttonView, isChecked -> + isPaymentSelected = isChecked // 更新全局变量 + if(isChecked){ + protocol.background = ContextCompat.getDrawable(this, R.drawable.checkbox_round_selected) + }else{ + protocol.background = ContextCompat.getDrawable(this, R.drawable.checkbox_round) + } + }) + } + + // 这里添加alipay_layout的点击事件 + private fun handleAlipayClick() { + // 绑定按钮 + val btnAlipay: LinearLayout = findViewById(R.id.alipay_layout); + btnAlipay.setOnClickListener(View.OnClickListener { + // 判断协议是否勾选 + if (!isPaymentSelected){ + // 这里需要弹出框 + showConfirmDialog() + }else{ + doAlipay() + } + + + }) + } + + private fun doAlipay(){ + lifecycleScope.launch { + try { + val response = RetrofitClient.apiService.getPayOrderInfo() + var orderInfo=response.data + Log.d("AliPayHelper","获取订单信息时: ${response}") + // 这里调用支付宝 + PayAbility.aliPay(this@VipActivity, orderInfo, Observer { + when (it.resultStatus) { + "9000" -> { +// Snackbar.make(binding.root, "支付成功", Snackbar.LENGTH_LONG).show() + runOnUiThread { + Toast.makeText(this@VipActivity, "支付成功", Toast.LENGTH_LONG).show() + } + } + else -> { +// Snackbar.make(binding.root, "支付失败", Snackbar.LENGTH_LONG).show() + + runOnUiThread { + Toast.makeText(this@VipActivity, "支付失败", Toast.LENGTH_LONG).show() + } + } + } + }) + + } catch (e: Exception) { + Toast.makeText(this@VipActivity, e.message, Toast.LENGTH_LONG).show() + Log.d("AliPayHelper","获取订单信息时发生错误: ${e.message}") + } + } + } + + private fun showConfirmDialog() { + val dialogView = LayoutInflater.from(this).inflate(R.layout.vip_protocol_dialog_custom, null) + + val dialog = AlertDialog.Builder(this) + .setView(dialogView) + .create() + + // 设置自定义背景 + dialog.window?.setBackgroundDrawableResource(R.drawable.dialog_background) + + // 获取按钮并设置点击事件 + val btnConfirm = dialogView.findViewById<Button>(R.id.btnConfirm) + btnConfirm.setOnClickListener { + // 将协议勾选上 + val protocol: CheckBox = findViewById(R.id.protocol_checkbox); + protocol.isChecked = true + + doAlipay() + dialog.dismiss() + } + + // 显示对话框 + dialog.show() + } + private fun showConfirmDialog2() { + // 创建标题 TextView 并居中 + val titleView = TextView(this).apply { + text = "确认开通" + textSize = 20f + gravity = Gravity.CENTER + setPadding(20, 20, 20, 20) + } + + // 创建内容 TextView 并居中 + val messageView = TextView(this).apply { + text = "请阅读并同意《会员协议》?" + textSize = 16f + gravity = Gravity.CENTER + setPadding(40, 20, 40, 20) + } + + AlertDialog.Builder(this) + .setCustomTitle(titleView) // 自定义标题 + .setView(messageView) // 自定义内容 + .setPositiveButton("继续开通") { _, _ -> + + + + // 确认支付 + doAlipay() + } + .setNegativeButton("取消") { dialog, _ -> + dialog.dismiss() // 关闭对话框 + } + .show() + } + + // 这里添加alipay_layout的点击事件 + private fun handleWechatClick() { + + // 绑定按钮 + val wechatAlipay: LinearLayout = findViewById(R.id.wechat_layout); + wechatAlipay.setOnClickListener(View.OnClickListener { + lifecycleScope.launch { + try { + // 判断协议是否勾选 + if (!isPaymentSelected){ + + Toast.makeText(this@VipActivity, "请勾选协议", Toast.LENGTH_LONG).show() + return@launch // 直接 return,不往下执行 + } + Toast.makeText(this@VipActivity, "功能暂未开放", Toast.LENGTH_LONG).show() + return@launch + + + } catch (e: Exception) { + Toast.makeText(this@VipActivity, e.message, Toast.LENGTH_LONG).show() + Log.d("AliPayHelper","获取订单信息时发生错误: ${e.message}") + } + } + }) + + + } + + + private fun vipCardInit() { val recyclerView = findViewById<RecyclerView>(R.id.recycler_view) - recyclerView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false) + recyclerView.layoutManager = + LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false) val cardList = listOf( CardData.ContinueMonthly( "首月限时特惠", "连续包月", "首次开通", - "¥9.9", + "9.9", "次月起12元/月", "自动续费可随时取消" ), CardData.Yearly( "折合9元/月", "年卡", - "¥108/年", - "¥168" + "108", + "168" ), CardData.SingleMonth( "1个月", - "¥15" + "15" ) ) - val adapter = CardAdapter(cardList) {cardViewList, cardData, cardView -> - handleCardClick(cardViewList,cardData,cardView) + val adapter = CardAdapter(cardList) { cardViewList, cardData, cardView -> + handleVipCardClick(cardViewList, cardData, cardView) } recyclerView.adapter = adapter + } + private fun memberBenefitInit() { + val container = findViewById<ConstraintLayout>(R.id.dynamicContainer) - try { - val firstMonthCardView = findViewById<CardView>(R.id.vip_first_month_card_view) - firstMonthCardView.foreground = ContextCompat.getDrawable(this, R.drawable.gray_border_shape) // 设置自定义背景 + // 传递过来的数据列表 + val itemList = listOf( + MemberBenefitItem(R.mipmap.vip_life_insurance, "自定义更多分类", true), + MemberBenefitItem(R.mipmap.vip_ad_no, "自动去广告", false), + MemberBenefitItem(R.mipmap.vip_ling, "公众号提醒待办", true), + MemberBenefitItem(R.mipmap.vip_circle_pie, "数据统计", false) + ) - }catch (e: Exception){ - e.stackTrace - Log.e("VipActivity",e.message+"") + var previousViewId = R.id.dynamicContainer + + for ((index, item) in itemList.withIndex()) { + val iconView = ImageView(this).apply { + id = View.generateViewId() + setImageResource(item.iconRes) + layoutParams = ConstraintLayout.LayoutParams( + TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt(), + TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt() + ) + } + + val textView = TextView(this).apply { + id = View.generateViewId() + text = item.text + textSize = 16f + setTextColor(Color.parseColor("#DFC08E")) + } + + val checkView = ImageView(this).apply { + id = View.generateViewId() + setImageResource(R.drawable.ic_check) + layoutParams = ConstraintLayout.LayoutParams( + TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt(), + TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics).toInt() + ) + } + + container.addView(iconView) + container.addView(textView) + container.addView(checkView) + + val constraintSet = ConstraintSet() + constraintSet.clone(container) + + // Icon 位置 + constraintSet.connect( + iconView.id, + ConstraintSet.TOP, + previousViewId, + if (index == 0) ConstraintSet.TOP else ConstraintSet.BOTTOM, + 16 + ) + constraintSet.connect( + iconView.id, + ConstraintSet.START, + ConstraintSet.PARENT_ID, + ConstraintSet.START, + 16 + ) + + // Text 位置 + constraintSet.connect(textView.id, ConstraintSet.TOP, iconView.id, ConstraintSet.TOP) + constraintSet.connect( + textView.id, + ConstraintSet.START, + iconView.id, + ConstraintSet.END, + 8 + ) + + // Check 位置 + constraintSet.connect(checkView.id, ConstraintSet.TOP, iconView.id, ConstraintSet.TOP) + constraintSet.connect( + checkView.id, + ConstraintSet.END, + ConstraintSet.PARENT_ID, + ConstraintSet.END, + 16 + ) + + constraintSet.applyTo(container) + + previousViewId = iconView.id } - } /** * 会员卡样式点击事件 */ - private fun handleCardClick(cardViewList: MutableList<CardView>,cardData: CardData, cardView: CardView) { + private fun handleVipCardClick(cardViewList: MutableList<CardView>, cardData: CardData, cardView: CardView) { // 处理点击事件,修改样式 // 修改所有的边框色都是灰色 cardViewList.forEach { card -> @@ -101,6 +369,17 @@ is CardData.Yearly -> cardData.title is CardData.SingleMonth -> cardData.title } + val price = when (cardData) { + is CardData.ContinueMonthly -> cardData.price + is CardData.Yearly -> cardData.price + is CardData.SingleMonth -> cardData.price + } + + + val alipayAmount:TextView = findViewById(R.id.alipay_amount); + val wechatAmount:TextView = findViewById(R.id.wechat_amount); + alipayAmount.text=price + wechatAmount.text=price // 处理点击事件,这里我们只是简单地展示一个 Toast Toast.makeText(this, "点击了: ${title}", Toast.LENGTH_SHORT).show() } diff --git a/app/src/main/java/com/example/firstapp/adapter/CardAdapter.kt b/app/src/main/java/com/example/firstapp/adapter/CardAdapter.kt index 9f1b699..f9b45f3 100644 --- a/app/src/main/java/com/example/firstapp/adapter/CardAdapter.kt +++ b/app/src/main/java/com/example/firstapp/adapter/CardAdapter.kt @@ -9,7 +9,7 @@ import androidx.cardview.widget.CardView import androidx.recyclerview.widget.RecyclerView import com.example.firstapp.R -import com.example.firstapp.entity.CardData +import com.example.firstapp.model.CardData class CardAdapter(private val cardList: List<CardData>, diff --git a/app/src/main/java/com/example/firstapp/database/service/ApiService.kt b/app/src/main/java/com/example/firstapp/database/service/ApiService.kt index 3171ff6..2b046b7 100644 --- a/app/src/main/java/com/example/firstapp/database/service/ApiService.kt +++ b/app/src/main/java/com/example/firstapp/database/service/ApiService.kt @@ -44,7 +44,7 @@ @GET("config-security/enable-list-all") suspend fun getSecurityList(): SecurityResponse - @GET("alipay/pay-order-info") + @GET("v2/alipay/pay-order-info") suspend fun getPayOrderInfo(): AlipayOrderInfoResponse @GET("flower/api/supplier/info/{phone}") @@ -64,8 +64,7 @@ // 创建Retrofit实例(单例) object RetrofitClient{ -// private const val BASE_URL ="http://192.168.1.213:8888/jshERP-boot/" - private const val BASE_URL ="http://192.168.1.213:5000/" + private const val BASE_URL ="http://192.168.1.199:8080/smart_message/" //添加Gson解析器,用于自动将JSON响应转换为Kotlin/Java对象 private val retrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create()).build() diff --git a/app/src/main/java/com/example/firstapp/entity/CardData.kt b/app/src/main/java/com/example/firstapp/model/CardData.kt similarity index 93% rename from app/src/main/java/com/example/firstapp/entity/CardData.kt rename to app/src/main/java/com/example/firstapp/model/CardData.kt index f5c7c46..4c4ef14 100644 --- a/app/src/main/java/com/example/firstapp/entity/CardData.kt +++ b/app/src/main/java/com/example/firstapp/model/CardData.kt @@ -1,4 +1,4 @@ -package com.example.firstapp.entity +package com.example.firstapp.model sealed class CardData { data class ContinueMonthly( diff --git a/app/src/main/java/com/example/firstapp/model/MemberBenefitItem.kt b/app/src/main/java/com/example/firstapp/model/MemberBenefitItem.kt new file mode 100644 index 0000000..179daa5 --- /dev/null +++ b/app/src/main/java/com/example/firstapp/model/MemberBenefitItem.kt @@ -0,0 +1,5 @@ +package com.example.firstapp.model + +class MemberBenefitItem ( val iconRes: Int, + val text: String, + val isChecked: Boolean ) \ No newline at end of file diff --git a/app/src/main/java/com/example/firstapp/model/MoreMemberBenefitItem.kt b/app/src/main/java/com/example/firstapp/model/MoreMemberBenefitItem.kt new file mode 100644 index 0000000..ceb96ad --- /dev/null +++ b/app/src/main/java/com/example/firstapp/model/MoreMemberBenefitItem.kt @@ -0,0 +1,4 @@ +package com.example.firstapp.model + +class MoreMemberBenefitItem (val iconRes: Int, + val text: String) \ No newline at end of file diff --git a/app/src/main/java/com/example/firstapp/ui/notifications/NotificationsFragment.kt b/app/src/main/java/com/example/firstapp/ui/notifications/NotificationsFragment.kt index 6566ceb..527fa09 100644 --- a/app/src/main/java/com/example/firstapp/ui/notifications/NotificationsFragment.kt +++ b/app/src/main/java/com/example/firstapp/ui/notifications/NotificationsFragment.kt @@ -130,39 +130,6 @@ private fun setupClickListeners() { - // 支付插件 -// binding.payPlugin.setOnClickListener { -// // 跳转到支付插件页面 -// lifecycleScope.launch { -// try { -// val response = RetrofitClient.apiService.getPayOrderInfo() -// var orderInfo=response.data -// Log.d("AliPayHelper","获取订单信息时: ${response}") -// // 这里调用支付宝 -// PayAbility.aliPay(requireActivity(), orderInfo, Observer { -// when (it.resultStatus) { -// "9000" -> { -//// Snackbar.make(binding.root, "支付成功", Snackbar.LENGTH_LONG).show() -// requireActivity().runOnUiThread { -// Toast.makeText(requireContext(), "支付成功", Toast.LENGTH_LONG).show() -// } -// } -// else -> { -//// Snackbar.make(binding.root, "支付失败", Snackbar.LENGTH_LONG).show() -// requireActivity().runOnUiThread { -// Toast.makeText(requireContext(), "支付失败", Toast.LENGTH_LONG).show() -// } -// -// } -// } -// }) -// -// } catch (e: Exception) { -// Log.d("AliPayHelper","获取订单信息时发生错误: ${e.message}") -// } -// } -// } - // 设置提醒 binding.layoutReminder.setOnClickListener { @@ -238,6 +205,15 @@ val intent = Intent(requireContext(), VipActivity::class.java) startActivity(intent) } + + binding.cardVip.setOnClickListener { +// Toast.makeText(context, "VIP续费功能开发中", Toast.LENGTH_SHORT).show() + // 跳转到vipActivity + val intent = Intent(requireContext(), VipActivity::class.java) + startActivity(intent) + } + + } private fun showEmailDialog() { diff --git a/app/src/main/res/drawable/alipay_shape.xml b/app/src/main/res/drawable/alipay_shape.xml new file mode 100644 index 0000000..df5109c --- /dev/null +++ b/app/src/main/res/drawable/alipay_shape.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid android:color="#D5EBFF"/> + <corners android:radius="30dp"/> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/black_button_background.xml b/app/src/main/res/drawable/black_button_background.xml new file mode 100644 index 0000000..73a1897 --- /dev/null +++ b/app/src/main/res/drawable/black_button_background.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <corners android:radius="5dp" /> + <solid android:color="#000000" /> + <padding android:left="10dp" android:right="10dp" android:top="5dp" android:bottom="5dp"/> +</shape> diff --git a/app/src/main/res/drawable/checkbox_round.xml b/app/src/main/res/drawable/checkbox_round.xml new file mode 100644 index 0000000..2f3d2fb --- /dev/null +++ b/app/src/main/res/drawable/checkbox_round.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <solid android:color="@android:color/transparent" /> <!-- 设置圆形的背景颜色 --> + <corners android:radius="300dp" /> <!-- 设置圆角半径为50%来形成圆形 --> + <stroke + android:color="#6B6A70" android:width="2dp" /> <!-- 设置边框宽度 --> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/checkbox_round_selected.xml b/app/src/main/res/drawable/checkbox_round_selected.xml new file mode 100644 index 0000000..f3ce711 --- /dev/null +++ b/app/src/main/res/drawable/checkbox_round_selected.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <solid android:color="#FF6200EE" /> <!-- 设置圆形的背景颜色 --> + <corners android:radius="300dp" /> <!-- 设置圆角半径为50%来形成圆形 --> + <stroke + android:color="#6B6A70" android:width="2dp" /> <!-- 设置边框宽度 --> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/dialog_background.xml b/app/src/main/res/drawable/dialog_background.xml new file mode 100644 index 0000000..530fb77 --- /dev/null +++ b/app/src/main/res/drawable/dialog_background.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <!-- 圆角 10dp --> + <corners android:radius="10dp" /> + + <!-- 背景色:黑色 --> + <solid android:color="#FFFFFF" /> + + <!-- 内边距 --> + <padding android:left="10dp" + android:top="10dp" + android:right="10dp" + android:bottom="10dp"/> + + <stroke android:width="0dp" android:color="#FFFFFF"/> +</shape> diff --git a/app/src/main/res/drawable/ic_check.xml b/app/src/main/res/drawable/ic_check.xml index 8cba425..a9a2051 100644 --- a/app/src/main/res/drawable/ic_check.xml +++ b/app/src/main/res/drawable/ic_check.xml @@ -6,9 +6,9 @@ android:viewportHeight="24"> <path - android:fillColor="#FFFFFF" + android:fillColor="#8A5C37" android:strokeWidth="2" - android:strokeColor="#000000" + android:strokeColor="#8A5C37" android:pathData="M10.29,15.29 4,9 5.41,7.59 10.29,12.47 19.59,3.17 21,4.59 10.29,15.29"/> </vector> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_reminder.xml b/app/src/main/res/drawable/ic_reminder.xml new file mode 100644 index 0000000..310d415 --- /dev/null +++ b/app/src/main/res/drawable/ic_reminder.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + <path + android:fillColor="#FFD700" + android:pathData="M12,1a11,11 0 0,1 0,22a11,11 0 0,1 0,-22zM12,18a2,2 0 0,1 0,4h-2v-4h2zm0,-12a3,3 0 0,0 -3,3v5h6V9a3,3 0 0,0 -3,-3z"/> + +</vector> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_stats.xml b/app/src/main/res/drawable/ic_stats.xml new file mode 100644 index 0000000..957f134 --- /dev/null +++ b/app/src/main/res/drawable/ic_stats.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + <path + android:fillColor="#FF5733" + android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zm0,18c-4.42,0 -8 -3.58 -8 -8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z M16,6h-4v10h4V6z"/> + +</vector> \ No newline at end of file diff --git a/app/src/main/res/drawable/more_benefit_shape.xml b/app/src/main/res/drawable/more_benefit_shape.xml new file mode 100644 index 0000000..f305ef0 --- /dev/null +++ b/app/src/main/res/drawable/more_benefit_shape.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"> + <gradient + android:angle="90" + android:startColor="#130F27" + android:endColor="#15102D" + android:type="linear"/> + <corners android:radius="30dp"/> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/wechat_shape.xml b/app/src/main/res/drawable/wechat_shape.xml new file mode 100644 index 0000000..5c6381a --- /dev/null +++ b/app/src/main/res/drawable/wechat_shape.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid android:color="#E7F8E7"/> + <corners android:radius="30dp"/> +</shape> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_vip.xml b/app/src/main/res/layout/activity_vip.xml index 3ef2986..7db7900 100644 --- a/app/src/main/res/layout/activity_vip.xml +++ b/app/src/main/res/layout/activity_vip.xml @@ -4,77 +4,496 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:fitsSystemWindows="true" - android:background="@drawable/member_background" + tools:context=".activity.VipActivity"> +<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:fillViewport="true" tools:context=".activity.VipActivity"> - <com.google.android.material.appbar.AppBarLayout + <androidx.coordinatorlayout.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" - android:background="@android:color/transparent" - > + android:background="@drawable/member_background"> - <com.google.android.material.appbar.MaterialToolbar - android:id="@+id/toolbar" + <!-- 这里是原来CoordinatorLayout中的内容,保持不变 --> + + <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" > - <!-- 直接在 Toolbar 中添加 TextView --> - <ImageView - android:id="@+id/ivBack" - android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:fitsSystemWindows="true" + android:background="@android:color/transparent"> + + <com.google.android.material.appbar.MaterialToolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize"> + <!-- 直接在Toolbar中添加TextView --> + <ImageView + android:id="@+id/ivBack" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="left" + android:layout_marginStart="16dp" + android:src="@drawable/ic_back" /> + <TextView + android:id="@+id/tvTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="智信会员" + android:textColor="#FFFFFF" + android:textSize="18sp" + android:layout_gravity="left" + android:layout_marginEnd="16dp" /> + </com.google.android.material.appbar.MaterialToolbar> + + </com.google.android.material.appbar.AppBarLayout> + <!-- 引入MemberInfoCardFragment --> + <fragment + android:name="com.example.firstapp.ui.vip.MemberInfoCardFragment" + android:id="@+id/memberInfoCardFragment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> + + <!-- 滑动框 --> + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recycler_view" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="145dp" + android:layout_marginLeft="15dp" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + android:background="@android:color/transparent" /> + + +<!-- 会员权益--动态--> + <androidx.constraintlayout.widget.ConstraintLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/benefit_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="270dp" + android:layout_marginLeft="15dp" + android:layout_marginRight="15dp" + android:padding="0dp" + android:background="@android:color/transparent" + app:cardBackgroundColor="@android:color/transparent" + android:foreground="@drawable/gray_border_shape" + + tools:context=".MainActivity"> + <!-- 标题 --> + <TextView + android:id="@+id/title_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="会员权益" + android:textColor="#8A5C37" + android:textSize="20sp" + android:textStyle="bold" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + android:layout_marginTop="5dp" /> + + <!-- 分割线 --> + <View + android:id="@+id/divider" + android:layout_width="0dp" + android:layout_height="1dp" + android:background="#615B7F" + app:layout_constraintTop_toBottomOf="@id/title_text" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + android:layout_marginTop="8dp" + android:layout_marginHorizontal="16dp" /> + <androidx.constraintlayout.widget.ConstraintLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/dynamicContainer" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="left" - android:layout_marginStart="16dp" - android:src="@drawable/ic_back" /> + android:padding="10dp" + android:layout_marginTop="0dp" + android:background="@android:color/transparent" + app:layout_constraintTop_toBottomOf="@id/divider" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + + /> + </androidx.constraintlayout.widget.ConstraintLayout> + +<!-- 更多权益--> + + <LinearLayout + android:id="@+id/more_benefit_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/more_benefit_shape" + android:layout_marginTop="480dp" + android:layout_marginLeft="13dp" + android:layout_marginRight="13dp" + android:padding="10dp" + android:orientation="vertical" + android:gravity="center"> + <TextView - android:id="@+id/tvTitle" + android:id="@+id/more_benefit_text" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="智信会员" - android:textColor="#FFFFFF" - android:textSize="18sp" - android:layout_gravity="left" - android:layout_marginEnd="16dp"/> - </com.google.android.material.appbar.MaterialToolbar> + android:text="更多权益敬请期待" + android:textColor="#D5D4DA" + android:textStyle="italic|bold" + android:textSize="16sp" + android:layout_marginBottom="10dp" + android:gravity="center" + android:layout_gravity="center"/> - </com.google.android.material.appbar.AppBarLayout> - <!-- 引入 MemberInfoCardFragment --> - <fragment - android:name="com.example.firstapp.ui.vip.MemberInfoCardFragment" - android:id="@+id/memberInfoCardFragment" + <!-- 第一项 --> + <LinearLayout + android:layout_width="200dp" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="start" + android:baselineAligned="false" + android:layout_marginBottom="8dp" + > + + <ImageView + android:layout_width="30dp" + android:layout_height="30dp" + android:src="@mipmap/vip_ai_ass_icon" + android:layout_marginEnd="8dp"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="解锁AI语音助手" + android:textColor="#93B7D9" + android:textSize="16sp" + android:gravity="start"/> + </LinearLayout> + <!-- 第二项 --> + <LinearLayout + android:layout_width="200dp" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="start" + android:baselineAligned="false" + android:layout_marginBottom="8dp" + > + <ImageView + android:layout_width="30dp" + android:layout_height="30dp" + android:src="@mipmap/vip_bar_sta" + android:layout_marginEnd="8dp" + /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="数据智能预测" + android:textColor="#93B7D9" + android:textSize="16sp" + android:gravity="start"/> + </LinearLayout> + + <!-- 第三项 --> + <LinearLayout + android:layout_width="200dp" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="start" + android:baselineAligned="false" + android:layout_marginBottom="8dp" + > + + <ImageView + android:layout_width="30dp" + android:layout_height="30dp" + android:src="@mipmap/vip_life_insurance" + android:layout_marginEnd="8dp"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="家庭分类共享" + android:textColor="#93B7D9" + android:textSize="16sp" + android:gravity="start"/> + </LinearLayout> + + <LinearLayout + android:layout_width="160dp" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="start" + android:baselineAligned="false" + android:layout_marginBottom="8dp" + > + + <ImageView + android:layout_width="30dp" + android:layout_height="30dp" + android:src="@mipmap/vip_more" + android:layout_marginEnd="8dp"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="敬请期待......" + android:textColor="#D6D5DB" + android:textSize="16sp" + android:gravity="start"/> + </LinearLayout> + + </LinearLayout> + + <View + android:id="@+id/divider2" + android:layout_width="match_parent" + android:layout_height="1dp" + android:background="#646174" + app:layout_constraintTop_toBottomOf="@id/more_benefit_layout" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + android:layout_marginTop="690dp" + android:layout_marginHorizontal="0dp" /> + + + + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="30dp" + android:layout_marginTop="880dp" + > + + </LinearLayout> + + + </androidx.coordinatorlayout.widget.CoordinatorLayout> +</androidx.core.widget.NestedScrollView> + + <androidx.cardview.widget.CardView + android:id="@+id/card_view_fixed" android:layout_width="match_parent" - android:layout_height="wrap_content" - app:layout_behavior="@string/appbar_scrolling_view_behavior"/> + android:layout_height="180dp" + android:layout_margin="0dp" + android:layout_marginTop="10dp" + android:layout_gravity="bottom" + app:cardCornerRadius="0dp" + app:cardElevation="6dp" + android:background="#030308" + app:cardBackgroundColor="#030308" + android:layout_alignParentBottom="true"> -<!-- 滑动框--> - <androidx.recyclerview.widget.RecyclerView - android:id="@+id/recycler_view" - android:layout_width="match_parent" - android:layout_height="200dp" - android:layout_marginTop="200dp" - app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - android:background="@android:color/transparent" - /> + <LinearLayout + android:id="@+id/alipay_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/alipay_shape" + android:layout_marginTop="15dp" + android:layout_marginLeft="15dp" + android:layout_marginRight="15dp" + android:padding="3dp" + android:orientation="vertical" + android:gravity="center"> + + <LinearLayout + android:layout_width="250dp" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="start" + android:baselineAligned="false" + > + + <ImageView + android:layout_width="30dp" + android:layout_height="30dp" + android:src="@mipmap/vip_alipay" + android:layout_marginEnd="8dp"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="确认协议并支付" + android:textColor="#419AE4" + android:textSize="16sp" + android:gravity="start"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="¥" + android:textColor="#419AE4" + android:textSize="16sp" + android:layout_marginLeft="10dp" + android:layout_marginRight="5dp" + android:gravity="start"/> + + <TextView + android:id="@+id/alipay_amount" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="30" + android:textColor="#419AE4" + android:textSize="16sp" + android:gravity="start"/> + </LinearLayout> + + </LinearLayout> + + <LinearLayout + android:id="@+id/wechat_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/wechat_shape" + android:layout_marginTop="60dp" + android:layout_marginLeft="15dp" + android:layout_marginRight="15dp" + android:padding="3dp" + android:orientation="vertical" + android:gravity="center"> + + <LinearLayout + android:layout_width="250dp" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="start" + android:baselineAligned="false" + > + + <ImageView + android:layout_width="30dp" + android:layout_height="30dp" + android:src="@mipmap/vip_wechat" + android:layout_marginEnd="8dp"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="确认协议并支付" + android:textColor="#77E382" + android:textSize="16sp" + android:gravity="start"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="¥" + android:textColor="#77E382" + android:textSize="16sp" + android:layout_marginLeft="10dp" + android:layout_marginRight="5dp" + android:gravity="start"/> + + <TextView + android:id="@+id/wechat_amount" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="30" + android:textColor="#77E382" + android:textSize="16sp" + android:gravity="start"/> + </LinearLayout> + + </LinearLayout> + + <LinearLayout + android:id="@+id/xieyi_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@android:color/transparent" + android:layout_marginTop="100dp" + android:layout_marginLeft="15dp" + android:layout_marginRight="15dp" + android:padding="1dp" + android:orientation="vertical" + android:gravity="center"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="start" + android:baselineAligned="false" + > + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="自动续费可随时取消,开通后每月按12元自动续费,可随时取消自动续费" + android:textColor="#A19FA7" + android:textSize="12sp" + android:gravity="start"/> + </LinearLayout> + + </LinearLayout> + <LinearLayout + android:id="@+id/protocol_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@android:color/transparent" + android:layout_marginTop="140dp" + android:layout_marginLeft="15dp" + android:layout_marginRight="15dp" + android:padding="1dp" + android:orientation="vertical" + android:gravity="center"> + <LinearLayout + android:layout_width="300dp" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:gravity="center_vertical" + android:baselineAligned="false" + > + <CheckBox + android:id="@+id/protocol_checkbox" + android:layout_width="20dp" + android:layout_height="20dp" + android:text="" + android:orientation="horizontal" + android:gravity="start" + android:button="@null" + android:background="@drawable/checkbox_round" + /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="已阅读并同意" + android:textColor="#7E5C3C" + android:textSize="14sp" + android:gravity="start" + android:layout_marginLeft="0dp" + android:orientation="horizontal" + /> - <!-- <include layout="@layout/content_vip" />--> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="《VIP会员服务协议》" + android:textColor="#15759E" + android:textSize="14sp" + android:gravity="start" + android:orientation="horizontal" + /> + </LinearLayout> - <!-- <com.google.android.material.floatingactionbutton.FloatingActionButton--> - <!-- android:id="@+id/fab"--> - <!-- android:layout_width="wrap_content"--> - <!-- android:layout_height="wrap_content"--> - <!-- android:layout_gravity="bottom|end"--> - <!-- android:layout_marginEnd="@dimen/fab_margin"--> - <!-- android:layout_marginBottom="16dp"--> - <!-- app:srcCompat="@android:drawable/ic_dialog_email" />--> + </LinearLayout> + </androidx.cardview.widget.CardView> </androidx.coordinatorlayout.widget.CoordinatorLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_member_info_card.xml b/app/src/main/res/layout/fragment_member_info_card.xml index d42005b..5f2d2a6 100644 --- a/app/src/main/res/layout/fragment_member_info_card.xml +++ b/app/src/main/res/layout/fragment_member_info_card.xml @@ -16,51 +16,61 @@ <!-- CardView 内部的内容 --> <androidx.cardview.widget.CardView android:layout_width="match_parent" - android:layout_height="100dp" - android:layout_marginTop="20dp" + android:layout_height="wrap_content" android:layout_marginLeft="15dp" + android:layout_marginTop="10dp" android:layout_marginRight="15dp" - app:cardCornerRadius="30dp" - android:elevation="2dp"> <!-- 设置CardView的elevation --> + android:elevation="2dp" + app:cardCornerRadius="10dp"> <!-- 设置CardView的elevation --> - <androidx.constraintlayout.widget.ConstraintLayout - android:id="@+id/memberCard" - android:layout_width="match_parent" - android:layout_height="80dp" - android:layout_marginTop="10dp" - tools:ignore="MissingConstraints"> + <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/memberCard" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + tools:ignore="MissingConstraints"> - <ImageView - android:id="@+id/memberAvatarView" - android:layout_width="60dp" - android:layout_height="60dp" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" - android:scaleType="centerCrop" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintStart_toStartOf="parent" /> + <ImageView + android:id="@+id/memberAvatarView" + android:layout_width="40dp" + android:layout_height="40dp" + android:layout_marginLeft="10dp" + android:layout_marginRight="10dp" + android:scaleType="centerCrop" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - <TextView - android:id="@+id/phoneNumberText" - android:layout_width="120dp" - android:layout_height="60dp" - android:gravity="center" - android:text="@{viewModel.phoneNumber}" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintStart_toEndOf="@id/memberAvatarView" /> + <TextView + android:id="@+id/phoneNumberText" + android:layout_width="120dp" + android:layout_height="40dp" + android:gravity="center" + android:text="@{viewModel.phoneNumber}" + app:layout_constraintStart_toEndOf="@id/memberAvatarView" + app:layout_constraintTop_toTopOf="parent" /> - <TextView - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_marginLeft="15dp" - android:layout_marginTop="60dp" - android:gravity="start" - android:text="@{viewModel.memberStatus}" /> +<!-- <TextView--> +<!-- android:id="@+id/memberStatus"--> +<!-- android:layout_width="match_parent"--> +<!-- android:layout_height="wrap_content"--> +<!-- android:gravity="start"--> +<!-- android:text="@{viewModel.memberStatus}"--> +<!-- app:layout_constraintStart_toEndOf="@id/memberCard"--> +<!-- app:layout_constraintTop_toTopOf="parent" />--> - </androidx.constraintlayout.widget.ConstraintLayout> + <TextView + android:id="@+id/memberStatus" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="start" + android:text="@{viewModel.memberStatus}" + android:layout_marginLeft="8dp" + android:padding="2dp" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/memberAvatarView" /> - + </androidx.constraintlayout.widget.ConstraintLayout> </androidx.cardview.widget.CardView> @@ -70,7 +80,7 @@ android:id="@+id/memberImageView" android:layout_width="80dp" android:layout_height="80dp" - android:layout_marginTop="0dp" + android:layout_marginTop="-10dp" android:layout_marginRight="40dp" android:scaleType="centerCrop" android:layout_gravity="end|top" diff --git a/app/src/main/res/layout/item_card_continue_monthly.xml b/app/src/main/res/layout/item_card_continue_monthly.xml index 115f488..6e7cb52 100644 --- a/app/src/main/res/layout/item_card_continue_monthly.xml +++ b/app/src/main/res/layout/item_card_continue_monthly.xml @@ -1,9 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_width="280dp" + android:layout_width="240dp" android:layout_height="wrap_content" - android:layout_margin="8dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" android:background="@android:color/transparent" app:cardBackgroundColor="@android:color/transparent" app:cardElevation="0dp" @@ -15,7 +16,7 @@ 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="140dp" + android:layout_height="100dp" android:layout_marginTop="10dp" app:cardCornerRadius="16dp" android:foreground="@drawable/gold_border_shape" @@ -27,7 +28,8 @@ <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:padding="16dp" + android:padding="5dp" + android:paddingStart="15dp" android:background="@android:color/transparent"> <!-- Title Text --> @@ -38,7 +40,7 @@ android:text="连续包月" android:textSize="18sp" android:textColor="#F9EBC6" - android:layout_marginTop="8dp" + android:background="@android:color/transparent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent" /> @@ -64,11 +66,23 @@ <!-- Price Text --> <TextView + android:id="@+id/price_text_tag" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="¥" + android:textSize="20sp" + android:textColor="#F9EBC6" + android:layout_marginTop="10dp" + android:layout_marginLeft="135dp" + android:background="@android:color/transparent" + app:layout_constraintTop_toBottomOf="@id/sub_title_text" + app:layout_constraintStart_toStartOf="parent" /> + <TextView android:id="@+id/price_text" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="¥9.9" - android:textSize="40sp" + android:text="9.9" + android:textSize="30sp" android:textColor="#F9EBC6" android:layout_marginTop="0dp" android:layout_marginLeft="150dp" @@ -84,9 +98,9 @@ android:text="次月起12元/月" android:textSize="14sp" android:textColor="#CCCCCC" - android:layout_marginTop="-30dp" + android:layout_marginTop="10dp" android:background="@android:color/transparent" - app:layout_constraintTop_toBottomOf="@id/price_text" + app:layout_constraintTop_toBottomOf="@id/title_text" app:layout_constraintStart_toStartOf="parent" /> <!-- Auto Renew Text --> @@ -143,6 +157,7 @@ android:textColor="#FFFFFF" android:padding="4dp" android:elevation="4dp" + android:textSize="10sp" android:background="@drawable/round_red_bg" /> </androidx.cardview.widget.CardView> \ No newline at end of file diff --git a/app/src/main/res/layout/item_card_single_month.xml b/app/src/main/res/layout/item_card_single_month.xml index 21d888d..739b66c 100644 --- a/app/src/main/res/layout/item_card_single_month.xml +++ b/app/src/main/res/layout/item_card_single_month.xml @@ -3,7 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="160dp" android:layout_height="wrap_content" - android:layout_margin="8dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" android:background="@android:color/transparent" app:cardBackgroundColor="@android:color/transparent" app:cardElevation="0dp" @@ -13,7 +14,7 @@ <androidx.cardview.widget.CardView android:id="@+id/vip_month_card_view" android:layout_width="160dp" - android:layout_height="140dp" + android:layout_height="100dp" android:padding="8dp" android:layout_marginTop="10dp" android:layout_marginEnd="20dp" @@ -30,7 +31,7 @@ android:layout_marginRight="20dp" android:gravity="center" android:orientation="vertical" - android:padding="16dp"> + android:padding="5dp"> <TextView android:id="@+id/single_month_title_text" @@ -41,14 +42,26 @@ android:textColor="#F9EBC6" android:textSize="18sp" /> - <TextView - android:id="@+id/single_month_price_text" + <LinearLayout android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="8dp" - android:text="¥15" - android:textColor="#F9EBC6" - android:textSize="40sp" /> + android:layout_height="wrap_content"> + <TextView + android:id="@+id/single_month_price_tag" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:text="¥" + android:textColor="#F9EBC6" + android:textSize="20sp" /> + <TextView + android:id="@+id/single_month_price_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:text="15" + android:textColor="#F9EBC6" + android:textSize="30sp" /> + </LinearLayout> </LinearLayout> </androidx.cardview.widget.CardView> diff --git a/app/src/main/res/layout/item_card_yearly.xml b/app/src/main/res/layout/item_card_yearly.xml index d07e1ec..b7b61fa 100644 --- a/app/src/main/res/layout/item_card_yearly.xml +++ b/app/src/main/res/layout/item_card_yearly.xml @@ -3,7 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="160dp" android:layout_height="wrap_content" - android:layout_margin="8dp" + android:layout_marginTop="10dp" + android:layout_marginRight="10dp" android:background="@android:color/transparent" app:cardBackgroundColor="@android:color/transparent" app:cardElevation="0dp" @@ -14,7 +15,7 @@ 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="140dp" + android:layout_height="wrap_content" android:layout_marginTop="10dp" app:cardCornerRadius="16dp" android:foreground="@drawable/gray_border_shape" @@ -25,10 +26,10 @@ <LinearLayout android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="100dp" android:orientation="vertical" android:gravity="center" - android:padding="16dp"> + android:padding="0dp"> <TextView android:id="@+id/yearly_title_text" @@ -39,24 +40,56 @@ android:textColor="#F9EBC6" android:layout_marginTop="8dp"/> + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + <TextView + android:id="@+id/yearly_price_tag" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="¥" + android:textSize="20sp" + android:textColor="#F9EBC6" + android:layout_marginTop="2dp"/> + <TextView + android:id="@+id/yearly_price_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="108" + android:textSize="20sp" + android:textColor="#F9EBC6" + android:layout_marginTop="2dp"/> + <TextView + android:id="@+id/yearly_price_unit" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="/年" + android:textSize="20sp" + android:textColor="#F9EBC6" + android:layout_marginTop="2dp"/> + </LinearLayout> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content"> <TextView - android:id="@+id/yearly_price_text" + android:id="@+id/yearly_original_price_tag" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="¥108/年" - android:textSize="30sp" - android:textColor="#F9EBC6" - android:layout_marginTop="8dp"/> - + android:text="¥" + android:textSize="12sp" + android:textColor="#CCCCCC" + android:layout_marginTop="2dp"/> <TextView android:id="@+id/yearly_original_price_text" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="¥168" + android:text="168" android:textSize="12sp" android:textColor="#CCCCCC" - android:layout_marginTop="4dp" + android:layout_marginTop="2dp" /> + </LinearLayout> </LinearLayout> @@ -74,6 +107,7 @@ android:text="折合9元/月" android:textColor="#FFFFFF" android:padding="4dp" + android:textSize="10sp" android:elevation="4dp" android:background="@drawable/round_red_bg" /> diff --git a/app/src/main/res/layout/vip_protocol_dialog_custom.xml b/app/src/main/res/layout/vip_protocol_dialog_custom.xml new file mode 100644 index 0000000..94d6cab --- /dev/null +++ b/app/src/main/res/layout/vip_protocol_dialog_custom.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="300dp" + android:layout_height="wrap_content" + android:orientation="vertical" + android:background="@drawable/dialog_background" + android:padding="20dp" + android:gravity="center" + + > + + <!-- 标题 --> + <TextView + android:id="@+id/dialogTitle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="确认开通" + android:textSize="20sp" + android:textColor="#000000" + android:gravity="center" + android:paddingBottom="10dp" /> + + <!-- 内容 --> + <TextView + android:id="@+id/dialogMessage" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="请阅读并同意《会员协议》?" + android:textSize="16sp" + android:textColor="#000000" + android:gravity="center" + android:paddingBottom="20dp" /> + + <!-- 按钮 --> + <Button + android:id="@+id/btnConfirm" + android:layout_width="200dp" + android:layout_height="wrap_content" + android:text="继续开通" + android:textColor="@android:color/white" + + android:backgroundTint="#000000" + android:gravity="center" /> +</LinearLayout> diff --git a/app/src/main/res/layout/vip_protocol_dialog_custom_bak.xml b/app/src/main/res/layout/vip_protocol_dialog_custom_bak.xml new file mode 100644 index 0000000..e3b23ec --- /dev/null +++ b/app/src/main/res/layout/vip_protocol_dialog_custom_bak.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="300dp" + android:layout_height="wrap_content" + app:cardCornerRadius="10dp" + app:cardElevation="5dp" + app:cardBackgroundColor="#FFFFFF" + android:layout_gravity="center"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="20dp" + android:gravity="center"> + + <!-- 标题 --> + <TextView + android:id="@+id/dialogTitle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="确认开通" + android:textSize="20sp" + android:textColor="#000000" + android:gravity="center" + android:paddingBottom="10dp" /> + + <!-- 内容 --> + <TextView + android:id="@+id/dialogMessage" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="请阅读并同意《会员协议》?" + android:textSize="16sp" + android:textColor="#000000" + android:gravity="center" + android:paddingBottom="20dp" /> + + <!-- 按钮 --> + <Button + android:id="@+id/btnConfirm" + android:layout_width="200dp" + android:layout_height="wrap_content" + android:text="继续开通" + android:textColor="@android:color/white" + android:backgroundTint="#000000" + android:textColorHint="@android:color/black" + android:gravity="center" /> + </LinearLayout> + +</androidx.cardview.widget.CardView> diff --git a/app/src/main/res/mipmap/vip.png b/app/src/main/res/mipmap/vip.png new file mode 100644 index 0000000..6cdf762 --- /dev/null +++ b/app/src/main/res/mipmap/vip.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_ad_no.png b/app/src/main/res/mipmap/vip_ad_no.png new file mode 100644 index 0000000..981fdce --- /dev/null +++ b/app/src/main/res/mipmap/vip_ad_no.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_ai_ass_icon.png b/app/src/main/res/mipmap/vip_ai_ass_icon.png new file mode 100644 index 0000000..a8ec7b9 --- /dev/null +++ b/app/src/main/res/mipmap/vip_ai_ass_icon.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_alipay.png b/app/src/main/res/mipmap/vip_alipay.png new file mode 100644 index 0000000..d770490 --- /dev/null +++ b/app/src/main/res/mipmap/vip_alipay.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_bar_sta.png b/app/src/main/res/mipmap/vip_bar_sta.png new file mode 100644 index 0000000..77a41cc --- /dev/null +++ b/app/src/main/res/mipmap/vip_bar_sta.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_cancel.png b/app/src/main/res/mipmap/vip_cancel.png new file mode 100644 index 0000000..9fc891d --- /dev/null +++ b/app/src/main/res/mipmap/vip_cancel.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_cancel_link.png b/app/src/main/res/mipmap/vip_cancel_link.png new file mode 100644 index 0000000..1f5f091 --- /dev/null +++ b/app/src/main/res/mipmap/vip_cancel_link.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_card.png b/app/src/main/res/mipmap/vip_card.png new file mode 100644 index 0000000..75d9e76 --- /dev/null +++ b/app/src/main/res/mipmap/vip_card.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_circle_pie.png b/app/src/main/res/mipmap/vip_circle_pie.png new file mode 100644 index 0000000..94e153d --- /dev/null +++ b/app/src/main/res/mipmap/vip_circle_pie.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_copy.png b/app/src/main/res/mipmap/vip_copy.png new file mode 100644 index 0000000..c6a5e8a --- /dev/null +++ b/app/src/main/res/mipmap/vip_copy.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_free_member.png b/app/src/main/res/mipmap/vip_free_member.png new file mode 100644 index 0000000..d6bd848 --- /dev/null +++ b/app/src/main/res/mipmap/vip_free_member.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_life_insurance.png b/app/src/main/res/mipmap/vip_life_insurance.png new file mode 100644 index 0000000..445c54e --- /dev/null +++ b/app/src/main/res/mipmap/vip_life_insurance.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_ling.png b/app/src/main/res/mipmap/vip_ling.png new file mode 100644 index 0000000..3de1c6a --- /dev/null +++ b/app/src/main/res/mipmap/vip_ling.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_more.png b/app/src/main/res/mipmap/vip_more.png new file mode 100644 index 0000000..34dfb7f --- /dev/null +++ b/app/src/main/res/mipmap/vip_more.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_no.png b/app/src/main/res/mipmap/vip_no.png new file mode 100644 index 0000000..e07563a --- /dev/null +++ b/app/src/main/res/mipmap/vip_no.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_right.png b/app/src/main/res/mipmap/vip_right.png new file mode 100644 index 0000000..5d46f9f --- /dev/null +++ b/app/src/main/res/mipmap/vip_right.png Binary files differ diff --git a/app/src/main/res/mipmap/vip_wechat.png b/app/src/main/res/mipmap/vip_wechat.png new file mode 100644 index 0000000..d66bbb2 --- /dev/null +++ b/app/src/main/res/mipmap/vip_wechat.png Binary files differ -- Gitblit v1.9.3