order.vue 5.2 KB

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