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,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,19 @@
# ddd
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
{
"name": "ddd",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "vue-cli-service serve --mode development",
"build": "vue-cli-service build --mode production"
},
"dependencies": {
"axios": "^0.20.0",
"core-js": "^3.6.5",
"lib-flexible": "^0.3.2",
"node-rsa": "^1.1.1",
"vant": "^2.10.6",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.5.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"postcss-pxtorem": "^5.1.1",
"pug-html-loader": "^1.1.5",
"pug-plain-loader": "^1.0.0",
"vue-template-compiler": "^2.6.11"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 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: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 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: 5.1 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: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 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: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 KiB

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<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>
<link rel="stylesheet" href="//at.alicdn.com/t/font_2080293_ihr18jfa50o.css">
</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 -->
</body>
</html>

View File

@@ -0,0 +1,23 @@
<template lang="pug">
#app
router-view
</template>
<script>
export default {
data() {
return {
}
},
async created(){
},
components: {
}
}
</script>
<style lang="less">
@import "~@less/utils/normalize.less";
</style>

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,45 @@
@import "./index.less";
@fontFamily: Roboto, Lato, sans-serif;
@themeColor: #2575fb;
@LoginColor: #f8d14b;
// 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,94 @@
@import "../color/var";
.account {
.account_welcome {
display: flex;
flex-direction: column;
height: 100%;
.swiper{
}
.buttons {
flex-grow: 1;
display: flex;
align-items: center;
justify-content: space-around;
div {
height: 30px;
width: 120px;
border: 1px solid @LoginColor;
border-radius: 4px;
text-align: center;
line-height: 30px;
font-size: 13px;
}
.login_butt {
color: @LoginColor;
}
.reg_butt {
background: @LoginColor;
color: @alternateTextColor;
}
}
}
.account_action {
.header {
height: 165px;
background: @LoginColor;
position: relative;
}
.wrap {
width: 87%;
background: @alternateTextColor;
position: relative;
top: -80px;
left: 50%;
margin-left: calc(-87% / 2);
border-radius: 13px;
padding: 12px;
box-sizing: border-box;
box-shadow: 2px 2px 10px #e1e1e1;
.portrait {
width: 45px;
height: 45px;
border: 2px solid @alternateTextColor;
border-radius: 100%;
position: absolute;
left: 50%;
margin-left: calc(-45px / 2);
top: -30px;
overflow: hidden;
img {
width: 100%;
height: 100%;
}
}
.input {
margin-top: 50px;
}
}
.login {
}
.reg {}
.SubmitLogin {
width: 87%;
height: 45px;
background: @LoginColor;
color: @alternateTextColor;
border-radius: 30px;
text-align: center;
font-size: 16px;
line-height: 45px;
margin: 0 auto;
margin-top: -40px;
}
.Tips {
margin: 0 auto;
margin-top: 16px;
padding-right: 33px;
font-size: 14px;
color: #c0c0c0;
text-align: right;
}
}
}

View File

@@ -0,0 +1,4 @@
@import "../color/var.less";
h2 {
color: @successColor;
}

View File

@@ -0,0 +1,10 @@
@import "../color/var.less";
.Contentlist{
padding: 50px 10px 0px 10px;
box-sizing: border-box;
}
.van-nav-bar{
position: fixed;
top: 0;
width: 100%;
}

View File

@@ -0,0 +1,310 @@
.transition(@d) {
-webkit-transition-duration: @d;
transition-duration: @d;
}
.delay(@d) {
-webkit-transition-delay: @d;
transition-delay: @d;
}
.transform(@t) {
-webkit-transform: @t;
transform: @t;
}
.transform-origin(@to) {
-webkit-transform-origin: @to;
transform-origin: @to;
}
.translate3d(@x:0, @y:0, @z:0) {
-webkit-transform: translate3d(@x,@y,@z);
transform: translate3d(@x,@y,@z);
}
.animation (@a) {
-webkit-animation: @a;
animation: @a;
}
.scrollable() {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.flex-shrink(@fs) {
-webkit-box-flex: @fs;
-webkit-flex-shrink: @fs;
-ms-flex: 0 @fs auto;
flex-shrink: @fs;
}
.clearfix() {
&:after,
&:before {
content: " ";
display: table;
}
&:after {
clear: both;
}
}
.hairline(@position, @color) when (@position = top) {
&:before {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: auto;
right: auto;
height: 1px;
width: 100%;
background-color: @color;
display: block;
z-index: 15;
// .transform-origin(50% 0%);
html.pixel-ratio-2 & {
.transform(scaleY(0.5));
}
html.pixel-ratio-3 & {
.transform(scaleY(0.33));
}
}
}
.hairline(@position, @color) when (@position = left) {
&:before {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: auto;
right: auto;
width: 1px;
height: 100%;
background-color: @color;
display: block;
z-index: 15;
// .transform-origin(0% 50%);
html.pixel-ratio-2 & {
.transform(scaleX(0.5));
}
html.pixel-ratio-3 & {
.transform(scaleX(0.33));
}
}
}
.hairline(@position, @color) when (@position = bottom) {
&:after {
content: '';
position: absolute;
left: 0;
bottom: 0;
right: auto;
top: auto;
height: 1px;
width: 100%;
background-color: @color;
display: block;
z-index: 15;
html.pixel-ratio-2 & {
.transform(scaleY(0.5));
}
html.pixel-ratio-3 & {
.transform(scaleY(0.33));
}
}
}
.hairline(@position, @color) when (@position = right) {
&:after {
content: '';
position: absolute;
right: 0;
top: 0;
left: auto;
bottom: auto;
width: 1px;
height: 100%;
background-color: @color;
display: block;
z-index: 15;
// .transform-origin(100% 50%);
html.pixel-ratio-2 & {
.transform(scaleX(0.5));
}
html.pixel-ratio-3 & {
.transform(scaleX(0.33));
}
}
}
// For right and bottom
.hairline-remove(@position) when not (@position = left) and not (@position = top) {
&:after {
display: none;
}
}
// For left and top
.hairline-remove(@position) when not (@position = right) and not (@position = bottom) {
&:before {
display: none;
}
}
// For right and bottom
.hairline-color(@position, @color) when not (@position = left) and not (@position = top) {
&:after {
background-color: @color;
}
}
// For left and top
.hairline-color(@position, @color) when not (@position = right) and not (@position = bottom) {
&:before {
background-color: @color;
}
}
// Encoded SVG Background
.encoded-svg-background(@svg) {
@url: `encodeURIComponent(@{svg})`;
background-image: url("data:image/svg+xml;charset=utf-8,@{url}");
}
// Preserve3D
.preserve3d() {
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
}
// Shadow
.depth(@level:1) {
& when (@level = 0) {
box-shadow: none;
}
& when (@level = 1) {
box-shadow: 0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);
}
& when (@level = 2) {
box-shadow: 0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12);
}
& when (@level = 3) {
box-shadow: 0 3px 3px -2px rgba(0,0,0,.2),0 3px 4px 0 rgba(0,0,0,.14),0 1px 8px 0 rgba(0,0,0,.12);
}
& when (@level = 4) {
box-shadow: 0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);
}
& when (@level = 5) {
box-shadow: 0 3px 5px -1px rgba(0,0,0,.2),0 5px 8px 0 rgba(0,0,0,.14),0 1px 14px 0 rgba(0,0,0,.12);
}
& when (@level = 6) {
box-shadow: 0 3px 5px -1px rgba(0,0,0,.2),0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12);
}
& when (@level = 7) {
box-shadow: 0 4px 5px -2px rgba(0,0,0,.2),0 7px 10px 1px rgba(0,0,0,.14),0 2px 16px 1px rgba(0,0,0,.12);
}
& when (@level = 8) {
box-shadow: 0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);
}
& when (@level = 9) {
box-shadow: 0 5px 6px -3px rgba(0,0,0,.2),0 9px 12px 1px rgba(0,0,0,.14),0 3px 16px 2px rgba(0,0,0,.12);
}
& when (@level = 10) {
box-shadow: 0 6px 6px -3px rgba(0,0,0,.2),0 10px 14px 1px rgba(0,0,0,.14),0 4px 18px 3px rgba(0,0,0,.12);
}
& when (@level = 11) {
box-shadow: 0 6px 7px -4px rgba(0,0,0,.2),0 11px 15px 1px rgba(0,0,0,.14),0 4px 20px 3px rgba(0,0,0,.12);
}
& when (@level = 12) {
box-shadow: 0 7px 8px -4px rgba(0,0,0,.2),0 12px 17px 2px rgba(0,0,0,.14),0 5px 22px 4px rgba(0,0,0,.12);
}
& when (@level = 13) {
box-shadow: 0 7px 8px -4px rgba(0,0,0,.2),0 13px 19px 2px rgba(0,0,0,.14),0 5px 24px 4px rgba(0,0,0,.12);
}
& when (@level = 14) {
box-shadow: 0 7px 9px -4px rgba(0,0,0,.2),0 14px 21px 2px rgba(0,0,0,.14),0 5px 26px 4px rgba(0,0,0,.12);
}
& when (@level = 15) {
box-shadow: 0 8px 9px -5px rgba(0,0,0,.2),0 15px 22px 2px rgba(0,0,0,.14),0 6px 28px 5px rgba(0,0,0,.12);
}
& when (@level = 16) {
box-shadow: 0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12);
}
& when (@level = 17) {
box-shadow: 0 8px 11px -5px rgba(0,0,0,.2),0 17px 26px 2px rgba(0,0,0,.14),0 6px 32px 5px rgba(0,0,0,.12);
}
& when (@level = 18) {
box-shadow: 0 9px 11px -5px rgba(0,0,0,.2),0 18px 28px 2px rgba(0,0,0,.14),0 7px 34px 6px rgba(0,0,0,.12);
}
& when (@level = 19) {
box-shadow: 0 9px 12px -6px rgba(0,0,0,.2),0 19px 29px 2px rgba(0,0,0,.14),0 7px 36px 6px rgba(0,0,0,.12);
}
& when (@level = 20) {
box-shadow: 0 10px 13px -6px rgba(0,0,0,.2),0 20px 31px 3px rgba(0,0,0,.14),0 8px 38px 7px rgba(0,0,0,.12);
}
& when (@level = 21) {
box-shadow: 0 10px 13px -6px rgba(0,0,0,.2),0 21px 33px 3px rgba(0,0,0,.14),0 8px 40px 7px rgba(0,0,0,.12);
}
& when (@level = 22) {
box-shadow: 0 10px 14px -6px rgba(0,0,0,.2),0 22px 35px 3px rgba(0,0,0,.14),0 8px 42px 7px rgba(0,0,0,.12);
}
& when (@level = 23) {
box-shadow: 0 11px 14px -7px rgba(0,0,0,.2),0 23px 36px 3px rgba(0,0,0,.14),0 9px 44px 8px rgba(0,0,0,.12);
}
& when (@level = 24) {
box-shadow: 0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);
}
// & when (@level = 1) {
// box-shadow: rgba(0, 0, 0, 0.117647) 0px 1px 6px, rgba(0, 0, 0, 0.117647) 0px 1px 4px;
// }
// & when (@level = 2) {
// box-shadow: rgba(0, 0, 0, 0.156863) 0px 3px 10px, rgba(0, 0, 0, 0.227451) 0px 3px 10px;
// }
// & when (@level = 3) {
// box-shadow: rgba(0, 0, 0, 0.188235) 0px 10px 30px, rgba(0, 0, 0, 0.227451) 0px 6px 10px;
// }
// & when (@level = 4) {
// box-shadow: rgba(0, 0, 0, 0.247059) 0px 14px 45px, rgba(0, 0, 0, 0.219608) 0px 10px 18px;
// }
// & when (@level = 5) {
// box-shadow: rgba(0, 0, 0, 0.298039) 0px 19px 60px, rgba(0, 0, 0, 0.219608) 0px 15px 20px;
// }
}
// Highlighted Links
.active-highlight(@color:rgba(255, 255, 255, 0.15)){
&:before {
content: '';
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
background-color: @color;
background-repeat: no-repeat;
background-position: center;
background-size: 100% 100%;
opacity: 0;
pointer-events: none;
.transition(600ms);
}
&.active-state:before,
html:not(.watch-active-state) &:active:before {
opacity: 1;
.transition(150ms);
}
}
.active-highlight-color(@color) {
&:before {
background-image: -webkit-radial-gradient(center, circle cover, @color 66%, rgba(red(@color),green(@color),blue(@color),0) 66%);
background-image: radial-gradient(circle at center, @color 66%, rgba(red(@color),green(@color),blue(@color),0) 66%);
}
}
// 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;
}

