detail.vue 12 KB

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