dongmu 1 year ago
parent 3ee987f1f9
commit 67859c569f

@ -0,0 +1,8 @@
export const environment = {
ENV: 'development',
APP_TITLE: '鸿森通货运平台',
APP_TARGET: 'http://192.168.0.166',
APP_PORT: ':8080',
APP_FILE_URL: 'http://106.58.179.30:19005/',
ENCRYPT: '',
}

@ -0,0 +1,8 @@
export const environment = {
ENV: 'production',
APP_TITLE: '鸿森通货运平台',
APP_TARGET: 'https://hongsentong.com',
APP_PORT: '',
APP_FILE_URL: 'https://hongsentong.com/minio/',
ENCRYPT: 'encrypt',
}

8
src/env/test.ts vendored

@ -0,0 +1,8 @@
export const environment = {
ENV: 'test',
APP_TITLE: '鸿森通货运平台',
APP_TARGET: 'http://112.112.149.146/',
APP_PORT: '18010',
APP_FILE_URL: 'http://112.112.149.146:19005/',
ENCRYPT: true,
}

@ -1,6 +1,6 @@
{ {
"name": "小兔鲜儿", "name": "鸿森通货运",
"appid": "", "appid": "__UNI__D787228",
"description": "", "description": "",
"versionName": "1.0.0", "versionName": "1.0.0",
"versionCode": 1, "versionCode": 1,
@ -50,7 +50,7 @@
"quickapp": {}, "quickapp": {},
/* */ /* */
"mp-weixin": { "mp-weixin": {
"appid": "wx87ac19b30bdc45d1", "appid": "wx79b61e386979fc3a",
"setting": { "setting": {
"urlCheck": false "urlCheck": false
}, },

@ -1,28 +1,41 @@
<script setup lang="ts"> <script setup lang="ts">
import { getHomeBannerAPI } from '@/services/home' import { getHomeBannerAPI, queryList } from '@/services/home'
import CustomNavbar from './componets/CustomNavbar.vue' import CustomNavbar from './componets/CustomNavbar.vue'
import { onLoad } from '@dcloudio/uni-app' // ----- import { onLoad } from '@dcloudio/uni-app' // -----
import { ref } from 'vue' import { ref } from 'vue'
import type { BannerItem } from '@/types/home' import type { BannerItem } from '@/types/home'
const bannerList = ref<BannerItem[]>([]) //ref([]) BannerItem --- crtrl+i
const getHomeBannerData = async () => {
const res = await getHomeBannerAPI()
bannerList.value = res.result //res.result res.result
}
// -- // --
onLoad(() => { onLoad(() => {
getHomeBannerData() // getHomeBannerData()
queryLists()
}) })
//
const queryLists = async () => {
const res = await queryList()
console.log(res)
}
//
// queryLists() {
// queryList().then((res) => {
// this.VicItems = res.data;
// // console.log(res, 'queryList')
// if (res.data.length != 0) {
// let e = this.VicItems[0];
// this.vehicle = e; //
// this.vehicleId = e.id;
// }
// });
// },
</script> </script>
<template> <template>
<CustomNavbar></CustomNavbar> <CustomNavbar></CustomNavbar>
<!-- 自定义轮播图 ctrl+点击 后先进入的是组件类型 声明文件 可以看到组件引入的路径--> <!-- 自定义轮播图 ctrl+点击 后先进入的是组件类型 声明文件 可以看到组件引入的路径-->
<XtxSwiper :list="bannerList"></XtxSwiper>
<view class="index">index</view> <view class="index">index</view>
</template> </template>

@ -15,3 +15,19 @@ export const getHomeBannerAPI = (distributionSite = 1) => {
}, },
}) })
} }
// 查询车型
export const queryList = () => {
return http({
method: 'GET',
url: '/system/vehicleDic/queryList',
})
}
// 查询车型
// export function queryList() {
// return requests({
// method: 'get',
// url: "/system/vehicleDic/queryList"
// })
// }

@ -0,0 +1,5 @@
import { environment } from '@/env/development'
// import { environment } from '@/env/production'
// import { environment } from '@/env/test'
export const ENV = environment

@ -1,7 +1,8 @@
// src/utils/http.ts // src/utils/http.ts
import { useMemberStore } from '@/stores' import { useMemberStore } from '@/stores'
// 请求基地址 import { ENV } from '@/utils/env'
const baseURL = 'https://pcapi-xiaotuxian-front-devtest.itheima.net' // 请求基地址 -- 基础路径+网口端
const baseURL = ENV.APP_TARGET + ENV.APP_PORT
// 拦截器配置 // 拦截器配置
const httpInterceptor = { const httpInterceptor = {
@ -48,7 +49,7 @@ uni.addInterceptor('uploadFile', httpInterceptor)
type Data<T> = { type Data<T> = {
code: string code: string
msg: string msg: string
result: T data: T
} }
// 2.2 添加类型,支持泛型 // 2.2 添加类型,支持泛型
export const http = <T>(options: UniApp.RequestOptions) => { export const http = <T>(options: UniApp.RequestOptions) => {

Loading…
Cancel
Save