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,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<ul></ul>
</body>
<script>
// 使用 XMLHttpRequest 对象的 open() 方法可以建立一个 HTTP 请求
var ajax = new XMLHttpRequest();
ajax.open("GET" , "http://127.0.0.1:3000/api/json/index")
//建立连接后,可以使用 send() 方法发送请求
ajax.send()
ajax.onreadystatechange = function(){
if(ajax.readyState == 4){
if(ajax.status == 200){
var result = JSON.parse(ajax.responseText)
console.log(result.data);
result.data.newest.list.forEach(function(v){
document.querySelector("ul").innerHTML +=
`
<li>
<img src="${v.preview}" alt="">
</li>
`
})
}else{
console.log("请求错误");
}
}
}
</script>
</html>

View File

@@ -0,0 +1,58 @@
(function () {
class Ajax {
constructor() {
this.ajax = new XMLHttpRequest();
}
get(option) {
var params = ""
for (var key in option.data) {
params += `&${key}=${option.data[key]}`
}
params = params.replace("&", "?")
option.url = option.url + params
this.ajax.open("GET", option.url)
this.ajax.send()
this.readystatechange(option.success, option.error && option.error)
}
post(option) {
this.ajax.open("POST", option.url)
this.ajax.setRequestHeader("Content-Type", "application/json")
this.ajax.send(JSON.stringify(option.data))
this.readystatechange(option.success, option.error && option.error)
}
readystatechange(success, error) {
this.ajax.onreadystatechange = () => {
if (this.ajax.readyState == 4) {
if (this.ajax.status == 200) {
var result = typeof this.ajax.responseText == "string" ?
JSON.parse(this.ajax.responseText) : this.ajax.responseText;
switch (result.status) {
case 200:
success(result.data)
break;
case 500:
error(result.msg)
break;
default:
}
} else {
error("请求出错")
}
}
}
}
}
window.$ajax = new Ajax()
})()

View File

@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<ul>
</ul>
</body>
<script src="ajax.js"></script>
<script>
$ajax.get({
url: 'http://127.0.0.1:3000/api/json/index',
data: {},
success: function (res) {
console.log(res);
res.newest.list.forEach(function (v) {
document.querySelector("ul").innerHTML +=
`
<li>
<a href="./info.html?id=${v.id}">
<img src="${v.preview}" alt="">
<p>${v.title}</p>
</a>
</li>
`
})
},
error: function (err) {
alert(err)
}
})
</script>
</html>

View File