View File

@@ -0,0 +1,451 @@
/*! 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,body,#app,.account {
height: 100%
}
h2,h3,h4,h5,h6,h1,body,ul,li,p {
margin: 0;
padding: 0;
list-style: none;
}
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;
}
.list{
.commodity{
margin-right: 14px;
width: 48% !important;
}
.commodity:nth-child(2n){
margin-right: 0px;
}
}
.content{
.Swiper{
.van-swipe{
height: 200px !important;
}
}
}
.van-tabs--line .van-tabs__wrap{
position: fixed;
width: 100%;
z-index: 9;
}
.van-tabs__content--animated{
padding-top: 44px;
}
/* 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;
margin: 0.67em 0;
}
/**
* 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 */
}
/**
* 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 */
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,92 @@
<template lang="pug">
.Contentlist
.Content
.commodity(v-for="(v,i) in list" :key="i" @click="Eninfo(v.wares_id)")
img(:src="v.wares_masterimg[1]")
h3 {{v.wares_title.substring(0, 5)}}
p {{ v.wares_info.substring(0, 10)}}
span {{ v.wares_oldprice }} hby
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
export default {
name: "Contentlist",
props: {
list: {
type: Array,
default: []
},
},
//import引入的组件需要注入到对象中才能使用
components: {},
data() {
//这里存放数据
return {
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
Eninfo(id) {
this.$router.push({
path: '/info',
query: {
id: id
}
})
},
},
//生命周期 - 创建完成(可以访问当前this实例)
created() {
console.log(this.list);
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
};
</script>
<style lang='less' scoped>
.Contentlist {
padding-bottom: 50px;
.Content {
display: flex;
flex-wrap: wrap;
.commodity {
width: 50%;
text-align: center;
margin-bottom: 5px;
img {
width: 100%;
height: 187px;
}
h3 {
margin-top: 5px;
}
p {
font-size: 12px;
color: rgba(0, 0, 0, 0.54);
margin-top: 5px;
}
span {
display: block;
font-size: 14px;
color: #ea625b;
margin-top: 5px;
}
}
}
}
//@import url(); 引入公共css类
</style>

View File

@@ -0,0 +1,45 @@
<template lang="pug">
.Header
img(src='@img/logo.png', alt='')
van-search(show-action='', label='', placeholder='请输入搜索关键词',shape="round" @focus="$router.push('/search')")
template(#action='')
div 搜索
</template>
<script>
export default {
name: 'Header',
props: {},
data() {
return {}
},
created() {
},
methods: {},
components: {}
}
</script>
<style lang="less" scoped>
@import "~@less/color/var.less";
.Header{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 50px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 8px;
box-sizing: border-box;
background: @alternateTextColor;
z-index: 99;
img{
width: 25px;
height: 16px;
}
.van-search--show-action{
width: 90%;
}
}
</style>

View File

@@ -0,0 +1,70 @@
<template lang="pug">
.hello
h1 {{ msg }}
p
| For a guide and recipes on how to configure / customize this project,
br
| check out the
a(href='https://cli.vuejs.org', target='_blank', rel='noopener') vue-cli documentation
| .
h3 Installed CLI Plugins
ul
li
a(href='https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel', target='_blank', rel='noopener') babel
li
a(href='https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router', target='_blank', rel='noopener') router
li
a(href='https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex', target='_blank', rel='noopener') vuex
h3 Essential Links
ul
li
a(href='https://vuejs.org', target='_blank', rel='noopener') Core Docs
li
a(href='https://forum.vuejs.org', target='_blank', rel='noopener') Forum
li
a(href='https://chat.vuejs.org', target='_blank', rel='noopener') Community Chat
li
a(href='https://twitter.com/vuejs', target='_blank', rel='noopener') Twitter
li
a(href='https://news.vuejs.org', target='_blank', rel='noopener') News
h3 Ecosystem
ul
li
a(href='https://router.vuejs.org', target='_blank', rel='noopener') vue-router
li
a(href='https://vuex.vuejs.org', target='_blank', rel='noopener') vuex
li
a(href='https://github.com/vuejs/vue-devtools#vue-devtools', target='_blank', rel='noopener') vue-devtools
li
a(href='https://vue-loader.vuejs.org', target='_blank', rel='noopener') vue-loader
li
a(href='https://github.com/vuejs/awesome-vue', target='_blank', rel='noopener') awesome-vue
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

View File

@@ -0,0 +1,58 @@
<template lang="pug">
.ShopItem
van-row(style='margin-top: 10px')
van-col.item-center(v-for='(v,i) in list', :key='i', span='12', style='margin-bottom: 15px;')
router-link(:to="{ path: '/info', query: { id: v.wares_id } }")
van-image(:src='v.wares_masterimg[0]', style='height: 207px;', width='100%')
h3 {{ v.wares_title.substring(0, 5) }}
p {{ v.wares_info | Substring }}
.price {{ v.wares_oldprice }}
</template>
<script>
export default {
name: 'ShopItem',
props: {
list: {
type: Array,
default: []
}
},
data () {
return {}
},
async created () {
},
filters: {
Substring (val) {
return val.substring(0, 5) + '...';
}
},
methods: {},
components: {}
}
</script>
<style lang="less" scoped>
.item-center {
text-align: center;
h3 {
font-size: 15px;
color: #000;
}
p {
color: rgba(0, 0, 0, 0.54);
font-size: 13px;
margin-top: 4px;
line-height: 17px;
}
.price {
color: #ea625b;
font-size: 15px;
}
}
</style>

View File

@@ -0,0 +1,34 @@
<template lang="pug">
.Swiper
van-swipe.my-swipe(:autoplay='3000', indicator-color='white')
van-swipe-item(v-for="(v,i) in swiperList" :key="i")
div(v-if="v.id == null")
img(:src="v.img")
router-link(v-else :to="{ path: '/info', query: { id: v.id } }")
img(:src="v.img")
</template>
<script>
export default {
name: 'Swiper',
props: {
swiperList: {
type: Array,
default: []
}
},
data() {
return {}
},
async created() {
},
methods: {},
components: {}
}
</script>
<style lang="less" scoped>
//@import "~@less/page/Home.less";
img {
width: 100%;
}
</style>

View File

@@ -0,0 +1,45 @@
import http from "../service";
import Vant from 'vant';
import 'vant/lib/index.css';
export default {
AjaxConfig: {
// 开发阶段的请求基地址
DevUrl: 'http://127.0.0.1:6060',
// 测试阶段的请求基地址
TestUrl: '',
// 正式阶段的请求基地址
ProdUrl: 'http://127.0.0.1:3000/api/prod',
UrlList: {
Login: '/user/login',
Reg: '/user/add',
index:'/home/index',
activity:'/home/activity',
list:'/type/list',
info:'/home/info',
like:'/user/like',
addCar:'/car/addCar',
submitCar:'/car/submitCar',
likeList:'/user/likeList',
getCarList:'/car/getCarList',
updateCarNum:'/car/updateCarNum',
deleteCar:'/car/deleteCar',
allOrder:'/order/allOrder',
buyOrder:'/order/buyOrder',
search:'/home/search',
getUserAddress:'/user/getUserAddress',
}
},
NotVuePlugin: [
{ n: '$http', v: http }
],
VuePlugin: [
Vant
],
rsa_public_key: `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9eo8WIbWS5Yql06imlhrW0ZXh
faivPavdULvYLIxIKyUaOwMPFrPuHqqBNGnYOpiPHAKL+zxk2j4u+6jhB6VK1SOD
ccSLxIRxd0HmSDS+hBzYRf4vKc8BLlhMrYhnLmcxCc+PJIIa4DfCZnu8FfQlu/5L
ljjpYN9kHOpHAT+xpQIDAQAB
-----END PUBLIC KEY-----`
}

View File

@@ -0,0 +1,105 @@
import axios from "axios";
import Utils from "../utils";
import { Toast, Dialog } from 'vant';
import RSA from "../utils/rsa";
class Axios {
constructor() {
this.requestInterceptors()
this.responseInterceptors()
}
/**
* GET请求
* @param {*} object params
* {
* url: '',
* data: {}
* }
*/
async get(params) {
this.setBaseUrl()
return await axios.get(params.url, {
headers: {
data: RSA.PublicKeyEncryption(params.data),
token: localStorage.getItem("token")
}
})
}
/**
* post 请求
*/
async post(params) {
this.setBaseUrl()
return await axios.post(params.url, {}, {
headers: {
data: RSA.PublicKeyEncryption(params.data),
token: localStorage.getItem("token")
}
})
}
setBaseUrl () {
axios.defaults.baseURL = Utils.checkUrl();
}
/**
* 请求拦截器
*/
requestInterceptors() {
axios.interceptors.request.use(function (config) {
// 在发送请求之前做些什么
Toast.loading({
duration: 0,
forbidClick: true,
message: '数据加载中....',
});
return config;
}, function (error) {
// 对请求错误做些什么
return Promise.reject(error);
});
}
/**
* 响应拦截器
* 对响应数据做点什么
*/
responseInterceptors() {
axios.interceptors.response.use(function (response) {
Toast.clear();
switch (response.data.status) {
case 500:
Dialog.alert({
title: '出现错误',
message: `【${response.data.status}】 ${response.data.message}`,
}).then(() => {
localStorage.removeItem("token")
location.href = "#/account"
});
// 出现错误,不希望返回数据给前端页面,那么这时候将程序在这里断掉
throw new Error(`【${response.data.status}】 ${response.data.message}`)
break;
case 404:
Dialog.alert({
title: '温馨提示',
message: `【${response.data.status}】 ${response.data.message}`,
});
// 出现错误,不希望返回数据给前端页面,那么这时候将程序在这里断掉
throw new Error(`【${response.data.status}】 ${response.data.message}`)
break;
case 200:
response.data.result = RSA.PublicKeyDecryption(response.data.result)
return response.data.result;
break
}
}, function (error) {
// 对响应错误做点什么
return Promise.reject(error);
});
}
}
export default new Axios();

View File

@@ -0,0 +1,16 @@
import 'lib-flexible/flexible'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Config from './config'
Vue.config.productionTip = false
Config.VuePlugin.forEach(v => Vue.use(v))
Config.NotVuePlugin.forEach(v => Vue.prototype[v.n] = v.v)
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

View File

@@ -0,0 +1,123 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'index',
component: () => import(/* webpackChunkName: "home" */ '../views/Index.vue'),
redirect: '/home',
children: [
{
path: '/home',
name: 'home',
component: () => import(/* webpackChunkName: "type" */ '../views/Home.vue'),
meta: {
isLogin: false
}
},
{
path: '/type',
name: 'type',
component: () => import(/* webpackChunkName: "type" */ '../views/Type.vue'),
meta: {
isLogin: false
}
},
{
path: '/car',
name: 'car',
component: () => import(/* webpackChunkName: "car" */ '../views/Car.vue'),
meta: {
isLogin: true
}
},
{
path: '/me',
name: 'me',
component: () => import(/* webpackChunkName: "me" */ '../views/Me.vue'),
meta: {
isLogin: true
}
}
]
},
{
path: '/account',
name: 'account',
component: () => import(/* webpackChunkName: "account" */ '../views/Account.vue')
},
{
path: '/list',
name: 'list',
component: () => import(/* webpackChunkName: "list" */ '../views/list.vue')
},
{
path: '/Info',
name: 'Info',
component: () => import(/* webpackChunkName: "list" */ '../views/Info.vue')
},
{
path: '/setting',
name: 'Setting',
component: () => import(/* webpackChunkName: "list" */ '../views/Setting.vue')
},
{
path: '/pay',
name: 'pay',
component: () => import(/* webpackChunkName: "list" */ '../views/Pay.vue')
},
{
path: '/Collection',
name: 'Collection',
component: () => import(/* webpackChunkName: "list" */ '../views/Collection.vue')
},
{
path: '/Status',
name: 'Status',
component: () => import(/* webpackChunkName: "list" */ '../views/Status.vue')
},
{
path: '/Search',
name: 'Search',
component: () => import(/* webpackChunkName: "list" */ '../views/Search.vue')
},
{
path: '/Shippingaddress',
name: 'Shippingaddress',
component: () => import(/* webpackChunkName: "me" */ '../views/Shippingaddress.vue')
},
]
const router = new VueRouter({
routes
})
router.beforeEach((to, from, next)=>{
if (to.name == "account") {
if (localStorage.getItem("token") !== null) {
history.back()
} else {
next()
}
}
if (to.meta.isLogin) {
if (localStorage.getItem("token") !== null) {
next()
} else {
next({
path: '/account',
query: {
from: to.fullPath
}
})
}
} else {
next()
}
})
export default router

View File

@@ -0,0 +1,123 @@
import Config from "../config";
import Axios from "../http/axios";
class IndexService {
async index(data) {
let res = await Axios.post({
url: Config.AjaxConfig.UrlList.index,
data: data
});
res.forEach((v)=>{
v.wares_infoimg = JSON.parse(v.wares_infoimg);
v.wares_masterimg = JSON.parse(v.wares_masterimg);
})
return res;
}
async like(data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.like,
data: data
})
}
async addCar(data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.addCar,
data: data
})
}
async submitCar(data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.submitCar,
data: data
})
}
async likeList(data) {
let res = await Axios.post({
url: Config.AjaxConfig.UrlList.likeList,
data: data
});
res.forEach((v)=>{
v.wares_infoimg = JSON.parse(v.wares_infoimg);
v.wares_masterimg = JSON.parse(v.wares_masterimg);
})
return res;
}
async getCarList(data) {
let res = await Axios.post({
url: Config.AjaxConfig.UrlList.getCarList,
data: data
});
res.forEach((v)=>{
v.wares_infoimg = JSON.parse(v.wares_infoimg);
v.wares_masterimg = JSON.parse(v.wares_masterimg);
})
return res;
}
async updateCarNum(data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.updateCarNum,
data: data
})
}
async deleteCar(data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.deleteCar,
data: data
})
}
async allOrder (data) {
let res = await Axios.post({
url: Config.AjaxConfig.UrlList.allOrder,
data: data
});
// JSON.stringify(res) == "{}"
if (Object.keys(res).length == 0) {
return []
} else {
res.forEach((v) => {
v.wares_infoimg = JSON.parse(v.wares_infoimg);
v.wares_masterimg = JSON.parse(v.wares_masterimg);
});
}
return res
}
async buyOrder(data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.buyOrder,
data: data
})
}
async search (data) {
let res = await Axios.post({
url: Config.AjaxConfig.UrlList.search,
data: data
});
res.forEach((v) => {
v.wares_infoimg = JSON.parse(v.wares_infoimg);
v.wares_masterimg = JSON.parse(v.wares_masterimg);
});
return res
}
async getUserAddress(data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.getUserAddress,
data: data
})
}
}
export default new IndexService();

