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 @@
module.exports = {
BaseUrl: 'https://www.ixiumei.com/gallery/starphoto/'
}

View File

@@ -0,0 +1,27 @@
// const dddd = require("axios");
const dddd = require("request");
const fs = require("fs");
const cheerio = require('cheerio')
const config = require("./config")
dddd(config.BaseUrl, function(error, response, body) {
// 使用 cheerio 插件将获取到的html转为为虚拟dom
var $ = cheerio.load(body)
$(".mod-img-list li").each(function(i, e) {
if (i <= 7) {
var a = "http:" + $(e).find("img").attr("src")
wirteFile(a, $(this).find("p a").text())
} else {
var b = "http:" + $(e).find("img").attr("data-original")
wirteFile(b, $(this).find("p a").text())
}
})
});
/**
*
*/
function wirteFile(url, name) {
dddd(url).pipe(fs.createWriteStream(`img/${name}.jpg`))
}

View File

@@ -0,0 +1,5 @@
{
"name": "pc",
"version": "1.0.0",
"lockfileVersion": 1
}

View File

@@ -0,0 +1,17 @@
{
"name": "pc",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"pc": "node index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.21.0",
"cheerio": "^1.0.0-rc.3",
"request": "^2.88.2"
}
}

View File

@@ -0,0 +1,5 @@
1使用程序(xxxx)访问目标网页 xxxx
html 字符串转化 虚拟dom
2: 使用正则表达式 或 dom操作 从网页的html中提取你要的数据

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 @@
# vuecli3s
## 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,32 @@
{
"name": "vuecli3s",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"amfe-flexible": "^2.2.1",
"axios": "^0.21.0",
"core-js": "^3.6.5",
"node-rsa": "^1.1.1",
"vant": "^2.10.13",
"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-service": "~4.5.0",
"@vue/cli-shared-utils": "^4.5.8",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"postcss-pxtorem": "^5.1.1",
"pug": "^3.0.0",
"pug-html-loader": "^1.1.5",
"pug-plain-loader": "^1.0.0",
"vue-template-compiler": "^2.6.11"
}
}

View File

