detail.vue 16 KB

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