invoiceList.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="curpage">
  3. <view class="search" style="margin-bottom: 24rpx;">
  4. <u-search placeholder="请输入单号" v-model="keyword" borderColor="#A8A8A8" height="64rpx" searchIconSize="44" @search="loadLsit" @custom="loadLsit()"></u-search>
  5. </view>
  6. <view class="list" v-for="(item,index) in bill " :key="index">
  7. <view class="content">
  8. <view class="flextop">
  9. <view class="">
  10. 单号 {{item.code}}
  11. </view>
  12. <view class="price">
  13. 订单金额 <text style="font-weight: 700;font-size: 28rpx;margin-left: 10rpx;">¥{{item.amount}}</text>
  14. </view>
  15. </view>
  16. <view class="detail">
  17. <radio color="#1E9F6A" style="font-size: 26rpx;" :checked="item.checked" :value="index"
  18. @click="checkbox(index)"></radio>
  19. <!-- <u-checkbox iconSize=32 style="padding: 0 100rpx;" activeColor="#1E9F6A" :key="index" :name="item.amount"></u-checkbox> -->
  20. <view class="" style="margin-left: 30rpx;">
  21. <view class="" style="font-weight: 700;font-size: 36rpx;">
  22. 夕阳红康养团7日游
  23. </view>
  24. <view class="" style="margin: 24rpx 0;">
  25. 日期:{{item.start_at}} ~ {{item.end_at}}
  26. </view>
  27. <view class="">
  28. 数量 {{item.number}}
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="navbar">
  35. <view class="navbar-item">
  36. 总金额 ¥{{total}}
  37. </view>
  38. <view class="navbar-item want" @click="choose">
  39. 选择抬头
  40. </view>
  41. </view>
  42. <view v-show="bill.length==0" class="more"><text>暂无更多</text></view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. bill: [],
  50. keyword: '',
  51. checkboxValue1: [],
  52. ids:[]
  53. }
  54. },
  55. onLoad() {
  56. this.loadLsit()
  57. },
  58. computed:{
  59. total(){
  60. let allprice=0
  61. this.bill.forEach(item=>{
  62. if(item.checked){
  63. allprice+=Number(item.price)
  64. }
  65. })
  66. return allprice
  67. }
  68. },
  69. methods: {
  70. loadLsit() {
  71. this.$showLoadding("加载中")
  72. uni.$u.http.post('/api/order/bill', {
  73. keyword:this.keyword
  74. },{
  75. custom: {
  76. auth: true
  77. }
  78. }).then((res) => {
  79. uni.hideLoading()
  80. let nawarr = res
  81. nawarr.forEach(item => {
  82. item.checked = false
  83. })
  84. this.bill = nawarr
  85. }).catch((err) => {
  86. uni.hideLoading()
  87. console.log(err)
  88. })
  89. },
  90. checkbox(n) {
  91. let data = this.bill
  92. if (data[n].checked) {
  93. data[n].checked = false;
  94. } else {
  95. data[n].checked = true;
  96. }
  97. this.ids=[]
  98. data.forEach(item=>{
  99. if(item.checked){
  100. this.ids.push(item.id)
  101. }
  102. })
  103. console.log('ids',this.ids);
  104. },
  105. // 跳转抬头管理
  106. choose() {
  107. if(this.ids.length<=0){
  108. this.$toast("请选择开票订单")
  109. return
  110. }
  111. let order={
  112. ids:this.ids,
  113. total:this.total
  114. }
  115. uni.setStorageSync("order",order)
  116. uni.navigateTo({
  117. url: "/pages/invoice/applyInvoice"
  118. })
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="less">
  124. page {
  125. background-color: #F4F4F4;
  126. font-size: 26rpx;
  127. }
  128. .curpage {
  129. padding: 24rpx 30rpx;
  130. .list {
  131. box-shadow: 0px 2rpx 4rpx 0px rgba(0, 0, 0, 0.02);
  132. border-radius: 8rpx 8rpx 8rpx 32rpx;
  133. background-color: #fff;
  134. margin-bottom: 20rpx;
  135. .flextop {
  136. display: flex;
  137. justify-content: space-between;
  138. border-bottom: 1rpx solid #E3E3E3;
  139. padding: 30rpx;
  140. }
  141. .detail {
  142. padding: 30rpx;
  143. display: flex;
  144. align-items: center;
  145. }
  146. }
  147. .navbar {
  148. display: flex;
  149. font-size: 30rpx;
  150. align-items: center;
  151. bottom: 0;
  152. left: 0;
  153. position: fixed;
  154. width: 100%;
  155. height: 104rpx;
  156. background: #1E9F6A;
  157. border-radius: 16rpx 16rpx 0px 0px;
  158. color: #ffffff;
  159. .navbar-item {
  160. flex: 1;
  161. text-align: center;
  162. }
  163. .want {
  164. border-left: 1rpx solid #FFFFFF;
  165. }
  166. }
  167. }
  168. </style>