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'
]
}

View File

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

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: 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

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width,initial-scale=1.0" name="viewport">
<link href="<%= BASE_URL %>favicon.ico" rel="icon">
<title><%= htmlWebpackPlugin.options.title %></title>
<link href="//at.alicdn.com/t/font_2080293_ihr18jfa50o.css" rel="stylesheet">
</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,19 @@
<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,46 @@
@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,109 @@
@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,5 @@
@import "../color/var.less";
h2 {
color: @successColor;
}

View File

@@ -0,0 +1,335 @@
.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,444 @@
/*! 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;
}
.content {
padding-top: 60px;
padding-bottom: 55px;
}
.van-tree-select__nav {
padding-bottom: 55px;
}
.van-tree-select__content {
flex: 4 !important;
padding: 7px;
padding-bottom: 55px;
}
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;
}
/* 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,50 @@
<template lang="pug">
.HomeHeader
.me
van-icon(name='friends-o')
.search
van-search(@focus="$router.push('/search')" placeholder='请输入搜索关键词')
</template>
<script>
// import HelloWorld from '@com/HelloWorld.vue'
export default {
name: 'HomeHeader',
data () {
return {}
},
async created () {
},
methods: {},
components: {}
}
</script>
<style lang="less" scoped>
.HomeHeader {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 10px;
box-sizing: border-box;
position: fixed;
width: 100%;
height: 59px;
z-index: 999;
background: #fff;
.search {
width: 90%;
}
.me {
margin-left: 10px;
i {
font-size: 20px;
}
}
}
</style>

View File

@@ -0,0 +1,47 @@
<template>
<div class="InfoHeader">
<van-icon name="arrow-left" @click="$router.back()"/>
<van-icon name="shopping-cart-o" @click="$router.push('/car')"/>
</div>
</template>
<script>
// import HelloWorld from '@com/HelloWorld.vue'
export default {
name: 'InfoHeader',
data () {
return {}
},
async created () {
},
methods: {},
components: {}
}
</script>
<style lang="less" scoped>
.InfoHeader {
position: fixed;
width: 100%;
top: 0;
left: 0;
z-index: 999;
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 15px;
box-sizing: border-box;
i {
color: #fff;
text-align: center;
line-height: 40px;
border-radius: 100%;
font-size: 20px;
width: 40px;
height: 40px;
background: #00000038;
}
}
</style>

View File

@@ -0,0 +1,61 @@
<template>
<div class="ShopItem">
<van-row style="margin-top: 10px">
<van-col v-for="(v,i) in list" :key="i" class="item-center" 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) }}</h3>
<p>{{ v.wares_info | Substring }}</p>
<div class="price">{{ v.wares_oldprice }}</div>
</router-link>
</van-col>
</van-row>
</div>
</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,35 @@
<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,46 @@
import http from "../service";
import Vant from 'vant';
import 'vant/lib/index.css';
import Utils from "../utils";
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',
Info: '/home/info',
Type: '/type/list',
activity: '/home/activity',
addCar: '/car/addCar',
getCarList: '/car/getCarList',
updateCarNum: '/car/updateCarNum',
submitCar: '/car/submitCar',
deleteCar: '/car/deleteCar',
allOrder: '/order/allOrder',
buyOrder: '/order/buyOrder',
Search: '/home/search',
LikeShop: '/user/like',
LikeList: '/user/likeList',
}
},
NotVuePlugin: [
{ n: '$http', v: http },
{ n: '$utils', v: Utils }
],
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,104 @@
import axios from "axios";
import Utils from "../utils";
import { Dialog, Toast } 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(() => {
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,118 @@
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: '/coll',
name: 'Collection',
component: () => import(/* webpackChunkName: "account" */ '../views/Collection.vue')
},
{
path: '/list',
name: 'list',
component: () => import(/* webpackChunkName: "account" */ '../views/List.vue')
},
{
path: '/info',
name: 'info',
component: () => import(/* webpackChunkName: "me" */ '../views/Info.vue')
},
{
path: '/pay',
name: 'pay',
component: () => import(/* webpackChunkName: "me" */ '../views/Pay.vue')
},
{
path: '/setting',
name: 'setting',
component: () => import(/* webpackChunkName: "me" */ '../views/Setting.vue')
},
{
path: '/status',
name: 'status',
component: () => import(/* webpackChunkName: "me" */ '../views/OrderStatus.vue')
},
{
path: '/search',
name: 'search',
component: () => import(/* webpackChunkName: "me" */ '../views/Search.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,154 @@
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 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;
}
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;
}
async Type (data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.Type,
data: data
});
}
async addCar (data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.addCar,
data: data
})
}
async LikeShop (data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.LikeShop,
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 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 updateCarNum (data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.updateCarNum,
data: data
})
}
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 submitCar (data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.submitCar,
data: data
})
}
async deleteCar (data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.deleteCar,
data: data
})
}
async buyOrder (data) {
return await Axios.post({
url: Config.AjaxConfig.UrlList.buyOrder,
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
}
}
export default new IndexService();

View File

@@ -0,0 +1,21 @@
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,7 @@
import UserService from "./UserService"
import IndexService from "./IndexService"
export default {
UserService: UserService,
IndexService: IndexService
}

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,17 @@
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";
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,138 @@
<template lang="pug">
.account
.account_welcome(v-if="isShowAction")
.swiper
SwiperComponents(:swiper-list="list")
.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',
list: [ '/img/login_2.png' ]
}
},
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 () {
this.isShowAction = false
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: {
SwiperComponents
}
}
</script>
<style lang="less" scoped>
@import "~@less/page/Account.less";
</style>

