detail.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <template>
  2. <view class="container mine clearfix">
  3. <view class="tui-header-box first"
  4. :style="{ height: isCmcustomClass == 'fiexd' ? CustomBar + 10 + 'px' : CustomBar + 30 + 'px' }"
  5. :class="isCmcustomClass">
  6. <view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 30 + 'px' }"></view>
  7. <view class="header-sit">
  8. <text class="iconfont icon-fanhui" @click.stop="this.$api.navigateBack(1)"></text>
  9. <text class="header-sit-text">款项信息</text>
  10. </view>
  11. </view>
  12. <view class="tui-header-box"
  13. :style="{ height: CustomBar + 30 + 'px', backgroundImage: 'url(https://static.caimei365.com/app/crm/image/statistic_bg1.png)' }">
  14. </view>
  15. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="7"></tui-skeleton>
  16. <view class="distinguish-section" v-else :style="{ top: CustomBar + 'px', left: 0 + 'px' }">
  17. <view class="distinguish-section-conten">
  18. <view class="section-rows">
  19. <view class="rows-label">收款金额:</view>
  20. <view class="rows-mains">
  21. <text>¥{{ receipt.receiptAmount | NumFormat }}</text>
  22. </view>
  23. </view>
  24. <view class="section-rows">
  25. <view class="rows-label">收款类型:</view>
  26. <view class="rows-mains">
  27. <text>{{ receipt.payTypeText }}</text>
  28. </view>
  29. </view>
  30. <view class="section-rows">
  31. <view class="rows-label">收款时间:</view>
  32. <view class="rows-mains">
  33. <text>{{ receipt.receiptDate }}</text>
  34. </view>
  35. </view>
  36. <view class="section-rows">
  37. <view class="rows-label">手续费:</view>
  38. <view class="rows-mains">
  39. <text>¥{{ receipt.handlingFee ? (receipt.handlingFee | NumFormat) : '0.00' }}</text>
  40. </view>
  41. </view>
  42. <view class="section-title">收款短信</view>
  43. <view class="section-textarea msg">
  44. <view class="textarea">{{ receipt.smsContent ? receipt.smsContent : '无' }}</view>
  45. </view>
  46. </view>
  47. <view class="distinguish-button">
  48. <button class="button" open-type="share" :data-receipt="receipt">分享</button>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import wxLogin from '@/services/wxLogin.js'
  55. import {
  56. mapState,
  57. mapMutations
  58. } from 'vuex'
  59. export default {
  60. data() {
  61. return {
  62. receipt:{},
  63. receiptId:0,
  64. nvabarData: {
  65. //顶部自定义导航
  66. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  67. showSearch: 0,
  68. title: '', // 导航栏 中间的标题
  69. haveBack: false,
  70. home: false,
  71. textLeft: this.$store.state.isIphone,
  72. bgColor: '#D33020',
  73. textColor: '#ffffff'
  74. },
  75. modalButton: [{
  76. text: '取消',
  77. type: 'gray',
  78. plain: true //是否空心
  79. },
  80. {
  81. text: '确认',
  82. customStyle: {
  83. color: '#fff',
  84. bgColor: '#4688fa'
  85. },
  86. plain: false
  87. }
  88. ],
  89. isCmcustomClass: 'left',
  90. CustomBar: this.CustomBar, // 顶部导航栏高度
  91. skeletonShow:true,
  92. height: 64, //header高度
  93. top: 0, //标题图标距离顶部距离
  94. scrollH: 0, //滚动总高度
  95. opcity: 1,
  96. }
  97. },
  98. computed: {
  99. ...mapState(['hasLogin'])
  100. },
  101. onLoad(option) {
  102. let obj = {}
  103. // #ifdef MP-WEIXIN
  104. obj = wx.getMenuButtonBoundingClientRect()
  105. // #endif
  106. // #ifdef MP-BAIDU
  107. obj = swan.getMenuButtonBoundingClientRect()
  108. // #endif
  109. // #ifdef MP-ALIPAY
  110. my.hideAddToDesktopMenu()
  111. // #endif
  112. uni.getSystemInfo({
  113. success: res => {
  114. this.width = obj.left || res.windowWidth
  115. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  116. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  117. this.scrollH = res.windowWidth * 0.6
  118. }
  119. })
  120. this.receiptId = option.id
  121. this.getOrderReceiptShareDetail(option.id)
  122. },
  123. methods: {
  124. getOrderReceiptShareDetail(id){
  125. // 收款详情
  126. this.OrderService.orderReceiptShareDetail({ id : id})
  127. .then(response => {
  128. this.receipt = response.data
  129. this.skeletonShow = false
  130. })
  131. .catch(err => {
  132. this.$util.msg(err.msg, 2000)
  133. })
  134. },
  135. formatReceiptType(value) {
  136. //订单状态文字和颜色
  137. var HtmlStateText = '',
  138. stateTextObject = {
  139. 1: '订单款',
  140. 2: '非订单款',
  141. 3: '返佣款',
  142. 4: '订单款或者非订单款',
  143. 5: '供应商退款'
  144. }
  145. Object.keys(stateTextObject).forEach(function(key) {
  146. if (key == value) {
  147. HtmlStateText = stateTextObject[key]
  148. }
  149. })
  150. return HtmlStateText
  151. },
  152. },
  153. onPageScroll(e) {
  154. //实时获取到滚动的值
  155. // if (e.scrollTop > 30) {
  156. // this.isCmcustomClass = 'fiexd'
  157. // } else {
  158. // this.isCmcustomClass = 'left'
  159. // }
  160. },
  161. onPullDownRefresh() {
  162. setTimeout(() => {
  163. this.getOrderReceiptShareDetail(this.receiptId)
  164. uni.stopPullDownRefresh()
  165. }, 200)
  166. },
  167. onShareAppMessage(res) {
  168. //分享收款详情
  169. const receipt = res.target.dataset.receipt
  170. const receiptTypeText = this.formatReceiptType(receipt.receiptType)
  171. if (res.from === 'button') {
  172. // console.log('来自页面内转发按钮')
  173. return {
  174. title: `【${receipt.receiptStatusText}(${receiptTypeText})】收款金额${receipt.receiptAmount.toFixed(2)}元,收款时间:${receipt.receiptDate}`,
  175. path: `/pages/login/login-share?id=${receipt.id}`,
  176. imageUrl: 'https://static.caimei365.com/app/crm/image/icon-share@2x.jpg'
  177. }
  178. }
  179. },
  180. onShow() {
  181. }
  182. }
  183. </script>
  184. <style lang="scss">
  185. @import '@/uni.scss';
  186. page {
  187. background: #fff;
  188. }
  189. .tui-header-box {
  190. width: 100%;
  191. background: #ffffff;
  192. z-index: 999;
  193. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  194. background-size: cover;
  195. &.fiexd {
  196. position: fixed;
  197. top: 0;
  198. left: 0;
  199. }
  200. }
  201. .header-top {
  202. width: 100%;
  203. font-size: 16px;
  204. font-weight: 500;
  205. height: 32px;
  206. display: flex;
  207. align-items: center;
  208. justify-content: center;
  209. position: relative;
  210. padding: 0 40rpx;
  211. }
  212. .header-sit {
  213. width: 100%;
  214. box-sizing: border-box;
  215. height: 80rpx;
  216. line-height: 80rpx;
  217. box-sizing: border-box;
  218. color: #ffffff;
  219. .header-sit-text {
  220. text-align: left;
  221. font-size: $font-size-40;
  222. font-weight: 600;
  223. font-family: '正楷';
  224. }
  225. .icon-fanhui {
  226. display: block;
  227. width: 80rpx;
  228. height: 80rpx;
  229. float: left;
  230. text-align: center;
  231. line-height: 80rpx;
  232. font-size: 42rpx;
  233. }
  234. }
  235. .mine {
  236. width: 100%;
  237. height: 100%;
  238. position: relative;
  239. }
  240. .distinguish-section {
  241. width: 100%;
  242. position: absolute;
  243. padding: 20rpx 20rpx;
  244. box-sizing: border-box;
  245. }
  246. .distinguish-section-conten {
  247. width: 100%;
  248. height: auto;
  249. position: relative;
  250. background-color: #ffffff;
  251. border-radius: 20rpx;
  252. padding: 20rpx;
  253. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  254. .section-rows {
  255. width: 100%;
  256. height: 80rpx;
  257. box-sizing: border-box;
  258. padding: 0 20rpx;
  259. border-radius: 8rpx;
  260. background: #f8f8f8;
  261. margin-bottom: 20rpx;
  262. line-height: 80rpx;
  263. display: flex;
  264. position: relative;
  265. &.disabled {
  266. background: #e1e1e1;
  267. }
  268. .rows-label {
  269. flex: 3;
  270. .iconfont {
  271. margin-right: 8rpx;
  272. &.icon-yixuanze {
  273. color: $color-system;
  274. }
  275. }
  276. }
  277. .rows-mains {
  278. flex: 7;
  279. text-align: left;
  280. font-size: $font-size-28;
  281. color: #666666;
  282. height: 80rpx;
  283. line-height: 80rpx;
  284. }
  285. .icon-xiayibu {
  286. display: block;
  287. width: 40rpx;
  288. height: 80rpx;
  289. position: absolute;
  290. right: 0;
  291. text-align: center;
  292. font-size: $font-size-32;
  293. }
  294. }
  295. .section-title {
  296. width: 100%;
  297. height: 40rpx;
  298. box-sizing: border-box;
  299. padding: 0 20rpx;
  300. text-align: left;
  301. font-size: $font-size-28;
  302. color: #333333;
  303. line-height: 40rpx;
  304. font-weight: bold;
  305. margin-bottom: 20rpx;
  306. }
  307. .section-textarea {
  308. width: 100%;
  309. height: 180rpx;
  310. box-sizing: border-box;
  311. padding: 20rpx;
  312. background: #f7f7f7;
  313. border-radius: 8rpx;
  314. &.msg {
  315. height: 180rpx;
  316. margin-bottom: 10rpx;
  317. }
  318. .textarea {
  319. width: 100%;
  320. height: 100%;
  321. color: #666666;
  322. }
  323. }
  324. }
  325. .distinguish-button {
  326. width: 100%;
  327. height: 80rpx;
  328. margin-top: 100rpx;
  329. box-sizing: border-box;
  330. padding: 0 50rpx;
  331. .button {
  332. width: 100%;
  333. height: 80rpx;
  334. background: $btn-confirm;
  335. border-radius: 40rpx;
  336. text-align: center;
  337. color: #ffffff;
  338. line-height: 80rpx;
  339. font-size: $font-size-28;
  340. }
  341. }
  342. .uni-badge--small {
  343. -webkit-transform: scale(0.8);
  344. -ms-transform: scale(0.8);
  345. transform: scale(0.8);
  346. -webkit-transform-origin: center center;
  347. -ms-transform-origin: center center;
  348. transform-origin: center center;
  349. }
  350. .uni-badge {
  351. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  352. -webkit-box-sizing: border-box;
  353. box-sizing: border-box;
  354. font-size: 12px;
  355. line-height: 1;
  356. display: inline-block;
  357. padding: 3px 6px;
  358. color: #333;
  359. border-radius: 100px;
  360. background-color: #f1f1f1;
  361. }
  362. .uni-badge-error {
  363. color: #fff;
  364. background-color: #dd524d;
  365. }
  366. </style>