bill.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="pages">
  3. <!-- 这是我的发票页面 -->
  4. <u-empty mode="data" text="还没有发票哟">
  5. </u-empty>
  6. <div class="bottom-btn">
  7. <div @click="handleToAddBill">添加发票</div>
  8. <div @click="getBill">
  9. 读取微信发票信息
  10. </div>
  11. </div>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. }
  19. },
  20. methods: {
  21. getBill(){
  22. uni.chooseInvoiceTitle({
  23. success: function (res) {
  24. console.log(res);
  25. },
  26. fail: function (err) {
  27. console.log(err);
  28. },
  29. complete: function (res) {
  30. console.log(res);
  31. }
  32. });
  33. },
  34. handleToAddBill(){
  35. uni.navigateTo({
  36. url:'/components/bill/addBill',
  37. success:(res)=>{
  38. console.log('成功',res);
  39. },
  40. fail:(err)=>{
  41. console.log('失败',err);
  42. }
  43. })
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. .pages {
  50. width: 100%;
  51. height: 100vh;
  52. background: #f5f5f5;
  53. }
  54. .bottom-btn{
  55. position: fixed;
  56. bottom: 0;
  57. left: 0;
  58. width: 100%;
  59. height: 70px;
  60. background: #fff;
  61. display: flex;
  62. justify-content: space-between;
  63. align-items: center;
  64. padding: 0 10px;
  65. div:nth-child(1){
  66. flex: 1;
  67. text-align: center;
  68. }
  69. div:nth-child(2){
  70. flex: 1;
  71. text-align: center;
  72. }
  73. }
  74. </style>