detail.vue 16 KB

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