orderList.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="page" :style="{'min-height':(h)+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="订单列表"></c-nav-bar>
  4. <view class="query">
  5. <u-icon @click="show=true" name="calendar" label="自定义查询" labelPos="right" labelColor="#666" color="#666"
  6. space="10px" size="25px"></u-icon>
  7. </view>
  8. <view class="list">
  9. <view class="time">
  10. <text>{{date}}</text>
  11. </view>
  12. <view class="content">
  13. <view class="li first">
  14. <text>订单信息</text>
  15. <text>销量</text>
  16. <text>成交金额</text>
  17. </view>
  18. <view class="li" v-for="(item,index) in list" :key="index" @click="detail(item)">
  19. <view class="avatar">
  20. <image :src="item.pic"></image>
  21. <text>{{item.thingName}}</text>
  22. </view>
  23. <text>{{item.num}}</text>
  24. <text>¥{{item.price}}</text>
  25. </view>
  26. </view>
  27. </view>
  28. <u-datetime-picker @confirm="confirmDate" @cancel="show=false" :show="show" v-model="value1"
  29. mode="date"></u-datetime-picker>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. date: new Date().Format('yyyy-MM-dd'),
  37. show: false,
  38. value1: Number(new Date()),
  39. h: uni.getSystemInfoSync().windowHeight - 87,
  40. mt: uni.getSystemInfoSync().statusBarHeight + 44,
  41. list: [],
  42. }
  43. },
  44. onLoad(){
  45. this.getList();
  46. },
  47. methods: {
  48. confirmDate(e){
  49. // 创建一个Date对象并传入时间戳
  50. const date = new Date(e.value);
  51. // 使用Date对象的方法获取年、月、日、小时、分钟和秒
  52. const year = date.getFullYear();
  53. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  54. const day = ('0' + date.getDate()).slice(-2);
  55. // 格式化时间
  56. const formattedTime = `${year}-${month}-${day}`;
  57. this.date = formattedTime;
  58. this.getList();
  59. this.show = false;
  60. },
  61. getList(){
  62. this.$api.post('/merchant/merchantFisherman/home/getMerchantFishermanOrderList',{
  63. dateTime:this.date,
  64. dateType:'1',
  65. fishermanId:uni.getStorageSync('merchantId')
  66. }).then(res => {
  67. if (res.data.code === 0) {
  68. this.list = res.data.data;
  69. }
  70. })
  71. },
  72. detail(item) {
  73. let info=encodeURIComponent(JSON.stringify(item));
  74. uni.navigateTo({
  75. url: "/pagesHouse/home/orderBillDetail?info="+info
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="less" scoped>
  82. .page {
  83. background: #F5F8FA;
  84. padding-bottom: 40rpx;
  85. box-sizing: border-box;
  86. .query {
  87. height: 100rpx;
  88. display: flex;
  89. align-items: center;
  90. padding-left: 30rpx;
  91. background-color: #fff;
  92. }
  93. .list {
  94. width: calc(100% - 36rpx);
  95. margin: 20rpx auto;
  96. padding: 0 0 6rpx;
  97. .time {
  98. margin: 24rpx 0;
  99. color: #111;
  100. }
  101. .content {
  102. background-color: #fff;
  103. padding: 22rpx 20rpx 4rpx;
  104. border-radius: 24rpx;
  105. .li {
  106. display: grid;
  107. grid-template-columns: 60% 20% 20%;
  108. align-items: center;
  109. margin-bottom: 24rpx;
  110. text {
  111. color: #333;
  112. font-size: 26rpx;
  113. }
  114. .avatar {
  115. display: flex;
  116. align-items: center;
  117. image {
  118. width: 90rpx;
  119. min-width: 90rpx;
  120. height: 90rpx;
  121. margin-right: 20rpx;
  122. }
  123. text {
  124. width: 100px;
  125. word-break: break-all;
  126. text-overflow: ellipsis;
  127. display: -webkit-box;
  128. -webkit-box-orient: vertical;
  129. -webkit-line-clamp: 2;
  130. font-size: 24rpx;
  131. line-height: 33rpx;
  132. /* 这里是超出几行省略 */
  133. overflow: hidden;
  134. }
  135. }
  136. &.first {
  137. margin-bottom: 30rpx;
  138. text {
  139. color: #5A697C;
  140. }
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>