detail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. <template>
  2. <view class="container mine clearfix">
  3. <!-- <cu-custom :navbar-data='nvabarData' @navigateBack="hanldNavigateBack"></cu-custom> -->
  4. <view class="tui-header-box first"
  5. :style="{ height: isCmcustomClass == 'fiexd' ? CustomBar + 10 + 'px' : CustomBar + 30 + 'px' }"
  6. :class="isCmcustomClass">
  7. <view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 30 + 'px' }"></view>
  8. <view class="header-sit">
  9. <text class="iconfont icon-shouye1" v-if="isShareType" @click.stop="this.$api.navigateLinkJump()"></text>
  10. <text class="iconfont icon-fanhui" v-else @click.stop="this.$api.navigateBack(1)"></text>
  11. <text class="header-sit-text">返佣详情</text>
  12. </view>
  13. </view>
  14. <view class="tui-header-box"
  15. :style="{ height: CustomBar + 30 + 'px', backgroundImage: 'url(https://static.caimei365.com/app/crm/image/statistic_bg1.png)' }">
  16. </view>
  17. <tui-skeleton
  18. v-if="skeletonShow"
  19. backgroundColor="#fafafa"
  20. borderRadius="10rpx"
  21. :isLoading="true"
  22. :loadingType="7"
  23. />
  24. <view class="distinguish-section" v-else :style="{ top: CustomBar - 4 + 'px', left: 0 + 'px' }">
  25. <view class="distinguish-section-conten">
  26. <view class="section-top">
  27. <view class="title">
  28. <view class="title-text">收款信息</view>
  29. </view>
  30. <!-- <view class="button" @click="toNoSms('/pages/collection/list')">
  31. <text class="iconfont icon-wodedingdan"></text>
  32. 收款列表
  33. </view> -->
  34. </view>
  35. <view class="section-top-item">
  36. <view class="list-title-t">
  37. <view class="list-title-tip">
  38. <text class="badges">{{ receiptInfo.receiptType | formatReceiptType }}款</text>
  39. </view>
  40. </view>
  41. <view class="list-title-b">
  42. 收款金额:<text class="text">¥{{ receiptInfo.receiptAmount | NumFormat }}</text>
  43. </view>
  44. <view class="list-title-b">
  45. 收款账号:<text class="text">{{ receiptInfo.payTypeText }}</text>
  46. </view>
  47. <view class="list-title-b">
  48. 款时间:<text class="text">{{ receiptInfo.receiptDate }}</text>
  49. </view>
  50. <view class="list-title-b">收款短信:</view>
  51. <view class="list-title-b sms">
  52. <text class="text">{{ receiptInfo.smsContent ? receiptInfo.smsContent : '无' }}</text>
  53. </view>
  54. </view>
  55. <view class="section-title">关联订单</view>
  56. <view class="section-mid">
  57. <view
  58. class="tui-order-item"
  59. v-for="(order, index) in shopOrderList"
  60. :key="index"
  61. >
  62. <view class="list-title" @click.stop="orderDetail(order.shopOrderId)">
  63. <view class="list-title-t">
  64. <view class="list-title-tip">
  65. <text
  66. class="badges"
  67. :class="{
  68. success: order.orderType === 1,
  69. warning: order.orderType === 0
  70. }"
  71. >{{ order.orderType | formatOrderType }}</text
  72. >
  73. <text class="badgesb" v-if="order.secondHandOrderFlag ==1">二手</text>
  74. </view>
  75. <view class="list-title-tag">
  76. <text class="badges">{{ order.organizeId | organizeName }}</text>
  77. </view>
  78. <view class="list-title-num">{{ order.status | stateExpFormat }}</view>
  79. </view>
  80. <view class="list-title-a">
  81. <view class="list-title-a-text">
  82. 子订单编号:<text class="text">{{ order.shopOrderNo }} ( {{ order.shopOrderId }} )</text>
  83. </view>
  84. <view class="list-title-a-text">
  85. 供应商名称:<text class="text">{{ order.shopName }}</text>
  86. </view>
  87. <view class="list-title-a-text">
  88. 订单金额:<text class="text">¥{{ order.needPayAmount | NumFormat }}</text>
  89. </view>
  90. </view>
  91. <view class="list-title-b">
  92. 客户名称:<text class="text">{{ order.userName ? order.userName : '无' }}</text>
  93. </view>
  94. <view class="list-title-b">
  95. 下单日期:<text class="text">{{ order.orderTime }}</text>
  96. </view>
  97. <view class="list-title-b">
  98. <view class="list-title-b-item ">
  99. 应收金额:<text class="text">¥{{ order.needPayAmount | NumFormat }}</text>
  100. </view>
  101. <view class="list-title-b-item ">
  102. 已收金额:<text class="text">¥{{ order.receiptAmount | NumFormat }}</text>
  103. </view>
  104. </view>
  105. </view>
  106. <view class="list-detail" @click.stop="orderDetail(order.shopOrderId)">
  107. <text class="iconfont icon-xiayibu"></text>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="section-title">状态</view>
  112. <view class="section-mid">
  113. <view class="list-title">
  114. <view class="list-title-b">进度:<text
  115. :style="{ color: formatColor(receiptInfo.receiptStatus) }">{{ receiptInfo.receiptStatusText }}</text>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </template>
  123. <script>
  124. import {
  125. mapState,
  126. mapMutations
  127. } from 'vuex'
  128. export default {
  129. data() {
  130. return {
  131. isIphoneX: this.$store.state.isIphoneX,
  132. CustomBar: this.CustomBar, // 顶部导航栏高度
  133. height: 64, //header高度
  134. top: 0, //标题图标距离顶部距离
  135. scrollH: 0, //滚动总高度
  136. opcity: 1,
  137. isCmcustomClass: 'left',
  138. skeletonShow:true,
  139. orderList:[],
  140. listQuery:{
  141. pageNum: 1, //页数
  142. pageSize: 10, //条数
  143. id: 0,
  144. shopName: '',
  145. },
  146. nvabarData: {
  147. //顶部自定义导航
  148. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  149. showSearch: 0,
  150. title: '', // 导航栏 中间的标题
  151. haveBack: false,
  152. home: false,
  153. textLeft: this.$store.state.isIphone,
  154. bgColor: '#D33020',
  155. textColor: '#ffffff'
  156. },
  157. receiptInfo: {},
  158. receiptId: 0,
  159. isShareType:false
  160. }
  161. },
  162. onLoad(option) {
  163. let obj = {}
  164. // #ifdef MP-WEIXIN
  165. obj = wx.getMenuButtonBoundingClientRect()
  166. // #endif
  167. // #ifdef MP-BAIDU
  168. obj = swan.getMenuButtonBoundingClientRect()
  169. // #endif
  170. // #ifdef MP-ALIPAY
  171. my.hideAddToDesktopMenu()
  172. // #endif
  173. uni.getSystemInfo({
  174. success: res => {
  175. this.width = obj.left || res.windowWidth
  176. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  177. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  178. this.scrollH = res.windowWidth * 0.6
  179. }
  180. })
  181. if(option.type == 'share'){ this.isShareType = true }
  182. this.receiptId = this.listQuery.id = option.id
  183. this.getOrderReceiptDetail(this.receiptId)
  184. this.getOrderReceiptRebateOrders()
  185. },
  186. computed: {
  187. ...mapState(['hasLogin'])
  188. },
  189. methods: {
  190. getOrderReceiptDetail(id) {
  191. // 收款详情
  192. this.OrderService.orderReceiptRebateDetails({ id: id })
  193. .then(response => {
  194. this.receiptInfo = response.data
  195. })
  196. .catch(err => {
  197. this.$api.navigateTo('/pages/login/login-error')
  198. })
  199. },
  200. getOrderReceiptRebateOrders() {// 收款详情-订单列表
  201. this.OrderService.orderReceiptRebateOrders(this.listQuery)
  202. .then(response => {
  203. let data = response.data
  204. if (data.list && data.list.length > 0) {
  205. this.shopOrderList = data.list
  206. }
  207. setTimeout(()=>{
  208. this.skeletonShow = false
  209. },1000)
  210. })
  211. .catch(err => {
  212. this.$util.msg(err.msg, 2000)
  213. })
  214. },
  215. orderDetail(shopOrderId) {
  216. //订单详情跳转
  217. this.$api.navigateTo(`/pages/relation/order/detail?shopOrderId=${shopOrderId}`)
  218. },
  219. toNoSms(url) {
  220. this.$api.navigateTo(url)
  221. },
  222. formatColor(state) {
  223. //设置邀请码状态亚瑟
  224. let stateColor = '',
  225. stateColorObject = {
  226. 1: '#ff7900',
  227. 2: '#4cd964',
  228. 3: '#19be6b',
  229. 4: '#ed3f14',
  230. 5: '#F74D54'
  231. }
  232. Object.keys(stateColorObject).forEach(function(key) {
  233. if (key == state) {
  234. stateColor = stateColorObject[key]
  235. }
  236. })
  237. return stateColor
  238. },
  239. formatReceiptType(value) {
  240. //订单状态文字和颜色
  241. var HtmlStateText = '',
  242. stateTextObject = {
  243. 1: '订单款',
  244. 2: '非订单款',
  245. 3: '返佣款',
  246. 4: '订单款或者非订单款',
  247. 5: '供应商退款'
  248. }
  249. Object.keys(stateTextObject).forEach(function(key) {
  250. if (key == value) {
  251. HtmlStateText = stateTextObject[key]
  252. }
  253. })
  254. return HtmlStateText
  255. },
  256. },
  257. onPageScroll(e) {
  258. //实时获取到滚动的值
  259. // if (e.scrollTop > 30) {
  260. // this.isCmcustomClass = 'fiexd'
  261. // } else {
  262. // this.isCmcustomClass = 'left'
  263. // }
  264. },
  265. onPullDownRefresh() {
  266. setTimeout(() => {
  267. this.getOrderReceiptDetail(this.receiptId)
  268. uni.stopPullDownRefresh()
  269. }, 200)
  270. },
  271. onShareAppMessage(res) {
  272. //分享购买优惠券
  273. const receipt = this.receiptInfo
  274. const receiptTypeText = this.formatReceiptType(receipt.receiptType)
  275. if (res.from === 'button') {
  276. // console.log('来自页面内转发按钮')
  277. }
  278. return {
  279. title: `¥${receipt.receiptAmount.toFixed(2)} | ${receipt.receiptDate} | ${receipt.receiptStatusText}(${receiptTypeText})`,
  280. path: `/pages/login/login-share?id=${receipt.id}`,
  281. imageUrl: 'https://static.caimei365.com/app/crm/image/icon-share@2x.jpg'
  282. }
  283. },
  284. onShow() {
  285. }
  286. }
  287. </script>
  288. <style lang="scss">
  289. @import '@/uni.scss';
  290. page {
  291. background: #fff;
  292. }
  293. .tui-header-box {
  294. width: 100%;
  295. background: #ffffff;
  296. z-index: 999;
  297. background-size: cover;
  298. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  299. &.fiexd {
  300. position: fixed;
  301. top: 0;
  302. left: 0;
  303. }
  304. }
  305. .header-top {
  306. width: 100%;
  307. font-size: 16px;
  308. font-weight: 500;
  309. height: 32px;
  310. display: flex;
  311. align-items: center;
  312. justify-content: center;
  313. position: relative;
  314. padding: 0 40rpx;
  315. }
  316. .header-sit {
  317. width: 100%;
  318. box-sizing: border-box;
  319. height: 80rpx;
  320. line-height: 80rpx;
  321. box-sizing: border-box;
  322. color: #ffffff;
  323. .header-sit-text {
  324. text-align: left;
  325. font-size: $font-size-40;
  326. font-weight: 600;
  327. font-family: '正楷';
  328. }
  329. .iconfont {
  330. display: block;
  331. width: 80rpx;
  332. height: 80rpx;
  333. float: left;
  334. text-align: center;
  335. line-height: 80rpx;
  336. font-size: 42rpx;
  337. }
  338. .icon-iconfonticonfontsousuo1 {
  339. font-size: 42rpx;
  340. margin-left: 30rpx;
  341. }
  342. }
  343. .mine {
  344. width: 100%;
  345. height: 100%;
  346. position: relative;
  347. }
  348. .distinguish-section {
  349. width: 100%;
  350. position: absolute;
  351. padding: 40rpx 20rpx;
  352. box-sizing: border-box;
  353. }
  354. .distinguish-section-conten {
  355. width: 100%;
  356. height: auto;
  357. position: relative;
  358. background-color: #ffffff;
  359. border-radius: 20rpx;
  360. padding: 20rpx;
  361. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  362. .section-top {
  363. width: 100%;
  364. height: 66rpx;
  365. box-sizing: border-box;
  366. .title {
  367. float: left;
  368. height: 66rpx;
  369. padding: 13rpx 0;
  370. .title-text{
  371. float: left;
  372. line-height: 40rpx;
  373. height: 40rpx;
  374. color: #333333;
  375. text-align: left;
  376. font-weight: 600;
  377. font-size: $font-size-30;
  378. }
  379. }
  380. .button {
  381. float: right;
  382. box-sizing: border-box;
  383. padding: 0 24rpx;
  384. height: 100%;
  385. line-height: 66rpx;
  386. background: $btn-confirm;
  387. border-radius: 8rpx;
  388. text-align: center;
  389. color: #ffffff;
  390. }
  391. }
  392. .section-top-item {
  393. width: 100%;
  394. height: auto;
  395. margin-top: 10rpx;
  396. position: relative;
  397. float: left;
  398. .list-title-t {
  399. width: 100%;
  400. height: 50rpx;
  401. float: left;
  402. font-size: $font-size-28;
  403. padding-bottom: 10rpx;
  404. .list-title-tip {
  405. float: left;
  406. .badges {
  407. display: block;
  408. float: left;
  409. padding: 0 15rpx;
  410. height: 36rpx;
  411. line-height: 36rpx;
  412. border-radius: 18rpx;
  413. background: #ecf5ff;
  414. font-size: $font-size-22;
  415. text-align: center;
  416. color: #409eff;
  417. }
  418. }
  419. }
  420. .list-title-b {
  421. width: 100%;
  422. height: 44rpx;
  423. float: left;
  424. font-size: $font-size-24;
  425. line-height: 44rpx;
  426. color: #666666;
  427. text-align: left;
  428. .text{
  429. color: #999999;
  430. }
  431. .list-title-b-item {
  432. width: 50%;
  433. height: 100%;
  434. float: left;
  435. }
  436. &.sms {
  437. height: auto;
  438. padding: 10rpx;
  439. border-radius: 4rpx;
  440. background: #F7F7F7;
  441. }
  442. }
  443. .list-icon {
  444. width: 120rpx;
  445. height: 60rpx;
  446. border: 1px solid #e1e1e1;
  447. border-radius: 10rpx;
  448. text-align: center;
  449. font-size: 20rpx;
  450. line-height: 60rpx;
  451. position: absolute;
  452. right: 90rpx;
  453. top: 40rpx;
  454. color: #dd524d;
  455. z-index: 99;
  456. transform: rotate(45deg);
  457. -webkit-transform: rotate(45deg);
  458. -moz-transform: rotate(45deg);
  459. font-family: '正楷';
  460. }
  461. }
  462. .section-title {
  463. width: 100%;
  464. height: 66rpx;
  465. float: left;
  466. font-size: $font-size-28;
  467. line-height: 66rpx;
  468. color: #333333;
  469. text-align: left;
  470. font-weight: 600;
  471. }
  472. .section-mid {
  473. width: 100%;
  474. height: auto;
  475. display: flex;
  476. flex-direction: column;
  477. position: relative;
  478. border-radius: 0 0 20rpx 20rpx;
  479. .tui-order-item{
  480. display: flex;
  481. flex-direction: column;
  482. width: 100%;
  483. background: #fff;
  484. position: relative;
  485. .list-title {
  486. width: 100%;
  487. height: auto;
  488. .list-title-t {
  489. width: 100%;
  490. height: 50rpx;
  491. float: left;
  492. font-size: $font-size-28;
  493. padding-bottom: 10rpx;
  494. .list-title-tip {
  495. float: left;
  496. .badges {
  497. display: block;
  498. float: left;
  499. padding: 0 15rpx;
  500. height: 36rpx;
  501. line-height: 36rpx;
  502. border-radius: 20rpx;
  503. font-size: $font-size-22;
  504. background-color: #f0f9eb;
  505. color: #67c23a;
  506. text-align: center;
  507. &.success {
  508. background-color: #ecf5ff;
  509. color: #409eff;
  510. }
  511. &.warning {
  512. background-color: #fdf6ec;
  513. color: #e6a23c;
  514. }
  515. }
  516. .badgesb{
  517. display: block;
  518. float: left;
  519. padding: 0 15rpx;
  520. height: 36rpx;
  521. line-height: 36rpx;
  522. border-radius: 20rpx;
  523. background: #f4f4f5;
  524. font-size: $font-size-22;
  525. text-align: center;
  526. color: #909399;
  527. margin-left: 24rpx;
  528. }
  529. }
  530. .list-title-tag {
  531. float: left;
  532. margin-left: 20rpx;
  533. .badges {
  534. display: block;
  535. float: left;
  536. padding: 0 15rpx;
  537. height: 40rpx;
  538. line-height: 40rpx;
  539. border-radius: 20rpx;
  540. font-size: $font-size-22;
  541. text-align: center;
  542. background-color: #ecf5ff;
  543. color: #409eff;
  544. }
  545. }
  546. .list-title-num {
  547. float: left;
  548. text-align: left;
  549. color: #42b983;
  550. line-height: 40rpx;
  551. margin-left: 20rpx;
  552. font-size: $font-size-24;
  553. }
  554. }
  555. .list-title-a {
  556. width: 100%;
  557. height: auto;
  558. float: left;
  559. // padding: 5rpx 8rpx;
  560. // border-radius: 4rpx;
  561. // background-color: rgba(247, 247, 247, 1);
  562. // margin: 10rpx 0;
  563. .text{
  564. color: #999999;
  565. }
  566. .list-title-a-text {
  567. width: 100%;
  568. height: 50rpx;
  569. float: left;
  570. font-size: $font-size-24;
  571. line-height: 50rpx;
  572. color: #666666;
  573. text-align: left;
  574. }
  575. }
  576. .list-title-b {
  577. width: 100%;
  578. height: 50rpx;
  579. float: left;
  580. font-size: $font-size-24;
  581. line-height: 50rpx;
  582. color: #666666;
  583. text-align: left;
  584. .text{
  585. color: #999999;
  586. }
  587. .list-title-b-item {
  588. width: 50%;
  589. height: 100%;
  590. float: left;
  591. }
  592. }
  593. }
  594. }
  595. .list-detail {
  596. width: 70rpx;
  597. height: 80rpx;
  598. line-height: 80rpx;
  599. text-align: center;
  600. position: absolute;
  601. right: 0;
  602. bottom: 0;
  603. .iconfont {
  604. font-size: $font-size-32;
  605. color: #999999;
  606. }
  607. }
  608. }
  609. .section-tips{
  610. width: 100%;
  611. height: 50rpx;
  612. font-size: $font-size-28;
  613. line-height: 50rpx;
  614. color: $uni-color-error;
  615. text-align: left;
  616. }
  617. }
  618. .distinguish-button {
  619. width: 100%;
  620. position: fixed;
  621. bottom: 0;
  622. left: 0;
  623. background-color: #ffffff;
  624. padding: 0 50rpx;
  625. padding-top: 20rpx;
  626. display: flex;
  627. .button {
  628. flex: 1;
  629. height: 80rpx;
  630. margin: 0 20rpx;
  631. border-radius: 40rpx;
  632. text-align: center;
  633. color: #ffffff;
  634. line-height: 80rpx;
  635. font-size: $font-size-28;
  636. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  637. &.confirm{
  638. background: $btn-confirm;
  639. }
  640. &.cancel{
  641. background: $uni-color-error;
  642. }
  643. }
  644. }
  645. </style>