cm-record-popup.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template name="record">
  2. <view class="record-template">
  3. <!-- 支付记录 -->
  4. <tui-bottom-popup :radius="true" :show="show">
  5. <view class="tui-popup-box clearfix">
  6. <view class="title">
  7. 支付记录
  8. <view class="title-close">
  9. <text class="iconfont icon-iconfontguanbi" @click="hidePopup"></text>
  10. </view>
  11. </view>
  12. <view class="tui-popup-main coupon">
  13. <scroll-view class="tui-popup-scroll" scroll-y="true">
  14. <view class="list-main" v-if="dataList.length > 0">
  15. <view class="list-item" v-for="(record, index) in dataList" :key="index">
  16. <view class="list-item-cell">
  17. <text class="text row-1">¥{{ record.receiptAmount | NumFormat }}</text>
  18. <text class="text row-2">{{ record.payType | payTypeText }}</text>
  19. </view>
  20. <view class="list-item-cell">
  21. <text class="text row-3">{{ record.receiptDate }}</text>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="list-none" v-else>暂无支付记录</view>
  26. </scroll-view>
  27. </view>
  28. </view>
  29. </tui-bottom-popup>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. name: 'record',
  35. props: {
  36. show: {
  37. type: Boolean,
  38. default: false
  39. },
  40. list: {
  41. type: Array,
  42. default: []
  43. }
  44. },
  45. data() {
  46. return {
  47. isIphoneX: this.$store.state.isIphoneX,
  48. dataList: [
  49. {
  50. receiptAmount: '1000',
  51. payType: 12,
  52. receiptDate: '2022-10-31 17:24:35'
  53. },
  54. {
  55. receiptAmount: '1000',
  56. payType: 13,
  57. receiptDate: '2022-10-31 17:24:35'
  58. },
  59. {
  60. receiptAmount: '1000',
  61. payType: 15,
  62. receiptDate: '2022-10-31 17:24:35'
  63. },
  64. {
  65. receiptAmount: '1000',
  66. payType: 17,
  67. receiptDate: '2022-10-31 17:24:35'
  68. }
  69. ]
  70. }
  71. },
  72. filters: {
  73. NumFormat(value) {
  74. //处理金额
  75. if (value) {
  76. return Number(value).toFixed(2)
  77. } else {
  78. return '0.00'
  79. }
  80. },
  81. payTypeText(vaule) {
  82. //处理支付记录文字
  83. const map = {
  84. 12: '企业网银',
  85. 13: '微信支付',
  86. 14: '支付宝',
  87. 15: '微信支付',
  88. 16: '余额抵扣',
  89. 17: '建设银行借记卡(0053)'
  90. }
  91. return map[vaule]
  92. }
  93. },
  94. created() {
  95. // this.dataList = this.list
  96. },
  97. methods: {
  98. hidePopup() {
  99. this.$parent.popupShow = false
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss">
  105. .record-template {
  106. width: 100%;
  107. height: auto;
  108. background: #ffffff;
  109. float: left;
  110. margin-top: 24rpx;
  111. }
  112. .tui-popup-box {
  113. position: relative;
  114. box-sizing: border-box;
  115. min-height: 220rpx;
  116. padding: 24rpx 32rpx 0 32rpx;
  117. .title {
  118. font-size: $font-size-32;
  119. color: $text-color;
  120. line-height: 68rpx;
  121. text-align: center;
  122. float: left;
  123. width: 100%;
  124. height: 68rpx;
  125. box-sizing: border-box;
  126. padding: 0 24rpx;
  127. position: relative;
  128. font-weight: bold;
  129. .title-close {
  130. width: 68rpx;
  131. height: 68rpx;
  132. text-align: center;
  133. line-height: 68rpx;
  134. position: absolute;
  135. right: 0;
  136. top: 0;
  137. .iconfont {
  138. color: #b2b2b2;
  139. font-size: 40rpx;
  140. }
  141. }
  142. }
  143. .tui-popup-main {
  144. width: 100%;
  145. float: left;
  146. padding-top: 10rpx;
  147. .tui-popup-scroll {
  148. width: 100%;
  149. height: 600rpx;
  150. .list-none {
  151. line-height: 80rpx;
  152. font-size: $font-size-26;
  153. color: #999999;
  154. text-align: left;
  155. }
  156. .list-main {
  157. height: auto;
  158. display: flex;
  159. flex-direction: column;
  160. .list-item {
  161. width: 100%;
  162. height: auto;
  163. box-sizing: border-box;
  164. padding: 24rpx 0;
  165. border-bottom: 1px solid #e1e1e1;
  166. &:last-child {
  167. border-bottom: none;
  168. }
  169. .list-item-cell {
  170. width: 100%;
  171. height: 44rpx;
  172. display: flex;
  173. flex: 1;
  174. line-height: 44rpx;
  175. font-size: $font-size-26;
  176. color: $text-color;
  177. .text {
  178. flex: 1;
  179. &.row-1 {
  180. flex: 3;
  181. }
  182. &.row-2 {
  183. flex: 7;
  184. }
  185. &.row-3 {
  186. color: #999999;
  187. }
  188. }
  189. }
  190. }
  191. }
  192. }
  193. }
  194. }
  195. </style>