order.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="center">
  3. <view class="main" v-for="(item, index) in list" :key="index" @click="goToOrderDetail(item)">
  4. <view class="top flex">
  5. <view class="userinfo clamp">订单编号ID:{{ item.order_id }}</view>
  6. <view class="type">{{ item.status_name }}</view>
  7. </view>
  8. <view class="mainbox" v-for="(ls, ind) in item._info">
  9. <view class="bg"><image :src="ls.cart_info.productInfo.image" mode=""></image></view>
  10. <view class="main-info flex">
  11. <view class="main-left">
  12. <view class="name clamp2">{{ ls.cart_info.productInfo.store_name }}</view>
  13. </view>
  14. <view class="main-right">
  15. <view class="price">¥{{ ls.cart_info.productInfo.ot_price }}</view>
  16. <view class="num">x{{ ls.cart_info.cart_num }}</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="item-btm">共{{ item.total_num }}件商品 合计:¥{{ item.total_price }}</view>
  21. </view>
  22. <uni-load-more :status="loadType"></uni-load-more>
  23. <!-- </scroll-view> -->
  24. </view>
  25. </template>
  26. <script>
  27. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  28. import empty from '@/components/empty';
  29. import { merchantList } from '@/api/merchant.js';
  30. export default {
  31. components: {
  32. empty,
  33. uniLoadMore
  34. },
  35. data() {
  36. return {
  37. page: 1,
  38. limit: 10,
  39. loadType: 'more',
  40. list: [],
  41. maxheight: ''
  42. };
  43. },
  44. onReachBottom() {
  45. this.loadData();
  46. },
  47. onPullDownRefresh() {
  48. this.loadData();
  49. },
  50. onLoad() {
  51. this.loadData();
  52. },
  53. methods: {
  54. loadData() {
  55. const obj = this;
  56. if (obj.loadType == 'loading' || obj.loadType == 'noMore') {
  57. return;
  58. }
  59. obj.loadType = 'loading';
  60. merchantList({ page: obj.page, limit: obj.limit }).then(({ data }) => {
  61. obj.list = obj.list.concat(data);
  62. obj.page++;
  63. if (data.length == obj.limit) {
  64. obj.loadType = 'more';
  65. } else {
  66. obj.loadType = 'noMore';
  67. }
  68. });
  69. },
  70. goToOrderDetail(e) {
  71. uni.navigateTo({
  72. url: '/pages/merchant/orderDetail?id=' + e.order_id
  73. });
  74. }
  75. }
  76. };
  77. </script>
  78. <style lang="scss">
  79. page,
  80. .center {
  81. height: 100%;
  82. background: #f6f4f4;
  83. }
  84. .input-box {
  85. width: 100%;
  86. padding: 25rpx;
  87. background-color: #52c696;
  88. z-index: 999;
  89. height: 60px;
  90. .iconsearch {
  91. padding-left: 30%;
  92. font-size: 50rpx;
  93. color: #9f9f9f;
  94. }
  95. .input-content {
  96. border-radius: 99rpx;
  97. color: #9f9f9f;
  98. flex-grow: 1;
  99. padding: 10rpx 30rpx;
  100. background-color: #ffffff;
  101. .input {
  102. flex-grow: 1;
  103. input {
  104. font-size: $font-lg;
  105. }
  106. }
  107. }
  108. .input-button {
  109. padding-left: 20rpx;
  110. font-size: $font-lg;
  111. height: 100%;
  112. }
  113. }
  114. .main {
  115. padding: 30rpx 30rpx 60rpx 30rpx;
  116. width: 700rpx;
  117. margin: 20rpx auto 0;
  118. background: #ffffff;
  119. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  120. border-radius: 10rpx;
  121. .top {
  122. align-items: center;
  123. .userinfo {
  124. max-width: 70%;
  125. font-size: 24rpx;
  126. font-family: PingFang SC;
  127. font-weight: 400;
  128. color: #666666;
  129. }
  130. .type {
  131. font-size: 28rpx;
  132. font-family: PingFang SC;
  133. font-weight: 500;
  134. color: #52c696;
  135. }
  136. }
  137. .mainbox {
  138. display: flex;
  139. flex-direction: row;
  140. justify-content: flex-start;
  141. margin-top: 30rpx;
  142. align-items: flex-start;
  143. .bg {
  144. flex-shrink: 0;
  145. width: 160rpx;
  146. height: 160rpx;
  147. background: #4cd964;
  148. image {
  149. width: 100%;
  150. height: 100%;
  151. }
  152. }
  153. .main-info {
  154. justify-content: space-between;
  155. align-items: flex-start;
  156. width: 100%;
  157. .main-left {
  158. padding-left: 10rpx;
  159. .name {
  160. max-width: 338rpx;
  161. font-size: 26rpx;
  162. font-family: PingFang SC;
  163. font-weight: 500;
  164. color: #3f454b;
  165. }
  166. .order {
  167. margin-top: 10rpx;
  168. font-size: 24rpx;
  169. font-family: PingFang SC;
  170. font-weight: 400;
  171. color: #666666;
  172. }
  173. .ordertype {
  174. width: 120rpx;
  175. margin-top: 10rpx;
  176. background: #ffeae5;
  177. border-radius: 5rpx;
  178. font-size: 20rpx;
  179. font-family: PingFang SC;
  180. font-weight: 500;
  181. color: #ff6f0f;
  182. text-align: center;
  183. }
  184. }
  185. .main-right {
  186. text-align: right;
  187. padding-top: 6rpx;
  188. .price {
  189. font-size: 26rpx;
  190. font-family: PingFang SC;
  191. font-weight: 500;
  192. color: #333333;
  193. }
  194. .num {
  195. font-size: 26rpx;
  196. font-family: PingFang SC;
  197. font-weight: 500;
  198. color: #666666;
  199. }
  200. }
  201. }
  202. }
  203. .item-btm {
  204. text-align: right;
  205. font-size: 26rpx;
  206. font-family: PingFang SC;
  207. font-weight: 500;
  208. color: #333333;
  209. }
  210. }
  211. </style>