zhengyiming
2025-02-19 bd90b36d5eac788d33a20b27f7515168fa2e5c5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<template>
  <PageLayoutWithBg class="index-page-wrapper" :title="''" :need-auth="false">
    <template #left>
      <div class="menu-btn-wrapper menu-logo">
        <img :src="IconLogo" class="logo" />
      </div>
    </template>
    <div class="home-header">
      <div class="home-banner-wrapper">
        <nut-swiper :auto-play="3000">
          <nut-swiper-item v-for="(item, index) in list" :key="index">
            <img :src="item" class="banner-img" draggable="false" />
          </nut-swiper-item>
        </nut-swiper>
      </div>
    </div>
    <InfiniteLoading
      scrollViewClassName="common-infinite-scroll-list home-list"
      v-bind="infiniteLoadingProps"
    >
      <template #renderItem="{ item }">
        <div>TaskCard</div>
      </template>
    </InfiniteLoading>
  </PageLayoutWithBg>
</template>
 
<script setup lang="ts">
import { useUser, useInfiniteLoading } from '@/hooks';
import { useUserStore } from '@/stores/modules/user';
import { RectDown, Location2 } from '@nutui/icons-vue-taro';
import Taro from '@tarojs/taro';
import _ from 'lodash';
import IconLogo from '@/assets/home/icon-logo.png';
import IconLocaltion from '@/assets/task/icon-localtion.png';
import * as orderServices from '@life-payment/services/api/Order';
import { OrderInputType } from '@life-payment/constants';
 
const { locationCity } = useUser();
 
const userStore = useUserStore();
 
const queryState = reactive({});
 
const { infiniteLoadingProps } = useInfiniteLoading(
  ({ pageParam }) => {
    let params: API.FrontOrderListInput = {
      pageModel: {
        rows: 20,
        page: pageParam,
        orderInput: [{ property: 'lastShelfTime', order: OrderInputType.Desc }],
      },
    };
 
    return orderServices.getFrontOrderList(params, {
      showLoading: false,
    });
  },
  {
    queryKey: ['orderServices/getFrontOrderList', queryState],
  }
);
 
const list = ref([
  'https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg',
  'https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg',
  'https://storage.360buyimg.com/jdc-article/welcomenutui.jpg',
  'https://storage.360buyimg.com/jdc-article/fristfabu.jpg',
]);
 
const selectItem = ref();
 
function handleMenuSelectClose() {
  selectItem.value?.toggle?.();
}
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.index-page-wrapper {
  .menu-logo {
    padding: 0;
 
    .logo {
      width: 96px;
      height: 64px;
    }
  }
 
  .home-searchbar-wrapper {
    padding: 32px 0;
    display: flex;
 
    .searchbar-container {
      flex: 1;
      min-width: 0;
    }
 
    .city-btn {
      display: flex;
      align-items: center;
      padding-left: 36px;
      color: boleGetCssVar('text-color', 'primary');
 
      .city-btn-icon {
        width: 40px;
        height: 40px;
      }
 
      .city-btn-text {
        max-width: 200px;
        @include ellipsis;
        margin-left: 12px;
        font-size: 30px;
      }
    }
  }
 
  .home-banner-wrapper {
    .banner-img {
      width: 100%;
      height: 260px;
      object-fit: cover;
    }
  }
 
  .home-header {
    padding: 0 boleGetCssVar('size', 'body-padding-h');
  }
}
 
.home-list {
  @include infiniteLoadingInTabBarPage;
}
</style>