detail.vue 13 KB

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