detail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  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="list-title-tip">
  29. <text class="badges">{{ receiptInfo.receiptType | formatReceiptType }}款</text>
  30. </view>
  31. <view class="title-text">收款信息</view>
  32. </view>
  33. <view class="button" @click="toNoSms('/pages/collection/list')">
  34. <text class="iconfont icon-wodedingdan"></text>
  35. 收款列表
  36. </view>
  37. </view>
  38. <view class="section-top-item">
  39. <view class="list-title-b">
  40. <view class="list-title-b-item ">
  41. 收款金额:<text class="text">¥{{ receiptInfo.receiptAmount | NumFormat }}</text>
  42. </view>
  43. <view class="list-title-b-item ">
  44. 收款类型:<text class="text">{{ receiptInfo.payTypeText }}</text>
  45. </view>
  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.$util.msg(err.msg, 2000)
  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: '#FEAC20',
  223. 2: '#4cd964',
  224. 3: '#34CC8C',
  225. 4: '#F94B4B',
  226. 5: '#007aff'
  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/img/icon/icon-shareCoupon@2x.png'
  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. .list-title-tip {
  367. float: left;
  368. margin-right: 15rpx;
  369. .badges {
  370. display: block;
  371. float: left;
  372. padding: 0 15rpx;
  373. height: 40rpx;
  374. line-height: 40rpx;
  375. border-radius: 4rpx;
  376. background: $btn-confirm;
  377. font-size: $font-size-24;
  378. text-align: center;
  379. color: #ffffff;
  380. }
  381. }
  382. .title-text{
  383. float: left;
  384. line-height: 40rpx;
  385. height: 40rpx;
  386. color: #333333;
  387. text-align: left;
  388. font-weight: 600;
  389. }
  390. }
  391. .button {
  392. float: right;
  393. box-sizing: border-box;
  394. padding: 0 24rpx;
  395. height: 100%;
  396. line-height: 66rpx;
  397. background: $btn-confirm;
  398. border-radius: 8rpx;
  399. text-align: center;
  400. color: #ffffff;
  401. }
  402. }
  403. .section-top-item {
  404. width: 100%;
  405. height: auto;
  406. margin-top: 10rpx;
  407. position: relative;
  408. float: left;
  409. .list-title-b {
  410. width: 100%;
  411. height: 44rpx;
  412. float: left;
  413. font-size: $font-size-24;
  414. line-height: 44rpx;
  415. color: #666666;
  416. text-align: left;
  417. .text{
  418. color: #999999;
  419. }
  420. .list-title-b-item {
  421. width: 50%;
  422. height: 100%;
  423. float: left;
  424. }
  425. &.sms {
  426. height: 120rpx;
  427. padding: 10rpx;
  428. border-radius: 4rpx;
  429. background: #F7F7F7;
  430. }
  431. }
  432. .list-icon {
  433. width: 120rpx;
  434. height: 60rpx;
  435. border: 1px solid #e1e1e1;
  436. border-radius: 10rpx;
  437. text-align: center;
  438. font-size: 20rpx;
  439. line-height: 60rpx;
  440. position: absolute;
  441. right: 90rpx;
  442. top: 40rpx;
  443. color: #dd524d;
  444. z-index: 99;
  445. transform: rotate(45deg);
  446. -webkit-transform: rotate(45deg);
  447. -moz-transform: rotate(45deg);
  448. font-family: '正楷';
  449. }
  450. }
  451. .section-title {
  452. width: 100%;
  453. height: 66rpx;
  454. float: left;
  455. font-size: $font-size-28;
  456. line-height: 66rpx;
  457. color: #333333;
  458. text-align: left;
  459. font-weight: 600;
  460. }
  461. .section-mid {
  462. width: 100%;
  463. height: auto;
  464. display: flex;
  465. flex-direction: column;
  466. position: relative;
  467. border-radius: 0 0 20rpx 20rpx;
  468. .tui-order-item{
  469. display: flex;
  470. flex-direction: column;
  471. width: 100%;
  472. background: #fff;
  473. position: relative;
  474. .list-title {
  475. width: 100%;
  476. height: auto;
  477. .list-title-t {
  478. width: 100%;
  479. height: 50rpx;
  480. float: left;
  481. font-size: $font-size-28;
  482. padding-bottom: 10rpx;
  483. .list-title-tip {
  484. float: left;
  485. .badges {
  486. display: block;
  487. float: left;
  488. padding: 0 15rpx;
  489. height: 40rpx;
  490. line-height: 40rpx;
  491. border-radius: 20rpx;
  492. background: rgba(248, 204, 148, 0.5);
  493. font-size: $font-size-24;
  494. text-align: center;
  495. color: #666666;
  496. }
  497. }
  498. .list-title-tag {
  499. float: left;
  500. margin-left: 20rpx;
  501. .badges {
  502. display: block;
  503. float: left;
  504. padding: 0 15rpx;
  505. height: 40rpx;
  506. line-height: 40rpx;
  507. border-radius: 20rpx;
  508. background: linear-gradient(270deg, #fee9ba 0%, #f0cb72 100%);
  509. font-size: $font-size-24;
  510. text-align: center;
  511. color: #666666;
  512. }
  513. }
  514. .list-title-num {
  515. float: left;
  516. text-align: left;
  517. color: #e15616;
  518. line-height: 40rpx;
  519. margin-left: 20rpx;
  520. }
  521. }
  522. .list-title-a {
  523. width: 100%;
  524. height: auto;
  525. float: left;
  526. padding: 5rpx 8rpx;
  527. border-radius: 4rpx;
  528. background-color: rgba(247, 247, 247, 1);
  529. margin: 10rpx 0;
  530. .text{
  531. color: #999999;
  532. }
  533. .list-title-a-text {
  534. width: 100%;
  535. height: 50rpx;
  536. float: left;
  537. font-size: $font-size-24;
  538. line-height: 50rpx;
  539. color: #666666;
  540. text-align: left;
  541. }
  542. }
  543. .list-title-b {
  544. width: 100%;
  545. height: 50rpx;
  546. float: left;
  547. font-size: $font-size-24;
  548. line-height: 50rpx;
  549. color: #666666;
  550. text-align: left;
  551. .text{
  552. color: #999999;
  553. }
  554. .list-title-b-item {
  555. width: 50%;
  556. height: 100%;
  557. float: left;
  558. }
  559. }
  560. }
  561. }
  562. .list-detail {
  563. width: 70rpx;
  564. height: 80rpx;
  565. line-height: 80rpx;
  566. text-align: center;
  567. position: absolute;
  568. right: 0;
  569. bottom: 0;
  570. .iconfont {
  571. font-size: $font-size-32;
  572. color: #999999;
  573. }
  574. }
  575. }
  576. .section-tips{
  577. width: 100%;
  578. height: 50rpx;
  579. font-size: $font-size-28;
  580. line-height: 50rpx;
  581. color: $uni-color-error;
  582. text-align: left;
  583. }
  584. }
  585. .distinguish-button {
  586. width: 100%;
  587. position: fixed;
  588. bottom: 0;
  589. left: 0;
  590. background-color: #ffffff;
  591. padding: 0 50rpx;
  592. padding-top: 20rpx;
  593. display: flex;
  594. .button {
  595. flex: 1;
  596. height: 80rpx;
  597. margin: 0 20rpx;
  598. border-radius: 40rpx;
  599. text-align: center;
  600. color: #ffffff;
  601. line-height: 80rpx;
  602. font-size: $font-size-28;
  603. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  604. &.confirm{
  605. background: $btn-confirm;
  606. }
  607. &.cancel{
  608. background: $uni-color-error;
  609. }
  610. }
  611. }
  612. </style>