detail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  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" :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. <!-- 弹窗提示 -->
  117. <tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :title="contentModalTitle"
  118. :content="contentModalText" :button="modalButton" color="#333" :size="32" shape="circle"
  119. :maskClosable="false">
  120. </tui-modal>
  121. </view>
  122. </template>
  123. <script>
  124. import wxLogin from '@/services/wxLogin.js'
  125. import {
  126. mapState,
  127. mapMutations
  128. } from 'vuex'
  129. export default {
  130. data() {
  131. return {
  132. isIphoneX: this.$store.state.isIphoneX,
  133. CustomBar: this.CustomBar, // 顶部导航栏高度
  134. height: 64, //header高度
  135. top: 0, //标题图标距离顶部距离
  136. scrollH: 0, //滚动总高度
  137. opcity: 1,
  138. isCmcustomClass: 'left',
  139. skeletonShow:true,
  140. orderList:[],
  141. listQuery:{
  142. pageNum: 1, //页数
  143. pageSize: 10, //条数
  144. id: 0,
  145. shopName: '',
  146. },
  147. nvabarData: {
  148. //顶部自定义导航
  149. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  150. showSearch: 0,
  151. title: '', // 导航栏 中间的标题
  152. haveBack: false,
  153. home: false,
  154. textLeft: this.$store.state.isIphone,
  155. bgColor: '#D33020',
  156. textColor: '#ffffff'
  157. },
  158. receiptInfo: {},
  159. receiptId: 0,
  160. isShareType: false
  161. }
  162. },
  163. onLoad(option) {
  164. let obj = {}
  165. // #ifdef MP-WEIXIN
  166. obj = wx.getMenuButtonBoundingClientRect()
  167. // #endif
  168. // #ifdef MP-BAIDU
  169. obj = swan.getMenuButtonBoundingClientRect()
  170. // #endif
  171. // #ifdef MP-ALIPAY
  172. my.hideAddToDesktopMenu()
  173. // #endif
  174. uni.getSystemInfo({
  175. success: res => {
  176. this.width = obj.left || res.windowWidth
  177. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  178. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  179. this.scrollH = res.windowWidth * 0.6
  180. }
  181. })
  182. if(option.type == 'share'){ this.isShareType = true }
  183. this.receiptId = this.listQuery.id = option.id
  184. this.getOrderReceiptDetail(this.receiptId)
  185. this.getOrderReceiptRebateOrders()
  186. },
  187. computed: {
  188. ...mapState(['hasLogin'])
  189. },
  190. methods: {
  191. getOrderReceiptDetail(id) {
  192. // 收款详情
  193. this.OrderService.orderReceiptRefundDetail({ id: id })
  194. .then(response => {
  195. this.receiptInfo = response.data
  196. })
  197. .catch(err => {
  198. this.$util.msg(err.msg, 2000)
  199. })
  200. },
  201. getOrderReceiptRebateOrders() {// 收款详情-订单列表
  202. this.OrderService.orderReceiptRebateOrders(this.listQuery)
  203. .then(response => {
  204. let data = response.data
  205. if (data.list && data.list.length > 0) {
  206. this.orderList = data.list
  207. }
  208. setTimeout(()=>{
  209. this.skeletonShow = false
  210. },1000)
  211. })
  212. .catch(err => {
  213. this.$util.msg(err.msg, 2000)
  214. })
  215. },
  216. orderDetail(orderId) {
  217. //订单详情跳转
  218. this.isModalLayer = true
  219. this.$api.navigateTo(`/pages/relation/order/detail?orderId=${orderId}`)
  220. },
  221. toNoSms(url) {
  222. this.$api.navigateTo(url)
  223. },
  224. formatColor(state) {
  225. //设置颜色
  226. let stateColor = '',
  227. stateColorObject = {
  228. 1: '#FEAC20',
  229. 2: '#4cd964',
  230. 3: '#34CC8C',
  231. 4: '#F94B4B',
  232. 5: '#007aff'
  233. }
  234. Object.keys(stateColorObject).forEach(function(key) {
  235. if (key == state) {
  236. stateColor = stateColorObject[key]
  237. }
  238. })
  239. return stateColor
  240. },
  241. formatReceiptType(value) {
  242. //订单状态文字和颜色
  243. var HtmlStateText = '',
  244. stateTextObject = {
  245. 1: '订单',
  246. 2: '非订单',
  247. 3: '返佣',
  248. 4: '订单款或者非订单款',
  249. 5: '供应商退款'
  250. }
  251. Object.keys(stateTextObject).forEach(function(key) {
  252. if (key == value) {
  253. HtmlStateText = stateTextObject[key]
  254. }
  255. })
  256. return HtmlStateText
  257. },
  258. },
  259. onPageScroll(e) {
  260. //实时获取到滚动的值
  261. // if (e.scrollTop > 30) {
  262. // this.isCmcustomClass = 'fiexd'
  263. // } else {
  264. // this.isCmcustomClass = 'left'
  265. // }
  266. },
  267. onPullDownRefresh() {
  268. setTimeout(() => {
  269. this.getOrderReceiptDetail(this.receiptId)
  270. uni.stopPullDownRefresh()
  271. }, 200)
  272. },
  273. onShareAppMessage(res) {
  274. //分享购买优惠券
  275. const receipt = this.receiptInfo
  276. const receiptTypeText = this.formatReceiptType(receipt.receiptType)
  277. if (res.from === 'button') {
  278. // console.log('来自页面内转发按钮')
  279. }
  280. return {
  281. title: `【${receipt.receiptStatusText}(${receiptTypeText}款)】收款金额${receipt.receiptAmount.toFixed(2)}元,收款时间:${receipt.receiptDate}`,
  282. path: `/pages/login/login-share?id=${receipt.id}`,
  283. imageUrl: 'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
  284. }
  285. },
  286. onShow() {
  287. }
  288. }
  289. </script>
  290. <style lang="scss">
  291. @import '@/uni.scss';
  292. page {
  293. background: #fff;
  294. }
  295. .tui-header-box {
  296. width: 100%;
  297. background: #ffffff;
  298. z-index: 999;
  299. background-size: cover;
  300. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  301. &.fiexd {
  302. position: fixed;
  303. top: 0;
  304. left: 0;
  305. }
  306. }
  307. .header-top {
  308. width: 100%;
  309. font-size: 16px;
  310. font-weight: 500;
  311. height: 32px;
  312. display: flex;
  313. align-items: center;
  314. justify-content: center;
  315. position: relative;
  316. padding: 0 40rpx;
  317. }
  318. .header-sit {
  319. width: 100%;
  320. box-sizing: border-box;
  321. height: 80rpx;
  322. line-height: 80rpx;
  323. box-sizing: border-box;
  324. color: #ffffff;
  325. .header-sit-text {
  326. text-align: left;
  327. font-size: $font-size-40;
  328. font-weight: 600;
  329. font-family: '正楷';
  330. }
  331. .iconfont {
  332. display: block;
  333. width: 80rpx;
  334. height: 80rpx;
  335. float: left;
  336. text-align: center;
  337. line-height: 80rpx;
  338. font-size: 42rpx;
  339. }
  340. .icon-iconfonticonfontsousuo1 {
  341. font-size: 42rpx;
  342. margin-left: 30rpx;
  343. }
  344. }
  345. .mine {
  346. width: 100%;
  347. height: 100%;
  348. position: relative;
  349. }
  350. .distinguish-section {
  351. width: 100%;
  352. position: absolute;
  353. padding: 40rpx 20rpx;
  354. box-sizing: border-box;
  355. }
  356. .distinguish-section-conten {
  357. width: 100%;
  358. height: auto;
  359. position: relative;
  360. background-color: #ffffff;
  361. border-radius: 20rpx;
  362. padding: 20rpx;
  363. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  364. .section-top {
  365. width: 100%;
  366. height: 66rpx;
  367. box-sizing: border-box;
  368. .title {
  369. float: left;
  370. height: 66rpx;
  371. padding: 13rpx 0;
  372. .list-title-tip {
  373. float: left;
  374. margin-right: 15rpx;
  375. .badges {
  376. display: block;
  377. float: left;
  378. padding: 0 15rpx;
  379. height: 40rpx;
  380. line-height: 40rpx;
  381. border-radius: 4rpx;
  382. background: $btn-confirm;
  383. font-size: $font-size-24;
  384. text-align: center;
  385. color: #ffffff;
  386. }
  387. }
  388. .title-text{
  389. float: left;
  390. line-height: 40rpx;
  391. height: 40rpx;
  392. color: #333333;
  393. text-align: left;
  394. font-weight: 600;
  395. }
  396. }
  397. .button {
  398. float: right;
  399. box-sizing: border-box;
  400. padding: 0 24rpx;
  401. height: 100%;
  402. line-height: 66rpx;
  403. background: $btn-confirm;
  404. border-radius: 8rpx;
  405. text-align: center;
  406. color: #ffffff;
  407. }
  408. }
  409. .section-top-item {
  410. width: 100%;
  411. height: auto;
  412. margin-top: 10rpx;
  413. position: relative;
  414. float: left;
  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: 120rpx;
  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. .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. .list-detail {
  562. width: 70rpx;
  563. height: 80rpx;
  564. line-height: 80rpx;
  565. text-align: center;
  566. position: absolute;
  567. right: 0;
  568. bottom: 0;
  569. .iconfont {
  570. font-size: $font-size-32;
  571. color: #999999;
  572. }
  573. }
  574. }
  575. .section-tips{
  576. width: 100%;
  577. height: 50rpx;
  578. font-size: $font-size-28;
  579. line-height: 50rpx;
  580. color: $uni-color-error;
  581. text-align: left;
  582. }
  583. }
  584. .distinguish-button {
  585. width: 100%;
  586. position: fixed;
  587. bottom: 0;
  588. left: 0;
  589. background-color: #ffffff;
  590. padding: 0 50rpx;
  591. padding-top: 20rpx;
  592. display: flex;
  593. .button {
  594. flex: 1;
  595. height: 80rpx;
  596. margin: 0 20rpx;
  597. border-radius: 40rpx;
  598. text-align: center;
  599. color: #ffffff;
  600. line-height: 80rpx;
  601. font-size: $font-size-28;
  602. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  603. &.confirm{
  604. background: $btn-confirm;
  605. }
  606. &.cancel{
  607. background: $uni-color-error;
  608. }
  609. }
  610. }
  611. </style>