myorderRecord.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <view class="content">
  3. <scroll-view scroll-x="true" class="class-box flex b-t" :scroll-with-animation="true">
  4. <view class="navbar">
  5. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  6. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
  7. </view>
  8. </scroll-view>
  9. <view class="top-search flex">
  10. <view class="search-box flex">
  11. <image class="search-icon" src="../../static/icon/sousuo.png" mode=""></image>
  12. <view class="search-font"><input type="text" placeholder="请输入货号搜索" v-model="productname" /></view>
  13. </view>
  14. </view>
  15. <swiper :style="{ height: maxheight }" :current="tabCurrentIndex" class="swiper-box" duration="300"
  16. @change="changeTab">
  17. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  18. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  19. <!-- 空白页 -->
  20. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  21. <!-- 订单列表 -->
  22. <view v-for="(item,index) in 10">
  23. <view class="main">
  24. <view class="main-id">产品货号:9876543211025666</view>
  25. <view class="main-name">产品名称</view>
  26. <view class="main-info flex">
  27. <scroll-view scroll-x="true" class="main-price">
  28. <view class="image-box">
  29. <view class="image-item" v-for="(itm,ind) in 10">
  30. <image src="../../static/img/user-item2.png" mode=""></image>
  31. </view>
  32. </view>
  33. </scroll-view>
  34. <view class="main-more" @click="navTo('/pages/user/myorderDetail')">
  35. <view class="mainm-font">
  36. 查看详细
  37. </view>
  38. <image class="mainm-jt" src="../../static/img/jt.png" mode=""></image>
  39. </view>
  40. </view>
  41. <view class="main-num flex">
  42. <view class="mainnum-item">
  43. 收益: <text class="red">285</text>
  44. </view>
  45. <view class="mainnum-item">
  46. 提交日期:2022年2月10日
  47. </view>
  48. </view>
  49. <view class="main-num flex start">
  50. <view class="mainnum-item">
  51. 规格:
  52. </view>
  53. <view class="mainnum-item">
  54. 【黄色,37码,数量30】【黄色,37码,数量30】<br />
  55. 【黄色,37码,数量30】【黄色,37码,数量30】<br />
  56. 【黄色,37码,数量30】【黄色,37码,数量30】
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <uni-load-more :status="tabItem.loadingType"></uni-load-more>
  62. </scroll-view>
  63. </swiper-item>
  64. </swiper>
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. data() {
  70. return {
  71. productname: '',
  72. maxheight: '',
  73. tabCurrentIndex: 0,
  74. navList: [{
  75. state: 0,
  76. text: '合格记录',
  77. loadingType: 'more',
  78. orderList: [],
  79. page: 1, //当前页数
  80. limit: 10 //每次信息条数
  81. },
  82. {
  83. state: 1,
  84. text: '不合格记录',
  85. loadingType: 'more',
  86. orderList: [],
  87. page: 1, //当前页数
  88. limit: 10 //每次信息条数
  89. },
  90. ],
  91. };
  92. },
  93. onLoad() {},
  94. onShow() {},
  95. onReachBottom() {},
  96. onReady(res) {
  97. var _this = this;
  98. uni.getSystemInfo({
  99. success: resu => {
  100. const query = uni.createSelectorQuery();
  101. query.select('.swiper-box').boundingClientRect();
  102. query.exec(function(res) {
  103. _this.maxheight = resu.windowHeight - res[0].top + 'px';
  104. console.log('打印页面的剩余高度', _this.maxheight);
  105. });
  106. },
  107. fail: res => {}
  108. });
  109. },
  110. methods: {
  111. tabClick(index) {
  112. this.tabCurrentIndex = index;
  113. },
  114. changeTab(e) {
  115. this.tabCurrentIndex = e.target.current;
  116. // this.loadData('tabChange');
  117. },
  118. navTo(url) {
  119. uni.navigateTo({
  120. url
  121. })
  122. }
  123. }
  124. };
  125. </script>
  126. <style lang="scss">
  127. page,
  128. .content {
  129. min-height: 100%;
  130. height: auto;
  131. }
  132. .navbar {
  133. display: flex;
  134. height: 40px;
  135. padding: 0 5px;
  136. background: #fff;
  137. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  138. position: relative;
  139. z-index: 10;
  140. .nav-item {
  141. background: #fff;
  142. display: flex;
  143. justify-content: center;
  144. align-items: center;
  145. width: 50%;
  146. flex-shrink: 0;
  147. height: 100%;
  148. font-size: 15px;
  149. color: #9c9c9c;
  150. position: relative;
  151. &.current {
  152. color: #333333;
  153. &:after {
  154. content: '';
  155. position: absolute;
  156. left: 50%;
  157. bottom: 0;
  158. transform: translateX(-50%);
  159. width: 44px;
  160. height: 0;
  161. border-bottom: 2px solid #ff4c4c;
  162. }
  163. }
  164. }
  165. }
  166. .top-search {
  167. width: 750rpx;
  168. height: 100rpx;
  169. background: #FFFFFF;
  170. padding: 20rpx 32rpx 16rpx;
  171. .search-box {
  172. justify-content: center;
  173. width: 100%;
  174. height: 64rpx;
  175. background: #F6F6F6;
  176. border-radius: 34rpx;
  177. .search-icon {
  178. width: 32rpx;
  179. height: 32rpx;
  180. }
  181. .search-font {
  182. margin-left: 20rpx;
  183. font-size: 26rpx;
  184. font-family: PingFang SC;
  185. font-weight: 500;
  186. color: #666666;
  187. }
  188. }
  189. .search {
  190. font-size: 28rpx;
  191. font-family: PingFang SC;
  192. font-weight: 500;
  193. color: #666666;
  194. }
  195. }
  196. .list-scroll-content {
  197. height: 100%;
  198. }
  199. .main {
  200. width: 700rpx;
  201. background: #FFFFFF;
  202. border-radius: 24rpx;
  203. margin: 20rpx auto 0;
  204. padding: 0 15rpx;
  205. line-height: 1;
  206. .main-id {
  207. padding: 35rpx 14rpx 30rpx;
  208. font-size: 28rpx;
  209. font-family: PingFang SC;
  210. font-weight: 500;
  211. color: #666666;
  212. border-bottom: 1px solid #ededed;
  213. }
  214. .main-name {
  215. padding: 20rpx 14rpx 16rpx;
  216. font-size: 28rpx;
  217. font-family: PingFang SC;
  218. font-weight: 500;
  219. color: #363636;
  220. }
  221. .main-info {
  222. padding: 0 14rpx;
  223. .main-price {
  224. width: 480rpx;
  225. .image-box {
  226. display: flex;
  227. align-items: center;
  228. .image-item {
  229. margin-left: 10rpx;
  230. width: 110rpx;
  231. height: 110rpx;
  232. flex-shrink: 0;
  233. image {
  234. width: 100%;
  235. height: 100%;
  236. }
  237. }
  238. }
  239. }
  240. .main-more {
  241. display: flex;
  242. align-items: center;
  243. .mainm-font {
  244. margin-right: 10rpx;
  245. font-size: 26rpx;
  246. font-family: PingFang SC;
  247. font-weight: 500;
  248. color: #333333;
  249. }
  250. .mainm-jt {
  251. width: 12rpx;
  252. height: 22rpx;
  253. }
  254. }
  255. }
  256. .main-num {
  257. padding: 24rpx 14rpx 20rpx;
  258. border-bottom: 1px solid #ededed;
  259. .mainnum-item {
  260. font-size: 28rpx;
  261. font-family: PingFang SC;
  262. font-weight: 500;
  263. color: #333333;
  264. line-height: 1.5;
  265. .red {
  266. color: #FF4C4C
  267. }
  268. }
  269. }
  270. .start {
  271. align-items: flex-start;
  272. }
  273. .btn-box {
  274. display: flex;
  275. justify-content: space-around;
  276. align-items: center;
  277. padding: 20rpx 0;
  278. .box1 {
  279. width: 144rpx;
  280. height: 55rpx;
  281. border: 2px solid #EBEBEB;
  282. border-radius: 28rpx;
  283. display: flex;
  284. justify-content: center;
  285. align-items: center;
  286. font-size: 26rpx;
  287. font-family: PingFang SC;
  288. font-weight: 500;
  289. color: #999999;
  290. }
  291. .box2 {
  292. width: 144rpx;
  293. height: 55rpx;
  294. border: 2px solid #FF2D2D;
  295. border-radius: 28rpx;
  296. display: flex;
  297. justify-content: center;
  298. align-items: center;
  299. font-size: 26rpx;
  300. font-family: PingFang SC;
  301. font-weight: 500;
  302. color: #FF2D2D;
  303. }
  304. }
  305. }
  306. </style>