You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

invoiceList.vue 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <template>
  2. <view class="wrap">
  3. <view>
  4. <view class="item last">
  5. <text>状态:</text>
  6. <uni-data-select v-model="state.status" :localdata="state.statusData"
  7. @change="statusChange"></uni-data-select>
  8. </view>
  9. <view class="item last">
  10. <text>订单类型:</text>
  11. <uni-data-select v-model="state.orderType" :localdata="state.orderTypeData"
  12. @change="orderTypeChange"></uni-data-select>
  13. <button size="mini" style="color: #ffffff;
  14. backgroundColor: rgb(118, 200, 77);
  15. borderColor: rgb(118, 200, 77);
  16. font-size: 26rpx;
  17. flex-shrink: 0;margin-left: 20rpx;" @click="search">查询</button>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="listbox">
  22. <view class="card-no-active" v-for="(item,index) in state.data">
  23. <view class="head">
  24. <!-- <image :src="`${$imgUrl}order/icon-star-green.png`" mode=""></image> -->
  25. <!-- <text>新办订单</text> -->
  26. </view>
  27. <view class="content">
  28. <view class="row">
  29. 订单类型:<text>新办订单</text>
  30. </view>
  31. <view class="row">
  32. 开票日期:<text>{{item.invoiceDate}}</text>
  33. </view>
  34. <view class="row">
  35. 发票抬头:<text>{{item.buyerName}}</text>
  36. </view>
  37. <view class="row">
  38. 状态:<text>{{item.status==1?'正常':"红冲"}}</text>
  39. </view>
  40. </view>
  41. <view class="btns">
  42. <button>开票</button>
  43. </view>
  44. </view>
  45. <!-- <view class="bottom-line" v-if="state.flags">我是有底线的~~~</view> -->
  46. </view>
  47. </template>
  48. <script setup lang="ts">
  49. import {
  50. reactive
  51. } from "vue";
  52. import { onLoad, onReachBottom } from "@dcloudio/uni-app";
  53. import { invoiceQueryApi } from "@/utils/network/api.js";
  54. import { stringToJson } from "@/utils/network/encryption";
  55. import { request } from "@/utils/network/request.js";
  56. const state = reactive({
  57. userMobile: "",
  58. pageNumber: 1,
  59. pageSize: 10,
  60. status: 1,
  61. statusData: [{
  62. 'value': 1,
  63. 'text': '正常'
  64. }, {
  65. 'value': -1,
  66. 'text': '红冲'
  67. }],
  68. orderType: 1,
  69. orderTypeData: [{
  70. 'value': 1,
  71. 'text': 'ETC服务'
  72. }, {
  73. 'value': 2,
  74. 'text': '通行服务费'
  75. }],
  76. data: [],
  77. flags: false,
  78. })
  79. onLoad((options) => {
  80. state.userMobile = options.userMobile
  81. })
  82. const search = () => {
  83. query(1)
  84. }
  85. const query = (val) => {
  86. if (val == 1) {
  87. state.pageNumber = 1
  88. }
  89. if (state.pageNumber == 1 && state.data.length > 0) {
  90. state.data = []
  91. }
  92. const options = {
  93. type: 2,
  94. data: {
  95. userMobile: state.userMobile,
  96. pageNumber: state.pageNumber,
  97. pageSize: state.pageSize,
  98. status: state.status,
  99. orderType: state.orderType,
  100. },
  101. method: "POST",
  102. showLoading: true,
  103. };
  104. request(invoiceQueryApi, options).then((res) => {
  105. const data = stringToJson(res.bizContent);
  106. state.data = data.invoices
  107. console.log(data, "通行");
  108. });
  109. }
  110. const statusChange = (e) => {
  111. state.status = e
  112. }
  113. const orderTypeChange = (e) => {
  114. state.orderType = e
  115. }
  116. // 触底加载
  117. onReachBottom(() => {
  118. if (state.data.length < state.pageNumber * 10) return state.flags = true
  119. console.log("触底了")
  120. state.pageNumber++
  121. query(2)
  122. })
  123. </script>
  124. <style>
  125. page {
  126. width: 100%;
  127. height: 100%;
  128. }
  129. </style>
  130. <style lang="scss" scoped>
  131. .listbox {
  132. height: 100%;
  133. background-color: #EEF7F7;
  134. padding: 30rpx;
  135. border-top: 1rpx solid #DFDFDF;
  136. margin-top: 200rpx;
  137. .card-no-active {
  138. margin-bottom: 30rpx;
  139. height: 438rpx;
  140. background: #FFFFFF;
  141. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  142. border-radius: 20rpx;
  143. display: flex;
  144. flex-direction: column;
  145. .head {
  146. display: flex;
  147. padding: 30rpx;
  148. align-items: center;
  149. border-bottom: 1px solid #DCDCDC;
  150. image {
  151. width: 48rpx;
  152. height: 48rpx;
  153. }
  154. text {
  155. font-size: 30rpx;
  156. font-family: Noto Sans S Chinese;
  157. font-weight: 400;
  158. color: #333333;
  159. }
  160. }
  161. .content {
  162. margin: 30rpx;
  163. margin-bottom: 0;
  164. border-bottom: 1rpx solid #DCDCDC;
  165. .row {
  166. font-size: 26rpx;
  167. font-family: Noto Sans S Chinese;
  168. font-weight: 400;
  169. color: #999999;
  170. margin-bottom: 20rpx;
  171. text {
  172. font-size: 26rpx;
  173. font-family: Noto Sans S Chinese;
  174. font-weight: 400;
  175. color: #333333;
  176. }
  177. }
  178. }
  179. .btns {
  180. flex: 1;
  181. display: flex;
  182. align-items: center;
  183. justify-content: flex-end;
  184. padding: 0 30rpx;
  185. button {
  186. margin: 0;
  187. display: inline-block;
  188. height: 61rpx;
  189. background: #FFFFFF;
  190. border: 1px solid #00B38B;
  191. border-radius: 30rpx;
  192. font-size: 26rpx;
  193. font-family: Noto Sans S Chinese;
  194. font-weight: 400;
  195. color: #00B38B;
  196. line-height: 61rpx;
  197. }
  198. }
  199. }
  200. .card-active {
  201. height: 375rpx;
  202. background: #FFFFFF;
  203. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  204. border-radius: 20rpx;
  205. display: flex;
  206. flex-direction: column;
  207. .head {
  208. display: flex;
  209. padding: 30rpx;
  210. align-items: center;
  211. border-bottom: 1px solid #DCDCDC;
  212. image {
  213. width: 48rpx;
  214. height: 48rpx;
  215. }
  216. text {
  217. font-size: 30rpx;
  218. font-family: Noto Sans S Chinese;
  219. font-weight: 400;
  220. color: #333333;
  221. }
  222. .status {
  223. position: absolute;
  224. right: 35px;
  225. font-size: 26rpx;
  226. font-family: Noto Sans S Chinese;
  227. font-weight: 400;
  228. color: #777777;
  229. }
  230. }
  231. .content {
  232. margin: 30rpx;
  233. .row {
  234. font-size: 26rpx;
  235. font-family: Noto Sans S Chinese;
  236. font-weight: 400;
  237. color: #999999;
  238. margin-bottom: 20rpx;
  239. text {
  240. font-size: 26rpx;
  241. font-family: Noto Sans S Chinese;
  242. font-weight: 400;
  243. color: #333333;
  244. }
  245. }
  246. }
  247. }
  248. }
  249. .item {
  250. display: flex;
  251. font-size: 30rpx;
  252. margin-top: 10rpx;
  253. align-items: center;
  254. }
  255. .wrap {
  256. padding: 10rpx 20rpx;
  257. box-sizing: border-box;
  258. // display: flex;
  259. // justify-content: space-evenly;
  260. position: fixed;
  261. left: 0;
  262. top: 0;
  263. background-color: white;
  264. width: 100%;
  265. }
  266. .bottom-line {
  267. text-align: center;
  268. margin: 30rpx 0;
  269. }
  270. </style>