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,17 @@
<template>
<div id="app">
<router-view/>
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style lang="less">
@import "../src/assets/less/pub/clear.less";
@import "../src/assets/less/pub/reset.less";
</style>

View File

@@ -0,0 +1,64 @@
import axios from 'axios'
import config from '@/config/index'
import { Toast } from 'vant';
export default class Api {
constructor(isBase = null) {
this.instance = axios.create({
baseURL: isBase == null ? config.checkEnvironment() : "",
timeout: 10000,
//headers: { 'X-Custom-Header': foobar }
})
this.interceptors()
}
async get(params) {
return await this.instance.get(params.url, {
params: params.data
})
}
async post(params) {
return await this.instance.post(params.url, params.data,{
headers: Object.assign({
"Content-Type": "application/json",
}, params.headers) //Object.assign 有值后面替换前面的
})
}
//拦截器
interceptors() {
//请求前
this.instance.interceptors.request.use(function (config) {
Toast.loading({
duration:10000,
forbidClick: true,
message: '加载中....',
});
return config
}, function (error) {
return Promise.reject(error);
});
//请求后返回的数据
this.instance.interceptors.response.use(function (response) {
Toast.clear();
switch (response.data.status) {
case 200:
return response.data.result
break;
case 404:
Toast.fail({
message: response.data.message
});
throw new Error(response.data.message)
break;
default:
break;
}
}, function (error) {
return Promise.reject(error);
});
}
}

View File

@@ -0,0 +1,10 @@
@import "../pub/mixins.less";
@import "../pub/vars.less";
.home {
width: 100px;
h2 {
color: @red500;
.line(top);
}
}

View File

@@ -0,0 +1,6 @@
@import "../pub/mixins.less";
@import "../pub/vars.less";
.me {
}

View File

@@ -0,0 +1,61 @@
@import "../pub/mixins.less";
@import "../pub/vars.less";
.push {
.active {
background: #ffd23c !important;
}
.shang {
margin-left: 10px !important;
margin-right: 10px !important;
.shangchaun{
margin-left: 10px !important;
margin-right: 10px !important;
}
}
.last {
margin-left: 10px !important;
margin-right: 10px !important;
.lasttitle {
margin: 15px 0px 10px 10px;
color: rgba(69, 90, 100, .6);
font-size: 13px;
}
.lastBottom {
display: inline-block;
background-color: rgba(82, 66, 66, 0.089);
border-radius: 30px;
margin-right: 10px;
margin: 5px;
color: black;
font-size: 14px;
padding: 10px;
}
}
.zuilast {
margin: 0, 10px, 0, 10px !important;
display: flex;
align-items: center;
justify-content: center;
.zuilastclcl {
display: flex;
align-items: center;
justify-content: center;
height: 50px;
width: 50px;
background-color: yellow;
border-radius: 50px;
// position: fixed;
// bottom: 5%;
// left: 31%;
}
}
}

View File

@@ -0,0 +1,61 @@
@import "../pub/mixins.less";
@import "../pub/vars.less";
.Square {
/deep/ .van-tabs__wrap {
position: fixed;
width: 100%;
z-index: 999;
}
/deep/ .fa {
.van-tabs__wrap {
top: 45px;
}
.Squaredata {
// position: fixed;
// bottom: 10px;
width: 150px;
height: 155px;
margin: auto auto;
.Squaredata_img {
width: 100%;
height: 140px;
}
.Squaredata_p {
font-size: 14px;
margin-top: -50px;
}
}
.father {
height: 483.03px;
overflow: auto;
.child {
//overflow-y: scroll;
}
}
}
/deep/ .chil {
.van-tabs__wrap {
top: 88px;
}
}
}

View File

