paymentRecord.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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 tt">{{ item.receiptDate }}</view>
  17. <view class="item-time pp">{{ item.payTypeStr }}</view>
  18. <view class="item-time mm">¥{{item.associateAmount.toFixed(2)}}</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. 18:'大额银联转账',
  66. }
  67. Object.keys(stateTextObject).forEach(key => {
  68. if(key == state){
  69. stateText = stateTextObject[key]
  70. }
  71. })
  72. return stateText
  73. },
  74. }
  75. }
  76. </script>
  77. <style lang="scss">
  78. .record-template{
  79. width: 100%;
  80. height: auto;
  81. background: #FFFFFF;
  82. float: left;
  83. margin-top: 24rpx;
  84. .record-content{
  85. width: 702rpx;
  86. padding: 20rpx 24rpx;
  87. height: auto;
  88. .record-title{
  89. width: 100%;
  90. font-size: $font-size-28;
  91. color: $text-color;
  92. text-align: left;
  93. line-height: 40rpx;
  94. margin-bottom: 12rpx;
  95. float: left;
  96. .record-title-l{
  97. font-weight: bold;
  98. float: left;
  99. }
  100. .record-title-r{
  101. float: right;
  102. .red{
  103. color: #FF2A2A;
  104. font-weight: bold;
  105. }
  106. }
  107. }
  108. .record-empty{
  109. font-size: $font-size-28;
  110. color: $text-color;
  111. text-align: left;
  112. line-height: 40rpx;
  113. }
  114. .record-list{
  115. width: 100%;
  116. height: auto;
  117. float: left;
  118. margin-top: 12rpx;
  119. .record-item{
  120. height: 40rpx;
  121. width: 100%;
  122. padding: 12rpx 0;
  123. font-size: $font-size-28;
  124. line-height: 40rpx;
  125. float: left;
  126. display: flex;
  127. justify-content: center;
  128. flex-direction: row;
  129. .item-time{
  130. &.mm{
  131. flex: 3;
  132. color: $text-color;
  133. text-align: right;
  134. }
  135. &.pp{
  136. flex: 3;
  137. color: $text-color;
  138. }
  139. &.tt{
  140. flex: 4;
  141. color: #999999;
  142. }
  143. }
  144. }
  145. }
  146. }
  147. }
  148. </style>