index.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="self-order">
  3. <view class="type-tabs">
  4. <u-tabs :scrollable="true" lineColor="#C30D23" :activeStyle="{ color: '#C30D23', fontWeight: 'bold' }" :list="types"
  5. @click="changeType" :current="current" />
  6. </view>
  7. <My_listbox ref="List" @getlist="getList" :bottomHeight="70">
  8. <List :list="list"></List>
  9. </My_listbox>
  10. </view>
  11. </template>
  12. <script>
  13. import { onLoad } from 'uview-ui/libs/mixin/mixin';
  14. import List from './list.vue'
  15. export default {
  16. components:{List},
  17. data () {
  18. return {
  19. current:0,
  20. content: {
  21. "pageNumber": 1,
  22. "pageSize": 20,
  23. "where": {
  24. "type": "",
  25. }
  26. },
  27. list:[],
  28. types:[]
  29. }
  30. },
  31. methods: {
  32. changeType (type) {
  33. this.current = type.index
  34. this.content.where.type = type.value
  35. this.getList(true)
  36. },
  37. getList(init = false) {
  38. return new Promise((resolve, reject) => {
  39. if (this.paging(this.content, init)) return resolve();
  40. this.$Http.basic({
  41. "id": "20240513162802",
  42. content: this.content
  43. }).then(res => {
  44. this.$refs.List.setHeight()
  45. this.$refs.List.RefreshToComplete()
  46. console.log("获取预约列表", res)
  47. resolve();
  48. if (this.cutoff(res.msg)) return;
  49. this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
  50. this.content = this.$refs.List.paging(this.content, res)
  51. })
  52. })
  53. },
  54. callPhoneFun (phonenumber) {
  55. this.callPhone(phonenumber)
  56. }
  57. },
  58. created() {
  59. this.getCustomClass('appointmenttype').then(res => {
  60. res.forEach(v => v.name = v.remarks)
  61. res.unshift({name:'全部',value:''})
  62. this.types = res
  63. console.log(this.types,'分类');
  64. })
  65. this.getList()
  66. },
  67. onLoad (option) {
  68. uni.setNavigationBarTitle({
  69. title:'我的预约',
  70. })
  71. }
  72. }
  73. </script>
  74. <style lang="scss">
  75. </style>