order.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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. var app;
  53. export default {
  54. data() {
  55. return {
  56. orderState:0
  57. }
  58. },
  59. onLoad() {
  60. app = this;
  61. },
  62. methods: {
  63. orderStatus(state) {
  64. this.orderState = state
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .content{
  71. position: fixed;
  72. z-index: 1;
  73. top: 0;
  74. left: 0;
  75. bottom: 0;
  76. right: 0;
  77. background-color: #ededed;
  78. display: flex;
  79. flex-direction: column;
  80. }
  81. .tab-menu{
  82. height: 80rpx;
  83. line-height: 80rpx;
  84. background-color: #fff;
  85. display: flex;
  86. align-items: center;
  87. font-size: 28rpx;
  88. color: #666;
  89. justify-content: space-around;
  90. .tab-item{
  91. position: relative;
  92. color: $main-text-color;
  93. &.active{
  94. color: $main-color;
  95. font-weight: 700;
  96. &::after{
  97. position: absolute;
  98. content: "";
  99. width: 30%;
  100. left: 35%;
  101. height: 4rpx;
  102. bottom: 0;
  103. background-color: $main-color;
  104. }
  105. }
  106. }
  107. }
  108. .order-body{
  109. height: 0;
  110. flex: 1;
  111. .order-list{
  112. .order-item{
  113. width: 95%;
  114. margin: 0 auto;
  115. background-color: #fff;
  116. padding: 20rpx;
  117. margin-top: 20rpx;
  118. border-radius: 10rpx;
  119. .item-footer{
  120. display: flex;
  121. align-items: center;
  122. justify-content: space-between;
  123. color: $main-text-color;
  124. font-size: 28rpx;
  125. .footer-left{
  126. text {
  127. font-size: 30rpx;
  128. font-weight: bold;
  129. color: $main-color;
  130. }
  131. }
  132. .footer-group-btn{
  133. display: flex;
  134. align-items: center;
  135. gap: 20rpx;
  136. .button{
  137. font-size: 24rpx;
  138. padding: 10rpx 20rpx;
  139. border-radius: 40rpx;
  140. display: flex;
  141. align-items: center;
  142. &.border{
  143. background-color: #fff;
  144. border: 2rpx solid #fed7aa;
  145. color: #f26428;
  146. }
  147. &.success{
  148. background-color: #d1fae5;
  149. color: #059669;
  150. }
  151. &.fail{
  152. background-color: #f1f5f9;
  153. color: #64748b;
  154. }
  155. &.danger{
  156. background-color: #fef3c7;
  157. color: #b45309;
  158. }
  159. &.warn{
  160. background-color: #fef3c7;
  161. color: #b45309;
  162. }
  163. }
  164. }
  165. }
  166. .item-time{
  167. background-color: #fff8f1;
  168. border-radius: 10rpx;
  169. margin: 20rpx 0;
  170. padding: 20rpx;
  171. .time-list{
  172. line-height: 48rpx;
  173. font-size: 24rpx;
  174. color: #64748b;
  175. }
  176. }
  177. .item-goods{
  178. display: flex;
  179. align-items: center;
  180. gap: 20rpx;
  181. background-color: #fff;
  182. margin-top: 20rpx;
  183. border-radius: 20rpx;
  184. .stock{
  185. text-align: right;
  186. }
  187. .image {
  188. height: 180rpx;
  189. overflow: hidden;display: flex;align-items: center;min-width: 180rpx;
  190. position: relative;
  191. image {
  192. width: 180rpx;
  193. border-radius: 10upx;
  194. height: 100%;
  195. }
  196. }
  197. .info{
  198. flex: 1 1 0%;
  199. overflow: hidden;
  200. .title{
  201. display: flex;
  202. align-items: center;
  203. justify-content: space-between;
  204. .name {
  205. overflow: hidden;
  206. text-overflow: ellipsis;
  207. font-size: 32rpx;
  208. display: -webkit-box;
  209. -webkit-line-clamp: 2;
  210. -webkit-box-orient: vertical;
  211. color: #333;
  212. font-weight: 900;
  213. }
  214. }
  215. .tags {
  216. color: #94a3b8;
  217. font-size: 24rpx;
  218. margin: 10rpx 0;
  219. display: flex;
  220. align-items: center;
  221. justify-content: space-between;
  222. .price {
  223. font-size: 28rpx;
  224. color: $main-text-color;
  225. font-weight: 600;
  226. }
  227. }
  228. }
  229. }
  230. .item-header{
  231. display: flex;
  232. align-items: center;
  233. justify-content: space-between;
  234. border-bottom: 2rpx solid #fff7ed;
  235. padding-bottom: 10rpx;
  236. .item-status{
  237. font-size: 24rpx;
  238. padding: 10rpx 20rpx;
  239. border-radius: 30rpx;
  240. &.success{
  241. background-color: #d1fae5;
  242. color: #059669;
  243. }
  244. &.fail{
  245. background-color: #f1f5f9;
  246. color: #64748b;
  247. }
  248. &.danger{
  249. background-color: #fef3c7;
  250. color: #b45309;
  251. }
  252. &.warn{
  253. background-color: #fef3c7;
  254. color: #b45309;
  255. }
  256. }
  257. .item-store{
  258. display: flex;
  259. align-items: center;
  260. gap: 15rpx;
  261. image {
  262. width: 40rpx;
  263. height: 40rpx;
  264. }
  265. }
  266. }
  267. }
  268. }
  269. }
  270. </style>