@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>详情</title>
</head>
<body>
<h2 class="title"></h2>
<p class="source"></p>
<ul>
<li>
<img src="" alt="">
<p></p>
</li>
</ul>
<button>下一页</button>
</body>
<script src="ajax.js"></script>
<script>
var page = 1;
function getInfo() {
$ajax.get({
url: 'http://127.0.0.1:3000/api/json/info',
data: {
id: GetQueryString("id"),
page: page
},
success: function (res) {
document.querySelector(".title").innerText = res.title
document.querySelector(".source").innerText = res.source
res.list.forEach((v)=>{
document.querySelector("ul").innerHTML +=
`
<li>
<img src="${v.src}" alt="">
<p>${v.title}</p>
</li>
`
})
}
})
}
document.querySelector("button").onclick = function () {
page+=1;
getInfo()
}
getInfo()
function GetQueryString(name) {
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
</script>
</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 @@
# zaibaohe
## 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": "zaibaohe",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"amfe-flexible": "^2.2.1",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"node-rsa": "^1.1.1",
"vant": "^2.12.3",
"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.0",
"pug-html-loader": "^1.1.5",
"pug-plain-loader": "^1.1.0",
"style-resources-loader": "^1.4.1",
"vue-cli-plugin-style-resources-loader": "~0.1.4",
"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: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,18 @@
<!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>
<script src="//at.alicdn.com/t/font_2269051_hpoln7gmind.js"></script>
</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,28 @@
<template lang="pug">
#app
keep-alive
router-view(v-if="$route.meta.keepAlive")
router-view(v-if="!$route.meta.keepAlive")
van-tabbar(v-if="$route.meta.isShowTabbar" v-model='active' route)
van-tabbar-item(icon='home-o' to="/") 首页
van-tabbar-item(icon='apps-o' to="/type") 分类
van-tabbar-item(icon='shopping-cart-o' to="/car") 购物车
van-tabbar-item(icon='friends-o' to="/me") 我的
</template>
<script>
export default {
data () {
return {
active: 0
}
}
}
</script>
<style lang="less">
@import "~@common/_.less";
</style>

View File

@@ -0,0 +1,4 @@
@import "normalize.less";
@import "base.less";
@import "colors.less";
@import "mixins.less";

View File

@@ -0,0 +1,35 @@
@import "./normalize.less";
body,ul,li,p,h1,h2,h3,h4,h5,h6 {
margin: 0;
padding: 0;
list-style: none;
}
a {
text-decoration: none;
}
input {
outline: none;
}
.content {
margin-top: 45px;
}
img {
width: 100%;
}
.me {
.van-divider {
margin: 0 !important;
}
}
.icon {
width: 16px;
height: 16px;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}

View File

@@ -0,0 +1,2 @@
@themeColor: #ff6700;
@whileColor: #fff;

View File

@@ -0,0 +1,16 @@
.ellipsis() {
white-space:nowrap;
text-overflow:ellipsis;
overflow:hidden;
word-wrap: break-word;
}
.no-scrollbar() {
&::-webkit-scrollbar {
display: none !important;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
opacity: 0 !important;
}
}

View File

@@ -0,0 +1,419 @@
/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Change the default font family in all browsers (opinionated).
* 2. Prevent adjustments of font size after orientation changes in IE and iOS.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove the margin in all browsers (opinionated).
*/
body {
margin: 0;
}
/* 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,28 @@
@import "../common/_.less";
.home {
h2 {
color: @themeColor;
font-size: 37.5px;
}
.navbar {
display: flex;
height: 45px;
align-items: center;
justify-content: space-between;
padding: 0 15px;
box-sizing: border-box;
position: fixed;
left: 0;
top: 0;
width: 100%;
border-bottom: 1px solid #f7f8fa;
background: @whileColor;
.logo_text {
font-size: 14px;
}
.van-search {
padding: 0 0.32rem !important;
flex: 1;
}
}
}

View File

@@ -0,0 +1,31 @@
.info {
.header {
display: flex;
height: 40px;
align-items: center;
justify-content: space-between;
position: fixed;
left: 0;
top: 10px;
width: 100%;
z-index: 999;
padding: 0 15px;
box-sizing: border-box;
i {
width: 35px;
height: 35px;
border-radius: 100%;
text-align: center;
line-height: 35px;
background: #00000080;
color: #fff;
font-size: 14px;
}
}
.info_text {
padding: 0 15px;
p {
color: @themeColor;
}
}
}

View File

@@ -0,0 +1,68 @@
@import "../common/_.less";
.login {
padding: 0 0.48rem;
.user_header {
margin-bottom: 25px;
text-align: center;
margin-top: 20px;
.logo_header {
width: 80px;
height: 80px;
margin-bottom: 12px;
}
p {
font-size: 18px;
color: #000;
font-weight: 400;
}
}
.user_login {
margin: 20px auto;
position: relative;
}
.user_reg {
position: relative;
.showpwd {
right: 0 !important;
bottom: 3.7rem !important;
}
}
input {
border: none;
border-bottom: 0.02667rem solid #d3d3d3;
width: 100%;
margin-bottom: 13px;
font-size: 16px;
padding-bottom: 15px;
padding-right: 20px;
box-sizing: border-box;
}
.showpwd {
position: absolute;
right: 15px;
bottom: 27px;
}
.submit {
width: 100%;
height: 47px;
border-radius: 20px;
background: @themeColor;
text-align: center;
line-height: 47px;
color: #fff;
font-size: 18px;
}
.action {
margin-top: 10px;
display: flex;
align-items: center;
justify-content: space-between;
position: fixed;
bottom: 15px;
width: calc(100% - 36px);
span {
font-size: 13px;
color: #d3d3d3;
}
}
}

View File

@@ -0,0 +1,20 @@
.me {
.me_header {
display: flex;
height: 85px;
align-items: center;
padding: 0 15px;
box-sizing: border-box;
background: url("https://m.mi.com/static/img/bg.63c8e19851.png") center 0 #f37d0f;
background-size: auto 100%;
img {
width: 44px;
height: 44px;
margin-right: 10px;
}
span {
color: #fff;
font-size: 12px;
}
}
}

View File

@@ -0,0 +1,24 @@
.radio {
text-align: center;
.title {
margin-top: 1.347rem;
font-size: 0.48rem;
color: #000000;
margin-bottom: 0.84rem;
}
.banner {
width: 7.467rem;
height: 7.467rem;
margin-bottom: 0.667rem;
}
.progress {
display: block;
height: 1.2rem;
margin: 0 auto;
}
.play {
margin-top: 0.733rem;
width: 1.6rem;
height: 1.6rem;
}
}

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,80 @@
<template lang="pug">
.list_item
van-row(gutter="5" type="flex" justify="space-between")
router-link(tag="div" class="van-col van-col van-col--12" span="12",
v-for="(v,index) in data" :to="{ path: '/info', query: { id: v.wares_id } }"
:key="index")
img(
:src="v.wares_masterimg[0]"
)
.item_text
p.name {{ v.wares_title }}
p.info {{ v.wares_info }}
.price
.now_price ¥{{ v.wares_oldprice }}
span 起
del.old_price ¥{{ v.wares_nowprice }}
.buy 立即购买
</template>
<script>
export default {
props: {
data: {
type: Array,
default: () => []
}
}
};
</script>
<style lang="less" scoped>
@import "~@common/mixins.less";
.list_item {
.van-col {
text-align: center;
margin-bottom: 20px;
.item_text {
.name {
font-size: 16px;
color: rgba(0, 0, 0, 0.87);
}
.info {
font-size: 12px;
color: rgba(0, 0, 0, 0.54);
margin-top: 3px;
padding: 0 26px;
.ellipsis();
}
.price {
display: flex;
align-items: flex-end;
justify-content: center;
.now_price {
color: #ea625b;
font-size: 13px;
span {
font-size: 12px;
}
}
.old_price {
color: rgba(0, 0, 0, 0.54);
font-size: 12px;
}
}
}
.buy {
width: 104px;
background: #ea625b;
text-align: center;
height: 30px;
line-height: 30px;
color: #fff;
font-size: 12px;
margin: 0 auto;
margin-top: 8px;
}
}
}
</style>

View File

@@ -0,0 +1,66 @@
<template lang="pug">
.navbar
.left
img(src="/img/icon/gw_img_logo.png")
img(src="/img/icon/logo_text_icon.png")
.right 打开
</template>
<script>
export default {
data() {
return {
}
},
created() {
},
methods: {
},
components: {
}
}
</script>
<style lang="less" scoped>
.navbar {
width: 100%;
position: fixed;
height: 1.333rem;
background-color: #000000;
z-index: 999;
opacity: 0.7;
left: 0;
top: 0;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 0.32rem;
box-sizing: border-box;
.left {
display: flex;
align-items: center;
img {
&:first-child {
width: 0.867rem;
height: 0.867rem;
margin-right: 0.253rem;
}
&:last-child {
width: 1.76rem;
height: 0.613rem;
}
}
}
.right {
width: 1.92rem;
height: 0.693rem;
background-color: #d0302c;
border-radius: 0.107rem;
color: #ffff;
text-align: center;
line-height:0.693rem;
font-size: 0.32rem;
}
}
</style>

View File

@@ -0,0 +1,114 @@
<template lang="pug">
.vt_comment
//- 没有评论
.theme1_newscomment(v-if="theme == 'theme1'")
p.pp1 全部评论
img(src="/img/hm_bg_img_no.png")
p.pp2 快来发表你的评论吧
//-有评论
.theme2_newscomment(v-else)
p.ppp1 全部评论
.specific_content()
.sc_top
.sctop_left
img(:src="aalist.image")
.sctop_center
p.pp1 {{aalist.nick_name}}
p.pp2 {{create_time}}
.sctop_right
img(src="/img/icon/give_thumbs-up.png")
p {{aalist.praise_count}}
.sc_bottom
p {{aalist.content}}
</template>
<script>
export default {
props: {
theme: {
default:"theme1",
type:String
},
aalist:{
type:Array,
default:() =>[]
}
},
data() {
return {
id: [],
list:{},
};
},
created() {
// this.GetnewsDetail();
},
methods: {
},
components: {},
};
</script>
<style lang="less" scoped>
.vt_comment {
.theme2_newscomment {
.ppp1 {
font-size: 0.427rem;
color: #333333;
margin-top: 0.427rem;
margin-bottom: 0.493rem;
}
.specific_content {
.sc_top {
display: flex;
justify-content: space-between;
height: 1.4rem;
img {
}
.sctop_left {
display: flex;
img {
width: 0.933rem;
height: 0.933rem;
padding: 0;
margin: 0;
}
.pp1 {
font-size: 0.373rem;
color: #000000;
}
.pp2 {
font-size: 0.267rem;
color: #999999;
margin: 0;
text-align: inherit;
}
}
.sctop_right {
display: flex;
text-align: center;
margin-top: 0.507rem;
img {
width: 0.347rem;
height: 0.36rem;
margin: 0;
}
p {
font-size: 0.32rem;
color: #999999;
}
}
}
.sc_bottom {
margin-left: 1.507rem;
margin-right: 0.52rem;
p {
font-size: 0.373rem;
color: #000000;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,114 @@
<template lang="pug">
.recommend
.title 相关推荐
//- 竖排新闻列表
.theme1_content(v-if="theme == 'theme1'")
router-link.item(tag="div" v-for="v,i in list" :to="{ name: 'news', query: { id: v.id } }")
.item-left
p {{ v.title }}
span {{ v.size }}
img.item-right(:src="v.cover")
//- 视频列表
.theme2_content(v-else)
router-link.item(tag="div" v-for="v,i in list" :to="{ name: 'videoinfo', query: { id: v.id } }")
.item-top
img(:src="v.cover")
span {{ v.size }}
p.item-bottom {{ v.title }}
</template>
<script>
export default {
props: {
theme: {
default: "theme1",
type: String,
},
list: {
default: () => [],
type: Array,
}
},
data() {
return {};
},
created() {},
methods: {},
components: {},
};
</script>
<style lang="less" scoped>
.recommend {
.title {
height: 1.347rem;
background-color: #ffffff;
padding-left: 0.32rem;
line-height: 1.347rem;
font-size: 0.427rem;
color: #333333;
}
.theme1_content {
padding-left: 0.307rem;
padding-right: 0.32rem;
.item {
display: flex;
border-bottom: 1px solid #e5e5e5;
padding-bottom: 0.613rem;
padding-top: 0.427rem;
.item-left {
margin-right: 0.413rem;
p {
font-size: 0.427rem;
color: #333333;
margin-bottom: 0.333rem;
}
span {
font-size: 0.32rem;
color: #999999;
}
}
.item-right {
width: 3.013rem;
height: 2.267rem;
}
}
}
.theme2_content {
display: flex;
overflow-x: scroll;
padding-left: 0.307rem;
padding-right: 0.32rem;
.item {
width: 3.653rem;
flex-shrink: 0;
margin-right: 0.147rem;
.item-top {
width: 100%;
height: 2.08rem;
position: relative;
img {
width: 100%;
height: 100%;
}
span {
position: absolute;
right: 0.187rem;
bottom: 0.173rem;
width: 0.76rem;
font-size: 0.293rem;
color: #ffffff;
}
}
.item-bottom {
margin-top: 0.32rem;
font-size: 0.373rem;
color: #333333;
}
.active {
color: #d0302c;
}
}
}
}
</style>

View File

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

View File

@@ -0,0 +1,54 @@
<template lang="pug">
.tv-list
ul.list
router-link(tag="li" :to="{ name: 'TvInfo', query: { id: v.id, url: v.play_url } }" v-for="v,i in listData" :key="i")
span(:class="v.id == currentId ? 'active' : '' ") {{ v.title }}
img(v-if="v.id == currentId" src="/img/act-list.gif")
</template>
<script>
export default {
props: {
listData: {
type: Array,
default: () => [],
}
},
data() {
return {
currentId: this.$route.query.id
};
},
created() {
},
methods: {},
components: {},
};
</script>
<style lang="less" scoped>
.tv-list {
.list {
li {
height: 1.6rem;
background-color: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 0.56rem;
border-bottom: 1px solid #e5e5e5;
span {
font-size: 0.427rem;
color: #333333;
}
.active {
color: #d0302c;
}
img {
width: 0.36rem;
height: 0.4rem;
}
}
}
}
</style>

View File

@@ -0,0 +1,72 @@
<template lang="pug">
.video
videoPlayer(class="video-player-box"
ref="videoPlayer"
:options="playerOptions")
</template>
<script>
import "video.js/dist/video-js.css";
import { videoPlayer } from "vue-video-player";
import "videojs-contrib-hls";
export default {
props: {
videoUrl: {
type: Array,
default: ''
}
},
data() {
return {
playerOptions: {
playbackRates: [0.5, 1.0, 1.5, 2.0],
autoplay: false,
muted: false,
loop: false,
preload: 'none',
language: 'zh-CN',
aspectRatio: '16:9',
fluid: false,
sources: this.videoUrl,
poster: '',
notSupportedMessage: '此视频暂无法播放,请稍后再试',
controlBar: {
// 当前时间和总时间的 分隔符
timeDivider: true,
//当前播放时间
currentTimeDisplay: true,
// 总时间
durationDisplay: true,
/**
* 区分 currentTimeDisplay,timeDivider,durationDisplay
* remainingTimeDisplay显示默认样式,只显示当前播放时间,一般
* 为false
*/
remainingTimeDisplay: false,
fullscreenToggle: true
}
},
};
},
created() {
},
mounted() {
},
methods: {
play () {
this.$refs.videoPlayer.player.play()
},
stop() {
this.$refs.videoPlayer.player.pause()
}
},
components: {
videoPlayer,
},
};
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,129 @@
<template lang="pug">
.viedo-detail
.recommend-title 相关推荐
.recommend-video1( v-if=" theme == 't1' " )
.item(v-for="(v,i) in vlist ")
.re-top
img( :src=" v.cover ")
span
p.re-bottom {{ v.title }}
.recommend-video2( v-else )
.item(v-for="(v,i) in vlist ")
.re-left
p {{ v.title }}
span {{ v.create_time }}
img.re-right( :src=" v.icon " )
//- :src=" v.icon "
</template>
<script>
export default {
props:{
theme:{
type: String,
default: 't1'
},
vlist:{
type:Array,
default:() => []
}
},
data() {
return {
}
},
created() {
this.Getvideo()
},
methods: {
async Getvideo(){
// let res = await this.$api.video.videoDetail({
// id: this.$route.query.id
// })
// this.vlist = res.recommend;
console.log('vlist',this.vlist);
}
},
components: {
},
};
</script>
<style lang="less" scoped>
.viedo-detail{
padding-top: 0.48rem;
.recommend-title{
font-size: 0.427rem;
color: #333333;
margin-bottom: 0.147rem;
font-weight: bold;
}
.recommend-video1{
margin-top: 0.5rem;
display: flex;
align-content: center;
justify-content: space-between;
overflow-x: scroll;
.item{
margin-right: 0.133rem;
width: 3.653rem;
flex-shrink: 0;
.re-top{
width: 100%;
position: relative;
img{
width: 100%;
height: 2.08rem;
border-radius: 0.053rem;
}
span{
font-size: 0.293rem;
color: #ffffff;
position: absolute;
right: 0.187rem;
top: 1.667rem;
}
}
.re-bottom{
font-size: 0.373rem;
color: #333333;
}
}
}
.recommend-video2{
.item{
display: flex;
justify-content: space-between;
padding-bottom: 0.627rem;
border-bottom: 1px solid #e5e5e5;
padding-top: 0.427rem;
.re-left{
flex: 1;
p{
font-size: 0.427rem;
line-height: 0.667rem;
color: #333333;
}
span{
font-size: 0.32rem;
line-height: 0.747rem;
color: #999999;
}
}
.re-right{
width: 3.013rem;
height: 2.267rem;
border-radius: 0.053rem;
}
}
}
}
</style>