@@ -0,0 +1,12 @@
module.exports = {
plugins: {
'autoprefixer': {
browsers: ['Android >= 4.0', 'iOS >= 7']
},
'postcss-pxtorem': {
rootValue: 37.5,
//这是基准值在375px的屏幕变大rem的值会变大小于这个大小元素的rem值会变小
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: 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,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="stylesheet" href="//at.alicdn.com/t/font_2124975_fax348tpohd.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,32 @@
<template lang="pug">
#app
keep-alive
router-view(v-if="$route.meta.keepAlive" :key="$route.fullPath")
router-view(v-if="!$route.meta.keepAlive" :key="$route.fullPath")
</template>
<script>
export default {
data() {
return {
scroll: 0
}
},
mouted() {
},
activated() {
console.log("activated");
if (this.scroll > 0) {
window.scrollTo(0, this.scroll);
this.scroll = 0;
window.addEventListener("scroll", this.handleScroll);
}
},
methods: {
},
};
</script>
<style lang="less">
@import "~@mixins/normalize";
</style>

View File

@@ -0,0 +1,3 @@
@themeColor: #fb7299;
@themeTextColor: #999;
@while: #fff;

View File

@@ -0,0 +1,319 @@
.padding(@px) {
padding: @px;
}
.flex (@justifyContent:space-between, @alignItems:center) {
display: flex;
justify-content: @justifyContent;
align-items: @alignItems;
}
.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,463 @@
/*! 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.
*/
.my-swipe,
.van-swipe__track{
width: 100%;
}
.van-swipe-item img {
width: 100%;
}
.type .van-tree-select__nav,
.type .van-tree-select__content{
padding-bottom: 50px;
}
.van-overlay {
z-index: 999 !important;
}
.home .van-image img {
width: 36px;
height: 36px;
margin-bottom: 10px;
}
.van-grid-item__content span {
font-size: 12px;
}
.content {
margin-top: 45px;
margin-bottom: 50px;
}
img {
width: 100%;
}
.car {
.item {
padding-left: 10px;
display: flex;
background-color: #fafafa;
}
.van-card {
flex: 1;
}
.van-submit-bar {
bottom: 50px;
}
}
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,p,li,ul,h1,h2,h3,h4,h5,h6{
margin: 0;
padding: 0;
list-style: none;
}
/* 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,38 @@
@import "../colors/index";
@import "../mixins/index";
.home {
.search {
display: flex;
height: 45px;
position: fixed;
width: 100%;
left: 0;
top: 0;
z-index: 999;
background: @while;
align-items: center;
justify-content: space-between;
padding: 0 15px;
box-sizing: border-box;
.search_input {
display: flex;
align-items: center;
background: #f7f8fa;
flex: 1;
margin-left: 16px;
border-radius: 30px;
font-size: 12px;
height: 30px;
padding-left: 12px;
box-sizing: border-box;
span {
margin-left: 6px;
}
}
}
.adv {
width: 100%;
}
}

View File

@@ -0,0 +1,62 @@
@import "../colors/index";
@import "../mixins/index";
.info {
.header {
position: fixed;
width: 100%;
left: 0;
top: 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;
}
}
.InfoContent {
.padding(16px);
h2 {
font-size: 21px;
color: #3c3c3c;
margin-bottom: 10px;
}
p {
color: rgba(0, 0, 0, 0.54);
font-size: 13px;
line-height: 18px;
}
.price {
margin-top: 10px;
color: #ff6700;
font-size: 20px;
}
}
.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 {
margin-top: 20px;
padding-bottom: 55px;
img {
width: 100%;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,54 @@
<template lang="pug">
ul.listitem
router-link(v-for="(item,index) in list" :key="index" tag="li" :to="{ name: 'info', query: { id: item.wares_id } }")
img(
:src="Array.isArray(item.wares_masterimg) ? item.wares_masterimg[0] : item.wares_masterimg"
)
p.title {{ item.wares_title }}
p.price(v-if="item.hasOwnProperty('wares_nowprice')") {{item.wares_nowprice}}
</template>
<script>
export default {
props: {
list: {
type: Array,
default: ()=> []
},
},
data() {
return {};
},
created() {},
methods: {},
components: {},
};
</script>
<style lang="less">
.listitem {
display: flex;
flex-wrap: wrap;
li {
width: 50%;
text-align: center;
margin-bottom: 15px;
img {
width: 100%;
}
.title {
font-size: 15px;
font-weight: 600;
}
.des {
font-size: 13px;
color: rgba(0, 0, 0, 0.54);
}
.price {
color: #ea625b;
font-size: 15px;
}
}
}
</style>

View File

@@ -0,0 +1,31 @@
<template lang="pug">
.swiper
van-swipe.my-swipe(:autoplay='3000', indicator-color='white')
van-swipe-item(v-for="(item,index) in list" :key="index")
img(:src="item")
</template>
<script>
export default {
props: {
list: {
type: Array,
default: []
}
},
data() {
return {
active: 0
};
},
created() {},
methods: {},
components: {},
};
</script>
<style lang="less">
</style>

View File

@@ -0,0 +1,24 @@
<template lang="pug">
.tabbar
van-tabbar(v-model="active" route)
van-tabbar-item(icon="home-o" to="/") 首页
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 {
data() {
return {
active: 0
};
},
created() {},
methods: {},
components: {},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,37 @@
import Vant from 'vant';
import 'vant/lib/index.css';
import Service from '../service'
import utils from '../utils'
export default {
DevUrl: 'http://127.0.0.1:9090',
ProdUrl: 'http://103.91.219.114:3000/api/json',
ApiList: {
index: '/home/index', // 获取首页
TypeList: '/type/list', // 获取分类左侧列表
login: '/user/login', // 用户登录
add: '/user/add', // 用户注册
activity: '/home/activity', // 获取首页轮播下活动分类商品的接口
info: '/home/info', // 详情
addCar: '/car/addCar', // 添加购物车
like: '/user/like', // 添加用户收藏
getCarList: '/car/getCarList', // 购物车列表
deleteCar: '/car/deleteCar', // 删除购物车
updateCarNum: '/car/updateCarNum', // 更新购物车商品数量
submitCar: '/car/submitCar', // 提交购物车
buyOrder: '/order/buyOrder', // 更改订单状态
allOrder: '/order/allOrder', // 获取所有的未付款订单
},
VuePlugs: [Vant],
NotVuePlugs: [
{ n: '$http', v: Service },
{ n: '$utils', v: utils },
],
publickey: `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9eo8WIbWS5Yql06imlhrW0ZXh
faivPavdULvYLIxIKyUaOwMPFrPuHqqBNGnYOpiPHAKL+zxk2j4u+6jhB6VK1SOD
ccSLxIRxd0HmSDS+hBzYRf4vKc8BLlhMrYhnLmcxCc+PJIIa4DfCZnu8FfQlu/5L
ljjpYN9kHOpHAT+xpQIDAQAB
-----END PUBLIC KEY-----
`
}

View File

@@ -0,0 +1,75 @@
import axios from 'axios'
import utils from '../utils'
import rsa from '../utils/rsa'
import { Toast } from 'vant';
class HTTP {
constructor () {
this.request()
this.response()
}
async get (params) {
this.SetBaseUrl()
return await axios.get(params.url, {
params: params.data,
headers: params.header
})
}
async post (params) {
this.SetBaseUrl()
return await axios.post(params.url, {}, {
headers: Object.assign(params.header, {
data: rsa.PublicKeyEncryption(params.data),
token: localStorage.getItem("token")
})
})
}
/**
* 请求拦截器
*/
request () {
axios.interceptors.request.use(function (config) {
// 在发送请求之前做些什么
return config
}, function (error) {
// 对请求错误做些什么
return Promise.reject(error)
})
}
/**
* 添加响应拦截器
*/
response () {
axios.interceptors.response.use(function (response) {
// 对响应数据做点什么
switch (response.data.status) {
case 200:
return rsa.PublicKeyDecryption(response.data.result);
break;
case 500:
Toast.fail("请先登录");
return location.href="#/login"
break;
default:
Toast.fail(response.data.message);
throw new Error(response.data.message)
break
}
}, function (error) {
// 对响应错误做点什么
return Promise.reject(error)
})
}
SetBaseUrl () {
axios.defaults.baseURL = utils.checkUrl()
}
}
export default new HTTP()

View File

@@ -0,0 +1,20 @@
import 'amfe-flexible'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import config from './config'
import store from './store'
import Listitem from "./components/ListItem.vue";
Vue.component("Listitem", Listitem)
Vue.config.productionTip = false
config.NotVuePlugs.forEach(v => Vue.prototype[v.n] = v.v)
config.VuePlugs.forEach(v => Vue.use(v))
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

View File

@@ -0,0 +1,27 @@
export default {
data() {
return {
currentEl: null
}
},
methods: {
handleScroll(index) {
// localStorage.setItem("index", index)
this.currentEl = document.querySelectorAll(".van-tab__pane")[index];
if (this.currentEl != undefined) {
this.currentEl.addEventListener("scroll", () => {
// console.log("滚动距离:", this.currentEl.scrollTop);
localStorage.setItem(`${index}Y`, this.currentEl.scrollTop)
});
}
},
scrollTop(currentIndex) {
var Y = localStorage.getItem(`${currentIndex}Y`);
if (this.currentEl != undefined) {
this.currentEl.scrollTo(0, Y);
}
}
},
}

View File

@@ -0,0 +1,138 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)
const routes = [
{
path: '/',
component: () => import( /* webpackChunkName: "Layout" */ '@/views/Layout'),
children: [
{
path: '/',
name: 'home',
meta: {
keepAlive: true,
isLogin: false,
},
component: () => import( /* webpackChunkName: "home" */ '@/views/Home')
},
{
path: '/type',
name: 'type',
meta: {
keepAlive: true,
isLogin: false,
},
component: () => import( /* webpackChunkName: "type" */ '@/views/Type')
},
{
path: '/car',
name: 'car',
meta: {
keepAlive: true,
isLogin: true,
},
component: () => import( /* webpackChunkName: "car" */ '@/views/Car')
},
{
path: '/me',
name: 'me',
meta: {
keepAlive: true,
isLogin: true,
},
component: () => import( /* webpackChunkName: "me" */ '@/views/Me')
},
]
},
{
path: '/info',
name: 'info',
component: () => import(/* webpackChunkName: "me" */ '@/views/Info.vue')
},
{
path: '/pay',
name: 'pay',
component: () => import(/* webpackChunkName: "me" */ '@/views/Pay.vue')
},
{
path: '/search',
name: 'search',
component: () => import(/* webpackChunkName: "me" */ '@/views/Search.vue')
},
{
path: '/activity',
name: 'activity',
component: () => import(/* webpackChunkName: "me" */ '@/views/Activity.vue')
},
{
path: '/setting',
name: 'setting',
component: () => import(/* webpackChunkName: "me" */ '@/views/Setting.vue')
},
{
path: '/coll',
name: 'coll',
meta: {
keepAlive: true,
isLogin: true,
},
component: () => import(/* webpackChunkName: "me" */ '@/views/Collection.vue')
},
{
path: '/login',
name: 'login',
meta: {
keepAlive: true,
isLogin: false,
},
component: () => import( /* webpackChunkName: "login" */ '@/views/Login')
},
{
path: '/register',
name: 'register',
meta: {
keepAlive: true,
isLogin: false,
},
component: () => import( /* webpackChunkName: "register" */ '@/views/Register')
},
{
path: '/status',
name: 'status',
component: () => import(/* webpackChunkName: "me" */ '@/views/OrderStatus.vue')
},
]
const router = new VueRouter({
routes
})
router.beforeEach((to, from, next) => {
if (to.meta.isLogin) {
// 未登录
if (localStorage.getItem("token") == null) {
next({
path: '/login',
query: {
from: to.fullPath
}
})
} else {
next()
}
} else {
next()
}
})
export default router

View File

@@ -0,0 +1,128 @@
import http from '../http'
import config from '../config'
class IndexService {
async GetIndex(data = {}, header = {}) {
let res= await http.post({
url: config.ApiList.index,
data: data,
header: header
})
res.forEach(v=> v.wares_masterimg = JSON.parse(v.wares_masterimg))
return res;
}
async updateCarNum(data = {}, header = {}) {
return await http.post({
url: config.ApiList.updateCarNum,
data: data,
header: header
})
}
async buyOrder(data = {}, header = {}) {
return await http.post({
url: config.ApiList.buyOrder,
data: data,
header: header
})
}
async allOrder(data = {}, header = {}) {
let res = await http.post({
url: config.ApiList.allOrder,
data: data,
header: header
});
if (Object.keys(res).length != 0) {
res.forEach(v=> v.wares_masterimg = JSON.parse(v.wares_masterimg))
return res;
} else {
return []
}
}
async submitCar(data = {}, header = {}) {
return await http.post({
url: config.ApiList.submitCar,
data: data,
header: header
})
}
async getCarList(data = {}, header = {}) {
let res= await http.post({
url: config.ApiList.getCarList,
data: data,
header: header
})
console.log(res);
if (Object.keys(res).length != 0) {
res.forEach(v=> v.wares_masterimg = JSON.parse(v.wares_masterimg))
return res;
} else {
return []
}
}
async deleteCar(data = {}, header = {}) {
return await http.post({
url: config.ApiList.deleteCar,
data: data,
header: header
})
}
async like(data = {}, header = {}) {
return await http.post({
url: config.ApiList.like,
data: data,
header: header
})
}
async carList(data = {}, header = {}) {
let res = await http.post({
url: config.ApiList.carList,
data: data,
header: header
})
res.forEach(v=> v.wares_masterimg = JSON.parse(v.wares_masterimg))
return res;
}
async addCar(data = {}, header = {}) {
return await http.post({
url: config.ApiList.addCar,
data: data,
header: header
});
}
async activity(data = {}, header = {}) {
let res= await http.post({
url: config.ApiList.activity,
data: data,
header: header
})
res.forEach(v=> v.wares_masterimg = JSON.parse(v.wares_masterimg))
return res;
}
async info(data = {}, header = {}) {
let res= await http.post({
url: config.ApiList.info,
data: data,
header: header
})
res.wares_masterimg = JSON.parse(res.wares_masterimg)
res.wares_infoimg = JSON.parse(res.wares_infoimg)
res.wares_conf = JSON.parse(res.wares_conf)
return res;
}
}
export default new IndexService()

View File

@@ -0,0 +1,5 @@
class PublicService {
}
export default new PublicService()

View File

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

View File

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

View File

@@ -0,0 +1,11 @@
import IndexService from './IndexService';
import PublicService from './PublicService';
import TypeService from './TypeService';
import UserService from './UserService';
export default {
index: IndexService,
type: TypeService,
public: PublicService,
user: UserService,
}

View File

@@ -0,0 +1,33 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: { // 存数据类似vue的data
hello: 'tests是如是如是如是如是虽然收入',
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: '超值特卖' }
],
PayList: []
},
mutations: { //修改数据的类似vue的methods
SET_PAYLIST (state, data) {
state.PayList = data;
console.log(" state.PayList ==== : ", state.PayList);
}
},
getters: { // getters 读state里面的数据
GET_TuiJian(state) {
return state.TuiJian
},
GET_PAYLIST(state) {
return state.PayList;
}
},
actions: { // ac tions 触发 mutations
}
})

