upgrade.vue 20 KB

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