invoiceList.vue 4.6 KB

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