detail.vue 16 KB

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