upgrade.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910
  1. <template>
  2. <view class="upgrade-page-wrapper">
  3. <scroll-view class="page" scroll-y>
  4. <!-- 当前会员状态卡片 -->
  5. <view class="status-card">
  6. <view class="status-badge" :class="isFree ? 'badge-free' : 'badge-family'">
  7. <text class="badge-icon">{{ isFree ? '○' : '●' }}</text>
  8. <text class="badge-text">{{ currentLevelName }}</text>
  9. </view>
  10. <view class="status-body" v-if="membership && membership.levelCode !== 'FREE'">
  11. <view class="expiry-row">
  12. <text class="expiry-label">到期时间</text>
  13. <text class="expiry-value">{{ formatDate(membership.endDate) }}</text>
  14. </view>
  15. <view class="days-remaining" v-if="membership.isActive">
  16. <text class="days-num">{{ membership.daysRemaining || 0 }}</text>
  17. <text class="days-unit">天剩余</text>
  18. </view>
  19. <view class="expired-msg" v-else>
  20. <text class="expired-text">会员已过期,续费恢复权益</text>
  21. </view>
  22. </view>
  23. <view class="status-body" v-else>
  24. <text class="free-hint">当前为免费版,开通家庭会员解锁全部特权</text>
  25. </view>
  26. </view>
  27. <!-- 等级切换 tabs -->
  28. <view class="level-tabs" v-if="isFree">
  29. <view class="level-tab" :class="selectedLevel === 'FAMILY' ? 'level-tab-active' : ''"
  30. @click="selectLevel('FAMILY')">
  31. <text class="level-tab-name">家庭会员</text>
  32. <text class="level-tab-price">¥{{ getLevelYearlyPrice('FAMILY') }}/年</text>
  33. </view>
  34. <view class="level-tab" :class="selectedLevel === 'PREMIUM' ? 'level-tab-active' : ''"
  35. @click="selectLevel('PREMIUM')">
  36. <text class="level-tab-name">高级家庭会员</text>
  37. <text class="level-tab-price">¥{{ getLevelYearlyPrice('PREMIUM') }}/年</text>
  38. </view>
  39. </view>
  40. <!-- 家庭会员开通卡片 -->
  41. <view class="upgrade-card" v-if="isFree">
  42. <view class="upgrade-header">
  43. <text class="upgrade-title">{{ selectedLevel === 'FAMILY' ? '家庭会员' : '高级家庭会员' }}</text>
  44. <text class="upgrade-subtitle">{{ selectedLevel === 'FAMILY' ? 'FAMILY' : 'PREMIUM' }}</text>
  45. </view>
  46. <!-- 档位选择 -->
  47. <view class="period-tabs">
  48. <view
  49. class="period-tab"
  50. v-for="p in visiblePeriods"
  51. :key="p.key"
  52. :class="selectedPeriod === p.key ? 'period-tab-active' : ''"
  53. @click="selectPeriod(p.key)"
  54. >
  55. <text class="period-tab-label">{{ p.label }}</text>
  56. <text class="period-tab-price">¥{{ getPriceForPeriod(p.key) }}</text>
  57. </view>
  58. </view>
  59. <view class="upgrade-price">
  60. <text class="price-symbol">¥</text>
  61. <text class="price-amount">{{ getPriceForPeriod(selectedPeriod) }}</text>
  62. <text class="price-unit">{{ getPeriodUnit() }}</text>
  63. </view>
  64. <view class="feature-list">
  65. <view class="feature-item" v-for="(feature, idx) in features" :key="idx">
  66. <text class="feature-check">✓</text>
  67. <text class="feature-text">{{ feature }}</text>
  68. </view>
  69. </view>
  70. <!-- Coupon section -->
  71. <view class="coupon-row" @click="openCouponPicker">
  72. <text class="coupon-row-label">优惠券</text>
  73. <text v-if="selectedCoupon" class="coupon-row-discount">-{{ formatPriceWithSymbol(selectedCoupon.value) }} {{ selectedCoupon.name }}</text>
  74. <text v-else class="coupon-row-placeholder">选择优惠券</text>
  75. <text class="coupon-row-arrow">›</text>
  76. </view>
  77. <button class="btn-upgrade" @click="handleUpgrade">立即开通</button>
  78. </view>
  79. <!-- 续费卡片 -->
  80. <view class="upgrade-card" v-else>
  81. <view class="upgrade-header">
  82. <text class="upgrade-title">续费会员</text>
  83. <text class="upgrade-subtitle">保持权益不中断</text>
  84. </view>
  85. <!-- 档位选择 -->
  86. <view class="period-tabs">
  87. <view
  88. class="period-tab"
  89. v-for="p in visiblePeriods"
  90. :key="p.key"
  91. :class="selectedPeriod === p.key ? 'period-tab-active' : ''"
  92. @click="selectPeriod(p.key)"
  93. >
  94. <text class="period-tab-label">{{ p.label }}</text>
  95. <text class="period-tab-price">¥{{ getPriceForPeriod(p.key) }}</text>
  96. </view>
  97. </view>
  98. <view class="upgrade-price">
  99. <text class="price-symbol">¥</text>
  100. <text class="price-amount">{{ getPriceForPeriod(selectedPeriod) }}</text>
  101. <text class="price-unit">{{ getPeriodUnit() }}</text>
  102. </view>
  103. <!-- Coupon section -->
  104. <view class="coupon-row" @click="openCouponPicker">
  105. <text class="coupon-row-label">优惠券</text>
  106. <text v-if="selectedCoupon" class="coupon-row-discount">-{{ formatPriceWithSymbol(selectedCoupon.value) }} {{ selectedCoupon.name }}</text>
  107. <text v-else class="coupon-row-placeholder">选择优惠券</text>
  108. <text class="coupon-row-arrow">›</text>
  109. </view>
  110. <button class="btn-upgrade btn-renew" @click="handleRenew">立即续费</button>
  111. </view>
  112. <!-- 权益对比表 -->
  113. <view class="compare-section">
  114. <text class="section-title">权益对比</text>
  115. <view class="compare-table">
  116. <view class="compare-row header-row">
  117. <text class="compare-cell cell-feature">权益项</text>
  118. <text class="compare-cell cell-free">免费</text>
  119. <text class="compare-cell cell-family active">家庭会员</text>
  120. <text class="compare-cell cell-premium active">高级会员</text>
  121. </view>
  122. <view class="compare-row" v-for="(item, idx) in compareData" :key="idx">
  123. <text class="compare-cell cell-feature">{{ item.name }}</text>
  124. <text class="compare-cell cell-free">{{ item.free }}</text>
  125. <text class="compare-cell cell-family active">{{ item.family }}</text>
  126. <text class="compare-cell cell-premium active">{{ item.premium }}</text>
  127. </view>
  128. </view>
  129. </view>
  130. <!-- 升级记录 -->
  131. <view class="records-section" v-if="records.length > 0">
  132. <text class="section-title">升级记录</text>
  133. <view class="record-item" v-for="record in records" :key="record.id">
  134. <view class="record-left">
  135. <text class="record-level">{{ record.levelName }}</text>
  136. <text class="record-time">{{ formatDate(record.createdAt) }}</text>
  137. </view>
  138. <text class="record-amount">{{ formatPriceWithSymbol(record.amount) }}</text>
  139. </view>
  140. </view>
  141. </scroll-view>
  142. <!-- Coupon Picker Bottom Sheet -->
  143. <view class="modal-mask" v-if="showCouponPicker" @click="showCouponPicker = false">
  144. <view class="coupon-picker" @click.stop>
  145. <view class="picker-header">
  146. <text class="picker-title">选择优惠券</text>
  147. <text class="picker-close" @click="showCouponPicker = false">关闭</text>
  148. </view>
  149. <scroll-view scroll-y class="picker-list">
  150. <view
  151. v-for="coupon in availableCoupons"
  152. :key="coupon.id"
  153. class="picker-item"
  154. :class="selectedCoupon && selectedCoupon.id === coupon.id ? 'picker-item-active' : ''"
  155. @click="selectCoupon(coupon)"
  156. >
  157. <view class="picker-item-left">
  158. <text class="picker-item-value">{{ formatPriceWithSymbol(coupon.value) }}</text>
  159. </view>
  160. <view class="picker-item-right">
  161. <text class="picker-item-name">{{ coupon.name }}</text>
  162. <text class="picker-item-condition">{{ getCouponCondition(coupon.minSpend) }}</text>
  163. </view>
  164. <view class="picker-item-check" v-if="selectedCoupon && selectedCoupon.id === coupon.id">
  165. <text>✓</text>
  166. </view>
  167. </view>
  168. <view class="picker-empty" v-if="availableCoupons.length === 0">
  169. <text>暂无可用优惠券</text>
  170. </view>
  171. </scroll-view>
  172. <view class="picker-footer" v-if="selectedCoupon">
  173. <button class="picker-btn-remove" @click="removeCoupon">不使用优惠券</button>
  174. </view>
  175. </view>
  176. </view>
  177. </view>
  178. </template>
  179. <script>
  180. import { getMyMembership, getMembershipLevels, getUpgradeRecords, upgradeMember, createOrder, getCouponList } from '../../utils/api.js'
  181. export default {
  182. data() {
  183. return {
  184. membership: null,
  185. levels: [],
  186. records: [],
  187. features: ['折扣购物', '家庭管理', '推荐佣金', '专属活动', '任务特权', '成长报告'],
  188. isFree: true,
  189. currentLevelName: '免费用户',
  190. compareData: [
  191. { name: '商品折扣', free: '普通价格', family: '9折', premium: '8折' },
  192. { name: '家庭管理', free: '基础功能', family: '全部功能', premium: '全部功能+优先响应' },
  193. { name: '管家服务', free: '—', family: '—', premium: '每周一次' },
  194. { name: '推荐佣金', free: '不可参与', family: '最高15%', premium: '最高20%' },
  195. { name: '专属活动', free: '部分参与', family: '全部参与', premium: '优先参与' },
  196. { name: '成长报告', free: '月度', family: '每周+深度', premium: '每日+深度+专家解读' },
  197. { name: '任务配额', free: '每日5个', family: '不限量', premium: '不限量+优先审核' }
  198. ],
  199. coupons: [],
  200. selectedCoupon: null,
  201. showCouponPicker: false,
  202. periods: [
  203. { key: 'monthly', label: '月度', unit: '/月' },
  204. { key: 'quarterly', label: '季度', unit: '/季' },
  205. { key: 'yearly', label: '年度', unit: '/年' }
  206. ],
  207. selectedPeriod: 'yearly',
  208. selectedLevel: 'FAMILY',
  209. }
  210. },
  211. computed: {
  212. visiblePeriods() {
  213. var self = this
  214. return this.periods.filter(function(p) {
  215. if (self.selectedLevel === 'FAMILY') {
  216. return p.key === 'yearly'
  217. }
  218. if (self.selectedLevel === 'PREMIUM') {
  219. return p.key === 'monthly' || p.key === 'yearly'
  220. }
  221. return true
  222. })
  223. },
  224. availableCoupons() {
  225. var self = this
  226. return this.coupons.filter(function(c) {
  227. if (c.status && c.status !== 'AVAILABLE') return false
  228. if (c.applicableTo && c.applicableTo !== 'ALL' && c.applicableTo !== 'MEMBERSHIP') return false
  229. return true
  230. })
  231. }
  232. },
  233. onLoad() {
  234. this.loadData()
  235. },
  236. methods: {
  237. async loadData() {
  238. try {
  239. const membershipRes = await getMyMembership()
  240. this.membership = membershipRes.data
  241. if (this.membership && this.membership.levelCode && this.membership.levelCode !== 'FREE') {
  242. this.isFree = false
  243. this.currentLevelName = this.membership.levelName || '家庭会员'
  244. this.selectedLevel = this.membership.levelCode
  245. } else {
  246. this.isFree = true
  247. this.currentLevelName = '免费用户'
  248. }
  249. } catch (e) {
  250. console.error('加载会员信息失败', e)
  251. }
  252. try {
  253. const levelsRes = await getMembershipLevels()
  254. this.levels = levelsRes.data || []
  255. } catch (e) {
  256. console.error('加载会员等级失败', e)
  257. }
  258. try {
  259. const recordsRes = await getUpgradeRecords()
  260. if (recordsRes.data && recordsRes.data.records) {
  261. this.records = recordsRes.data.records
  262. }
  263. } catch (e) {
  264. console.error('加载升级记录失败', e)
  265. }
  266. try {
  267. const couponsRes = await getCouponList()
  268. this.coupons = couponsRes.data || []
  269. } catch (e) {
  270. console.error('加载优惠券失败', e)
  271. }
  272. },
  273. openCouponPicker() {
  274. if (this.availableCoupons.length === 0 && !this.selectedCoupon) {
  275. uni.showToast({ title: '暂无可用优惠券', icon: 'none' })
  276. return
  277. }
  278. this.showCouponPicker = true
  279. },
  280. selectCoupon(coupon) {
  281. this.selectedCoupon = coupon
  282. this.showCouponPicker = false
  283. },
  284. removeCoupon() {
  285. this.selectedCoupon = null
  286. this.showCouponPicker = false
  287. },
  288. getCouponCondition(minSpend) {
  289. if (!minSpend || minSpend <= 0) return '无门槛'
  290. return '满' + (minSpend / 100).toFixed(2) + '元可用'
  291. },
  292. selectLevel: function(code) {
  293. this.selectedLevel = code
  294. this.selectedPeriod = 'yearly'
  295. },
  296. getLevelYearlyPrice: function(code) {
  297. for (var i = 0; i < this.levels.length; i++) {
  298. if (this.levels[i].levelCode === code) {
  299. return this.levels[i].yearly ? (this.levels[i].yearly / 100).toFixed(0) : '0'
  300. }
  301. }
  302. return '0'
  303. },
  304. selectPeriod: function(key) {
  305. this.selectedPeriod = key
  306. },
  307. getPriceForPeriod: function(periodKey) {
  308. var plan = null
  309. for (var i = 0; i < this.levels.length; i++) {
  310. if (this.levels[i].levelCode === this.selectedLevel) {
  311. plan = this.levels[i]
  312. break
  313. }
  314. }
  315. if (!plan) return '0'
  316. if (periodKey === 'monthly') return plan.monthly ? (plan.monthly / 100).toFixed(0) : '0'
  317. if (periodKey === 'quarterly') return plan.quarterly ? (plan.quarterly / 100).toFixed(0) : '0'
  318. if (periodKey === 'yearly') return plan.yearly ? (plan.yearly / 100).toFixed(0) : '0'
  319. return '0'
  320. },
  321. getPeriodUnit: function() {
  322. for (var i = 0; i < this.periods.length; i++) {
  323. if (this.periods[i].key === this.selectedPeriod) {
  324. return this.periods[i].unit
  325. }
  326. }
  327. return '/年'
  328. },
  329. handleUpgrade: function() {
  330. var self = this
  331. var priceText = '¥' + this.getPriceForPeriod(this.selectedPeriod) + this.getPeriodUnit()
  332. var levelName = this.selectedLevel === 'FAMILY' ? '家庭会员' : '高级家庭会员'
  333. uni.showModal({
  334. title: '确认开通',
  335. content: '确认开通' + levelName + '(' + priceText + ')?',
  336. success: function(res) {
  337. if (!res.confirm) return
  338. self.doUpgrade()
  339. }
  340. })
  341. },
  342. doUpgrade: function() {
  343. var self = this
  344. createOrder(self.selectedLevel, 'pay', self.selectedPeriod).then(function(res) {
  345. uni.showToast({ title: '开通成功', icon: 'success' })
  346. self.loadData()
  347. }).catch(function(e) {
  348. uni.showToast({ title: e.message || '开通失败', icon: 'none' })
  349. })
  350. },
  351. handleRenew: function() {
  352. var self = this
  353. var priceText = '¥' + this.getPriceForPeriod(this.selectedPeriod) + this.getPeriodUnit()
  354. var levelName = this.selectedLevel === 'FAMILY' ? '家庭会员' : '高级家庭会员'
  355. uni.showModal({
  356. title: '确认续费',
  357. content: '确认续费' + levelName + '(' + priceText + ')?',
  358. success: function(res) {
  359. if (!res.confirm) return
  360. self.doRenew()
  361. }
  362. })
  363. },
  364. doRenew: function() {
  365. var self = this
  366. createOrder(self.selectedLevel, 'pay', this.selectedPeriod).then(function(res) {
  367. uni.showToast({ title: '续费成功', icon: 'success' })
  368. self.loadData()
  369. }).catch(function(e) {
  370. uni.showToast({ title: e.message || '续费失败', icon: 'none' })
  371. })
  372. },
  373. formatDate(date) {
  374. if (!date) return ''
  375. var d = new Date(date)
  376. return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0')
  377. }
  378. }
  379. }
  380. </script>
  381. <style scoped>
  382. .page {
  383. min-height: 100vh;
  384. background: #FFF7ED;
  385. padding: 30rpx;
  386. box-sizing: border-box;
  387. }
  388. /* ===== 状态卡片 ===== */
  389. .status-card {
  390. background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  391. border-radius: 20rpx;
  392. padding: 40rpx;
  393. margin-bottom: 30rpx;
  394. }
  395. .status-badge {
  396. display: inline-flex;
  397. align-items: center;
  398. padding: 10rpx 24rpx;
  399. border-radius: 9999rpx;
  400. font-size: 24rpx;
  401. }
  402. .badge-free {
  403. background: rgba(255,255,255,0.2);
  404. color: #fff;
  405. }
  406. .badge-family {
  407. background: rgba(255,255,255,0.3);
  408. color: #fff;
  409. }
  410. .badge-icon {
  411. font-size: 20rpx;
  412. margin-right: 8rpx;
  413. }
  414. .badge-text {
  415. font-weight: 600;
  416. }
  417. .status-body {
  418. margin-top: 24rpx;
  419. }
  420. .expiry-row {
  421. display: flex;
  422. justify-content: space-between;
  423. align-items: center;
  424. }
  425. .expiry-label {
  426. font-size: 26rpx;
  427. color: rgba(255,255,255,0.8);
  428. }
  429. .expiry-value {
  430. font-size: 28rpx;
  431. color: #fff;
  432. font-weight: 500;
  433. }
  434. .days-remaining {
  435. display: flex;
  436. align-items: baseline;
  437. justify-content: center;
  438. margin-top: 20rpx;
  439. }
  440. .days-num {
  441. font-size: 56rpx;
  442. font-weight: bold;
  443. color: #FEF3C7;
  444. }
  445. .days-unit {
  446. font-size: 26rpx;
  447. color: rgba(255,255,255,0.7);
  448. margin-left: 8rpx;
  449. }
  450. .expired-msg {
  451. text-align: center;
  452. margin-top: 16rpx;
  453. }
  454. .expired-text {
  455. font-size: 26rpx;
  456. color: #FEF3C7;
  457. }
  458. .free-hint {
  459. font-size: 26rpx;
  460. color: rgba(255,255,255,0.85);
  461. text-align: center;
  462. display: block;
  463. }
  464. /* ===== 升级/续费卡片 ===== */
  465. .upgrade-card {
  466. background: #FFFFFF;
  467. border-radius: 20rpx;
  468. padding: 40rpx;
  469. margin-bottom: 30rpx;
  470. box-shadow: 0 4rpx 24rpx rgba(249, 115, 22, 0.08);
  471. }
  472. .upgrade-header {
  473. text-align: center;
  474. margin-bottom: 20rpx;
  475. }
  476. .upgrade-title {
  477. font-size: 36rpx;
  478. font-weight: bold;
  479. color: #1E293B;
  480. display: block;
  481. }
  482. .upgrade-subtitle {
  483. font-size: 24rpx;
  484. color: #94A3B8;
  485. margin-top: 6rpx;
  486. display: block;
  487. }
  488. .upgrade-price {
  489. text-align: center;
  490. margin: 24rpx 0;
  491. }
  492. .price-symbol {
  493. font-size: 28rpx;
  494. color: #F97316;
  495. vertical-align: top;
  496. }
  497. .price-amount {
  498. font-size: 64rpx;
  499. font-weight: bold;
  500. color: #F97316;
  501. line-height: 1;
  502. }
  503. .price-unit {
  504. font-size: 26rpx;
  505. color: #94A3B8;
  506. margin-left: 6rpx;
  507. }
  508. .feature-list {
  509. margin: 24rpx 0;
  510. }
  511. .feature-item {
  512. display: flex;
  513. align-items: center;
  514. padding: 12rpx 0;
  515. }
  516. .feature-check {
  517. width: 40rpx;
  518. height: 40rpx;
  519. line-height: 40rpx;
  520. text-align: center;
  521. background: #F97316;
  522. color: #fff;
  523. border-radius: 50%;
  524. font-size: 22rpx;
  525. margin-right: 16rpx;
  526. flex-shrink: 0;
  527. }
  528. .feature-text {
  529. font-size: 28rpx;
  530. color: #1E293B;
  531. }
  532. .btn-upgrade {
  533. width: 100%;
  534. height: 88rpx;
  535. line-height: 88rpx;
  536. background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  537. color: #fff;
  538. font-size: 32rpx;
  539. font-weight: 600;
  540. border-radius: 44rpx;
  541. margin-top: 20rpx;
  542. border: none;
  543. }
  544. .btn-upgrade::after {
  545. border: none;
  546. }
  547. .btn-upgrade:active {
  548. opacity: 0.9;
  549. }
  550. .btn-renew {
  551. background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
  552. }
  553. /* ===== 权益对比 ===== */
  554. .compare-section {
  555. background: #FFFFFF;
  556. border-radius: 20rpx;
  557. padding: 30rpx;
  558. margin-bottom: 30rpx;
  559. box-shadow: 0 4rpx 24rpx rgba(249, 115, 22, 0.08);
  560. }
  561. .section-title {
  562. font-size: 32rpx;
  563. font-weight: bold;
  564. color: #1E293B;
  565. display: block;
  566. margin-bottom: 24rpx;
  567. }
  568. .compare-table {
  569. border-radius: 16rpx;
  570. overflow: hidden;
  571. border: 1rpx solid #FED7AA;
  572. }
  573. .compare-row {
  574. display: flex;
  575. border-bottom: 1rpx solid #FED7AA;
  576. }
  577. .compare-row:last-child {
  578. border-bottom: none;
  579. }
  580. .header-row {
  581. background: #FFF7ED;
  582. }
  583. .compare-cell {
  584. flex: 1;
  585. padding: 20rpx 16rpx;
  586. font-size: 26rpx;
  587. text-align: center;
  588. display: flex;
  589. align-items: center;
  590. justify-content: center;
  591. }
  592. .cell-feature {
  593. flex: 1.5;
  594. color: #1E293B;
  595. font-weight: 500;
  596. justify-content: flex-start;
  597. }
  598. .cell-free {
  599. color: #94A3B8;
  600. }
  601. .cell-family.active {
  602. color: #F97316;
  603. font-weight: 600;
  604. }
  605. .cell-premium.active {
  606. color: #8B5CF6;
  607. font-weight: 600;
  608. }
  609. .header-row .compare-cell {
  610. font-size: 24rpx;
  611. font-weight: 600;
  612. color: #64748B;
  613. }
  614. .header-row .cell-family.active {
  615. color: #F97316;
  616. }
  617. .header-row .cell-premium.active {
  618. color: #8B5CF6;
  619. }
  620. /* ===== 等级切换 Tabs ===== */
  621. .level-tabs {
  622. display: flex;
  623. margin-bottom: 30rpx;
  624. border-radius: 16rpx;
  625. overflow: hidden;
  626. border: 2rpx solid #FED7AA;
  627. }
  628. .level-tab {
  629. flex: 1;
  630. padding: 24rpx;
  631. text-align: center;
  632. background: #FFF7ED;
  633. cursor: pointer;
  634. }
  635. .level-tab-active {
  636. background: #fff;
  637. border-bottom: 4rpx solid #F97316;
  638. }
  639. .level-tab-name {
  640. font-size: 28rpx;
  641. font-weight: 600;
  642. color: #1E293B;
  643. display: block;
  644. }
  645. .level-tab-price {
  646. font-size: 22rpx;
  647. color: #F97316;
  648. margin-top: 6rpx;
  649. display: block;
  650. }
  651. .level-tab-active .level-tab-name {
  652. color: #F97316;
  653. }
  654. /* ===== 升级记录 ===== */
  655. .records-section {
  656. background: #FFFFFF;
  657. border-radius: 20rpx;
  658. padding: 30rpx;
  659. margin-bottom: 30rpx;
  660. box-shadow: 0 4rpx 24rpx rgba(249, 115, 22, 0.08);
  661. }
  662. .record-item {
  663. display: flex;
  664. justify-content: space-between;
  665. align-items: center;
  666. padding: 20rpx 0;
  667. border-bottom: 1rpx solid #FED7AA;
  668. }
  669. .record-item:last-child {
  670. border-bottom: none;
  671. }
  672. .record-left {
  673. flex: 1;
  674. }
  675. .record-level {
  676. font-size: 28rpx;
  677. color: #1E293B;
  678. display: block;
  679. }
  680. .record-time {
  681. font-size: 22rpx;
  682. color: #94A3B8;
  683. margin-top: 4rpx;
  684. display: block;
  685. }
  686. .record-amount {
  687. font-size: 30rpx;
  688. font-weight: bold;
  689. color: #F97316;
  690. }
  691. /* ===== Coupon Row ===== */
  692. .coupon-row {
  693. display: flex;
  694. align-items: center;
  695. padding: 24rpx 0;
  696. border-top: 1rpx solid #f5f5f5;
  697. margin-top: 16rpx;
  698. }
  699. .coupon-row:active {
  700. opacity: 0.7;
  701. }
  702. .coupon-row-label {
  703. font-size: 26rpx;
  704. color: #666;
  705. margin-right: 16rpx;
  706. }
  707. .coupon-row-discount {
  708. flex: 1;
  709. font-size: 26rpx;
  710. color: #F97316;
  711. font-weight: 600;
  712. text-align: right;
  713. }
  714. .coupon-row-placeholder {
  715. flex: 1;
  716. font-size: 26rpx;
  717. color: #ccc;
  718. text-align: right;
  719. }
  720. .coupon-row-arrow {
  721. font-size: 32rpx;
  722. color: #ccc;
  723. margin-left: 8rpx;
  724. }
  725. /* ===== Coupon Picker Modal ===== */
  726. .modal-mask {
  727. position: fixed;
  728. top: 0;
  729. left: 0;
  730. right: 0;
  731. bottom: 0;
  732. background: rgba(0,0,0,0.5);
  733. z-index: 999;
  734. display: flex;
  735. align-items: flex-end;
  736. }
  737. .coupon-picker {
  738. background: #fff;
  739. border-radius: 24rpx 24rpx 0 0;
  740. width: 100%;
  741. max-height: 70vh;
  742. display: flex;
  743. flex-direction: column;
  744. }
  745. .picker-header {
  746. display: flex;
  747. justify-content: space-between;
  748. align-items: center;
  749. padding: 30rpx;
  750. border-bottom: 1rpx solid #eee;
  751. }
  752. .picker-title {
  753. font-size: 30rpx;
  754. font-weight: 600;
  755. color: #333;
  756. }
  757. .picker-close {
  758. font-size: 26rpx;
  759. color: #999;
  760. }
  761. .picker-list {
  762. max-height: 50vh;
  763. padding: 0 20rpx;
  764. }
  765. .picker-item {
  766. display: flex;
  767. align-items: center;
  768. padding: 24rpx 16rpx;
  769. border-bottom: 1rpx solid #f5f5f5;
  770. }
  771. .picker-item:active {
  772. background: #fafafa;
  773. }
  774. .picker-item-active {
  775. background: #FFF7ED;
  776. }
  777. .picker-item-left {
  778. width: 120rpx;
  779. text-align: center;
  780. flex-shrink: 0;
  781. }
  782. .picker-item-value {
  783. font-size: 32rpx;
  784. font-weight: bold;
  785. color: #F97316;
  786. }
  787. .picker-item-right {
  788. flex: 1;
  789. margin: 0 16rpx;
  790. }
  791. .picker-item-name {
  792. font-size: 26rpx;
  793. color: #333;
  794. display: block;
  795. margin-bottom: 4rpx;
  796. }
  797. .picker-item-condition {
  798. font-size: 22rpx;
  799. color: #999;
  800. }
  801. .picker-item-check {
  802. width: 40rpx;
  803. height: 40rpx;
  804. background: #F97316;
  805. border-radius: 50%;
  806. display: flex;
  807. align-items: center;
  808. justify-content: center;
  809. flex-shrink: 0;
  810. color: #fff;
  811. font-size: 24rpx;
  812. font-weight: bold;
  813. }
  814. .picker-empty {
  815. text-align: center;
  816. padding: 60rpx 0;
  817. font-size: 26rpx;
  818. color: #999;
  819. }
  820. .picker-footer {
  821. padding: 20rpx;
  822. border-top: 1rpx solid #eee;
  823. }
  824. .picker-btn-remove {
  825. background: #f5f5f5;
  826. color: #666;
  827. font-size: 26rpx;
  828. border-radius: 12rpx;
  829. border: none;
  830. }
  831. .picker-btn-remove::after {
  832. border: none;
  833. }
  834. /* ===== 档位选择 ===== */
  835. .period-tabs {
  836. display: flex;
  837. justify-content: space-between;
  838. margin: 24rpx 0;
  839. gap: 16rpx;
  840. }
  841. .period-tab {
  842. flex: 1;
  843. display: flex;
  844. flex-direction: column;
  845. align-items: center;
  846. padding: 20rpx 0;
  847. border: 2rpx solid #FED7AA;
  848. border-radius: 16rpx;
  849. background: #FFFBF5;
  850. }
  851. .period-tab-active {
  852. border-color: #F97316;
  853. background: #FFF7ED;
  854. }
  855. .period-tab-label {
  856. font-size: 26rpx;
  857. color: #64748B;
  858. font-weight: 500;
  859. }
  860. .period-tab-active .period-tab-label {
  861. color: #F97316;
  862. font-weight: 600;
  863. }
  864. .period-tab-price {
  865. font-size: 28rpx;
  866. font-weight: bold;
  867. color: #F97316;
  868. margin-top: 8rpx;
  869. }
  870. </style>