wdsc.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="ayuu">
  3. <view class="">
  4. <view class="fzctob sclixmy" v-for="(item,index) in list" :key="index" @click="todetail(item.id)">
  5. <view class="sckjert">
  6. <image :src="item.img" mode="" style="width: 100%; height: 100%;border-radius: 10upx;"></image>
  7. </view>
  8. <view class="fsxto" style="width: 100%;margin-left: 24rpx;">
  9. <view class="sctxtyuu"><text>{{item.title}}</text></view>
  10. <view class="sctxtyuua"><text>{{item.l_title}}</text></view>
  11. <view class="fzctob">
  12. <text class="wdjga">¥</text>
  13. <text class="wdjgb">{{item.price}}</text>
  14. <text class="scjga">原价¥{{item.line_price}}</text>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <style>
  22. page {
  23. background: #FAFAFA;
  24. }
  25. </style>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. page: 1,
  31. num: 20,
  32. total: 0,
  33. list: [],
  34. user_id: ''
  35. }
  36. },
  37. onReachBottom() {
  38. if (this.list.length < this.total) {
  39. this.page = this.page + 1
  40. this.getlist();
  41. } else {
  42. uni.showToast({
  43. title: '没有更多数据了',
  44. icon: 'none'
  45. })
  46. }
  47. },
  48. onLoad() {
  49. this.user_id = uni.getStorageSync('id')
  50. this.getlist();
  51. },
  52. methods: {
  53. getlist() {
  54. let that = this;
  55. this.$post({
  56. data: {
  57. do: 'MyCollection',
  58. data: {
  59. type: '2',
  60. page: that.page,
  61. num: that.num,
  62. user_id: that.user_id,
  63. pw: '375'
  64. }
  65. }
  66. }).then(res => {
  67. that.list = [...that.list, ...res.data.data]
  68. that.total = Number(res.data.total)
  69. })
  70. },
  71. todetail(id){
  72. uni.navigateTo({
  73. url:'/pages/index/kcxq-x?id='+id
  74. })
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. </style>