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

193 lines
4.1 KiB

5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 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. <!--审核状态 0审核中 1 审核通过 2审核未通过-->
  42. <view class="tip">
  43. <img v-if="item.auditStatus==0" src="/pages_order/static/order/3.svg" style="width: 100%;height: 100%;" />
  44. <img v-if="item.auditStatus==1" src="/pages_order/static/order/1.svg" style="width: 100%;height: 100%;" />
  45. <img v-if="item.auditStatus==2" src="/pages_order/static/order/2.svg" style="width: 100%;height: 100%;" />
  46. </view>
  47. </view>
  48. </view>
  49. <view class="bottom">
  50. <view class="uni-color-btn"
  51. v-if="item.auditStatus == 0 && item.orderFlag < 2"
  52. @click.stop="closeOrder(item.id)">
  53. 取消订单
  54. </view>
  55. </view>
  56. </view>
  57. <!--无历史记录-->
  58. <view v-else style="padding: 100rpx 0;">
  59. <uv-empty iconSize="100rpx" mode="history" textSize="28rpx" />
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. export default {
  65. name: "myOrderList",
  66. props: {
  67. list: {
  68. type: Array,
  69. default: false
  70. },
  71. },
  72. data() {
  73. return {}
  74. },
  75. methods: {
  76. // 订单状态 0 未确认 1已确认 2已取消 3已付保证金 4 已退款 5已提货
  77. orderStatusText(flag) {
  78. const statusMap = {
  79. 0: '未确认',
  80. 1: '已确认',
  81. 2: '已取消',
  82. 3: '已付保证金',
  83. 4: '已退款',
  84. 5: '已提货'
  85. };
  86. return statusMap[flag] || '未知状态';
  87. },
  88. // 查看详情
  89. lookDetail(item, index) {
  90. this.$store.state.orderDetail = item
  91. uni.navigateTo({
  92. url: `/pages_order/order/myOrderDetail`
  93. });
  94. },
  95. // 取消订单
  96. closeOrder(orderId){
  97. let self = this
  98. uni.showModal({
  99. title: '确认取消订单吗?',
  100. success(e) {
  101. if (e.confirm) {
  102. self.$api('updateOrder', {
  103. orderId,
  104. type : 1
  105. }, res => {
  106. if (res.code == 200) {
  107. uni.showToast({
  108. title: '取消成功',
  109. icon: 'none'
  110. })
  111. self.$emit("getData")
  112. }
  113. })
  114. }
  115. }
  116. })
  117. },
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .page {
  123. display: flex;
  124. flex-direction: column;
  125. gap: 20rpx;
  126. // height: calc(90vh - 180rpx);
  127. .content {
  128. position: relative;
  129. margin: 10rpx 0;
  130. .box-flex{
  131. display: flex;
  132. height: calc(100% - 80px);
  133. .left {
  134. width: 200rpx;
  135. height: 100%;
  136. border-radius: 10rpx;
  137. flex-shrink: 0;
  138. image {
  139. width: 100%;
  140. height: 100%;
  141. border-radius: 10rpx;
  142. }
  143. }
  144. .right {
  145. width: calc(100% - 160rpx);
  146. color: #777;
  147. font-size: 24rpx;
  148. padding-left: 20rpx;
  149. line-height: 40rpx;
  150. background-color: #F8F8F8;
  151. }
  152. }
  153. .bottom{
  154. display: flex;
  155. justify-content: flex-end;
  156. gap: 20rpx;
  157. &>view{
  158. width: fit-content;
  159. font-size: 24rpx;
  160. padding: 10rpx 30rpx;
  161. }
  162. }
  163. }
  164. .tip {
  165. width: 80rpx;
  166. height: 80rpx;
  167. position: absolute;
  168. top: 20rpx;
  169. right: 20rpx;
  170. }
  171. }
  172. </style>