order.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="content">
  3. <view class="tab-menu">
  4. <view :class="orderState==0?'tab-item active':'tab-item'" @click="orderStatus(0)">全部</view>
  5. <view :class="orderState==1?'tab-item active':'tab-item'" @click="orderStatus(1)">待使用</view>
  6. <view :class="orderState==2?'tab-item active':'tab-item'" @click="orderStatus(2)">已完成</view>
  7. <view :class="orderState==3?'tab-item active':'tab-item'" @click="orderStatus(3)">已退款</view>
  8. <view :class="orderState==6?'tab-item active':'tab-item'" @click="orderStatus(6)">已关闭</view>
  9. </view>
  10. <scroll-view class="order-body" scroll-y scroll-with-animation>
  11. <view class="order-list">
  12. <view class="order-item" v-for="(item,indx) in 10" :key="indx">
  13. <view class="item-header">
  14. <view class="item-store">
  15. <image src="/static/image/store.svg"></image>
  16. <text>桃奢妍奥莱城</text>
  17. </view>
  18. <view class="item-status success">已完成</view>
  19. </view>
  20. <view class="item-goods">
  21. <view class="image">
  22. <image src="https://washmy.oss-cn-guangzhou.aliyuncs.com/storage/20260727/2e9fd491e2def96b0dd0677f43d7a31913cf959e.png"></image>
  23. </view>
  24. <view class="info">
  25. <view class="title">
  26. <view class="name">赫莲娜/HR黑绷带50ml小露珠200ml两件套 线下兑换券</view>
  27. <view class="num">x1</view>
  28. </view>
  29. <view class="tags">
  30. 默认
  31. <view class="price">¥199.90</view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="item-time">
  36. <view class="time-list">订单编号:XM20260811082315</view>
  37. <view class="time-list">下单时间:2026-08-11 08:23</view>
  38. </view>
  39. <view class="item-footer">
  40. <view class="footer-left">实付 <text>¥199.90</text></view>
  41. <view class="footer-group-btn">
  42. <view :class="indx%2==0?'button border':'button warn'">继续支付</view>
  43. <view class="button fail">申请退款</view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </scroll-view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. orderState:0
  56. }
  57. },
  58. methods: {
  59. orderStatus(state) {
  60. this.orderState = state
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .content{
  67. position: fixed;
  68. z-index: 1;
  69. top: 0;
  70. left: 0;
  71. bottom: 0;
  72. right: 0;
  73. background-color: #ededed;
  74. display: flex;
  75. flex-direction: column;
  76. }
  77. .tab-menu{
  78. height: 80rpx;
  79. line-height: 80rpx;
  80. background-color: #fff;
  81. display: flex;
  82. align-items: center;
  83. font-size: 28rpx;
  84. color: #666;
  85. justify-content: space-around;
  86. .tab-item{
  87. position: relative;
  88. color: $main-text-color;
  89. &.active{
  90. color: $main-color;
  91. font-weight: 700;
  92. &::after{
  93. position: absolute;
  94. content: "";
  95. width: 30%;
  96. left: 35%;
  97. height: 4rpx;
  98. bottom: 0;
  99. background-color: $main-color;
  100. }
  101. }
  102. }
  103. }
  104. .order-body{
  105. height: 0;
  106. flex: 1;
  107. .order-list{
  108. .order-item{
  109. width: 95%;
  110. margin: 0 auto;
  111. background-color: #fff;
  112. padding: 20rpx;
  113. margin-top: 20rpx;
  114. border-radius: 10rpx;
  115. .item-footer{
  116. display: flex;
  117. align-items: center;
  118. justify-content: space-between;
  119. color: $main-text-color;
  120. font-size: 28rpx;
  121. .footer-left{
  122. text {
  123. font-size: 30rpx;
  124. font-weight: bold;
  125. color: $main-color;
  126. }
  127. }
  128. .footer-group-btn{
  129. display: flex;
  130. align-items: center;
  131. gap: 20rpx;
  132. .button{
  133. font-size: 24rpx;
  134. padding: 10rpx 20rpx;
  135. border-radius: 40rpx;
  136. display: flex;
  137. align-items: center;
  138. &.border{
  139. background-color: #fff;
  140. border: 2rpx solid #fed7aa;
  141. color: #f26428;
  142. }
  143. &.success{
  144. background-color: #d1fae5;
  145. color: #059669;
  146. }
  147. &.fail{
  148. background-color: #f1f5f9;
  149. color: #64748b;
  150. }
  151. &.danger{
  152. background-color: #fef3c7;
  153. color: #b45309;
  154. }
  155. &.warn{
  156. background-color: #fef3c7;
  157. color: #b45309;
  158. }
  159. }
  160. }
  161. }
  162. .item-time{
  163. background-color: #fff8f1;
  164. border-radius: 10rpx;
  165. margin: 20rpx 0;
  166. padding: 20rpx;
  167. .time-list{
  168. line-height: 48rpx;
  169. font-size: 24rpx;
  170. color: #64748b;
  171. }
  172. }
  173. .item-goods{
  174. display: flex;
  175. align-items: center;
  176. gap: 20rpx;
  177. background-color: #fff;
  178. margin-top: 20rpx;
  179. border-radius: 20rpx;
  180. .stock{
  181. text-align: right;
  182. }
  183. .image {
  184. height: 180rpx;
  185. overflow: hidden;display: flex;align-items: center;min-width: 180rpx;
  186. position: relative;
  187. image {
  188. width: 180rpx;
  189. border-radius: 10upx;
  190. height: 100%;
  191. }
  192. }
  193. .info{
  194. flex: 1 1 0%;
  195. overflow: hidden;
  196. .title{
  197. display: flex;
  198. align-items: center;
  199. justify-content: space-between;
  200. .name {
  201. overflow: hidden;
  202. text-overflow: ellipsis;
  203. font-size: 32rpx;
  204. display: -webkit-box;
  205. -webkit-line-clamp: 2;
  206. -webkit-box-orient: vertical;
  207. color: #333;
  208. font-weight: 900;
  209. }
  210. }
  211. .tags {
  212. color: #94a3b8;
  213. font-size: 24rpx;
  214. margin: 10rpx 0;
  215. display: flex;
  216. align-items: center;
  217. justify-content: space-between;
  218. .price {
  219. font-size: 28rpx;
  220. color: $main-text-color;
  221. font-weight: 600;
  222. }
  223. }
  224. }
  225. }
  226. .item-header{
  227. display: flex;
  228. align-items: center;
  229. justify-content: space-between;
  230. border-bottom: 2rpx solid #fff7ed;
  231. padding-bottom: 10rpx;
  232. .item-status{
  233. font-size: 24rpx;
  234. padding: 10rpx 20rpx;
  235. border-radius: 30rpx;
  236. &.success{
  237. background-color: #d1fae5;
  238. color: #059669;
  239. }
  240. &.fail{
  241. background-color: #f1f5f9;
  242. color: #64748b;
  243. }
  244. &.danger{
  245. background-color: #fef3c7;
  246. color: #b45309;
  247. }
  248. &.warn{
  249. background-color: #fef3c7;
  250. color: #b45309;
  251. }
  252. }
  253. .item-store{
  254. display: flex;
  255. align-items: center;
  256. gap: 15rpx;
  257. image {
  258. width: 40rpx;
  259. height: 40rpx;
  260. }
  261. }
  262. }
  263. }
  264. }
  265. }
  266. </style>