paymentRecord.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template name="record">
  2. <view class="record-template">
  3. <!-- 支付记录 -->
  4. <view class="record-content">
  5. <view class="record-title">
  6. <view class="record-title-l">支付记录</view>
  7. <view class="record-title-r" v-if="!isEmpty">
  8. 已支付:<text class="red">¥{{ receiptAmount != null ? receiptAmount.toFixed(2): '0.00'}}</text>
  9. </view>
  10. </view>
  11. <view class="record-empty" v-if="isEmpty">
  12. <text>暂无支付记录</text>
  13. </view>
  14. <view class="record-list" v-else>
  15. <view class="record-item" v-for="(item,index) in discernReceiptList" :key="index">
  16. <view class="item-time mm">¥{{item.associateAmount.toFixed(2)}}</view>
  17. <view class="item-time pp">{{payTypeText(item.payType)}}</view>
  18. <view class="item-time tt">{{item.receiptDate}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default{
  26. name:"record",
  27. props:{
  28. discernReceiptList:{
  29. type:Array
  30. },
  31. receiptAmount:{
  32. type:Number
  33. }
  34. },
  35. data() {
  36. return{
  37. isEmpty:false,
  38. paymentData:'',
  39. typeText:'',
  40. isOpen:false,
  41. }
  42. },
  43. created(){
  44. this.initData(this.discernReceiptList)
  45. },
  46. computed: {
  47. },
  48. methods:{
  49. initData(res) {
  50. if(res!=''){
  51. this.isEmpty = false
  52. this.paymentData = res;
  53. }else{
  54. this.isEmpty = true
  55. }
  56. },
  57. payTypeText (state){//处理支付记录文字
  58. let stateText = '',
  59. stateTextObject={
  60. 12:'企业网银',
  61. 13:'微信支付',
  62. 14:'支付宝',
  63. 15:'微信支付',
  64. 16:'余额抵扣',
  65. }
  66. Object.keys(stateTextObject).forEach(key => {
  67. if(key == state){
  68. stateText = stateTextObject[key]
  69. }
  70. })
  71. return stateText;
  72. },
  73. }
  74. }
  75. </script>
  76. <style lang="scss">
  77. .record-template{
  78. width: 100%;
  79. height: auto;
  80. background: #FFFFFF;
  81. float: left;
  82. margin-top: 24rpx;
  83. .record-content{
  84. width: 702rpx;
  85. padding: 20rpx 24rpx;
  86. height: auto;
  87. .record-title{
  88. width: 100%;
  89. font-size: $font-size-28;
  90. color: $text-color;
  91. text-align: left;
  92. line-height: 40rpx;
  93. margin-bottom: 12rpx;
  94. float: left;
  95. .record-title-l{
  96. font-weight: bold;
  97. float: left;
  98. }
  99. .record-title-r{
  100. float: right;
  101. .red{
  102. color: #ff457b;
  103. font-weight: bold;
  104. }
  105. }
  106. }
  107. .record-empty{
  108. font-size: $font-size-28;
  109. color: $text-color;
  110. text-align: left;
  111. line-height: 40rpx;
  112. }
  113. .record-list{
  114. width: 100%;
  115. height: auto;
  116. float: left;
  117. margin-top: 12rpx;
  118. .record-item{
  119. height: 40rpx;
  120. width: 100%;
  121. padding: 12rpx 0;
  122. font-size: $font-size-28;
  123. line-height: 40rpx;
  124. float: left;
  125. display: flex;
  126. justify-content: center;
  127. flex-direction: row;
  128. .item-time{
  129. &.mm{
  130. flex: 3;
  131. color: $text-color;
  132. }
  133. &.pp{
  134. flex: 3;
  135. color: $text-color;
  136. }
  137. &.tt{
  138. flex: 4;
  139. color: #999999;
  140. }
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>