View File

@@ -0,0 +1,33 @@
import Vant from 'vant'
import 'vant/lib/index.css'
import service from '../service/_'
export default {
DevUrl: 'http://127.0.0.1:9090',
ProdUrl: 'http://127.0.0.1:9090',
check: function () {
if (process.env.NODE_ENV == "development") {
return this.DevUrl
} else {
return this.ProdUrl
}
},
ApiUrl: {
index: '/home/index',
add: '/user/add',
login: '/user/login',
activity: '/home/activity',
info: '/home/info'
},
VuePlug: [ Vant ],
CustomPlug: [
{ n: '$api', v: service }
],
RsaPublicKey: `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9eo8WIbWS5Yql06imlhrW0ZXh
faivPavdULvYLIxIKyUaOwMPFrPuHqqBNGnYOpiPHAKL+zxk2j4u+6jhB6VK1SOD
ccSLxIRxd0HmSDS+hBzYRf4vKc8BLlhMrYhnLmcxCc+PJIIa4DfCZnu8FfQlu/5L
ljjpYN9kHOpHAT+xpQIDAQAB
-----END PUBLIC KEY-----`
}

View File

@@ -0,0 +1,99 @@
import axios from 'axios'
import config from '@config'
import rsa from '@utils/rsa';
import { Dialog } from 'vant';
class Http {
static instance;
static getInstance() {
if (this.instance instanceof this) {
return this.instance;
} else {
this.instance = new this;
return this.instance;
}
}
constructor() {
this.SetBaseUrl();
this.interceptors();
this.rsa = new rsa();
}
async get(url, params = {}, header = {}) {
return await axios.get(url, {
params: params,
headers: header
})
}
async post(url, params, header = {}) {
return await axios.post(url, params, {
headers: Object.assign(
header,
{
data: this.rsa.PublicKeyEncryption(params),
token: localStorage.getItem("token")
}
),
})
}
interceptors() {
// 添加请求拦截器
axios.interceptors.request.use(function (config) {
return config;
}, function (error) {
// 对请求错误做些什么
return Promise.reject(error);
});
// 添加响应拦截器
axios.interceptors.response.use(async (response) => {
// 对响应数据做点什么
switch (response.data.status) {
case 200:
response.data.result = this.rsa.PublicKeyDecryption(response.data.result);
return response.data.result;
break;
case 500:
await Dialog.alert({
title: '提示',
message: response.data.message,
});
throw new Error(response.data.message);
break;
case 404:
await Dialog.alert({
title: '提示',
message: response.data.message,
});
throw new Error(response.data.message);
break;
// token 失效
case 501:
let a = await Dialog.alert({
title: '提示',
message: response.data.message,
});
if (a == "confirm") {
location.href = "#/about"
}
break;
};
}, function (error) {
// 对响应错误做点什么
return Promise.reject(error);
});
}
SetBaseUrl() {
if (axios.defaults.baseURL == null) {
axios.defaults.baseURL = config.check();
}
}
}
export default Http

