upgrade.vue 21 KB

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