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,3 @@
> 1%
last 2 versions
not dead

View File

@@ -0,0 +1,14 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
parserOptions: {
parser: "babel-eslint",
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
};

View File

@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -0,0 +1,24 @@
# vuecli3
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

View File

@@ -0,0 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,41 @@
{
"name": "vuecli3",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"amfe-flexible": "^2.2.1",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"node-rsa": "^1.1.1",
"vant": "^2.12.10",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0",
"compression-webpack-plugin": "^5.0.1",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^6.2.2",
"postcss-pxtorem": "^5.1.1",
"prettier": "^2.2.1",
"pug": "^3.0.2",
"pug-html-loader": "^1.1.5",
"pug-plain-loader": "^1.1.0",
"style-resources-loader": "^1.4.1",
"stylus": "^0.54.8",
"stylus-loader": "^3.0.2",
"vue-template-compiler": "^2.6.11"
}
}

View File

@@ -0,0 +1,11 @@
module.exports = {
plugins: {
autoprefixer: {
browsers: ["Android >= 4.0", "iOS >= 7"],
},
"postcss-pxtorem": {
rootValue: 37.5,
propList: ["*"],
},
},
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" ></link>
<% } %>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
</body>
</html>

View File

@@ -0,0 +1,30 @@
<template>
<div id="app">
<keep-alive >
<router-view v-if="$route.meta.iskeepAlive"/>
</keep-alive>
<router-view v-if="!$route.meta.iskeepAlive"/>
</div>
</template>
<script>
import { mapActions } from 'vuex'
export default {
data() {
return { }
},
async created() {
await this.carList();
},
methods: {
...mapActions({
carList: 'PUT_SET_CARLIST'
}),
}
}
</script>
<style lang="stylus">
@import "~@styl/clear.styl";
</style>

View File

@@ -0,0 +1,2 @@
@import "public/_.styl";

View File

@@ -0,0 +1,425 @@
/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Change the default font family in all browsers (opinionated).
* 2. Prevent adjustments of font size after orientation changes in IE and iOS.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove the margin in all browsers (opinionated).
*/
body {
margin: 0;
}
h1,h2,h3,h4,h5,h6,ul,li,p {
margin: 0;
padding: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Add the correct display in IE 9-.
* 1. Add the correct display in Edge, IE, and Firefox.
* 2. Add the correct display in IE.
*/
article,
aside,
details, /* 1 */
figcaption,
figure,
footer,
header,
main, /* 2 */
menu,
nav,
section,
summary { /* 1 */
display: block;
}
/**
* Add the correct display in IE 9-.
*/
audio,
canvas,
progress,
video {
display: inline-block;
}
/**
* Add the correct display in iOS 4-7.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Add the correct display in IE 10-.
* 1. Add the correct display in IE.
*/
template, /* 1 */
[hidden] {
display: none;
}
/* Links
========================================================================== */
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
a {
background-color: transparent; /* 1 */
-webkit-text-decoration-skip: objects; /* 2 */
}
/**
* Remove the outline on focused links when they are also active or hovered
* in all browsers (opinionated).
*/
a:active,
a:hover {
outline-width: 0;
}
/* Text-level semantics
========================================================================== */
/**
* 1. Remove the bottom border in Firefox 39-.
* 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 */
}
/**
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
*/
b,
strong {
font-weight: inherit;
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* Add the correct font style in Android 4.3-.
*/
dfn {
font-style: italic;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
}
/**
* Add the correct background and color in IE 9-.
*/
mark {
background-color: #ff0;
color: #000;
}
/**
* 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;
}
/**
* Hide the overflow in IE.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct margin in IE 8.
*/
figure {
margin: 1em 40px;
}
/**
* 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 */
}
/* Forms
========================================================================== */
/**
* 1. Change font properties to `inherit` in all browsers (opinionated).
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
select,
textarea {
font: inherit; /* 1 */
margin: 0; /* 2 */
outline: none;
border: none;
}
/**
* Restore the font weight unset by the previous rule.
*/
optgroup {
font-weight: bold;
}
/**
* 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;
}
/**
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
* controls in Android 4.
* 2. Correct the inability to style clickable types in iOS and Safari.
*/
button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
-webkit-appearance: button; /* 2 */
}
/**
* 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;
}
/**
* Change the border, margin, and padding in all browsers (opinionated).
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 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 */
}
/**
* Remove the default vertical scrollbar in IE.
*/
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 and cancel buttons in Chrome and Safari on OS X.
*/
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Correct the text style of placeholders in Chrome, Edge, and Safari.
*/
::-webkit-input-placeholder {
color: inherit;
opacity: 0.54;
}
/**
* 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 */
}

View File

@@ -0,0 +1,35 @@
.activity
.header
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 999;
.h-text
height 43px
display flex
justify-content center
align-items center
.van-icon
position absolute
margin-top 1px
left 16px
color #1989fa
font-size 16px
p
font-size 16px
.content
display flex
flex-wrap: wrap;
padding-top 43px
li
width 50%
text-align center
img
width 100%
.p1
font-size 0.4rem
font-weight 600
.p2
color: #ea625b;
font-size: 0.4rem;

View File

@@ -0,0 +1,82 @@
.top{
position: fixed
top 0
left 0
right 0
z-index 999
display: flex
align-items: center
height: 1.2rem
background-color: #fff
.icon{
padding: 0 .3rem 0 .3rem
}
.serch{
background-color: #eee
display: flex
align-items: center
width: 87%
border-radius: 2rem
.sou{
padding-left: .2rem
}
p{
padding: .1rem
font-size: .35rem
color: #ccc
}
}
}
.my-swipe{
margin-top 1.2rem
img{
width 100%
}
}
.banner{
margin-top .3rem
display: flex
justify-content: space-around
li{
display: flex
flex-direction: column
justify-content: center
align-items: center
}
img{
width 1rem
height 1rem
}
p{
margin-top .2rem
padding-top: .1rem
font-size: .1rem
margin-bottom .4rem
}
}
.girdes{
display: flex
img{
width 50%
}
.imggird{
display: flex
flex-direction: column
img{
width 100%
}
}
margin-bottom .5rem
}
.banimg{
width 100%
}
/deep/.showtime li[data-v-1c4665c3]{
width 45%
}

View File

