租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

310 lines
6.6 KiB

  1. <template>
  2. <view class="u-page">
  3. <!-- 头部会员卡片 -->
  4. <view class="member-header">
  5. <view class="member-card">
  6. <view class="card-bg">
  7. <view class="member-title">
  8. <uv-icon name="level" size="60rpx" color="#FFD700"></uv-icon>
  9. <text class="title-text">会员中心</text>
  10. </view>
  11. <view class="member-desc">开通永久会员享受更多专属权益</view>
  12. </view>
  13. </view>
  14. </view>
  15. <!-- 会员权益 -->
  16. <view class="rights-section">
  17. <view class="section-title">
  18. <text>会员专享权益</text>
  19. </view>
  20. <view class="rights-list">
  21. <view class="right-item">
  22. <view class="right-icon">
  23. <uv-icon name="map-fill" size="40rpx" color="#FF6B6B"></uv-icon>
  24. </view>
  25. <view class="right-content">
  26. <text class="right-title">查看详细地址</text>
  27. <text class="right-desc">查看具体定位和村址普通用户只能看到乡镇</text>
  28. </view>
  29. </view>
  30. <view class="right-item">
  31. <view class="right-icon">
  32. <uv-icon name="phone-fill" size="40rpx" color="#4ECDC4"></uv-icon>
  33. </view>
  34. <view class="right-content">
  35. <text class="right-title">查看联系方式</text>
  36. <text class="right-desc">查看房主手机号方便直接联系</text>
  37. </view>
  38. </view>
  39. <view class="right-item">
  40. <view class="right-icon">
  41. <uv-icon name="star-fill" size="40rpx" color="#FFD700"></uv-icon>
  42. </view>
  43. <view class="right-content">
  44. <text class="right-title">优先查看房源</text>
  45. <text class="right-desc">抢先查看最新房源信息</text>
  46. </view>
  47. </view>
  48. <view class="right-item">
  49. <view class="right-icon">
  50. <uv-icon name="heart-fill" size="40rpx" color="#9B59B6"></uv-icon>
  51. </view>
  52. <view class="right-content">
  53. <text class="right-title">专属客服</text>
  54. <text class="right-desc">享受一对一专属客服服务</text>
  55. </view>
  56. </view>
  57. <view class="right-item">
  58. <view class="right-icon">
  59. <uv-icon name="gift-fill" size="40rpx" color="#E74C3C"></uv-icon>
  60. </view>
  61. <view class="right-content">
  62. <text class="right-title">永久会员标识</text>
  63. <text class="right-desc">尊贵的永久会员身份标识</text>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <!-- 永久会员价格 -->
  69. <view class="package-section">
  70. <view class="price-card">
  71. <view class="price-header">
  72. <view class="price-tag">
  73. <text class="currency"></text>
  74. <text class="price">99</text>
  75. </view>
  76. <text class="price-desc">永久会员</text>
  77. </view>
  78. <view class="price-benefits">
  79. <text class="benefit-text"> 一次购买终身享受所有会员权益</text>
  80. <text class="benefit-text"> 无需续费永久有效</text>
  81. </view>
  82. </view>
  83. </view>
  84. <!-- 开通按钮 -->
  85. <view class="action-section">
  86. <uv-button type="primary" @click="openMember"
  87. style="background: linear-gradient(135deg, #1EC77A 0%, #16A085 100%); border: none; border-radius: 50rpx; height: 100rpx; font-size: 32rpx; font-weight: bold;">
  88. 立即开通永久会员 - 99
  89. </uv-button>
  90. <view class="agreement">
  91. <text>开通即表示同意</text>
  92. <text class="link" @click="showAgreement">永久会员服务协议</text>
  93. </view>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. export default {
  99. data() {
  100. return {
  101. memberPrice: 99 // 永久会员价格
  102. }
  103. },
  104. methods: {
  105. openMember() {
  106. uni.showModal({
  107. title: '确认开通',
  108. content: `确定开通永久会员吗?\n价格:¥${this.memberPrice}\n终身享受会员权益`,
  109. confirmText: '确认开通',
  110. cancelText: '取消',
  111. success: (res) => {
  112. if (res.confirm) {
  113. this.processPay()
  114. }
  115. }
  116. })
  117. },
  118. processPay() {
  119. // 这里应该调用支付接口
  120. uni.showLoading({
  121. title: '处理中...'
  122. })
  123. // 模拟支付处理
  124. setTimeout(() => {
  125. uni.hideLoading()
  126. uni.showToast({
  127. title: '永久会员开通成功',
  128. icon: 'success',
  129. duration: 2000
  130. })
  131. // 返回上一页并刷新用户信息
  132. setTimeout(() => {
  133. uni.navigateBack()
  134. }, 2000)
  135. }, 2000)
  136. },
  137. showAgreement() {
  138. uni.showModal({
  139. title: '永久会员服务协议',
  140. content: '1. 永久会员享有查看详细地址和联系方式的权限\n2. 会员权益包括但不限于:查看具体定位、村址信息、房主手机号等\n3. 永久会员权益终身有效,无需续费\n4. 其他会员服务条款...',
  141. showCancel: false,
  142. confirmText: '我知道了'
  143. })
  144. }
  145. }
  146. }
  147. </script>
  148. <style scoped>
  149. .u-page {
  150. background: linear-gradient(180deg, #1EC77A 0%, #f5f5f5 30%);
  151. min-height: 100vh;
  152. }
  153. .member-header {
  154. padding: 40rpx 30rpx;
  155. }
  156. .member-card {
  157. background: rgba(255, 255, 255, 0.15);
  158. border-radius: 20rpx;
  159. padding: 40rpx;
  160. backdrop-filter: blur(10rpx);
  161. }
  162. .member-title {
  163. display: flex;
  164. align-items: center;
  165. margin-bottom: 20rpx;
  166. }
  167. .title-text {
  168. font-size: 40rpx;
  169. font-weight: bold;
  170. color: white;
  171. margin-left: 20rpx;
  172. }
  173. .member-desc {
  174. font-size: 28rpx;
  175. color: rgba(255, 255, 255, 0.8);
  176. }
  177. .rights-section, .package-section {
  178. margin: 30rpx;
  179. background: white;
  180. border-radius: 20rpx;
  181. padding: 40rpx 30rpx;
  182. }
  183. .section-title {
  184. font-size: 32rpx;
  185. font-weight: bold;
  186. color: #333;
  187. margin-bottom: 30rpx;
  188. }
  189. .rights-list {
  190. display: flex;
  191. flex-direction: column;
  192. gap: 30rpx;
  193. }
  194. .right-item {
  195. display: flex;
  196. align-items: center;
  197. }
  198. .right-icon {
  199. margin-right: 20rpx;
  200. }
  201. .right-content {
  202. flex: 1;
  203. }
  204. .right-title {
  205. display: block;
  206. font-size: 28rpx;
  207. font-weight: bold;
  208. color: #333;
  209. margin-bottom: 8rpx;
  210. }
  211. .right-desc {
  212. font-size: 24rpx;
  213. color: #666;
  214. }
  215. .price-card {
  216. text-align: center;
  217. background: linear-gradient(135deg, #1EC77A 0%, #16A085 100%);
  218. border-radius: 20rpx;
  219. padding: 50rpx 30rpx;
  220. color: white;
  221. position: relative;
  222. overflow: hidden;
  223. }
  224. .price-card::before {
  225. content: '';
  226. position: absolute;
  227. top: -50rpx;
  228. right: -50rpx;
  229. width: 200rpx;
  230. height: 200rpx;
  231. background: rgba(255, 255, 255, 0.1);
  232. border-radius: 50%;
  233. }
  234. .price-header {
  235. margin-bottom: 30rpx;
  236. }
  237. .price-tag {
  238. display: flex;
  239. align-items: baseline;
  240. justify-content: center;
  241. margin-bottom: 10rpx;
  242. }
  243. .currency {
  244. font-size: 40rpx;
  245. font-weight: bold;
  246. }
  247. .price {
  248. font-size: 120rpx;
  249. font-weight: bold;
  250. line-height: 1;
  251. }
  252. .price-desc {
  253. font-size: 32rpx;
  254. font-weight: bold;
  255. opacity: 0.9;
  256. }
  257. .price-benefits {
  258. display: flex;
  259. flex-direction: column;
  260. gap: 15rpx;
  261. }
  262. .benefit-text {
  263. font-size: 26rpx;
  264. opacity: 0.9;
  265. text-align: left;
  266. }
  267. .action-section {
  268. padding: 30rpx;
  269. }
  270. .agreement {
  271. text-align: center;
  272. margin-top: 20rpx;
  273. font-size: 24rpx;
  274. color: #666;
  275. }
  276. .link {
  277. color: #1EC77A;
  278. }
  279. </style>