index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view>
  3. <view class="px-20">
  4. <view class="w-full h-72 rd-36rpx bg--w111-fff flex-y-center mt-10 mb-32 px-32">
  5. <text class="iconfont icon-ic_search text--w111-999"></text>
  6. <input v-model="params.keyword" class="pl-18 flex-1 line1 fs-28" placeholder="请输入要查询的订单"
  7. placeholder-class="text--w111-999" @confirm="searchSubmit" />
  8. </view>
  9. <view class="order_card bg--w111-fff rd-24rpx pt-32 pb-32 pl-24 pr-24"
  10. v-for="(item, index) in orderList" :key="index" @click="goOrderDetails(item.order_id)">
  11. <view class="flex-between-center">
  12. <view class="flex-y-center">
  13. <text class="fs-28 lh-40rpx text--w111-333 pl-16">订单号:{{item.order_id}}</text>
  14. </view>
  15. <view class="fs-26">
  16. <view class="text-num">
  17. <text class="text--w111-999" v-if="item.status == 3">已完成</text>
  18. <text v-else>{{item._status._title}}</text>
  19. <text v-if="item.refund.length">{{item.is_all_refund?',退款中':',部分退款中'}}</text>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="mt-26" v-if="item.cartInfo.length && item.cartInfo.length == 1">
  24. <view class="flex justify-between" v-for="(items, i) in item.cartInfo" :key="i">
  25. <view class="flex">
  26. <easy-loadimage
  27. mode="widthFix"
  28. :image-src="items.productInfo.image"
  29. width="136rpx"
  30. height="136rpx"
  31. borderRadius="16rpx"></easy-loadimage>
  32. <view class="ml-20">
  33. <view class="w-346 fs-28 text--w111-333 lh-40rpx line2"> {{items.productInfo.store_name }}
  34. </view>
  35. <view class="w-346 fs-24 text--w111-999 lh-34rpx line1 mt-12">{{items.productInfo.attrInfo.suk}}</view>
  36. </view>
  37. </view>
  38. <view>
  39. <baseMoney v-if="items.productInfo.attrInfo" :money="items.productInfo.attrInfo.price"
  40. symbolSize="20" integerSize="32" decimalSize="20" color="#333333" weight></baseMoney>
  41. <baseMoney v-else :money="items.productInfo.price" symbolSize="20" integerSize="32"
  42. decimalSize="20" incolor="#333333" weight></baseMoney>
  43. <view class="fs-24 text--w111-999 lh-34rpx text-right">共{{item.total_num}}件</view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="mt-26 relative" v-if="item.cartInfo.length && item.cartInfo.length > 1">
  48. <scroll-view scroll-x="true" class="white-nowrap vertical-middle w-560" show-scrollbar="false">
  49. <view class="inline-block mr-16" v-for="(items,i) in item.cartInfo" :key="i">
  50. <easy-loadimage
  51. mode="widthFix"
  52. :image-src="items.productInfo.image"
  53. width="136rpx"
  54. height="136rpx"
  55. borderRadius="16rpx"></easy-loadimage>
  56. </view>
  57. </scroll-view>
  58. <view class="abs-rt h-136 flex-col flex-center items-end">
  59. <baseMoney :money="item.pay_price" symbolSize="20" integerSize="32" decimalSize="20"
  60. color="#333333" weight></baseMoney>
  61. <view class="fs-24 text--w111-999 lh-34rpx text-right">共{{item.total_num}}件</view>
  62. </view>
  63. </view>
  64. </view>
  65. <block v-if="orderList.length == 0">
  66. <emptyPage title="暂无订单信息~" src="/statics/images/empty-box.png"></emptyPage>
  67. </block>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import { adminOrderRecordList } from "@/api/admin.js";
  73. import emptyPage from '@/components/emptyPage.vue';
  74. export default {
  75. data() {
  76. return {
  77. params:{
  78. page:1,
  79. limit:10,
  80. keyword:'',
  81. },
  82. orderList:[],
  83. status: false
  84. }
  85. },
  86. components: {
  87. emptyPage,
  88. },
  89. onLoad() {
  90. this.getList();
  91. },
  92. onPageScroll(object) {
  93. uni.$emit('scroll');
  94. },
  95. methods: {
  96. goOrderDetails(id){
  97. uni.navigateTo({
  98. url:'/pages/admin/orderDetail/index?id=' + id
  99. })
  100. },
  101. searchSubmit(){
  102. this.params.page = 1;
  103. this.status = false;
  104. this.orderList = [];
  105. this.getList();
  106. },
  107. getList(){
  108. let that = this;
  109. if (that.status) return;
  110. adminOrderRecordList(this.params).then(res => {
  111. let len = res.data.length;
  112. this.orderList = this.orderList.concat(res.data)
  113. that.params.page++;
  114. that.status = this.params.limit > len;
  115. that.params.page = that.params.page;
  116. }).catch(err=>{
  117. return this.$util.Tips({
  118. title: err
  119. });
  120. })
  121. },
  122. },
  123. onReachBottom(e) {
  124. this.getList()
  125. }
  126. }
  127. </script>
  128. <style lang="scss">
  129. .border_con {
  130. border: 1px solid $primary-admin;
  131. }
  132. .text-num{
  133. color: #FF7E00;
  134. }
  135. .abs-rt {
  136. position: absolute;
  137. top: 0;
  138. right: 0;
  139. }
  140. .order_card ~ .order_card{
  141. margin-top:20rpx;
  142. }
  143. </style>