detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  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 class="iconfont icon-fanhui" @click.stop="this.$api.navigateBack(1)"></text>
  12. <text class="header-sit-text">非订单款项详情</text>
  13. </view>
  14. </view>
  15. <view
  16. class="tui-header-box"
  17. :style="{
  18. height: CustomBar + 30 + 'px',
  19. backgroundImage: 'url(https://static.caimei365.com/app/crm/image/statistic_bg1.png)'
  20. }"
  21. >
  22. </view>
  23. <tui-skeleton
  24. v-if="skeletonShow"
  25. backgroundColor="#fafafa"
  26. borderRadius="10rpx"
  27. :isLoading="true"
  28. :loadingType="7"
  29. ></tui-skeleton>
  30. <view class="distinguish-section" v-else :style="{ top: CustomBar - 4 + 'px', left: 0 + 'px' }">
  31. <view class="distinguish-section-conten">
  32. <view class="section-top">
  33. <view class="title"> <view class="title-text">收款信息</view> </view>
  34. <view class="button" @click="toNoSms('/pages/collection/list')">
  35. <text class="iconfont icon-wodedingdan"></text> 收款列表
  36. </view>
  37. </view>
  38. <view class="section-top-item">
  39. <view class="list-title-t">
  40. <view class="list-title-tip">
  41. <text class="badges">{{ receiptInfo.receiptType | formatReceiptType }}</text>
  42. <text class="badgesa">{{ receiptInfo.newReceiptType | newReceiptTypeType }}</text>
  43. </view>
  44. </view>
  45. <view class="list-title-b">
  46. <view class="list-title-b-item ">
  47. 收款金额:<text class="text">¥{{ receiptInfo.receiptAmount | NumFormat }}</text>
  48. </view>
  49. <view class="list-title-b-item ">
  50. 收款类型:<text class="text">{{ receiptInfo.payTypeText }}</text>
  51. </view>
  52. </view>
  53. <view class="list-title-b">
  54. 款时间:<text class="text">{{ receiptInfo.receiptDate }}</text>
  55. </view>
  56. <template v-if="receiptInfo.smsContent">
  57. <view class="list-title-b">收款短信:</view>
  58. <view class="list-title-b sms">
  59. <text class="text">{{ receiptInfo.smsContent ? receiptInfo.smsContent : '无' }}</text>
  60. </view>
  61. </template>
  62. <view class="list-icon" v-if="receiptInfo.tipMsg">
  63. <image
  64. class="list-icon-image"
  65. src="https://static.caimei365.com/app/crm/image/icon-noconfirm@2x.png"
  66. mode=""
  67. v-if="receiptInfo.receiptStatus == 1"
  68. ></image>
  69. <image
  70. class="list-icon-image"
  71. src="https://static.caimei365.com/app/crm/image/icon-noaudit@2x.png"
  72. mode=""
  73. v-if="receiptInfo.receiptStatus == 2"
  74. ></image>
  75. </view>
  76. </view>
  77. <template v-if="receiptInfo.orderList">
  78. <view class="section-title">关联订单</view>
  79. <view class="section-mid">
  80. <view
  81. class="tui-order-item"
  82. v-for="(order, orderIndex) in receiptInfo.orderList"
  83. :key="orderIndex"
  84. >
  85. <receipt-details :orderInfo="order"></receipt-details>
  86. </view>
  87. </view>
  88. </template>
  89. <view class="section-title">状态</view>
  90. <view class="section-mid">
  91. <view class="list-title">
  92. <view class="list-title-b"
  93. >进度:<text :style="{ color: formatColor(receiptInfo.receiptStatus) }">{{
  94. receiptInfo.receiptStatusText
  95. }}</text>
  96. </view>
  97. <view class="list-title-b"
  98. >确认人:<text class="text">{{
  99. receiptInfo.confirmUserName ? receiptInfo.confirmUserName : '无'
  100. }}</text></view
  101. >
  102. <view class="list-title-b"
  103. >确认时间:<text class="text">{{
  104. receiptInfo.confirmDate ? receiptInfo.confirmDate : '无'
  105. }}</text></view
  106. >
  107. <view class="list-title-b"
  108. >审核人:<text class="text">{{
  109. receiptInfo.reviewUserName ? receiptInfo.reviewUserName : '无'
  110. }}</text></view
  111. >
  112. <view class="list-title-b"
  113. >审核时间:<text class="text">{{
  114. receiptInfo.reviewDate ? receiptInfo.reviewDate : '无'
  115. }}</text></view
  116. >
  117. <view class="list-title-b" v-if="receiptInfo.shopName"
  118. >关联供应商:<text class="text">{{ receiptInfo.shopName }}</text></view
  119. >
  120. <view class="list-title-b"
  121. >备注信息:<text class="text">{{
  122. receiptInfo.noOrderReason ? receiptInfo.noOrderReason : '无'
  123. }}</text></view
  124. >
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </template>
  131. <script>
  132. import receiptDetails from '@/components/cm-module/receipt/receipt-details'
  133. import { mapState, mapMutations } from 'vuex'
  134. export default {
  135. components: {
  136. receiptDetails
  137. },
  138. data() {
  139. return {
  140. isIphoneX: this.$store.state.isIphoneX,
  141. CustomBar: this.CustomBar, // 顶部导航栏高度
  142. height: 64, //header高度
  143. top: 0, //标题图标距离顶部距离
  144. scrollH: 0, //滚动总高度
  145. opcity: 1,
  146. isCmcustomClass: 'left',
  147. skeletonShow: true,
  148. nvabarData: {
  149. //顶部自定义导航
  150. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  151. showSearch: 0,
  152. title: '', // 导航栏 中间的标题
  153. haveBack: false,
  154. home: false,
  155. textLeft: this.$store.state.isIphone,
  156. bgColor: '#D33020',
  157. textColor: '#ffffff'
  158. },
  159. receiptInfo: {},
  160. receiptId: 0
  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. this.receiptId = option.id
  183. this.getOrderReceiptDetail(this.receiptId)
  184. },
  185. filters: {
  186. newReceiptTypeType(value) {
  187. switch (value) {
  188. case 1:
  189. return '上架费'
  190. break
  191. case 2:
  192. return '订单返佣'
  193. break
  194. case 3:
  195. return '认证通会员'
  196. break
  197. case 4:
  198. return '认证通企划'
  199. break
  200. }
  201. },
  202. formatSourceType(value) {
  203. switch (value) {
  204. case 1:
  205. return '订单'
  206. break
  207. case 2:
  208. return '非订单'
  209. break
  210. case 3:
  211. return '返佣'
  212. break
  213. case 4:
  214. return '订单款或者非订单款'
  215. break
  216. case 5:
  217. return '供应商退款'
  218. break
  219. }
  220. },
  221. formatStateType(value) {
  222. switch (value) {
  223. case 0:
  224. return '待确认'
  225. break
  226. case 1:
  227. return '已确认'
  228. break
  229. case 2:
  230. return '待审核'
  231. break
  232. case 3:
  233. return '审核通过'
  234. break
  235. }
  236. },
  237. NumFormat(value) {
  238. //处理金额
  239. if (value) {
  240. return Number(value).toFixed(2)
  241. } else {
  242. return '0.00'
  243. }
  244. }
  245. },
  246. computed: {
  247. ...mapState(['hasLogin', 'userInfo'])
  248. },
  249. methods: {
  250. getOrderReceiptDetail(id) {
  251. // 收款详情
  252. this.OrderService.orderReceiptDetail({ id: id })
  253. .then(response => {
  254. this.receiptInfo = response.data
  255. setTimeout(() => {
  256. this.skeletonShow = false
  257. }, 1000)
  258. })
  259. .catch(err => {
  260. this.$api.navigateTo('/pages/login/login-error')
  261. })
  262. },
  263. toNoSms(url) {
  264. this.$api.navigateTo(url)
  265. },
  266. formatColor(state) {
  267. //设置邀请码状态亚瑟
  268. let stateColor = '',
  269. stateColorObject = {
  270. 1: '#ff7900',
  271. 2: '#4cd964',
  272. 3: '#19be6b',
  273. 4: '#ed3f14',
  274. 5: '#F74D54'
  275. }
  276. Object.keys(stateColorObject).forEach(function(key) {
  277. if (key == state) {
  278. stateColor = stateColorObject[key]
  279. }
  280. })
  281. return stateColor
  282. },
  283. formatReceiptType(value) {
  284. //订单状态文字和颜色
  285. var HtmlStateText = '',
  286. stateTextObject = {
  287. 1: '订单款',
  288. 2: '非订单款',
  289. 3: '返佣款',
  290. 4: '订单款或者非订单款',
  291. 5: '供应商退款'
  292. }
  293. Object.keys(stateTextObject).forEach(function(key) {
  294. if (key == value) {
  295. HtmlStateText = stateTextObject[key]
  296. }
  297. })
  298. return HtmlStateText
  299. }
  300. },
  301. onPageScroll(e) {
  302. //实时获取到滚动的值
  303. // if (e.scrollTop > 30) {
  304. // this.isCmcustomClass = 'fiexd'
  305. // } else {
  306. // this.isCmcustomClass = 'left'
  307. // }
  308. },
  309. onPullDownRefresh() {
  310. setTimeout(() => {
  311. this.getOrderReceiptDetail(this.receiptId)
  312. uni.stopPullDownRefresh()
  313. }, 200)
  314. },
  315. onShareAppMessage(res) {
  316. //分享购买优惠券
  317. const receipt = this.receiptInfo
  318. const receiptTypeText = this.formatReceiptType(receipt.receiptType)
  319. if (res.from === 'button') {
  320. // console.log('来自页面内转发按钮')
  321. }
  322. return {
  323. title: `¥${receipt.receiptAmount.toFixed(2)} | ${receipt.receiptDate} | ${
  324. receipt.receiptStatusText
  325. }(${receiptTypeText})`,
  326. path: `/pages/login/login-share?id=${receipt.id}`,
  327. imageUrl: 'https://static.caimei365.com/app/crm/image/icon-share@2x.jpg'
  328. }
  329. },
  330. onShow() {}
  331. }
  332. </script>
  333. <style lang="scss">
  334. @import '@/uni.scss';
  335. page {
  336. background: #fff;
  337. }
  338. .tui-header-box {
  339. width: 100%;
  340. background: #ffffff;
  341. z-index: 999;
  342. background-size: cover;
  343. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  344. &.fiexd {
  345. position: fixed;
  346. top: 0;
  347. left: 0;
  348. }
  349. }
  350. .header-top {
  351. width: 100%;
  352. font-size: 16px;
  353. font-weight: 500;
  354. height: 32px;
  355. display: flex;
  356. align-items: center;
  357. justify-content: center;
  358. position: relative;
  359. padding: 0 40rpx;
  360. }
  361. .header-sit {
  362. width: 100%;
  363. box-sizing: border-box;
  364. height: 80rpx;
  365. line-height: 80rpx;
  366. box-sizing: border-box;
  367. color: #ffffff;
  368. .header-sit-text {
  369. text-align: left;
  370. font-size: $font-size-40;
  371. font-weight: 600;
  372. font-family: '正楷';
  373. }
  374. .icon-fanhui {
  375. display: block;
  376. width: 80rpx;
  377. height: 80rpx;
  378. float: left;
  379. text-align: center;
  380. line-height: 80rpx;
  381. font-size: 42rpx;
  382. }
  383. }
  384. .mine {
  385. width: 100%;
  386. height: 100%;
  387. position: relative;
  388. }
  389. .distinguish-section {
  390. width: 100%;
  391. position: absolute;
  392. padding: 40rpx 20rpx;
  393. box-sizing: border-box;
  394. }
  395. .distinguish-section-conten {
  396. width: 100%;
  397. height: auto;
  398. position: relative;
  399. background-color: #ffffff;
  400. border-radius: 20rpx;
  401. padding: 20rpx;
  402. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  403. .section-top {
  404. width: 100%;
  405. height: 66rpx;
  406. box-sizing: border-box;
  407. .title {
  408. float: left;
  409. height: 66rpx;
  410. padding: 13rpx 0;
  411. .title-text {
  412. float: left;
  413. line-height: 40rpx;
  414. height: 40rpx;
  415. color: #333333;
  416. text-align: left;
  417. font-weight: 600;
  418. font-size: $font-size-30;
  419. }
  420. }
  421. .button {
  422. float: right;
  423. box-sizing: border-box;
  424. padding: 0 24rpx;
  425. height: 100%;
  426. line-height: 66rpx;
  427. background: $btn-confirm;
  428. border-radius: 8rpx;
  429. text-align: center;
  430. color: #ffffff;
  431. }
  432. }
  433. .section-top-item {
  434. width: 100%;
  435. height: auto;
  436. margin-top: 10rpx;
  437. position: relative;
  438. float: left;
  439. .list-title-t {
  440. width: 100%;
  441. height: 50rpx;
  442. float: left;
  443. font-size: $font-size-28;
  444. padding-bottom: 10rpx;
  445. .list-title-tip {
  446. float: left;
  447. .badges {
  448. display: block;
  449. float: left;
  450. padding: 0 15rpx;
  451. height: 40rpx;
  452. line-height: 40rpx;
  453. border-radius: 4rpx;
  454. background: $btn-confirm;
  455. font-size: $font-size-24;
  456. text-align: center;
  457. color: #ffffff;
  458. }
  459. .badgesa {
  460. display: block;
  461. float: left;
  462. padding: 0 15rpx;
  463. height: 40rpx;
  464. line-height: 40rpx;
  465. border-radius: 4rpx;
  466. background: #7fba4f;
  467. font-size: $font-size-24;
  468. text-align: center;
  469. color: #ffffff;
  470. margin-left: 24rpx;
  471. }
  472. }
  473. }
  474. .list-title-b {
  475. width: 100%;
  476. height: 44rpx;
  477. float: left;
  478. font-size: $font-size-24;
  479. line-height: 44rpx;
  480. color: #999999;
  481. text-align: left;
  482. .text {
  483. color: #999999;
  484. }
  485. .list-title-b-item {
  486. width: 50%;
  487. height: 100%;
  488. float: left;
  489. }
  490. &.sms {
  491. height: auto;
  492. padding: 10rpx;
  493. border-radius: 4rpx;
  494. background: #f7f7f7;
  495. }
  496. }
  497. .list-icon {
  498. width: 120rpx;
  499. height: 120rpx;
  500. border-radius: 10rpx;
  501. position: absolute;
  502. right: 0;
  503. top: 0;
  504. color: #dd524d;
  505. z-index: 99;
  506. .list-icon-image {
  507. width: 120rpx;
  508. height: 120rpx;
  509. display: block;
  510. }
  511. }
  512. }
  513. .section-title {
  514. width: 100%;
  515. height: 66rpx;
  516. float: left;
  517. font-size: $font-size-28;
  518. line-height: 66rpx;
  519. color: #333333;
  520. text-align: left;
  521. font-weight: 600;
  522. }
  523. .section-mid {
  524. width: 100%;
  525. height: auto;
  526. display: flex;
  527. flex-direction: column;
  528. position: relative;
  529. border-radius: 0 0 20rpx 20rpx;
  530. .list-title-b {
  531. width: 100%;
  532. height: 50rpx;
  533. float: left;
  534. font-size: $font-size-24;
  535. line-height: 50rpx;
  536. color: #666666;
  537. text-align: left;
  538. .text {
  539. color: #999999;
  540. }
  541. .list-title-b-item {
  542. width: 50%;
  543. height: 100%;
  544. float: left;
  545. }
  546. }
  547. }
  548. .section-tips {
  549. width: 100%;
  550. height: 50rpx;
  551. font-size: $font-size-28;
  552. line-height: 50rpx;
  553. color: $uni-color-error;
  554. text-align: left;
  555. }
  556. }
  557. .distinguish-button {
  558. width: 100%;
  559. position: fixed;
  560. bottom: 0;
  561. left: 0;
  562. background-color: #ffffff;
  563. padding: 0 50rpx;
  564. padding-top: 20rpx;
  565. display: flex;
  566. .button {
  567. flex: 1;
  568. height: 80rpx;
  569. margin: 0 20rpx;
  570. border-radius: 40rpx;
  571. text-align: center;
  572. color: #ffffff;
  573. line-height: 80rpx;
  574. font-size: $font-size-28;
  575. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  576. &.confirm {
  577. background: $btn-confirm;
  578. }
  579. &.cancel {
  580. background: $uni-color-error;
  581. }
  582. }
  583. }
  584. </style>