tjsymx.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view class="" style="text-align: center;">
  3. <view style="padding: 50rpx;padding-bottom: 0rpx;">
  4. <view style="color: #fff;">当前</view>
  5. <view style="color: #fff;font-size: 50rpx;line-height: 200%;">{{userinfo.tjprice}}</view>
  6. </view>
  7. <button type="default" @click="zhuanzhang()" class="btn1" style="margin-bottom: 30rpx;">转乐票</button>
  8. <view v-for="(item,index) in list" style="border-top: solid 1px gainsboro;padding:30rpx 10rpx;color: #fff;font-size:28rpx;line-height: 150%;">
  9. <view style="width: 100%;display: table;">
  10. <view style="float: left;">
  11. <view>
  12. <text v-if="item.type==0" style="color: #fff;">+{{item.price}}</text>
  13. <text v-if="item.type==1" style="color: #e8131a;font-weight: bold;">-{{item.price}}</text>
  14. </view>
  15. </view>
  16. <view style="float: right;">
  17. <view>{{item.time}}</view>
  18. </view>
  19. </view>
  20. <view style="display: table;width: 100%;text-align: left;">{{item.content}}</view>
  21. </view>
  22. <uni-load-more :status="status" :content-text="contentText" />
  23. <view v-if="list.length==0" style="padding: 20px;">
  24. 暂无明细
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. constants: {},
  33. userinfo: null,
  34. data:{
  35. _token:"",
  36. uid:0,
  37. },
  38. num:"",
  39. mobile:"",
  40. jymm:"",
  41. list:[],
  42. page:1,
  43. status: 'more',
  44. contentText: {
  45. contentdown: '上拉加载更多',
  46. contentrefresh: '加载中',
  47. contentnomore: '到底了'
  48. }
  49. };
  50. },
  51. onShow() {
  52. var user = this.$api.getUserinfo();
  53. if (user) {
  54. this.userinfo = user;
  55. this.data._token=user._token;
  56. this.data.uid=user.id;
  57. this.page=1;
  58. this.list=[];
  59. this.MhMyInteger();
  60. } else {
  61. this.userinfo = null;
  62. }
  63. },
  64. onReachBottom() {
  65. this.status = 'loading';
  66. this.page++;
  67. this.MhMyInteger();
  68. },
  69. methods: {
  70. zhuanzhang(){
  71. //手动预约的 要求输入数量
  72. uni.navigateTo({
  73. url: 'syzlp'
  74. });
  75. },
  76. MhMyInteger(){
  77. var data = this.data;
  78. data.page=this.page;
  79. this.$api
  80. .MhPostModel(data, 'user/tjsy')
  81. .then(res => {
  82. var shuju = res.data.data.data;
  83. this.list = this.list.concat(shuju)
  84. this.status = 'more';
  85. if (shuju.length == 0) {
  86. this.status = 'nomore';
  87. }
  88. })
  89. .catch(err => {
  90. // console.log('request fail', JSON.stringify(err));
  91. });
  92. },
  93. }
  94. }
  95. </script>
  96. <style>
  97. page{padding: 15rpx;background: #98a737;background-attachment: fixed !important;
  98. background-repeat: no-repeat !important;}
  99. .btn1{background: #f2a50b; width:150rpx;text-align: center;color: #fff;font-size: 30rpx;line-height: 200%;border-radius: 10rpx;}
  100. </style>