View File

@@ -0,0 +1,176 @@
<template>
<div class="Car">
<van-nav-bar
fixed
left-arrow
title="购物车">
<template #right>
<span @click="changeAction">{{ ShowDelete ? '管理' : '完成' }}</span>
<!-- <span @click="changeAction">完成</span>-->
</template>
</van-nav-bar>
<div class="content">
<van-checkbox-group ref="checkboxGroup" v-model="checkCarItem">
<div v-for="(v,i) in CarList" :key="i" class="carItem">
<van-checkbox :name="v.car_id"></van-checkbox>
<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)"
/>
</template>
</van-card>
</div>
</van-checkbox-group>
<van-goods-action>
<van-checkbox v-model="checkCarItem.length == CarList.length ? true : false" @click="SelectAllCarItem">全选
</van-checkbox>
<van-goods-action-button
:text="ShowDelete?`结算(${Money})`: '删除'"
type="danger"
@click="ShowDelete ? SubmitCar() : DeleteCarItem()"/>
</van-goods-action>
</div>
</div>
</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-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>
<div class="Collection">
<van-nav-bar
left-arrow
title="收藏"
@click-left="$router.back()"
/>
<ShopItemComponents :list="List"></ShopItemComponents>
</div>
</template>
<script>
import ShopItemComponents from "../components/ShopItem";
export default {
name: 'Collection',
data () {
return {
List: []
}
},
async created () {
this.GetLike();
},
methods: {
async GetLike() {
this.List = await this.$http.IndexService.LikeList({});
console.log("res ===== : ", this.List)
}
},
components: {
ShopItemComponents
}
}
</script>
<style lang="less" scoped>
//@import "~@less/page/Home.less";
</style>

View File