View File

@@ -0,0 +1,18 @@
import config from "../config"
class Utils {
checkUrl() {
if (process.env.NODE_ENV == "development") {
return config.DevUrl
} else {
return config.ProdUrl
}
}
checkPhone(phone) {
return /^1[3456789]\d{9}$/.test(phone)
}
}
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,48 @@
<template lang="pug">
.activity
van-nav-bar(:title="title", left-arrow="", @click-left="$router.back()")
Listitem(:list="ActivityList")
</template>
<script>
import {mapGetters, mapMutations} from "vuex"
export default {
data() {
return {
ActivityList: [],
title: "活动分类",
};
},
created() {
this.title = this.tj[this.$route.query.id-1].title
this.GetActivity();
// this.$store.state.hello = "342432424";
// console.log(this.$store.getters.GetHello);
// console.log(this.GetHello);
// this.$store.commit('Set_hello', "修改数据")
// this.Set_hello("修改数据")
// console.log(this.GetHello);
},
methods: {
...mapMutations([
'Set_hello'
]),
async GetActivity() {
this.ActivityList = await this.$http.index.activity({
id: this.$route.query.id,
});
},
onSearch() {},
},
computed: {
// 使用对象展开运算符将 getter 混入 computed 对象中
...mapGetters({
"tj": 'GET_TuiJian'
})
}
};
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,145 @@
<template lang="pug">
.car
van-nav-bar(
title="购物车",
:right-text="status ? '管理' : '完成'",
left-arrow="",
@click-left="$router.back()",
@click-right="status = !status"
)
.car_list(v-if="UserCarList.length != 0")
van-checkbox-group(
ref="checkboxGroup",
v-model="YouSelectItem",
@change="ItemChange"
)
.item(v-for="(v, index) in UserCarList", :key="index")
van-checkbox(:name="v.car_id")
van-card(
:price="v.wares_nowprice",
:desc="v.wares_info.substring(0, 20) + '...'",
:title="v.wares_title",
:thumb="v.wares_masterimg[0]"
)
template(#footer)
van-stepper(v-model="v.car_num" @change="changeNums(index)")
.nodata(v-else) 购物车没有商品
van-submit-bar(
:button-text="status ? '提交订单' : '删除'",
@submit="status ? SubmitCar() : DeleteCar()"
)
template(#default)
van-checkbox(v-model="checked", @click="SelectAll") 全选
span.totalprice {{ status ? `总计:¥${TotalMoney}` : '' }}
</template>
<script>
import { mapMutations } from 'vuex'
export default {
data() {
return {
status: true,
checked: false,
UserCarList: [],
YouSelectItem: []
};
},
activated() {
this.carList()
},
created() {
this.carList()
},
computed: {
TotalMoney () {
let price = 0;
this.UserCarList.forEach(v=> {
if (this.YouSelectItem.includes(v.car_id)) {
price += v.car_num * v.wares_nowprice
}
})
return price;
}
},
methods: {
...mapMutations([
'SET_PAYLIST'
]),
async changeNums(index) {
let res = this.$http.index.updateCarNum({
carid: this.UserCarList[index].car_id,
quantity: this.UserCarList[index].car_num
})
},
async DeleteCar() {
if (this.YouSelectItem.length != 0) {
let res = await this.$http.index.deleteCar({
carid: this.YouSelectItem
})
this.carList()
this.YouSelectItem = []
}
},
async carList() {
this.UserCarList = await this.$http.index.getCarList()
console.log(this.UserCarList);
},
// 列表被点选后
ItemChange() {
if (this.UserCarList.length == this.YouSelectItem.length) {
this.checked = true
} else {
this.checked = false
}
console.log("YouSelectItem: ", this.YouSelectItem);
},
// 全选
SelectAll() {
if (this.checked) {
this.$refs.checkboxGroup.toggleAll(true);
} else {
this.$refs.checkboxGroup.toggleAll();
}
},
async SubmitCar(){
var subList = {
carList: []
}, Pay = [];
this.UserCarList.forEach(v=> {
if (this.YouSelectItem.includes(v.car_id)) {
Pay.push(v)
subList.carList.push({
waresid: v.wares_id,
goodsnum: v.car_num,
goodsprice: v.wares_nowprice
})
}
});
this.SET_PAYLIST(Pay)
let res = await this.$http.index.submitCar(JSON.stringify(subList));
this.$router.push("/pay")
console.log(res);
},
},
components: {
},
}
</script>
<style scoped lang="less">
.totalprice {
width: 48%;
text-align: right;
padding-right: 10px;
}
.nodata {
font-size: 12px;
color: #8d8d8d;
text-align: center;
margin-top: 40px;
}
</style>

View File

@@ -0,0 +1,24 @@
<template lang="pug">
.Collection
van-nav-bar(title='收藏', left-arrow='', @click-left='$router.back()')
Listitem
</template>
<script>
export default {
data() {
return {
};
},
methods: {
onSearch () {
}
}
};
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,78 @@
<template lang="pug">
.home
.search
van-icon(name="user-o" size="17")
.search_input(@click="$router.push('/search')")
van-icon(name="search")
span 输入关键字
.content
Swiper(:list="img")
van-grid(:border='false', :column-num='4')
van-grid-item(v-for="(v,i) in tj" :key="i" class="tj_img" @click="Enterlist(v.id)")
van-image(:src="v.url")
span {{ v.title }}
van-row
van-col(span='12')
img(src="/img/left_1.jpg")
van-col(span='12')
van-row
van-col(span='24')
img(src="/img/left_2.jpg")
van-col(span='24')
img(src="/img/left_3.jpg")
img.adv(src="http://localhost:8081/img/mi10.jpg")
Listitem(:list="IndexList")
</template>
<script>
import Swiper from "@/components/Swiper.vue";
import {mapGetters, mapMutations} from "vuex"
export default {
name: "Home",
data() {
return {
IndexList: [],
img: [
"https://gw.alicdn.com/imgextra/i4/73/O1CN01Is1b3V1CPTYB80MEx_!!73-0-lubanu.jpg",
"https://gw.alicdn.com/imgextra/i4/73/O1CN01Is1b3V1CPTYB80MEx_!!73-0-lubanu.jpg",
"https://gw.alicdn.com/imgextra/i4/73/O1CN01Is1b3V1CPTYB80MEx_!!73-0-lubanu.jpg",
],
};
},
created() {
this.GetIndexData();
},
methods: {
Enterlist(id) {
this.$router.push({
path: '/activity',
query: {
id: id
}
})
},
async GetIndexData() {
let res = await this.$http.index.GetIndex();
this.IndexList = res
console.log(this.IndexList);
},
},
computed: {
// 使用对象展开运算符将 getter 混入 computed 对象中
...mapGetters({
"tj": 'GET_TuiJian'
})
},
components: {
Swiper
},
};
</script>
<style lang="less" scoped>
@import "~@views/Home";
</style>

View File

@@ -0,0 +1,76 @@
<template lang="pug">
.info
.header
i.van-icon.van-icon-arrow-left
i.van-icon.van-icon-shopping-cart-o(@click="$router.push('/car')")
Swiper(:list="InfoList.wares_masterimg")
.InfoContent
h2 {{ InfoList.wares_title }}
p {{ InfoList.wares_info }}
.price {{ InfoList.wares_nowprice }}
.norms()
p.status 已选
p.conf {{ InfoList.wares_conf && InfoList.wares_conf[0] }}
p.right
span x1
van-icon(name="arrow")
.info_img
img(v-for='i in InfoList.wares_infoimg', :src='i')
van-goods-action
van-goods-action-icon(icon='star-o', text='收藏', @click='like')
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='')
</template>
<script>
import Swiper from "@/components/Swiper.vue";
export default {
data() {
return {
wares_conf: [],
InfoList: [],
NewConfg: []
};
},
created() {
this.GetInfo()
},
methods: {
async GetInfo() {
this.InfoList = await this.$http.index.info({
id: this.$route.query.id
});
this.InfoList.wares_conf = JSON.parse(this.InfoList.wares_conf)
console.log(this.InfoList.wares_conf);
},
async like() {
let res = await this.$http.index.like({
shopid: this.$route.query.id
})
this.$toast.success("收藏成功")
console.log(res);
},
async addCar() {
let res = await this.$http.index.addCar({
waresid: this.$route.query.id
});
this.$toast.success("成功添加购物车")
}
},
components: {
Swiper,
},
};
</script>
<style scoped lang="less">
@import "~@views/Info";
</style>

View File

@@ -0,0 +1,21 @@
<template lang="pug">
.layout
router-view
TabBar
</template>
<script>
import TabBar from "@/components/Tabbar.vue"
export default {
name: "layout",
components: {
TabBar
},
};
</script>
<style scoped lang="less">
.content {
margin-top: 46px;
}
</style>

View File

@@ -0,0 +1,93 @@
<template lang="pug">
.login
.header
.item
van-form(@submit="onSubmit")
van-field(
v-model="username",
left-icon="phone-o",
name="name",
placeholder="请输入手机号",
:rules="[{ required: true, message: '请填写手机号' }]"
)
van-field(
v-model="password",
type="password",
left-icon="edit",
right-icon="closed-eye",
name="pwd",
placeholder="请输入密码",
:rules="[{ required: true, message: '请填写密码' }]"
)
div(style="margin: 16px;")
van-button(round="", block="", type="info", native-type="submit") 登录
.zhu
router-link(to="register") 注册
</template>
<script>
export default {
name: "Login",
data() {
return {
username: "",
password: "",
};
},
created() {
},
methods: {
async onSubmit(values) {
if ( this.$utils.checkPhone(values.name) ) {
let res = await this.$http.user.login(values)
console.log(res);
if (res.hasOwnProperty("token")) {
localStorage.setItem("token", res.token)
if (this.$route.query.hasOwnProperty("from")) {
this.$router.push(this.$route.query.from)
} else {
this.$router.push("/")
}
}
} else {
this.$toast.fail('手机号不正确');
}
console.log(values);
},
},
components: {},
};
</script>
<style lang="less" scoped>
.login {
width: 100%;
.header {
width: 100%;
height: 200px;
background: url(/img/me_back.png) no-repeat;
background-position: center center;
background-size: cover;
}
.item {
width: 80%;
margin: 0 auto;
margin-top: -80px;
background: #fff;
border-radius: 20px;
background: #fff;
box-shadow: 10px 10px 5px #efefef;
}
.van-button {
padding: 0 80px;
margin-top: 20px;
}
.zhu {
text-align: center;
font-size: 16px;
padding-top: 20px;
}
}
</style>

View File

@@ -0,0 +1,103 @@
<template lang="pug">
.me
.header
img.setting(alt='', src='/img/me_settin_2.png')
.user
img.user_head(alt='', src='/img/user_head.png')
p 编码猿Code
van-grid.type(:border='false', :column-num='5', clickable='')
router-link(v-for='(item,index) in orderList', :key='index', :to="{ name: 'status', query: { active: index } }")
van-grid-item(:text='item.title')
img(slot='icon', :src='item.img')
.setting
van-cell(:center='true', :clickable='true', title='收货地址')
img(slot='icon', alt='', src='/img/me_address.png')
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(:center='true', :clickable='true', icon='location-o', is-link='', title='我的设置', to='/setting')
img(slot='icon', alt='', src='/img/me_settin_2.png')
</template>
<script>
export default {
data() {
return {
orderList: [
{ title: '全部订单', img: '/img/me_1.png' },
{ title: '待付款', img: '/img/me_2.png' },
{ title: '待发货', img: '/img/me_3.png' },
{ title: '待收货', img: '/img/me_4.png' },
{ title: '退款/售后', img: '/img/me_5.png' }
]
};
},
created() {
},
methods: {
},
components: {
},
}
</script>
<style scoped lang="less">
.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,58 @@
<template lang="pug">
.orderstatus
van-tabs(v-model='active' @change="StatusChange")
van-tab(:title='v.title' v-for="(v,i) in OrderList" :key="i")
van-card(v-for="(v,i) in OrderList[active].content" :num='v.car_num', :price='v.wares_nowprice',
:desc="v.wares_info.substring(0, 20) + '...'",
:title='v.wares_title',
:key="i"
:thumb='v.wares_masterimg[0]')
template(#footer)
van-tag(type='danger' v-if="v.goods_status == 0") 待付款
van-tag(type='warning' v-if="v.goods_status == 1") 待发货
van-tag(type='success' v-if="v.goods_status == 2") 待收货
van-tag(type='primary' v-if="v.goods_status == 3") 退款/售后
</template>
<script>
export default {
data() {
return {
active: 0,
OrderList: [
{ title: "所有订单", id: -1, content: [] },
{ title: "待付款", id: 0, content: [] },
{ title: "待发货", id: 1, content: [] },
{ title: "待收货", id: 2, content: [] },
{ title: "退款/售后", id: 3, content: [] },
],
};
},
created() {
console.log(this.$route.query.active);
if (this.$route.query.active) {
this.active = Number(this.$route.query.active)
}
this.allOrder()
},
methods: {
StatusChange() {
console.log("dddddd");
if (this.OrderList[this.active].content.length == 0) {
this.allOrder()
}
},
async allOrder() {
let res = await this.$http.index.allOrder({
status: this.OrderList[this.active].id
});
this.OrderList[this.active].content = [...this.OrderList[this.active].content, ...res]
console.log("订单数据为:",this.OrderList)
},
PayStatus() {},
},
};
</script>
<style lang="less" scoped>
</style>>

View File

@@ -0,0 +1,245 @@
<template lang="pug">
.paly
van-overlay.wxpay-page(:show='ShowStatus')
.wxpay-page-dialog
.dialog-title
van-icon(name='cross', size='15', @click='ShowStatus = false')
span 请输入支付密码
.dialog-price
p.price-title 付款给创想网络科技
p.price-info
span.info-1
span.info-2 {{ TotalMoney / 100 }}.00
.dialog-chooise
p 支付方式
.chooise-right
img(alt='', src='img/wxPay/ye.png')
span 零钱
van-icon(name='arrow', size='15')
van-password-input(:focused="showKeyboard"
:value="PayPassword"
@focus="showKeyboard = true")
.wxpay-page-password
van-number-keyboard( :show="showKeyboard"
@blur="showKeyboard = false"
@delete="onDelete"
@input="onInput")
.order-list
van-card(v-for="(v,i) in OrderList" :num='v.car_num', :price='v.wares_nowprice',
:desc="v.wares_info.substring(0, 20) + '...'",
:title='v.wares_title',
:key="i"
:thumb='v.wares_masterimg[0]')
van-cell-group
van-cell(title="配送方式", value="顺丰配送货(免运费)")
van-cell(title="发票类型", value="电子发票")
van-cell(title="优惠券", value="无")
van-cell-group(title="支付方式")
van-cell(title="微信支付")
template(slot="icon")
img(alt="微信支付", src="img/pay_wx.png")
template(slot="right-icon")
van-radio(checked="")
van-cell(title="支付宝支付")
template(slot="icon")
img(alt="支付宝支付", src="img/pay_zfb2.png")
template(slot="right-icon")
van-radio(disabled="")
van-cell(title="花呗分期")
template(slot="icon")
img(alt="花呗分期", src="img/pay_antinstalment.png")
template(slot="right-icon")
van-radio(disabled="")
van-cell(title="银联支付")
template(slot="icon")
img(alt="银联支付", src="img/pay_yl1.png")
template(slot="right-icon")
van-radio(disabled="")
van-submit-bar(:price="TotalMoney", button-text="支付", @submit="PayStatus()")
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
OrderList: [],
ShowStatus: false,
showKeyboard: false,
PayPassword: ''
};
},
activated() {
this.allOrder()
},
created() {
this.allOrder()
},
computed: {
TotalMoney () {
let price = 0;
this.OrderList.forEach(v=> {
price += v.goods_num * v.goods_price
})
return price * 100;
},
...mapGetters([
'GET_PAYLIST'
])
},
methods: {
async allOrder() {
this.OrderList = await this.$http.index.allOrder({
status: 0
});
console.log("订单数据为:",this.OrderList)
},
async buyOrder() {
let a = []
this.OrderList.forEach(v => {
a.push(v.goods_id)
})
let res = await this.$http.index.buyOrder({
goodsid: JSON.stringify(a)
})
if (Object.keys(res).length == 0) {
this.$router.push("/status")
}
},
onInput(val) {
this.PayPassword += String(val)
if (this.PayPassword.length >= 6) {
console.log("用户输完密码了");
this.buyOrder()
} else {
console.log(val);
}
},
onDelete() {
this.PayPassword = this.PayPassword.slice(0, this.PayPassword.length - 1)
},
PayStatus() {
this.ShowStatus = true
}
},
};
</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,94 @@
<template lang="pug">
.register
.header
.item
van-form(@submit="onSubmit")
van-field(
v-model="username",
left-icon="user-o",
name="name",
placeholder="请输入用户名",
:rules="[{ required: true, message: '请填写用户名' }]"
)
van-field(
v-model="userphone",
left-icon="phone-o",
name="phone",
placeholder="请输入手机号",
:rules="[{ required: true, message: '请填写手机号' }]"
)
van-field(
v-model="password",
type="password",
left-icon="edit",
right-icon="closed-eye",
name="pwd",
placeholder="请输入密码",
:rules="[{ required: true, message: '请填写密码' }]"
)
div(style="margin: 16px;")
van-button(round="", block="", type="info", native-type="submit") 注册
</template>
<script>
export default {
name: "register",
data() {
return {
username: "test",
password: "123456",
userphone: "15155145354"
};
},
created() {},
methods: {
async onSubmit(values) {
if ( this.$utils.checkPhone(values.phone) ) {
let res = await this.$http.user.add(values)
this.$toast.success({
message: '恭喜,注册成功',
onClose: () => {
this.$router.push("/login")
}
});
} else {
this.$toast.fail('手机号不正确');
}
console.log("submit", values);
},
},
components: {},
};
</script>
<style lang="less" scoped>
.register {
width: 100%;
.header {
width: 100%;
height: 200px;
background: url(/img/me_back.png) no-repeat;
background-position: center center;
background-size: cover;
}
.item {
width: 80%;
margin: 0 auto;
margin-top: -80px;
background: #fff;
border-radius: 20px;
background: #fff;
box-shadow: 10px 10px 5px #efefef;
}
.van-button {
padding: 0 80px;
margin-top: 20px;
}
.zhu {
text-align: center;
font-size: 16px;
padding-top: 20px;
}
}
</style>