View File

@@ -0,0 +1,18 @@
import 'amfe-flexible'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import config from './config';
// 配置vue插件
config.VuePlug.forEach((v)=> Vue.use(v));
config.CustomPlug.forEach((v) => Vue.prototype[v.n] = v.v);
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')

View File

@@ -0,0 +1,105 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
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)
}
const routes = [
{
path: '/',
name: 'Home',
component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue'),
meta: {
keepAlive: true,
isLogin: false,
isShowTabbar: true
}
},
{
path: '/type',
name: 'type',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/Type.vue'),
meta: {
keepAlive: true,
isLogin: false,
isShowTabbar: true
}
},
{
path: '/car',
name: 'car',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/Car.vue'),
meta: {
keepAlive: true,
isLogin: true,
isShowTabbar: true
}
},
{
path: '/me',
name: 'me',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/Me.vue'),
meta: {
keepAlive: false,
isLogin: true,
isShowTabbar: true
}
},
{
path: '/info',
name: 'info',
component: () => import(/* webpackChunkName: "home" */ '../views/Info.vue'),
meta: {
keepAlive: false,
isLogin: false,
isShowTabbar: false
}
},
{
path: '/login',
name: 'login',
component: () => import(/* webpackChunkName: "home" */ '../views/Login.vue'),
meta: {
keepAlive: false,
isLogin: false,
isShowTabbar: false
}
}
]
const router = new VueRouter({
routes
});
router.beforeEach((to, from, next) => {
if (to.meta.isLogin) {
if (localStorage.getItem("token") !== null) {
next()
} else {
next({
path: '/login',
query: {
from: to.fullPath
}
})
}
} else {
next();
}
})
export default router

