list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  1. <template>
  2. <view class="container mine clearfix">
  3. <view
  4. class="tui-header-box first"
  5. :style="{ height: isCmcustomClass == 'fiexd' ? CustomBar + 6 + 'px' : CustomBar + 6 + 'px' }"
  6. :class="isCmcustomClass"
  7. >
  8. <view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 20 + 'px' }"></view>
  9. <view class="header-sit">
  10. <text class="iconfont icon-fanhui" @click.stop="this.$api.navigateBack(1)"></text>
  11. <text class="header-sit-text">选择关联订单</text>
  12. </view>
  13. </view>
  14. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="7"></tui-skeleton>
  15. <view class="container-content" v-else>
  16. <view class="tui-header-tabs day clearfix" :style="{ top: CustomBar + 6 + 'px' }">
  17. <view class="tui-header-tabmain">
  18. <input
  19. class="input"
  20. type="text"
  21. v-model="listQuery.keyWord"
  22. confirm-type="search"
  23. @confirm="subMitSearch()"
  24. placeholder="请输入供应商名称"
  25. />
  26. <text class="iconfont icon-sousuo"></text>
  27. </view>
  28. </view>
  29. <view
  30. class="user-section"
  31. :style="{
  32. top: isIphoneX ? CustomBar + 66 + 'px' : CustomBar + 56 + 'px',
  33. left: 0 + 'px',
  34. paddingBottom: isIphoneX ? '178rpx' : '144rpx'
  35. }"
  36. >
  37. <view class="header-content">
  38. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="clearfix">
  39. <!-- 空白页 -->
  40. <empty v-if="isEmpty" :typeIndex="currents" :navbarHeight="navbarHeight"></empty>
  41. <!-- 列表 -->
  42. <view v-else class="tui-order-content">
  43. <view
  44. class="tui-order-item"
  45. v-for="(order, index) in orderList"
  46. :key="index"
  47. >
  48. <view class="list-title" @click.stop="orderDetail(order.mainOrder.orderId)">
  49. <view class="list-title-t">
  50. <view class="list-title-tip">
  51. <text class="badges">{{ order.mainOrder.orderType | formatOrderType }}</text>
  52. </view>
  53. <view class="list-title-tag" v-if="order.mainOrder.organizeId == 3">
  54. <text class="badges">维沙</text>
  55. </view>
  56. <view class="list-title-num">{{ order.mainOrder.status | stateExpFormat }}</view>
  57. </view>
  58. <view class="list-title-a">
  59. <view class="list-title-a-text">
  60. 子订单编号:<text class="text">{{ order.shopOrderNo }} ( {{ order.shopOrderId }} )</text>
  61. </view>
  62. <view class="list-title-a-text">
  63. 供应商名称:<text class="text">{{ order.shopName }}</text>
  64. </view>
  65. <view class="list-title-a-text">
  66. 订单金额:<text class="text">¥{{ order.needPayAmount | NumFormat }}</text>
  67. </view>
  68. </view>
  69. <view class="list-title-b">
  70. 客户名称:<text class="text">{{ order.mainOrder.userName ? order.mainOrder.userName : '无' }}</text>
  71. </view>
  72. <view class="list-title-b">
  73. 订单编号:<text class="text">{{ order.mainOrder.orderNo }} ( {{ order.mainOrder.orderId }} )</text>
  74. </view>
  75. <view class="list-title-b">
  76. 下单日期:<text class="text">{{ order.mainOrder.orderTime }}</text>
  77. </view>
  78. <view class="list-title-b">
  79. <view class="list-title-b-item ">
  80. 订单金额:<text class="text">¥{{ order.mainOrder.payTotalFee | NumFormat }}</text>
  81. </view>
  82. <view class="list-title-b-item ">
  83. 已收金额:<text class="text">¥{{ order.mainOrder.paidAmount | NumFormat }}</text>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="list-checked" @click="checkedOrder(order,index)">
  88. <text
  89. class="iconfont"
  90. :class="order.isChecked ? 'icon-yixuanze' : 'icon-weixuanze'"
  91. ></text>
  92. </view>
  93. <view class="list-detail" @click.stop="orderDetail(order.mainOrder.orderId)">
  94. <text class="iconfont icon-xiayibu"></text>
  95. </view>
  96. </view>
  97. <!--加载loadding-->
  98. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  99. <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text="nomoreText"></tui-nomore>
  100. <!--加载loadding-->
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. <view class="distinguish-button" :style="{ paddingBottom: isIphoneX ? '68rpx' : '24rpx' }" v-if="orderList.length>0">
  106. <view class="button" @click="confirmDistinguish">确定</view>
  107. </view>
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. import empty from '@/components/empty'
  113. import { mapState, mapMutations } from 'vuex'
  114. const defaultListQuery = {
  115. pageNum: 1, //页数
  116. pageSize: 10, //条数
  117. keyWord: '',
  118. }
  119. export default {
  120. components: {
  121. empty
  122. },
  123. data() {
  124. return {
  125. CustomBar: this.CustomBar, // 顶部导航栏高度
  126. isIphoneX: this.$store.state.isIphoneX,
  127. skeletonShow:true,
  128. listQuery: Object.assign({}, defaultListQuery),
  129. orderList: [],
  130. checkedOrderList: [],
  131. checkedIndex:'',
  132. scrollTop: 0,
  133. isEmpty: false,
  134. loadding: false,
  135. pullUpOn: true,
  136. hasNextPage: false,
  137. pullFlag: true,
  138. navbarHeight: '',
  139. nomoreText: '上拉显示更多',
  140. contentModalText: '', //操作文字提示语句
  141. modal: false,
  142. modal1: false,
  143. returnBrokerage:0,
  144. confirmParams:{
  145. shopOrderId:0,
  146. verbalAmount:'',
  147. rebateRemarks:''
  148. },
  149. rightDrawer: false,
  150. hanldReceipt: {}, //储存监听收款信息
  151. handleOperId: 0, //操作类型
  152. height: 64, //header高度
  153. top: 0, //标题图标距离顶部距离
  154. scrollH: 0, //滚动总高度
  155. opcity: 1
  156. }
  157. },
  158. onLoad() {
  159. let obj = {}
  160. uni.getSystemInfo({
  161. success: res => {
  162. this.width = obj.left || res.windowWidth
  163. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  164. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  165. this.scrollH = res.windowWidth * 0.6
  166. }
  167. })
  168. },
  169. computed: {
  170. ...mapState(['hasLogin']),
  171. },
  172. methods: {
  173. orderNoReceiptShoporderList() {
  174. // 收款详情-订单列表
  175. this.initListQuery()
  176. this.OrderService.orderNoReceiptShoporderList(this.listQuery)
  177. .then(response => {
  178. let data = response.data
  179. this.hasNextPage = response.data.hasNextPage
  180. if (data.list && data.list.length > 0) {
  181. this.isEmpty = false
  182. this.orderList = data.list.map((el, index) => {
  183. el.isChecked = false
  184. return el
  185. })
  186. this.pullFlag = false
  187. setTimeout(() => {
  188. this.pullFlag = true
  189. }, 500)
  190. if (this.hasNextPage) {
  191. this.pullUpOn = false
  192. this.nomoreText = '上拉显示更多'
  193. } else {
  194. if (this.orderList.length < 3) {
  195. this.pullUpOn = true
  196. this.loadding = false
  197. } else {
  198. this.pullUpOn = false
  199. this.loadding = false
  200. this.nomoreText = '已至底部'
  201. }
  202. }
  203. } else {
  204. this.isEmpty = true
  205. }
  206. this.skeletonShow = false
  207. })
  208. .catch(err => {
  209. this.$util.msg(err.msg, 2000)
  210. })
  211. },
  212. getOnReachBottomData(index) {
  213. //上拉加载
  214. this.listQuery.pageNum += 1
  215. this.OrderService.orderNoReceiptShoporderList(this.listQuery)
  216. .then(response => {
  217. let data = response.data
  218. if (data.list && data.list.length > 0) {
  219. this.hasNextPage = data.hasNextPage
  220. let list = data.list.map((el, index) => {
  221. el.isChecked = false
  222. return el
  223. })
  224. this.orderList = this.orderList.concat(list)
  225. this.pullFlag = false // 防上拉暴滑
  226. setTimeout(() => {
  227. this.pullFlag = true
  228. }, 500)
  229. if (this.hasNextPage) {
  230. this.pullUpOn = false
  231. this.nomoreText = '上拉显示更多'
  232. } else {
  233. this.pullUpOn = false
  234. this.loadding = false
  235. this.nomoreText = '已至底部'
  236. }
  237. }
  238. })
  239. .catch(error => {
  240. this.$util.msg(error.msg, 2000)
  241. })
  242. },
  243. subMitSearch() {
  244. // 确认搜索
  245. this.orderNoReceiptShoporderList()
  246. },
  247. confirmDistinguish() {
  248. // 点击确认
  249. const list = []
  250. this.checkedOrderList.forEach(el => {
  251. if (list.indexOf(el.userId) == -1) {
  252. list.push(el.userId)
  253. }
  254. })
  255. if (this.confirmParams.shopOrderId == 0) {
  256. this.$util.msg('请选择订单!', 2000)
  257. return
  258. }
  259. // 带参数返回
  260. var pages = getCurrentPages()
  261. var prevPage = pages[pages.length - 2] //上一个页面
  262. prevPage.setData({select:'select'})
  263. uni.navigateBack()
  264. },
  265. checkedOrder(order,index) {
  266. // 勾选关联订单
  267. this.checkedIndex = index
  268. this.orderList.forEach((el, index) => {
  269. if (this.checkedIndex == index) {
  270. el.isChecked = true
  271. this.confirmParams.shopOrderId = el.shopOrderId
  272. this.returnBrokerage = el.brokerage
  273. uni.setStorageSync('selectOrder',el)
  274. } else {
  275. el.isChecked = false
  276. }
  277. })
  278. console.log('shopOrderId',this.confirmParams.shopOrderId)
  279. console.log('returnBrokerage',this.returnBrokerage)
  280. },
  281. orderDetail(orderId) {
  282. //订单详情跳转
  283. this.$api.navigateTo(`/pages/relation/order/detail?orderId=${orderId}`)
  284. },
  285. initListQuery(){// 初始化
  286. this.orderList =[]
  287. this.loadding = true
  288. this.pullUpOn = true
  289. this.listQuery.pageNum = 1
  290. }
  291. },
  292. onPageScroll(e) {
  293. //实时获取到滚动的值
  294. if (e.scrollTop > 30) {
  295. this.isCmcustomClass = 'fiexd'
  296. } else {
  297. this.isCmcustomClass = 'left'
  298. }
  299. if (e.scrollTop > 180) {
  300. this.isShowHeader = true
  301. } else {
  302. this.isShowHeader = false
  303. }
  304. },
  305. onReachBottom() {
  306. if (this.hasNextPage) {
  307. this.loadding = true
  308. this.pullUpOn = true
  309. this.getOnReachBottomData()
  310. }
  311. },
  312. onPullDownRefresh() {
  313. setTimeout(() => {
  314. this.orderNoReceiptShoporderList()
  315. uni.stopPullDownRefresh()
  316. }, 200)
  317. },
  318. onShow() {
  319. this.orderNoReceiptShoporderList()
  320. }
  321. }
  322. </script>
  323. <style lang="scss">
  324. @import '@/uni.scss';
  325. page {
  326. background: #f7f7f7;
  327. }
  328. .tui-header-box {
  329. width: 100%;
  330. background: #ffffff;
  331. z-index: 999;
  332. position: fixed;
  333. top: 0;
  334. left: 0;
  335. background-size: cover;
  336. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  337. &.fiexd {
  338. }
  339. &.first {
  340. }
  341. }
  342. .header-top {
  343. width: 100%;
  344. font-size: 16px;
  345. font-weight: 500;
  346. height: 32px;
  347. display: flex;
  348. align-items: center;
  349. justify-content: center;
  350. position: relative;
  351. padding: 0 40rpx;
  352. }
  353. .header-sit {
  354. width: 100%;
  355. box-sizing: border-box;
  356. height: 80rpx;
  357. line-height: 80rpx;
  358. box-sizing: border-box;
  359. color: #ffffff;
  360. .header-sit-text {
  361. text-align: left;
  362. font-size: $font-size-40;
  363. font-weight: 600;
  364. font-family: '正楷';
  365. }
  366. .icon-fanhui {
  367. display: block;
  368. width: 80rpx;
  369. height: 80rpx;
  370. float: left;
  371. text-align: center;
  372. line-height: 80rpx;
  373. font-size: 42rpx;
  374. }
  375. }
  376. .tui-header-tabs {
  377. width: 100%;
  378. height: auto;
  379. margin-bottom: 40rpx;
  380. padding: 20rpx 24rpx;
  381. background: #ffffff;
  382. box-sizing: border-box;
  383. position: fixed;
  384. z-index: 999;
  385. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  386. .tui-header-tabmain {
  387. width: 100%;
  388. height: 70rpx;
  389. float: left;
  390. position: relative;
  391. .input {
  392. width: 100%;
  393. height: 70rpx;
  394. box-sizing: border-box;
  395. padding: 0 20rpx;
  396. padding-left: 70rpx;
  397. background: #f7f7f7;
  398. border-radius: 8rpx;
  399. font-size: $font-size-26;
  400. }
  401. .icon-sousuo {
  402. width: 80rpx;
  403. height: 70rpx;
  404. display: block;
  405. line-height: 70rpx;
  406. text-align: center;
  407. color: #999999;
  408. font-size: $font-size-38;
  409. position: absolute;
  410. left: 0;
  411. top: 0;
  412. }
  413. }
  414. .button-content {
  415. width: 100%;
  416. height: auto;
  417. float: left;
  418. position: relative;
  419. .btn {
  420. height: 64rpx;
  421. padding: 0 20rpx;
  422. margin: 10rpx 0 0 0;
  423. line-height: 64rpx;
  424. font-size: $font-size-26;
  425. text-align: center;
  426. border-radius: 6rpx;
  427. float: right;
  428. }
  429. .btn-confirm {
  430. background-color: #ff5000;
  431. color: #ffffff;
  432. }
  433. }
  434. }
  435. .distinguish-button {
  436. width: 100%;
  437. position: fixed;
  438. bottom: 0;
  439. left: 0;
  440. z-index: 9999;
  441. background-color: #ffffff;
  442. padding: 0 50rpx;
  443. padding-top: 20rpx;
  444. .button {
  445. width: 100%;
  446. height: 80rpx;
  447. background: $btn-confirm;
  448. border-radius: 40rpx;
  449. text-align: center;
  450. color: #ffffff;
  451. line-height: 80rpx;
  452. font-size: $font-size-28;
  453. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  454. }
  455. }
  456. .user-section {
  457. position: absolute;
  458. width: 100%;
  459. }
  460. .header-content {
  461. width: 100%;
  462. height: auto;
  463. position: relative;
  464. background-color: #f7f7f7;
  465. }
  466. .tui-order-list {
  467. margin-top: 24rpx;
  468. width: 100%;
  469. position: relative;
  470. box-sizing: border-box;
  471. padding: 0 20rpx;
  472. }
  473. .tui-order-content {
  474. width: 100%;
  475. height: auto;
  476. }
  477. .tui-order-item {
  478. display: flex;
  479. flex-direction: column;
  480. width: 100%;
  481. padding: 20rpx 20rpx;
  482. background: #fff;
  483. margin-bottom: 24rpx;
  484. border-radius: 8rpx;
  485. position: relative;
  486. .list-checked {
  487. width: 80rpx;
  488. height: 80rpx;
  489. line-height: 80rpx;
  490. text-align: center;
  491. position: absolute;
  492. right: 0;
  493. top: 0;
  494. .iconfont {
  495. font-size: 38rpx;
  496. color: $color-system;
  497. }
  498. }
  499. .list-detail {
  500. width: 70rpx;
  501. height: 80rpx;
  502. line-height: 80rpx;
  503. text-align: center;
  504. position: absolute;
  505. right: 0;
  506. bottom: 0;
  507. .iconfont {
  508. font-size: $font-size-32;
  509. color: #999999;
  510. }
  511. }
  512. }
  513. .list-title {
  514. width: 100%;
  515. height: auto;
  516. .list-title-t {
  517. width: 100%;
  518. height: 50rpx;
  519. float: left;
  520. font-size: $font-size-24;
  521. padding-bottom: 10rpx;
  522. .list-title-tip {
  523. float: left;
  524. .badges {
  525. display: block;
  526. float: left;
  527. padding: 0 15rpx;
  528. height: 40rpx;
  529. line-height: 40rpx;
  530. border-radius: 20rpx;
  531. background: rgba(248, 204, 148, 0.5);
  532. font-size: $font-size-24;
  533. text-align: center;
  534. color: #666666;
  535. }
  536. }
  537. .list-title-tag {
  538. float: left;
  539. margin-left: 20rpx;
  540. .badges {
  541. display: block;
  542. float: left;
  543. padding: 0 15rpx;
  544. height: 40rpx;
  545. line-height: 40rpx;
  546. border-radius: 20rpx;
  547. background: linear-gradient(270deg, #fee9ba 0%, #f0cb72 100%);
  548. font-size: $font-size-24;
  549. text-align: center;
  550. color: #666666;
  551. }
  552. }
  553. .list-title-num {
  554. float: left;
  555. text-align: left;
  556. color: #e15616;
  557. line-height: 40rpx;
  558. margin-left: 20rpx;
  559. }
  560. }
  561. .list-title-a {
  562. width: 100%;
  563. height: auto;
  564. float: left;
  565. padding: 5rpx 8rpx;
  566. border-radius: 4rpx;
  567. background-color: rgba(247, 247, 247, 1);
  568. margin-bottom: 10rpx;
  569. .text{
  570. color: #999999;
  571. }
  572. .list-title-a-text {
  573. width: 100%;
  574. height: 44rpx;
  575. float: left;
  576. font-size: $font-size-24;
  577. line-height: 44rpx;
  578. color: #666666;
  579. text-align: left;
  580. }
  581. }
  582. .list-title-b {
  583. width: 100%;
  584. height: 44rpx;
  585. float: left;
  586. font-size: $font-size-24;
  587. line-height: 44rpx;
  588. color: #666666;
  589. text-align: left;
  590. .text{
  591. color: #999999;
  592. }
  593. .list-title-b-item {
  594. width: 50%;
  595. height: 100%;
  596. float: left;
  597. }
  598. &.sms {
  599. height: auto;
  600. }
  601. }
  602. }
  603. .tui-prompt-title{
  604. line-height: 44rpx;
  605. text-align: center;
  606. }
  607. .tui-prompt-input{
  608. width: 100%;
  609. height: 80rpx;
  610. box-sizing: border-box;
  611. background: #f7f7f7;
  612. border-radius: 8rpx;
  613. padding:15rpx 20rpx;
  614. padding-left: 50rpx;
  615. margin: 20rpx 0;
  616. position: relative;
  617. .text{
  618. display: block;
  619. width: 50rpx;
  620. height: 80rpx;
  621. line-height: 80rpx;
  622. color: #666666;
  623. text-align: center;
  624. position: absolute;
  625. top: 0;
  626. left: 0;
  627. }
  628. .input {
  629. width: 100%;
  630. height: 100%;
  631. line-height: 80rpx;
  632. font-size: $font-size-26;
  633. color: $color-system;
  634. &.none{
  635. display: none;
  636. }
  637. }
  638. }
  639. .tui-prompt-flex{
  640. width: 100%;
  641. height: 70rpx;
  642. display: flex;
  643. margin-top: 20rpx;
  644. .btn{
  645. flex: 1;
  646. line-height: 70rpx;
  647. font-size: $font-size-26;
  648. text-align: center;
  649. color: #FFFFFF;
  650. border-radius: 33rpx;
  651. margin: 0 24rpx;
  652. &.btn-cancel{
  653. background: #F7F7F7;
  654. color: #999999;
  655. }
  656. &.btn-confirm{
  657. background: $color-system;
  658. }
  659. }
  660. }
  661. .tui-prompt-text{
  662. line-height: 44rpx;
  663. font-size: $font-size-26;
  664. color: #333333;
  665. .text{
  666. color: $color-system;
  667. }
  668. }
  669. </style>