cm-payment-temp.vue 3.2 KB

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