View File

@@ -0,0 +1,16 @@
export class BaseService {
handle (data) {
if (Array.isArray(data)) {
data.forEach(v => {
v.wares_masterimg = JSON.parse(v.wares_masterimg);
v.wares_infoimg = JSON.parse(v.wares_infoimg)
});
} else {
data.wares_masterimg = JSON.parse(data.wares_masterimg);
data.wares_infoimg = JSON.parse(data.wares_infoimg);
}
return data;
}
}

View File

@@ -0,0 +1,23 @@
import http from '@http'
import config from '@config'
import { BaseService } from './BaseService';
class HomeService extends BaseService {
async index(params = {}) {
return this.handle(await http.getInstance().post(
config.ApiUrl.index,
params
))
}
async info(params = {}) {
return this.handle(
await http.getInstance().post(
config.ApiUrl.info,
params
)
)
}
}
export default new HomeService()

View File

@@ -0,0 +1,20 @@
import http from '@http'
import config from '@config'
class UserService {
async add (params = {} ) {
return await http.getInstance().post(
config.ApiUrl.add,
params
)
}
async login (params = {} ) {
return await http.getInstance().post(
config.ApiUrl.login,
params
)
}
}
export default new UserService()

View File

@@ -0,0 +1,7 @@
import HomeService from './HomeService';
import UserService from './UserService';
export default {
home: HomeService,
user: UserService,
}

View File

@@ -0,0 +1,15 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
},
mutations: {
},
actions: {
},
modules: {
}
})

View File

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

View File

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

View File