@@ -0,0 +1,107 @@
<template>
<div class="home">
<HomeHeaderComponents></HomeHeaderComponents>
<div class="content">
<SwiperComponents :swiper-list="SwiperList"></SwiperComponents>
<van-grid :border="false" :column-num="4">
<van-grid-item v-for="(v,i) in TuiJian" :key="i" class="tj_img" @click="Enterlist(v.id)">
<van-image :src="v.url" style="margin-bottom: 15px" width="37"/>
<span>{{ v.title }}</span>
</van-grid-item>
</van-grid>
<van-row>
<van-col span="12">
<van-image src="/img/left_1.jpg" width="100%"/>
</van-col>
<van-col span="12">
<van-row>
<van-col span="24">
<van-image src="/img/left_2.jpg" width="100%"/>
</van-col>
<van-col span="24">
<van-image src="/img/left_3.jpg" width="100%"/>
</van-col>
</van-row>
</van-col>
</van-row>
<van-image src="/img/mi10.jpg" width="100%"/>
<ShopItemComponents :list="itemList"></ShopItemComponents>
</div>
</div>
</template>
<script>
import SwiperComponents from "../components/Swiper";
import HomeHeaderComponents from "../components/HomeHeader";
import ShopItemComponents from "../components/ShopItem";
export default {
data () {
return {
itemList: [],
SwiperList: [],
TuiJian: [
{ id: 1, url: '/img/type_1.png', title: '限时白嫖' },
{ id: 2, url: '/img/type_2.png', title: '新品推荐' },
{ id: 3, url: '/img/type_3.png', title: '低价高配' },
{ id: 4, url: '/img/type_4.png', title: '超值特卖' }
]
}
},
async created () {
this.GetIndex()
},
methods: {
Enterlist (id) {
this.$router.push({
path: '/list',
query: {
id: id
}
})
},
async GetIndex () {
let res = await this.$http.IndexService.Index({});
console.log(res)
res.forEach((v,i)=>{
if (i <= 2) {
this.SwiperList.push({
img: v.wares_masterimg[1],
id: v.wares_id
})
}
});
console.log(this.SwiperList)
this.itemList = res
}
},
components: {
SwiperComponents,
HomeHeaderComponents,
ShopItemComponents
}
}
</script>
<style lang="less" scoped>
@import "~@less/page/Home.less";
.Swiper {
height: 200px;
}
.tj_img {
text-align: center;
.van-image__img {
width: 37px;
margin-bottom: 15px;
}
}
</style>

View File

@@ -0,0 +1,28 @@
<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,235 @@
<template>
<div v-if="ConfigData.length != 0" class="Info">
<InfoHeaderComponents></InfoHeaderComponents>
<SwiperComponents :swiper-list="InfoList.wares_masterimg"></SwiperComponents>
<div class="InfoContent">
<h2>{{ InfoList.wares_title }}</h2>
<p>{{ InfoList.wares_info }}</p>
<div class="price"> {{ ConfigData[active].config_price }}</div>
</div>
<div class="norms" @click="OpenConfig">
<p class="status">已选</p>
<p class="conf">{{ ConfigData[active].config_info }}...</p>
<p class="right">
<span>x1</span>
<van-icon name="arrow"/>
</p>
</div>
<div class="info_img">
<img v-for="i in InfoList.wares_infoimg" :src="i"
@click="IsShowPreview = true"/>
</div>
<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[0]"
:title="ConfigData[active].config_price"
/>
<div class="version">版本</div>
<div class="list">
<div v-for="(item,index) in ConfigData"
:key="index"
:class="active == index ? 'chioose': '' " class="item"
@click="active = index">
{{ item.config_text }}
</div>
</div>
</van-popup>
<van-image-preview v-model="IsShowPreview" :images="InfoList.wares_infoimg" @change="PreviewChange">
<template v-slot:index>{{ CurrentPreviewIndex }}/{{ InfoList.wares_infoimg.length }}</template>
</van-image-preview>
<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()"/>
</van-goods-action>
</div>
</template>
<script>
import InfoHeaderComponents from "../components/InfoHeader";
import SwiperComponents from "../components/Swiper";
export default {
name: 'Info',
data () {
return {
isShowConfig: false,
active: 0,
CurrentPreviewIndex: 1,
IsShowPreview: false,
InfoList: {},
ConfigData: [],
list: [
{ url: 'https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/f93719624db56e56186c540d779787c4.jpg', title: '登录图片' },
{ url: 'https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/b4ea51ccbdd6bdf3d23b4a8af0ed7edd.jpg', title: '注册图片' },
{ url: 'https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/9c5b77e7780de29e42faf2ed4d936ac0.jpg', title: '注册图片' }
],
currentNum: null
}
},
async created () {
await this.GetInfo()
this.StructureData()
},
methods: {
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)
},
async LikeShop () {
await this.$http.IndexService.LikeShop({
shopid: this.$route.query.id
});
this.$toast("收藏成功");
},
async addCar () {
let res = await this.$http.IndexService.addCar({
waresid: this.$route.query.id
})
this.$toast("添加成功");
},
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 GetInfo () {
this.InfoList = await this.$http.IndexService.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)
}
},
components: {
InfoHeaderComponents,
SwiperComponents
}
}
</script>
<style lang="less" scoped>
.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;
}
.Info {
.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,56 @@
<template>
<div class="List">
<van-nav-bar
:title="title"
left-arrow
@click-left="$router.back()"
/>
<ShopItemComponents :list="itemList"></ShopItemComponents>
</div>
</template>
<script>
import ShopItemComponents from "../components/ShopItem";
export default {
name: 'List',
data () {
return {
itemList: [],
title: ''
}
},
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.GetActivity()
},
methods: {
async GetActivity () {
this.itemList = await this.$http.IndexService.Activity({
id: this.$route.query.id
});
console.log(this.itemList)
}
},
components: {
ShopItemComponents
}
}
</script>
<style lang="less" scoped>
//@import "~@less/page/Home.less";
</style>

