invoiceList.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <div class="iApp">
  3. <div class="log_list" v-if="list.length">
  4. <div class="list_box" v-for="(item, index) of list" :key="index" @click="toDetail(item.fpqqlsh)">
  5. <div class="list_item">
  6. <div class="p1 flex_r flex_jb c05">
  7. <span>状态:{{ typeStatus(item.status) }}</span>
  8. <span>{{item.create_time}}</span>
  9. </div>
  10. <div class="p2 flex_r flex_jb">
  11. <div class="tit ellipsis">电子发票</div>
  12. <span class="money">金额{{ item.money}}</span>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="zanwu" v-else>
  18. <img src="@/static/img/zanwu.png" alt="" class="zanwuimg">
  19. <view class="zanwutxt">暂无开票历史</view>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import { post } from "@/request/api.js";
  25. var app = getApp();
  26. var appEv = app.$vm.$options;
  27. export default {
  28. name: "iApp",
  29. components: {},
  30. data() {
  31. return {
  32. list: [],
  33. page: 1,
  34. rows: 10,
  35. selectedId: [],
  36. selectedLi: [],
  37. height: undefined,
  38. trueTotal: 0,
  39. money: 0,
  40. };
  41. },
  42. onLoad(option) {
  43. let that = this;
  44. uni.getSystemInfo({
  45. success: function (res) {
  46. that.height = res.windowHeight * 2 - 150 + "rpx";
  47. that.getList();
  48. },
  49. });
  50. },
  51. onLaunch() {},
  52. onShow() {},
  53. onHide() {},
  54. //页面上拉触底事件的处理函数
  55. onReachBottom() {
  56. if (this.page != -1) {
  57. var that = this;
  58. setTimeout(function () {
  59. that.page++;
  60. that.getList();
  61. }, 800);
  62. }
  63. },
  64. methods: {
  65. getList() {
  66. let data = {
  67. page: this.page,
  68. rows: this.rows,
  69. };
  70. post("v1/invoice/myInvoice", data).then((res) => {
  71. if (res.code == 0) {
  72. this.list = this.list.concat(res.data.data);
  73. this.total = res.data.total;
  74. if (Math.ceil(this.total / this.rows) <= this.page) {
  75. this.page = -1;
  76. }
  77. }
  78. });
  79. },
  80. toDetail(id){
  81. this.goto("/pagesB/invoice/Billingresult",{id : id});
  82. },
  83. },
  84. computed: {
  85. typeStatus(){
  86. return (da) => {
  87. let str;
  88. if (da === 1) str = "已开票";
  89. if (da === 2) str = "开票失败";
  90. if (da === 4) str = "红冲发票";
  91. if (da === 5) str = "开票中";
  92. if (da === 6) str = "发票作废";
  93. return str;
  94. };
  95. }
  96. },
  97. watch: {
  98. },
  99. };
  100. </script>
  101. <style scoped lang='scss'>
  102. .iApp {
  103. min-height: 100vh;
  104. background: #fff;
  105. .log_list {
  106. padding: 32rpx 32rpx;
  107. overflow: scroll;
  108. .log_title {
  109. line-height: 40rpx;
  110. margin-bottom: 20rpx;
  111. .tit {
  112. font-size: 36rpx;
  113. font-weight: bold;
  114. .log_num {
  115. font-size: 28rpx;
  116. margin-left: 10rpx;
  117. }
  118. .active {
  119. border-bottom: 4rpx solid #3a88ff;
  120. }
  121. }
  122. .mor {
  123. font-size: 24rpx;
  124. color: rgba($color: #000, $alpha: 0.5);
  125. .icofont {
  126. font-size: 22rpx;
  127. }
  128. }
  129. }
  130. .list_box {
  131. margin-top: 20rpx;
  132. .list_item {
  133. background: #fff;
  134. padding: 32rpx;
  135. border-radius: 16rpx;
  136. margin-bottom: 20rpx;
  137. border: 1px solid #ddd;
  138. .list_item_l {
  139. width: 68rpx;
  140. // text-align: center;
  141. .iconfont {
  142. font-size: 36rpx;
  143. }
  144. }
  145. .list_item_r {
  146. width: calc(100% - 68rpx);
  147. }
  148. &:last-child {
  149. margin-bottom: 0;
  150. }
  151. }
  152. .p1 {
  153. font-size: 25rpx;
  154. margin-bottom: 20rpx;
  155. }
  156. .p2 {
  157. .odr_img {
  158. object-fit: cover;
  159. width: 120rpx;
  160. height: 112rpx;
  161. }
  162. .odr_info {
  163. width: calc(100% - 120rpx - 20rpx);
  164. font-size: 24rpx;
  165. color: rgba($color: #000, $alpha: 0.5);
  166. .tit {
  167. color: rgba($color: #000, $alpha: 0.9);
  168. }
  169. }
  170. }
  171. }
  172. }
  173. .bottom {
  174. flex: 0 0 100rpx;
  175. // background-color: red;
  176. border-top: 1px solid #ddd;
  177. height: 100rpx;
  178. width: 100%;
  179. z-index: 999;
  180. display: flex;
  181. flex-direction: row;
  182. justify-content: space-between;
  183. align-items: center;
  184. padding: 0 32rpx;
  185. .left {
  186. display: flex;
  187. flex-direction: row;
  188. .green {
  189. color: #2db389;
  190. margin: 0 6rpx;
  191. }
  192. }
  193. .right {
  194. display: flex;
  195. justify-content: center;
  196. align-items: center;
  197. .button {
  198. padding: 10rpx 20rpx;
  199. background-color: #2db389;
  200. border-radius: 10rpx;
  201. span {
  202. color: #fff;
  203. }
  204. }
  205. }
  206. }
  207. .money{
  208. color:#2db389;
  209. }
  210. }
  211. </style>