scrap.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <template>
  2. <view class="content">
  3. <view class="navbar">
  4. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  5. :class="{ current: tabCurrentIndex == index }" @click="tabClick(index)">{{ item.text }}</view>
  6. </view>
  7. <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300"
  8. @change="changeTab">
  9. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  10. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  11. <!-- 空白页 -->
  12. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  13. <view class="main" v-for="(item,index) in 10">
  14. <view class="main-id flex">
  15. <view class="">产品货号:9876543211025666</view>
  16. <view class="type1" v-if="tabCurrentIndex != 3">
  17. {{tabCurrentIndex ==2?'未同意':'未分责'}}
  18. </view>
  19. <view class="type2" v-else>
  20. 已分责
  21. </view>
  22. </view>
  23. <view class="main-name flex">
  24. <view class="">产品名称</view>
  25. </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">
  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" v-if="tabCurrentIndex !=0 && tabCurrentIndex!=1">
  42. <view class="mainnum-item">
  43. 处理时间:2022年10月30日
  44. </view>
  45. <view class="mainnum-item">
  46. 金额:<text class="red">¥200</text>
  47. </view>
  48. </view>
  49. <view class="main-num flex" v-if="tabCurrentIndex ==3">
  50. <view class="mainnum-item">
  51. 处理数量: <text class="red">285</text>
  52. </view>
  53. <view class="mainnum-item">
  54. 处理人:李丹丹
  55. </view>
  56. </view>
  57. <view class="main-num flex">
  58. <view class="mainnum-item">
  59. 检验员:拉丹丹
  60. </view>
  61. <view class="mainnum-item">
  62. 提交人:李丹丹(组长)
  63. </view>
  64. </view>
  65. <view class="main-num flex" v-if="tabCurrentIndex ==3">
  66. <view class="mainnum-item gray">
  67. 责任人1(李丹丹):
  68. </view>
  69. <view class="mainnum-item red">
  70. 20%
  71. </view>
  72. </view>
  73. <view class="main-num flex" v-if="tabCurrentIndex ==3">
  74. <view class="mainnum-item gray">
  75. 责任人2(李丹丹):
  76. </view>
  77. <view class="mainnum-item red">
  78. 80%
  79. </view>
  80. </view>
  81. <view class="main-tip" v-if="tabCurrentIndex ==2">
  82. 反馈理由:责任分配不对,请重新填写,李丹丹的责任应为20%,请重新修改。
  83. </view>
  84. <view class=" bottom flex" v-if="tabCurrentIndex !=3">
  85. <view class="bottom-font">
  86. {{tabCurrentIndex==2?'处理数量':'不合格数量'}}:<text class="red">285</text>
  87. </view>
  88. <view class="btn-box" @click.stop="navTo('/pages/scrap/dispose')">
  89. <view class="box2">
  90. {{tabCurrentIndex==2?'修改处理':'立即处理'}}
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. <!-- 订单列表 -->
  96. <uni-load-more :status="tabItem.loadingType"></uni-load-more>
  97. </scroll-view>
  98. </swiper-item>
  99. </swiper>
  100. </view>
  101. </template>
  102. <script>
  103. export default {
  104. data() {
  105. return {
  106. tabCurrentIndex: 0,
  107. height: '',
  108. navList: [{
  109. state: 1,
  110. text: '全部',
  111. loadingType: 'more',
  112. orderList: [],
  113. page: 1, //当前页数
  114. limit: 10 //每次信息条数
  115. },
  116. {
  117. state: 2,
  118. text: '未分责',
  119. loadingType: 'more',
  120. orderList: [],
  121. page: 1, //当前页数
  122. limit: 10 //每次信息条数
  123. },
  124. {
  125. state: 3,
  126. text: '处理中',
  127. loadingType: 'more',
  128. orderList: [],
  129. page: 1, //当前页数
  130. limit: 10 //每次信息条数
  131. },
  132. {
  133. state: 4,
  134. text: '已分责',
  135. loadingType: 'more',
  136. orderList: [],
  137. page: 1, //当前页数
  138. limit: 10 //每次信息条数
  139. },
  140. ],
  141. };
  142. },
  143. onLoad() {},
  144. onShow() {},
  145. onReachBottom() {},
  146. onReady(res) {
  147. var _this = this;
  148. uni.getSystemInfo({
  149. success: resu => {
  150. const query = uni.createSelectorQuery();
  151. query.select('.swiper-box').boundingClientRect();
  152. query.exec(function(res) {
  153. _this.height = resu.windowHeight - res[0].top + 'px';
  154. console.log('打印页面的剩余高度', _this.height);
  155. });
  156. },
  157. fail: res => {}
  158. });
  159. },
  160. methods: {
  161. //swiper 切换
  162. changeTab(e) {
  163. this.tabCurrentIndex = e.target.current;
  164. this.loadData('tabChange');
  165. },
  166. //顶部tab点击
  167. tabClick(index) {
  168. this.tabCurrentIndex = index;
  169. },
  170. navTo(url) {
  171. uni.navigateTo({
  172. url
  173. })
  174. }
  175. }
  176. };
  177. </script>
  178. <style lang="scss">
  179. page,
  180. .content {
  181. min-height: 100%;
  182. height: auto;
  183. }
  184. .navbar {
  185. display: flex;
  186. height: 40px;
  187. padding: 0 5px;
  188. background: #fff;
  189. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  190. position: relative;
  191. z-index: 10;
  192. .nav-item {
  193. flex: 1;
  194. display: flex;
  195. justify-content: center;
  196. align-items: center;
  197. height: 100%;
  198. font-size: 15px;
  199. color: #999999;
  200. position: relative;
  201. &.current {
  202. color: #333333;
  203. &:after {
  204. content: '';
  205. position: absolute;
  206. left: 50%;
  207. bottom: 0;
  208. transform: translateX(-50%);
  209. width: 44px;
  210. height: 0;
  211. border-bottom: 2px solid #FF4C4C;
  212. }
  213. }
  214. }
  215. }
  216. .swiper-box {
  217. padding-top: 10rpx;
  218. }
  219. .main {
  220. width: 700rpx;
  221. background: #FFFFFF;
  222. border-radius: 24rpx;
  223. margin: 20rpx auto 0;
  224. padding: 0 15rpx;
  225. line-height: 1;
  226. .main-id {
  227. padding: 35rpx 14rpx 30rpx;
  228. font-size: 28rpx;
  229. font-family: PingFang SC;
  230. font-weight: 500;
  231. color: #666666;
  232. border-bottom: 1px solid #ededed;
  233. }
  234. .type1 {
  235. font-size: 26rpx;
  236. font-family: PingFang SC;
  237. font-weight: 500;
  238. color: #FF2D2D;
  239. }
  240. .type2 {
  241. font-size: 26rpx;
  242. font-family: PingFang SC;
  243. font-weight: 500;
  244. color: #999999;
  245. }
  246. .main-name {
  247. padding: 20rpx 14rpx 16rpx;
  248. font-size: 28rpx;
  249. font-family: PingFang SC;
  250. font-weight: 500;
  251. color: #363636;
  252. }
  253. .main-info {
  254. padding: 0 14rpx;
  255. .main-price {
  256. width: 480rpx;
  257. .image-box {
  258. display: flex;
  259. align-items: center;
  260. .image-item {
  261. margin-left: 10rpx;
  262. width: 110rpx;
  263. height: 110rpx;
  264. flex-shrink: 0;
  265. image {
  266. width: 100%;
  267. height: 100%;
  268. }
  269. }
  270. }
  271. }
  272. .main-more {
  273. display: flex;
  274. align-items: center;
  275. .mainm-font {
  276. margin-right: 10rpx;
  277. font-size: 26rpx;
  278. font-family: PingFang SC;
  279. font-weight: 500;
  280. color: #333333;
  281. }
  282. .mainm-jt {
  283. width: 12rpx;
  284. height: 22rpx;
  285. }
  286. }
  287. }
  288. .main-num {
  289. padding: 24rpx 14rpx 20rpx;
  290. border-bottom: 1px solid #ededed;
  291. .mainnum-item {
  292. font-size: 28rpx;
  293. font-family: PingFang SC;
  294. font-weight: 500;
  295. color: #333333;
  296. }
  297. .red {
  298. color: #FF4C4C
  299. }
  300. .gray {
  301. color: #666666;
  302. }
  303. }
  304. .main-tip {
  305. padding: 24rpx 14rpx 20rpx;
  306. border-bottom: 1px solid #ededed;
  307. font-size: 28rpx;
  308. font-family: PingFang SC;
  309. font-weight: 500;
  310. color: #666666;
  311. line-height: 1.5;
  312. }
  313. .bottom {
  314. padding: 20rpx 0;
  315. .btn-box {
  316. display: flex;
  317. justify-content: flex-end;
  318. align-items: center;
  319. }
  320. .bottom-font {
  321. font-size: 28rpx;
  322. font-family: PingFang SC;
  323. font-weight: 500;
  324. color: #333333;
  325. .red {
  326. color: #FF4C4C
  327. }
  328. }
  329. .box2 {
  330. margin-left: 10rpx;
  331. width: 144rpx;
  332. height: 55rpx;
  333. border: 2px solid #FF2D2D;
  334. border-radius: 28rpx;
  335. display: flex;
  336. justify-content: center;
  337. align-items: center;
  338. font-size: 26rpx;
  339. font-family: PingFang SC;
  340. font-weight: 500;
  341. color: #FF2D2D;
  342. }
  343. }
  344. }
  345. </style>