index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="content">
  3. <view class="sub-lists" v-for="(item,index) in list" @click="goodsTap(item.id)" >
  4. <view class="sub-tops">
  5. <view>预约号:{{item.code}}</view>
  6. </view>
  7. <view class="contents">
  8. <view class="sub-img">
  9. <img :src="item.cover" alt="">
  10. </view>
  11. <view class="goods">
  12. <view class="goods-name overflow2">{{item.goods_name}}
  13. {{item.desc}}
  14. </view>
  15. <view class="goods-rule">{{item.goods_spec}}</view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import api from 'utils/api'
  23. export default {
  24. data() {
  25. return {
  26. pages:{
  27. page:1,
  28. pageNum:10
  29. },
  30. list:[],
  31. loadmore: true,
  32. }
  33. },
  34. onLoad() {
  35. },
  36. onReachBottom() {
  37. if (this.loadmore) {
  38. this.pages.page = this.pages.page + 1;
  39. this.getAppointmentList();
  40. }
  41. },
  42. onShow() {
  43. this.getAppointmentList();
  44. },
  45. methods: {
  46. goodsTap(id){
  47. console.error(id)
  48. uni.navigateTo({
  49. url:"/pages/subscribeDetails/index?id="+id
  50. })
  51. },
  52. getAppointmentList(){
  53. let data={
  54. page:this.pages.page,
  55. page_num:this.pages.pageNum,
  56. status:-1,
  57. }
  58. api.getAppointmentList(data).then((res)=>{
  59. if(res.code==1){
  60. // this.list=res.data.list
  61. let goodsList=res.data.list
  62. this.list = [...this.list, ...goodsList];
  63. if (res.data.list=='') {
  64. this.loadmore = false;
  65. }
  66. }
  67. })
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. .content{
  74. padding: 20rpx 30rpx;
  75. .sub-lists{
  76. .contents{
  77. display: flex;
  78. padding: 20rpx 30rpx;
  79. width: 100%;
  80. background-color: #fff;
  81. .goods{
  82. margin-left: 20rpx;
  83. .goods-rule{
  84. font-size: 20rpx;
  85. color: #666;
  86. margin-top: 15rpx;
  87. }
  88. .goods-name{
  89. width: 470rpx;
  90. color: #222;
  91. font-size: 24rpx;
  92. }
  93. }
  94. .sub-img{
  95. image{
  96. width: 120rpx;
  97. height: 120rpx;
  98. }
  99. }
  100. }
  101. width: 630rpx;
  102. background-color: #fff;
  103. margin-bottom: 25rpx;
  104. .contents{
  105. display: flex;
  106. }
  107. .sub-tops{
  108. height: 64rpx;
  109. background: #222222;
  110. border-radius: 16rpx 16rpx 0px 0px;
  111. line-height: 64rpx;
  112. width: 100%;
  113. padding: 0 30rpx;
  114. color: #fff;
  115. font-size: 28rpx;
  116. }
  117. }
  118. }
  119. </style>