detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  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="list-title-tip">
  36. <text class="badges">{{ receiptInfo.receiptType | formatReceiptType }}款</text>
  37. </view>
  38. <view class="title-text">收款信息</view>
  39. </view>
  40. <view class="button" @click="toNoSms('/pages/collection/list')">
  41. <text class="iconfont icon-wodedingdan"></text> 收款列表
  42. </view>
  43. </view>
  44. <view class="section-top-item">
  45. <view class="list-title-b">
  46. <view class="list-title-b-item ">
  47. 收款金额:<text class="text">¥{{ receiptInfo.receiptAmount | NumFormat }}</text>
  48. </view>
  49. <view class="list-title-b-item ">
  50. 收款类型:<text class="text">{{ receiptInfo.payTypeText }}</text>
  51. </view>
  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.$util.msg(err.msg, 2000)
  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: '#FEAC20',
  192. 2: '#4cd964',
  193. 3: '#34CC8C',
  194. 4: '#F94B4B',
  195. 5: '#007aff'
  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/img/icon/icon-shareCoupon@2x.png'
  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. .list-title-tip {
  335. float: left;
  336. margin-right: 15rpx;
  337. .badges {
  338. display: block;
  339. float: left;
  340. padding: 0 15rpx;
  341. height: 40rpx;
  342. line-height: 40rpx;
  343. border-radius: 4rpx;
  344. background: $btn-confirm;
  345. font-size: $font-size-24;
  346. text-align: center;
  347. color: #ffffff;
  348. }
  349. }
  350. .title-text {
  351. float: left;
  352. line-height: 40rpx;
  353. height: 40rpx;
  354. color: #333333;
  355. text-align: left;
  356. font-weight: 600;
  357. }
  358. }
  359. .button {
  360. float: right;
  361. box-sizing: border-box;
  362. padding: 0 24rpx;
  363. height: 100%;
  364. line-height: 66rpx;
  365. background: $btn-confirm;
  366. border-radius: 8rpx;
  367. text-align: center;
  368. color: #ffffff;
  369. }
  370. }
  371. .section-top-item {
  372. width: 100%;
  373. height: auto;
  374. margin-top: 10rpx;
  375. position: relative;
  376. float: left;
  377. .list-title-b {
  378. width: 100%;
  379. height: 44rpx;
  380. float: left;
  381. font-size: $font-size-24;
  382. line-height: 44rpx;
  383. color: #999999;
  384. text-align: left;
  385. .text {
  386. color: #999999;
  387. }
  388. .list-title-b-item {
  389. width: 50%;
  390. height: 100%;
  391. float: left;
  392. }
  393. &.sms {
  394. height: 120rpx;
  395. padding: 10rpx;
  396. border-radius: 4rpx;
  397. background: #f7f7f7;
  398. }
  399. }
  400. }
  401. .section-title {
  402. width: 100%;
  403. height: 66rpx;
  404. float: left;
  405. font-size: $font-size-28;
  406. line-height: 66rpx;
  407. color: #333333;
  408. text-align: left;
  409. font-weight: 600;
  410. }
  411. .section-mid {
  412. width: 100%;
  413. height: auto;
  414. display: flex;
  415. flex-direction: column;
  416. position: relative;
  417. border-radius: 0 0 20rpx 20rpx;
  418. .list-title {
  419. width: 100%;
  420. height: auto;
  421. .list-title-b {
  422. width: 100%;
  423. height: 50rpx;
  424. float: left;
  425. font-size: $font-size-24;
  426. line-height: 50rpx;
  427. color: #666666;
  428. text-align: left;
  429. .text{
  430. color: #999999;
  431. }
  432. .list-title-b-item {
  433. width: 50%;
  434. height: 100%;
  435. float: left;
  436. }
  437. }
  438. }
  439. }
  440. .section-tips {
  441. width: 100%;
  442. height: 50rpx;
  443. font-size: $font-size-28;
  444. line-height: 50rpx;
  445. color: $uni-color-error;
  446. text-align: left;
  447. }
  448. }
  449. .tui-order-item {
  450. display: flex;
  451. flex-direction: column;
  452. width: 100%;
  453. background: #fff;
  454. margin-bottom: 24rpx;
  455. border-radius: 8rpx;
  456. position: relative;
  457. .list-detail {
  458. width: 70rpx;
  459. height: 80rpx;
  460. line-height: 80rpx;
  461. text-align: right;
  462. position: absolute;
  463. right: 0;
  464. bottom: 0;
  465. .iconfont {
  466. font-size: $font-size-32;
  467. color: #999999;
  468. }
  469. }
  470. }
  471. .distinguish-button {
  472. width: 100%;
  473. position: fixed;
  474. bottom: 0;
  475. left: 0;
  476. background-color: #ffffff;
  477. padding: 0 50rpx;
  478. padding-top: 20rpx;
  479. display: flex;
  480. .button {
  481. flex: 1;
  482. height: 80rpx;
  483. margin: 0 20rpx;
  484. border-radius: 40rpx;
  485. text-align: center;
  486. color: #ffffff;
  487. line-height: 80rpx;
  488. font-size: $font-size-28;
  489. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  490. &.confirm {
  491. background: $btn-confirm;
  492. }
  493. &.cancel {
  494. background: $uni-color-error;
  495. }
  496. }
  497. }
  498. </style>