detail.vue 16 KB

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