@@ -0,0 +1,28 @@
@import "../pub/mixins.less";
@import "../pub/vars.less";
.user {
.login {
.van-icon {
margin-right: 20px;
}
.login_but {
.flex();
flex-direction: column;
margin-top: 30px;
.van-button {
width: 70%;
background: linear-gradient(90deg, #8817cd, #c63ba2);
}
}
.reg_tx{
text-align: center;
margin-top: 10px;
font-size: 14px;
color: #bdbaba;
}
}
}

View File

@@ -0,0 +1,406 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
body {
// font-size: 0;
}
html {
line-height: 1;
-webkit-text-size-adjust: 100%;
/* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body,
ul,
li,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
padding: 0;
list-style: none;
}
::-webkit-scrollbar {
width: 0;
height: 0;
}
.content {
margin-top: 1rem;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box;
/* 1 */
height: 0;
/* 1 */
overflow: visible;
/* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
text-decoration: none;
color: #000;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none;
/* 1 */
text-decoration: underline;
/* 2 */
text-decoration: underline dotted;
/* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
width: 100%;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
line-height: 1.15;
/* 1 */
margin: 0;
/* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input {
/* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
/* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box;
/* 1 */
color: inherit;
/* 2 */
display: table;
/* 1 */
max-width: 100%;
/* 1 */
padding: 0;
/* 3 */
white-space: normal;
/* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

View File

@@ -0,0 +1,44 @@
.line (@position: "left") {
border-@{position}: 1px solid #8d8d8d;
}
.clearfix() {
&:after,
&:before {
content: " ";
display: table;
}
&:after {
clear: both;
}
}
// No Scrollbar
.no-scrollbar() {
&::-webkit-scrollbar {
display: none !important;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
opacity: 0 !important;
}
}
.ellipsis() {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-wrap: break-word;
}
.flex(@align:center,@justify:center){
display: flex;
align-items: @align;
justify-content: @justify;
}

View File

@@ -0,0 +1,304 @@
@red50: #ffebee;
@red100: #ffcdd2;
@red200: #ef9a9a;
@red300: #e57373;
@red400: #ef5350;
@red500: #f44336;
@red600: #e53935;
@red700: #d32f2f;
@red800: #c62828;
@red900: #b71c1c;
@redA100: #ff8a80;
@redA200: #ff5252;
@redA400: #ff1744;
@redA700: #d50000;
@red: @red500;
@pink50: #fce4ec;
@pink100: #f8bbd0;
@pink200: #f48fb1;
@pink300: #f06292;
@pink400: #ec407a;
@pink500: #e91e63;
@pink600: #d81b60;
@pink700: #c2185b;
@pink800: #ad1457;
@pink900: #880e4f;
@pinkA100: #ff80ab;
@pinkA200: #ff4081;
@pinkA400: #f50057;
@pinkA700: #c51162;
@pink: @pink500;
@purple50: #f3e5f5;
@purple100: #e1bee7;
@purple200: #ce93d8;
@purple300: #ba68c8;
@purple400: #ab47bc;
@purple500: #9c27b0;
@purple600: #8e24aa;
@purple700: #7b1fa2;
@purple800: #6a1b9a;
@purple900: #4a148c;
@purpleA100: #ea80fc;
@purpleA200: #e040fb;
@purpleA400: #d500f9;
@purpleA700: #aa00ff;
@purple: @purple500;
@deepPurple50: #ede7f6;
@deepPurple100: #d1c4e9;
@deepPurple200: #b39ddb;
@deepPurple300: #9575cd;
@deepPurple400: #7e57c2;
@deepPurple500: #673ab7;
@deepPurple600: #5e35b1;
@deepPurple700: #512da8;
@deepPurple800: #4527a0;
@deepPurple900: #311b92;
@deepPurpleA100: #b388ff;
@deepPurpleA200: #7c4dff;
@deepPurpleA400: #651fff;
@deepPurpleA700: #6200ea;
@deepPurple: @deepPurple500;
@indigo50: #e8eaf6;
@indigo100: #c5cae9;
@indigo200: #9fa8da;
@indigo300: #7986cb;
@indigo400: #5c6bc0;
@indigo500: #3f51b5;
@indigo600: #3949ab;
@indigo700: #303f9f;
@indigo800: #283593;
@indigo900: #1a237e;
@indigoA100: #8c9eff;
@indigoA200: #536dfe;
@indigoA400: #3d5afe;
@indigoA700: #304ffe;
@indigo: @indigo500;
@blue50: #e3f2fd;
@blue100: #bbdefb;
@blue200: #90caf9;
@blue300: #64b5f6;
@blue400: #42a5f5;
@blue500: #2196f3;
@blue600: #1e88e5;
@blue700: #1976d2;
@blue800: #1565c0;
@blue900: #0d47a1;
@blueA100: #82b1ff;
@blueA200: #448aff;
@blueA400: #2979ff;
@blueA700: #2962ff;
@blue: @blue500;
@lightBlue50: #e1f5fe;
@lightBlue100: #b3e5fc;
@lightBlue200: #81d4fa;
@lightBlue300: #4fc3f7;
@lightBlue400: #29b6f6;
@lightBlue500: #03a9f4;
@lightBlue600: #039be5;
@lightBlue700: #0288d1;
@lightBlue800: #0277bd;
@lightBlue900: #01579b;
@lightBlueA100: #80d8ff;
@lightBlueA200: #40c4ff;
@lightBlueA400: #00b0ff;
@lightBlueA700: #0091ea;
@lightBlue: @lightBlue500;
@cyan50: #e0f7fa;
@cyan100: #b2ebf2;
@cyan200: #80deea;
@cyan300: #4dd0e1;
@cyan400: #26c6da;
@cyan500: #00bcd4;
@cyan600: #00acc1;
@cyan700: #0097a7;
@cyan800: #00838f;
@cyan900: #006064;
@cyanA100: #84ffff;
@cyanA200: #18ffff;
@cyanA400: #00e5ff;
@cyanA700: #00b8d4;
@cyan: @cyan500;
@teal50: #e0f2f1;
@teal100: #b2dfdb;
@teal200: #80cbc4;
@teal300: #4db6ac;
@teal400: #26a69a;
@teal500: #009688;
@teal600: #00897b;
@teal700: #00796b;
@teal800: #00695c;
@teal900: #004d40;
@tealA100: #a7ffeb;
@tealA200: #64ffda;
@tealA400: #1de9b6;
@tealA700: #00bfa5;
@teal: @teal500;
@green50: #e8f5e9;
@green100: #c8e6c9;
@green200: #a5d6a7;
@green300: #81c784;
@green400: #66bb6a;
@green500: #4caf50;
@green600: #43a047;
@green700: #388e3c;
@green800: #2e7d32;
@green900: #1b5e20;
@greenA100: #b9f6ca;
@greenA200: #69f0ae;
@greenA400: #00e676;
@greenA700: #00c853;
@green: @green500;
@lightGreen50: #f1f8e9;
@lightGreen100: #dcedc8;
@lightGreen200: #c5e1a5;
@lightGreen300: #aed581;
@lightGreen400: #9ccc65;
@lightGreen500: #8bc34a;
@lightGreen600: #7cb342;
@lightGreen700: #689f38;
@lightGreen800: #558b2f;
@lightGreen900: #33691e;
@lightGreenA100: #ccff90;
@lightGreenA200: #b2ff59;
@lightGreenA400: #76ff03;
@lightGreenA700: #64dd17;
@lightGreen: @lightGreen500;
@lime50: #f9fbe7;
@lime100: #f0f4c3;
@lime200: #e6ee9c;
@lime300: #dce775;
@lime400: #d4e157;
@lime500: #cddc39;
@lime600: #c0ca33;
@lime700: #afb42b;
@lime800: #9e9d24;
@lime900: #827717;
@limeA100: #f4ff81;
@limeA200: #eeff41;
@limeA400: #c6ff00;
@limeA700: #aeea00;
@lime: @lime500;
@yellow50: #fffde7;
@yellow100: #fff9c4;
@yellow200: #fff59d;
@yellow300: #fff176;
@yellow400: #ffee58;
@yellow500: #ffeb3b;
@yellow600: #fdd835;
@yellow700: #fbc02d;
@yellow800: #f9a825;
@yellow900: #f57f17;
@yellowA100: #ffff8d;
@yellowA200: #ffff00;
@yellowA400: #ffea00;
@yellowA700: #ffd600;
@yellow: @yellow500;
@amber50: #fff8e1;
@amber100: #ffecb3;
@amber200: #ffe082;
@amber300: #ffd54f;
@amber400: #ffca28;
@amber500: #ffc107;
@amber600: #ffb300;
@amber700: #ffa000;
@amber800: #ff8f00;
@amber900: #ff6f00;
@amberA100: #ffe57f;
@amberA200: #ffd740;
@amberA400: #ffc400;
@amberA700: #ffab00;
@amber: @amber500;
@orange50: #fff3e0;
@orange100: #ffe0b2;
@orange200: #ffcc80;
@orange300: #ffb74d;
@orange400: #ffa726;
@orange500: #ff9800;
@orange600: #fb8c00;
@orange700: #f57c00;
@orange800: #ef6c00;
@orange900: #e65100;
@orangeA100: #ffd180;
@orangeA200: #ffab40;
@orangeA400: #ff9100;
@orangeA700: #ff6d00;
@orange: @orange500;
@deepOrange50: #fbe9e7;
@deepOrange100: #ffccbc;
@deepOrange200: #ffab91;
@deepOrange300: #ff8a65;
@deepOrange400: #ff7043;
@deepOrange500: #ff5722;
@deepOrange600: #f4511e;
@deepOrange700: #e64a19;
@deepOrange800: #d84315;
@deepOrange900: #bf360c;
@deepOrangeA100: #ff9e80;
@deepOrangeA200: #ff6e40;
@deepOrangeA400: #ff3d00;
@deepOrangeA700: #dd2c00;
@deepOrange: @deepOrange500;
@brown50: #efebe9;
@brown100: #d7ccc8;
@brown200: #bcaaa4;
@brown300: #a1887f;
@brown400: #8d6e63;
@brown500: #795548;
@brown600: #6d4c41;
@brown700: #5d4037;
@brown800: #4e342e;
@brown900: #3e2723;
@brown: @brown500;
@blueGrey50: #eceff1;
@blueGrey100: #cfd8dc;
@blueGrey200: #b0bec5;
@blueGrey300: #90a4ae;
@blueGrey400: #78909c;
@blueGrey500: #607d8b;
@blueGrey600: #546e7a;
@blueGrey700: #455a64;
@blueGrey800: #37474f;
@blueGrey900: #263238;
@blueGrey: @blueGrey500;
@grey50: #fafafa;
@grey100: #f5f5f5;
@grey200: #eeeeee;
@grey300: #e0e0e0;
@grey400: #bdbdbd;
@grey500: #9e9e9e;
@grey600: #757575;
@grey700: #616161;
@grey800: #424242;
@grey900: #212121;
@grey: @grey500;
@black: #000000;
@white: #ffffff;
@transparent: rgba(0, 0, 0, 0);
@fullBlack: rgba(0, 0, 0, 1);
@darkBlack: rgba(0, 0, 0, 0.87);
@lightBlack: rgba(0, 0, 0, 0.54);
@minBlack: rgba(0, 0, 0, 0.26);
@faintBlack: rgba(0, 0, 0, 0.12);
@fullWhite: rgba(255, 255, 255, 1);
@darkWhite: rgba(255, 255, 255, 0.87);
@lightWhite: rgba(255, 255, 255, 0.54);

View File

@@ -0,0 +1,113 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<h2>Essential Links</h2>
<ul>
<li>
<a
href="https://vuejs.org"
target="_blank"
>
Core Docs
</a>
</li>
<li>
<a
href="https://forum.vuejs.org"
target="_blank"
>
Forum
</a>
</li>
<li>
<a
href="https://chat.vuejs.org"
target="_blank"
>
Community Chat
</a>
</li>
<li>
<a
href="https://twitter.com/vuejs"
target="_blank"
>
Twitter
</a>
</li>
<br>
<li>
<a
href="http://vuejs-templates.github.io/webpack/"
target="_blank"
>
Docs for This Template
</a>
</li>
</ul>
<h2>Ecosystem</h2>
<ul>
<li>
<a
href="http://router.vuejs.org/"
target="_blank"
>
vue-router
</a>
</li>
<li>
<a
href="http://vuex.vuejs.org/"
target="_blank"
>
vuex
</a>
</li>
<li>
<a
href="http://vue-loader.vuejs.org/"
target="_blank"
>
vue-loader
</a>
</li>
<li>
<a
href="https://github.com/vuejs/awesome-vue"
target="_blank"
>
awesome-vue
</a>
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

View File

@@ -0,0 +1,22 @@
<template>
<van-nav-bar fixed :title="title" left-arrow @click-left="$router.back()" />
</template>
<script>
export default {
name: "navbar",
props: {
title: {
type: String,
default: "",
},
},
data() {
return {};
},
};
</script>
<style lang="less" scoped></style>

View File

@@ -0,0 +1,26 @@
<template>
<div class="page" :style="{ marginTop: `${top}px`, marginBottom: `${bottom}px` }">
<slot></slot>
</div>
</template>
<script>
export default {
name: "page",
props: {
top: {
type: Number,
default: 45
},
bottom: {
type: Number,
default: 50
}
},
data() {
return {}
}
}
</script>
<style lang="less" scoped></style>

View File

@@ -0,0 +1,37 @@
<template>
<van-tabbar route v-model="active" active-color="#ffd23c">
<van-tabbar-item to="/home">
<template #icon>
<img src="/static/images/icon/index.png" alt="">
</template>
首页
</van-tabbar-item>
<van-tabbar-item to="/square">
<template #icon>
<img src="/static/images/icon/dating.png" alt="">
</template>
广场
</van-tabbar-item>
<van-tabbar-item to="/me">
<template #icon>
<img src="/static/images/icon/user.png" alt="">
</template>
我的
</van-tabbar-item>
</van-tabbar>
</template>
<script>
export default {
name: "tabbar",
data() {
return {
active: 0
}
}
}
</script>
<style lang="less" scoped></style>

View File

@@ -0,0 +1,34 @@
import tabbar from "../components/tabbar";
import navbar from "../components/header";
import page from "../components/page";
import Vant from 'vant';
export default {
devBaseUrl: "http://127.0.0.1:3030",
testBaseUrl: "http://127.0.0.1:3000/app/article",
prodBaseUrl: "http://127.0.0.1:3000/app/article",
aliOss: {
host: 'https://losta.oss-cn-shanghai.aliyuncs.com',
},
apiList: {
add: '/user/add',
login: '/user/login',
push: '/home/push',
token: '/home/token',
tab: "/home/tab"
},
vueComponents: [tabbar,navbar,page],
vuePlugs: [ Vant ],
checkEnvironment() {
switch (process.env.NODE_ENV) {
case "development":
return this.devBaseUrl
break;
case "test":
return this.testBaseUrl
break;
case "production":
return this.prodBaseUrl
break;
}
}
}

View File

@@ -0,0 +1,27 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import "amfe-flexible";
import Vue from 'vue'
import App from './App'
import router from './router'
import service from './service/_'
import utils from './utils/index'
import config from "./config/index";
import 'vant/lib/index.css';
//全局组件
config.vueComponents.forEach(v => Vue.component(v.name, v))
//其他
config.vuePlugs.forEach(v => Vue.use(v))
Vue.config.productionTip = false
Vue.prototype.$http = service;
Vue.prototype.$utils = utils;
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})

View File

@@ -0,0 +1,15 @@
<template>
<div class="about">
</div>
</template>
<script >
export default{
data(){
return {}
}
}
</script>
<style scoped></style>

View File

@@ -0,0 +1,35 @@
<template>
<div class="home">
<ul>
<li @click="enterPush(item)" v-for="(item, index) in action" :key="index">
{{ item.text }} 发布
</li>
</ul>
</div>
</template>
<script>
export default {
data() {
return {
action: [
{ text: "失物招领", id: 1 },
{ text: "寻物启事", id: 2 },
],
};
},
async created() {},
methods: {
enterPush({ id }) {
this.$router.push({
name: "Push",
query: { id },
});
},
},
};
</script>
<style scoped lang="less">
@import "~@less/Home";
</style>

View File

@@ -0,0 +1,19 @@
<template>
<div class="layout">
<router-view/>
<tabbar></tabbar>
</div>
</template>
<script>
export default {
data () {
return {}
}
}
</script>
<style scoped lang='less'>
</style>

View File

@@ -0,0 +1,18 @@
<template>
<div class="me">
我的
</div>
</template>
<script>
export default {
data () {
return {}
}
}
</script>
<style scoped lang='less'>
@import "~@less/Me";
</style>

View File

@@ -0,0 +1,145 @@
<template>
<div class="push">
<navbar title="发布信息"></navbar>
<page :bottom="0">
<div class="shang">
<van-field v-model="pushParmas.thing_title" maxlength="50" :clearable="true" rows="2" type="textarea" :autosize="minHeightTa"
placeholder="物品的标题" />
<van-field v-model="pushParmas.thing_introduce" :clearable="true" rows="5" type="textarea" maxlength="500"
placeholder="请描述清楚时间,地点,物品特征等基本信息(限500字)" show-word-limit />
<van-uploader v-model="uploadFileList" class="shangchaun" :after-read="afterRead" :max-count="1"/>
</div>
<div class="last">
<div class="lasttitle">物品类型</div>
<div :class="thingTypeIndex == index ? 'active lastBottom' : 'lastBottom'" @click="clickOne(index)"
v-for="(item, index) in typeOne" :key="index">
{{ item.title }}
</div>
</div>
<div class="last">
<div class="lasttitle">物品类别</div>
<div :class="thingCategoryIndex == index ? 'active lastBottom' : 'lastBottom'" @click="clickTwo(index)"
v-for="(item, index) in typeTwo" :key="index">
{{ item.title }}
</div>
</div>
<div class="zuilast">
<van-icon class="zuilastclcl" name="smile-o" @click="pushEvent"/>
</div>
</page>
</div>
</template>
<script>
import config from '@/config';
export default {
data() {
return {
pushParmas: {
user_id: 0,
thing_title: "",
thing_introduce: "",
thing_img: null,
thing_type: null,
thing_category: null,
},
minHeightTa: { maxHeight: 100, minHeight: 0 },
uploadFileList: [],
thingTypeIndex: 0,
thingCategoryIndex: 0,
typeOne: [
{ title: '失物招领', type: 1 },
{ title: '寻物启事', type: 2 },
],
typeTwo: [
{ title: '证件', type: 1 },
{ title: '服装', type: 2 },
{ title: '数码', type: 3 },
{ title: '日用品', type: 4 },
{ title: '其他', type: 5 },
],
}
},
async created() {
this.pushParmas.user_id = this.$utils.getItem("token").user_id //用户Id
this.thingTypeIndex = this.$route.query.id ? this.$route.query.id - 1 : this.thingTypeIndex //获取传入Id
this.pushParmas.thing_type = this.typeOne[this.thingTypeIndex].type //获取默认大分类的数值
this.pushParmas.thing_category = this.typeTwo[this.thingCategoryIndex].type //获取默认小分类
},
methods: {
clickOne(index) {
this.pushParmas.thing_type = this.typeOne[index].type
this.thingTypeIndex = index
},
clickTwo(index) {
this.thingCategoryIndex = index
this.pushParmas.thing_category = this.typeTwo[index].type
},
async afterRead(fileImg) {
let aliyunOssToken = await this.$http.home.token();//请求阿里云身份token
let form = new FormData() //创建一个from表单
for (const key in aliyunOssToken) {
form.append(key, aliyunOssToken[key])
}
form.append("key", fileImg.file.name) //文件名
form.append("file", fileImg.file) //文件路径
let ss= await this.$http.home.uploadFile(form,{
"Content-Type": "multipart/form-data",
});
console.log(ss);
this.pushParmas.thing_img = `${config.aliOss.host}/${fileImg.file.name}`//文件路径
},
async pushEvent() {
if (this.pushParmas.thing_title.length == 0) {
this.$toast("标题不能为空")
return;
}
if (this.pushParmas.thing_introduce.length == 0) {
this.$toast("内容不能为空")
return;
}
console.log("pushParmas: ",this.pushParmas);
let res = await this.$http.home.push(this.pushParmas);
this.$toast({
message: "发布成功",
onClose: () => {
this.$router.push({ name: "Square" })
}
})
}
}
}
</script>
<style scoped lang='less'>
@import "../assets/less/page/Push.less";
</style>

View File

@@ -0,0 +1,203 @@
<template>
<div class="Square">
<navbar title="广场" :show-back="false"></navbar>
<page :top="133">
<van-tabs v-model="active" class="fa" @change="childrenChange">
<van-tab v-for="(item, index) in hall" :title="item.title" :key="index">
<van-tabs :swipeable="true" v-model="item.index" @change="childrenChange" class="chil">
<van-tab class="father" v-for="(v, i) in item.children" :title="v.title" :key="i" >
<van-list v-model="v.loading" :immediate-check="false" :finished="v.finished" @load="getTabList" >
<template #finished>
<div class="Squaredata">
<img class="Squaredata_img" src="../../static/images/img/noLogin.png">
<div class="Squaredata_p">没有数据了</div>
</div>
</template>
<van-row class="child">
<van-col v-for="vi, ind in v.content" :key="ind" span="12">
<img :src="vi.thing_img" alt="">
</van-col>
</van-row>
</van-list>
</van-tab>
</van-tabs>
</van-tab>
</van-tabs>
</page>
</div>
</template>
<script>
export default {
data() {
return {
active: 0,
hall: [
{
type: 1,
title: "失物招领",
index: 0,
children: [
{
title: "全部",
type: -1,
page: 1,
loading: false,
finished: false,
totalpage: 3,
content: [],
},
{
title: "证件",
type: 1,
page: 1,
loading: false,
finished: false,
totalpage: 3,
content: [],
},
{
title: "服装",
type: 2,
page: 1,
loading: false,
finished: false,
totalpage: 1,
content: [],
},
{
title: "数码",
type: 3,
page: 1,
loading: false,
finished: false,
totalpage: 2,
content: [],
},
{
title: "日用品",
type: 4,
page: 1,
loading: false,
finished: false,
totalpage: 1,
content: [],
},
{
title: "其他",
type: 5,
page: 1,
loading: false,
finished: false,
totalpage: 1,
content: [],
},
],
},
{
type: 2,
title: "寻物启事",
index: 0,
children: [
{
title: "全部",
type: -1,
page: 1,
loading: false,
finished: false,
totalpage: 4,
content: [],
},
{
title: "证件",
type: 1,
page: 1,
loading: false,
finished: false,
totalpage: 3,
content: [],
},
{
title: "服装",
type: 2,
page: 1,
loading: false,
finished: false,
totalpage: 3,
content: [],
},
{
title: "数码",
type: 3,
page: 1,
loading: false,
finished: false,
totalpage: 5,
content: [],
},
{
title: "日用品",
type: 4,
page: 1,
loading: false,
finished: false,
totalpage: 1,
content: [],
},
{
title: "其他",
type: 5,
page: 1,
loading: false,
finished: false,
totalpage: 3,
content: [],
},
],
},
],
};
},
async created() {
this.getTabList("click");
},
methods: {
async getTabList(type) {
let childrenObj =
this.hall[this.active].children[this.hall[this.active].index];
let a = async () => {
let res = await this.$http.home.tab({
thing_type: this.hall[this.active].type,
thing_category: childrenObj.type,
page: childrenObj.page,
});
console.log(res);
childrenObj.content = [...childrenObj.content, ...res];//拼接
childrenObj.page += 1;
if (childrenObj.page > childrenObj.totalpage) {
childrenObj.finished = true
} else {
childrenObj.loading = false
}
};
type == "click" ? childrenObj.content.length == 0 ? a() : null : a()
},
async childrenChange() {
this.getTabList("click");
},
},
};
</script>
<style scoped lang='less'>
@import "../assets/less/page/Square.less";
</style>

View File

@@ -0,0 +1,173 @@
<template>
<div class="user">
<img src="/static/images/img/loginBack.png" />
<div class="login" v-if="status">
<van-cell-group :border="false">
<van-field
v-model="loginParams.phone"
type="digit"
:maxlength="11"
:clearable="true"
placeholder="输入手机号"
>
<template #left-icon>
<van-icon name="phone-o" size="23" class="set_icon" />
</template>
</van-field>
<van-field
v-model="loginParams.pwd"
type="password"
:clearable="true"
placeholder="输入密码"
>
<template #left-icon>
<van-icon name="shield-o" size="23" class="set_icon" />
</template>
</van-field>
</van-cell-group>
<div class="login_but">
<van-button type="primary" round @click="UserLogin()">登 录</van-button>
<div class="reg_tx" @click="status = false">注册账号</div>
</div>
</div>
<div class="reg login" v-else>
<van-cell-group :border="false">
<van-field
v-model="addParams.phone"
placeholder="输入手机号"
:maxlength="11"
:clearable="true"
>
<template #left-icon>
<van-icon name="phone-o" size="23" class="set_icon" />
</template>
</van-field>
<van-field
v-model="addParams.pwd"
type="password"
placeholder="输入密码"
:clearable="true"
>
<template #left-icon>
<van-icon name="shield-o" size="23" class="set_icon" />
</template>
</van-field>
<van-field
v-model="addParams.againPwd"
type="password"
placeholder="再次密码"
:clearable="true"
>
<template #left-icon>
<van-icon name="shield-o" size="23" class="set_icon" />
</template>
</van-field>
</van-cell-group>
<div class="login_but">
<van-button type="primary" round @click="UserAdd()">注 册</van-button>
<div class="reg_tx" @click="status = true">登录账号</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
status: true, //trun 登录 false 注册
loginParams: {
phone: "",
pwd: "",
},
addParams: {
phone: "",
pwd: "",
againPwd: "",
},
};
},
methods: {
//登录
async UserLogin() {
if (this.verify(this.loginParams.phone, this.loginParams.pwd)) {
let userInfo = await this.$http.user.login(this.loginParams);
this.$utils.setItem("token", userInfo);
this.$toast({
message: "恭喜登录成功",
onClose: () => {
if (this.$route.query.from) {
this.$router.push(this.$route.query.from);
} else {
this.$router.push("/");
}
},
});
}
},
//注册
async UserAdd() {
if (this.verify(this.addParams.phone,this.addParams.pwd,this.addParams.againPwd)){
delete this.addParams.againPwd;
let res = await this.$http.user.add(this.addParams);
this.$toast({
message: "恭喜注册成功",
onClose: () => {
this.status = true;
},
});
}
},
verify(phone, pwd, againPwd = null) {
if (!this.$utils.isPhone(phone)) {
this.$toast("手机号不正确");
return;
}
if (!this.$utils.checkPwd(pwd)) {
this.$toast("密码不符合要求");
return;
}
if (againPwd != null) {
if (pwd != againPwd) {
this.$toast("确认密码不符合要求");
return;
}
}
return true;
},
},
};
</script>
<style scoped lang="less">
@import "../assets/less/page/User.less";
</style>
<!-- <template>
<div class="user">
</div>
</template>
<script>
export default{
data(){
return{
}
}
}
</script>
<style scoped>
</style> -->

View File

@@ -0,0 +1,95 @@
import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
Vue.use(Router)
let router= new Router({
routes: [
{
path: '/',
name: 'Layout',
redirect: "/home",
// 路由懒加载
component: () => import(/* webpackChunkName: "Layout" */ '@/page/Layout'),
children: [
{
path: 'home',
name: 'Home',
meta: {
requiresAuth: false,
title: '首页'
},
// 路由懒加载
component: () => import(/* webpackChunkName: "home" */ '@/page/Home')
},
{
path: 'me',
name: 'Me',
meta: {
requiresAuth: false,
title: '我的'
},
component: () => import(/* webpackChunkName: "Me" */ '@/page/Me')
},
{
path: 'square',
name: 'Square',
meta: {
requiresAuth: true,
title: '广场'
},
// 路由懒加载
component: () => import(/* webpackChunkName: "square" */ '@/page/Square')
},
]
},
{
path: '/push',
name: 'Push',
meta: {
requiresAuth: true,
title: '发布'
},
// 路由懒加载
component: () => import(/* webpackChunkName: "push" */ '@/page/Push')
},
{
path: '/user',
name: 'User',
meta: {
requiresAuth: false,
title: '登录/注册'
},
// 路由懒加载
component: () => import(/* webpackChunkName: "user" */ '@/page/User')
}
]
})
// 登录状态检查
router.beforeEach((to, from, next) => {
document.title = to.meta.title;
// 未登录
if (localStorage.getItem("token") == null) {
// 你访问的页面还需要登录
if (to.meta.requiresAuth) {
next({
name: 'User',
query: {
from: to.fullPath
}
})
} else {
next()
}
} else {
next()
}
})
export default router