View File

@@ -0,0 +1,48 @@
<template lang="pug">
.search
van-search(
v-model="SearchKey",
fixed="",
placeholder="请输入搜索关键词",
show-action="",
@search="onSearch"
)
template(#action="")
div(@click="onSearch") 搜索
.content(v-if='SearchList.length != 0') 搜索列表
.content.search(v-else) 请搜索
</template>
<script>
export default {
data() {
return {
SearchKey: "",
SearchList: []
};
},
methods: {
onSearch () {
}
}
};
</script>
<style lang="less" scoped>
.van-search {
position: fixed;
width: 100%;
z-index: 9;
top: 0;
left: 0;
}
.search {
font-size: 14px;
text-align: center;
margin-top: 60px;
color: #6666;
}
</style>

View File

@@ -0,0 +1,126 @@
<template lang="pug">
.Setting
.logo-wrap
img.logo(alt="logo", src="/img/logo_s.png")
p 基友汇
span v2.1.1
.list
van-cell(
:center="true",
:clickable="true",
icon="phone-o",
is-link="",
title="联系我们",
@click="ContactUs()"
)
van-cell(
:center="true",
:clickable="true",
icon="friends-o",
is-link="",
title="关于我们",
@click="AboutUs()"
)
van-cell(
:center="true",
:clickable="true",
icon="upgrade",
is-link="",
title="检测升级",
@click="CheckUpdate()"
)
van-button.logout(
block="",
color="#f8d14b",
type="primary",
@click="UserLogOut"
) 退
</template>
<script>
export default {
name: 'Setting',
data () {
return {}
},
async created () {
},
methods: {
UserLogOut () {
this.$dialog.confirm({
title: '退出登录',
message: '确定退出登录吗?'
}).then(() => {
localStorage.clear();
this.$router.push("/")
}).catch(() => {
});
},
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,70 @@
<template lang="pug">
.type
van-tree-select(height='100vh', @click-nav="MenuClick",:items='items', :main-active-index.sync='active')
template(#content='')
div(v-for="(v,i) in items")
Listitem(v-if="i == active" :list="items[active].content")
</template>
<script>
import Listitem from "@/components/ListItem.vue";
export default {
data() {
return {
active: 0,
items: [
{
text: '小米',
content: []
},
{
text: '魅族',
content: []
},
{
text: '华为',
content: []
},
{
text: 'Iphone',
content: []
},
{
text: '三星',
content: []
},
{
text: '锤子',
content: []
}
],
};
},
created() {
this.getTypeList()
},
methods: {
MenuClick(index) {
if (this.items[this.active].content == 0) {
this.getTypeList()
}
},
async getTypeList() {
let res = await this.$http.type.TypeList({
typename: this.items[this.active].text
})
this.items[this.active].content = res
console.log(res);
}
},
components: {
Listitem
},
}
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,24 @@
const path = require('path');
module.exports = {
publicPath: './',
chainWebpack: config => {
// 路径别名
config.resolve.alias
.set('@', resolve('src'))
.set('@mixins',resolve('src/assets/less/mixins'))
.set('@views',resolve('src/assets/less/views'))
config.module.rule('pug')
.test(/\.pug$/)
.use('pug-html-loader')
.loader('pug-html-loader')
.end()
}
}
function resolve(dir) {
return path.join(__dirname, dir);
}

View File

@@ -0,0 +1,14 @@
RSA 非对称加密
各种类型的支付(微信支付,支付宝支付,银联支付)
https
公钥
私钥
vuex:
vue中存放全局数据的地方

View File

@@ -0,0 +1,9 @@
1: 每次初始化后请修改
路径node_modules/vant/es/tabs/index.js
行数377行
在代码this.slots('nav-right')]) 后面增加
,h("i",{ "class": "iconfont icon-edit","on": {"click": function click() { _this7.$emit("edit")}} })

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 @@
# vuecli3s
## 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

@@ -0,0 +1,30 @@
{
"name": "vuecli3s",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"amfe-flexible": "^2.2.1",
"axios": "^0.21.0",
"core-js": "^3.6.5",
"vant": "^2.10.13",
"vue": "^2.6.11",
"vue-router": "^3.2.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/cli-shared-utils": "^4.5.8",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"postcss-pxtorem": "^5.1.1",
"pug": "^3.0.0",
"pug-html-loader": "^1.1.5",
"pug-plain-loader": "^1.0.0",
"vue-template-compiler": "^2.6.11"
}
}

View File

@@ -0,0 +1,12 @@
module.exports = {
plugins: {
'autoprefixer': {
browsers: ['Android >= 4.0', 'iOS >= 7']
},
'postcss-pxtorem': {
rootValue: 37.5,
//这是基准值在375px的屏幕变大rem的值会变大小于这个大小元素的rem值会变小
propList: ['*']
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

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