detail.vue 12 KB

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