View File

@@ -0,0 +1,17 @@
import Config from "../config";
import Axios from "../http/axios";
class InfoService {
async info (data) {
let res = await Axios.post({
url: Config.AjaxConfig.UrlList.info,
data: data
});
res.wares_infoimg = JSON.parse(res.wares_infoimg);
res.wares_masterimg = JSON.parse(res.wares_masterimg);
res.wares_conf = JSON.parse(res.wares_conf);
return res;
}
}
export default new InfoService();

View File

@@ -0,0 +1,13 @@
import Config from "../config";
import Axios from "../http/axios";
class Typeservice {
async list(data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.list,
data: data
});
}
}
export default new Typeservice();

View File

@@ -0,0 +1,20 @@
import Config from "../config";
import Axios from "../http/axios";
class UserService {
async Login(data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.Login,
data: data
})
}
async Reg(data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.Reg,
data: data
})
}
}
export default new UserService();

View File

@@ -0,0 +1,19 @@
import Config from "../config";
import Axios from "../http/axios";
class activityService {
async activity(data) {
let res = await Axios.post({
url: Config.AjaxConfig.UrlList.activity,
data: data
});
res.forEach((v)=>{
v.wares_infoimg = JSON.parse(v.wares_infoimg);
v.wares_masterimg = JSON.parse(v.wares_masterimg);
})
return res;
}
}
export default new activityService();

