detail.vue 8.8 KB

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