国外MOSE官网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

207 lines
4.6 KiB

2 days ago
12 hours ago
2 days ago
12 hours ago
2 days ago
12 hours ago
2 days ago
12 hours ago
2 days ago
12 hours ago
2 days ago
12 hours ago
2 days ago
12 hours ago
2 days ago
12 hours ago
2 days ago
12 hours ago
2 days ago
12 hours ago
2 days ago
  1. <template>
  2. <view class="goods-detail">
  3. <!-- 轮播图 -->
  4. <view class="banner-container">
  5. <uv-swiper
  6. indicator
  7. indicatorMode="dot"
  8. indicatorActiveColor="blue"
  9. height="700rpx"
  10. :list="goodsData.image ? goodsData.image.split(',') : []"></uv-swiper>
  11. </view>
  12. <!-- 商品信息 -->
  13. <view class="goods-info">
  14. <!-- 积分信息 -->
  15. <view class="points-section">
  16. <image src="/static/积分图标.png" class="points-icon" mode="aspectFit"></image>
  17. <text class="points-text">{{ goodsData.price }}积分</text>
  18. </view>
  19. <!-- 商品标题 -->
  20. <view class="title-section">
  21. <text class="goods-title">{{ goodsData.title }}</text>
  22. </view>
  23. </view>
  24. <!-- 商品详情独立容器 -->
  25. <view class="detail-container">
  26. <!-- 商品详情标题 -->
  27. <view class="detail-title-section">
  28. <rich-text :nodes="goodsData.details"></rich-text>
  29. </view>
  30. </view>
  31. <!-- 底部操作栏 - 只在待领取状态显示 -->
  32. <view v-if="status === 'pending'" class="bottom-bar">
  33. <view class="exchange-btn" @click="confirmReceive">
  34. <text class="exchange-text">确认取货</text>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. name: 'ExchangeDetail',
  42. data() {
  43. return {
  44. goodsId: '',
  45. status: 'pending', // pending: 待领取, received: 已领取, cancelled: 系统取消
  46. goodsData: {
  47. id: 1,
  48. title: '哪吒之魔童闹海新款首套装哪吒校内艺术手办树脂摆件学生小礼品',
  49. price: 100,
  50. category: '积分兑换',
  51. exchangeCount: 120,
  52. sales: 0,
  53. inventory: 50,
  54. details: '这是一款美味的薄脆小饼干,口感酥脆,营养丰富。采用优质原料制作,无添加剂,适合全家人享用。每一口都能感受到浓郁的香味和酥脆的口感,是您休闲时光的最佳选择。',
  55. image: '/static/商城_商品1.png,/static/商城_商品2.png,/static/bannerImage.png'
  56. }
  57. }
  58. },
  59. onLoad(options) {
  60. if (options.id) {
  61. this.goodsId = options.id;
  62. }
  63. if (options.status) {
  64. this.status = options.status;
  65. }
  66. this.getGoodsDetail(this.goodsId);
  67. },
  68. methods: {
  69. async getGoodsDetail(id) {
  70. const res = await this.$api.user.queryOrderById({ orderId: id })
  71. this.goodsData = res.result
  72. },
  73. previewImage(current, urls) {
  74. uni.previewImage({
  75. current: current,
  76. urls: urls
  77. });
  78. },
  79. confirmReceive() {
  80. uni.showModal({
  81. title: '确认取货',
  82. content: `确定已取货${this.goodsData.title}吗?`,
  83. success: (res) => {
  84. if (res.confirm) {
  85. // 执行确认取货逻辑
  86. uni.showToast({
  87. title: '取货成功',
  88. icon: 'success'
  89. });
  90. // 延迟返回上一页
  91. setTimeout(() => {
  92. uni.navigateBack();
  93. }, 1500);
  94. }
  95. }
  96. });
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .goods-detail {
  103. background: #f8f8f8;
  104. min-height: 100vh;
  105. padding-bottom: 120rpx; // 为底部固定栏留出空间
  106. }
  107. .banner-container {
  108. height: 700rpx;
  109. .banner-swiper {
  110. width: 100%;
  111. .banner-image {
  112. width: 100%;
  113. height: 100%;
  114. }
  115. }
  116. }
  117. .goods-info {
  118. background: #ffffff;
  119. margin-top: 20rpx;
  120. padding: 30rpx;
  121. }
  122. .points-section {
  123. display: flex;
  124. align-items: center;
  125. margin-bottom: 20rpx;
  126. .points-icon {
  127. width: 32rpx;
  128. height: 32rpx;
  129. margin-right: 8rpx;
  130. }
  131. .points-text {
  132. font-size: 32rpx;
  133. font-weight: bold;
  134. color: #1488DB;
  135. }
  136. }
  137. .title-section {
  138. margin-bottom: 40rpx;
  139. .goods-title {
  140. font-size: 28rpx;
  141. color: #333333;
  142. line-height: 1.5;
  143. display: block;
  144. }
  145. }
  146. .detail-container {
  147. background: #ffffff;
  148. margin-top: 20rpx;
  149. padding: 30rpx;
  150. margin-bottom: 120rpx;
  151. }
  152. .detail-title-section {
  153. display: flex;
  154. align-items: center;
  155. justify-content: center;
  156. margin-bottom: 30rpx;
  157. }
  158. .bottom-bar {
  159. position: fixed;
  160. bottom: 0;
  161. left: 0;
  162. right: 0;
  163. background: #ffffff;
  164. padding: 20rpx 30rpx;
  165. border-top: 1rpx solid #f0f0f0;
  166. z-index: 999;
  167. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
  168. display: flex;
  169. align-items: center;
  170. justify-content: center;
  171. .exchange-btn {
  172. width: 100%;
  173. height: 80rpx;
  174. border-radius: 40rpx;
  175. background-color: #218cdd;
  176. display: flex;
  177. align-items: center;
  178. justify-content: center;
  179. .exchange-text {
  180. color: #ffffff;
  181. font-size: 28rpx;
  182. }
  183. }
  184. }
  185. </style>