detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  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.$util.msg(err.msg, 2000)
  225. })
  226. },
  227. toNoSms(url) {
  228. this.$api.navigateTo(url)
  229. },
  230. formatColor(state) {
  231. //设置邀请码状态亚瑟
  232. let stateColor = '',
  233. stateColorObject = {
  234. 0: '#4cd964',
  235. 1: '#4cd964',
  236. 2: '#4cd964',
  237. 3: '#007aff'
  238. }
  239. Object.keys(stateColorObject).forEach(function(key) {
  240. if (key == state) {
  241. stateColor = stateColorObject[key]
  242. }
  243. })
  244. return stateColor
  245. },
  246. formatReceiptType(value) {
  247. //订单状态文字和颜色
  248. var HtmlStateText = '',
  249. stateTextObject = {
  250. 1: '订单款',
  251. 2: '非订单款',
  252. 3: '返佣款',
  253. 4: '订单款或者非订单款',
  254. 5: '供应商退款'
  255. }
  256. Object.keys(stateTextObject).forEach(function(key) {
  257. if (key == value) {
  258. HtmlStateText = stateTextObject[key]
  259. }
  260. })
  261. return HtmlStateText
  262. }
  263. },
  264. onPageScroll(e) {
  265. //实时获取到滚动的值
  266. // if (e.scrollTop > 30) {
  267. // this.isCmcustomClass = 'fiexd'
  268. // } else {
  269. // this.isCmcustomClass = 'left'
  270. // }
  271. },
  272. onPullDownRefresh() {
  273. setTimeout(() => {
  274. this.getOrderReceiptDetail(this.receiptId)
  275. uni.stopPullDownRefresh()
  276. }, 200)
  277. },
  278. onShareAppMessage(res) {
  279. //分享购买优惠券
  280. const receipt = this.receiptInfo
  281. const receiptTypeText = this.formatReceiptType(receipt.receiptType)
  282. if (res.from === 'button') {
  283. // console.log('来自页面内转发按钮')
  284. }
  285. return {
  286. title: `【${receipt.receiptStatusText}(${receiptTypeText})】收款金额${receipt.receiptAmount.toFixed(2)}元,收款时间:${receipt.receiptDate}`,
  287. path: `/pages/login/login-share?id=${receipt.id}`,
  288. imageUrl: 'https://static.caimei365.com/app/crm/image/icon-share@2x.jpg'
  289. }
  290. },
  291. onShow() {}
  292. }
  293. </script>
  294. <style lang="scss">
  295. @import '@/uni.scss';
  296. page {
  297. background: #fff;
  298. }
  299. .tui-header-box {
  300. width: 100%;
  301. background: #ffffff;
  302. z-index: 999;
  303. background-size: cover;
  304. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  305. &.fiexd {
  306. position: fixed;
  307. top: 0;
  308. left: 0;
  309. }
  310. }
  311. .header-top {
  312. width: 100%;
  313. font-size: 16px;
  314. font-weight: 500;
  315. height: 32px;
  316. display: flex;
  317. align-items: center;
  318. justify-content: center;
  319. position: relative;
  320. padding: 0 40rpx;
  321. }
  322. .header-sit {
  323. width: 100%;
  324. box-sizing: border-box;
  325. height: 80rpx;
  326. line-height: 80rpx;
  327. box-sizing: border-box;
  328. color: #ffffff;
  329. .header-sit-text {
  330. text-align: left;
  331. font-size: $font-size-40;
  332. font-weight: 600;
  333. font-family: '正楷';
  334. }
  335. .icon-fanhui {
  336. display: block;
  337. width: 80rpx;
  338. height: 80rpx;
  339. float: left;
  340. text-align: center;
  341. line-height: 80rpx;
  342. font-size: 42rpx;
  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. .title-text {
  373. float: left;
  374. line-height: 40rpx;
  375. height: 40rpx;
  376. color: #333333;
  377. text-align: left;
  378. font-weight: 600;
  379. font-size: $font-size-30;
  380. }
  381. }
  382. .button {
  383. float: right;
  384. box-sizing: border-box;
  385. padding: 0 24rpx;
  386. height: 100%;
  387. line-height: 66rpx;
  388. background: $btn-confirm;
  389. border-radius: 8rpx;
  390. text-align: center;
  391. color: #ffffff;
  392. }
  393. }
  394. .section-top-item {
  395. width: 100%;
  396. height: auto;
  397. margin-top: 10rpx;
  398. position: relative;
  399. float: left;
  400. .list-title-t {
  401. width: 100%;
  402. height: 50rpx;
  403. float: left;
  404. font-size: $font-size-28;
  405. padding-bottom: 10rpx;
  406. .list-title-tip {
  407. float: left;
  408. .badges {
  409. display: block;
  410. float: left;
  411. padding: 0 15rpx;
  412. height: 40rpx;
  413. line-height: 40rpx;
  414. border-radius: 4rpx;
  415. background: $btn-confirm;
  416. font-size: $font-size-24;
  417. text-align: center;
  418. color: #ffffff;
  419. }
  420. }
  421. }
  422. .list-title-b {
  423. width: 100%;
  424. height: 44rpx;
  425. float: left;
  426. font-size: $font-size-24;
  427. line-height: 44rpx;
  428. color: #999999;
  429. text-align: left;
  430. .text {
  431. color: #999999;
  432. }
  433. .list-title-b-item {
  434. width: 50%;
  435. height: 100%;
  436. float: left;
  437. }
  438. &.sms {
  439. height: 120rpx;
  440. padding: 10rpx;
  441. border-radius: 4rpx;
  442. background: #f7f7f7;
  443. }
  444. }
  445. .list-icon {
  446. width: 120rpx;
  447. height: 120rpx;
  448. border-radius: 10rpx;
  449. position: absolute;
  450. right: 0;
  451. top: 0;
  452. color: #dd524d;
  453. z-index: 99;
  454. .list-icon-image{
  455. width: 120rpx;
  456. height: 120rpx;
  457. display: block;
  458. }
  459. }
  460. }
  461. .section-title {
  462. width: 100%;
  463. height: 66rpx;
  464. float: left;
  465. font-size: $font-size-28;
  466. line-height: 66rpx;
  467. color: #333333;
  468. text-align: left;
  469. font-weight: 600;
  470. }
  471. .section-mid {
  472. width: 100%;
  473. height: auto;
  474. display: flex;
  475. flex-direction: column;
  476. position: relative;
  477. border-radius: 0 0 20rpx 20rpx;
  478. .list-title-b {
  479. width: 100%;
  480. height: 50rpx;
  481. float: left;
  482. font-size: $font-size-24;
  483. line-height: 50rpx;
  484. color: #666666;
  485. text-align: left;
  486. .text{
  487. color: #999999;
  488. }
  489. .list-title-b-item {
  490. width: 50%;
  491. height: 100%;
  492. float: left;
  493. }
  494. }
  495. }
  496. .section-tips {
  497. width: 100%;
  498. height: 50rpx;
  499. font-size: $font-size-28;
  500. line-height: 50rpx;
  501. color: $uni-color-error;
  502. text-align: left;
  503. }
  504. }
  505. .distinguish-button {
  506. width: 100%;
  507. position: fixed;
  508. bottom: 0;
  509. left: 0;
  510. background-color: #ffffff;
  511. padding: 0 50rpx;
  512. padding-top: 20rpx;
  513. display: flex;
  514. .button {
  515. flex: 1;
  516. height: 80rpx;
  517. margin: 0 20rpx;
  518. border-radius: 40rpx;
  519. text-align: center;
  520. color: #ffffff;
  521. line-height: 80rpx;
  522. font-size: $font-size-28;
  523. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  524. &.confirm {
  525. background: $btn-confirm;
  526. }
  527. &.cancel {
  528. background: $uni-color-error;
  529. }
  530. }
  531. }
  532. </style>