detail.vue 16 KB

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