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 @@
# vuecli3-tpl
## 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,34 @@
{
"name": "vuecli3-tpl",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"start": "npm run serve",
"build": "vue-cli-service build"
},
"dependencies": {
"amfe-flexible": "^2.2.1",
"axios": "^0.24.0",
"core-js": "^3.6.5",
"node-rsa": "^1.1.1",
"vant": "^2.12.37",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"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": "^3.0.2",
"pug-html-loader": "^1.1.5",
"pug-plain-loader": "^1.1.0",
"style-resources-loader": "^1.5.0",
"vue-template-compiler": "^2.6.11"
}
}

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 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: 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,20 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="stylesheet" href="http://at.alicdn.com/t/font_3036272_34p8458jm25.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,14 @@
<template>
<div id="app">
<keep-alive>
<router-view v-if="$route.meta.keepAlive"/>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"/>
</div>
</template>
<style lang="less">
</style>

View File

@@ -0,0 +1,4 @@
@import "./mixins/index";
@import "./mixins/normalize";
@import "./mixins/reset";
@import "./config/color";

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,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,422 @@
.content {
margin-top: 54px;
margin-bottom: 50px;
}
body,ul,li,h1,h2,h3,h4,h5,h6,p {
margin: 0;
padding: 0;
list-style: none;
}
a {
text-decoration: none;
}
img {
width: 100%;
}
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* 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 */
}

View File

@@ -0,0 +1,27 @@
.home {
.logo {
width: 0.66667rem;
height: 0.42667rem;
margin-right: 0.32rem;
}
.van-search {
position: fixed;
width: 100%;
left: 0;
right: 0;
top: 0;
z-index: 999;
}
.g_item {
/deep/ .van-image__img {
width: 0.85333rem;
}
span {
color: #646566;
font-size: 0.32rem;
line-height: 1.5;
word-break: break-all;
}
}
}

View File

