detail.vue 12 KB

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