cart.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. <template>
  2. <view class="container">
  3. <scroll-view
  4. scroll-y
  5. class="cart-list"
  6. refresher-enabled
  7. :refresher-triggered="refreshing"
  8. @refresherrefresh="onRefresh"
  9. >
  10. <view v-if="loading && items.length === 0" class="loading-wrap">
  11. <text class="loading-text">加载中...</text>
  12. </view>
  13. <view v-else-if="items.length === 0" class="empty-wrap">
  14. <text class="empty-icon">🛒</text>
  15. <text class="empty-text">购物车是空的</text>
  16. </view>
  17. <view v-else>
  18. <view class="select-all-row">
  19. <view class="checkbox-wrap" @click="toggleSelectAll">
  20. <text :class="['checkbox', selectAll ? 'checked' : '']">
  21. <text v-if="selectAll" class="checkmark">✓</text>
  22. </text>
  23. <text class="select-all-text">全选</text>
  24. </view>
  25. </view>
  26. <view
  27. v-for="item in items"
  28. :key="item.productId"
  29. class="cart-item-card"
  30. >
  31. <view class="item-left">
  32. <image
  33. class="item-image"
  34. :src="getImageUrl(item.coverImage) || '/static/default-product.png'"
  35. mode="aspectFill"
  36. />
  37. </view>
  38. <view class="item-right">
  39. <view class="item-header">
  40. <view class="checkbox-wrap" @click="toggleItem(item.productId)">
  41. <text :class="['checkbox', item.checked ? 'checked' : '']">
  42. <text v-if="item.checked" class="checkmark">✓</text>
  43. </text>
  44. </view>
  45. <text class="item-name">{{ item.productName }}</text>
  46. <text v-if="item.giftLevelName" class="gift-badge">🎁购此送 {{ item.giftLevelName }}会员</text>
  47. <text v-if="item.specDesc" class="item-spec">{{ item.specDesc }}</text>
  48. <text v-if="item.supplierName" class="item-supplier">供应商: {{ item.supplierName }}</text>
  49. <text class="item-delete" @click="onRemove(item.productId)">🗑</text>
  50. </view>
  51. <view class="item-bottom">
  52. <view class="item-price-wrap">
  53. <text class="item-price">{{ formatPriceWithSymbol(item.unitPrice) }}</text>
  54. <text v-if="isMember && item.memberPrice && item.memberPrice > 0 && item.memberPrice < item.unitPrice" class="item-member-price">会员 {{ formatPriceWithSymbol(item.memberPrice) }}</text>
  55. </view>
  56. <view class="stepper">
  57. <text class="stepper-btn" @click="decreaseQty(item)">−</text>
  58. <text class="stepper-value">{{ item.quantity }}</text>
  59. <text class="stepper-btn" @click="increaseQty(item)">+</text>
  60. </view>
  61. </view>
  62. <text class="item-subtotal">小计: {{ formatPriceWithSymbol(item.subtotal) }}</text>
  63. </view>
  64. </view>
  65. </view>
  66. </scroll-view>
  67. <!-- Member Upgrade Hint -->
  68. <view v-if="!isMember && items.length > 0" class="member-hint" @click="goUpgrade">
  69. <text class="member-hint-icon">👑</text>
  70. <text class="member-hint-text">开通会员享全场商品折扣</text>
  71. <text class="member-hint-action">去开通 ›</text>
  72. </view>
  73. <!-- Gift Membership Progress -->
  74. <view v-if="giftProgress && !giftIsGranted && giftProgress.threshold > 0" class="gift-progress-section">
  75. <view class="gift-progress-header">
  76. <text class="gift-progress-icon">🎁</text>
  77. <text class="gift-progress-title">购会员商品累计进度</text>
  78. <text class="gift-progress-percent">{{ giftProgressPercent }}%</text>
  79. </view>
  80. <view class="gift-progress-bar-bg">
  81. <view class="gift-progress-bar-fill" :style="{ width: giftProgressPercent + '%' }"></view>
  82. </view>
  83. <view class="gift-progress-info">
  84. <text class="gift-progress-accumulated">已累 {{ giftAccumulatedYuan }} 元</text>
  85. <text class="gift-progress-remaining">还差 {{ giftRemainingYuan }} 元送会员</text>
  86. </view>
  87. <view v-if="giftProgress.grantedLevel" class="gift-progress-level">
  88. <text>达标将赠送 {{ giftProgress.grantedLevel === 'FAMILY' ? '家庭会员' : giftProgress.grantedLevel }} 权益</text>
  89. </view>
  90. </view>
  91. <view v-else-if="giftIsGranted" class="gift-granted-hint">
  92. <text class="gift-granted-icon">✅</text>
  93. <text class="gift-granted-text">本家庭已赠送会员,请前往会员中心查看</text>
  94. </view>
  95. <view class="bottom-bar" v-if="items.length > 0">
  96. <view class="bottom-left">
  97. <text class="selected-count">已选 {{ selectedCount }} 件</text>
  98. </view>
  99. <view class="bottom-right" v-if="isMember">
  100. <view class="price-compare">
  101. <text class="price-original-label">原价</text>
  102. <text class="price-original">{{ formatPriceWithSymbol(originalTotalAmount) }}</text>
  103. </view>
  104. <view class="price-compare">
  105. <text class="price-estimate-label">预计支付</text>
  106. <text class="price-estimate">{{ formatPriceWithSymbol(estimatedTotalAmount) }}</text>
  107. </view>
  108. </view>
  109. <view class="bottom-right" v-else>
  110. <text class="total-amount-label">合计: </text>
  111. <text class="total-amount">{{ formatPriceWithSymbol(totalAmount) }}</text>
  112. </view>
  113. <button
  114. :class="['checkout-btn', selectedCount === 0 ? 'disabled' : '']"
  115. :disabled="selectedCount === 0"
  116. @click="goCheckout"
  117. >去结算</button>
  118. </view>
  119. </view>
  120. </template>
  121. <script>
  122. import config from '@/config.js'
  123. import { getMyMembership, getGiftMembershipProgress } from '@/utils/api.js'
  124. export default {
  125. data() {
  126. return {
  127. items: [],
  128. loading: false,
  129. refreshing: false,
  130. userId: null,
  131. isMember: false,
  132. giftProgress: null // 赠会员累计进度
  133. }
  134. },
  135. computed: {
  136. selectAll() {
  137. return this.items.length > 0 && this.items.every(function(item) {
  138. return item.checked
  139. })
  140. },
  141. selectedCount() {
  142. var count = 0
  143. for (var i = 0; i < this.items.length; i++) {
  144. if (this.items[i].checked) {
  145. count = count + this.items[i].quantity
  146. }
  147. }
  148. return count
  149. },
  150. totalAmount() {
  151. var total = 0
  152. for (var i = 0; i < this.items.length; i++) {
  153. if (this.items[i].checked) {
  154. total = total + (this.items[i].subtotal || this.items[i].unitPrice * this.items[i].quantity)
  155. }
  156. }
  157. return total
  158. },
  159. originalTotalAmount() {
  160. var total = 0
  161. for (var i = 0; i < this.items.length; i++) {
  162. if (this.items[i].checked) {
  163. var price = this.items[i].unitPrice || 0
  164. total = total + (price * this.items[i].quantity)
  165. }
  166. }
  167. return total
  168. },
  169. estimatedTotalAmount() {
  170. var total = 0
  171. for (var i = 0; i < this.items.length; i++) {
  172. if (this.items[i].checked) {
  173. var price = this.items[i].unitPrice || 0
  174. // 会员可用会员价,优先用会员价
  175. if (this.isMember && this.items[i].memberPrice && this.items[i].memberPrice > 0 && this.items[i].memberPrice < price) {
  176. price = this.items[i].memberPrice
  177. }
  178. total = total + (price * this.items[i].quantity)
  179. }
  180. }
  181. return total
  182. },
  183. hasGiftItems() {
  184. for (var i = 0; i < this.items.length; i++) {
  185. if (this.items[i].checked && this.items[i].giftLevelName) return true
  186. }
  187. return false
  188. },
  189. giftLevelNames() {
  190. var names = []
  191. for (var i = 0; i < this.items.length; i++) {
  192. if (this.items[i].checked && this.items[i].giftLevelName) {
  193. names.push(this.items[i].giftLevelName)
  194. }
  195. }
  196. return names
  197. },
  198. // 累计进度相关计算
  199. giftAccumulatedYuan() {
  200. if (!this.giftProgress || !this.giftProgress.accumulatedAmount) return 0
  201. return this.giftProgress.accumulatedAmount / 100
  202. },
  203. giftThresholdYuan() {
  204. if (!this.giftProgress || !this.giftProgress.threshold) return 0
  205. return this.giftProgress.threshold / 100
  206. },
  207. giftRemainingYuan() {
  208. if (!this.giftProgress || !this.giftProgress.remaining) return 0
  209. return this.giftProgress.remaining / 100
  210. },
  211. giftProgressPercent() {
  212. if (!this.giftProgress || !this.giftProgress.threshold || this.giftProgress.threshold <= 0) return 0
  213. if (!this.giftProgress.accumulatedAmount) return 0
  214. return Math.min(100, Math.round(this.giftProgress.accumulatedAmount / this.giftProgress.threshold * 100))
  215. },
  216. giftIsGranted() {
  217. return this.giftProgress && this.giftProgress.granted === 1
  218. }
  219. },
  220. onLoad() {
  221. this.userId = uni.getStorageSync('userId')
  222. this.checkMemberStatus()
  223. this.loadCart()
  224. this.loadGiftProgress()
  225. this._onLoadFired = true
  226. },
  227. onShow() {
  228. if (this._onLoadFired) {
  229. this._onLoadFired = false
  230. } else if (this.items.length > 0) {
  231. this.loadCart()
  232. this.loadGiftProgress()
  233. }
  234. },
  235. methods: {
  236. checkMemberStatus() {
  237. var that = this
  238. getMyMembership().then(function(res) {
  239. if (res.data && res.data.memberLevel) {
  240. that.isMember = res.data.memberLevel !== 'FREE'
  241. }
  242. }).catch(function() {})
  243. },
  244. loadGiftProgress() {
  245. var that = this
  246. getGiftMembershipProgress().then(function(res) {
  247. if (res.data && res.data.code === 200) {
  248. that.giftProgress = res.data.data || null
  249. }
  250. }).catch(function() {})
  251. },
  252. goUpgrade() {
  253. uni.navigateTo({ url: '/pages/membership/upgrade' })
  254. },
  255. loadCart() {
  256. if (this.loading) return
  257. this.loading = true
  258. var that = this
  259. uni.request({
  260. url: config.api('/api/cart/list'),
  261. method: 'POST',
  262. data: {},
  263. header: {
  264. 'Content-Type': 'application/json',
  265. 'Authorization': 'Bearer ' + uni.getStorageSync('token')
  266. },
  267. success: function(res) {
  268. that.loading = false
  269. that.refreshing = false
  270. if (res.data && res.data.code === 200) {
  271. var list = res.data.data || []
  272. for (var i = 0; i < list.length; i++) {
  273. list[i].checked = true
  274. list[i].subtotal = list[i].unitPrice * list[i].quantity
  275. }
  276. that.items = list
  277. }
  278. },
  279. fail: function() {
  280. that.loading = false
  281. that.refreshing = false
  282. uni.showToast({ title: '加载购物车失败', icon: 'none' })
  283. }
  284. })
  285. },
  286. onRefresh() {
  287. this.refreshing = true
  288. this.loadCart()
  289. },
  290. toggleSelectAll() {
  291. var newState = !this.selectAll
  292. for (var i = 0; i < this.items.length; i++) {
  293. this.items[i].checked = newState
  294. }
  295. },
  296. toggleItem(productId) {
  297. for (var i = 0; i < this.items.length; i++) {
  298. if (this.items[i].productId === productId) {
  299. this.items[i].checked = !this.items[i].checked
  300. break
  301. }
  302. }
  303. },
  304. increaseQty(item) {
  305. item.quantity = item.quantity + 1
  306. item.subtotal = item.unitPrice * item.quantity
  307. this.syncQty(item)
  308. },
  309. decreaseQty(item) {
  310. if (item.quantity <= 1) return
  311. item.quantity = item.quantity - 1
  312. item.subtotal = item.unitPrice * item.quantity
  313. this.syncQty(item)
  314. },
  315. syncQty(item) {
  316. uni.request({
  317. url: config.api('/api/cart/update'),
  318. method: 'POST',
  319. data: { productId: item.productId, quantity: item.quantity },
  320. header: {
  321. 'Content-Type': 'application/json',
  322. 'Authorization': 'Bearer ' + uni.getStorageSync('token')
  323. }
  324. })
  325. },
  326. onRemove(productId) {
  327. var that = this
  328. uni.showModal({
  329. title: '确认删除',
  330. content: '确定从购物车移除该商品吗?',
  331. success: function(confirm) {
  332. if (confirm.confirm) {
  333. uni.request({
  334. url: config.api('/api/cart/remove'),
  335. method: 'POST',
  336. data: { productId: productId },
  337. header: {
  338. 'Content-Type': 'application/json',
  339. 'Authorization': 'Bearer ' + uni.getStorageSync('token')
  340. },
  341. success: function(res) {
  342. if (res.data && res.data.code === 200) {
  343. uni.showToast({ title: '已移除', icon: 'success' })
  344. that.loadCart()
  345. }
  346. }
  347. })
  348. }
  349. }
  350. })
  351. },
  352. goCheckout() {
  353. if (this.selectedCount === 0) {
  354. uni.showToast({ title: '请选择商品', icon: 'none' })
  355. return
  356. }
  357. var selected = []
  358. for (var i = 0; i < this.items.length; i++) {
  359. if (this.items[i].checked) {
  360. var item = {
  361. productId: this.items[i].productId,
  362. productName: this.items[i].productName,
  363. coverImage: this.items[i].coverImage,
  364. unitPrice: this.items[i].unitPrice,
  365. quantity: this.items[i].quantity
  366. }
  367. if (this.items[i].skuId) {
  368. item.skuId = this.items[i].skuId
  369. }
  370. if (this.items[i].specDesc) {
  371. item.specDesc = this.items[i].specDesc
  372. }
  373. if (this.items[i].giftLevelName) {
  374. item.giftLevelName = this.items[i].giftLevelName
  375. }
  376. if (this.items[i].memberPrice) {
  377. item.memberPrice = this.items[i].memberPrice
  378. }
  379. selected.push(item)
  380. }
  381. }
  382. uni.setStorageSync('checkoutItems', selected)
  383. uni.navigateTo({ url: '/pages/shop/checkout/checkout' })
  384. },
  385. formatPriceWithSymbol(price) {
  386. if (price === null || price === undefined) return '0.00'
  387. return (Number(price) / 100).toFixed(2)
  388. },
  389. getImageUrl: function(path) {
  390. return config.API_BASE_URL + path
  391. }
  392. }
  393. }
  394. </script>
  395. <style scoped>
  396. .container {
  397. display: flex;
  398. flex-direction: column;
  399. height: 100vh;
  400. background: #f5f5f5;
  401. }
  402. .cart-list {
  403. flex: 1;
  404. height: calc(100vh - 120rpx);
  405. }
  406. .loading-wrap,
  407. .empty-wrap {
  408. display: flex;
  409. flex-direction: column;
  410. align-items: center;
  411. padding-top: 200rpx;
  412. }
  413. .loading-text {
  414. font-size: 26rpx;
  415. color: #999;
  416. }
  417. .empty-icon {
  418. font-size: 100rpx;
  419. margin-bottom: 30rpx;
  420. }
  421. .empty-text {
  422. font-size: 28rpx;
  423. color: #999;
  424. }
  425. .select-all-row {
  426. background: #fff;
  427. padding: 20rpx 30rpx;
  428. border-bottom: 1rpx solid #f0f0f0;
  429. }
  430. .checkbox-wrap {
  431. display: flex;
  432. align-items: center;
  433. }
  434. .checkbox {
  435. width: 36rpx;
  436. height: 36rpx;
  437. border-radius: 50%;
  438. border: 2rpx solid #ddd;
  439. display: flex;
  440. align-items: center;
  441. justify-content: center;
  442. margin-right: 12rpx;
  443. font-size: 24rpx;
  444. color: #fff;
  445. }
  446. .checkbox.checked {
  447. background: #F97316;
  448. border-color: #F97316;
  449. }
  450. .checkmark {
  451. color: #fff;
  452. font-weight: bold;
  453. }
  454. .select-all-text {
  455. font-size: 26rpx;
  456. color: #333;
  457. }
  458. .cart-item-card {
  459. display: flex;
  460. background: #fff;
  461. margin: 16rpx 20rpx;
  462. border-radius: 16rpx;
  463. padding: 20rpx;
  464. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  465. }
  466. .item-left {
  467. margin-right: 16rpx;
  468. }
  469. .item-image {
  470. width: 180rpx;
  471. height: 180rpx;
  472. border-radius: 12rpx;
  473. background: #f0f0f0;
  474. }
  475. .item-right {
  476. flex: 1;
  477. display: flex;
  478. flex-direction: column;
  479. justify-content: space-between;
  480. min-width: 0;
  481. }
  482. .item-header {
  483. display: flex;
  484. align-items: center;
  485. }
  486. .item-name {
  487. flex: 1;
  488. font-size: 26rpx;
  489. color: #333;
  490. overflow: hidden;
  491. text-overflow: ellipsis;
  492. white-space: nowrap;
  493. margin-left: 4rpx;
  494. }
  495. .item-spec {
  496. font-size: 22rpx;
  497. color: #999;
  498. display: block;
  499. margin-top: 4rpx;
  500. flex-basis: 100%;
  501. }
  502. .item-supplier {
  503. font-size: 20rpx;
  504. color: #0EA5E9;
  505. display: block;
  506. margin-top: 2rpx;
  507. flex-basis: 100%;
  508. }
  509. .item-delete {
  510. font-size: 32rpx;
  511. padding: 4rpx 8rpx;
  512. color: #ccc;
  513. }
  514. .item-bottom {
  515. display: flex;
  516. justify-content: space-between;
  517. align-items: center;
  518. margin-top: 12rpx;
  519. }
  520. .item-price {
  521. font-size: 28rpx;
  522. color: #F97316;
  523. font-weight: bold;
  524. }
  525. .stepper {
  526. display: flex;
  527. align-items: center;
  528. border: 1rpx solid #e0e0e0;
  529. border-radius: 8rpx;
  530. overflow: hidden;
  531. }
  532. .stepper-btn {
  533. width: 56rpx;
  534. height: 48rpx;
  535. text-align: center;
  536. line-height: 48rpx;
  537. font-size: 28rpx;
  538. color: #666;
  539. background: #fafafa;
  540. }
  541. .stepper-value {
  542. width: 64rpx;
  543. height: 48rpx;
  544. text-align: center;
  545. line-height: 48rpx;
  546. font-size: 26rpx;
  547. color: #333;
  548. border-left: 1rpx solid #e0e0e0;
  549. border-right: 1rpx solid #e0e0e0;
  550. }
  551. .item-subtotal {
  552. font-size: 22rpx;
  553. color: #999;
  554. text-align: right;
  555. margin-top: 8rpx;
  556. }
  557. .bottom-bar {
  558. position: fixed;
  559. bottom: 0;
  560. left: 0;
  561. right: 0;
  562. height: 100rpx;
  563. background: #fff;
  564. border-top: 1rpx solid #eee;
  565. display: flex;
  566. align-items: center;
  567. justify-content: space-between;
  568. padding: 0 30rpx;
  569. z-index: 100;
  570. }
  571. .bottom-left {
  572. display: flex;
  573. align-items: baseline;
  574. }
  575. .selected-count {
  576. font-size: 24rpx;
  577. color: #666;
  578. margin-right: 12rpx;
  579. }
  580. .total-amount-label {
  581. font-size: 24rpx;
  582. color: #666;
  583. }
  584. .total-amount {
  585. font-size: 36rpx;
  586. color: #F97316;
  587. font-weight: bold;
  588. }
  589. .checkout-btn {
  590. background: linear-gradient(135deg, #F97316, #FB923C);
  591. color: #fff;
  592. font-size: 28rpx;
  593. font-weight: bold;
  594. padding: 0 50rpx;
  595. height: 72rpx;
  596. line-height: 72rpx;
  597. border-radius: 36rpx;
  598. border: none;
  599. }
  600. .checkout-btn::after {
  601. border: none;
  602. }
  603. .checkout-btn.disabled {
  604. background: #ddd;
  605. color: #999;
  606. }
  607. /* Member Upgrade Hint */
  608. .member-hint {
  609. display: flex;
  610. align-items: center;
  611. padding: 20rpx 30rpx;
  612. background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  613. border-top: 2rpx solid #FED7AA;
  614. border-bottom: 2rpx solid #FED7AA;
  615. }
  616. .member-hint-icon {
  617. font-size: 32rpx;
  618. margin-right: 12rpx;
  619. }
  620. .member-hint-text {
  621. flex: 1;
  622. font-size: 26rpx;
  623. color: #C2410C;
  624. }
  625. .member-hint-action {
  626. font-size: 26rpx;
  627. color: #F97316;
  628. font-weight: 500;
  629. }
  630. .price-original {
  631. font-size: 22rpx;
  632. color: #94A3B8;
  633. text-decoration: line-through;
  634. }
  635. .price-estimate {
  636. font-size: 34rpx;
  637. font-weight: bold;
  638. color: #F97316;
  639. }
  640. /* Gift badge */
  641. .gift-badge {
  642. font-size: 20rpx;
  643. color: #F97316;
  644. background: #FFF7ED;
  645. padding: 2rpx 8rpx;
  646. border-radius: 6rpx;
  647. margin-left: 8rpx;
  648. border: 1rpx solid #FED7AA;
  649. }
  650. /* Member price */
  651. .item-member-price {
  652. font-size: 22rpx;
  653. color: #10B981;
  654. margin-left: 8rpx;
  655. }
  656. .item-price-wrap {
  657. display: flex;
  658. align-items: baseline;
  659. }
  660. /* Gift membership progress */
  661. .gift-progress-section {
  662. padding: 20rpx 30rpx;
  663. background: #FFF7ED;
  664. border-top: 2rpx solid #FED7AA;
  665. }
  666. .gift-progress-header {
  667. display: flex;
  668. align-items: center;
  669. margin-bottom: 16rpx;
  670. }
  671. .gift-progress-icon {
  672. font-size: 32rpx;
  673. margin-right: 12rpx;
  674. }
  675. .gift-progress-title {
  676. flex: 1;
  677. font-size: 26rpx;
  678. color: #C2410C;
  679. font-weight: 500;
  680. }
  681. .gift-progress-percent {
  682. font-size: 28rpx;
  683. color: #F97316;
  684. font-weight: bold;
  685. }
  686. .gift-progress-bar-bg {
  687. height: 20rpx;
  688. background: #FED7AA;
  689. border-radius: 10rpx;
  690. overflow: hidden;
  691. margin-bottom: 12rpx;
  692. }
  693. .gift-progress-bar-fill {
  694. height: 100%;
  695. background: linear-gradient(90deg, #F97316, #FB923C);
  696. border-radius: 10rpx;
  697. transition: width 0.3s ease;
  698. }
  699. .gift-progress-info {
  700. display: flex;
  701. justify-content: space-between;
  702. }
  703. .gift-progress-accumulated {
  704. font-size: 22rpx;
  705. color: #9A3412;
  706. }
  707. .gift-progress-remaining {
  708. font-size: 22rpx;
  709. color: #C2410C;
  710. font-weight: 500;
  711. }
  712. .gift-progress-level {
  713. margin-top: 12rpx;
  714. font-size: 22rpx;
  715. color: #F97316;
  716. }
  717. .gift-granted-hint {
  718. display: flex;
  719. align-items: center;
  720. padding: 20rpx 30rpx;
  721. background: #F0FDF4;
  722. border-top: 2rpx solid #BBF7D0;
  723. }
  724. .gift-granted-icon {
  725. font-size: 32rpx;
  726. margin-right: 12rpx;
  727. }
  728. .gift-granted-text {
  729. flex: 1;
  730. font-size: 26rpx;
  731. color: #15803D;
  732. }
  733. </style>