铝交易,微信公众号
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.

178 lines
3.5 KiB

9 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
9 months ago
7 months ago
7 months ago
7 months ago
9 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
9 months ago
  1. <template>
  2. <view class="page">
  3. <view v-for="(item, index) in list"
  4. v-if="list.length>0"
  5. :key="index"
  6. class="content"
  7. @click="lookDetail(item, index)">
  8. <view class="box-flex">
  9. <view class="left">
  10. <image :src="item.pic" mode="aspectFill"/>
  11. </view>
  12. <view class="right">
  13. <view class="text-hidden-1">
  14. 订单状态{{ orderStatusText(item.orderFlag) }}
  15. </view>
  16. <view class="text-hidden-1">
  17. 公司名称{{ item.companyName }}
  18. </view>
  19. <view class="text-hidden-1">
  20. 单价{{ item.price }}
  21. </view>
  22. <view class="text-hidden-1">
  23. 购买数量{{ item.num }}
  24. </view>
  25. <view class="text-hidden-1">
  26. 规格{{ item.specsName }}
  27. </view>
  28. <view class="text-hidden-1">
  29. 提货地址{{ item.address }}
  30. </view>
  31. <!--<view class="text-hidden-1">-->
  32. <!-- 定金{{ item.deposit }}-->
  33. <!--</view>-->
  34. <view class="text-hidden-1">
  35. 提货时间{{ item.takeTime }}
  36. </view>
  37. <!--审核状态 0审核中 1 审核通过 2审核未通过-->
  38. <!--<view class="text-hidden-1">-->
  39. <!-- 审核状态{{ item.auditStatus == 0? '审核中' : (item.auditStatus == 1? '审核通过' : '审核未通过') }}-->
  40. <!--</view>-->
  41. </view>
  42. </view>
  43. <view class="bottom">
  44. <view class="uni-color-btn"
  45. v-if="item.orderFlag == 0"
  46. @click.stop="closeOrder(item.id)">
  47. 取消订单
  48. </view>
  49. </view>
  50. </view>
  51. <!--无历史记录-->
  52. <view v-else style="padding: 100rpx 0;">
  53. <uv-empty iconSize="100rpx" mode="history" textSize="28rpx" />
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. name: "myOrderList",
  60. props: {
  61. list: {
  62. type: Array,
  63. default: false
  64. },
  65. },
  66. data() {
  67. return {}
  68. },
  69. methods: {
  70. // 订单状态 0 未确认 1已确认 2已取消 3已付保证金 4 已退款 5已提货
  71. orderStatusText(flag) {
  72. const statusMap = {
  73. 0: '未确认',
  74. 1: '已确认',
  75. 2: '已取消',
  76. 3: '已付保证金',
  77. 4: '已退款',
  78. 5: '已提货'
  79. };
  80. return statusMap[flag] || '未知状态';
  81. },
  82. // 查看详情
  83. lookDetail(item, index) {
  84. this.$store.state.orderDetail = item
  85. uni.navigateTo({
  86. url: `/pages_order/order/myOrderDetail`
  87. });
  88. },
  89. // 取消订单
  90. closeOrder(orderId){
  91. let self = this
  92. uni.showModal({
  93. title: '确认取消订单吗?',
  94. success(e) {
  95. if (e.confirm) {
  96. self.$api('updateOrder', {
  97. orderId,
  98. type : 1
  99. }, res => {
  100. if (res.code == 200) {
  101. uni.showToast({
  102. title: '取消成功',
  103. icon: 'none'
  104. })
  105. self.$emit("getData")
  106. }
  107. })
  108. }
  109. }
  110. })
  111. },
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .page {
  117. display: flex;
  118. flex-direction: column;
  119. gap: 20rpx;
  120. height: calc(90vh - 180rpx);
  121. .content {
  122. margin: 10rpx 0;
  123. .box-flex{
  124. display: flex;
  125. height: calc(100% - 80px);
  126. .left {
  127. width: 200rpx;
  128. height: 100%;
  129. height: 100%;
  130. border-radius: 10rpx;
  131. image {
  132. width: 100%;
  133. height: 100%;
  134. border-radius: 10rpx;
  135. }
  136. }
  137. .right {
  138. width: calc(100% - 160rpx);
  139. color: #777;
  140. font-size: 24rpx;
  141. padding-left: 20rpx;
  142. line-height: 40rpx;
  143. background-color: #F8F8F8;
  144. }
  145. }
  146. .bottom{
  147. display: flex;
  148. justify-content: flex-end;
  149. gap: 20rpx;
  150. &>view{
  151. width: fit-content;
  152. font-size: 24rpx;
  153. padding: 10rpx 30rpx;
  154. }
  155. }
  156. }
  157. }
  158. </style>