upgrade.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  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, getMembershipPlans, getUpgradeRecords, upgradeMember, createOrder, getCouponList, requestVirtualPayment } 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 getMembershipPlans()
  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. var data = res.data || {}
  346. if (data.orderInfo && data.sign) {
  347. // 真实模式:内联返回 VirtualPayParamsDTO → 拉起虚拟支付
  348. requestVirtualPayment(data, {
  349. success: function() {
  350. uni.showToast({ title: '支付成功,开通中…', icon: 'none' })
  351. self.pollOrderStatus()
  352. },
  353. fail: function() {
  354. uni.showToast({ title: '支付未完成', icon: 'none' })
  355. }
  356. })
  357. } else {
  358. // testMode/trial:下单接口直接返回订单实体(mock 已开通)→ 沿用旧成功逻辑
  359. uni.showToast({ title: '开通成功', icon: 'success' })
  360. self.loadData()
  361. }
  362. }).catch(function(e) {
  363. if (e.code === 46001) {
  364. uni.showToast({ title: '该商品暂未开放购买', icon: 'none' })
  365. } else {
  366. uni.showToast({ title: e.message || '开通失败', icon: 'none' })
  367. }
  368. })
  369. },
  370. pollOrderStatus: function() {
  371. var self = this
  372. var times = 0
  373. var timer = setInterval(function() {
  374. times++
  375. getMyMembership().then(function(res) {
  376. var m = res.data || {}
  377. if (m.membership && m.membership.isActive) {
  378. clearInterval(timer)
  379. uni.showToast({ title: '开通成功', icon: 'success' })
  380. self.loadData()
  381. } else if (times >= 5) {
  382. clearInterval(timer)
  383. self.loadData()
  384. }
  385. }).catch(function() {
  386. if (times >= 5) { clearInterval(timer); self.loadData() }
  387. })
  388. }, 2000)
  389. },
  390. handleRenew: function() {
  391. var self = this
  392. var priceText = '¥' + this.getPriceForPeriod(this.selectedPeriod) + this.getPeriodUnit()
  393. var levelName = this.selectedLevel === 'FAMILY' ? '家庭会员' : '高级家庭会员'
  394. uni.showModal({
  395. title: '确认续费',
  396. content: '确认续费' + levelName + '(' + priceText + ')?',
  397. success: function(res) {
  398. if (!res.confirm) return
  399. self.doRenew()
  400. }
  401. })
  402. },
  403. doRenew: function() {
  404. var self = this
  405. createOrder(self.selectedLevel, 'pay', this.selectedPeriod).then(function(res) {
  406. var data = res.data || {}
  407. if (data.orderInfo && data.sign) {
  408. // 真实模式:内联返回 VirtualPayParamsDTO → 拉起虚拟支付
  409. requestVirtualPayment(data, {
  410. success: function() {
  411. uni.showToast({ title: '支付成功,续费中…', icon: 'none' })
  412. self.pollOrderStatus()
  413. },
  414. fail: function() {
  415. uni.showToast({ title: '支付未完成', icon: 'none' })
  416. }
  417. })
  418. } else {
  419. // testMode/trial:下单接口直接返回订单实体(mock 已开通)→ 沿用旧成功逻辑
  420. uni.showToast({ title: '续费成功', icon: 'success' })
  421. self.loadData()
  422. }
  423. }).catch(function(e) {
  424. if (e.code === 46001) {
  425. uni.showToast({ title: '该商品暂未开放购买', icon: 'none' })
  426. } else {
  427. uni.showToast({ title: e.message || '续费失败', icon: 'none' })
  428. }
  429. })
  430. },
  431. formatDate(date) {
  432. if (!date) return ''
  433. var d = new Date(date)
  434. return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0')
  435. }
  436. }
  437. }
  438. </script>
  439. <style scoped>
  440. .page {
  441. min-height: 100vh;
  442. background: #FFF7ED;
  443. padding: 30rpx;
  444. box-sizing: border-box;
  445. }
  446. /* ===== 状态卡片 ===== */
  447. .status-card {
  448. background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  449. border-radius: 20rpx;
  450. padding: 40rpx;
  451. margin-bottom: 30rpx;
  452. }
  453. .status-badge {
  454. display: inline-flex;
  455. align-items: center;
  456. padding: 10rpx 24rpx;
  457. border-radius: 9999rpx;
  458. font-size: 24rpx;
  459. }
  460. .badge-free {
  461. background: rgba(255,255,255,0.2);
  462. color: #fff;
  463. }
  464. .badge-family {
  465. background: rgba(255,255,255,0.3);
  466. color: #fff;
  467. }
  468. .badge-icon {
  469. font-size: 20rpx;
  470. margin-right: 8rpx;
  471. }
  472. .badge-text {
  473. font-weight: 600;
  474. }
  475. .status-body {
  476. margin-top: 24rpx;
  477. }
  478. .expiry-row {
  479. display: flex;
  480. justify-content: space-between;
  481. align-items: center;
  482. }
  483. .expiry-label {
  484. font-size: 26rpx;
  485. color: rgba(255,255,255,0.8);
  486. }
  487. .expiry-value {
  488. font-size: 28rpx;
  489. color: #fff;
  490. font-weight: 500;
  491. }
  492. .days-remaining {
  493. display: flex;
  494. align-items: baseline;
  495. justify-content: center;
  496. margin-top: 20rpx;
  497. }
  498. .days-num {
  499. font-size: 56rpx;
  500. font-weight: bold;
  501. color: #FEF3C7;
  502. }
  503. .days-unit {
  504. font-size: 26rpx;
  505. color: rgba(255,255,255,0.7);
  506. margin-left: 8rpx;
  507. }
  508. .expired-msg {
  509. text-align: center;
  510. margin-top: 16rpx;
  511. }
  512. .expired-text {
  513. font-size: 26rpx;
  514. color: #FEF3C7;
  515. }
  516. .free-hint {
  517. font-size: 26rpx;
  518. color: rgba(255,255,255,0.85);
  519. text-align: center;
  520. display: block;
  521. }
  522. /* ===== 升级/续费卡片 ===== */
  523. .upgrade-card {
  524. background: #FFFFFF;
  525. border-radius: 20rpx;
  526. padding: 40rpx;
  527. margin-bottom: 30rpx;
  528. box-shadow: 0 4rpx 24rpx rgba(249, 115, 22, 0.08);
  529. }
  530. .upgrade-header {
  531. text-align: center;
  532. margin-bottom: 20rpx;
  533. }
  534. .upgrade-title {
  535. font-size: 36rpx;
  536. font-weight: bold;
  537. color: #1E293B;
  538. display: block;
  539. }
  540. .upgrade-subtitle {
  541. font-size: 24rpx;
  542. color: #94A3B8;
  543. margin-top: 6rpx;
  544. display: block;
  545. }
  546. .upgrade-price {
  547. text-align: center;
  548. margin: 24rpx 0;
  549. }
  550. .price-symbol {
  551. font-size: 28rpx;
  552. color: #F97316;
  553. vertical-align: top;
  554. }
  555. .price-amount {
  556. font-size: 64rpx;
  557. font-weight: bold;
  558. color: #F97316;
  559. line-height: 1;
  560. }
  561. .price-unit {
  562. font-size: 26rpx;
  563. color: #94A3B8;
  564. margin-left: 6rpx;
  565. }
  566. .feature-list {
  567. margin: 24rpx 0;
  568. }
  569. .feature-item {
  570. display: flex;
  571. align-items: center;
  572. padding: 12rpx 0;
  573. }
  574. .feature-check {
  575. width: 40rpx;
  576. height: 40rpx;
  577. line-height: 40rpx;
  578. text-align: center;
  579. background: #F97316;
  580. color: #fff;
  581. border-radius: 50%;
  582. font-size: 22rpx;
  583. margin-right: 16rpx;
  584. flex-shrink: 0;
  585. }
  586. .feature-text {
  587. font-size: 28rpx;
  588. color: #1E293B;
  589. }
  590. .btn-upgrade {
  591. width: 100%;
  592. height: 88rpx;
  593. line-height: 88rpx;
  594. background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  595. color: #fff;
  596. font-size: 32rpx;
  597. font-weight: 600;
  598. border-radius: 44rpx;
  599. margin-top: 20rpx;
  600. border: none;
  601. }
  602. .btn-upgrade::after {
  603. border: none;
  604. }
  605. .btn-upgrade:active {
  606. opacity: 0.9;
  607. }
  608. .btn-renew {
  609. background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
  610. }
  611. /* ===== 权益对比 ===== */
  612. .compare-section {
  613. background: #FFFFFF;
  614. border-radius: 20rpx;
  615. padding: 30rpx;
  616. margin-bottom: 30rpx;
  617. box-shadow: 0 4rpx 24rpx rgba(249, 115, 22, 0.08);
  618. }
  619. .section-title {
  620. font-size: 32rpx;
  621. font-weight: bold;
  622. color: #1E293B;
  623. display: block;
  624. margin-bottom: 24rpx;
  625. }
  626. .compare-table {
  627. border-radius: 16rpx;
  628. overflow: hidden;
  629. border: 1rpx solid #FED7AA;
  630. }
  631. .compare-row {
  632. display: flex;
  633. border-bottom: 1rpx solid #FED7AA;
  634. }
  635. .compare-row:last-child {
  636. border-bottom: none;
  637. }
  638. .header-row {
  639. background: #FFF7ED;
  640. }
  641. .compare-cell {
  642. flex: 1;
  643. padding: 20rpx 16rpx;
  644. font-size: 26rpx;
  645. text-align: center;
  646. display: flex;
  647. align-items: center;
  648. justify-content: center;
  649. }
  650. .cell-feature {
  651. flex: 1.5;
  652. color: #1E293B;
  653. font-weight: 500;
  654. justify-content: flex-start;
  655. }
  656. .cell-free {
  657. color: #94A3B8;
  658. }
  659. .cell-family.active {
  660. color: #F97316;
  661. font-weight: 600;
  662. }
  663. .cell-premium.active {
  664. color: #8B5CF6;
  665. font-weight: 600;
  666. }
  667. .header-row .compare-cell {
  668. font-size: 24rpx;
  669. font-weight: 600;
  670. color: #64748B;
  671. }
  672. .header-row .cell-family.active {
  673. color: #F97316;
  674. }
  675. .header-row .cell-premium.active {
  676. color: #8B5CF6;
  677. }
  678. /* ===== 等级切换 Tabs ===== */
  679. .level-tabs {
  680. display: flex;
  681. margin-bottom: 30rpx;
  682. border-radius: 16rpx;
  683. overflow: hidden;
  684. border: 2rpx solid #FED7AA;
  685. }
  686. .level-tab {
  687. flex: 1;
  688. padding: 24rpx;
  689. text-align: center;
  690. background: #FFF7ED;
  691. cursor: pointer;
  692. }
  693. .level-tab-active {
  694. background: #fff;
  695. border-bottom: 4rpx solid #F97316;
  696. }
  697. .level-tab-name {
  698. font-size: 28rpx;
  699. font-weight: 600;
  700. color: #1E293B;
  701. display: block;
  702. }
  703. .level-tab-price {
  704. font-size: 22rpx;
  705. color: #F97316;
  706. margin-top: 6rpx;
  707. display: block;
  708. }
  709. .level-tab-active .level-tab-name {
  710. color: #F97316;
  711. }
  712. /* ===== 升级记录 ===== */
  713. .records-section {
  714. background: #FFFFFF;
  715. border-radius: 20rpx;
  716. padding: 30rpx;
  717. margin-bottom: 30rpx;
  718. box-shadow: 0 4rpx 24rpx rgba(249, 115, 22, 0.08);
  719. }
  720. .record-item {
  721. display: flex;
  722. justify-content: space-between;
  723. align-items: center;
  724. padding: 20rpx 0;
  725. border-bottom: 1rpx solid #FED7AA;
  726. }
  727. .record-item:last-child {
  728. border-bottom: none;
  729. }
  730. .record-left {
  731. flex: 1;
  732. }
  733. .record-level {
  734. font-size: 28rpx;
  735. color: #1E293B;
  736. display: block;
  737. }
  738. .record-time {
  739. font-size: 22rpx;
  740. color: #94A3B8;
  741. margin-top: 4rpx;
  742. display: block;
  743. }
  744. .record-amount {
  745. font-size: 30rpx;
  746. font-weight: bold;
  747. color: #F97316;
  748. }
  749. /* ===== Coupon Row ===== */
  750. .coupon-row {
  751. display: flex;
  752. align-items: center;
  753. padding: 24rpx 0;
  754. border-top: 1rpx solid #f5f5f5;
  755. margin-top: 16rpx;
  756. }
  757. .coupon-row:active {
  758. opacity: 0.7;
  759. }
  760. .coupon-row-label {
  761. font-size: 26rpx;
  762. color: #666;
  763. margin-right: 16rpx;
  764. }
  765. .coupon-row-discount {
  766. flex: 1;
  767. font-size: 26rpx;
  768. color: #F97316;
  769. font-weight: 600;
  770. text-align: right;
  771. }
  772. .coupon-row-placeholder {
  773. flex: 1;
  774. font-size: 26rpx;
  775. color: #ccc;
  776. text-align: right;
  777. }
  778. .coupon-row-arrow {
  779. font-size: 32rpx;
  780. color: #ccc;
  781. margin-left: 8rpx;
  782. }
  783. /* ===== Coupon Picker Modal ===== */
  784. .modal-mask {
  785. position: fixed;
  786. top: 0;
  787. left: 0;
  788. right: 0;
  789. bottom: 0;
  790. background: rgba(0,0,0,0.5);
  791. z-index: 999;
  792. display: flex;
  793. align-items: flex-end;
  794. }
  795. .coupon-picker {
  796. background: #fff;
  797. border-radius: 24rpx 24rpx 0 0;
  798. width: 100%;
  799. max-height: 70vh;
  800. display: flex;
  801. flex-direction: column;
  802. }
  803. .picker-header {
  804. display: flex;
  805. justify-content: space-between;
  806. align-items: center;
  807. padding: 30rpx;
  808. border-bottom: 1rpx solid #eee;
  809. }
  810. .picker-title {
  811. font-size: 30rpx;
  812. font-weight: 600;
  813. color: #333;
  814. }
  815. .picker-close {
  816. font-size: 26rpx;
  817. color: #999;
  818. }
  819. .picker-list {
  820. max-height: 50vh;
  821. padding: 0 20rpx;
  822. }
  823. .picker-item {
  824. display: flex;
  825. align-items: center;
  826. padding: 24rpx 16rpx;
  827. border-bottom: 1rpx solid #f5f5f5;
  828. }
  829. .picker-item:active {
  830. background: #fafafa;
  831. }
  832. .picker-item-active {
  833. background: #FFF7ED;
  834. }
  835. .picker-item-left {
  836. width: 120rpx;
  837. text-align: center;
  838. flex-shrink: 0;
  839. }
  840. .picker-item-value {
  841. font-size: 32rpx;
  842. font-weight: bold;
  843. color: #F97316;
  844. }
  845. .picker-item-right {
  846. flex: 1;
  847. margin: 0 16rpx;
  848. }
  849. .picker-item-name {
  850. font-size: 26rpx;
  851. color: #333;
  852. display: block;
  853. margin-bottom: 4rpx;
  854. }
  855. .picker-item-condition {
  856. font-size: 22rpx;
  857. color: #999;
  858. }
  859. .picker-item-check {
  860. width: 40rpx;
  861. height: 40rpx;
  862. background: #F97316;
  863. border-radius: 50%;
  864. display: flex;
  865. align-items: center;
  866. justify-content: center;
  867. flex-shrink: 0;
  868. color: #fff;
  869. font-size: 24rpx;
  870. font-weight: bold;
  871. }
  872. .picker-empty {
  873. text-align: center;
  874. padding: 60rpx 0;
  875. font-size: 26rpx;
  876. color: #999;
  877. }
  878. .picker-footer {
  879. padding: 20rpx;
  880. border-top: 1rpx solid #eee;
  881. }
  882. .picker-btn-remove {
  883. background: #f5f5f5;
  884. color: #666;
  885. font-size: 26rpx;
  886. border-radius: 12rpx;
  887. border: none;
  888. }
  889. .picker-btn-remove::after {
  890. border: none;
  891. }
  892. /* ===== 档位选择 ===== */
  893. .period-tabs {
  894. display: flex;
  895. justify-content: space-between;
  896. margin: 24rpx 0;
  897. gap: 16rpx;
  898. }
  899. .period-tab {
  900. flex: 1;
  901. display: flex;
  902. flex-direction: column;
  903. align-items: center;
  904. padding: 20rpx 0;
  905. border: 2rpx solid #FED7AA;
  906. border-radius: 16rpx;
  907. background: #FFFBF5;
  908. }
  909. .period-tab-active {
  910. border-color: #F97316;
  911. background: #FFF7ED;
  912. }
  913. .period-tab-label {
  914. font-size: 26rpx;
  915. color: #64748B;
  916. font-weight: 500;
  917. }
  918. .period-tab-active .period-tab-label {
  919. color: #F97316;
  920. font-weight: 600;
  921. }
  922. .period-tab-price {
  923. font-size: 28rpx;
  924. font-weight: bold;
  925. color: #F97316;
  926. margin-top: 8rpx;
  927. }
  928. </style>