upgrade.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  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 periods"
  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 periods"
  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: '最高15%', premium: '最高20%' },
  194. { name: '专属活动', free: '部分参与', family: '全部参与', premium: '优先参与' },
  195. { name: '成长报告', free: '月度', family: '每周+深度', premium: '每日+深度+专家解读' },
  196. { name: '任务配额', free: '每日5个', family: '不限量', premium: '不限量+优先审核' }
  197. ],
  198. coupons: [],
  199. selectedCoupon: null,
  200. showCouponPicker: false,
  201. periods: [
  202. { key: 'monthly', label: '月度', unit: '/月' },
  203. { key: 'quarterly', label: '季度', unit: '/季' },
  204. { key: 'yearly', label: '年度', unit: '/年' }
  205. ],
  206. selectedPeriod: 'yearly',
  207. selectedLevel: 'FAMILY',
  208. }
  209. },
  210. computed: {
  211. availableCoupons() {
  212. var self = this
  213. return this.coupons.filter(function(c) {
  214. if (c.status && c.status !== 'AVAILABLE') return false
  215. if (c.applicableTo && c.applicableTo !== 'ALL' && c.applicableTo !== 'MEMBERSHIP') return false
  216. return true
  217. })
  218. }
  219. },
  220. onLoad() {
  221. this.loadData()
  222. },
  223. methods: {
  224. async loadData() {
  225. try {
  226. const membershipRes = await getMyMembership()
  227. this.membership = membershipRes.data
  228. if (this.membership && this.membership.levelCode && this.membership.levelCode !== 'FREE') {
  229. this.isFree = false
  230. this.currentLevelName = this.membership.levelName || '家庭会员'
  231. } else {
  232. this.isFree = true
  233. this.currentLevelName = '免费用户'
  234. }
  235. } catch (e) {
  236. console.error('加载会员信息失败', e)
  237. }
  238. try {
  239. const levelsRes = await getMembershipLevels()
  240. this.levels = levelsRes.data || []
  241. } catch (e) {
  242. console.error('加载会员等级失败', e)
  243. }
  244. try {
  245. const recordsRes = await getUpgradeRecords()
  246. if (recordsRes.data && recordsRes.data.records) {
  247. this.records = recordsRes.data.records
  248. }
  249. } catch (e) {
  250. console.error('加载升级记录失败', e)
  251. }
  252. try {
  253. const couponsRes = await getCouponList()
  254. this.coupons = couponsRes.data || []
  255. } catch (e) {
  256. console.error('加载优惠券失败', e)
  257. }
  258. },
  259. openCouponPicker() {
  260. if (this.availableCoupons.length === 0 && !this.selectedCoupon) {
  261. uni.showToast({ title: '暂无可用优惠券', icon: 'none' })
  262. return
  263. }
  264. this.showCouponPicker = true
  265. },
  266. selectCoupon(coupon) {
  267. this.selectedCoupon = coupon
  268. this.showCouponPicker = false
  269. },
  270. removeCoupon() {
  271. this.selectedCoupon = null
  272. this.showCouponPicker = false
  273. },
  274. getCouponCondition(minSpend) {
  275. if (!minSpend || minSpend <= 0) return '无门槛'
  276. return '满' + (minSpend / 100).toFixed(2) + '元可用'
  277. },
  278. selectLevel: function(code) {
  279. this.selectedLevel = code
  280. this.selectedPeriod = 'yearly'
  281. },
  282. getLevelYearlyPrice: function(code) {
  283. for (var i = 0; i < this.levels.length; i++) {
  284. if (this.levels[i].levelCode === code) {
  285. return this.levels[i].yearly ? (this.levels[i].yearly / 100).toFixed(0) : '0'
  286. }
  287. }
  288. return '0'
  289. },
  290. selectPeriod: function(key) {
  291. this.selectedPeriod = key
  292. },
  293. getPriceForPeriod: function(periodKey) {
  294. var plan = null
  295. for (var i = 0; i < this.levels.length; i++) {
  296. if (this.levels[i].levelCode === this.selectedLevel) {
  297. plan = this.levels[i]
  298. break
  299. }
  300. }
  301. if (!plan) return '0'
  302. if (periodKey === 'monthly') return plan.monthly ? (plan.monthly / 100).toFixed(0) : '0'
  303. if (periodKey === 'quarterly') return plan.quarterly ? (plan.quarterly / 100).toFixed(0) : '0'
  304. if (periodKey === 'yearly') return plan.yearly ? (plan.yearly / 100).toFixed(0) : '0'
  305. return '0'
  306. },
  307. getPeriodUnit: function() {
  308. for (var i = 0; i < this.periods.length; i++) {
  309. if (this.periods[i].key === this.selectedPeriod) {
  310. return this.periods[i].unit
  311. }
  312. }
  313. return '/年'
  314. },
  315. handleUpgrade: function() {
  316. var self = this
  317. var priceText = '¥' + this.getPriceForPeriod(this.selectedPeriod) + this.getPeriodUnit()
  318. var levelName = this.selectedLevel === 'FAMILY' ? '家庭会员' : '高级家庭会员'
  319. uni.showModal({
  320. title: '确认开通',
  321. content: '确认开通' + levelName + '(' + priceText + ')?',
  322. success: function(res) {
  323. if (!res.confirm) return
  324. self.doUpgrade()
  325. }
  326. })
  327. },
  328. doUpgrade: function() {
  329. var self = this
  330. createOrder(self.selectedLevel, 'pay', self.selectedPeriod).then(function(res) {
  331. uni.showToast({ title: '开通成功', icon: 'success' })
  332. self.loadData()
  333. }).catch(function(e) {
  334. uni.showToast({ title: e.message || '开通失败', icon: 'none' })
  335. })
  336. },
  337. handleRenew: function() {
  338. var self = this
  339. var priceText = '¥' + this.getPriceForPeriod(this.selectedPeriod) + this.getPeriodUnit()
  340. var levelName = this.selectedLevel === 'FAMILY' ? '家庭会员' : '高级家庭会员'
  341. uni.showModal({
  342. title: '确认续费',
  343. content: '确认续费' + levelName + '(' + priceText + ')?',
  344. success: function(res) {
  345. if (!res.confirm) return
  346. self.doRenew()
  347. }
  348. })
  349. },
  350. doRenew: function() {
  351. var self = this
  352. createOrder(self.selectedLevel, 'pay', this.selectedPeriod).then(function(res) {
  353. uni.showToast({ title: '续费成功', icon: 'success' })
  354. self.loadData()
  355. }).catch(function(e) {
  356. uni.showToast({ title: e.message || '续费失败', icon: 'none' })
  357. })
  358. },
  359. formatDate(date) {
  360. if (!date) return ''
  361. var d = new Date(date)
  362. return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0')
  363. }
  364. }
  365. }
  366. </script>
  367. <style scoped>
  368. .page {
  369. min-height: 100vh;
  370. background: #FFF7ED;
  371. padding: 30rpx;
  372. box-sizing: border-box;
  373. }
  374. /* ===== 状态卡片 ===== */
  375. .status-card {
  376. background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  377. border-radius: 20rpx;
  378. padding: 40rpx;
  379. margin-bottom: 30rpx;
  380. }
  381. .status-badge {
  382. display: inline-flex;
  383. align-items: center;
  384. padding: 10rpx 24rpx;
  385. border-radius: 9999rpx;
  386. font-size: 24rpx;
  387. }
  388. .badge-free {
  389. background: rgba(255,255,255,0.2);
  390. color: #fff;
  391. }
  392. .badge-family {
  393. background: rgba(255,255,255,0.3);
  394. color: #fff;
  395. }
  396. .badge-icon {
  397. font-size: 20rpx;
  398. margin-right: 8rpx;
  399. }
  400. .badge-text {
  401. font-weight: 600;
  402. }
  403. .status-body {
  404. margin-top: 24rpx;
  405. }
  406. .expiry-row {
  407. display: flex;
  408. justify-content: space-between;
  409. align-items: center;
  410. }
  411. .expiry-label {
  412. font-size: 26rpx;
  413. color: rgba(255,255,255,0.8);
  414. }
  415. .expiry-value {
  416. font-size: 28rpx;
  417. color: #fff;
  418. font-weight: 500;
  419. }
  420. .days-remaining {
  421. display: flex;
  422. align-items: baseline;
  423. justify-content: center;
  424. margin-top: 20rpx;
  425. }
  426. .days-num {
  427. font-size: 56rpx;
  428. font-weight: bold;
  429. color: #FEF3C7;
  430. }
  431. .days-unit {
  432. font-size: 26rpx;
  433. color: rgba(255,255,255,0.7);
  434. margin-left: 8rpx;
  435. }
  436. .expired-msg {
  437. text-align: center;
  438. margin-top: 16rpx;
  439. }
  440. .expired-text {
  441. font-size: 26rpx;
  442. color: #FEF3C7;
  443. }
  444. .free-hint {
  445. font-size: 26rpx;
  446. color: rgba(255,255,255,0.85);
  447. text-align: center;
  448. display: block;
  449. }
  450. /* ===== 升级/续费卡片 ===== */
  451. .upgrade-card {
  452. background: #FFFFFF;
  453. border-radius: 20rpx;
  454. padding: 40rpx;
  455. margin-bottom: 30rpx;
  456. box-shadow: 0 4rpx 24rpx rgba(249, 115, 22, 0.08);
  457. }
  458. .upgrade-header {
  459. text-align: center;
  460. margin-bottom: 20rpx;
  461. }
  462. .upgrade-title {
  463. font-size: 36rpx;
  464. font-weight: bold;
  465. color: #1E293B;
  466. display: block;
  467. }
  468. .upgrade-subtitle {
  469. font-size: 24rpx;
  470. color: #94A3B8;
  471. margin-top: 6rpx;
  472. display: block;
  473. }
  474. .upgrade-price {
  475. text-align: center;
  476. margin: 24rpx 0;
  477. }
  478. .price-symbol {
  479. font-size: 28rpx;
  480. color: #F97316;
  481. vertical-align: top;
  482. }
  483. .price-amount {
  484. font-size: 64rpx;
  485. font-weight: bold;
  486. color: #F97316;
  487. line-height: 1;
  488. }
  489. .price-unit {
  490. font-size: 26rpx;
  491. color: #94A3B8;
  492. margin-left: 6rpx;
  493. }
  494. .feature-list {
  495. margin: 24rpx 0;
  496. }
  497. .feature-item {
  498. display: flex;
  499. align-items: center;
  500. padding: 12rpx 0;
  501. }
  502. .feature-check {
  503. width: 40rpx;
  504. height: 40rpx;
  505. line-height: 40rpx;
  506. text-align: center;
  507. background: #F97316;
  508. color: #fff;
  509. border-radius: 50%;
  510. font-size: 22rpx;
  511. margin-right: 16rpx;
  512. flex-shrink: 0;
  513. }
  514. .feature-text {
  515. font-size: 28rpx;
  516. color: #1E293B;
  517. }
  518. .btn-upgrade {
  519. width: 100%;
  520. height: 88rpx;
  521. line-height: 88rpx;
  522. background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  523. color: #fff;
  524. font-size: 32rpx;
  525. font-weight: 600;
  526. border-radius: 44rpx;
  527. margin-top: 20rpx;
  528. border: none;
  529. }
  530. .btn-upgrade::after {
  531. border: none;
  532. }
  533. .btn-upgrade:active {
  534. opacity: 0.9;
  535. }
  536. .btn-renew {
  537. background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
  538. }
  539. /* ===== 权益对比 ===== */
  540. .compare-section {
  541. background: #FFFFFF;
  542. border-radius: 20rpx;
  543. padding: 30rpx;
  544. margin-bottom: 30rpx;
  545. box-shadow: 0 4rpx 24rpx rgba(249, 115, 22, 0.08);
  546. }
  547. .section-title {
  548. font-size: 32rpx;
  549. font-weight: bold;
  550. color: #1E293B;
  551. display: block;
  552. margin-bottom: 24rpx;
  553. }
  554. .compare-table {
  555. border-radius: 16rpx;
  556. overflow: hidden;
  557. border: 1rpx solid #FED7AA;
  558. }
  559. .compare-row {
  560. display: flex;
  561. border-bottom: 1rpx solid #FED7AA;
  562. }
  563. .compare-row:last-child {
  564. border-bottom: none;
  565. }
  566. .header-row {
  567. background: #FFF7ED;
  568. }
  569. .compare-cell {
  570. flex: 1;
  571. padding: 20rpx 16rpx;
  572. font-size: 26rpx;
  573. text-align: center;
  574. display: flex;
  575. align-items: center;
  576. justify-content: center;
  577. }
  578. .cell-feature {
  579. flex: 1.5;
  580. color: #1E293B;
  581. font-weight: 500;
  582. justify-content: flex-start;
  583. }
  584. .cell-free {
  585. color: #94A3B8;
  586. }
  587. .cell-family.active {
  588. color: #F97316;
  589. font-weight: 600;
  590. }
  591. .cell-premium.active {
  592. color: #8B5CF6;
  593. font-weight: 600;
  594. }
  595. .header-row .compare-cell {
  596. font-size: 24rpx;
  597. font-weight: 600;
  598. color: #64748B;
  599. }
  600. .header-row .cell-family.active {
  601. color: #F97316;
  602. }
  603. .header-row .cell-premium.active {
  604. color: #8B5CF6;
  605. }
  606. /* ===== 等级切换 Tabs ===== */
  607. .level-tabs {
  608. display: flex;
  609. margin-bottom: 30rpx;
  610. border-radius: 16rpx;
  611. overflow: hidden;
  612. border: 2rpx solid #FED7AA;
  613. }
  614. .level-tab {
  615. flex: 1;
  616. padding: 24rpx;
  617. text-align: center;
  618. background: #FFF7ED;
  619. cursor: pointer;
  620. }
  621. .level-tab-active {
  622. background: #fff;
  623. border-bottom: 4rpx solid #F97316;
  624. }
  625. .level-tab-name {
  626. font-size: 28rpx;
  627. font-weight: 600;
  628. color: #1E293B;
  629. display: block;
  630. }
  631. .level-tab-price {
  632. font-size: 22rpx;
  633. color: #F97316;
  634. margin-top: 6rpx;
  635. display: block;
  636. }
  637. .level-tab-active .level-tab-name {
  638. color: #F97316;
  639. }
  640. /* ===== 升级记录 ===== */
  641. .records-section {
  642. background: #FFFFFF;
  643. border-radius: 20rpx;
  644. padding: 30rpx;
  645. margin-bottom: 30rpx;
  646. box-shadow: 0 4rpx 24rpx rgba(249, 115, 22, 0.08);
  647. }
  648. .record-item {
  649. display: flex;
  650. justify-content: space-between;
  651. align-items: center;
  652. padding: 20rpx 0;
  653. border-bottom: 1rpx solid #FED7AA;
  654. }
  655. .record-item:last-child {
  656. border-bottom: none;
  657. }
  658. .record-left {
  659. flex: 1;
  660. }
  661. .record-level {
  662. font-size: 28rpx;
  663. color: #1E293B;
  664. display: block;
  665. }
  666. .record-time {
  667. font-size: 22rpx;
  668. color: #94A3B8;
  669. margin-top: 4rpx;
  670. display: block;
  671. }
  672. .record-amount {
  673. font-size: 30rpx;
  674. font-weight: bold;
  675. color: #F97316;
  676. }
  677. /* ===== Coupon Row ===== */
  678. .coupon-row {
  679. display: flex;
  680. align-items: center;
  681. padding: 24rpx 0;
  682. border-top: 1rpx solid #f5f5f5;
  683. margin-top: 16rpx;
  684. }
  685. .coupon-row:active {
  686. opacity: 0.7;
  687. }
  688. .coupon-row-label {
  689. font-size: 26rpx;
  690. color: #666;
  691. margin-right: 16rpx;
  692. }
  693. .coupon-row-discount {
  694. flex: 1;
  695. font-size: 26rpx;
  696. color: #F97316;
  697. font-weight: 600;
  698. text-align: right;
  699. }
  700. .coupon-row-placeholder {
  701. flex: 1;
  702. font-size: 26rpx;
  703. color: #ccc;
  704. text-align: right;
  705. }
  706. .coupon-row-arrow {
  707. font-size: 32rpx;
  708. color: #ccc;
  709. margin-left: 8rpx;
  710. }
  711. /* ===== Coupon Picker Modal ===== */
  712. .modal-mask {
  713. position: fixed;
  714. top: 0;
  715. left: 0;
  716. right: 0;
  717. bottom: 0;
  718. background: rgba(0,0,0,0.5);
  719. z-index: 999;
  720. display: flex;
  721. align-items: flex-end;
  722. }
  723. .coupon-picker {
  724. background: #fff;
  725. border-radius: 24rpx 24rpx 0 0;
  726. width: 100%;
  727. max-height: 70vh;
  728. display: flex;
  729. flex-direction: column;
  730. }
  731. .picker-header {
  732. display: flex;
  733. justify-content: space-between;
  734. align-items: center;
  735. padding: 30rpx;
  736. border-bottom: 1rpx solid #eee;
  737. }
  738. .picker-title {
  739. font-size: 30rpx;
  740. font-weight: 600;
  741. color: #333;
  742. }
  743. .picker-close {
  744. font-size: 26rpx;
  745. color: #999;
  746. }
  747. .picker-list {
  748. max-height: 50vh;
  749. padding: 0 20rpx;
  750. }
  751. .picker-item {
  752. display: flex;
  753. align-items: center;
  754. padding: 24rpx 16rpx;
  755. border-bottom: 1rpx solid #f5f5f5;
  756. }
  757. .picker-item:active {
  758. background: #fafafa;
  759. }
  760. .picker-item-active {
  761. background: #FFF7ED;
  762. }
  763. .picker-item-left {
  764. width: 120rpx;
  765. text-align: center;
  766. flex-shrink: 0;
  767. }
  768. .picker-item-value {
  769. font-size: 32rpx;
  770. font-weight: bold;
  771. color: #F97316;
  772. }
  773. .picker-item-right {
  774. flex: 1;
  775. margin: 0 16rpx;
  776. }
  777. .picker-item-name {
  778. font-size: 26rpx;
  779. color: #333;
  780. display: block;
  781. margin-bottom: 4rpx;
  782. }
  783. .picker-item-condition {
  784. font-size: 22rpx;
  785. color: #999;
  786. }
  787. .picker-item-check {
  788. width: 40rpx;
  789. height: 40rpx;
  790. background: #F97316;
  791. border-radius: 50%;
  792. display: flex;
  793. align-items: center;
  794. justify-content: center;
  795. flex-shrink: 0;
  796. color: #fff;
  797. font-size: 24rpx;
  798. font-weight: bold;
  799. }
  800. .picker-empty {
  801. text-align: center;
  802. padding: 60rpx 0;
  803. font-size: 26rpx;
  804. color: #999;
  805. }
  806. .picker-footer {
  807. padding: 20rpx;
  808. border-top: 1rpx solid #eee;
  809. }
  810. .picker-btn-remove {
  811. background: #f5f5f5;
  812. color: #666;
  813. font-size: 26rpx;
  814. border-radius: 12rpx;
  815. border: none;
  816. }
  817. .picker-btn-remove::after {
  818. border: none;
  819. }
  820. /* ===== 档位选择 ===== */
  821. .period-tabs {
  822. display: flex;
  823. justify-content: space-between;
  824. margin: 24rpx 0;
  825. gap: 16rpx;
  826. }
  827. .period-tab {
  828. flex: 1;
  829. display: flex;
  830. flex-direction: column;
  831. align-items: center;
  832. padding: 20rpx 0;
  833. border: 2rpx solid #FED7AA;
  834. border-radius: 16rpx;
  835. background: #FFFBF5;
  836. }
  837. .period-tab-active {
  838. border-color: #F97316;
  839. background: #FFF7ED;
  840. }
  841. .period-tab-label {
  842. font-size: 26rpx;
  843. color: #64748B;
  844. font-weight: 500;
  845. }
  846. .period-tab-active .period-tab-label {
  847. color: #F97316;
  848. font-weight: 600;
  849. }
  850. .period-tab-price {
  851. font-size: 28rpx;
  852. font-weight: bold;
  853. color: #F97316;
  854. margin-top: 8rpx;
  855. }
  856. </style>