@@ -0,0 +1,55 @@
.user_index {
padding-top: 30%;
padding-left: 20px;
padding-right: 20px;
text-align: center;
.user_img {
width: 100px;
height: 100px;
border-radius: 100%;
margin-bottom: 25px;
}
.login {
}
.reg {}
.input {
position: relative;
width: 100%;
margin-bottom: 15px;
input {
border: none;
border-bottom: 0.02667rem solid #e7e4e4;
font-size: 14px;
width: 100%;
padding-bottom: 14px;
padding-left: 33px;
box-sizing: border-box;
}
i {
position: absolute;
top: 50%;
transform: translateY(-76%);;
}
}
.submit {
width: 100%;
height: 1.2rem;
background: #9C54FE;
font-size: 18px;
color: #fff;
text-align: center;
line-height: 1.2rem;
letter-spacing: 8px;
border-radius: 8px;
margin-top: 28px;
}
.tips {
display: flex;
align-items: center;
justify-content: space-between;
color: #9c54fead;
margin-top: 15px;
font-size: 14px
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,59 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<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</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex" target="_blank" rel="noopener">vuex</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</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,63 @@
<template lang="pug">
van-row.shop
van-col.list_item(span='12' v-for="(item,index) in list" :key="index" @click="EnterInfo(item.wares_id)")
img(:src="item.wares_masterimg[0]")
h3 {{ item.wares_title }}
.desc {{ item.wares_info }}
.pice ¥{{ item.wares_oldprice }}
</template>
<script>
export default {
name: "ShopItem",
props: {
list: {
type: Array,
default: () => []
}
},
data() {
return {}
},
methods: {
EnterInfo(id) {
this.$router.push({
path: '/info',
query: {
id: id
}
})
}
}
}
</script>
<style scoped lang="less">
.shop {
margin-top: 20px;
.list_item {
text-align: center;
margin-bottom: 20px;
img {
width: 100%;
}
h3 {
font-size: 0.37333rem;
color: #000;
}
.desc {
color: rgba(0, 0, 0, 0.54);
font-size: 0.32rem;
margin-top: 0.08333rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.pice {
color: #ea625b;
font-size: 0.37333rem;
margin-top: 0.13333rem;
}
}
}
</style>

View File

@@ -0,0 +1,39 @@
<template lang="pug">
.Swiper
van-swipe( indicator-color='white' @change="SwiperChange" ref="vanSwipe")
van-swipe-item(v-for="(item,index) in list" :key="index")
slot(:item="item" :index="index")
template(#indicator)
slot(name="indicator" :index="index")
</template>
<script>
export default {
name: "Swiper",
props: {
list: {
type: Array,
default: () => []
}
},
data() {
return {
index: 0
}
},
methods: {
SwiperChange(index) {
this.index = index
},
swipeTo(index) {
this.$refs.vanSwipe.swipeTo(index)
}
}
}
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,38 @@
export default {
devUrl: 'http://127.0.0.1:9090',
testUrl: '',
prodUrl: '',
apiList: {
home: '/home/index',
login: '/user/login',
add: '/user/add',
info: '/home/info',
addCar: '/car/addCar',
getCarList: '/car/getCarList',
checkCar: '/car/checkCar',
deleteCar: '/car/deleteCar',
updateCarNum: '/car/updateCarNum',
submitCar: '/car/submitCar',
allOrder: '/order/allOrder',
buyOrder: '/order/buyOrder'
},
rsa_public_key: `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9eo8WIbWS5Yql06imlhrW0ZXh
faivPavdULvYLIxIKyUaOwMPFrPuHqqBNGnYOpiPHAKL+zxk2j4u+6jhB6VK1SOD
ccSLxIRxd0HmSDS+hBzYRf4vKc8BLlhMrYhnLmcxCc+PJIIa4DfCZnu8FfQlu/5L
ljjpYN9kHOpHAT+xpQIDAQAB
-----END PUBLIC KEY-----`,
checkUrl: function () {
switch (process.env.NODE_ENV) {
case 'development':
return this.devUrl;
break;
case 'test':
return this.testUrl;
break;
case 'production':
return this.prodUrl;
break;
}
}
}

View File

@@ -0,0 +1,17 @@
import $http from '@/service/_'
import $util from '@/util'
import Vant from 'vant';
import 'vant/lib/index.css';
import Swiper from '@/components/Swiper'
import ShopItem from '@/components/ShopItem'
export default {
VueComponents: [ Swiper, ShopItem ],
VuePlugIn: [ Vant ],
NotVuePlugIn: {
$http, $util
}
}

View File

@@ -0,0 +1,82 @@
import axios from 'axios'
import config from '@/config'
import Rsa from '../util/Rsa'
import { Toast, Dialog } from 'vant';
import rsa from "../util/Rsa";
var toast = null;
export default class Http {
constructor () {
this.instance = axios.create({
baseURL: config.checkUrl(),
timeout: 10000,
headers: {
'Content-Type': 'application/json'
}
})
this.interceptors()
}
async get (params) {
return await this.instance.get(params.url, {
params: {},
headers: Object.assign({
data: rsa.PublicKeyEncryption(params.data),
token: localStorage.getItem("token")
}, params.headers )
})
}
async post (params) {
return await this.instance.post(params.url, {}, {
headers: Object.assign({
data: rsa.PublicKeyEncryption(params.data),
token: localStorage.getItem("token")
}, params.headers )
})
}
interceptors () {
// 添加请求拦截器
this.instance.interceptors.request.use(function (config) {
toast = Toast.loading({
duration: 0,
message: '加载中...'
});
return config
}, function (error) {
// 对请求错误做些什么
return Promise.reject(error)
})
// 添加响应拦截器
this.instance.interceptors.response.use(async function (response) {
// 对响应数据做点什么
toast.clear();
switch (response.data.status) {
case 200:
return rsa.PublicKeyDecryption(response.data.result)
break;
case 501:
Toast.fail(response.data.message);
await Dialog.alert({
message: response.data.message,
});
location.href = "/#/user"
break;
case 500:
Toast.fail(response.data.message);
throw new Error(response.data.message)
break;
case 404:
Toast.fail(response.data.message);
throw new Error(response.data.message)
break;
}
}, function (error) {
// 对响应错误做点什么
return Promise.reject(error)
})
}
}

View File

@@ -0,0 +1,23 @@
import 'amfe-flexible'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import init from './config/init'
Vue.config.productionTip = false
// 注册全局组件
init.VueComponents.forEach(v => Vue.component(v.name, v))
// 初始化vue插件
init.VuePlugIn.forEach(v => Vue.use(v))
// 挂载非vue插件到vue实例中,这样可以全局调用方法
for (const key in init.NotVuePlugIn) Vue.prototype[key] = init.NotVuePlugIn[key]
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

View File

@@ -0,0 +1,116 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'layout',
redirect: '/home',
component: () => import(/* webpackChunkName: "layout" */ '../views/layout.vue'),
children: [
{
path: 'home',
name: 'home',
component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue'),
meta: {
isLogin: false,
keepAlive: true
}
},
{
path: 'type',
name: 'type',
component: () => import(/* webpackChunkName: "type" */ '../views/Type.vue'),
meta: {
isLogin: true,
keepAlive: false
}
},
{
path: 'car',
name: 'car',
component: () => import(/* webpackChunkName: "car" */ '../views/Car.vue'),
meta: {
isLogin: true,
keepAlive: false
}
},
{
path: 'me',
name: 'me',
component: () => import(/* webpackChunkName: "me" */ '../views/Me.vue'),
meta: {
isLogin: true,
keepAlive: false
}
},
]
},
{
path: '/info',
name: 'info',
component: () => import(/* webpackChunkName: "info" */ '../views/Info.vue'),
meta: {
isLogin: false,
keepAlive: false
}
},
{
path: '/payOrder',
name: 'payOrder',
component: () => import(/* webpackChunkName: "payOrder" */ '../views/order/payOrder.vue'),
meta: {
isLogin: true,
keepAlive: false
}
},
{
path: '/orderStatus',
name: 'orderStatus',
component: () => import(/* webpackChunkName: "orderStatus" */ '../views/order/orderStatus.vue'),
meta: {
isLogin: true,
keepAlive: false
}
},
{
path: '/user',
name: 'user',
component: () => import(/* webpackChunkName: "user" */ '../views/User/index.vue'),
meta: {
isLogin: false,
keepAlive: false
}
}
]
const router = new VueRouter({
routes
})
// 登录拦截
router.beforeEach((to, from, next) => {
// 表示未登录
if (localStorage.getItem("token") == null) {
// 需要登录才可以查看的页面
if (to.meta.isLogin) {
next({
path: "/user",
query: {
from: to.fullPath
}
})
// 不需要登录就可以查看的页面
} else {
next()
}
// 表示登录过了
} else {
next()
}
})
export default router

View File

@@ -0,0 +1,11 @@
import indexService from './indexService'
import carService from './carService'
import userService from './userService'
import orderService from './orderService'
export default {
index: new indexService(),
car: new carService(),
user: new userService(),
order: new orderService(),
}

View File

@@ -0,0 +1,59 @@
import http from "@/http"
import config from "@/config"
export default class carService {
async addCar(data = {}, header = {}) {
return await (new http()).post({
url: config.apiList.addCar,
data: data,
headers: header
})
}
async deleteCar(data = {}, header = {}) {
return await (new http()).post({
url: config.apiList.deleteCar,
data: data,
headers: header
})
}
async updateCarNum(data = {}, header = {}) {
return await (new http()).post({
url: config.apiList.updateCarNum,
data: data,
headers: header
})
}
async submitCar(data = {}, header = {}) {
return await (new http()).post({
url: config.apiList.submitCar,
data: data,
headers: header
})
}
async getCarList(data = {}, header = {}) {
let res = await (new http()).post({
url: config.apiList.getCarList,
data: data,
headers: header
});
res.forEach(v => {
v.wares_masterimg = JSON.parse(v.wares_masterimg)
v.isShowNum = true
})
return res;
}
async checkCar(data = {}, header = {}) {
return await (new http()).post({
url: config.apiList.checkCar,
data: data,
headers: header
})
}
}

View File

@@ -0,0 +1,32 @@
import http from "@/http"
import config from "@/config"
export default class IndexService {
async home(data = {}, header = {}) {
let res = await (new http()).post({
url: config.apiList.home,
data: data,
headers: header
});
res.forEach(v => {
v.wares_masterimg = JSON.parse(v.wares_masterimg)
});
return res;
}
async info(data = {}, header = {}) {
let res = await (new http()).post({
url: config.apiList.info,
data: data,
headers: header
});
res.wares_masterimg = JSON.parse(res.wares_masterimg)
res.wares_infoimg = JSON.parse(res.wares_infoimg)
return res;
}
}

View File

@@ -0,0 +1,32 @@
import http from "@/http"
import config from "@/config"
export default class orderService {
async allOrder(data = {}, header = {}) {
let res = await (new http()).post({
url: config.apiList.allOrder,
data: data,
headers: header
})
console.log("res ===== ", res)
if (Array.isArray(res)) {
res.forEach(v => {
v.wares_masterimg = JSON.parse(v.wares_masterimg)
})
} else {
res = []
}
return res;
}
async buyOrder(data = {}, header = {}) {
return await (new http()).post({
url: config.apiList.buyOrder,
data: data,
headers: header
})
}
}

View File

@@ -0,0 +1,22 @@
import http from "@/http"
import config from "@/config"
export default class UserService {
async login(data = {}, header = {}) {
return await (new http()).post({
url: config.apiList.login,
data: data,
headers: header
})
}
async add(data = {}, header = {}) {
return await (new http()).post({
url: config.apiList.add,
data: data,
headers: header
})
}
}

View File

@@ -0,0 +1,5 @@
export default {
carList: state => state.car.carList,
theme: state => state.setting.theme,
}

View File

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

View File

@@ -0,0 +1,24 @@
import carService from '../../service/carService'
export default {
state: {
carList: []
},
mutations: {
SET_CARLIST (state, data) {
state.carList = data
}
},
actions: {
async getCarList({ commit }) {
let res = await (new carService()).getCarList();
console.log("actions getCarList ===: ", res)
commit("SET_CARLIST", res)
},
async addCar({ commit }, params) {
let res = await (new carService()).addCar(params);
console.log("actions addCar ===: ", res)
}
}
}

View File

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

View File

@@ -0,0 +1,11 @@
export default {
state: {
theme: 'red'
},
mutations: {
},
actions: {
}
}

View File

@@ -0,0 +1,21 @@
import NodeRsa from "node-rsa";
import config from "../config";
class RSA {
constructor () {
this.public_key = config.rsa_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,12 @@
class Index {
checkPhone(phone) {
console.log(phone)
if((/^1[3456789]\d{9}$/.test(phone))){
return true
} else {
return false
}
}
}
export default new Index()

View File

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

View File

@@ -0,0 +1,145 @@
<template lang="pug">
.Car
van-nav-bar(title='购物车', fixed, :right-text=' status ? "管理" : "完成" ', @click-right='status = !status' ,left-arrow='', @click-left='')
.list
van-checkbox-group(v-model='selectItem', ref='checkboxGroup' @change="SelectChange")
div(v-for="(item,index) in carList" class="item" :key="index")
van-checkbox(:name='item.car_id')
van-card(:price='item.wares_oldprice',
:desc='item.wares_info',
:title='item.wares_title',
:thumb='item.wares_masterimg[0]')
template(#num v-if="item.isShowNum" )
span.van-stepper_text(@click="item.isShowNum = false") x{{ item.car_num }}
template(#num v-else )
van-stepper(@change="updateCarNum" v-model="item.car_num" :name="item.car_id")
van-submit-bar(:price='totalMoney', @submit='onSubmit' :class=" status ? '' : 'hidden_price' ")
van-checkbox(v-model='checked' @click="SelectAll") 全选
template(#button v-if="status")
van-button(round, type='danger' @click="submitCar") 提交订单
template(#button v-else)
van-button(round, type='danger' @click="deleteCar") 删除商品
</template>
<script>
import { mapGetters, mapMutations, mapActions } from 'vuex'
export default {
name: "Car",
data() {
return {
checked: false,
status: true, // true 管理 false 删除
isShowNum: true, // true 文字样式,false 步进器
selectItem: []
}
},
async created() {
await this.getCarList();
},
mounted() {
window.addEventListener('click', this.hiddenStepper)
},
methods: {
...mapActions([
'getCarList'
]),
hiddenStepper(e) {
if (!e.target.className.includes("van-stepper")) {
this.carList.forEach(v => v.isShowNum = true)
}
},
onSubmit() {},
SelectChange() {
console.log("selectItem: ",this.selectItem)
if (this.selectItem.length == this.carList.length) {
this.checked = true
} else {
this.checked = false
}
},
SelectAll() {
if (this.checked) {
this.$refs.checkboxGroup.toggleAll(true);
} else {
this.$refs.checkboxGroup.toggleAll();
}
console.log(this.checked)
},
async updateCarNum(quantity,detail) {
await this.$http.car.updateCarNum({
carid: detail.name,
quantity: quantity
})
},
async submitCar() {
var params = [];
this.selectItem.forEach(v => {
this.carList.forEach(j => {
if (v == j.car_id) {
params.push({
waresid: j.wares_id,
goodsnum: j.car_num,
goodsprice: j.wares_oldprice
})
}
})
});
await this.$http.car.submitCar({
carList: params
});
this.$router.push("/payOrder")
},
async deleteCar() {
await this.$http.car.deleteCar({
carid: this.selectItem
});
setTimeout(async () => await this.getCarList(), 300)
}
},
computed: {
totalMoney () {
var total = 0;
this.selectItem.forEach(v => {
this.carList.forEach(j => {
if (v == j.car_id) {
total += j.car_num * j.wares_oldprice
}
})
});
total = total * 100
return total
},
...mapGetters([
'carList'
])
},
}
</script>
<style scoped lang="less">
/deep/ .hidden_price .van-submit-bar__text {
opacity: 0 !important;
}
.list {
margin-top: 45px;
margin-bottom: 100px;
.item {
display: flex;
align-items: center;
padding-left: 15px;
}
.van-card{
background-color: #ffffff !important;
width: calc(100vw - 35px);
}
}
/deep/ .van-submit-bar {
bottom: 50px !important;
}
</style>

View File

@@ -0,0 +1,75 @@
<template lang="pug">
.home
van-search(show-action='', shape="round",placeholder='请输入搜索关键词', @focus='onfocus')
template(#action)
div() 搜索
template(#left)
img(class="logo" src="/img/logo.png")
.content
Swiper(:list="swiperList")
template(v-slot:default='{ item }')
img(:src="item.img")
van-grid(:border='false', :column-num='4')
van-grid-item.g_item(v-for="(item,index) in gridArr" :key="index")
van-image(:src='item.src')
span {{ item.text }}
van-row
van-col(span='12')
img(src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/32b5d24417b673008f386592c4d17046.jpg?thumb=1&w=358&h=508")
van-col(span='12')
van-row
van-col(span='24')
img(src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/1480d862e1f5a41e5adae8c030eef511.jpg?thumb=1&w=358&h=252")
van-col(span='24')
img(src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/1480d862e1f5a41e5adae8c030eef511.jpg?thumb=1&w=358&h=252")
van-row
van-col(span='24')
img(src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/3ca39ff880dfbcbc0e45314782c39fff.jpg?thumb=1&w=720&h=280")
ShopItem(:list="shopArr")
</template>
<script>
export default {
name: 'Home',
data () {
return {
shopArr: [],
swiperList: [
{ img: 'https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/bb4a8b7d9e77567c7330776a866e717f.jpg?thumb=1&w=720&h=360' },
{ img: 'https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/69d599cf6d4f0188312f4386b8bfd093.jpeg?thumb=1&w=720&h=360' },
{ img: 'https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/0b2bb13c396cc6205dd91da3a91a275a.jpg?thumb=1&w=720&h=360' },
],
gridArr: [
{ id: 1, text: '限时白嫖', src: '/img/type_1.png' },
{ id: 2, text: '新品推荐', src: '/img/type_2.png' },
{ id: 3, text: '低价高配', src: '/img/type_3.png' },
{ id: 4, text: '超值特卖', src: '/img/type_4.png' },
]
}
},
created() {
this.getIndex();
},
methods: {
async getIndex() {
this.shopArr = await this.$http.index.home();
console.log(this.shopArr)
},
onfocus() {
console.log("onfocus")
}
},
components: {
// HelloWorld
}
}
</script>
<style scoped lang="less">
@import "~@page/home.less";
</style>

View File

@@ -0,0 +1,229 @@
<template lang="pug">
.Info
.header_back(:style="{ backgroundColor: `rgba(255, 255, 255, ${opacity})` }")
van-icon.icon(:class=" isShow ? 'noback' : '' " name='arrow-left' size="14" )
van-icon.icon(:class=" isShow ? 'noback' : '' " name='shopping-cart-o' size="14")
van-tabs(v-model='active', scrollspy, sticky, ref="tabs"
:line-width=" width + 'px' ")
van-tab(v-if="Object.keys(infoArr).length != 0" )
template(#title v-if="isShow") 商品
Swiper(:list="infoArr.wares_masterimg" ref="wrapSwiper")
template(v-slot:default='{ item, index }')
img(:src="item" @click="showYlan(index)")
template(v-slot:indicator="{ index }")
.custom-indicator {{ index+1 }} / {{ infoArr.wares_masterimg.length }}
.wrap
.price
| ¥4000
del ¥6000
.title 华为Mate 30 Pro
.desc Huawei/华为Mate 30 Pro 5G麒麟990徕卡四摄5G芯片智能手机mate30pro5g官方旗舰店
van-tab()
template(#title v-if="isShow") 详情
.info_imf
img(v-for="(item,index) in infoArr.wares_infoimg" :key="index"
:src="item" @click="infoImagePreview(index)")
van-goods-action
van-goods-action-icon(icon='like-o', text='收藏')
van-goods-action-icon(icon='cart-o', text='购物车', to="/car" ,:badge='carList.length')
van-goods-action-button(type='warning', text='加入购物车',:class=" isAdd ? 'noclick' : '' ", @click=" isAdd ? '' : addUserCar()")
van-goods-action-button(type='danger', text='立即购买')
</template>
<script>
import { ImagePreview } from 'vant';
import { mapGetters, mapMutations, mapActions } from 'vuex'
export default {
name: "Info",
data() {
return {
opacity: 0,
width: 0,
active: 0,
isShow: false,
infoArr: {},
isAdd: false, // flase 表示没有添加购物车,true表示添加购物车了
}
},
computed: {
// 使用对象展开运算符将 getter 混入 computed 对象中
...mapGetters([
'carList',
'theme'
])
},
async created() {
this.checkCar()
await this.getCarList();
this.getInfo();
},
mounted() {
window.addEventListener("scroll", this.onScroll)
},
beforeDestroy() {
window.removeEventListener("scroll", this.onScroll)
},
methods: {
...mapActions([
'getCarList',
'addCar'
]),
async checkCar() {
let res = await this.$http.car.checkCar({
waresid: this.$route.query.id
});
this.isAdd = res.isAddCar;
console.log("this.isAdd: ", this.isAdd)
},
async addUserCar() {
await this.addCar({
waresid: this.$route.query.id
});
this.isAdd = true;
this.$toast('添加成功');
await this.getCarList();
},
infoImagePreview(index) {
ImagePreview({
images: this.infoArr.wares_infoimg,
startPosition: index
});
},
showYlan(index) {
ImagePreview({
images: this.infoArr.wares_masterimg,
startPosition: index,
onChange: (index) => {
this.$refs.wrapSwiper.swipeTo(index)
}
});
},
async getInfo() {
this.infoArr = await this.$http.index.info({
id: this.$route.query.id
});
// console.log(this.infoArr)
},
onScroll() {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
this.opacity = scrollTop / 375
if (this.opacity >= 0.5) {
this.isShow = true;
this.width = 15;
} else {
this.isShow = false;
this.width = 0;
}
this.$refs.tabs.resize();
}
}
}
</script>
<style scoped lang="less">
/deep/ .van-tabs {
margin-bottom: 50px;
}
/deep/ .van-tabs__wrap {
height: 1.17333rem;
width: 45%;
left: 50%;
position: relative;
transform: translateX(-50%);
z-index: 9;
}
/deep/ .van-sticky {
height: 0 !important;
}
/deep/ .van-tabs__nav {
background: #fff0;
}
.noclick {
background: linear-gradient(to right,#b4b4b4,#676665) !important;
}
.icon {
position: fixed;
top: 0.26667rem;
color: #fff;
border-radius: 100%;
display: inline-block;
text-align: center;
line-height: 0.74667rem;
background: rgba(0, 0, 0, 0.46);
width: 0.74667rem;
height: 0.74667rem;
z-index: 3;
}
.header_back {
width: 100%;
position: fixed;
height: 1.2rem;
top: 0;
left: 0;
z-index: 2;
}
.noback {
background: rgba(0, 0, 0, 0) !important;
color: #000 !important;
}
.van-icon-arrow-left {
left: 15px;
}
.van-icon-shopping-cart-o {
right: 15px;
}
.custom-indicator {
position: absolute;
right: 10px;
bottom: 10px;
padding: 2px 5px;
font-size: 12px;
background: rgba(0, 0, 0, 0.1);
}
/deep/ .van-goods-action {
padding-right: 6px;
.van-button__text {
font-size: 15px !important;
}
}
.Info {
.wrap {
padding: 0 0.4rem;
.price {
color: #ff6700;
font-size: 0.66667rem;
font-weight: 700;
margin-bottom: 0.4rem;
del {
color: rgba(0, 0, 0, 0.54);
font-size: 0.33333rem;
margin-left: 0.22213rem;
}
}
.title {
color: #000;
font-weight: 700;
font-size: 0.42667rem;
margin-bottom: 0.22213rem;
}
.desc {
margin-bottom: 0.16667rem;
color: #000;
font-size: 0.33333rem;
}
}
}
</style>

View File

@@ -0,0 +1,17 @@
<template lang="pug">
.Me Me
</template>
<script>
export default {
name: "Me",
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,17 @@
<template lang="pug">
.Type Type
</template>
<script>
export default {
name: "Type",
data() {
return {}
},
methods: {}
}
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,112 @@
<template lang="pug">
.user_index
img.user_img(src="https://upload.jianshu.io/users/upload_avatars/301940/189d69dd-af7c-4290-9e2c-89e98acf3603.jpg")
.login(v-if="status" )
.input
i(class="iconfont icon-zhanghu")
input.user_name(placeholder="用户名" type="text" v-model="loginParams.name" )
.input
i(class="iconfont icon-ziyuanxhdpi")
input.user_name(placeholder="密码" type="password" v-model="loginParams.pwd")
.reg(v-else)
.input
i(class="iconfont icon-zhanghu")
input.user_name(placeholder="手机号" type="number" v-model="regParams.phone")
.input
i(class="iconfont icon-ziyuanxhdpi")
input.user_name(placeholder="用户名" type="text" v-model="regParams.name")
.input
i(class="iconfont icon-ziyuanxhdpi")
input.user_name(placeholder="密码" type="password" v-model="regParams.pwd")
.input
i(class="iconfont icon-ziyuanxhdpi")
input.user_name(placeholder="确认密码" type="password" v-model="regParams.agPwd")
.submit(@click=" status ? Login() : Reg() ") {{ status ? '登录' : '注册' }}
.tips
span(@click="status = !status") {{ status ? '注册' : '登录' }}
span 忘记密码
</template>
<script>
export default {
name: "user",
data () {
return {
status: true, // true 登录 false 注册
loginParams: {
name: '',
pwd: ''
},
regParams: {
name: 'xxj',
pwd: '123456',
agPwd: '123456',
phone: '13666062265'
}
}
},
methods: {
async Login() {
if (this.loginParams.name.length == 0) {
this.$toast('用户名不能为空');
return;
}
if (this.loginParams.pwd.length == 0) {
this.$toast('密码不能为空');
return;
}
let res = await this.$http.user.login(this.loginParams);
localStorage.setItem("token", res.token)
this.$toast({
message: "恭喜,登录成功!",
onClose: () => {
this.$router.push("/")
}
});
},
async Reg() {
if (!this.$util.checkPhone(this.regParams.phone)) {
this.$toast('手机号格式错误');
return;
}
if (this.regParams.name.length == 0) {
this.$toast('用户名不能为空');
return;
}
if (this.regParams.pwd.length == 0 || this.regParams.agPwd.length == 0 || (
this.regParams.pwd != this.regParams.agPwd
) ) {
this.$toast('密码不能为空,且需要一致');
return;
}
delete this.regParams.agPwd;
let res = await this.$http.user.add(this.regParams);
// this.loginParams.name = this.regParams.name
// this.loginParams.pwd = this.regParams.pwd
this.$toast({
message: "恭喜,注册成功!",
onClose: () => {
this.status = true;
// this.Login()
}
});
console.log(res)
},
}
}
</script>
<style scoped lang="less">
@import "~@page/user.less";
</style>

View File

@@ -0,0 +1,26 @@
<template lang="pug">
.layout
router-view
van-tabbar(v-model='active' route)
van-tabbar-item(icon='home-o' to="/home") 首页
van-tabbar-item(icon='search' to="/type") 分类
van-tabbar-item(icon='friends-o' to="/car") 购物车
van-tabbar-item(icon='setting-o' to="/me") 我的
</template>
<script>
export default {
name: "layout",
data() {
return {
active: 0
}
},
methods: {}
}
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,62 @@
<template lang="pug">
.orderStatus
van-tabs(v-model='index' @change="tabChange")
van-tab(:title='item.text' v-for="(item,index) in tabs" :key="index")
div(v-if="item.content.length != 0")
van-card(:price='val.goods_price',
v-for="(val,i) in item.content"
:key="i"
:desc='val.wares_info',
:title='val.wares_title',
:num="val.goods_num"
:thumb='val.wares_masterimg[0]')
div.nodata(v-else) 暂无数据
</template>
<script>
export default {
name: "orderStatus",
data() {
return {
index: 0,
tabs: [
{ id: -1, text: '全部', page: 1, totalPage: 0, content: [] },
{ id: 0, text: '待付款', page: 1, totalPage: 0, content: [] },
{ id: 1, text: '待发货', page: 1, totalPage: 0, content: [] },
{ id: 2, text: '待收货', page: 1, totalPage: 0, content: [] },
{ id: 3, text: '退款/售后', page: 1, totalPage: 0, content: [] },
]
}
},
created() {
this.allOrder();
},
methods: {
tabChange() {
this.allOrder()
},
async allOrder() {
if (this.tabs[this.index].content.length == 0) {
let res = await this.$http.order.allOrder({
status: this.tabs[this.index].id
});
this.tabs[this.index].content = [
...this.tabs[this.index].content,
...res
]
}
}
}
}
</script>
<style scoped lang="less">
.nodata {
text-align: center;
margin: 20% auto;
font-size: 13px;
}
</style>

View File

@@ -0,0 +1,98 @@
<template lang="pug">
.payOrder
van-nav-bar(title='确认订单',left-arrow)
van-contact-card(type='edit', name='刘兵', tel='15155145354')
van-card(:price='item.goods_price',
v-for="(item,index) in orderList"
:desc='item.wares_info',
:title='item.wares_title',
:num="item.goods_num"
:thumb='item.wares_masterimg[0]')
van-row
van-col(span='24') 请选择支付方式
van-col(span='24')
van-radio-group(v-model='playType')
van-cell-group
van-cell()
template(#title)
img(src="/img/pay_zfb2.png" width="30px")
template(#right-icon='')
van-radio(name='1')
van-cell()
template(#title)
img(src="/img/pay_wx.png" width="30px")
template(#right-icon='')
van-radio(name='2')
van-submit-bar(:price='totalMoney', button-text='付款', @submit='onSubmit')
van-popup(v-model='showPay', position='bottom', :style="{ height: '60%' }")
span 支付
h3 {{ totalMoney / 100}}.00
van-button(type='primary' @click="buyOrder") 确认付款
</template>
<script>
import {mapGetters} from "vuex";
export default {
name: "payOrder",
data() {
return {
playType: '1',
showPay: false,
orderList: []
}
},
created() {
this.allOrder();
},
methods: {
onSubmit() {
this.showPay = true
},
async buyOrder() {
var params = [];
this.orderList.forEach(j => params.push(j.goods_id))
await this.$http.order.buyOrder({
goodsid: params
});
this.$toast({
message: "恭喜,支付成功!",
onClose: () => {
this.$router.push("/orderStatus")
}
});
},
async allOrder() {
this.orderList = await this.$http.order.allOrder({
status: 0
});
console.log(this.orderList)
}
},
computed: {
totalMoney () {
var total = 0;
this.orderList.forEach(j => {
total += j.goods_num * j.goods_price
})
total = total * 100
return total
}
},
}
</script>
<style scoped lang="less">
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

View File

@@ -0,0 +1,43 @@
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
publicPath: './',
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("@less", resolve("src/assets/less"))
.set("@page", resolve("src/assets/less/page"))
.set("@components", resolve("src/components"))
.set("@views", resolve("src/views"))
// 配置 less 的自动导入
const types = ['vue-modules', 'vue', 'normal-modules', 'normal']
types.forEach(type => addStyleResource(config.module.rule('less').oneOf(type)))
}
}
function addStyleResource (rule) {
rule.use('style-resource')
.loader('style-resources-loader')
.options({
patterns: [
path.resolve(__dirname, './src/assets/less/_.less'),
],
})
}

View File

@@ -0,0 +1,136 @@
1: http://127.0.0.1:3000/api/json/info?id=1&page=2&time=当前的时间&sign=
{
id: 1,
page: 1
}
id
page
time=1639991674000
1:对参数进行字母排序
2:转化为key=+value的格式,然后MD5加密,得到密文:53d669e4d1277826af95673bd8e2c6f7,把密文作为
sign字段的参数
id=1&page=2&time=1639991674000
MD5 加密
sign=53d669e4d1277826af95673bd8e2c6f7
RSA 非对称加密
公钥
私钥
Vuex 是vue的全局状态管理工具
就是存储全局变量(响应式)和方法的
state: 存储变量的
getter: 读取变量的,自动做缓存 和 computed 一样
mutations: 写(赋值)变量的,同步
actions: 提交 mutations,异步
明天讲购物车
和
实际项目的支付流程和差异
查在包河
实际项目中支付的接口调用流程:
1:下单 在数据库中创建一个未付款的订单
接口:/buyOrder
参数:
id: 商品id
type:支付类型 (0 微信支付 1 支付宝支付)
响应:订单编号
2:支付 拿步骤1的 订单编号 去唤起对应type的支付
接口:/pay
参数:
orderNum: 订单编号
响应:
支付宝H5
网址 支付官方网址
http://do.pay.com/alipay/ddded3dwdw?orderNum=213&dd=11w22
<form action="http://do.pay.com/alipay/ddded3dwdw?orderNum=213&dd=11w22" method="get">
<input type="submit"/>
</form>
订单状态查看页面的网址:http://geekhelp.cn/orderStatus?orderNum=
支付宝pc支付
微信PC
二维码的图片地址:https://www.baidu.com/img/xxxx.png
微信 JSAPI支付,小程序支付
jsapi支付参数
{
timeStamp 时间戳从1970年1月1日00:00:00至今的秒数,即当前的时间
nonceStr 随机字符串,长度为32个字符以下。
package 统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=*
signType 名类型,默认为MD5,支持HMAC-SHA256和MD5。注意此处需与统一下单的签名类型一致
paySign 签名,具体签名方案参见微信公众号支付帮助文档;
}
wx.requestPayment()
3:查询订单是否支付
接口:/checkOrder
参数:
orderNum: 订单编号
响应:
status: 0(未支付) 1(已支付)
支付宝 支付
移动端:
H5支付
小程序支付
pc支付
微信 支付
移动端:
JSAPI支付
小程序支付
注意:使用相应方法即可唤起支付,用户的支付状态在相应的回调中可以获得
pc支付
银联 支付
任务:
1:搜索
2:获取首页轮播下活动分类商品 需要单独写个页面
3:分类页面