View File

@@ -0,0 +1,113 @@
<template>
<div class="me">
<div class="header">
<img alt="" class="setting" src="/img/me_settin_2.png">
<div class="user">
<img alt="" class="user_head" src="/img/user_head.png">
<p>编码猿Code</p>
</div>
</div>
<van-grid :border="false" :column-num="5" class="type" 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"/>
</van-grid-item>
</router-link>
</van-grid>
<div class="setting">
<van-cell :center="true" :clickable="true" title="收货地址" >
<img slot="icon" alt="" src="/img/me_address.png">
</van-cell>
<van-cell :center="true" :clickable="true" icon="location-o" title="我的收藏" is-link to="/coll">
<img slot="icon" alt="" src="/img/me_like.png">
</van-cell>
<van-cell :center="true" :clickable="true" icon="location-o" is-link title="我的设置" to="/setting">
<img slot="icon" alt="" src="/img/me_settin_2.png">
</van-cell>
</div>
</div>
</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: {},
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,91 @@
<template>
<div class="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)"
/>
</div>
<div v-else class="nodata">
没有订单
</div>
</van-tab>
</van-tabs>
</div>
</template>
<script>
// goods_id: 23
// goods_num: 3
// goods_price: "3000"
// goods_status: 1
// goods_totalprice: "9000"
// user_id: 16
// wares_activity: "1"
// wares_conf: "["华为麦芒 8 8GB+256GB 翡冷翠", "华为麦芒 8 6GB+128GB 幻夜黑"]"
// wares_id: 171
// wares_info: "Huawei/华为麦芒 8全面屏AI三摄超级夜景智能手机华为正品官方手机华为官方旗舰店"
// wares_infoimg: Array(3)
// wares_masterimg: Array(3)
// wares_nowprice: "3500"
// wares_oldprice: "3000"
// wares_stock: "2222"
// wares_title: "华为麦芒 8"
// wares_type: "华为"
export default {
name: 'OrderStatus',
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,303 @@
<template>
<div class="Pay">
<div v-if="HiddedWxPage" class="wxpay-page">
<div class="wxpay-page-dialog">
<div class="dialog-title">
<van-icon name="cross" size="15" @click="HiddedWxPage = false"/>
<span>请输入支付密码</span>
</div>
<div class="dialog-price">
<p class="price-title">付款给创想网络科技</p>
<p class="price-info">
<span class="info-1"></span>
<span class="info-2">{{ TotalMoney / 100 }}.00</span>
</p>
</div>
<div class="dialog-chooise">
<p>支付方式</p>
<div class="chooise-right">
<img alt="" src="img/wxPay/ye.png">
<span>零钱</span>
<van-icon name="arrow" size="15"/>
</div>
</div>
<van-password-input
:focused="showKeyboard"
:value="PayPassword"
@focus="showKeyboard = true"/>
</div>
<div class="wxpay-page-password">
<van-number-keyboard
:show="showKeyboard"
@blur="showKeyboard = false"
@delete="onDelete"
@input="onInput">
</van-number-keyboard>
</div>
</div>
<div v-else class="order-list">
<!--代付款订单列表-->
<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>
<van-cell-group title="支付方式">
<van-cell title="微信支付">
<template slot="icon">
<img alt="微信支付" src="img/pay_wx.png">
</template>
<template slot="right-icon">
<van-radio checked></van-radio>
</template>
</van-cell>
<van-cell title="支付宝支付">
<template slot="icon">
<img alt="支付宝支付" src="img/pay_zfb2.png">
</template>
<template slot="right-icon">
<van-radio disabled></van-radio>
</template>
</van-cell>
<van-cell title="花呗分期">
<template slot="icon">
<img alt="花呗分期" src="img/pay_antinstalment.png">
</template>
<template slot="right-icon">
<van-radio disabled></van-radio>
</template>
</van-cell>
<van-cell title="银联支付">
<template slot="icon">
<img alt="银联支付" src="img/pay_yl1.png">
</template>
<template slot="right-icon">
<van-radio disabled></van-radio>
</template>
</van-cell>
</van-cell-group>
<van-submit-bar :price="TotalMoney" button-text="支付" @submit="PayStatus()"/>
</div>
</div>
</template>
<script>
// import HelloWorld from '@com/HelloWorld.vue'
// goods_id: 23
// goods_num: 3
// goods_price: "3000"
// goods_status: 0
// goods_totalprice: "9000"
// user_id: 16
// wares_activity: "1"
// wares_conf: "["华为麦芒 8 8GB+256GB 翡冷翠", "华为麦芒 8 6GB+128GB 幻夜黑"]"
// wares_id: 171
// wares_info: "Huawei/华为麦芒 8全面屏AI三摄超级夜景智能手机华为正品官方手机华为官方旗舰店"
// wares_infoimg: (3) ["https://img.alicdn.com/imgextra/i2/2838892713/O1CN…b67nnjME_!!2838892713.jpg_760x760Q90s50.jpg_.webp", "https://img.alicdn.com/imgextra/i3/2838892713/O1CN…b66OhQzT_!!2838892713.jpg_760x760Q90s50.jpg_.webp", "https://img.alicdn.com/imgextra/i3/2838892713/O1CN…b66OiZgF_!!2838892713.jpg_760x760Q90s50.jpg_.webp"]
// wares_masterimg: (3) ["https://img.alicdn.com/imgextra/i3/2838892713/O1CN…pYZ16_!!0-item_pic.jpg_2200x2200Q100s50.jpg_.webp", "https://img.alicdn.com/imgextra/i3/2838892713/O1CN…WkhZ8_!!2838892713.jpg_2200x2200Q100s50.jpg_.webp", "https://img.alicdn.com/imgextra/i4/2838892713/O1CN…FSia0_!!2838892713.jpg_2200x2200Q100s50.jpg_.webp"]
// wares_nowprice: "3500"
// wares_oldprice: "3000"
// wares_stock: "2222"
// wares_title: "华为麦芒 8"
// wares_type: "华为"
export default {
name: 'Pay.vue',
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)
})
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,73 @@
<template>
<div class="Search">
<van-search
v-model="SearchKey"
fixed
placeholder="请输入搜索关键词"
show-action
@search="onSearch">
<template #action>
<div @click="onSearch">搜索</div>
</template>
</van-search>
<div v-if="SearchList.length != 0" class="content">
<ShopItemComponents :list="SearchList"></ShopItemComponents>
</div>
<div v-else class="content search">
请搜索
</div>
</div>
</template>
<script>
import ShopItemComponents from "../components/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: {
ShopItemComponents
}
}
</script>
<style lang="less" scoped>
.van-search {
position: fixed;
width: 100%;
z-index: 9;
top: 0;
left: 0;
}
.search {
text-align: center;
margin-top: 30px;
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,99 @@
<template>
<div class="type">
<van-nav-bar
title="分类"
@click-left="onClickLeft">
<template #right>
<van-icon name="search" @click="$router.push('/search')" size="18"/>
</template>
</van-nav-bar>
<van-tree-select
@click-nav="ChangeItem"
height="100vh"
:items="items"
:main-active-index.sync="active">
<template #content>
<van-row gutter="10">
<van-col
@click="EnterInfo(v.wares_id)"
v-for="(v,i) in items[active].content"
span="12"
style="text-align: center;margin-bottom: 20px">
<van-image width="100%" :src="v.wares_masterimg" />
<span class="type_text">{{v.wares_title}}</span>
</van-col>
</van-row>
</template>
</van-tree-select>
</div>
</template>
<script>
export default {
name: 'type',
data () {
return {
active: 0,
items: [
{
text: '小米',
content: []
},
{
text: '魅族',
content: []
},
{
text: '华为',
content: []
},
{
text: 'Iphone',
content: []
},
{
text: '三星',
content: []
},
{
text: '锤子',
content: []
}
]
}
},
async created () {
this.GetTypeList()
},
methods: {
EnterInfo (id) {
this.$router.push({
path: '/info',
query: {
id: id
}
});
},
ChangeItem (i) {
this.active = i;
if (this.items[this.active].content.length == 0) {
this.GetTypeList()
}
},
async GetTypeList () {
let res = await this.$http.IndexService.Type({
typename: this.items[this.active].text
});
this.items[this.active].content = res;
}
},
components: {}
}
</script>
<style lang="less" scoped>
.type_text {
margin-top: 10px;
}
</style>

View File

@@ -0,0 +1,40 @@
const path = require('path');
module.exports = {
publicPath: './',
devServer: {
inline: false
},
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('@less', resolve('src/assets/less'))
}
}
function resolve (dir) {
return path.join(__dirname, dir);
}

