detail.vue 12 KB

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