detail.vue 8.5 KB

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