detail.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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. payDetailsId: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.payDetailsId = option.id
  121. this.getOrderReceiptDetail(option.id)
  122. },
  123. methods: {
  124. getOrderReceiptDetail(id){
  125. // 收款详情
  126. this.OrderService.orderReceiptDetail({ 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. },
  136. onPageScroll(e) {
  137. //实时获取到滚动的值
  138. // if (e.scrollTop > 30) {
  139. // this.isCmcustomClass = 'fiexd'
  140. // } else {
  141. // this.isCmcustomClass = 'left'
  142. // }
  143. },
  144. onPullDownRefresh() {
  145. setTimeout(() => {
  146. this.getOrderReceiptDetail(this.payDetailsId)
  147. uni.stopPullDownRefresh()
  148. }, 200)
  149. },
  150. onShareAppMessage(res) {
  151. //分享收款详情
  152. const receipt = res.target.dataset.receipt
  153. console.log('receipt', receipt)
  154. if (res.from === 'button') {
  155. // console.log('来自页面内转发按钮')
  156. return {
  157. title: `【待确认】收款金额${receipt.receiptAmount.toFixed(2)}元,收款时间:${receipt.receiptDate}`,
  158. path: `/pages/login/login-share?id=${receipt.id}&receiptType=${receipt.receiptType}`,
  159. imageUrl: 'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
  160. }
  161. }
  162. },
  163. onShow() {
  164. }
  165. }
  166. </script>
  167. <style lang="scss">
  168. @import '@/uni.scss';
  169. page {
  170. background: #fff;
  171. }
  172. .tui-header-box {
  173. width: 100%;
  174. background: #ffffff;
  175. z-index: 999;
  176. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  177. background-size: cover;
  178. &.fiexd {
  179. position: fixed;
  180. top: 0;
  181. left: 0;
  182. }
  183. }
  184. .header-top {
  185. width: 100%;
  186. font-size: 16px;
  187. font-weight: 500;
  188. height: 32px;
  189. display: flex;
  190. align-items: center;
  191. justify-content: center;
  192. position: relative;
  193. padding: 0 40rpx;
  194. }
  195. .header-sit {
  196. width: 100%;
  197. box-sizing: border-box;
  198. height: 80rpx;
  199. line-height: 80rpx;
  200. box-sizing: border-box;
  201. color: #ffffff;
  202. .header-sit-text {
  203. text-align: left;
  204. font-size: $font-size-40;
  205. font-weight: 600;
  206. font-family: '正楷';
  207. }
  208. .icon-fanhui {
  209. display: block;
  210. width: 80rpx;
  211. height: 80rpx;
  212. float: left;
  213. text-align: center;
  214. line-height: 80rpx;
  215. font-size: 42rpx;
  216. }
  217. }
  218. .mine {
  219. width: 100%;
  220. height: 100%;
  221. position: relative;
  222. }
  223. .distinguish-section {
  224. width: 100%;
  225. position: absolute;
  226. padding: 20rpx 20rpx;
  227. box-sizing: border-box;
  228. }
  229. .distinguish-section-conten {
  230. width: 100%;
  231. height: auto;
  232. position: relative;
  233. background-color: #ffffff;
  234. border-radius: 20rpx;
  235. padding: 20rpx;
  236. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  237. .section-rows {
  238. width: 100%;
  239. height: 80rpx;
  240. box-sizing: border-box;
  241. padding: 0 20rpx;
  242. border-radius: 8rpx;
  243. background: #f8f8f8;
  244. margin-bottom: 20rpx;
  245. line-height: 80rpx;
  246. display: flex;
  247. position: relative;
  248. &.disabled {
  249. background: #e1e1e1;
  250. }
  251. .rows-label {
  252. flex: 3;
  253. .iconfont {
  254. margin-right: 8rpx;
  255. &.icon-yixuanze {
  256. color: $color-system;
  257. }
  258. }
  259. }
  260. .rows-mains {
  261. flex: 7;
  262. text-align: left;
  263. font-size: $font-size-28;
  264. color: #666666;
  265. height: 80rpx;
  266. line-height: 80rpx;
  267. }
  268. .icon-xiayibu {
  269. display: block;
  270. width: 40rpx;
  271. height: 80rpx;
  272. position: absolute;
  273. right: 0;
  274. text-align: center;
  275. font-size: $font-size-32;
  276. }
  277. }
  278. .section-title {
  279. width: 100%;
  280. height: 40rpx;
  281. box-sizing: border-box;
  282. padding: 0 20rpx;
  283. text-align: left;
  284. font-size: $font-size-28;
  285. color: #333333;
  286. line-height: 40rpx;
  287. font-weight: bold;
  288. margin-bottom: 20rpx;
  289. }
  290. .section-textarea {
  291. width: 100%;
  292. height: 180rpx;
  293. box-sizing: border-box;
  294. padding: 20rpx;
  295. background: #f7f7f7;
  296. border-radius: 8rpx;
  297. &.msg {
  298. height: 180rpx;
  299. margin-bottom: 10rpx;
  300. }
  301. .textarea {
  302. width: 100%;
  303. height: 100%;
  304. color: #666666;
  305. }
  306. }
  307. }
  308. .distinguish-button {
  309. width: 100%;
  310. height: 80rpx;
  311. margin-top: 100rpx;
  312. box-sizing: border-box;
  313. padding: 0 50rpx;
  314. .button {
  315. width: 100%;
  316. height: 80rpx;
  317. background: $btn-confirm;
  318. border-radius: 40rpx;
  319. text-align: center;
  320. color: #ffffff;
  321. line-height: 80rpx;
  322. font-size: $font-size-28;
  323. }
  324. }
  325. .uni-badge--small {
  326. -webkit-transform: scale(0.8);
  327. -ms-transform: scale(0.8);
  328. transform: scale(0.8);
  329. -webkit-transform-origin: center center;
  330. -ms-transform-origin: center center;
  331. transform-origin: center center;
  332. }
  333. .uni-badge {
  334. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  335. -webkit-box-sizing: border-box;
  336. box-sizing: border-box;
  337. font-size: 12px;
  338. line-height: 1;
  339. display: inline-block;
  340. padding: 3px 6px;
  341. color: #333;
  342. border-radius: 100px;
  343. background-color: #f1f1f1;
  344. }
  345. .uni-badge-error {
  346. color: #fff;
  347. background-color: #dd524d;
  348. }
  349. </style>