detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  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. <view class="distinguish-section" :style="{ top: CustomBar - 4 + 'px', left: 0 + 'px' }">
  24. <view class="distinguish-section-conten">
  25. <view class="section-top">
  26. <view class="title">
  27. <view class="title-text">收款信息</view>
  28. </view>
  29. <view class="button" @click="toNoSms('/pages/collection/list')">
  30. <text class="iconfont icon-wodedingdan"></text> 收款列表
  31. </view>
  32. </view>
  33. <view class="section-top-item">
  34. <view class="list-title-t">
  35. <view class="list-title-tip">
  36. <text class="badges">{{ receiptInfo.receiptType | formatReceiptType }}</text>
  37. </view>
  38. </view>
  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. <template v-if="receiptInfo.smsContent">
  51. <view class="list-title-b">收款短信:</view>
  52. <view class="list-title-b sms">
  53. <text class="text">{{ receiptInfo.smsContent ? receiptInfo.smsContent : '无' }}</text>
  54. </view>
  55. </template>
  56. <view class="list-icon" v-if="receiptInfo.tipMsg">
  57. <image
  58. class="list-icon-image"
  59. src="https://static.caimei365.com/app/crm/image/icon-noconfirm@2x.png"
  60. mode=""
  61. v-if="receiptInfo.receiptStatus == 1"
  62. ></image>
  63. <image
  64. class="list-icon-image"
  65. src="https://static.caimei365.com/app/crm/image/icon-noaudit@2x.png"
  66. mode=""
  67. v-if="receiptInfo.receiptStatus == 2"
  68. ></image>
  69. </view>
  70. </view>
  71. <template v-if="receiptInfo.orderList">
  72. <view class="section-title">关联订单</view>
  73. <view class="section-mid">
  74. <view class="tui-order-item" v-for="(order, orderIndex) in receiptInfo.orderList" :key="orderIndex">
  75. <receipt-details :orderInfo="order"></receipt-details>
  76. </view>
  77. </view>
  78. </template>
  79. <view class="section-title">状态</view>
  80. <view class="section-mid">
  81. <view class="list-title">
  82. <view class="list-title-b"
  83. >进度:<text :style="{ color: formatColor(receiptInfo.receiptStatus) }"
  84. >{{ receiptInfo.receiptStatusText }}</text
  85. >
  86. </view>
  87. <view class="list-title-b"
  88. >确认人:<text class="text">{{
  89. receiptInfo.confirmUserName ? receiptInfo.confirmUserName : '无'
  90. }}</text></view
  91. >
  92. <view class="list-title-b"
  93. >确认时间:<text class="text">{{
  94. receiptInfo.confirmDate ? receiptInfo.confirmDate : '无'
  95. }}</text></view
  96. >
  97. <view class="list-title-b"
  98. >审核人:<text class="text">{{
  99. receiptInfo.reviewUserName ? receiptInfo.reviewUserName : '无'
  100. }}</text></view
  101. >
  102. <view class="list-title-b"
  103. >审核时间:<text class="text">{{
  104. receiptInfo.reviewDate ? receiptInfo.reviewDate : '无'
  105. }}</text></view
  106. >
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </template>
  113. <script>
  114. import wxLogin from '@/services/wxLogin.js'
  115. import receiptDetails from '@/components/cm-module/receipt/receipt-details'
  116. import { mapState, mapMutations } from 'vuex'
  117. export default {
  118. components: {
  119. receiptDetails
  120. },
  121. data() {
  122. return {
  123. isIphoneX: this.$store.state.isIphoneX,
  124. CustomBar: this.CustomBar, // 顶部导航栏高度
  125. height: 64, //header高度
  126. top: 0, //标题图标距离顶部距离
  127. scrollH: 0, //滚动总高度
  128. opcity: 1,
  129. isCmcustomClass: 'left',
  130. nvabarData: {
  131. //顶部自定义导航
  132. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  133. showSearch: 0,
  134. title: '', // 导航栏 中间的标题
  135. haveBack: false,
  136. home: false,
  137. textLeft: this.$store.state.isIphone,
  138. bgColor: '#D33020',
  139. textColor: '#ffffff'
  140. },
  141. receiptInfo: {},
  142. receiptId: 0
  143. }
  144. },
  145. onLoad(option) {
  146. let obj = {}
  147. // #ifdef MP-WEIXIN
  148. obj = wx.getMenuButtonBoundingClientRect()
  149. // #endif
  150. // #ifdef MP-BAIDU
  151. obj = swan.getMenuButtonBoundingClientRect()
  152. // #endif
  153. // #ifdef MP-ALIPAY
  154. my.hideAddToDesktopMenu()
  155. // #endif
  156. uni.getSystemInfo({
  157. success: res => {
  158. this.width = obj.left || res.windowWidth
  159. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  160. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  161. this.scrollH = res.windowWidth * 0.6
  162. }
  163. })
  164. this.receiptId = option.id
  165. this.getOrderReceiptDetail(this.receiptId)
  166. },
  167. filters: {
  168. formatSourceType(value) {
  169. switch (value) {
  170. case 1:
  171. return '订单'
  172. break
  173. case 2:
  174. return '非订单'
  175. break
  176. case 3:
  177. return '返佣'
  178. break
  179. case 4:
  180. return '订单款或者非订单款'
  181. break
  182. case 5:
  183. return '供应商退款'
  184. break
  185. }
  186. },
  187. formatStateType(value) {
  188. switch (value) {
  189. case 0:
  190. return '待确认'
  191. break
  192. case 1:
  193. return '已确认'
  194. break
  195. case 2:
  196. return '待审核'
  197. break
  198. case 3:
  199. return '审核通过'
  200. break
  201. }
  202. },
  203. NumFormat(value) {
  204. //处理金额
  205. if (value) {
  206. return Number(value).toFixed(2)
  207. } else {
  208. return '0.00'
  209. }
  210. }
  211. },
  212. computed: {
  213. ...mapState(['hasLogin', 'userInfo'])
  214. },
  215. methods: {
  216. getOrderReceiptDetail(id) {
  217. // 收款详情
  218. this.OrderService.orderReceiptDetail({ id: id })
  219. .then(response => {
  220. this.receiptInfo = response.data
  221. this.skeletonShow = false
  222. })
  223. .catch(err => {
  224. this.$api.navigateTo('/pages/login/login-error')
  225. })
  226. },
  227. toNoSms(url) {
  228. this.$api.navigateTo(url)
  229. },
  230. formatColor(state) {
  231. //设置邀请码状态亚瑟
  232. let stateColor = '',
  233. stateColorObject = {
  234. 1: '#ff7900',
  235. 2: '#4cd964',
  236. 3: '#19be6b',
  237. 4: '#ed3f14',
  238. 5: '#F74D54'
  239. }
  240. Object.keys(stateColorObject).forEach(function(key) {
  241. if (key == state) {
  242. stateColor = stateColorObject[key]
  243. }
  244. })
  245. return stateColor
  246. },
  247. formatReceiptType(value) {
  248. //订单状态文字和颜色
  249. var HtmlStateText = '',
  250. stateTextObject = {
  251. 1: '订单款',
  252. 2: '非订单款',
  253. 3: '返佣款',
  254. 4: '订单款或者非订单款',
  255. 5: '供应商退款'
  256. }
  257. Object.keys(stateTextObject).forEach(function(key) {
  258. if (key == value) {
  259. HtmlStateText = stateTextObject[key]
  260. }
  261. })
  262. return HtmlStateText
  263. }
  264. },
  265. onPageScroll(e) {
  266. //实时获取到滚动的值
  267. // if (e.scrollTop > 30) {
  268. // this.isCmcustomClass = 'fiexd'
  269. // } else {
  270. // this.isCmcustomClass = 'left'
  271. // }
  272. },
  273. onPullDownRefresh() {
  274. setTimeout(() => {
  275. this.getOrderReceiptDetail(this.receiptId)
  276. uni.stopPullDownRefresh()
  277. }, 200)
  278. },
  279. onShareAppMessage(res) {
  280. //分享购买优惠券
  281. const receipt = this.receiptInfo
  282. const receiptTypeText = this.formatReceiptType(receipt.receiptType)
  283. if (res.from === 'button') {
  284. // console.log('来自页面内转发按钮')
  285. }
  286. return {
  287. title: `【${receipt.receiptStatusText}[${receiptTypeText}]】收款金额${receipt.receiptAmount.toFixed(2)}元,收款时间:${receipt.receiptDate}`,
  288. path: `/pages/login/login-share?id=${receipt.id}`,
  289. imageUrl: 'https://static.caimei365.com/app/crm/image/icon-share@2x.jpg'
  290. }
  291. },
  292. onShow() {}
  293. }
  294. </script>
  295. <style lang="scss">
  296. @import '@/uni.scss';
  297. page {
  298. background: #fff;
  299. }
  300. .tui-header-box {
  301. width: 100%;
  302. background: #ffffff;
  303. z-index: 999;
  304. background-size: cover;
  305. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  306. &.fiexd {
  307. position: fixed;
  308. top: 0;
  309. left: 0;
  310. }
  311. }
  312. .header-top {
  313. width: 100%;
  314. font-size: 16px;
  315. font-weight: 500;
  316. height: 32px;
  317. display: flex;
  318. align-items: center;
  319. justify-content: center;
  320. position: relative;
  321. padding: 0 40rpx;
  322. }
  323. .header-sit {
  324. width: 100%;
  325. box-sizing: border-box;
  326. height: 80rpx;
  327. line-height: 80rpx;
  328. box-sizing: border-box;
  329. color: #ffffff;
  330. .header-sit-text {
  331. text-align: left;
  332. font-size: $font-size-40;
  333. font-weight: 600;
  334. font-family: '正楷';
  335. }
  336. .icon-fanhui {
  337. display: block;
  338. width: 80rpx;
  339. height: 80rpx;
  340. float: left;
  341. text-align: center;
  342. line-height: 80rpx;
  343. font-size: 42rpx;
  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: 40rpx;
  414. line-height: 40rpx;
  415. border-radius: 4rpx;
  416. background: $btn-confirm;
  417. font-size: $font-size-24;
  418. text-align: center;
  419. color: #ffffff;
  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: #999999;
  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: 120rpx;
  441. padding: 10rpx;
  442. border-radius: 4rpx;
  443. background: #f7f7f7;
  444. }
  445. }
  446. .list-icon {
  447. width: 120rpx;
  448. height: 120rpx;
  449. border-radius: 10rpx;
  450. position: absolute;
  451. right: 0;
  452. top: 0;
  453. color: #dd524d;
  454. z-index: 99;
  455. .list-icon-image{
  456. width: 120rpx;
  457. height: 120rpx;
  458. display: block;
  459. }
  460. }
  461. }
  462. .section-title {
  463. width: 100%;
  464. height: 66rpx;
  465. float: left;
  466. font-size: $font-size-28;
  467. line-height: 66rpx;
  468. color: #333333;
  469. text-align: left;
  470. font-weight: 600;
  471. }
  472. .section-mid {
  473. width: 100%;
  474. height: auto;
  475. display: flex;
  476. flex-direction: column;
  477. position: relative;
  478. border-radius: 0 0 20rpx 20rpx;
  479. .list-title-b {
  480. width: 100%;
  481. height: 50rpx;
  482. float: left;
  483. font-size: $font-size-24;
  484. line-height: 50rpx;
  485. color: #666666;
  486. text-align: left;
  487. .text{
  488. color: #999999;
  489. }
  490. .list-title-b-item {
  491. width: 50%;
  492. height: 100%;
  493. float: left;
  494. }
  495. }
  496. }
  497. .section-tips {
  498. width: 100%;
  499. height: 50rpx;
  500. font-size: $font-size-28;
  501. line-height: 50rpx;
  502. color: $uni-color-error;
  503. text-align: left;
  504. }
  505. }
  506. .distinguish-button {
  507. width: 100%;
  508. position: fixed;
  509. bottom: 0;
  510. left: 0;
  511. background-color: #ffffff;
  512. padding: 0 50rpx;
  513. padding-top: 20rpx;
  514. display: flex;
  515. .button {
  516. flex: 1;
  517. height: 80rpx;
  518. margin: 0 20rpx;
  519. border-radius: 40rpx;
  520. text-align: center;
  521. color: #ffffff;
  522. line-height: 80rpx;
  523. font-size: $font-size-28;
  524. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  525. &.confirm {
  526. background: $btn-confirm;
  527. }
  528. &.cancel {
  529. background: $uni-color-error;
  530. }
  531. }
  532. }
  533. </style>