arrival-reminder.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="arrival-reminder-page">
  3. <page-scroll
  4. ref="pageScroll"
  5. emptyText="暂无到货提醒"
  6. @updateList="updateList"
  7. >
  8. <view class="list-container">
  9. <arrival-reminder-item
  10. v-for="(item, index) in list"
  11. :key="index"
  12. :info="item"
  13. @cancel="handleCancel"
  14. />
  15. </view>
  16. </page-scroll>
  17. </view>
  18. </template>
  19. <script>
  20. import PageScroll from '@/components/pageScroll/index.vue';
  21. import ArrivalReminderItem from '../components/arrival-reminder-item.vue';
  22. export default {
  23. components: {
  24. PageScroll,
  25. ArrivalReminderItem
  26. },
  27. data() {
  28. return {
  29. list: []
  30. };
  31. },
  32. methods: {
  33. updateList(data) {
  34. // Mock data for display purposes
  35. this.list = data
  36. },
  37. handleCancel(item) {
  38. uni.showModal({
  39. title: '提示',
  40. content: '确定要取消该书籍的到货提醒吗?',
  41. success: (res) => {
  42. if (res.confirm) {
  43. this.list = this.list.filter(i => i.id !== item.id);
  44. uni.showToast({ title: '已取消', icon: 'none' });
  45. }
  46. }
  47. });
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. .arrival-reminder-page {
  54. background-color: #f5f5f5;
  55. min-height: 100vh;
  56. }
  57. .list-container {
  58. padding-top: 20rpx;
  59. padding-bottom: 20rpx;
  60. }
  61. </style>