list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  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. } else {
  197. this.pullUpOn = false
  198. this.loadding = false
  199. this.nomoreText = '已至底部'
  200. }
  201. }
  202. } else {
  203. this.isEmpty = true
  204. }
  205. this.skeletonShow = false
  206. })
  207. .catch(err => {
  208. this.$util.msg(err.msg, 2000)
  209. })
  210. },
  211. getOnReachBottomData(index) {
  212. //上拉加载
  213. this.listQuery.pageNum += 1
  214. this.OrderService.orderNoReceiptShoporderList(this.listQuery)
  215. .then(response => {
  216. let data = response.data
  217. if (data.list && data.list.length > 0) {
  218. this.hasNextPage = data.hasNextPage
  219. let list = data.list.map((el, index) => {
  220. el.isChecked = false
  221. return el
  222. })
  223. this.orderList = this.orderList.concat(list)
  224. this.pullFlag = false // 防上拉暴滑
  225. setTimeout(() => {
  226. this.pullFlag = true
  227. }, 500)
  228. if (this.hasNextPage) {
  229. this.pullUpOn = false
  230. this.nomoreText = '上拉显示更多'
  231. } else {
  232. this.pullUpOn = false
  233. this.loadding = false
  234. this.nomoreText = '已至底部'
  235. }
  236. }
  237. })
  238. .catch(error => {
  239. this.$util.msg(error.msg, 2000)
  240. })
  241. },
  242. subMitSearch() {
  243. // 确认搜索
  244. this.orderNoReceiptShoporderList()
  245. },
  246. confirmDistinguish() {
  247. // 点击确认
  248. const list = []
  249. this.checkedOrderList.forEach(el => {
  250. if (list.indexOf(el.userId) == -1) {
  251. list.push(el.userId)
  252. }
  253. })
  254. if (this.confirmParams.shopOrderId == 0) {
  255. this.$util.msg('请选择订单!', 2000)
  256. return
  257. }
  258. // 带参数返回
  259. var pages = getCurrentPages()
  260. var prevPage = pages[pages.length - 2] //上一个页面
  261. prevPage.setData({select:'select'})
  262. uni.navigateBack()
  263. },
  264. checkedOrder(order,index) {
  265. // 勾选关联订单
  266. this.checkedIndex = index
  267. this.orderList.forEach((el, index) => {
  268. if (this.checkedIndex == index) {
  269. el.isChecked = true
  270. this.confirmParams.shopOrderId = el.shopOrderId
  271. this.returnBrokerage = el.brokerage
  272. uni.setStorageSync('selectOrder',el)
  273. } else {
  274. el.isChecked = false
  275. }
  276. })
  277. console.log('shopOrderId',this.confirmParams.shopOrderId)
  278. console.log('returnBrokerage',this.returnBrokerage)
  279. },
  280. orderDetail(orderId) {
  281. //订单详情跳转
  282. this.$api.navigateTo(`/pages/relation/order/detail?orderId=${orderId}`)
  283. },
  284. initListQuery(){// 初始化
  285. this.orderList =[]
  286. this.loadding = true
  287. this.pullUpOn = true
  288. this.listQuery.pageNum = 1
  289. }
  290. },
  291. onPageScroll(e) {
  292. //实时获取到滚动的值
  293. if (e.scrollTop > 30) {
  294. this.isCmcustomClass = 'fiexd'
  295. } else {
  296. this.isCmcustomClass = 'left'
  297. }
  298. if (e.scrollTop > 180) {
  299. this.isShowHeader = true
  300. } else {
  301. this.isShowHeader = false
  302. }
  303. },
  304. onReachBottom() {
  305. if (this.hasNextPage) {
  306. this.loadding = true
  307. this.pullUpOn = true
  308. this.getOnReachBottomData()
  309. }
  310. },
  311. onPullDownRefresh() {
  312. setTimeout(() => {
  313. this.orderNoReceiptShoporderList()
  314. uni.stopPullDownRefresh()
  315. }, 200)
  316. },
  317. onShow() {
  318. this.orderNoReceiptShoporderList()
  319. }
  320. }
  321. </script>
  322. <style lang="scss">
  323. @import '@/uni.scss';
  324. page {
  325. background: #f7f7f7;
  326. }
  327. .tui-header-box {
  328. width: 100%;
  329. background: #ffffff;
  330. z-index: 999;
  331. position: fixed;
  332. top: 0;
  333. left: 0;
  334. background-size: cover;
  335. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  336. &.fiexd {
  337. }
  338. &.first {
  339. }
  340. }
  341. .header-top {
  342. width: 100%;
  343. font-size: 16px;
  344. font-weight: 500;
  345. height: 32px;
  346. display: flex;
  347. align-items: center;
  348. justify-content: center;
  349. position: relative;
  350. padding: 0 40rpx;
  351. }
  352. .header-sit {
  353. width: 100%;
  354. box-sizing: border-box;
  355. height: 80rpx;
  356. line-height: 80rpx;
  357. box-sizing: border-box;
  358. color: #ffffff;
  359. .header-sit-text {
  360. text-align: left;
  361. font-size: $font-size-40;
  362. font-weight: 600;
  363. font-family: '正楷';
  364. }
  365. .icon-fanhui {
  366. display: block;
  367. width: 80rpx;
  368. height: 80rpx;
  369. float: left;
  370. text-align: center;
  371. line-height: 80rpx;
  372. font-size: 42rpx;
  373. }
  374. }
  375. .tui-header-tabs {
  376. width: 100%;
  377. height: auto;
  378. margin-bottom: 40rpx;
  379. padding: 20rpx 24rpx;
  380. background: #ffffff;
  381. box-sizing: border-box;
  382. position: fixed;
  383. z-index: 999;
  384. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  385. .tui-header-tabmain {
  386. width: 100%;
  387. height: 70rpx;
  388. float: left;
  389. position: relative;
  390. .input {
  391. width: 100%;
  392. height: 70rpx;
  393. box-sizing: border-box;
  394. padding: 0 20rpx;
  395. padding-left: 70rpx;
  396. background: #f7f7f7;
  397. border-radius: 8rpx;
  398. font-size: $font-size-26;
  399. }
  400. .icon-sousuo {
  401. width: 80rpx;
  402. height: 70rpx;
  403. display: block;
  404. line-height: 70rpx;
  405. text-align: center;
  406. color: #999999;
  407. font-size: $font-size-38;
  408. position: absolute;
  409. left: 0;
  410. top: 0;
  411. }
  412. }
  413. .button-content {
  414. width: 100%;
  415. height: auto;
  416. float: left;
  417. position: relative;
  418. .btn {
  419. height: 64rpx;
  420. padding: 0 20rpx;
  421. margin: 10rpx 0 0 0;
  422. line-height: 64rpx;
  423. font-size: $font-size-26;
  424. text-align: center;
  425. border-radius: 6rpx;
  426. float: right;
  427. }
  428. .btn-confirm {
  429. background-color: #ff5000;
  430. color: #ffffff;
  431. }
  432. }
  433. }
  434. .distinguish-button {
  435. width: 100%;
  436. position: fixed;
  437. bottom: 0;
  438. left: 0;
  439. z-index: 9999;
  440. background-color: #ffffff;
  441. padding: 0 50rpx;
  442. padding-top: 20rpx;
  443. .button {
  444. width: 100%;
  445. height: 80rpx;
  446. background: $btn-confirm;
  447. border-radius: 40rpx;
  448. text-align: center;
  449. color: #ffffff;
  450. line-height: 80rpx;
  451. font-size: $font-size-28;
  452. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  453. }
  454. }
  455. .user-section {
  456. position: absolute;
  457. width: 100%;
  458. }
  459. .header-content {
  460. width: 100%;
  461. height: auto;
  462. position: relative;
  463. background-color: #f7f7f7;
  464. }
  465. .tui-order-list {
  466. margin-top: 24rpx;
  467. width: 100%;
  468. position: relative;
  469. box-sizing: border-box;
  470. padding: 0 20rpx;
  471. }
  472. .tui-order-content {
  473. width: 100%;
  474. height: auto;
  475. }
  476. .tui-order-item {
  477. display: flex;
  478. flex-direction: column;
  479. width: 100%;
  480. padding: 20rpx 20rpx;
  481. background: #fff;
  482. margin-bottom: 24rpx;
  483. border-radius: 8rpx;
  484. position: relative;
  485. .list-checked {
  486. width: 80rpx;
  487. height: 80rpx;
  488. line-height: 80rpx;
  489. text-align: center;
  490. position: absolute;
  491. right: 0;
  492. top: 0;
  493. .iconfont {
  494. font-size: 38rpx;
  495. color: $color-system;
  496. }
  497. }
  498. .list-detail {
  499. width: 70rpx;
  500. height: 80rpx;
  501. line-height: 80rpx;
  502. text-align: center;
  503. position: absolute;
  504. right: 0;
  505. bottom: 0;
  506. .iconfont {
  507. font-size: $font-size-32;
  508. color: #999999;
  509. }
  510. }
  511. }
  512. .list-title {
  513. width: 100%;
  514. height: auto;
  515. .list-title-t {
  516. width: 100%;
  517. height: 50rpx;
  518. float: left;
  519. font-size: $font-size-24;
  520. padding-bottom: 10rpx;
  521. .list-title-tip {
  522. float: left;
  523. .badges {
  524. display: block;
  525. float: left;
  526. padding: 0 15rpx;
  527. height: 40rpx;
  528. line-height: 40rpx;
  529. border-radius: 20rpx;
  530. background: rgba(248, 204, 148, 0.5);
  531. font-size: $font-size-24;
  532. text-align: center;
  533. color: #666666;
  534. }
  535. }
  536. .list-title-tag {
  537. float: left;
  538. margin-left: 20rpx;
  539. .badges {
  540. display: block;
  541. float: left;
  542. padding: 0 15rpx;
  543. height: 40rpx;
  544. line-height: 40rpx;
  545. border-radius: 20rpx;
  546. background: linear-gradient(270deg, #fee9ba 0%, #f0cb72 100%);
  547. font-size: $font-size-24;
  548. text-align: center;
  549. color: #666666;
  550. }
  551. }
  552. .list-title-num {
  553. float: left;
  554. text-align: left;
  555. color: #e15616;
  556. line-height: 40rpx;
  557. margin-left: 20rpx;
  558. }
  559. }
  560. .list-title-a {
  561. width: 100%;
  562. height: auto;
  563. float: left;
  564. padding: 5rpx 8rpx;
  565. border-radius: 4rpx;
  566. background-color: rgba(247, 247, 247, 1);
  567. margin-bottom: 10rpx;
  568. .text{
  569. color: #999999;
  570. }
  571. .list-title-a-text {
  572. width: 100%;
  573. height: 44rpx;
  574. float: left;
  575. font-size: $font-size-24;
  576. line-height: 44rpx;
  577. color: #666666;
  578. text-align: left;
  579. }
  580. }
  581. .list-title-b {
  582. width: 100%;
  583. height: 44rpx;
  584. float: left;
  585. font-size: $font-size-24;
  586. line-height: 44rpx;
  587. color: #666666;
  588. text-align: left;
  589. .text{
  590. color: #999999;
  591. }
  592. .list-title-b-item {
  593. width: 50%;
  594. height: 100%;
  595. float: left;
  596. }
  597. &.sms {
  598. height: auto;
  599. }
  600. }
  601. }
  602. .tui-prompt-title{
  603. line-height: 44rpx;
  604. text-align: center;
  605. }
  606. .tui-prompt-input{
  607. width: 100%;
  608. height: 80rpx;
  609. box-sizing: border-box;
  610. background: #f7f7f7;
  611. border-radius: 8rpx;
  612. padding:15rpx 20rpx;
  613. padding-left: 50rpx;
  614. margin: 20rpx 0;
  615. position: relative;
  616. .text{
  617. display: block;
  618. width: 50rpx;
  619. height: 80rpx;
  620. line-height: 80rpx;
  621. color: #666666;
  622. text-align: center;
  623. position: absolute;
  624. top: 0;
  625. left: 0;
  626. }
  627. .input {
  628. width: 100%;
  629. height: 100%;
  630. line-height: 80rpx;
  631. font-size: $font-size-26;
  632. color: $color-system;
  633. &.none{
  634. display: none;
  635. }
  636. }
  637. }
  638. .tui-prompt-flex{
  639. width: 100%;
  640. height: 70rpx;
  641. display: flex;
  642. margin-top: 20rpx;
  643. .btn{
  644. flex: 1;
  645. line-height: 70rpx;
  646. font-size: $font-size-26;
  647. text-align: center;
  648. color: #FFFFFF;
  649. border-radius: 33rpx;
  650. margin: 0 24rpx;
  651. &.btn-cancel{
  652. background: #F7F7F7;
  653. color: #999999;
  654. }
  655. &.btn-confirm{
  656. background: $color-system;
  657. }
  658. }
  659. }
  660. .tui-prompt-text{
  661. line-height: 44rpx;
  662. font-size: $font-size-26;
  663. color: #333333;
  664. .text{
  665. color: $color-system;
  666. }
  667. }
  668. </style>