View File

@@ -0,0 +1,48 @@
import Api from "@/Api/index";
import config from "@/config/index";
export default class HomeService{
async getHome(data= []){
console.log(1)
return await (new Api()).get({
url:config.apiList.categories_list,
data:""
})
}
//请求阿里云身份token
async token (data = {}, headers = {}) {
return await (new Api).post({
url: config.apiList.token,
data,
headers
})
}
//上传的阿里云
async uploadFile (data = {}, headers = {}) {
return await (new Api("noBaseUrl")).post({
url: config.aliOss.host,
data,
headers
})
}
//发布
async push (data = {}, headers = {}) {
return await (new Api).post({
url: config.apiList.push,
data,
headers
})
}
async tab (data = {}, headers = {}) {
return await (new Api).post({
url: config.apiList.tab,
data,
headers
})
}
}

View File

@@ -0,0 +1,21 @@
import Api from "@/Api/index";
import config from "@/config/index";
export default class UserService{
async add(data= {}){
console.log(1)
return await (new Api()).post({
url:config.apiList.add,
data
})
}
async login(data= {}){
console.log(1)
return await (new Api()).post({
url:config.apiList.login,
data
})
}
}

View File

@@ -0,0 +1,7 @@
import HomeService from "./Home";
import UserService from "./User";
export default {
home: new HomeService,
user: new UserService
}

View File

@@ -0,0 +1,28 @@
class Utils {
isPhone(phone) {
let myreg = /^1[3-9]\d{9}$/;
return myreg.test(phone)
}
// 密码中必须包含大小写 字母、数字、特称字符,至少6个字符,最多20个字符;
checkPwd(pwd) {
// 这个正则有问题,自己找个
let pwdRegex = /(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[`~!@#$%^&*()-=_+;':",./<>?])(?=\S+$).{6,32}/;
return pwdRegex.test(pwd)
}
setItem(key, value) {
localStorage.setItem(
key,
value.constructor == Object || value.constructor == Array
? JSON.stringify(value)
: value
)
}
getItem(key) {
return localStorage.getItem(key) == null ? false : JSON.parse(localStorage.getItem(key))
}
}
export default new Utils