View File

@@ -0,0 +1,14 @@
import UserService from "./UserService"
import IndexService from "./IndexService"
import activityService from "./activityService"
import Typeservice from "./Typeservice"
import InfoService from "./InfoService"
export default {
UserService: UserService,
IndexService: IndexService,
activityService: activityService,
Typeservice: Typeservice,
InfoService: InfoService,
}

View File

@@ -0,0 +1,22 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: { // 存数据,类似vue的data
OrderList: []
},
mutations: { //修改数据的,类似vue的methods
Set_OrderList (state, data) {
state.OrderList = data;
}
},
getters: { // getters 读state里面的数据
Get_OrderList (state) {
return state.OrderList
}
},
actions: { // ac tions 触发 mutations
}
})

View File

@@ -0,0 +1,15 @@
import Config from "../config"
class Utils {
checkUrl() {
// 开发阶段
if (process.env.NODE_ENV == "development") {
return Config.AjaxConfig.DevUrl
// 正式阶段
} else {
return Config.AjaxConfig.ProdUrl
}
}
}
export default new Utils;

View File

@@ -0,0 +1,25 @@
import NodeRsa from "node-rsa";
import config from "../config";
class RSA {
constructor () {
this.public_key = `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9eo8WIbWS5Yql06imlhrW0ZXh
faivPavdULvYLIxIKyUaOwMPFrPuHqqBNGnYOpiPHAKL+zxk2j4u+6jhB6VK1SOD
ccSLxIRxd0HmSDS+hBzYRf4vKc8BLlhMrYhnLmcxCc+PJIIa4DfCZnu8FfQlu/5L
ljjpYN9kHOpHAT+xpQIDAQAB
-----END PUBLIC KEY-----`;
}
// 公钥加密
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,137 @@
<template lang="pug">
.account
.account_welcome(v-if="isShowAction")
.swiper
img(src="img/login_2.png")
.buttons
.login_butt(@click="changePage('login')") 登 录
.reg_butt(@click="changePage('reg')") 注 册
.account_action(v-else)
.header
.login.wrap(v-if="currentStatus == 'login'")
.portrait
img(src="https://upload.jianshu.io/users/upload_avatars/9988193/fc26c109-1ae6-4327-a298-2def343e9cd8.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240")
van-cell-group(class="input" :border="false")
van-field( clearable
left-icon='manager-o'
v-model="UserLogin.name"
placeholder='请输入用户名')
van-field(class="pass"
:type="ShowType"
v-model="UserLogin.pwd"
clearable
:right-icon="ShowIcon"
@click-right-icon="ShowPwd"
left-icon='edit'
placeholder='请输入密码')
.reg.wrap(v-else)
.portrait
img(src="https://upload.jianshu.io/users/upload_avatars/9988193/fc26c109-1ae6-4327-a298-2def343e9cd8.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240")
van-cell-group(class="input" :border="false")
van-field( clearable
left-icon='manager-o'
v-model="UserReg.name"
placeholder='请输入用户名')
van-field( clearable
left-icon='phone-o'
v-model="UserReg.phone"
placeholder='请输入手机号')
van-field(class="pass"
:type="ShowType"
v-model="UserReg.pwd"
clearable
:right-icon="ShowIcon"
@click-right-icon="ShowPwd"
left-icon='edit'
placeholder='请输入密码')
.SubmitLogin(@click=" currentStatus == 'login' ? Login() : Reg() ") {{ currentStatus == "login" ? '登 录': '注 册' }}
.Tips(@click="changePage( currentStatus == 'login' ? 'reg' : 'login' )")
| {{ currentStatus == "login" ? '注 册': '登 录' }}
</template>
<script>
// import SwiperComponents from '@com/Swiper.vue'
export default {
name: 'User',
data() {
return {
UserLogin: {
name: '',
pwd: ''
},
UserReg: {
name: '',
pwd: '',
phone: ''
},
isShowAction: true,
currentStatus: 'login',
ShowIcon: 'closed-eye',
ShowType: 'password',
}
},
async created() {
},
methods: {
ShowPwd() {
if (this.ShowIcon == "closed-eye") {
this.ShowIcon = "eye-o"
this.ShowType = "text"
} else {
this.ShowIcon = "closed-eye"
this.ShowType = "password"
}
},
async Login() {
let res = await this.$http.UserService.Login(this.UserLogin);
this.$dialog.alert({
message: '登录成功',
}).then(() => {
localStorage.setItem("token", res.token);
if (this.$route.query.hasOwnProperty("from")) {
this.$router.replace(this.$route.query.from)
} else {
this.$router.replace("/home")
}
});
},
async Reg() {
await this.$http.UserService.Reg(this.UserReg);
this.$dialog.alert({
message: '注册成功',
}).then(() => {
this.currentStatus = "login"
});
},
/**
* 切换登录和注册页面
* @param action
*/
changePage(action) {
// 切换搭配登录注册页面
this.isShowAction = false;
this.currentStatus = action;
}
},
components: {
}
}
</script>
<style lang="less" scoped>
@import "~@less/page/Account.less";
.swiper{
img{
width: 100%;
}
}
</style>

View File

@@ -0,0 +1,148 @@
<template lang="pug">
.Car
van-nav-bar(fixed='', left-arrow='', title='购物车' @click-left="$router.back()")
template(#right='')
span(@click='changeAction') {{ ShowDelete ? "管理" : "完成" }}
// <span @click="changeAction">完成</span>
.content
van-checkbox-group(ref='checkboxGroup', v-model='checkCarItem')
.carItem(v-for='(v, i) in CarList', :key='i')
van-checkbox(:name='v.car_id')
van-card(:desc="v.wares_info.substring(0, 20) + '..'", :price='v.wares_oldprice', :thumb='v.wares_masterimg[0]', :title='v.wares_title')
template(#footer='')
van-stepper(v-model='v.car_num', @minus='UpdateCarNums(v.car_id, v.car_num - 1)', @plus='UpdateCarNums(v.car_id, v.car_num + 1)')
van-goods-action
van-checkbox(v-model='checkCarItem.length == CarList.length ? true : false', @click='SelectAllCarItem')
| 全选
van-goods-action-button(:text="ShowDelete ? `结算(${Money})` : '删除'", type='danger', @click='ShowDelete ? SubmitCar() : DeleteCarItem()')
</template>
<script>
import { mapMutations } from "vuex";
export default {
name: "car",
data() {
return {
checkCarItem: [],
ShowDelete: true,
CarList: [],
};
},
async created() {
this.GetCarList();
},
methods: {
...mapMutations(["Set_OrderList"]),
async GetCarList() {
this.CarList = await this.$http.IndexService.getCarList({});
console.log(this.CarList);
},
async UpdateCarNums(carid, nums) {
let res = await this.$http.IndexService.updateCarNum({
carid: carid,
quantity: nums,
});
},
async SubmitCar() {
let data = [],
orderData = [];
this.CarList.forEach((v) => {
if (this.checkCarItem.includes(v.car_id)) {
orderData.push(v);
data.push({
waresid: v.wares_id,
goodsnum: v.car_num,
goodsprice: v.wares_oldprice,
});
}
});
let res = await this.$http.IndexService.submitCar(
JSON.stringify({
carList: data,
})
);
this.$toast("订单增加成功");
//this.Set_OrderList(orderData)
setTimeout(() => {
this.$router.push("/Pay");
}, 2000);
},
// 全选
SelectAllCarItem() {
if (this.checkCarItem.length == 0) {
this.$refs.checkboxGroup.toggleAll(true);
} else {
this.$refs.checkboxGroup.toggleAll();
}
console.log(this.checkCarItem);
},
// 删除购物车商品
async DeleteCarItem() {
console.log(this.checkCarItem);
let res = await this.$http.IndexService.deleteCar({
carid: this.checkCarItem,
});
this.GetCarList();
},
changeAction() {
this.ShowDelete = !this.ShowDelete;
},
},
computed: {
Money() {
if (this.checkCarItem.length != 0) {
console.log("this.checkCarItem: ", this.checkCarItem);
let price = 0;
this.CarList.forEach((v) => {
if (this.checkCarItem.includes(v.car_id)) {
price += v.car_num * v.wares_oldprice;
}
});
return price;
} else {
return 0;
}
},
},
components: {},
};
</script>
<style lang="less" scoped>
.content {
padding-top: 46px;
padding-bottom: 110px !important;
}
.van-card {
background: #fff !important;
}
.van-goods-action {
bottom: 49.37px !important;
padding-left: 10px;
box-sizing: border-box;
}
.van-goods-action-button {
width: 30%;
position: absolute;
right: 0;
}
.carItem {
display: flex;
align-items: center;
padding-left: 15px;
box-sizing: border-box;
}
.van-card {
flex: 1;
padding-left: 0 !important;
}
//@import "~@less/page/Home.less";
</style>

View File

@@ -0,0 +1,40 @@
<template lang="pug">
.Collection
van-nav-bar(left-arrow='', title='收藏', @click-left='$router.back()')
ShopItem(:list="List")
</template>
<script>
import ShopItem from "@com/ShopItem.vue";
export default {
name: 'Collection',
data () {
return {
List: []
}
},
async created () {
this.GetLike();
},
methods: {
async GetLike() {
this.List = await this.$http.IndexService.likeList({});
console.log(this.List)
}
},
components: {
ShopItem
}
}
</script>
<style lang="less" scoped>
.van-nav-bar{
position: fixed;
width: 100%;
top: 0;
}
.ShopItem{
padding-top: 46px;
}
</style>

View File

@@ -0,0 +1,85 @@
<template lang="pug">
.home
Header
.content
Swipers(:swiper-list="piclist")
van-grid(:border='false', :column-num='type.length')
van-grid-item(@click="Enterlist(v.id)" v-for="(v,i) in type" :key="i")
van-image(:src="v.url")
span {{v.title}}
Contentlist(:list='Itemlist')
</template>
<script>
// import HelloWorld from '@com/HelloWorld.vue'
import Header from '@com/Header.vue'
import Swipers from '@com/Swiper.vue'
import Contentlist from '@com/Contentlist.vue'
export default {
data() {
return {
piclist:[],
type:[
{url:"img/type_1.png",title:"限时白嫖",id:1},
{url:"img/type_2.png",title:"新品推荐",id:2},
{url:"img/type_3.png",title:"低价高配",id:3},
{url:"img/type_4.png",title:"超值特卖",id:4}
],
Itemlist:[]
};
},
async created() {
this.GetIndex()
},
methods: {
Enterlist(id) {
this.$router.push({
path: '/list',
query: {
id: id
}
})
},
async GetIndex() {
let res = await this.$http.IndexService.index({});
this.Itemlist = res
console.log(res);
res.forEach((v,i)=>{
if (i <= 2) {
this.piclist.push({
img: v.wares_masterimg[1],
id: v.wares_id
})
}
});
}
},
components: {
Header,
Swipers,
Contentlist
}
}
</script>
<style lang="less" scoped>
@import "~@less/page/Home.less";
.content{
padding-top: 50px;
.Swiper{
.van-swipe{
height: 200px !important;
}
}
}
.van-grid-item{
.van-image{
width: 32px !important;
}
span{
margin-top: 3px;
color: #646566;
font-size: 12px;
}
}
</style>

View File

@@ -0,0 +1,29 @@
<template lang="pug">
.Index
router-view
van-tabbar(route)
van-tabbar-item(icon='home-o' replace to="/home") 首页
van-tabbar-item(icon='orders-o' replace to="/type") 分类
van-tabbar-item(icon='shopping-cart-o' replace to="/car") 购物车
van-tabbar-item(icon='friends-o' replace to="/me") 我的
</template>
<script>
// import HelloWorld from '@com/HelloWorld.vue'
export default {
name: 'Index',
data() {
return {
}
},
async created() {
},
methods: {},
components: {}
}
</script>
<style lang="less" scoped>
//@import "~@less/page/Home.less";
</style>

View File

@@ -0,0 +1,248 @@
<template lang="pug">
.info(v-if="ConfigData.length != 0")
.title
.title_shadow(@click="$router.back()")
van-icon(name="arrow-left", size="20", color="#fff")
.title_shadow(@click="$router.push('/car')")
van-icon(name="shopping-cart-o", size="20", color="#fff")
Swiper(:swiperList="infolist.wares_masterimg")
.InfoContent
h2 {{ infolist.wares_title }}
p {{ infolist.wares_info }}
.price ¥ {{ ConfigData[active].config_price }}
.norms(@click="OpenConfig")
p.status 已选
p.conf {{ ConfigData[active].config_info }}...
p.right
span x1
van-icon(name="arrow")
.info_img
img(
v-for="i in infolist.wares_infoimg",
:src="i",
@click="IsShowPreview = true"
)
van-popup(v-model="isShowConfig",:style="{ height: '40%' }",close-icon="close",closeable,position="bottom",round)
van-card(:desc="ConfigData[active].config_info",:thumb="infolist.wares_masterimg[1].img",:title="ConfigData[active].config_price")
.version 版本
.list
.item(
v-for="(item, index) in ConfigData",
:key="index",
:class="active == index ? 'chioose' : ''",
@click="active = index"
)
| {{ item.config_text }}
van-image-preview(
v-model="IsShowPreview",
:images="infolist.wares_infoimg",
@change="PreviewChange"
)
template(v-slot:index="") {{ CurrentPreviewIndex }}/{{ infolist.wares_infoimg.length }}
van-goods-action
van-goods-action-icon(icon="star-o", text="收藏", @click="LikeShop")
van-goods-action-icon(
icon="cart-o",
text="购物车",
@click="$router.push('/car')"
)
van-goods-action-button(text="加入购物车", type="warning", @click="addCar")
van-goods-action-button(text="立即购买", type="danger", @click="NowBuy()")
</template>
<script>
import Swiper from "../components/Swiper";
export default {
name: "info",
data() {
return {
infolist: {},
isShowConfig: false,
active: 0,
CurrentPreviewIndex: 1,
IsShowPreview: false,
ConfigData: [],
};
},
async created() {
await this.Infocontent();
this.StructureData();
},
methods: {
async Infocontent() {
this.infolist = await this.$http.InfoService.info({
id: this.$route.query.id,
});
let NewSwiper = [];
this.infolist.wares_masterimg.forEach((v) => {
NewSwiper.push({
img: v,
id: 1,
});
});
this.infolist.wares_masterimg = NewSwiper;
console.log(this.infolist);
},
PreviewChange(i) {
this.CurrentPreviewIndex = i + 1;
},
StructureData() {
this.infolist.wares_conf.forEach((v, i) => {
let text = v.match(/ (\S*)GB/)[1] + "GB";
let min = parseInt(text.split("+")[1]);
this.ConfigData.push({
config_text: text,
config_info: v,
});
});
this.ConfigData[0].config_price = this.infolist.wares_nowprice;
this.ConfigData[1].config_price = this.infolist.wares_oldprice;
},
OpenConfig() {
this.isShowConfig = true;
},
async LikeShop() {
await this.$http.IndexService.like({
shopid: this.$route.query.id,
});
this.$toast("收藏成功");
},
async addCar() {
let res = await this.$http.IndexService.addCar({
waresid: this.$route.query.id,
});
this.$toast("添加成功");
},
async NowBuy() {
var data = [];
data.push({
waresid: this.infolist.wares_id,
goodsnum: 1,
goodsprice: this.infolist.wares_oldprice,
});
let res = await this.$http.IndexService.submitCar(
JSON.stringify({
carList: data,
})
);
this.$toast("订单增加成功");
setTimeout(() => {
this.$router.push("/Pay");
}, 2000);
},
},
components: {
Swiper,
},
};
</script>
<style lang="less" scoped>
.title {
padding: 0 20px;
display: flex;
justify-content: space-between;
align-items: center;
height: 60px;
position: fixed;
top: 0;
left: 0;
width: 100%;
box-sizing: border-box;
z-index: 9;
}
.title_shadow {
border-radius: 100%;
width: 40px;
height: 40px;
background: #00000059;
display: flex;
align-items: center;
justify-content: center;
}
.version {
font-size: 16px;
color: #666;
margin: 10px;
}
.list {
margin: 10px;
display: flex;
.item {
padding: 8px 7px;
border: 1px solid #cac8c6;
margin-right: 10px;
}
}
.van-card__content {
padding-top: 20px !important;
}
.van-card__title {
color: #ff6700;
font-size: 20px !important;
margin-bottom: 10px;
}
.chioose {
border: 1px solid #ff6700 !important;
color: #ff6700 !important;
}
.van-card__desc {
font-size: 15px;
}
.InfoContent {
padding: 16px;
h2 {
font-size: 0.56rem;
color: #3c3c3c;
margin-bottom: 0.26667rem;
}
p {
color: rgba(0, 0, 0, 0.54);
font-size: 0.33333rem;
line-height: 0.5rem;
}
.price {
margin-top: 0.26667rem;
color: #ff6700;
font-size: 0.53333rem;
}
}
.norms {
padding: 0.13333rem 0.4rem;
border-bottom: 0.13333rem solid #f7f7f7;
border-top: 0.13333rem solid #f7f7f7;
display: flex;
justify-content: space-between;
height: 1.06667rem;
align-items: center;
font-size: 0.34667rem;
}
.info_img {
padding-bottom: 55px;
img {
width: 100%;
}
}
</style>

View File

@@ -0,0 +1,109 @@
<template lang="pug">
.me
.header
img.setting(alt='', src='/img/me_settin_2.png', @click='seating')
.user
img.user_head(alt='', src='/img/user_head.png')
p 赵先生
van-grid.type(:border='false', :column-num='5', clickable='')
router-link(v-for='(item, index) in orderList', :key='index', :to="{ name: 'Status', query: { active: index } }")
van-grid-item(:text='item.title')
img(slot='icon', :src='item.img')
.setting
van-cell(:center='true', :clickable='true', icon='location-o', title='收货地址',is-link to="/Shippingaddress")
img(slot='icon', alt='', src='/img/me_address.png')
van-cell(:center='true', :clickable='true', icon='location-o', title='我的收藏', is-link='', to='/Collection')
img(slot='icon', alt='', src='/img/me_like.png')
van-cell(:center='true', :clickable='true', icon='location-o', is-link='', title='我的设置', to='/setting')
img(slot='icon', alt='', src='/img/me_settin_2.png')
</template>
<script>
// import HelloWorld from '@com/HelloWorld.vue'
export default {
name: "me",
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" },
],
};
},
async created() {},
methods: {
seating(){
this.$router.push({
path: '/Setting',
})
}
},
components: {},
};
</script>
<style lang="less" scoped>
.header {
width: 100%;
height: 200px;
background: url("/img/me_back.png") no-repeat;
background-position: center center;
background-size: cover;
position: relative;
}
.header .setting {
position: absolute;
right: 15px;
top: 20px;
width: 25px;
height: 25px;
z-index: 9;
}
.header .user {
display: flex;
align-items: center;
position: absolute;
bottom: 40px;
left: 20px;
}
.header .user img {
width: 55px;
height: 55px;
}
.header .user p {
margin-left: 10px;
font-size: 18px;
}
.type {
justify-content: space-around;
}
.type img {
width: 35px;
}
.setting {
margin-top: 15px;
}
.setting .van-cell {
padding-top: 15px;
padding-bottom: 15px;
}
.setting img {
width: 18px;
height: 20px;
margin-right: 10px;
}
</style>

