first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<template>
<div id="app">
<van-nav-bar
title="标题"
left-text="返回"
right-text="按钮"
left-arrow
/>
<router-view />
<van-tabbar v-model="active" route>
<van-tabbar-item icon="home-o" replace to="/home">首页</van-tabbar-item>
<van-tabbar-item icon="search" replace to="/type">分类</van-tabbar-item>
<van-tabbar-item icon="friends-o" replace to="/car">购物车</van-tabbar-item>
<van-tabbar-item icon="setting-o" replace to="/about">我的</van-tabbar-item>
</van-tabbar>
</div>
</template>
<script>
export default {
name: 'App',
data () {
return {
active: 1
}
}
}
</script>
<style>
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,23 @@
import Vant from 'vant'
import 'vant/lib/index.css'
import service from '../service/_'
export default {
DevUrl: 'http://115.159.153.142:9010',
ProdUrl: 'http://115.159.153.142:9020',
check: function () {
if (process.env.NODE_ENV == "development") {
return this.DevUrl
} else {
return this.ProdUrl
}
},
ApiUrl: {
index: '/index'
},
VuePlug: [ Vant ],
CustomPlug: [
{ n: '$api', v: service }
]
}

View File

@@ -0,0 +1,27 @@
import axios from 'axios'
import config from '@config'
class Http {
async get (url, params = {}, header = {}) {
this.SetBaseUrl()
return await axios.get(url, {
params: params,
headers: header
})
}
async post (url, params = {}, header = {}) {
this.SetBaseUrl()
return await axios.post(url, params, {
headers: header
})
}
SetBaseUrl () {
if (axios.defaults.baseURL == null) {
axios.defaults.baseURL = config.check();
}
}
}
export default new Http()

View File

@@ -0,0 +1,18 @@
import 'amfe-flexible'
import Vue from 'vue'
import App from './App'
import router from './router'
import config from './config';
// 配置vue插件
config.VuePlug.forEach((v)=> Vue.use(v));
config.CustomPlug.forEach((v) => Vue.prototype[v.n] = v.v);
Vue.config.productionTip = false
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})

View File

@@ -0,0 +1,7 @@
export default [
{
path: '/home',
name: 'home',
component: () => import(/* webpackChunkName: "home" */ '@/view/Home.vue')
}
]

View File

@@ -0,0 +1,29 @@
import Vue from 'vue'
import Router from 'vue-router'
import HomeRouterConfig from './home'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
redirect: '/home'
},
...HomeRouterConfig,
{
path: '/type',
name: 'type',
component: () => import(/* webpackChunkName: "type" */ '@/view/Type.vue')
},
{
path: '/about',
name: 'about',
component: () => import(/* webpackChunkName: "about" */ '@/view/About.vue')
},
{
path: '/car',
name: 'car',
component: () => import(/* webpackChunkName: "about" */ '@/view/Car.vue')
}
]
})

View File

@@ -0,0 +1,19 @@
import http from '@http'
import config from '@config'
class HomeService {
async index (params) {
console.log(params);
console.log(config.ApiUrl.index);
return await http.get(
config.ApiUrl.index,
params,
{
'token': '11111'
}
)
}
}
export default new HomeService()

View File

@@ -0,0 +1,5 @@
import HomeService from './HomeService';
export default {
home: HomeService
}

View File

@@ -0,0 +1,15 @@
<template>
<div class="about">
<h1>关于我页面</h1>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@@ -0,0 +1,15 @@
<template>
<div class="car">
<h1>购物车</h1>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@@ -0,0 +1,37 @@
<template>
<div class="home">
<h1>home页面</h1>
<van-button type="info">信息按钮</van-button>
<ul>
<li v-for="(v,i) in newest.data" :key="i">
{{ v.title }}
</li>
</ul>
</div>
</template>
<script>
export default {
data () {
return {
newest: {}
}
},
created () {
this.GetIndexData()
},
methods: {
async GetIndexData () {
var a = await this.$api.home.index({
id: 1
})
console.log(a.data.result.newest)
this.newest = a.data.result.newest
}
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,15 @@
<template>
<div class="info">
<h1>详情页面</h1>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@@ -0,0 +1,15 @@
<template>
<div class="type">
<h1>分类页面</h1>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>