@@ -0,0 +1,30 @@
<template lang="pug">
.car
van-nav-bar(title='购物车', left-arrow)
template(#right) 管理
.car_list
van-card(price='2.00', desc='描述信息', title='商品标题', thumb='https://img.yzcdn.cn/vant/ipad.jpeg')
template(#num)
van-stepper()
van-submit-bar(:price='3050', button-text='提交订单')
van-checkbox() 全选
</template>
<script>
export default {
}
</script>
<style lang="less" scoped>
.car {
.van-submit-bar {
bottom: 50px !important;
}
.van-card {
background: #fff !important;
}
}
</style>

View File

@@ -0,0 +1,58 @@
<template lang="pug">
.content
.home
.navbar
span.logo_text 基友汇
van-search(v-model='SearchKey', placeholder='请输入搜索关键词', shape="round")
van-icon(name='friends-o' size="18")
Swiper(:data="list")
van-grid(:border="false")
van-grid-item(icon='photo-o', text='文字')
van-grid-item(icon='photo-o', text='文字')
van-grid-item(icon='photo-o', text='文字')
van-grid-item(icon='photo-o', text='文字')
van-grid-item(icon='photo-o', text='文字')
van-grid-item(icon='photo-o', text='文字')
van-grid-item(icon='photo-o', text='文字')
van-grid-item(icon='photo-o', text='文字')
.adv
img(src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/189acdf7e9b807cfc22d394df87c1958.jpg")
ListItem(:data="shopList")
h2 首页
</template>
<script>
import Swiper from '@com/Swiper'
import ListItem from '@com/ListItem'
export default {
data () {
return {
SearchKey: '',
list: [
{ img: "https://img.alicdn.com/imgextra/i3/2206686532409/O1CN018T9okz1TfMm3JfbEs_!!2206686532409-0-lubanimage.jpg" },
{ img: "https://img.alicdn.com/imgextra/i2/2206686532409/O1CN01gBWPro1TfMm22Ey2o_!!2206686532409-0-lubanimage.jpg" },
{ img: "https://img.alicdn.com/imgextra/i1/2206686532409/O1CN01UyWpYH1TfMmGVKxjC_!!2206686532409-0-lubanimage.jpg" },
],
shopList: []
}
},
created() {
this.GetIndexData();
},
methods: {
async GetIndexData () {
this.shopList = await this.$api.home.index()
console.log(this.shopList)
}
},
components: {
Swiper,
ListItem
}
}
</script>
<style scoped lang="less">
@import "~@views/Home.less";
</style>

View File

@@ -0,0 +1,71 @@
<template lang="pug">
.info
.header
van-icon(name="arrow-left")
van-icon(name="shopping-cart-o")
Swiper(:data="list")
.info_text
p
| ¥899
span ¥999
.title Redmi Note 8
.mess 「4GB+64GB到手价899元,享特惠真无线蓝牙耳机Air2 SE、支架式自拍杆加价购」
.config
span 已选
span Redmi Note 8 4GB+64GB 曜石黑
van-icon(name="arrow")
ul.remarks
li
img(src="/img/bz.png")
span 小米自营
li
img(src="/img/bz.png")
span 小米发货
li
img(src="/img/bz.png")
span 7天无理由退货
.figures
img(src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/c6957583e0c7ae8e284579984068daf3.jpg?w=1080&h=1753&bg=FFFFFF")
van-goods-action
van-goods-action-icon(icon='chat-o', text='客服', dot='')
van-goods-action-icon(icon='cart-o', text='购物车', badge='5')
van-goods-action-icon(icon='shop-o', text='店铺', badge='12')
van-goods-action-button(type='warning', text='加入购物车')
van-goods-action-button(type='danger', text='立即购买')
</template>
<script>
import Swiper from '@com/Swiper'
export default {
data () {
return {
id: this.$route.query.id,
list: [
{ img: "https://img.alicdn.com/imgextra/i3/2206686532409/O1CN018T9okz1TfMm3JfbEs_!!2206686532409-0-lubanimage.jpg" },
{ img: "https://img.alicdn.com/imgextra/i2/2206686532409/O1CN01gBWPro1TfMm22Ey2o_!!2206686532409-0-lubanimage.jpg" },
{ img: "https://img.alicdn.com/imgextra/i1/2206686532409/O1CN01UyWpYH1TfMmGVKxjC_!!2206686532409-0-lubanimage.jpg" },
],
}
},
created() {
// this.GetInfoData();
},
methods: {
async GetInfoData() {
let res = await this.$api.home.info({
id: this.id
})
console.log("GetInfoData: ", res);
}
},
components: {
Swiper
}
}
</script>
<style scoped lang="less">
@import "~@views/Info.less";
</style>

View File

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

View File

@@ -0,0 +1,95 @@
<template lang="pug">
.login
.user_header
svg.icon.logo_header(aria-hidden='true')
use(xlink:href='#icon-shouji')
p 基友汇{{ status ? '登 录' : '注 册' }}
.user_login(v-if="status")
input(v-model="loginParams.name", type="text", placeholder="请输入用户名")
input(v-model="loginParams.pwd", :type="isShowPassword ? 'password': 'text' ", placeholder="请输入密码")
svg.icon.showpwd(aria-hidden='true' @click="isShowPassword = !isShowPassword")
use(v-bind:xlink:href="isShowPassword ? '#icon-eye1':'#icon-eye'")
.user_reg(v-else)
input(type="text", v-model="add.name", placeholder="请输入用户名")
input(v-model="add.pwd", :type="isShowPassword ? 'password': 'text' ", placeholder="请输入密码")
input(v-model="add.againPwd", :type="isShowPassword ? 'password': 'text' ", placeholder="请输入确认密码")
input(v-model="add.phone", type="number", placeholder="请输入手机号")
svg.icon.showpwd(aria-hidden='true' @click="isShowPassword = !isShowPassword")
use(v-bind:xlink:href="isShowPassword ? '#icon-eye1':'#icon-eye'")
.submit(@click="status ? login() : reg() ") {{ status ? '登 录' : '注 册' }}
.action
span 首页
span(@click="status = !status") {{ status ? '注 册' : '登 录' }}
</template>
<script>
export default {
data() {
return {
status: true,
// true 闭眼,false 睁眼
isShowPassword: true,
loginParams: {
name: '',
pwd: ''
},
add: {
name: '',
pwd: '',
againPwd: '',
phone: ''
}
}
},
methods: {
async login() {
let res = await this.$api.user.login(this.loginParams);
localStorage.setItem("token", res.token);
if (this.$route.query.hasOwnProperty("from")) {
this.$router.push(this.$route.query.from)
} else {
this.$router.push("/")
}
},
async reg() {
var phoneRole = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
var nameRole = /^[a-zA-Z0-9]{4,16}$/;
if (!nameRole.test(this.add.name)) {
this.$toast("用户名4~16字母和数字组合");
return;
}
if (!nameRole.test(this.add.pwd)) {
this.$toast("密码4~16字母和数字组合");
return;
}
if (! (this.add.pwd == this.add.againPwd) ) {
this.$toast("两次密码不一致");
return;
}
if (!phoneRole.test(this.add.phone)) {
this.$toast("手机号格式不对,请检查");
return;
}
delete this.add.againPwd;
console.log("this.add: ", this.add);
let res = await this.$api.user.add(this.add);
console.log("res: ", res);
console.log("正取");
this.$toast.success({
message: '注册成功',
onClose: () => this.status = true
})
}
}
}
</script>
<style lang="less" scoped>
@import "~@views/Login.less";
</style>

View File

@@ -0,0 +1,31 @@
<template lang="pug">
.me
.me_header
img(src="https://m.mi.com/static/img/avatar.76a75b8f17.png")
span 登录/注册
.me_order
.top_order
van-cell(title='我的订单', value='全部订单' is-link)
van-divider
.bottom_order
van-grid(:column-num="3" :border="false")
van-grid-item(icon='photo-o', text='文字')
van-grid-item(icon='photo-o', text='文字')
van-grid-item(icon='photo-o', text='文字')
.setting
van-cell-group(:border="false")
van-cell(v-for="i in 5" icon="location-o" title='单元格', value='内容' is-link)
</template>
<script>
export default {
}
</script>
<style scoped lang="less">
@import "~@views/Me.less";
</style>

View File

@@ -0,0 +1,55 @@
<template lang="pug">
.radio
.title {{radioData.title}}
v-video(hidden ref="radioVideo" v-if="viderUrl.length != 0" :video-url="viderUrl")
img(class="banner" :src="radioData.frontcover")
img(class="progress" :src="progressImg")
img(class="play" :src="PlayImg" @click="playVideo")
</template>
<script>
// "http://10454-haitun.liveplay.myqcloud.com/live/10454_zbh_2001021036394.m3u8?txSecret=a068e2d05c23d3f035831afe590b9402&txTime=5FEFDC49"
export default {
data() {
return {
radioData: {},
viderUrl: [],
PlayImg: '/img/radio_up.png',
progressImg: '/img/sound_spectrum.png'
}
},
created() {
this.GetRadio();
},
methods: {
async GetRadio() {
let res = await this.$api.home.radios();
res.play_url = "https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8";
this.viderUrl = [
{
type: 'application/x-mpegURL',
src: res.play_url,
}
]
this.radioData = res;
},
playVideo() {
if (this.PlayImg.indexOf("radio_up") != -1) {
this.$refs.radioVideo.play();
this.PlayImg = "/img/radio_stop.png"
this.progressImg = "/img/sound_spectrum.gif"
} else {
this.$refs.radioVideo.stop();
this.PlayImg = "/img/radio_up.png"
this.progressImg = "/img/sound_spectrum.png"
}
}
},
components: {
}
}
</script>
<style lang="less" scoped>
@import "~@views/Radio.less";
</style>

View File

@@ -0,0 +1,38 @@
<template lang="pug">
.tv
TvList(:list-data="list")
</template>
<script>
import TvList from '@com/TvList.vue';
export default {
data() {
return {
page: 1,
list: []
}
},
created() {
this.GetChannelList()
},
methods: {
async GetChannelList() {
let res = await this.$api.home.channelList({
page: this.page,
count: 100
});
console.log( "res", res);
this.list = res;
}
},
components: {
TvList
}
}
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,67 @@
<template lang="pug">
.tv-info
NavbarComponents
.navbar-content
v-video(:video-url="videoUrl" v-if="videoUrl.length != 0")
van-tabs(v-model='active')
van-tab(title='频道')
TvList(:list-data="list")
van-tab(title='评论')
.vt_comment
</template>
<script>
import NavbarComponents from '@com/Navbar'
import TvList from '@com/TvList.vue';
export default {
data() {
return {
radioData: {},
videoUrl: [],
list: [],
commentList: [],
active: 0,
progressImg: '/img/hm_bg_img_no.png'
}
},
created() {
this.GetChannelList();
this.GetChannelComment();
},
methods: {
// 获取评论
async GetChannelComment() {
let res = await this.$api.home.channelComment({
object_id: this.$route.query.id
});
this.commentList = res.list;
console.log(res);
},
async GetChannelList() {
let res = await this.$api.home.channelList({
page: this.page,
count: 100
});
this.videoUrl = [{
type: 'video/x-flv',
src: this.$route.query.url,
}]
console.log(this.videoUrl);
this.list = res;
}
},
components: {
NavbarComponents,
TvList
}
}
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,33 @@
<template lang="pug">
.type
van-nav-bar(title='分类', left-arrow)
template(#right)
van-icon(name='search', size='18')
van-tree-select(height='calc(100vh - 50px - 46px)', :items='items', :main-active-index.sync='active')
template(#content='')
van-image(v-if='active === 0', src='https://img.yzcdn.cn/vant/apple-1.jpg')
van-image(v-if='active === 1', src='https://img.yzcdn.cn/vant/apple-2.jpg')
</template>
<script>
export default {
data() {
return {
active: 0,
items: [
{ text: '分组 1' }, { text: '分组 2' },
],
};
},
}
</script>
<style lang="less" scoped>
.type {
.van-tree-select__content {
flex: 3 !important;
}
}
</style>

View File

@@ -0,0 +1,122 @@
<template lang="pug">
.video-info
NavbarComponents
.navbar-content
v-video(:video-url="videoUrl" v-if="videoUrl.length != 0")
.viedo-content
p.title {{ this.list.title }}
span.time {{ this.list.publish_time }}
.videoBotton
.vb_left
i.iconfont.icon-shoucang
p 收藏
.vb_cont
i.iconfont.icon-shoucang
p {{ this.list.like_count }}
.vb_right( @click="descont = !descont " )
p 简介
i.iconfont.icon-shoucang
p.des( :class=" descont ? 'block': '' " ) {{ this.list.des }}
videoDetail( theme='t1' :vlist="videolist.recommend")
</template>
<script>
import NavbarComponents from "@com/Navbar";
import videoDetail from "@com/videoDetail"
export default {
data() {
return {
videolist: {},
videoUrl: [],
list:[],
descont: false
};
},
created() {
this.Getvideo();
},
methods: {
async Getvideo(){
let res = await this.$api.home.videoDetail({
id: this.$route.query.id
})
this.videolist = res;
console.log(this.videolist);
this.videoUrl = [
{
type: "video/mp4",
src: this.videolist.detail.play_url
},
];
this.list = this.videolist.detail
console.log('list',this.list);
},
},
components: {
NavbarComponents,
videoDetail
},
};
</script>
<style lang="less" scoped>
.video-info {
.viedo-content {
padding-top: 0.787rem;
padding-left: 0.307rem;
padding-right: 0.32rem;
.title {
font-size: 0.48rem;
color: #333333;
}
.block{
display: block !important;
}
.des{
display: none;
font-size: 0.373rem;
color: #999999;
margin-top: 0.4rem;
line-height: 0.627rem;
}
.time {
font-size: 0.32rem;
color: #999999;
}
.videoBotton {
display: flex;
align-items: center;
justify-content: space-between;
p {
font-size: 0.32rem;
color: #999999;
}
i {
// width: 0.373rem;
// height: 0.373rem;
}
.vb_left {
display: flex;
align-items: center;
margin-right: 0.8rem;
}
.vb_cont {
flex: 1;
align-items: center;
display: flex;
}
.vb_right {
align-items: center;
display: flex;
}
}
}
}
</style>

View File

@@ -0,0 +1,80 @@
<template lang="pug">
.news
NavbarComponents
.news_content
.newsContent_one
p.pp1 {{ list.title }}
p.pp2 {{ list.create_time }}
.newsContent_tow
p.pp3(v-html="list.content")
videoDetail( theme='aa' :vlist="re.recommend")
.news_comment
Newscomment(theme="theme1")
</template>
<script>
import NavbarComponents from "@com/Navbar";
import videoDetail from "@com/videoDetail"
import Newscomment from "@com/NewsComment";
export default {
data() {
return {
id: [],
isActive: true,
list: {},
re:{}
};
},
created() {
this.GetnewsDetail();
},
methods: {
async GetnewsDetail() {
let res = await this.$api.home.newsDetail({
id: this.$route.query.id,
});
this.list = res.detail;
this.re = res
console.log("res", res);
console.log("this.list", this.list);
},
},
components: {
NavbarComponents,
videoDetail,
Newscomment,
},
};
</script>
<style lang="less" scoped>
.news {
margin-top: 1.653rem;
.news_content {
padding-right: 0.333rem;
padding-left: 0.307rem;
.newsContent_one {
.pp1 {
font-size: 0.533rem;
color: #333333;
margin-bottom: 0.507rem;
}
.pp2 {
font-size: 0.32rem;
color: #999999;
}
}
.newsContent_tow .pp3 {
// height: 7.08rem;
font-size: 0.427rem;
color: #000000;
font-size: 0.427rem;
color: #000000;
}
}
}
</style>

View File

@@ -0,0 +1,99 @@
<template lang="pug">
.news
NavbarComponents
.news_content
.newsContent_one
p.pp1 {{ list.title }}
p.pp2 {{ list.create_time }}
.newsContent_tow
p.pp3(v-html="list.content")
img.nct_img(src="/img/select-down.png", @click="hidv = !hidv")
p.pp4 打开APP阅读全文
videoDetail(theme="aa", :vlist="re.recommend")
.news_comment
Newscomment(theme="theme1")
</template>
<script>
import NavbarComponents from "@com/Navbar";
import videoDetail from "@com/videoDetail";
import Newscomment from "@com/NewsComment";
export default {
data() {
return {
id: [],
isActive: true,
list: {},
hidv: false,
re: {},
};
},
created() {
this.GetnewsDetail();
},
methods: {
async GetnewsDetail() {
let res = await this.$api.home.newsDetail({
id: this.$route.query.id,
});
this.list = res.detail;
this.re = res;
console.log("res", res);
console.log("this.list", this.list);
},
},
components: {
NavbarComponents,
videoDetail,
Newscomment,
},
};
</script>
<style lang="less" scoped>
.news {
margin-top: 1.653rem;
.news_content {
padding-right: 0.333rem;
padding-left: 0.307rem;
.newsContent_one {
.pp1 {
font-size: 0.533rem;
color: #333333;
margin-bottom: 0.507rem;
}
.pp2 {
font-size: 0.32rem;
color: #999999;
}
}
.newsContent_tow {
.pp3 {
font-size: 0.427rem;
color: #000000;
height: 17.7rem;
overflow: hidden;
}
.nct_img {
height: 0.533rem;
display: table;
margin: 0 auto;
margin-top: 0.5rem;
margin-bottom: 0.3rem;
}
.pp4 {
width: 9.36rem;
height: 1.173rem;
background-color: #d0302c;
border-radius: 0.107rem;
font-size: 0.373rem;
color: #ffffff;
text-align: center;
line-height: 1.173rem;
}
}
}
}
</style>

View File

@@ -0,0 +1,37 @@
const path = require('path');
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: './',
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [
path.resolve(__dirname, './src/assets/less/common/_.less')
],
},
},
chainWebpack: (config) => {
// 配置别名
config.resolve.alias
.set('@', resolve('./src'))
.set('@config', resolve('./src/config'))
.set('@service', resolve('./src/service'))
.set('@utils', resolve('./src/utils'))
.set('@view', resolve('./src/view'))
.set('@http', resolve('./src/http'))
.set('@com', resolve('./src/components'))
.set('@views', resolve('./src/assets/less/views'))
.set('@common', resolve('./src/assets/less/common'))
config.module.rule('pug')
.test(/\.pug$/)
.use('pug-html-loader')
.loader('pug-html-loader')
.end()
}
}

View File

@@ -0,0 +1,74 @@
ajax 请求是无状态
json web token
jwt
用户登录后
id + WEFREFSDGTRH4354
token: 213456YTFQER4546Y56URYESRDT6U453456576434564U7TR65ERSYH5ETT53E
{
token: '213456YTFQER4546Y56URYESRDT6U453456576434564U7TR65ERSYH5ETT53E'
}
用户访问购物车页面的时候:
id = 1
{
status: 200,
result: "ASDERBGFREWQ32456435678UYTEWERFGRTHYJ6HY5T4WEHRJTYR6"
}
{
id: 253
}
data: WEFGFWERT56467I54TRGTHYTTRY6JH65
MD5 不能反向解密,不可逆的加密算法
bmycode
lb1223444
MD5("lb1223444") = ASDFGBGREW4TE54356764765Y4ETWGSBFDGGFAESRDHTRJ64
在线MD5解密
RSA 非对称加密
公钥 哈哈哈哈
私钥
前端请求参数
{
id: 1
}
RSA 加密
rsa({
id: 1
}) = DSFBGR4356Y45657UY54T/5465UY4T3454/5Y/65U6Y576U7U
data: DSFBGR4356Y45657UY54T/5465UY4T3454/5Y/65U6Y576U7U
{
status: 200,
result: "234567UJY5TR4FGT45YU685Y4TE54676Y"
}
[
{
id: 1
}
]

View File

@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
body {
background: #98d8fe url("../img/back.png");
background-position: center bottom;
background-repeat: no-repeat;
background-size: cover;
}
.people {
position: absolute;
left: 0;
bottom: 0;
width: 100px;
}
span {
}
.leftPeople {
transform: rotateY(180deg) !important;
}
.apple {
width: 40px;
height: 40px;
transition: top 0.1s ease;
}
.boom {
width: 60px;
transition: top 0.1s ease;
}
.fraction {
position: absolute;
right: 10px;
top: 10px;
font-size: 20px;
}
</style>
</head>
<body>
<!--得分-->
<div class="fraction">0分</div>
<!--爆炸音效-->
<audio class="bombAudio" src="../img/bomb.mp3" hidden></audio>
<audio class="appleAudio" src="../img/apple.mp3" hidden></audio>
<!--人物-->
<img class="people" src="../img/pepop.png"/>
<button onclick="ease">简单</button>
<button onclick="difficulty">困难</button>
<button onclick="veryharld">地狱</button>
</body>
<script src="../js/game.js"></script>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 711 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

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