View File

@@ -0,0 +1,234 @@
<template lang="pug">
.Pay
.wxpay-page(v-if='HiddedWxPage')
.wxpay-page-dialog
.dialog-title
van-icon(name='cross', size='15', @click='HiddedWxPage = false')
span 请输入支付密码
.dialog-price
p.price-title 付款给创想网络科技
p.price-info
span.info-1 ¥
span.info-2 {{ TotalMoney / 100 }}.00
.dialog-chooise
p 支付方式
.chooise-right
img(alt='', src='img/wxPay/ye.png')
span 零钱
van-icon(name='arrow', size='15')
van-password-input(:focused='showKeyboard', :value='PayPassword', @focus='showKeyboard = true')
.wxpay-page-password
van-number-keyboard(:show='showKeyboard', @blur='showKeyboard = false', @delete='onDelete', @input='onInput')
.order-list(v-else)
// 代付款订单列表
van-card(v-for='(item,index) in Get_OrderList', :key='index', :desc='item.wares_info', :num='item.goods_num', :price='item.goods_price', :thumb='item.wares_masterimg[0]', :title='item.wares_title')
van-cell-group
van-cell(title='配送方式', value='顺丰配送货(免运费)')
van-cell(title='发票类型', value='电子发票')
van-cell(title='优惠券', value='无')
van-cell-group(title='支付方式')
van-cell(title='微信支付')
template(slot='icon')
img(alt='微信支付', src='img/pay_wx.png')
template(slot='right-icon')
van-radio(checked='')
van-cell(title='支付宝支付')
template(slot='icon')
img(alt='支付宝支付', src='img/pay_zfb2.png')
template(slot='right-icon')
van-radio(disabled='')
van-cell(title='花呗分期')
template(slot='icon')
img(alt='花呗分期', src='img/pay_antinstalment.png')
template(slot='right-icon')
van-radio(disabled='')
van-cell(title='银联支付')
template(slot='icon')
img(alt='银联支付', src='img/pay_yl1.png')
template(slot='right-icon')
van-radio(disabled='')
van-submit-bar(:price='TotalMoney', button-text='支付', @submit='PayStatus()')
</template>
<script>
export default {
name: 'Pay',
data () {
return {
showKeyboard: true,
PayPassword: '',
HiddedWxPage: false,
Get_OrderList: []
}
},
async created () {
// console.log(this.Get_OrderList);
this.GetAllOrder()
},
methods: {
async GetAllOrder () {
this.Get_OrderList = await this.$http.IndexService.allOrder({
status: 0
});
},
PayStatus () {
this.HiddedWxPage = true
},
async onInput (v) {
this.PayPassword = (this.PayPassword + v).slice(0, 6);
if (this.PayPassword.length == 6) {
let aa = [];
this.Get_OrderList.forEach(v => {
aa.push(v.goods_id)
})
this.HiddedWxPage = false
let res = await this.$http.IndexService.buyOrder({
goodsid: JSON.stringify(aa)
})
this.$dialog.alert({
title: '提示',
message: '支付成功'
}).then(() => {
this.$router.push("/status")
});
}
},
onDelete () {
this.PayPassword = this.PayPassword.slice(0, this.PayPassword.length - 1);
}
},
components: {},
computed: {
TotalMoney () {
let price = 0;
this.Get_OrderList.forEach((v) => {
price += parseInt(v.goods_totalprice)
});
return price * 100
}
// ...mapGetters([
// 'Get_OrderList'
// ])
}
}
</script>
<style lang="less" scoped>
.order-list {
margin-top: 20px;
}
.van-cell {
align-items: center;
img {
width: 20px;
margin-right: 10px;
}
}
.wxpay-page-dialog {
width: 330px;
position: absolute;
background: #f8f8f8;
left: 50%;
margin-left: -165px;
top: 10%;
padding: 0 10px;
padding-bottom: 20px;
box-sizing: border-box;
}
.wxpay-page-dialog .dialog-title {
display: flex;
align-items: center;
height: 50px;
position: relative;
}
.wxpay-page-dialog .dialog-title .van-icon {
position: absolute;
left: 10px;
color: #aca6a8;
}
.wxpay-page-dialog .dialog-title span {
font-size: 14px;
color: #000;
margin: 0 auto;
}
.wxpay-page-dialog .dialog-price {
margin-top: 10px;
text-align: center;
border-bottom: 1px solid #ececec;
padding-bottom: 15px;
}
.wxpay-page-dialog .dialog-price .price-title {
font-size: 16px;
margin-bottom: 15px;
color: #000;
}
.wxpay-page-dialog .dialog-price .price-info {
font-weight: bolder;
}
.wxpay-page-dialog .dialog-price .price-info .info-1 {
vertical-align: middle;
font-size: 17px;
}
.wxpay-page-dialog .dialog-chooise {
display: flex;
justify-content: space-between;
height: 45px;
align-items: center;
padding: 0 4px;
}
.wxpay-page-dialog .dialog-chooise p {
font-size: 14px;
color: #686169;
}
.wxpay-page-dialog .dialog-chooise .chooise-right {
display: flex;
align-items: center;
}
.wxpay-page-dialog .dialog-chooise .chooise-right img {
width: 20px;
}
.wxpay-page-dialog .dialog-chooise .chooise-right span {
font-size: 13px;
margin-left: 8px;
margin-right: 8px;
}
.wxpay-page-dialog .van-password-input {
margin: 5px 0 0 0;
}
.wxpay-page {
position: fixed;
width: 100%;
background: rgba(0, 0, 0, 0.702);
z-index: 9999;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.delete {
width: 40px;
margin-top: 15px;
}
</style>

View File

@@ -0,0 +1,57 @@
<template lang="pug">
.Search
van-search(v-model='SearchKey', fixed='', placeholder='请输入搜索关键词', show-action='', @search='onSearch')
template(#action='')
div(@click='onSearch') 搜索
.content(v-if='SearchList.length != 0')
ShopItem(:list='SearchList')
.content.search(v-else='')
| 请搜索
</template>
<script>
import ShopItem from "@com/ShopItem";
export default {
name: 'Search',
data () {
return {
SearchKey: '',
SearchList: []
}
},
created () {
},
methods: {
async GetSearchList () {
let res = await this.$http.IndexService.search({
keyword: this.SearchKey
});
this.SearchList = res
},
onSearch () {
this.GetSearchList()
}
},
components: {
ShopItem
}
}
</script>
<style lang="less" scoped>
.van-search {
position: fixed;
width: 100%;
z-index: 9;
top: 0;
left: 0;
}
.search {
text-align: center;
padding-top: 190px;
color: #6666;
}
</style>

View File

@@ -0,0 +1,124 @@
<template>
<div class="Setting">
<div class="logo-wrap">
<img alt="logo" class="logo" src="/img/logo_s.png">
<p>基友汇<span>v2.1.1</span></p>
</div>
<div class="list">
<van-cell :center="true"
:clickable="true"
icon="phone-o"
is-link
title="联系我们"
@click="ContactUs()">
</van-cell>
<van-cell :center="true"
:clickable="true"
icon="friends-o"
is-link
title="关于我们"
@click="AboutUs()">
</van-cell>
<van-cell :center="true"
:clickable="true"
icon="upgrade"
is-link
title="检测升级"
@click="CheckUpdate()">
</van-cell>
</div>
<van-button block
class="logout"
color="#f8d14b"
type="primary" @click="UserLogOut">
退 出 登 录
</van-button>
</div>
</template>
<script>
export default {
name: 'Setting',
data () {
return {}
},
async created () {
},
methods: {
UserLogOut () {
this.$dialog.alert({
title: '退出登录',
message: '确定退出登录吗?'
}).then(() => {
localStorage.clear();
this.$router.push("/home")
})
},
ContactUs () {
this.$dialog.alert({
title: '联系我们',
message: '平台客服电话:0551-7397727'
})
},
AboutUs () {
this.$dialog.alert({
title: '关于我们',
message: '一款专业的手机交易平台,让您买到更加安心放心的高质量手机!'
})
},
CheckUpdate () {
this.$toast("当前已是最新版");
}
},
components: {}
}
</script>
<style lang="less" scoped>
.Setting {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 70px;
box-sizing: border-box;
.list {
width: 100%;
margin-top: 40px;
}
.logo-wrap {
text-align: center;
p {
margin-top: 11px;
font-size: 14px;
letter-spacing: 5px;
span {
letter-spacing: 0;
font-size: 9px;
color: #a3a1a1;
}
}
.logo {
width: 80px;
height: 80px;
}
}
.logout {
width: 91%;
margin-top: 40px;
}
}
.van-cell {
padding: 15px;
}
</style>

View File

@@ -0,0 +1,71 @@
<!-- -->
<template lang="pug">
.Shippingaddress
van-address-list(v-model='chosenAddressId', :list='list', :disabled-list='disabledList', disabled-text='以下地址超出配送范围', default-tag-text='默认',)
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
export default {
//import引入的组件需要注入到对象中才能使用
components: {},
data() {
//这里存放数据
return {
chosenAddressId: '1',
list: [
{
id: '1',
name: '张三',
tel: '13000000000',
address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
isDefault: true,
},
{
id: '2',
name: '李四',
tel: '1310000000',
address: '浙江省杭州市拱墅区莫干山路 50 号',
},
],
disabledList: [
{
id: '3',
name: '王五',
tel: '1320000000',
address: '浙江省杭州市滨江区江南大道 15 号',
},
],
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
async Getaddress() {
let res = await this.$http.IndexService.getUserAddress({});
console.log(res);
}
},
//生命周期 - 创建完成(可以访问当前this实例)
async created() {
this.Getaddress()
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
};
</script>
<style lang='less' scoped>
//@import url(); 引入公共css类
</style>

View File

@@ -0,0 +1,59 @@
<template lang="pug">
.OrderStatus
van-tabs(v-model='active', animated='', @change='ChangeStatus')
van-tab(v-for='(v,i) in OrderList', :key='i', :title='v.title')
div(v-if='v.content.length != 0')
van-card(v-for='(t,x) in v.content', :desc='t.wares_info', :num='t.goods_num', :price='t.goods_price', :thumb='t.wares_masterimg[0]', :title='t.wares_title', @click='enterInfo(t.wares_id)')
.nodata(v-else='')
| 没有订单
</template>
<script>
export default {
name: 'Status',
data () {
return {
active: 0,
OrderList: [
{ title: '所有订单', id: -1, content: [] },
{ title: '待付款', id: 0, content: [] },
{ title: '待发货', id: 1, content: [] },
{ title: '待收货', id: 2, content: [] },
{ title: '退款/售后', id: 3, content: [] }
]
}
},
async created () {
if (this.$route.query.hasOwnProperty("active")) {
this.active = this.$route.query.active;
}
this.allOrder()
},
methods: {
enterInfo (id) {
this.$router.push({ path: '/info', query: { id: id } })
},
ChangeStatus (i) {
this.active = i;
if (this.OrderList[this.active].content.length == 0) {
this.allOrder()
}
},
async allOrder () {
let res = await this.$http.IndexService.allOrder({
status: this.OrderList[this.active].id
});
this.OrderList[this.active].content = [ ...res ]
}
},
components: {}
}
</script>
<style lang="less" scoped>
.nodata {
text-align: center;
margin-top: 10%;
color: #a39b9b;
}
</style>

View File

@@ -0,0 +1,104 @@
<template lang="pug">
.type
van-nav-bar(title='分类')
template(#right='')
van-icon(name='search', size='18',@click="enterseach")
.typeconten
van-tree-select(height='100vh', :items='items', :main-active-index.sync='active' @click-nav="Change")
template(#content)
van-row(gutter='10px')
van-col(v-for="(v,i) in items[active].content" @click="enterInfo(v.wares_id)")
van-image(:src='v.wares_masterimg')
p {{v.wares_title}}
</template>
<script>
export default {
name: 'type',
data() {
return {
active: 0,
items: [
{ text: '小米',content:[]},
{ text: '魅族',content:[]},
{ text: '华为',content:[]},
{ text: 'iPhone',content:[]},
{ text: '三星',content:[]},
{ text: '锤子',content:[]},
{ text: '诺基亚',content:[]},
],
}
},
async created() {
this.GetTypeList()
},
methods: {
enterseach(){
this.$router.push({
path: '/Search',
});
},
async GetTypeList() {
let res = await this.$http.Typeservice.list({
typename: this.items[this.active].text
});
console.log(res);
this.items[this.active].content= res;
},
Change(index) {
this.active = index;
if (this.items[this.active].content.length == 0) {
this.GetTypeList()
}
},
enterInfo(id){
this.$router.push({
path: '/info',
query: {
id: id
}
});
},
},
components: {}
}
</script>
<style lang="less" scoped>
.van-nav-bar{
position: fixed;
width: 100%;
top: 0;
left: 0;
}
.van-tree-select{
padding-top: 46px !important;
padding-bottom: 50px !important;
box-sizing: border-box;
}
.van-tree-select__nav{
flex: 0.5 !important;
}
.van-tree-select__content{
padding-left: 10px;
box-sizing: border-box;
padding-right: 10px;
}
.van-row{
display: flex;
flex-wrap: wrap;
}
.van-col{
padding: 0 !important;
width: 48%;
margin-right: 10px;
margin-bottom: 10px;
p{
text-align: center;
}
}
.van-col:nth-child(2n){
margin-right: 0px;
}
</style>

View File

@@ -0,0 +1,40 @@
<!-- -->
<template>
<div class>
<img src="@img/logo.png" alt="">
</div>
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
export default {
//import引入的组件需要注入到对象中才能使用
components: {},
data() {
//这里存放数据
return {};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {},
//生命周期 - 创建完成(可以访问当前this实例)
created() {},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
};
</script>
<style lang='scss' scoped>
//@import url(); 引入公共css类
</style>

View File

@@ -0,0 +1,67 @@
<template lang="pug">
.list
van-nav-bar(:title='title',left-arrow='',@click-left="$router.back()")
Contentlist(:list='Itemlists')
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
import Contentlist from '@com/Contentlist.vue'
export default {
//import引入的组件需要注入到对象中才能使用
components: {
Contentlist
},
data() {
//这里存放数据
return {
Itemlists:[],
title: ''
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
async Infocontent() {
this.Itemlists = await this.$http.activityService.activity({
id:this.$route.query.id
});
console.log(this.Itemlists)
}
},
//生命周期 - 创建完成(可以访问当前this实例)
async created() {
switch (this.$route.query.id) {
case "1":
this.title = '限时白嫖';
break;
case "2":
this.title = '新品推荐';
break;
case "3":
this.title = '低价高配';
break;
case "4":
this.title = '超值特卖';
break;
}
this.Infocontent()
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
};
</script>
<style lang='less' scoped>
@import "~@less/page/List.less";
</style>

View File

@@ -0,0 +1,38 @@
const path = require('path');
module.exports = {
publicPath: './',
css: {
loaderOptions: {
postcss: {
plugins: [
require('postcss-pxtorem')({
rootValue: 37.5, // 换算的基数
selectorBlackList: ['weui', 'mu'], // 忽略转换正则匹配项
propList: ['*'],
}),
]
}
}
},
chainWebpack: (config) => {
// 配置pug的
config.module.rule('pug')
.test(/\.pug$/)
.use('pug-html-loader')
.loader('pug-html-loader')
.end();
// 路径别名
config.resolve.alias
.set('@',resolve('src'))
.set('@com',resolve('src/components'))
.set('@img',resolve('public/img'))
.set('@less',resolve('src/assets/less'))
}
}
function resolve(dir) {
return path.join(__dirname, dir);
}

View File

@@ -0,0 +1,30 @@
jwt
RSA
让接口变得有状态
jons web token
后端渲染的网站
用户登录成功后,后端会保存用户登录信息到后端的cookies里面
前后端分离后:
用户登录
后端返回前端 token SADFREGTRHYGEAWE23435467UUYEW3EFGVBTRN
{
token: "SADFREGTRHYGEAWE23435467UUYEW3EFGVBTRN"
}
将token保存到本地
后面的请求需要在axios中自动获取本地token发送给后端

View File

@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

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,19 @@
# ddd
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
{
"name": "ddd",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "vue-cli-service serve --mode development",
"build": "vue-cli-service build --mode production"
},
"dependencies": {
"axios": "^0.20.0",
"core-js": "^3.6.5",
"lib-flexible": "^0.3.2",
"node-rsa": "^1.1.1",
"vant": "^2.10.6",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.5.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"postcss-pxtorem": "^5.1.1",
"pug-html-loader": "^1.1.5",
"pug-plain-loader": "^1.0.0",
"vue-template-compiler": "^2.6.11"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 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

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