invoiceList.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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"></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. custom: {
  74. auth: true
  75. }
  76. }).then((res) => {
  77. uni.hideLoading()
  78. let nawarr = res
  79. nawarr.forEach(item => {
  80. item.checked = false
  81. })
  82. this.bill = nawarr
  83. }).catch((err) => {
  84. uni.hideLoading()
  85. console.log(err)
  86. })
  87. },
  88. checkbox(n) {
  89. let data = this.bill
  90. if (data[n].checked) {
  91. data[n].checked = false;
  92. } else {
  93. data[n].checked = true;
  94. }
  95. this.ids=[]
  96. data.forEach(item=>{
  97. if(item.checked){
  98. this.ids.push(item.id)
  99. }
  100. })
  101. console.log('ids',this.ids);
  102. },
  103. // 跳转抬头管理
  104. choose() {
  105. let order={
  106. ids:this.ids,
  107. total:this.total
  108. }
  109. uni.setStorageSync("order",order)
  110. uni.navigateTo({
  111. url: "/pages/invoice/applyInvoice"
  112. })
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="less">
  118. page {
  119. background-color: #F4F4F4;
  120. font-size: 26rpx;
  121. }
  122. .curpage {
  123. padding: 24rpx 30rpx;
  124. .list {
  125. box-shadow: 0px 2rpx 4rpx 0px rgba(0, 0, 0, 0.02);
  126. border-radius: 8rpx 8rpx 8rpx 32rpx;
  127. background-color: #fff;
  128. margin-bottom: 20rpx;
  129. .flextop {
  130. display: flex;
  131. justify-content: space-between;
  132. border-bottom: 1rpx solid #E3E3E3;
  133. padding: 30rpx;
  134. }
  135. .detail {
  136. padding: 30rpx;
  137. display: flex;
  138. align-items: center;
  139. }
  140. }
  141. .navbar {
  142. display: flex;
  143. font-size: 30rpx;
  144. align-items: center;
  145. bottom: 0;
  146. left: 0;
  147. position: fixed;
  148. width: 100%;
  149. height: 104rpx;
  150. background: #1E9F6A;
  151. border-radius: 16rpx 16rpx 0px 0px;
  152. color: #ffffff;
  153. .navbar-item {
  154. flex: 1;
  155. text-align: center;
  156. }
  157. .want {
  158. border-left: 1rpx solid #FFFFFF;
  159. }
  160. }
  161. }
  162. </style>