detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  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 class="list-title-b"
  108. >备注信息:<text class="text">{{
  109. receiptInfo.noOrderReason ? receiptInfo.noOrderReason : '无'
  110. }}</text></view
  111. >
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. </template>
  118. <script>
  119. import receiptDetails from '@/components/cm-module/receipt/receipt-details'
  120. import { mapState, mapMutations } from 'vuex'
  121. export default {
  122. components: {
  123. receiptDetails
  124. },
  125. data() {
  126. return {
  127. isIphoneX: this.$store.state.isIphoneX,
  128. CustomBar: this.CustomBar, // 顶部导航栏高度
  129. height: 64, //header高度
  130. top: 0, //标题图标距离顶部距离
  131. scrollH: 0, //滚动总高度
  132. opcity: 1,
  133. isCmcustomClass: 'left',
  134. nvabarData: {
  135. //顶部自定义导航
  136. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  137. showSearch: 0,
  138. title: '', // 导航栏 中间的标题
  139. haveBack: false,
  140. home: false,
  141. textLeft: this.$store.state.isIphone,
  142. bgColor: '#D33020',
  143. textColor: '#ffffff'
  144. },
  145. receiptInfo: {},
  146. receiptId: 0
  147. }
  148. },
  149. onLoad(option) {
  150. let obj = {}
  151. // #ifdef MP-WEIXIN
  152. obj = wx.getMenuButtonBoundingClientRect()
  153. // #endif
  154. // #ifdef MP-BAIDU
  155. obj = swan.getMenuButtonBoundingClientRect()
  156. // #endif
  157. // #ifdef MP-ALIPAY
  158. my.hideAddToDesktopMenu()
  159. // #endif
  160. uni.getSystemInfo({
  161. success: res => {
  162. this.width = obj.left || res.windowWidth
  163. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  164. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  165. this.scrollH = res.windowWidth * 0.6
  166. }
  167. })
  168. this.receiptId = option.id
  169. this.getOrderReceiptDetail(this.receiptId)
  170. },
  171. filters: {
  172. formatSourceType(value) {
  173. switch (value) {
  174. case 1:
  175. return '订单'
  176. break
  177. case 2:
  178. return '非订单'
  179. break
  180. case 3:
  181. return '返佣'
  182. break
  183. case 4:
  184. return '订单款或者非订单款'
  185. break
  186. case 5:
  187. return '供应商退款'
  188. break
  189. }
  190. },
  191. formatStateType(value) {
  192. switch (value) {
  193. case 0:
  194. return '待确认'
  195. break
  196. case 1:
  197. return '已确认'
  198. break
  199. case 2:
  200. return '待审核'
  201. break
  202. case 3:
  203. return '审核通过'
  204. break
  205. }
  206. },
  207. NumFormat(value) {
  208. //处理金额
  209. if (value) {
  210. return Number(value).toFixed(2)
  211. } else {
  212. return '0.00'
  213. }
  214. }
  215. },
  216. computed: {
  217. ...mapState(['hasLogin', 'userInfo'])
  218. },
  219. methods: {
  220. getOrderReceiptDetail(id) {
  221. // 收款详情
  222. this.OrderService.orderReceiptDetail({ id: id })
  223. .then(response => {
  224. this.receiptInfo = response.data
  225. this.skeletonShow = false
  226. })
  227. .catch(err => {
  228. this.$api.navigateTo('/pages/login/login-error')
  229. })
  230. },
  231. toNoSms(url) {
  232. this.$api.navigateTo(url)
  233. },
  234. formatColor(state) {
  235. //设置邀请码状态亚瑟
  236. let stateColor = '',
  237. stateColorObject = {
  238. 1: '#ff7900',
  239. 2: '#4cd964',
  240. 3: '#19be6b',
  241. 4: '#ed3f14',
  242. 5: '#F74D54'
  243. }
  244. Object.keys(stateColorObject).forEach(function(key) {
  245. if (key == state) {
  246. stateColor = stateColorObject[key]
  247. }
  248. })
  249. return stateColor
  250. },
  251. formatReceiptType(value) {
  252. //订单状态文字和颜色
  253. var HtmlStateText = '',
  254. stateTextObject = {
  255. 1: '订单款',
  256. 2: '非订单款',
  257. 3: '返佣款',
  258. 4: '订单款或者非订单款',
  259. 5: '供应商退款'
  260. }
  261. Object.keys(stateTextObject).forEach(function(key) {
  262. if (key == value) {
  263. HtmlStateText = stateTextObject[key]
  264. }
  265. })
  266. return HtmlStateText
  267. }
  268. },
  269. onPageScroll(e) {
  270. //实时获取到滚动的值
  271. // if (e.scrollTop > 30) {
  272. // this.isCmcustomClass = 'fiexd'
  273. // } else {
  274. // this.isCmcustomClass = 'left'
  275. // }
  276. },
  277. onPullDownRefresh() {
  278. setTimeout(() => {
  279. this.getOrderReceiptDetail(this.receiptId)
  280. uni.stopPullDownRefresh()
  281. }, 200)
  282. },
  283. onShareAppMessage(res) {
  284. //分享购买优惠券
  285. const receipt = this.receiptInfo
  286. const receiptTypeText = this.formatReceiptType(receipt.receiptType)
  287. if (res.from === 'button') {
  288. // console.log('来自页面内转发按钮')
  289. }
  290. return {
  291. title: `¥${receipt.receiptAmount.toFixed(2)} | ${receipt.receiptDate} | ${receipt.receiptStatusText}(${receiptTypeText})`,
  292. path: `/pages/login/login-share?id=${receipt.id}`,
  293. imageUrl: 'https://static.caimei365.com/app/crm/image/icon-share@2x.jpg'
  294. }
  295. },
  296. onShow() {}
  297. }
  298. </script>
  299. <style lang="scss">
  300. @import '@/uni.scss';
  301. page {
  302. background: #fff;
  303. }
  304. .tui-header-box {
  305. width: 100%;
  306. background: #ffffff;
  307. z-index: 999;
  308. background-size: cover;
  309. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  310. &.fiexd {
  311. position: fixed;
  312. top: 0;
  313. left: 0;
  314. }
  315. }
  316. .header-top {
  317. width: 100%;
  318. font-size: 16px;
  319. font-weight: 500;
  320. height: 32px;
  321. display: flex;
  322. align-items: center;
  323. justify-content: center;
  324. position: relative;
  325. padding: 0 40rpx;
  326. }
  327. .header-sit {
  328. width: 100%;
  329. box-sizing: border-box;
  330. height: 80rpx;
  331. line-height: 80rpx;
  332. box-sizing: border-box;
  333. color: #ffffff;
  334. .header-sit-text {
  335. text-align: left;
  336. font-size: $font-size-40;
  337. font-weight: 600;
  338. font-family: '正楷';
  339. }
  340. .icon-fanhui {
  341. display: block;
  342. width: 80rpx;
  343. height: 80rpx;
  344. float: left;
  345. text-align: center;
  346. line-height: 80rpx;
  347. font-size: 42rpx;
  348. }
  349. }
  350. .mine {
  351. width: 100%;
  352. height: 100%;
  353. position: relative;
  354. }
  355. .distinguish-section {
  356. width: 100%;
  357. position: absolute;
  358. padding: 40rpx 20rpx;
  359. box-sizing: border-box;
  360. }
  361. .distinguish-section-conten {
  362. width: 100%;
  363. height: auto;
  364. position: relative;
  365. background-color: #ffffff;
  366. border-radius: 20rpx;
  367. padding: 20rpx;
  368. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  369. .section-top {
  370. width: 100%;
  371. height: 66rpx;
  372. box-sizing: border-box;
  373. .title {
  374. float: left;
  375. height: 66rpx;
  376. padding: 13rpx 0;
  377. .title-text {
  378. float: left;
  379. line-height: 40rpx;
  380. height: 40rpx;
  381. color: #333333;
  382. text-align: left;
  383. font-weight: 600;
  384. font-size: $font-size-30;
  385. }
  386. }
  387. .button {
  388. float: right;
  389. box-sizing: border-box;
  390. padding: 0 24rpx;
  391. height: 100%;
  392. line-height: 66rpx;
  393. background: $btn-confirm;
  394. border-radius: 8rpx;
  395. text-align: center;
  396. color: #ffffff;
  397. }
  398. }
  399. .section-top-item {
  400. width: 100%;
  401. height: auto;
  402. margin-top: 10rpx;
  403. position: relative;
  404. float: left;
  405. .list-title-t {
  406. width: 100%;
  407. height: 50rpx;
  408. float: left;
  409. font-size: $font-size-28;
  410. padding-bottom: 10rpx;
  411. .list-title-tip {
  412. float: left;
  413. .badges {
  414. display: block;
  415. float: left;
  416. padding: 0 15rpx;
  417. height: 40rpx;
  418. line-height: 40rpx;
  419. border-radius: 4rpx;
  420. background: $btn-confirm;
  421. font-size: $font-size-24;
  422. text-align: center;
  423. color: #ffffff;
  424. }
  425. }
  426. }
  427. .list-title-b {
  428. width: 100%;
  429. height: 44rpx;
  430. float: left;
  431. font-size: $font-size-24;
  432. line-height: 44rpx;
  433. color: #999999;
  434. text-align: left;
  435. .text {
  436. color: #999999;
  437. }
  438. .list-title-b-item {
  439. width: 50%;
  440. height: 100%;
  441. float: left;
  442. }
  443. &.sms {
  444. height: auto;
  445. padding: 10rpx;
  446. border-radius: 4rpx;
  447. background: #f7f7f7;
  448. }
  449. }
  450. .list-icon {
  451. width: 120rpx;
  452. height: 120rpx;
  453. border-radius: 10rpx;
  454. position: absolute;
  455. right: 0;
  456. top: 0;
  457. color: #dd524d;
  458. z-index: 99;
  459. .list-icon-image{
  460. width: 120rpx;
  461. height: 120rpx;
  462. display: block;
  463. }
  464. }
  465. }
  466. .section-title {
  467. width: 100%;
  468. height: 66rpx;
  469. float: left;
  470. font-size: $font-size-28;
  471. line-height: 66rpx;
  472. color: #333333;
  473. text-align: left;
  474. font-weight: 600;
  475. }
  476. .section-mid {
  477. width: 100%;
  478. height: auto;
  479. display: flex;
  480. flex-direction: column;
  481. position: relative;
  482. border-radius: 0 0 20rpx 20rpx;
  483. .list-title-b {
  484. width: 100%;
  485. height: 50rpx;
  486. float: left;
  487. font-size: $font-size-24;
  488. line-height: 50rpx;
  489. color: #666666;
  490. text-align: left;
  491. .text{
  492. color: #999999;
  493. }
  494. .list-title-b-item {
  495. width: 50%;
  496. height: 100%;
  497. float: left;
  498. }
  499. }
  500. }
  501. .section-tips {
  502. width: 100%;
  503. height: 50rpx;
  504. font-size: $font-size-28;
  505. line-height: 50rpx;
  506. color: $uni-color-error;
  507. text-align: left;
  508. }
  509. }
  510. .distinguish-button {
  511. width: 100%;
  512. position: fixed;
  513. bottom: 0;
  514. left: 0;
  515. background-color: #ffffff;
  516. padding: 0 50rpx;
  517. padding-top: 20rpx;
  518. display: flex;
  519. .button {
  520. flex: 1;
  521. height: 80rpx;
  522. margin: 0 20rpx;
  523. border-radius: 40rpx;
  524. text-align: center;
  525. color: #ffffff;
  526. line-height: 80rpx;
  527. font-size: $font-size-28;
  528. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  529. &.confirm {
  530. background: $btn-confirm;
  531. }
  532. &.cancel {
  533. background: $uni-color-error;
  534. }
  535. }
  536. }
  537. </style>