@@ -0,0 +1,68 @@
.Info {
.header_top {
position fixed;
top 0;
left 0;
width: 100%;
height 45px;
display flex;
justify-content space-between;
align-items center;
padding 0 15px;
box-sizing border-box;
z-index 999;
}
.my-swipe {
img {
width: 100%;
}
.custom-indicator {
background-color: rgba(0,0,0,.5);
color: #fff;
width: 25px;
padding: 2px 5px;
bottom: 15px;
right: 10px;
left: auto;
position: absolute;
font-size: 13px;
border-radius: 10px;
text-align center;
}
}
.content_info {
padding-top 15px;
padding-left 15px;
padding-right 15px;
.price {
color: #ff6700;
font-size: 25px;
font-weight: 700;
}
.tite {
color: #000;
font-weight: 700;
font-size: 16px;
margin-top: 8px;
margin-bottom: 8px;
}
.desc {
margin-top: 6px;
margin-bottom: 6px;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: box;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
color: #000;
font-size 12px;
}
}
.img {
img {
width: 100%;
}
}
}

View File

@@ -0,0 +1,72 @@
.login
.top
width: 100%;
height: 3.213rem;
.login_form
margin-top: 1.867rem;
padding: 0 1rem;
input
height: 1.173rem;
width: 100%;
background-color: #f5f5f5;
border-radius: 0.587rem;
box-sizing: border-box;
padding-left: 0.533rem;
padding-right: 0.6rem;
font-size: 0.373rem;
color: #999999;
h2
font-size: 0.667rem;
color: #333333;
border-bottom: 0.107rem solid #41c5f6;
padding-bottom: 0.02rem
display: inline-block
margin-bottom: 0.907rem;
.pwd,
.phone
position relative
margin-bottom: 0.4rem;
input
padding-left: 1.213rem !important;
.left
width: 0.333rem;
height: 0.413rem;
left: 0.533rem;
.right
width: 0.253rem;
height: 0.12rem;
right: 0.6rem;
img
position: absolute
top: 50%;
transform: translateY(-50%)
.pwd
.right
width: 0.4rem !important;
height: 0.267rem !important;
.login_submit
width: 8rem;
height: 1.173rem;
background-image: linear-gradient(90deg,#5db9fc 0%, #53d6f4 100%),linear-gradient(#ff5740,#ff5740);
background-blend-mode: normal,normal;
box-shadow: 0rem 0.067rem 0.133rem 0rem rgba(85, 207, 246, 0.5);
border-radius: 0.587rem;
font-size: 0.427rem;
font-weight: bold;
color: #ffffff;
text-align: center;
line-height: 1.173rem;
margin-bottom: 0.4rem;
.tips
font-size: 0.373rem;
color: #666666;
text-align: center;
span
color: #41c5f6 !important;

View File

@@ -0,0 +1,69 @@
.header
width 100%
height 200px
position relative
background url("/img/me_back.png") no-repeat
background-position center center
background-size cover
.set
position absolute
right 15px
top 35px
width 25px
height 25px
z-index 999
.user
display flex
align-items center
position absolute
bottom 40px
left 20px
img
width 55px
height 55px
p
margin-left 10px
font-size 18px
.content
.c-list
display flex
padding-top 16px
justify-content space-around
padding-bottom 16px
li
padding-left 14px
padding-right 8px
text-align center
img
width 35px
p
font-size 12px
color #646566
.c-bottom
margin-top 19px
li
display flex
align-items center
justify-content space-between
border-bottom 1px solid #fafbfb
.li-left
display flex
.like
padding-top 1px
img
width 18px
height 20px
margin-right 10px
p
font-size 14px
.van-icon-arrow
font-size 16px
color #969799!important
.address
padding 14px 0
margin 0 16px
.collection
padding 18px 0
margin 0 16px
.setting
padding 16px 16px

View File

@@ -0,0 +1,20 @@
.search
.psearch
font-size: 14px;
text-align: center;
color: #6666;
.slist
display: flex;
flex-wrap: wrap;
li
width: 50%;
text-align: center;
margin-bottom: 0.4rem;
img
width: 100%;
.title
font-size: 0.4rem;
font-weight: 600;
.price
color: #ea625b;
font-size: 0.4rem;

View File

@@ -0,0 +1,51 @@
.setting
.header
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 70px;
box-sizing: border-box;
text-align: center;
img
width: 80px;
height: 80px;
.text
display flex
align-items center
margin-top 3px
.text1
letter-spacing: 5px;
margin-top: 11px;
font-size: 14px;
.text2
margin-top 11px
font-size: 9px;
color: #a3a1a1;
.content
margin-top: 41px;
li
display flex
justify-content space-between
align-items center
font-size 14px
padding 4px 0
div
display flex
align-items center
.van-cell
width: 23%;
.van-icon-arrow
font-size 17px
padding-right 17px!important
color #969799
p
width: 103px;
button
width: 340px;
margin-left: 17px;
margin-top: 45px;

View File

@@ -0,0 +1,3 @@
@import "color.styl";
@import "mixins.styl";
@import "vars.styl";

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,43 @@
@import "./color.styl";
fontFamily = Roboto, Lato, sans-serif;
// primary and accent
primaryColor = blue; // 主色
secondaryColor = pinkA200;
successColor = green;
warningColor = yellow600;
errorColor = red;
infoColor = blue;
trackColor = grey400;
// textColor or borderColor
textColor = darkBlack;
secondaryTextColor = fade(fullBlack, 54%);
alternateTextColor = white;
borderColor = fade(fullBlack, 12%);
disabledColor = fade(fullBlack, 38%);
// background
backgroundColor = grey50;
dialogBackgroundColor = white; // dialogs or cards
chipBackgroundColor = grey300;
// icon color
activeIconColor = fade(fullBlack, 54%);
inActiveIconColor = fade(fullBlack, 38%);
// spaceing
iconSize = 24px;
desktopGutter = 24px;
desktopGutterMore = 32px;
desktopGutterLess = 16px;
desktopGutterMini = 8px;
desktopKeylineIncrement = 64px;
desktopDropDownMenuItemHeight = 32px;
desktopDropDownMenuFontSize = 15px;
desktopDrawerMenuItemHeight = 48px;
desktopSubheaderHeight = 48px;
desktopToolbarHeight = 56px;
// animate
easeOutFunction = cubic-bezier(0.23, 1, 0.32, 1);
easeInOutFunction = cubic-bezier(0.445, 0.05, 0.55, 0.95);

View File

@@ -0,0 +1,22 @@
<template>
<div class="footer">
<van-tabbar route>
<van-tabbar-item to="/" icon="home-o">首页</van-tabbar-item>
<van-tabbar-item to="/type" icon="search">分类</van-tabbar-item>
<van-tabbar-item to="/car" icon="friends-o">购物车</van-tabbar-item>
<van-tabbar-item to="/me" icon="setting-o">我的</van-tabbar-item>
</van-tabbar>
</div>
</template>
<script>
export default {
data() {
return { }
},
methods: {
}
};
</script>
<style scoped lang="stylus"></style>

View File

@@ -0,0 +1,18 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
</div>
</template>
<script>
export default {
name: "HelloWorld",
props: {
msg: String,
},
};
</script>
<style scoped lang="stylus">
</style>

View File

@@ -0,0 +1,70 @@
<template>
<div class="item">
<ul class="showtime">
<router-link
tag="li"
:to="{ path: '/info', query: { id: v.wares_id } }"
v-for="(v, i) in itemList"
:key="i"
>
<img
:src="
Array.isArray(v.wares_masterimg)
? v.wares_masterimg[0]
: v.wares_masterimg
"
alt=""
/>
<p>{{ v.wares_title }}</p>
<p v-if="v.hasOwnProperty('wares_nowprice')">
¥ {{ v.wares_nowprice }}
</p>
</router-link>
</ul>
</div>
</template>
<script>
export default {
props: {
itemList: {
type: Array,
default: () => [],
},
},
data() {
return {};
},
created() {},
methods: {},
};
</script>
<style scoped lang="stylus">
.showtime{
display: flex
flex-wrap: wrap
li{
padding .1rem .1rem 0
margin: .2rem .1rem 0
display: flex
flex-direction: column
align-items: center
border-radius: .2rem
transition: all .1s;
&:hover{
transform: scale(1.03);
}
img{
width 4.6rem
border-radius: .2rem
}
p{
padding-top: .1rem
font-size: .4rem
color: #666
padding-bottom: .1rem
}
}
}
</style>

View File

@@ -0,0 +1,47 @@
<template>
<div class="Preview">
<van-image-preview v-model="isShow" :start-position="idx"
@closed="imgClosed"
:images="images" @change="onChange">
<template v-slot:index>第{{ idx + 1 }}页</template>
</van-image-preview>
</div>
</template>
<script>
export default {
name: 'Preview',
props: {
isShow: {
type: Boolean,
default: false
},
images: {
type: Array,
default: () => []
},
idx: {
type: Number,
default: 0
}
},
data() {
return {
}
},
created() {
},
methods: {
imgClosed() {
this.$emit("status",false)
},
onChange(i) {
this.idx = i;
}
}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,48 @@
import Vant from "vant";
// import { Icon } from 'vant';
// import { Swipe, SwipeItem } from 'vant';
//TODO 这事没写完的代码,
export default {
devBaseUrl: "http://127.0.0.1:9090",
testBaseUrl: "http://47.114.153.249:3000/api/json",
prodBaseUrl: "http://47.114.153.249:3000/api/json",
ApiList: {
index: "/home/index", // 首页
search: "/home/search", // 搜索
login: "/user/login", // 登录
reg: "/user/add", // 注册
activity: "/home/activity", // 活动页面
info: "/home/info", // 详情
addCar: "/car/addCar", // 添加购物车
checkCar: "/car/checkCar", // 检查商品是否已经被用户添加到购物车
getCarList: "/car/getCarList", // 获取购物车列表
deleteCar: "/car/deleteCar", // 删除购物车
submitCar: "/car/submitCar", // 提交购物车
buyOrder: "/order/buyOrder", //订单页面购买支付后需要用的接口,更改订单状态为待发货
allOrder: "/order/allOrder", //获取不同状态的订单
type: "/type/list", //分类页面获取分类商品的接口
},
VuePlugIn: [Vant],
publicKey: `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9eo8WIbWS5Yql06imlhrW0ZXh
faivPavdULvYLIxIKyUaOwMPFrPuHqqBNGnYOpiPHAKL+zxk2j4u+6jhB6VK1SOD
ccSLxIRxd0HmSDS+hBzYRf4vKc8BLlhMrYhnLmcxCc+PJIIa4DfCZnu8FfQlu/5L
ljjpYN9kHOpHAT+xpQIDAQAB
-----END PUBLIC KEY-----`,
getUrl() {
switch (process.env.NODE_ENV) {
case "development":
return this.devBaseUrl;
// eslint-disable-next-line no-unreachable
break;
case "test":
return this.testBaseUrl;
break;
case "production":
return this.prodBaseUrl;
break;
}
},
};

View File

@@ -0,0 +1,92 @@
import axios from "axios";
import config from "../config";
import { Toast } from "vant";
import rsa from "../utils/rsa";
class Http {
constructor() {
axios.defaults.baseURL = config.getUrl();
this.interceptors();
}
async get(option) {
return await axios.get(option.url, {
headers: Object.assign(
{
data: rsa.PublicKeyEncryption(option.data),
token: localStorage.getItem("token"),
},
option.headers
),
});
}
async post(option) {
return await axios.post(
option.url,
{},
{
headers: Object.assign(
{
data: rsa.PublicKeyEncryption(option.data),
token: localStorage.getItem("token"),
},
option.headers
),
}
);
}
interceptors() {
// 添加请求拦截器
axios.interceptors.request.use(
function (config) {
Toast.loading({
duration: 0,
message: "加载中...",
forbidClick: true,
});
// 在发送请求之前做些什么
return config;
},
function (error) {
// 对请求错误做些什么
return Promise.reject(error);
}
);
// 添加响应拦截器
axios.interceptors.response.use(
function (response) {
// 对响应数据做点什么
Toast.clear();
var data = response.data;
switch (data.status) {
case 200:
return rsa.PublicKeyDecryption(data.result);
case 501:
Toast.fail(data.message);
localStorage.removeItem("token");
setTimeout(() => {
location.href = "#/login";
}, 2000);
throw new Error(data.message);
case 500:
Toast.fail(data.message);
throw new Error(data.message);
case 404:
Toast.fail(data.message);
throw new Error(data.message);
break;
}
},
function (error) {
// 对响应错误做点什么
return Promise.reject(error);
}
);
}
}
export default new Http();

View File

@@ -0,0 +1,25 @@
import "amfe-flexible";
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import config from "./config";
import http from "./service/_";
import utils from "./utils";
import Item from "./components/Item";
Vue.config.productionTip = false;
Vue.prototype.$http = http;
Vue.prototype.$util = utils;
Vue.component("item", Item);
config.VuePlugIn.forEach((v) => Vue.use(v));
new Vue({
store,
router,
render: (h) => h(App),
}).$mount("#app");

View File

@@ -0,0 +1,8 @@
export default {
data() {
return {
page: 1,
totalPage: 0
}
},
}

View File

@@ -0,0 +1,152 @@
import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
const routes = [
{
path: "/",
name: "Home",
component: () => import(/* webpackChunkName: "home" */ "../views/Home.vue"),
meta: {
isLogin: true,
iskeepAlive: true,
},
},
{
path: "/about",
name: "About",
component: () =>
import(/* webpackChunkName: "about" */ "../views/About.vue"),
meta: {
isLogin: false,
iskeepAlive: false,
},
},
{
path: "/login",
name: "login",
component: () =>
import(/* webpackChunkName: "login" */ "../views/Login.vue"),
meta: {
isLogin: false,
iskeepAlive: false,
},
},
{
path: "/type",
name: "type",
component: () => import(/* webpackChunkName: "type" */ "../views/Type.vue"),
meta: {
isLogin: false,
iskeepAlive: true,
},
},
{
path: "/car",
name: "car",
component: () => import(/* webpackChunkName: "type" */ "../views/Car.vue"),
meta: {
isLogin: false,
iskeepAlive: false,
},
},
{
path: "/me",
name: "me",
component: () => import(/* webpackChunkName: "type" */ "../views/Me.vue"),
meta: {
isLogin: false,
iskeepAlive: false,
},
},
{
path: "/Setting",
name: "Setting",
component: () =>
import(/* webpackChunkName: "Setting" */ "../views/Setting.vue"),
meta: {
isLogin: false,
iskeepAlive: false,
},
},
{
path: "/Search",
name: "search",
component: () =>
import(/* webpackChunkName: "search" */ "../views/Search.vue"),
meta: {
isLogin: false,
iskeepAlive: false,
},
},
{
path: "/activity",
name: "activity",
component: () =>
import(/* webpackChunkName: "search" */ "../views/Activity.vue"),
meta: {
isLogin: false,
iskeepAlive: false,
},
},
{
path: "/info",
name: "info",
component: () =>
import(/* webpackChunkName: "search" */ "../views/Info.vue"),
meta: {
isLogin: false,
iskeepAlive: false,
},
},
//支付详情
{
path: "/payment",
name: "payment",
component: () =>
import(/* webpackChunkName: "payment" */ "../views/Payment.vue"),
meta: {
isLogin: false,
iskeepAlive: false,
},
},
{
path: "/OrderForm",
name: "OrderForm",
component: () =>
import(/* webpackChunkName: "OrderForm" */ "../views/OrderForm.vue"),
meta: {
isLogin: false,
iskeepAlive: false,
},
},
];
const router = new VueRouter({
routes,
});
router.beforeEach((to, from, next) => {
if (to.meta.isLogin) {
if (localStorage.getItem("token") !== null) {
next();
} else {
next({
path: "/login",
});
}
} else {
if (to.name == "login" || to.name == "reg") {
if (localStorage.getItem("token") !== null) {
router.go(-1);
} else {
next();
}
} else {
next();
}
}
});
export default router;

View File

@@ -0,0 +1,126 @@
import http from "../http";
import config from "../config";
export default class IndexService {
async home(data = {}, header = {}) {
var res = await http.post({
url: config.ApiList.index,
data: data,
headers: header,
});
res.forEach((v) => {
v.wares_masterimg = JSON.parse(v.wares_masterimg);
});
return res;
}
async activity(data = {}, header = {}) {
var res = await http.post({
url: config.ApiList.activity,
data: data,
headers: header,
});
res.forEach((v) => {
v.wares_masterimg = JSON.parse(v.wares_masterimg);
});
return res;
}
async info(data = {}, header = {}) {
var res = await http.post({
url: config.ApiList.info,
data: data,
headers: header,
});
res.wares_masterimg = JSON.parse(res.wares_masterimg);
res.wares_infoimg = JSON.parse(res.wares_infoimg);
return res;
}
async checkCar(data = {}, header = {}) {
return await http.post({
url: config.ApiList.checkCar,
data: data,
headers: header,
});
}
async addCar(data = {}, header = {}) {
return await http.post({
url: config.ApiList.addCar,
data: data,
headers: header,
});
}
async deleteCar(data = {}, header = {}) {
return await http.post({
url: config.ApiList.deleteCar,
data: data,
headers: header,
});
}
async getCarList(data = {}, header = {}) {
let res = await http.post({
url: config.ApiList.getCarList,
data: data,
headers: header,
});
res.forEach((v) => {
v.wares_masterimg = JSON.parse(v.wares_masterimg);
});
return res;
}
//提交购物车
async submitCar(data = {}, header = {}) {
return await http.post({
url: config.ApiList.submitCar,
data: data,
headers: header,
});
}
//订单页面购买支付后需要用的接口,更改订单状态为待发货
async buyOrder(data = {}, header = {}) {
return await http.post({
url: config.ApiList.buyOrder,
data: data,
headers: header,
});
}
async search(data = {}, header = {}) {
let res = await http.post({
url: config.ApiList.search,
data: data,
headers: header,
});
res.forEach((v) => {
v.wares_masterimg = JSON.parse(v.wares_masterimg);
});
return res;
}
//获取不同状态的订单
async allOrder(data = {}, header = {}) {
let res = await http.post({
url: config.ApiList.allOrder,
data: data,
headers: header,
});
if (Object.keys(res).length != 0) {
res.forEach((v) => (v.wares_masterimg = JSON.parse(v.wares_masterimg)));
return res;
} else {
return [];
}
}
}

View File

@@ -0,0 +1,13 @@
import http from '../http'
import config from '../config'
export default class TypeService {
async type (data = {}, header = {}) {
return await http.post({
url: config.ApiList.type,
data: data,
headers: header
})
}
}

View File

@@ -0,0 +1,20 @@
import http from '../http'
import config from '../config'
export default class UserService {
async login (data = {}, header = {}) {
return await http.post({
url: config.ApiList.login,
data: data,
headers: header
})
}
async reg (data = {}, header = {}) {
return await http.post({
url: config.ApiList.reg,
data: data,
headers: header
})
}
}

View File

@@ -0,0 +1,9 @@
import IndexService from './IndexService'
import UserService from './UserService'
import TypeService from './TypeService'
export default {
index: new IndexService(),
user: new UserService(),
type: new TypeService(),
}

View File

@@ -0,0 +1,5 @@
export default {
GET_CARLIST: state => state.car.carList,
GET_CARCOUNT: state => state.car.carCount,
}

View File

@@ -0,0 +1,16 @@
import Vue from 'vue'
import Vuex from 'vuex'
import car from './modules/car';
import setting from './modules/setting';
import getters from './getters';
Vue.use(Vuex);
export default new Vuex.Store({
getters,
modules: {
car,
setting,
},
})

View File

@@ -0,0 +1,31 @@
import http from "../../service/_";
export default {
state: {
carCount: 0,
carList: [],
//保存用户选中的商品
payList:[]
},
mutations: {
SET_CARLIST(state,data) {
state.carList = data;
},
SET_COUNT(state, leng = 1) {
state.carCount += leng;
},
//此方法是接收pyment传来的值,并且赋值给payList
submit(state,data){
state.payList = data;
}
},
actions: {
async PUT_SET_CARLIST ({ commit }, type="other") {
let res = await http.index.getCarList();
if (type == "other") {
Array.isArray(res) ? commit('SET_COUNT',res.length) : commit('SET_COUNT',0)
}
commit('SET_CARLIST',res)
}
}
}

View File

@@ -0,0 +1,11 @@
export default {
state: {
},
getters: {
},
mutations: {
},
actions: {
}
}

View File

@@ -0,0 +1,9 @@
class Utils {
checkPhone(phone){
if(!(/^[1][3,4,5,7,8][0-9]{9}$/.test(phone))){
return false;
}
return true;
}
}
export default new Utils();

View File

@@ -0,0 +1,20 @@
import NodeRsa from "node-rsa";
import Config from "../config";
class Rsa {
constructor () {
this.public_key = Config.publicKey
}
// 公钥加密
PublicKeyEncryption(text) {
return (new NodeRsa(this.public_key)).encrypt(JSON.stringify(text), 'base64')
}
// 公钥解密
PublicKeyDecryption(text) {
return JSON.parse((new NodeRsa(this.public_key)).decryptPublic(text, 'utf8'))
}
}
export default new Rsa()

View File

@@ -0,0 +1,5 @@
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>

View File

@@ -0,0 +1,42 @@
<template>
<div class="activity">
<div class="header">
<div class="h-text">
<van-icon name="arrow-left" @click='$router.back()' />
<p>限时白嫖</p>
</div>
</div>
<ul class="content">
<item :item-list="activityList"></item>
</ul>
</div>
</template>
<script>
export default {
name: 'Activity',
data() {
return {
activityList: []
}
},
created() {
this.getActivity();
},
methods: {
async getActivity() {
this.activityList = await this.$http.index.activity({
id: this.$route.query.id
});
console.log(this.activityList)
}
}
}
</script>
<style scoped lang="stylus">
@import "~@page/Activity.styl";
</style>

View File

@@ -0,0 +1,235 @@
<template>
<div class="car">
<van-nav-bar
fixed
title="购物车"
left-text="返回"
:right-text="isDelete ? '管理' : '完成'"
left-arrow
@click-right="isDelete = !isDelete"
@click-left="$router.back()"
/>
<div class="content">
<!-- carChange是用户点击选中事件 -->
<van-checkbox-group
v-model="result"
@change="carChange"
ref="checkboxGroup"
>
<van-checkbox
style="margin-bottom: 10px"
:name="item.car_id"
v-for="(item, index) in list"
:key="index"
>
<transition name="fade">
<div @click.stop="">
<van-card
:price="item.wares_nowprice"
:desc="item.wares_info"
:title="item.wares_title"
@click="
$router.push({ path: '/info', query: { id: item.wares_id } })
"
:thumb="item.wares_masterimg[0]"
>
<template #num>
<div @click.stop="">
<van-stepper v-model="item.car_num" integer />
</div>
</template>
</van-card>
</div>
</transition>
</van-checkbox>
</van-checkbox-group>
<transition name="fade">
<van-submit-bar
v-show="isDelete == true"
:price="totalMoney"
button-text="提交订单"
@submit="onSubmit"
>
<van-checkbox v-model="ischeck" @click="test">全选</van-checkbox>
</van-submit-bar>
</transition>
<transition name="fade">
<van-submit-bar
v-show="isDelete == false"
class="delete"
button-text="删除"
@submit="deleteCarItem"
>
<van-checkbox v-model="ischeck" @click="test">全选</van-checkbox>
</van-submit-bar>
</transition>
</div>
<Footer></Footer>
</div>
</template>
<script>
import Footer from "@c/Footer.vue";
import { mapGetters, mapActions } from "vuex";
export default {
data() {
return {
result: [],
ischeck: false,
isDelete: true,
//保存的是用户点击选中的商品id
ckeak: [],
};
},
created() {
this.getCarlist();
},
methods: {
//删除接口---------------------------------------------------------------
async deleteCarItem() {
await this.$http.index.deleteCar({
carid: this.result,
});
this.result = [];
this.getCarlist();
},
async getCarlist() {
await this.carAction("car");
console.log(this.list);
//打印的是购物车列表
},
//左边小圆点点击事件-----------------------------------------------------
carChange(selectArr) {
if (this.list.length == selectArr.length) {
this.ischeck = true;
} else {
this.ischeck = false;
}
// console.log(selectArr);
//赋值保存给空数组ckeak
this.ckeak = selectArr;
},
test() {
if (this.ischeck) {
this.$refs.checkboxGroup.toggleAll(true);
} else {
this.$refs.checkboxGroup.toggleAll();
}
},
...mapActions({
carAction: "PUT_SET_CARLIST",
}),
// 点击提交按钮提交订单,需要自己构建carList对象,里面包含三个字段--------------------------------
async onSubmit() {
//提交给后端
let payList = {
carList: [],
},
//保存的是用户选中的商品,保存至vuex中
payment = [];
//购物车列表,是个数组
console.log(this.list);
//用户选中商品的id
console.log(this.ckeak);
// 遍历购物车列表
this.list.forEach((item, index) => {
// 判断购物车列表里面的商品id是否包含用户选中的商品id
if (this.ckeak.includes(item.car_id)) {
//相等就保存至payment
payment.push(item);
console.log(item);
//这里面是用户选中的商品信息,构造好返回给payLists,然后提交给后端
payList.carList.push({
waresid: item.wares_id,
goodsnum: item.car_num,
goodsprice: item.wares_nowprice,
});
}
});
//2.payment保存至vuex
//调用提交接口,把payList转换成字符串上传上去。
let res = await this.$http.index.submitCar(JSON.stringify(payList));
console.log(res);
//把payment提交给vuex
this.$store.commit("submit", payment);
//跳转至支付页面
this.$router.push("/payment");
},
},
components: {
Footer,
},
computed: {
totalMoney() {
let money = 0;
var chiooseList = [];
this.list.forEach((item) => {
this.result.forEach((v) => {
if (item.car_id == v) {
chiooseList.push(item);
}
});
});
chiooseList.forEach((v) => (money += v.wares_nowprice * v.car_num));
return money * 100;
},
...mapGetters({
list: "GET_CARLIST",
}),
},
};
</script>
<style scoped lang="stylus">
.fade-enter-active, .fade-leave-active {
transition: opacity 1s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0;
}
.van-card {
background #fff !important;
}
.delete .van-submit-bar__bar{
justify-content: space-between !important;
}
/deep/ .van-checkbox__label {
flex 1;
margin-left 0;
}
/deep/ .van-checkbox__icon {
width: 39px;
text-align center;
}
/deep/ .van-checkbox__icon .van-icon {
display inline-block;
}
/deep/ .van-card {
padding-left 0 !important;
}
/deep/ .van-card__bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
/deep/ .van-card__desc {
width: 222px;
}
/deep/ .van-submit-bar {
bottom 50px
}
.content {
margin-bottom 100px;
margin-top 45px;
}
</style>

View File

@@ -0,0 +1,81 @@
<template>
<div class="home">
<Footer></Footer>
<div class="top">
<van-icon name="manager-o" class="icon" size=".5rem" />
<router-link tag="div" :to="{ path: 'Search' }" class="serch">
<van-icon name="search" size=".3rem" class="sou" />
<p>请输入关键字</p>
</router-link>
</div>
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe-item>
<img src="/img/mi10.jpg" alt="" />
</van-swipe-item>
<van-swipe-item>
<img src="/img/mi10.jpg" alt="" />
</van-swipe-item>
<van-swipe-item>
<img src="/img/mi10.jpg" alt="" />
</van-swipe-item>
</van-swipe>
<ul class="banner">
<router-link
tag="li"
:to="{ path: '/activity', query: { id: item.id } }"
v-for="(item, index) in activity"
:key="index"
>
<img :src="item.img" alt="" />
<p>{{ item.title }}</p>
</router-link>
</ul>
<div class="girdes">
<img src="/img/left_1.jpg" alt="" />
<div class="imggird">
<img src="/img/left_2.jpg" alt="" />
<img src="/img/left_3.jpg" alt="" />
</div>
</div>
<img src="/img/mi10.jpg" alt="" class="banimg" />
<item :item-list="list"></item>
</div>
</template>
<script>
import Footer from "@c/Footer.vue";
export default {
data() {
return {
list: [],
activity: [
{ id: 1, img: "/img/type_1.png", title: "限时白嫖" },
{ id: 2, img: "/img/type_2.png", title: "新品推荐" },
{ id: 3, img: "/img/type_3.png", title: "低价高配" },
{ id: 4, img: "/img/type_4.png", title: "超值特卖" },
],
};
},
created() {
this.getHome();
},
methods: {
async getHome() {
this.list = await this.$http.index.home();
console.log(this.list);
},
},
components: {
Footer,
},
};
</script>
<style lang="stylus" scoped>
@import '~@page/Home.styl';
</style>

View File

@@ -0,0 +1,171 @@
<template>
<div class="Info" ref="infos">
<div
class="header_top"
:style="{ background: `rgba(255, 255, 255, ${backColor})` }"
>
<van-icon
name="arrow-left"
:style="{ color: iconColor }"
@click="$router.back()"
/>
<van-icon name="cart-o" :style="{ color: iconColor }" />
</div>
<van-swipe class="my-swipe" @change="onChange" :autoplay="3000">
<van-swipe-item
v-for="(item, index) in info.wares_masterimg"
:key="index"
>
<img :src="item" @click="showSwiper(index)" alt="" />
</van-swipe-item>
<template #indicator>
<div class="custom-indicator">{{ current + 1 }}/3</div>
</template>
</van-swipe>
<div class="content_info">
<div class="price">¥{{ info.wares_nowprice }}</div>
<div class="tite">{{ info.wares_title }}</div>
<div class="desc">{{ info.wares_info }}</div>
</div>
<div class="img">
<img
v-for="(v, i) in info.wares_infoimg"
@click="showImg(i)"
:key="i"
:src="v"
alt=""
/>
</div>
<van-goods-action>
<van-goods-action-icon icon="chat-o" text="收藏" />
<van-goods-action-icon
@click="$router.push('/car')"
icon="cart-o"
text="购物车"
:badge="count"
/>
<van-goods-action-button
type="warning"
:style="{
background: isAddCar
? 'linear-gradient(to right,#c4c1b4,#c8c7c6)'
: '',
}"
@click="isAddCar ? '' : addCar()"
text="加入购物车"
/>
<van-goods-action-button type="danger" text="立即购买" />
</van-goods-action>
<Preview
:images="info.wares_infoimg"
:is-show="showStatus"
@status="changeShowStatus"
:idx="infoIndex"
></Preview>
</div>
</template>
<script>
import Preview from "@c/Preview.vue";
import { ImagePreview } from "vant";
import { mapGetters, mapMutations } from "vuex";
export default {
name: "Info",
data() {
return {
showStatus: false,
infoIndex: 0,
id: this.$route.query.id,
current: 0,
backColor: 0,
iconColor: "#fff",
info: {},
isAddCar: false, // false 可以添加,true 不可以添加
};
},
created() {
this.getInfoData();
this.checkCar();
},
mounted() {
window.addEventListener("scroll", this.paperScroll);
},
methods: {
...mapMutations({
addCount: "SET_COUNT",
}),
// 添加购物车
async addCar() {
await this.$http.index.addCar({
waresid: this.id,
});
this.addCount();
this.$toast("加入成功");
this.isAddCar = true;
},
async checkCar() {
let res = await this.$http.index.checkCar({
waresid: this.id,
});
this.isAddCar = res.isAddCar;
console.log(this.isAddCar);
},
showSwiper(index) {
ImagePreview({
images: this.info.wares_masterimg,
startPosition: index,
});
},
changeShowStatus(status) {
this.showStatus = status;
},
showImg(i) {
this.infoIndex = i;
this.showStatus = true;
},
async getInfoData() {
let res = await this.$http.index.info({
id: this.id,
});
this.info = res;
},
onChange(index) {
this.current = index;
},
paperScroll() {
var top = document.documentElement.scrollTop;
var scrollTop = (top / 412).toFixed(1);
if (top >= 367) {
this.iconColor = "#000";
} else {
this.iconColor = "#fff";
}
if (scrollTop >= 1) {
this.backColor = 255;
} else {
this.backColor = scrollTop;
}
},
},
computed: {
...mapGetters({
count: "GET_CARCOUNT",
}),
},
components: {
Preview,
},
};
</script>
<style scoped lang="stylus">
@import '~@page/Info.styl';
</style>

View File

@@ -0,0 +1,107 @@
<template>
<div class="login">
<img class="top" src="/img/topbacks.png" alt="" />
<div class="login_form">
<h2>{{ currentPage ? "登录" : "注册" }}</h2>
<div class="phone" v-if="!currentPage">
<img class="left" src="/img/phone.png" alt="" />
<input
type="text"
v-model="userform.phone"
placeholder="请收入手机号"
/>
<img class="right" src="/img/zk.png" alt="" />
</div>
<div class="phone">
<img class="left" src="/img/phone.png" alt="" />
<input type="text" v-model="userform.name" placeholder="请输入用户名" />
<img class="right" src="/img/zk.png" alt="" />
</div>
<div class="pwd">
<img class="left" src="/img/pwd.png" alt="" />
<input
:type="isShow ? 'text' : 'password'"
v-model="userform.pwd"
placeholder="请输入密码"
/>
<img
@click="isShow = !isShow"
class="right"
src="/img/eye.png"
alt=""
/>
</div>
<div class="login_submit" @click="currentPage ? UserLogin() : UserReg()">
{{ currentPage ? "登录" : "注册" }}
</div>
<p class="tips">
{{ currentPage ? "还没有账号?" : "已有账号?" }}
<span @click="currentPage = !currentPage">{{
!currentPage ? "登录" : "注册"
}}</span>
</p>
</div>
</div>
</template>
<script>
export default {
data() {
return {
currentPage: true, // true login false reg
isShow: false,
userform: {
name: "",
pwd: "",
phone: "",
},
};
},
created() {},
methods: {
async UserLogin() {
if (this.userform.name.length == 0) {
this.$toast.fail("用户必填");
return false;
}
if (this.userform.pwd.length == 0) {
this.$toast.fail("密码必填");
return false;
}
let res = await this.$http.user.login(this.userform);
console.log(res);
localStorage.setItem("token", res.token);
this.$router.replace("/");
},
async UserReg() {
if (!this.$util.checkPhone(this.userform.phone)) {
this.$toast.fail("手机号必须正确");
return false;
}
if (this.userform.name.length == 0) {
this.$toast.fail("用户必填");
return false;
}
if (this.userform.pwd.length == 0) {
this.$toast.fail("密码必填");
return false;
}
let res = await this.$http.user.reg(this.userform);
this.currentPage = true;
},
},
};
</script>
<style lang="stylus" scoped>
@import "~@page/Login.styl";
</style>

View File

@@ -0,0 +1,74 @@
<template lang="html">
<div class="me">
<div class="header">
<img class="set" src="/img/me_settin_2.png" alt="" />
<div class="user">
<img class="portrait" src="/img/user_head.png" alt="" />
<p>编码猿Code</p>
</div>
</div>
<div class="content">
<ul class="c-list">
<router-link
tag="li"
v-for="(item,index) in orderList"
:key="index"
:to="{ name: 'OrderForm', query: { active: index } }"
>
<img :src="item.img" alt="" />
<p>{{ item.title }}</p>
</router-link>
</ul>
<ul class="c-bottom">
<li class="address">
<div class="li-left">
<img src="/img/me_address.png" alt="" />
<p>收货地址</p>
</div>
</li>
<li class="collection">
<div class="li-left">
<img class="like" src="/img/me_like.png" alt="" />
<p>我的收藏</p>
</div>
<van-icon name="arrow" />
</li>
<router-link :to="{path:'Setting'}">
<li class="setting">
<div class="li-left">
<img src="/img/me_settin_2.png" alt="" />
<p>我的设置</p>
</div>
<van-icon name="arrow" />
</li>
</router-link>
</ul>
</div>
<Footer></Footer>
</div>
</template>
<script src="http://at.alicdn.com/t/font_1929483_9rn8kpfc5av.css"></script>
<script>
import Footer from "@c/Footer.vue";
export default {
data() {
return {
orderList: [
{ title: '全部订单', img: '/img/me_1.png' },
{ title: '待付款', img: '/img/me_2.png' },
{ title: '待发货', img: '/img/me_3.png' },
{ title: '待收货', img: '/img/me_4.png' },
{ title: '退款/售后', img: '/img/me_5.png' }
]
};
},
components: {
Footer,
},
};
</script>
<style scoped lang="stylus">
@import "~@page/Me.styl";
</style>

View File

@@ -0,0 +1,73 @@
<template lang="pug">
.orderstatus
van-tabs(v-model='active' @change="StatusChange")
van-tab(:title='v.title' v-for="(v,i) in OrderList" , :v-if='activeList',:key="i")
van-card(v-for="(v,i) in res" :num='v.goods_num',
:price='v.goods_price',
:desc="v.wares_info.substring(0, 20) + '...'",
:title='v.wares_title',
:key="i"
:thumb='v.wares_masterimg[0]')
template(#footer)
van-tag(type='danger' v-if="v.goods_status == 0") 待付款
van-tag(type='warning' v-if="v.goods_status == 1") 待发货
van-tag(type='success' v-if="v.goods_status == 2") 待收货
van-tag(type='primary' v-if="v.goods_status == 3") 退款/售后
</template>
<script>
export default {
data() {
return {
active: 0,
resStatus: [],
res: [],
OrderList: [
{ title: "所有订单", id: -1, content: [] },
{ title: "待付款", id: 0, content: [] },
{ title: "待发货", id: 1, content: [] },
{ title: "待收货", id: 2, content: [] },
{ title: "退款/售后", id: 3, content: [] },
],
};
},
created() {
console.log(this.$route.query.active);
if (this.$route.query.active) {
this.active = Number(this.$route.query.active);
}
this.allOrder();
this.StatusChange();
},
methods: {
StatusChange() {
if (this.activeList == undefined) {
} else {
this.allOrder();
}
},
async allOrder() {
this.res = await this.$http.index.allOrder({
status: this.OrderList[this.active].id,
});
this.res.forEach((v, i) => {
this.resStatus = v.goods_status;
console.log("v", this.resStatus);
});
// console.log("订单数据为:",this.OrderList)
console.log("数据res:", this.res);
// console.log("数据+++:",this.OrderList[this.active].content)
},
},
computed: {
activeList() {
return this.res.filter((val) => {
return val.goods_status;
});
},
},
};
</script>
<style scoped></style>

View File

@@ -0,0 +1,103 @@
<template>
<div>
<van-nav-bar left-text="返回" left-arrow @click-left="$router.back()" />
<van-card
v-for="(item, index) in zhifulist"
:price="item.goods_price"
:desc="item.wares_info.substring(0, 20) + '...'"
:title="item.wares_title"
:key="index"
:thumb="item.wares_masterimg[0]"
></van-card>
<van-cell-group>
<van-cell title="配送方式" value="顺丰配送(免运费)" />
<van-cell title="发票类型" value="电子发票" />
<van-cell title="优惠卷" value="无" />
</van-cell-group>
<van-cell-group title="支付方式" class="bottom">
<van-cell title="余额" icon="paid">
<!-- 使用 right-icon 插槽来自定义右侧图标 -->
<template #right-icon>
<van-checkbox v-model="checked"></van-checkbox>
</template>
</van-cell>
</van-cell-group>
<!-- 总价格 -->
<van-submit-bar :price="allMoney" button-text="支付" @submit="onSubmit" />
</div>
</template>
<script>
export default {
data() {
return {
//复选框是否为选中状态
checked: true,
//拿到购物车页面用户选中的商品
payList: this.$store.state.car.payList,
//不同状态的订单
zhifulist: [],
};
},
computed: {
allMoney() {
let price = 0;
this.zhifulist.forEach((item) => {
price += item.goods_num * item.wares_nowprice;
});
return price * 100;
},
},
mounted() {
this.byAllOrder();
},
created() {},
methods: {
//获取不同状态的订单接口
async byAllOrder() {
this.zhifulist = await this.$http.index.allOrder({
status: 0,
});
console.log(this.zhifulist);
},
//支付接口
async bybuyOrder() {
let infolist = [];
this.zhifulist.forEach((item) => {
infolist.push(item.goods_id);
});
let res = await this.$http.index.buyOrder({
goodsid: JSON.stringify(infolist),
});
console.log(res);
//只有支付完成才能跳转页面
this.$router.push("/OrderForm");
},
//支付按钮事件
onSubmit() {
this.bybuyOrder();
},
},
};
</script>
<style scoped>
.van-nav-bar {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 99;
}
.van-card:nth-child(2) {
margin-top: 1.3rem;
}
.bottom {
margin-bottom: 1.2rem;
}
</style>

View File

@@ -0,0 +1,39 @@
<template>
<div>
<div class="search">
<van-search show-action placeholder="请输入搜索关键词" v-model="value">
<template #action>
<div @click="Search">搜索</div>
</template>
</van-search>
</div>
<item :item-list="record"></item>
</div>
</template>
<script>
import item from "@c/Item.vue";
export default {
data() {
return {
record: [],
value: [],
};
},
created() {},
methods: {
async Search() {
this.record = await this.$http.index.search({
keyword: this.value,
});
console.log(this.record);
},
},
comments: {
item,
},
};
</script>
<style scoped lang="stylus">
@import "~@page/Search.styl";
</style>

View File

@@ -0,0 +1,74 @@
<template>
<div class="setting">
<div class="header">
<img src="/img/logo_s.png" alt="" />
<div class="text">
<p class="text1">基友汇</p>
<p class="text2">v2.1.1</p>
</div>
</div>
<ul class="content">
<li @click="ContactUs()">
<div class="contact">
<van-cell icon="phone-o"></van-cell>
<p>联系我们</p>
</div>
<van-icon name="arrow" />
</li>
<li @click="AboutUs()">
<div class="about">
<van-cell icon="friends-o"></van-cell>
<p>关于我们</p>
</div>
<van-icon name="arrow" />
</li>
<li @click="CheckUpdate()">
<div class="contact">
<van-cell icon="upgrade"></van-cell>
<p>检测升级</p>
</div>
<van-icon name="arrow" />
</li>
</ul>
<van-button class="bt1" color="#f8d14b" @click="UserLogOut">退 出 登 录</van-button>
</div>
</template>
<script>
export default {
name: "Setting",
methods: {
ContactUs () {
this.$dialog.alert({
title: '联系我们',
message: '平台客服电话:0551-7397727'
})
},
AboutUs () {
this.$dialog.alert({
title: '关于我们',
message: '一款专业的手机交易平台,让您买到更加安心放心的高质量手机!'
})
},
CheckUpdate () {
this.$toast("当前已是最新版");
},
UserLogOut () {
this.$dialog.confirm({
title: '退出登录',
message: '确定退出登录吗?'
}).then(() => {
localStorage.clear();
this.$router.push("/")
}).catch(() => {
});
},
}
};
</script>
<style scoped lang="stylus">
@import "~@page/Setting.styl";
</style>

View File

@@ -0,0 +1,79 @@
<template>
<div class="type">
<van-tree-select height="100vh" @click-nav="MenuClick" :items="items" :main-active-index.sync="active">
<template #content>
<div v-for="(v,i) in items">
<Item v-if="i == active" :item-list="items[active].content"></Item>
</div>
</template>
</van-tree-select>
<Footer></Footer>
</div>
</template>
<script>
import Footer from "@c/Footer.vue"
import Item from "@c/Item.vue";
export default {
data() {
return {
active: 0,
items: [
{
text: '小米',
content: []
},
{
text: '魅族',
content: []
},
{
text: '华为',
content: []
},
{
text: 'Iphone',
content: []
},
{
text: '三星',
content: []
},
{
text: '锤子',
content: []
}
],
};
},
created() {
this.getTypeList()
},
methods: {
MenuClick(index) {
if (this.items[this.active].content == 0) {
this.getTypeList()
}
},
async getTypeList() {
let res = await this.$http.type.type({
typename: this.items[this.active].text
})
this.items[this.active].content = res
console.log(res);
}
},
components: {
Footer,
Item,
}
};
</script>
<style scoped lang="stylus">
.van-tree-select__content{
padding-bottom 45px;
}
</style>

Some files were not shown because too many files have changed in this diff Show More