View File

@@ -0,0 +1,56 @@
jwt
RSA
让接口变得有状态
jons web token
后端渲染的网站
用户登录成功后后端会保存用户登录信息到后端的cookies里面
前后端分离后:
用户登录
后端返回前端 token SADFREGTRHYGEAWE23435467UUYEW3EFGVBTRN
{
token: "SADFREGTRHYGEAWE23435467UUYEW3EFGVBTRN"
}
将token保存到本地
后面的请求需要在axios中自动获取本地token发送给后端
1收货地址页面
2搜索页面
必写 3收藏页面
必写 4设置页面
5首页集成vuex解决数据多次请求的问题
【完成】4我的收藏
【完成】5我的设置
【完成】1购物车 的 SubmitCar
【完成】2删除商品 js filter 或者 重新调用接口!!
【完成】3订单页面
【完成】4支付成功的确认页面 【查看订单】 【回购物车】
【完成】2购物车
// 1先下单 返回一个订单号给你 XEWFGERGERTT56U6756454657745686543
// 2: 支付接口 XEWFGERGERTT56U6756454657745686543 返回给你 jsapi ...{} 支付参数
// 3: jssdk wx.({
...{}
success(status) {
if IO
}
});
// pc端支付 二维码地址
// 1 检查订单是否支付 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 KiB