1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <template>
- <view class="content">
- <view class="one">
- <u-swiper :list="config.file" height="240px" indicator indicatorMode="line" circular></u-swiper>
- </view>
- <view class="two">
- 正在申办
- </view>
- <view class="thr">
- <view class="list" v-for="(item, index) in menuList" :key="index" @click="toCommon(item.route)">
- <image class="image" mode="aspectFill" :src="item.url"></image>
- <view class="left">
- <view class="name">{{item.title}}</view>
- <view class="other">{{item.brief}}</view>
- </view>
- <view class="right">
- <u-icon name="arrow-right" size="20"></u-icon>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script setup lang="ts">
- import { getCurrentInstance, ref } from 'vue';
- //该依赖已内置不需要单独安装
- import { onShow, onPullDownRefresh } from "@dcloudio/uni-app";
- // 请求接口
- const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
- const $config = getCurrentInstance()?.appContext.config.globalProperties.$config;
- // 基本信息
- const config = ref({ logo: [], file: [] });
- const list = ref([]);
- const total = ref(0);
- onShow(async () => {
- await searchConfig();
- await search();
- })
- // config信息
- const searchConfig = async () => {
- config.value = uni.getStorageSync('config');
- };
- // 查询
- const search = async () => {
- const info = {
- skip: 0,
- limit: 2,
- status: '0'
- }
- // const res = await $api('car', 'GET', info);
- // if (res.errcode === 0) {
- // list.value = list.value.concat(res.data)
- // total.value = res.total
- // } else {
- // uni.showToast({
- // title: res.errmsg || '',
- // icon: 'error',
- // });
- // }
- };
- const toCommon = (item) => {
- uni.navigateTo({
- url: `/pagesHome/search/index?type=${item.type || ''}`
- })
- };
- // 查看详情
- const toView = (item) => {
- uni.navigateTo({
- url: `/pagesHome/car/index?id=${item.id || item._id}`
- })
- };
- </script>
- <style lang="scss" scoped>
- .content {
- display: flex;
- flex-direction: column;
- width: 100vw;
- height: 100vh;
- }
- </style>
|