order.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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: '/user/page/merchant/orderDetail?id=' + e.order_id
  73. });
  74. },
  75. }
  76. };
  77. </script>
  78. <style lang="scss">
  79. page,.center {
  80. height: 100%;
  81. background: #f6f4f4;
  82. }
  83. .input-box {
  84. width: 100%;
  85. padding: 25rpx;
  86. background-color: #52c696;
  87. z-index: 999;
  88. height: 60px;
  89. .iconsearch {
  90. padding-left: 30%;
  91. font-size: 50rpx;
  92. color: #9f9f9f;
  93. }
  94. .input-content {
  95. border-radius: 99rpx;
  96. color: #9f9f9f;
  97. flex-grow: 1;
  98. padding: 10rpx 30rpx;
  99. background-color: #ffffff;
  100. .input {
  101. flex-grow: 1;
  102. input {
  103. font-size: $font-lg;
  104. }
  105. }
  106. }
  107. .input-button {
  108. padding-left: 20rpx;
  109. font-size: $font-lg;
  110. height: 100%;
  111. }
  112. }
  113. .main {
  114. padding: 30rpx 30rpx 60rpx 30rpx;
  115. width: 700rpx;
  116. margin: 20rpx auto 0;
  117. background: #ffffff;
  118. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  119. border-radius: 10rpx;
  120. .top {
  121. align-items: center;
  122. .userinfo {
  123. max-width: 70%;
  124. font-size: 24rpx;
  125. font-family: PingFang SC;
  126. font-weight: 400;
  127. color: #666666;
  128. }
  129. .type {
  130. font-size: 28rpx;
  131. font-family: PingFang SC;
  132. font-weight: 500;
  133. color: #52c696;
  134. }
  135. }
  136. .mainbox {
  137. display: flex;
  138. flex-direction: row;
  139. justify-content: flex-start;
  140. margin-top: 30rpx;
  141. align-items: flex-start;
  142. .bg {
  143. flex-shrink: 0;
  144. width: 160rpx;
  145. height: 160rpx;
  146. background: #4cd964;
  147. image {
  148. width: 100%;
  149. height: 100%;
  150. }
  151. }
  152. .main-info {
  153. justify-content: space-between;
  154. align-items: flex-start;
  155. width: 100%;
  156. .main-left {
  157. padding-left: 10rpx;
  158. .name {
  159. max-width: 338rpx;
  160. font-size: 26rpx;
  161. font-family: PingFang SC;
  162. font-weight: 500;
  163. color: #3f454b;
  164. }
  165. .order {
  166. margin-top: 10rpx;
  167. font-size: 24rpx;
  168. font-family: PingFang SC;
  169. font-weight: 400;
  170. color: #666666;
  171. }
  172. .ordertype {
  173. width: 120rpx;
  174. margin-top: 10rpx;
  175. background: #ffeae5;
  176. border-radius: 5rpx;
  177. font-size: 20rpx;
  178. font-family: PingFang SC;
  179. font-weight: 500;
  180. color: #ff6f0f;
  181. text-align: center;
  182. }
  183. }
  184. .main-right {
  185. text-align: right;
  186. padding-top: 6rpx;
  187. .price {
  188. font-size: 26rpx;
  189. font-family: PingFang SC;
  190. font-weight: 500;
  191. color: #333333;
  192. }
  193. .num {
  194. font-size: 26rpx;
  195. font-family: PingFang SC;
  196. font-weight: 500;
  197. color: #666666;
  198. }
  199. }
  200. }
  201. }
  202. .item-btm {
  203. text-align: right;
  204. font-size: 26rpx;
  205. font-family: PingFang SC;
  206. font-weight: 500;
  207. color: #333333;
  208. }
  209. }
  210. </style>