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 @@
24451d21-f23b-43d2-bfa3-cf40894a906c

View File

@@ -0,0 +1,15 @@
.DS_Store
npm-debug.log*
selenium-debug.log
node_modules
.nuxt/
/package-lock.json
*.tar
*.md
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln

View File

@@ -0,0 +1,2 @@
node_modules
exec.js

View File

@@ -0,0 +1 @@
90b0809e-c34c-45b3-92fc-e4beb8e1bc2b

View File

@@ -0,0 +1,19 @@
FROM node:10
# 定位进入容器项目文件夹
WORKDIR /home/node
# 拷贝宿主项目到容器
COPY . .
# 初始化项目
# RUN npm install -g cnpm
# RUN apt-get update && apt-get install net-tools
# RUN apt-get update && apt-get install lsof
# RUN apt-get update && apt-get install vim -y
RUN npm install
#RUN cnpm install -g node-dev
# 绑定端口
EXPOSE 3000
# 启动网站
CMD [ "node", "./bin/www" ]

View File

@@ -0,0 +1,42 @@
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var indexRouter = require('./routes/index');
var app = express();
app.all('*', function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'token');
res.header('Content-Type', 'application/json;charset=utf-8');
next();
});
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use('/api', indexRouter);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
});
// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error');
});
module.exports = app;

View File

@@ -0,0 +1 @@
c2596e48-8cda-44ab-80c3-2de5edf780da

View File

@@ -0,0 +1,87 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('caipu:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3001');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
var addr = server.address();
console.log('App is run http://127.0.0.1:'+addr.port);
}

View File

@@ -0,0 +1 @@
67ef0137-0f07-4037-80ea-b78b82aa102c

View File

@@ -0,0 +1,85 @@
module.exports = {
baseUrl: 'https://m.meishij.net',
HomeClassType: function (type = 1, page = 1) {
return `https://m.meishij.net/ajax/index_search_new.php?callback=jQuery2140868703264037048_1597809875093&format=json&type=${type}&page=${page}&_=1597809875094`
},
// 菜谱视频大全
VideoList: function (page = 1) {
return `https://m.meishij.net/shipin/index.php?callback=jQuery21408367060449076322_1597835324516&format=json&ajax=1&page=${page}&_=1597835324517`;
},
SearchWord: function (q = '', page = 1) {
return `https://m.meishij.net/search.php?q=${q}&ajax=1&page=${page}`
},
leftType: [
{
url: '/fenlei/shiyongfenlei/',
title: '实用分类',
position: 0,
},
{
url: '/fenlei/meirisancan/',
title: '每日三餐',
position: -50,
},
{
url: '/fenlei/zhushidaquan/',
title: '主食',
position: -75,
},
{
url: '/fenlei/jiachangcaipu/',
title: '家常菜谱',
position: -100,
},
{
url: '/caixi/',
title: '中华菜系',
position: -125,
},
{
url: '/xiaochi/',
title: '各地小吃',
position: -150,
},
{
url: '/fenlei/waiguocaipu/',
title: '外国菜谱',
position: -175,
},
{
url: '/fenlei/hongbei/',
title: '烘焙',
position: -200,
},
{
url: '/renqun/',
title: '人群',
position: -225,
},
{
url: '/fenlei/chuju/',
title: '厨具',
position: -250,
},
{
url: '/fenlei/changjing/',
title: '场景',
position: -275,
},
{
url: '/zangfutiaoli/',
title: '脏腑调理',
position: -325,
},
{
url: '/fenlei/gongyi/',
title: '工艺',
position: -375,
},
{
url: '/fenlei/kouwei/',
title: '口味',
position: -425,
}
],
}

View File

@@ -0,0 +1,10 @@
# POST https://m.meishij.net/ajax/index_search.php HTTP/1.1
# content-type: application/json
# {
# "page": 2
# }
# GET http://127.0.0.1:3000/api/type/leftMenu HTTP/1.1
# GET http://127.0.0.1:3000/api/type/rightMenu?url=/fenlei/meirisancan/

View File

@@ -0,0 +1,841 @@
{
"name": "caipu",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/node": {
"version": "14.6.0",
"resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-14.6.0.tgz",
"integrity": "sha1-fUQRv1FXM5M318/4ZNn/RfF3tJk="
},
"accepts": {
"version": "1.3.7",
"resolved": "https://registry.npm.taobao.org/accepts/download/accepts-1.3.7.tgz",
"integrity": "sha1-UxvHJlF6OytB+FACHGzBXqq1B80=",
"requires": {
"mime-types": "~2.1.24",
"negotiator": "0.6.2"
}
},
"ajv": {
"version": "6.12.4",
"resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.4.tgz?cache=0&sync_timestamp=1597480760804&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.4.tgz",
"integrity": "sha1-BhT6zEUiEn+nE0Rca/0+vTduIjQ=",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/array-flatten/download/array-flatten-1.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Farray-flatten%2Fdownload%2Farray-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
"asn1": {
"version": "0.2.4",
"resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz",
"integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=",
"requires": {
"safer-buffer": "~2.1.0"
}
},
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
},
"aws4": {
"version": "1.10.1",
"resolved": "https://registry.npm.taobao.org/aws4/download/aws4-1.10.1.tgz?cache=0&sync_timestamp=1597238704875&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faws4%2Fdownload%2Faws4-1.10.1.tgz",
"integrity": "sha1-4eguTz6Zniz9YbFhKA0WoRH4ZCg="
},
"basic-auth": {
"version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/basic-auth/download/basic-auth-2.0.1.tgz",
"integrity": "sha1-uZgnm/R844NEtPPPkW1Gebv1Hjo=",
"requires": {
"safe-buffer": "5.1.2"
}
},
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
"requires": {
"tweetnacl": "^0.14.3"
}
},
"body-parser": {
"version": "1.18.3",
"resolved": "https://registry.npm.taobao.org/body-parser/download/body-parser-1.18.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbody-parser%2Fdownload%2Fbody-parser-1.18.3.tgz",
"integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=",
"requires": {
"bytes": "3.0.0",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.2",
"http-errors": "~1.6.3",
"iconv-lite": "0.4.23",
"on-finished": "~2.3.0",
"qs": "6.5.2",
"raw-body": "2.3.3",
"type-is": "~1.6.16"
}
},
"boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/boolbase/download/boolbase-1.0.0.tgz",
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24="
},
"bytes": {
"version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/bytes/download/bytes-3.0.0.tgz",
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
},
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
},
"cheerio": {
"version": "1.0.0-rc.3",
"resolved": "https://registry.npm.taobao.org/cheerio/download/cheerio-1.0.0-rc.3.tgz",
"integrity": "sha1-CUY21CWy6cD065GkbAVjDJoai/Y=",
"requires": {
"css-select": "~1.2.0",
"dom-serializer": "~0.1.1",
"entities": "~1.1.1",
"htmlparser2": "^3.9.1",
"lodash": "^4.15.0",
"parse5": "^3.0.1"
}
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz",
"integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"content-disposition": {
"version": "0.5.2",
"resolved": "https://registry.npm.taobao.org/content-disposition/download/content-disposition-0.5.2.tgz",
"integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
},
"content-type": {
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/content-type/download/content-type-1.0.4.tgz",
"integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js="
},
"cookie": {
"version": "0.4.0",
"resolved": "https://registry.npm.taobao.org/cookie/download/cookie-0.4.0.tgz",
"integrity": "sha1-vrQ35wIrO21JAZ0IhmUwPr6cFLo="
},
"cookie-parser": {
"version": "1.4.5",
"resolved": "https://registry.npm.taobao.org/cookie-parser/download/cookie-parser-1.4.5.tgz",
"integrity": "sha1-PlctS3wMgPnGHa9gTkM2gxtdHUk=",
"requires": {
"cookie": "0.4.0",
"cookie-signature": "1.0.6"
}
},
"cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npm.taobao.org/cookie-signature/download/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"css-select": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/css-select/download/css-select-1.2.0.tgz",
"integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=",
"requires": {
"boolbase": "~1.0.0",
"css-what": "2.1",
"domutils": "1.5.1",
"nth-check": "~1.0.1"
}
},
"css-what": {
"version": "2.1.3",
"resolved": "https://registry.npm.taobao.org/css-what/download/css-what-2.1.3.tgz",
"integrity": "sha1-ptdgRXM2X+dGhsPzEcVlE9iChfI="
},
"dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz",
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
"requires": {
"assert-plus": "^1.0.0"
}
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz",
"integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=",
"requires": {
"ms": "2.0.0"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/depd/download/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
"destroy": {
"version": "1.0.4",
"resolved": "https://registry.npm.taobao.org/destroy/download/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"dom-serializer": {
"version": "0.1.1",
"resolved": "https://registry.npm.taobao.org/dom-serializer/download/dom-serializer-0.1.1.tgz",
"integrity": "sha1-HsQFnihLq+027sKUHUqXChic58A=",
"requires": {
"domelementtype": "^1.3.0",
"entities": "^1.1.1"
}
},
"domelementtype": {
"version": "1.3.1",
"resolved": "https://registry.npm.taobao.org/domelementtype/download/domelementtype-1.3.1.tgz",
"integrity": "sha1-0EjESzew0Qp/Kj1f7j9DM9eQSB8="
},
"domhandler": {
"version": "2.4.2",
"resolved": "https://registry.npm.taobao.org/domhandler/download/domhandler-2.4.2.tgz",
"integrity": "sha1-iAUJfpM9ZehVRvcm1g9euItE+AM=",
"requires": {
"domelementtype": "1"
}
},
"domutils": {
"version": "1.5.1",
"resolved": "https://registry.npm.taobao.org/domutils/download/domutils-1.5.1.tgz?cache=0&sync_timestamp=1597680507221&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdomutils%2Fdownload%2Fdomutils-1.5.1.tgz",
"integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
"requires": {
"dom-serializer": "0",
"domelementtype": "1"
}
},
"ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz",
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
"requires": {
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
}
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
"entities": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/entities/download/entities-1.1.2.tgz?cache=0&sync_timestamp=1591227679482&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fentities%2Fdownload%2Fentities-1.1.2.tgz",
"integrity": "sha1-vfpzUplmTfr9NFKe1PhSKidf6lY="
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
},
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npm.taobao.org/etag/download/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"express": {
"version": "4.16.4",
"resolved": "https://registry.npm.taobao.org/express/download/express-4.16.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexpress%2Fdownload%2Fexpress-4.16.4.tgz",
"integrity": "sha1-/d72GSYQniTFFeqX/S8b2/Yt8S4=",
"requires": {
"accepts": "~1.3.5",
"array-flatten": "1.1.1",
"body-parser": "1.18.3",
"content-disposition": "0.5.2",
"content-type": "~1.0.4",
"cookie": "0.3.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "~1.1.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "1.1.1",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.4",
"qs": "6.5.2",
"range-parser": "~1.2.0",
"safe-buffer": "5.1.2",
"send": "0.16.2",
"serve-static": "1.13.2",
"setprototypeof": "1.1.0",
"statuses": "~1.4.0",
"type-is": "~1.6.16",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
},
"dependencies": {
"cookie": {
"version": "0.3.1",
"resolved": "https://registry.npm.taobao.org/cookie/download/cookie-0.3.1.tgz",
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
}
}
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz",
"integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo="
},
"extsprintf": {
"version": "1.3.0",
"resolved": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.3.tgz?cache=0&sync_timestamp=1591599651635&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-deep-equal%2Fdownload%2Ffast-deep-equal-3.1.3.tgz",
"integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU="
},
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM="
},
"finalhandler": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/finalhandler/download/finalhandler-1.1.1.tgz",
"integrity": "sha1-7r9O2EAHnIP0JJA4ydcDAIMBsQU=",
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"statuses": "~1.4.0",
"unpipe": "~1.0.0"
}
},
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz",
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
},
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz",
"integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"forwarded": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/forwarded/download/forwarded-0.1.2.tgz",
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
},
"fresh": {
"version": "0.5.2",
"resolved": "https://registry.npm.taobao.org/fresh/download/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"getpass": {
"version": "0.1.7",
"resolved": "https://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz",
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
"requires": {
"assert-plus": "^1.0.0"
}
},
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz",
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
},
"har-validator": {
"version": "5.1.5",
"resolved": "https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.5.tgz?cache=0&sync_timestamp=1596082653557&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhar-validator%2Fdownload%2Fhar-validator-5.1.5.tgz",
"integrity": "sha1-HwgDufjLIMD6E4It8ezds2veHv0=",
"requires": {
"ajv": "^6.12.3",
"har-schema": "^2.0.0"
}
},
"htmlparser2": {
"version": "3.10.1",
"resolved": "https://registry.npm.taobao.org/htmlparser2/download/htmlparser2-3.10.1.tgz?cache=0&sync_timestamp=1582422905208&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhtmlparser2%2Fdownload%2Fhtmlparser2-3.10.1.tgz",
"integrity": "sha1-vWedw/WYl7ajS7EHSchVu1OpOS8=",
"requires": {
"domelementtype": "^1.3.1",
"domhandler": "^2.3.0",
"domutils": "^1.5.1",
"entities": "^1.1.1",
"inherits": "^2.0.1",
"readable-stream": "^3.1.1"
}
},
"http-errors": {
"version": "1.6.3",
"resolved": "https://registry.npm.taobao.org/http-errors/download/http-errors-1.6.3.tgz?cache=0&sync_timestamp=1593407710477&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-errors%2Fdownload%2Fhttp-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": ">= 1.4.0 < 2"
}
},
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"requires": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"iconv-lite": {
"version": "0.4.23",
"resolved": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.23.tgz",
"integrity": "sha1-KXhx9jvlB63Pv8pxXQzQ7thOmmM=",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npm.taobao.org/ipaddr.js/download/ipaddr.js-1.9.1.tgz",
"integrity": "sha1-v/OFQ+64mEglB5/zoqjmy9RngbM="
},
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz",
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
},
"isstream": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
},
"jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
},
"json-schema": {
"version": "0.2.3",
"resolved": "https://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz",
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz",
"integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA="
},
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz",
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
},
"jsprim": {
"version": "1.4.1",
"resolved": "https://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz",
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
"requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.3.0",
"json-schema": "0.2.3",
"verror": "1.10.0"
}
},
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.20.tgz?cache=0&sync_timestamp=1597336001963&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.20.tgz",
"integrity": "sha1-tEqbYpe8tpjxxRo1RaKzs2jVnFI="
},
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/merge-descriptors/download/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
},
"methods": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/methods/download/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
},
"mime": {
"version": "1.4.1",
"resolved": "https://registry.npm.taobao.org/mime/download/mime-1.4.1.tgz",
"integrity": "sha1-Eh+evEnjdm8xGnbh+hyAA8SwOqY="
},
"mime-db": {
"version": "1.44.0",
"resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.44.0.tgz",
"integrity": "sha1-+hHF6wrKEzS0Izy01S8QxaYnL5I="
},
"mime-types": {
"version": "2.1.27",
"resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.27.tgz",
"integrity": "sha1-R5SfmOJ56lMRn1ci4PNOUpvsAJ8=",
"requires": {
"mime-db": "1.44.0"
}
},
"morgan": {
"version": "1.9.1",
"resolved": "https://registry.npm.taobao.org/morgan/download/morgan-1.9.1.tgz",
"integrity": "sha1-Co0Wc0odmvvIJLmd+H5zjlji2lk=",
"requires": {
"basic-auth": "~2.0.0",
"debug": "2.6.9",
"depd": "~1.1.2",
"on-finished": "~2.3.0",
"on-headers": "~1.0.1"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"negotiator": {
"version": "0.6.2",
"resolved": "https://registry.npm.taobao.org/negotiator/download/negotiator-0.6.2.tgz",
"integrity": "sha1-/qz3zPUlp3rpY0Q2pkiD/+yjRvs="
},
"nth-check": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/nth-check/download/nth-check-1.0.2.tgz",
"integrity": "sha1-sr0pXDfj3VijvwcAN2Zjuk2c8Fw=",
"requires": {
"boolbase": "~1.0.0"
}
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz",
"integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU="
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz",
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
"requires": {
"ee-first": "1.1.1"
}
},
"on-headers": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/on-headers/download/on-headers-1.0.2.tgz",
"integrity": "sha1-dysK5qqlJcOZ5Imt+tkMQD6zwo8="
},
"parse5": {
"version": "3.0.3",
"resolved": "https://registry.npm.taobao.org/parse5/download/parse5-3.0.3.tgz?cache=0&sync_timestamp=1595849319979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fparse5%2Fdownload%2Fparse5-3.0.3.tgz",
"integrity": "sha1-BC95L/3TaFFVHPTp4Gazh0q0W1w=",
"requires": {
"@types/node": "*"
}
},
"parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.3.tgz",
"integrity": "sha1-naGee+6NEt/wUT7Vt2lXeTvC6NQ="
},
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npm.taobao.org/path-to-regexp/download/path-to-regexp-0.1.7.tgz?cache=0&sync_timestamp=1574278262588&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpath-to-regexp%2Fdownload%2Fpath-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
},
"proxy-addr": {
"version": "2.0.6",
"resolved": "https://registry.npm.taobao.org/proxy-addr/download/proxy-addr-2.0.6.tgz",
"integrity": "sha1-/cIzZQVEfT8vLGOO0nLK9hS7sr8=",
"requires": {
"forwarded": "~0.1.2",
"ipaddr.js": "1.9.1"
}
},
"psl": {
"version": "1.8.0",
"resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz",
"integrity": "sha1-kyb4vPsBOtzABf3/BWrM4CDlHCQ="
},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz",
"integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew="
},
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz",
"integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY="
},
"range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npm.taobao.org/range-parser/download/range-parser-1.2.1.tgz",
"integrity": "sha1-PPNwI9GZ4cJNGlW4SADC8+ZGgDE="
},
"raw-body": {
"version": "2.3.3",
"resolved": "https://registry.npm.taobao.org/raw-body/download/raw-body-2.3.3.tgz",
"integrity": "sha1-GzJOzmtXBuFThVvBFIxlu39uoMM=",
"requires": {
"bytes": "3.0.0",
"http-errors": "1.6.3",
"iconv-lite": "0.4.23",
"unpipe": "1.0.0"
}
},
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npm.taobao.org/readable-stream/download/readable-stream-3.6.0.tgz",
"integrity": "sha1-M3u9o63AcGvT4CRCaihtS0sskZg=",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"request": {
"version": "2.88.2",
"resolved": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz",
"integrity": "sha1-1zyRhzHLWofaBH4gcjQUb2ZNErM=",
"requires": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.3",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz",
"integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz",
"integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo="
},
"send": {
"version": "0.16.2",
"resolved": "https://registry.npm.taobao.org/send/download/send-0.16.2.tgz",
"integrity": "sha1-bsyh4PjBVtFBWXVZhI32RzCmu8E=",
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.6.2",
"mime": "1.4.1",
"ms": "2.0.0",
"on-finished": "~2.3.0",
"range-parser": "~1.2.0",
"statuses": "~1.4.0"
}
},
"serve-static": {
"version": "1.13.2",
"resolved": "https://registry.npm.taobao.org/serve-static/download/serve-static-1.13.2.tgz",
"integrity": "sha1-CV6Ecv1bRiN9tQzkhqQ/S4bGzsE=",
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.2",
"send": "0.16.2"
}
},
"setprototypeof": {
"version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/setprototypeof/download/setprototypeof-1.1.0.tgz",
"integrity": "sha1-0L2FU2iHtv58DYGMuWLZ2RxU5lY="
},
"sshpk": {
"version": "1.16.1",
"resolved": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz",
"integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=",
"requires": {
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
"bcrypt-pbkdf": "^1.0.0",
"dashdash": "^1.12.0",
"ecc-jsbn": "~0.1.1",
"getpass": "^0.1.1",
"jsbn": "~0.1.0",
"safer-buffer": "^2.0.2",
"tweetnacl": "~0.14.0"
}
},
"statuses": {
"version": "1.4.0",
"resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.4.0.tgz",
"integrity": "sha1-u3PURtonlhBu/MG2AaJT1sRr0Ic="
},
"string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npm.taobao.org/string_decoder/download/string_decoder-1.3.0.tgz",
"integrity": "sha1-QvEUWUpGzxqOMLCoT1bHjD7awh4=",
"requires": {
"safe-buffer": "~5.2.0"
},
"dependencies": {
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.1.tgz",
"integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY="
}
}
},
"tough-cookie": {
"version": "2.5.0",
"resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz",
"integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=",
"requires": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
}
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"requires": {
"safe-buffer": "^5.0.1"
}
},
"tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
},
"type-is": {
"version": "1.6.18",
"resolved": "https://registry.npm.taobao.org/type-is/download/type-is-1.6.18.tgz",
"integrity": "sha1-TlUs0F3wlGfcvE73Od6J8s83wTE=",
"requires": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
}
},
"unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz",
"integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=",
"requires": {
"punycode": "^2.1.0"
}
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/utils-merge/download/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz?cache=0&sync_timestamp=1595886825323&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuuid%2Fdownload%2Fuuid-3.4.0.tgz",
"integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
},
"verror": {
"version": "1.10.0",
"resolved": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"requires": {
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "^1.2.0"
}
}
}
}

View File

@@ -0,0 +1,17 @@
{
"name": "caipu",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node-dev ./bin/www"
},
"dependencies": {
"cheerio": "^1.0.0-rc.3",
"cookie-parser": "~1.4.4",
"debug": "~2.6.9",
"express": "~4.16.1",
"http-errors": "~1.6.3",
"morgan": "~1.9.1",
"request": "^2.88.2"
}
}

View File

@@ -0,0 +1 @@
aba93b85-5030-4811-80eb-f2659aba7026

View File

@@ -0,0 +1,26 @@
const app = require('express')(),
exec = require('child_process').execFile;
app.post('/pull', (req, res) => {
exec('pull.sh', (err, stdout, stderr) => {
if (err) {
console.log(`命令执行错误:${err}`)
res.json({
title: 'error',
message: err.message
})
} else {
console.log("命令执行成功:");
console.log(stdout);
res.json({
title: 'success',
})
}
});
})
app.listen(1314, () => {
console.log('Node.js自动部署运行在: 1314')
})

View File

@@ -0,0 +1,15 @@
{
"name": "pull",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "pm2 start index.js --name pull --watch -i max"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.17.1"
}
}

View File

@@ -0,0 +1,32 @@
#!/bin/bash
# 项目路径
jar_path=/root/moehu-backend/
#编译好的jar名称
jar_name=back-0.0.1-SNAPSHOT.jar
#进入指定项目路径
cd ${jar_path}
echo ------
pwd
echo ------
#获取运行编译好的进程ID便于我们在重新部署项目的时候先杀掉以前的进程
pid=$(cat /root/moehu-backend/moehu.pid)
# 拉取代码,编译打包
git pull && mvn clean package -Dmaven.test.skip=true
echo ------
echo ${pid}
echo ------
#杀掉以前可能启动的项目进程
kill -9 ${pid}
#启动jar指定SpringBoot的profiles为test,后台启动
java -jar ${jar_name} &
#将进程ID存入到shaw-web.pid文件中
echo $! > /root/moehu-backend/moehu.pid

View File

@@ -0,0 +1 @@
fc738c73-0a26-4ee4-bbbd-4b0e72d46a3c

View File

@@ -0,0 +1,512 @@
const express = require('express');
const router = express.Router();
const config = require("../config")
const utils = require("../utils")
const cheerio = require('cheerio');
/**
* 1首页获取分类数据接口
* 请求示例http://127.0.0.1:3000/api/index/class?type=1&page=1
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/index/class
* 请求参数:
* type: 取值1(推荐)2(时令)3(食肉)4(素食)5(烘焙)
* page: 分页页码
*/
router.get('/index/class', function(req, res, next) {
var type = req.query.type || 1;
var page = req.query.page || 1;
utils.GET(config.HomeClassType(type,page),(result)=>{
let data = `${result.match(/jQuery2140868703264037048_1597809875093\(([\s\S]*?)\}\)/)[1]}}`
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: JSON.parse(data).data
});
})
});
/**
* 2热门推荐
* 请求示例http://127.0.0.1:3000/api/index/hot
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/index/hot
* 请求参数:无
*/
router.get('/index/hot', function(req, res, next) {
utils.GET(config.baseUrl,(result)=>{
const $ = cheerio.load(result);
let dat = []
$(".con1w .cj_swiper_item").each(function (index,el) {
dat.push({
img: $(this).find(".img").attr("style").match(/background: url\(([\s\S]*?)\) center/)[1],
title: $(this).find(".t").text(),
url: $(this).find("a").attr("href"),
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: dat
});
})
});
/**
* 3每日三餐
* 请求示例http://127.0.0.1:3000/api/index/threeMeals
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/index/threeMeals
* 请求参数:无
*/
router.get('/index/threeMeals', function(req, res, next) {
utils.GET(config.baseUrl,(result)=>{
const $ = cheerio.load(result);
var titleArray = []
$(".sc_titlew_scroller").eq(0).find("span").each(function(index,el){
titleArray.push({
title: $(this).find("em").text(),
content: []
});
})
var content = {};
$(".top_sancan2019 .swiper-slide").each(function(index,el){
content[index] = [];
$(this).find(".sancan_swiper_item").each(function(i,e){
content[index].push({
url: $(this).find("a").attr("href"),
img: $(this).find("a img").attr("src"),
title: $(this).find("a .text").text(),
des: $(this).find("a .yyw .des").text(),
})
})
});
for (const key in content) {
titleArray[key].content = content[key]
}
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: titleArray
})
})
});
/**
* 4获取banner图
* 请求示例http://127.0.0.1:3000/api/index/banner
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/index/banner
* 请求参数:无
*/
router.get('/index/banner', function(req, res, next) {
utils.GET(config.baseUrl,(result)=>{
const $ = cheerio.load(result);
let data = []
$(".swiper-container3 a").each(function (index,el) {
data.push({
url: $(this).attr("href"),
img: $(this).find("img").attr("src"),
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 5获取banner点击后的详情
* 请求示例http://127.0.0.1:3000/api/index/bannerInfo?url=https://m.meishij.net/zt/chushulaoji6dianyinshiyuanzeyi.html
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/index/bannerInfo
* 请求参数:
* url要进入的轮播url地址
*/
router.get('/index/bannerInfo', function(req, res, next) {
let url = req.query.url;
utils.GET(url,(result)=>{
const $ = cheerio.load(result);
let data = {}
data.banner = $(".topimgw img").attr("src")
data.title = $(".zttitlew h1").text()
data.content = $(".ztcontentw").html()
data.comment = []
$(".zt_pllist .zt_plitem").each(function (index,el){
data.comment.push({
name: $(this).find(".c1 strong").text(),
time: $(this).find(".c1 span").text(),
img: $(this).find(".c1 .avatarw img").attr("src"),
content: $(this).find(".pltxt").text()
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 6菜谱视频大全列表
* 请求示例http://127.0.0.1:3000/api/video/list
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/video/list
* 请求参数page
*/
router.get('/video/list', function(req, res, next) {
console.log("请求地址:", config.VideoList(1))
var page = req.query.page || 1;
utils.GET(config.VideoList(page),(result)=>{
let data = result.match(/jQuery21408367060449076322_1597835324516\(([\s\S]*?)\)/)[1]
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: JSON.parse(data).data
});
})
});
/**
* 7搜索接口
* 请求示例http://127.0.0.1:3000/api/search/list?q=猪蹄&page=1
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/search/list
* 请求参数:
* q 要搜索的菜名称
* page 页码
*/
router.get('/search/list', function(req, res, next) {
var q = req.query.q || '';
var page = req.query.page || 1;
utils.GET(config.SearchWord(encodeURIComponent(q), page),(result)=>{
const $ = cheerio.load(result);
var data = []
$(".hasbb1").each(function (index,el) {
data.push({
href: $(this).find("a").attr("href"),
title: $(this).find("a h3").text(),
des: $(this).find("a .des").text(),
img: $(this).find("a img").attr("src"),
})
});
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 8分类页面获取左侧分类菜单
* 请求示例http://127.0.0.1:3000/api/type/leftMenu
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/type/leftMenu
* 请求参数:无
*/
router.get('/type/leftMenu', function(req, res, next) {
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: config.leftType
});
});
/**
* 9分类页面获取右边的小内容
* 请求示例http://127.0.0.1:3000/api/type/rightMenu?url=/fenlei/shiyongfenlei/
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/type/rightMenu
* 请求参数:
* url: 左侧分类的url字段
*/
router.get('/type/rightMenu', function(req, res, next) {
let url = `${config.baseUrl}${req.query.url}`;
utils.GET(url,(result)=>{
const $ = cheerio.load(result);
let data = []
$(".right_sort_list_scroller ul li a").each(function (index,el) {
data.push({
id: $(this).attr("href"),
img: $(this).find("img").attr("src"),
title: $(this).find("span").text(),
})
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 10点击右边小分类获取分类列表
* 请求示例http://127.0.0.1:3000/api/type/rightMenuList?url=https://m.meishij.net/fenlei/recai/
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/type/rightMenuList
* 请求参数:
* url: 右侧分类的url字段
* p: 页码
*/
router.get('/type/rightMenuList', function(req, res, next) {
let url = req.query.url;
let page = req.query.p || 1;
console.log(`${url}p${page}`)
utils.GET(`${url}p${page}`,(result)=>{
const $ = cheerio.load(result);
var data = []
$(".con_data_s2_list").eq(0).find("li a").each(function (index, el){
var num = $(this).find("span").text().split("  ");
console.log(num)
data.push({
url: $(this).attr("href"),
img: $(this).find(".imgw img").attr("src"),
title: $(this).find(".imgw img").attr("alt"),
like: num[0],
view: num[1],
})
});
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
})
});
/**
* 11获取详情
* 请求示例http://127.0.0.1:3000/api/index/info?url=https://m.meishij.net/html5/zuofa/douruhezidangao_1.html
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/index/info
* 请求参数:
* url: 右侧分类的url字段
*/
router.get('/index/info', function(req, res, next) {
let url = req.query.url;
let page = req.query.p || 1;
utils.GET(url,(result)=>{
const $ = cheerio.load(result);
var data= {};
if ($(".topimgw").length != 0) {
// 标题
data.title = $(".cpc_c1 h1").text()
// 作者
data.posttime = $(".cpc_c1 .posttime").text()
// 如果有视频
if ($(".topimgw .vw").length != 0) {
data.videoSrc = $(".topimgw .vw #artical_video").attr("src")
}
// 背景图
data.backImg = $(".topimgw img").attr("src");
data.Statistics = []
// 卡路里等
$(".yycardw .yyinfos .yy_left .yy_left_item").each(function (index,el){
data.Statistics.push({
title: $(this).find("strong").text(),
proportion: $(this).find(".jd").attr("style")
})
});
data.stepInfo = {
arr: [],
message: ''
};
var startIndex = 0;
// 图标步骤
$(".cpargsw .cpargs").each(function (index,el){
data.stepInfo.arr.push({
title: $(this).text(),
position: index != 3 ? startIndex+= -30 : -0
})
})
data.stepInfo.message = $(".cpdesw .cpdes").text()
data.material = {
main: [],
accessories: []
}
// 主料
$(".cpc_c3 .c_mtr_ul").eq(0).find(".c_mtr_li").each(function (index,el){
data.material.main.push({
title: $(this).find(".t").text(),
nums: $(this).find(".a").text()
})
})
// 辅料
$(".cpc_c3 .c_mtr_ul").eq(1).find(".c_mtr_li").each(function (index,el){
data.material.accessories.push({
title: $(this).find(".t1").text(),
nums: $(this).find(".a").text()
})
});
// 详细步骤
data.DetailedSteps = [];
$(".cpc_c4 .stepitem").each(function (index,el){
// 如果有成品图的话
if ($(this).find(".doneimgw").length !== 0) {
data.DetailedSteps.push({
step_title: $(this).find(".step_title").text(),
step_img: [],
step_text: null,
})
$(this).find(".doneimgw .imgset img").each(function (i,e){
data.DetailedSteps[index].step_img.push($(this).attr("src"))
})
} else {
data.DetailedSteps.push({
step_title: $(this).find(".step_title").text(),
step_img: $(this).find("img").attr("src") || null,
step_text: $(this).find(".stepdes").text(),
})
}
})
// 其他推荐
data.OtherRecommen = [];
$(".con_data_s1_list li").each(function (i,e){
data.OtherRecommen.push({
url: $(this).find("a").attr("href"),
title: $(this).find("strong").text(),
img: $(this).find("img").attr("src"),
})
})
// 相关推荐
data.RelatedRecommen = [];
$(".con_data_s2_list li").each(function (i,e){
if ($(this).find(".title").text().length !=0) {
data.RelatedRecommen.push({
title: $(this).find(".title").text(),
url: $(this).find("a").attr("href"),
view: $(this).find("span").text(),
img: $(this).find("img").attr("src"),
})
}
})
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: data
});
}
})
});
/**
* 12获取banner图下面的九宫格分类数据
* 请求示例http://127.0.0.1:3000/api/index/type
* 接口基地址http://127.0.0.1:3000/
* 请求地址:/index/type
* 请求参数:
* url: 右侧分类的url字段
* p: 页码
*/
router.get('/index/type', function(req, res, next) {
res.json({
status: 200,
message: '请求成功',
copyright: 'bmy',
result: [
{
title: '快手菜',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_shiyongfenlei_1.png',
href: 'https://m.meishij.net/fenlei/kuaishoucai/'
},
{
title: '下饭菜',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_shiyongfenlei_2.png',
href: 'https://m.meishij.net/fenlei/xiafancai/'
},
{
title: '肉食',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_shiyongfenlei_5.png',
href: 'https://m.meishij.net/fenlei/roushi/'
},
{
title: '早餐',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_sancan_1.png',
href: 'https://m.meishij.net/fenlei/zaocan/'
},
{
title: '午餐',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_sancan_2.png',
href: 'https://m.meishij.net/fenlei/wucan/'
},
{
title: '夜宵',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_sancan_5.png',
href: 'https://m.meishij.net/fenlei/yexiao/'
},
{
title: '蛋糕面包',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_hongbei_1.png',
href: 'https://m.meishij.net/fenlei/dangaomianbao/'
},
{
title: '甜品点心',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_hongbei_3.png',
href: 'https://m.meishij.net/fenlei/tianpindianxin/'
},
{
title: '热菜',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_jiachangcaipu_1.png',
href: 'https://m.meishij.net/fenlei/recai/'
},
{
title: '主食',
img: 'https://s1.c.meishij.net/images/get3/fenlei/fl_jiachangcaipu_6.png',
href: 'https://m.meishij.net/fenlei/zhushi/'
},
]
})
});
module.exports = router;

View File

@@ -0,0 +1 @@
9cb8cd2e-5dff-42f5-b442-2509e63909e2

View File

@@ -0,0 +1,29 @@
const request = require('request');
class Utils {
constructor() {
this.options = {
url: null,
headers: {
'cookie': 'UM_distinctid=1739b1d471719c-04ea6eab4bf6e1-15306653-232800-1739b1d47188c0; Hm_lvt_9c1e85b5953d1badee5da8bbd6e213ef=1597762465; utrace=3E8920170005A7B318D9C35901202D11; Hm_lvt_01dd6a7c493607e115255b7e72de5f40=1597841958; login_redirect=https%3A%2F%2Fm.meishij.net%2Fhtml5%2F; CNZZDATA5955072=cnzz_eid%3D930894285-1596031998-https%253A%252F%252Fm.meishij.net%252F%26ntime%3D1598099253; __SessHandler=7d04ddf7323eb9bbf136f48602011327; last_update_time=1598103324; MSCookieKey=0ad175324d8efd79b3762290113fc7b9.14773285; Wap_ListLastPage_Key=https%253A%252F%252Fmeishij.net%252Fhtml5%252Fzuofa%252Fjiucaihezi_201.html; Hm_lpvt_01dd6a7c493607e115255b7e72de5f40=1598103503; Hm_lvt_01dd6a7c493607e115255b7e72de5f40=1598103503; CNZZDATA1259001544=1736519043-1596031804-%7C1598104578; Hm_lpvt_01dd6a7c493607e115255b7e72de5f40=1598109846',
'referer': 'https://m.meishij.net/',
'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1',
'x-requested-with': 'XMLHttpRequest',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
}
};
}
GET(url,callback) {
this.options.url = url;
request(this.options, function (error, response, body){
if (!error && response.statusCode == 200) {
callback(body)
}
});
}
}
module.exports = new Utils()

View File

@@ -0,0 +1 @@
ef26bcb3-86a9-447a-ae76-e7363c338cff

View File

@@ -0,0 +1 @@
1132f392-7f44-4732-8be6-721f0dd5ea3a

View File

@@ -0,0 +1,84 @@
.banner {
position: relative;
}
.img_hidden {
height: 100%;
overflow: hidden;
}
.nav {
display: flex;
justify-content: space-between;
padding: 0 0.8rem;
box-sizing: border-box;
position: fixed;
width: 100%;
top: .8rem;
z-index: 999;
}
.nav .menu {
height: 1.5rem;
padding: 0 .6rem;
background: rgba(0,0,0,0.5);
border-radius: .75rem;
}
.nav .menu a p {
line-height: 1.5rem;
font-size: .7rem;
color: #fff;
}
.img_hidden{
width: 100%;
height: 380px;
}
.img_hidden img{
width: 100%;
height: 100%;
}
.content{
padding: 0px .8rem;
}
.content div p{
font-size: 14px;
color: #383838;
line-height: 25px;
padding: 12px 4px 0px;
}
.content_title{
font-size: 22px;
font-weight: 700;
color: #1b1b1b;
line-height: 1.8rem;
margin: .5rem 0px;
}
.foot{
padding: 0px .8rem;
}
.foot .footer_title{
font-size: 16px;
font-weight: 600;
color: #000;
margin-bottom: 1rem;
}
.foot .headportrait{
display: flex;
}
.foot .headportrait img{
width: 1.7rem;
height: 1.7rem;
border-radius: 100%;
margin-right: .6rem;
}
.foot .headportrait .xinxi h1{
color: #888;
font-size: 14px;
font-weight: bold;
}
.foot .headportrait .xinxi h2{
color: #bbb;
font-size: .5rem;
margin-bottom: .5rem;
}
.foot .headportrait .xinxi p{
font-size: 14px;
color: #383838;
}

View File

@@ -0,0 +1,32 @@
body,h1,h2,h3,h4,h5,h6,p,ul,li,i{
margin: 0;
padding: 0;
list-style: none;
}
a {
text-decoration: none;
}
html {
font-size: 20px
}
@media only screen and (min-width: 400px) {
html {
font-size: 21.33px !important
}
}
@media only screen and (min-width: 414px) {
html {
font-size: 22.08px !important
}
}
@media only screen and (min-width: 480px) {
html {
font-size: 25.6px !important
}
}

View File

@@ -0,0 +1,86 @@
html,body {
height: 100%;
background: #f5f5f5;
}
.header {
background: #fff;
position: fixed;
width: 100%;
height: 3.6rem;
left: 0;
top: 0;
display: flex;
align-items: center;
padding: 0 .8rem;
z-index: 999;
box-sizing: border-box;
}
.back {
background: #f5f5f5;
height: 2rem;
width: 100%;
border-radius: .2rem;
display: flex;
align-items: center;
padding-left: .8rem;
}
.back i{
color: #666;
}
.header a input {
height: 1.1rem;
width: 88%;
border: none;
background: #f5f5f5;
padding-left: .45rem;
outline: none;
}
.content{
width: 100%;
padding-left: .8rem;
padding-right: .8rem;
box-sizing: border-box;
margin-top: 4.6rem;
}
.content_list{
width: 100%;
background: #fff;
border-radius: 15px;
overflow: hidden;
}
.content_list ul li{
padding-left: 16px;
padding-top: 20px;
}
.content_list ul li a{
display: flex;
}
.content_list ul li a img{
height: 80px;
width: 112px;
border-radius: 8px;
margin-right: 10px;
}
.content_list ul li a .list_right p{
font-size: 17px;
color: #000;
}
.content_list ul li a .list_right img{
height: 12px;
width: 68px;
}
.content_list ul li a .list_right .evaluate{
display: flex;
align-items: center;
font-size: 12px;
color: #949494;
}
.content_list ul li a .list_right .evaluate i{
margin-right: 3px;
}
.content_list ul li a .list_right .evaluate span{
margin-right: 5px;
}

View File

@@ -0,0 +1,278 @@
.bar {
display: flex;
align-items: center;
background: #fff;
padding: 0 .5rem;
box-sizing: border-box;
height: 2.25rem;
position: fixed;
width: 100%;
z-index: 999;
}
.banner_swiper img {
width: 100%;
}
.content {
margin-bottom: 3rem;
padding-top: 2.5rem;
}
.icon-wode {
color: #666;
font-size: .9rem !important;
}
.bar a:nth-child(2){
width: 90%;
}
.bar a input {
width: 100%;
height: 1.5rem;
border: none;
padding-left: .95rem;
margin-left: .5rem;
background: #f1f1f4;
border-radius: 1.5rem;
font-size: .75rem;
}
.menu {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}
.menu li {
width: 20%;
text-align: center;
}
.menu img {
width: 2.5rem;
height: 2.5rem;
}
.menu p {
font-size: .6rem;
color: #666;
}
.mrsc {
margin-top: 1.6rem;
padding: 0 .8rem;
}
.pub_title{
font-size: .8rem;
font-weight: 600;
color: #999;
line-height: 1.1rem;
margin-bottom: .5rem;
}
.mrsc ul {
display: flex;
margin-bottom: .5rem;
align-items: flex-end;
}
.mrsc ul li{
position: relative;
font-size: .8rem;
margin-right: 1rem;
color: #666;
}
.mrsc ul .active::after,
.do_together_title .active::after {
content: '';
height: .3rem;
border-radius: .15rem;
width: 100%;
left: 0px;
bottom: .15rem;
background: #ff9d9b;
position: absolute;
z-index: 50;
display: block;
}
.active {
font-size: 1.4rem !important;
color: #333 !important;
}
.mrsc_list {
display: flex;
justify-content: space-between;
}
.mrsc_list .mrsc_list_item{
}
.mrsc_list img{
width: 8.35rem;
height: 11.9rem;
border-radius: .35rem;
}
.mrsc_list .tips_titles {
margin-top: .5rem;
font-size: .9rem;
font-weight: 600;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 167px;
}
.tips_text {
padding: 0 .15rem;
background: #ff8d8d;
color: #fff;
font-size: .4rem;
}
.tips {
font-size: .55rem;
color: #ff8d8d;
line-height: .7rem;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
background: #fff2f2;
border-radius: .1rem;
padding: .2rem .3rem;
}
.recommend {
margin-top: 1.6rem;
}
.recommend ul {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}
.recommend ul li {
width: 5.2rem;
box-shadow: 0px 0px .6rem rgba(0,0,0,0.1);
background: #fff;
border-radius: 1.05rem;
margin-bottom: 1rem;
}
.recommend ul li a {
display: flex;
align-items: center;
justify-content: center;
}
.recommend_active {
background: #fe9b95 !important;
box-shadow: 0px 0px .6rem rgba(255,155,149,0.5) !important;
}
.recommend_active span {
color: #fff !important;
}
.recommend ul li img{
width: .9rem;
height: .9rem;
margin-right: .2rem;
}
.recommend ul li span {
font-size: .6rem;
color: #333;
line-height: 2.1rem;
display: inline-block;
vertical-align: top;
font-weight: 600;
}
.recommend_title {
font-size: 1.25rem;
font-weight: 600;
color: #333;
line-height: 1.8rem;
margin-bottom: .8rem;
}
.do_together_title {
display: flex;
justify-content: flex-start;
position: relative;
align-items: flex-end;
}
.do_together_title li {
margin-right: 1rem;
font-size: .8rem;
color: #666;
cursor: pointer;
position: relative;
}
.do_together_content {
margin-top: .5rem;
}
.do_together_content .roll_father {
margin-bottom: .8rem;
display: none;
-webkit-column-width: 7.6rem;
-o-colum-width: 7.6rem;
-webkit-column-gap: .6rem;
-moz-column-gap: .6rem;
-o-column-gap: .6rem;
}
.showRoll {
display: block !important;
}
.do_together_item{
margin-right: 0.33rem;
border-radius: .3rem;
box-shadow: 0 .15rem .3rem rgba(0,0,0,0.1);
padding-bottom: .6rem;
margin-bottom: 0.6rem;
width: 8.45rem;
}
.roll_father .do_together_item:nth-child(2n) {
margin-right: 0 !important;
}
.item_img {
position: relative;
}
.item_padd {
padding-left: .5rem;
padding-right: .5rem;
padding-bottom: .5rem;
box-sizing: border-box;
}
.item_pa {
padding-left: .5rem;
padding-right: .5rem;
}
.item_img img {
width: 100%;
border-top-left-radius: .3rem;
border-top-right-radius: .3rem;
}
.do_together_item .tips_titles {
font-size: .8rem !important;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #333;
font-weight: 600;
}
.item_avatr {
display: flex;
justify-content: space-between;
align-items: center;
}
.avatr_left,
.avatr_view{
display: flex;
align-items: center;
}
.avatr_left img {
width: .9rem;
height: .9rem;
margin-right: .25rem;
border-radius: 100%;
}
.avatr_left span {
font-size: .45rem;
color: #666;
}
.avatr_view .icon-yanjing {
font-size: .8rem;
color: #666;
}
.avatr_view span {
font-size: .45rem;
color: #666;
margin-left: .2rem;
}

View File

@@ -0,0 +1,266 @@
body{
background: #fafafa;
}
.banner {
height: 18.75rem;
position: relative;
}
.img_hidden {
height: 100%;
overflow: hidden;
}
.nav {
display: flex;
justify-content: space-between;
padding: 0 0.8rem;
box-sizing: border-box;
position: fixed;
width: 100%;
top: .8rem;
z-index: 999;
}
.nav .menu {
height: 1.5rem;
padding: 0 .6rem;
background: rgba(0,0,0,0.5);
border-radius: .75rem;
z-index: 14565269565;
}
.nav .menu a p {
line-height: 1.5rem;
font-size: .7rem;
color: #fff;
}
.banner img{
width: 100%;
position: relative;
top: -3.3rem;
}
.info_list {
margin: .8rem;
padding: 1rem .75rem .5rem;
background: #fff;
box-sizing: border-box;
position: relative;
box-shadow: 0px 0px 1.6rem rgba(0,0,0,0.1);
border-radius: .8rem;
margin-top: -3rem;
z-index: 999;
}
.info_list .list_title{
display: flex;
justify-content: space-between;
align-items: center;
}
.info_list h1 h2{
font-size: 1.4rem;
font-weight: 700;
color: #333;
}
.info_list .list_title i{
font-size: 1.25rem;
}
.info_list .posttime{
font-size: .6rem;
color: #999;
line-height: 1rem;
display: block;
padding: .2rem 0px 0px;
border-bottom: 1px solid #f5f5f5;
padding-bottom: .5rem;
}
.ddd {
display: flex;
justify-content: space-between;
margin-top: 1rem;
}
.ddd li {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.ddd p {
font-size: .6rem;
color: #666666;
}
.ddd .i{
height: 1.5rem;
width: 1.5rem;
background-position: 0px -1.5rem;
background: url("https://st-cn.meishij.net/p2/20200221/20200221173101_145.png");
background-size: 1.5rem 7.5rem;
}
.list_text {
overflow: hidden;
height: 2.1rem;
font-weight: 400;
text-align: justify;
font-size: .7rem;
color: #999999;
line-height: 1.05rem;
margin-top: 1rem;
position: relative;
}
.list_text .more {
position: absolute;
right: 0;
bottom: 0;
padding-left: 3rem;
font-size: .7rem;
color: #5a92f5;
background-image: linear-gradient(to right,rgba(255,255,255,0.1),rgba(255,255,255,0.5),rgba(255,255,255,1),rgba(255,255,255,1),rgba(255,255,255,1),rgba(255,255,255,1));
}
.icon-houtui-copy-copy {
font-size: .6rem !important;
}
.ms {
margin-top: 1rem;
}
.ms .main{
margin-bottom: .75rem;
}
.ms .title{
margin-bottom: .35rem;
border-bottom: 1px solid rgba(0,0,0,0.05);
padding-bottom: .5rem;
}
.ms .title span {
color: #999;
font-size: .6rem;
padding-left: .3rem;
font-weight: 300;
}
.ms ul{
}
.ms ul li{
display: flex;
justify-content: space-between;
height: 1.75rem;
align-items: center;
border-bottom: 1px solid rgba(0,0,0,0.05);
}
.ms ul li span{
font-size: .7rem;
color: #999;
font-weight: 400;
}
.content {
margin-top: 1rem;
}
.content_list {}
.content_list li {
position: relative;
}
.content_list li .step{
height: 2rem;
line-height: 2rem;
color: #333;
font-size: .9rem;
font-weight: 700;
display: inline-block;
vertical-align: top;
padding: 0px 1rem 0px .75rem;
background: rgba(255,255,255,0.9);
position: absolute;
left: 0px;
top: .75rem;
border-top-right-radius: 1rem;
border-bottom-right-radius: 1rem;
z-index: 100;
}
.content_list li img{
width: 100%;
}
.content_list li p{
padding: .75rem .75rem .75rem;
box-sizing: border-box;
}
.Otherpractices{
padding-left: .8rem;
padding-right: .8rem;
box-sizing: border-box;
margin-bottom: 2.5rem;
}
.Otherpractices_title{
height: 2.5rem;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.Otherpractices_title h3{
font-weight: 600;
}
.Otherpractices_title a{
font-size: .6rem;
color: #f15e51;
}
.Otherpractices ul{
padding: 1rem .8rem;
background: #fff;
border-radius: 16px;
box-shadow: 0px 0px 32px rgba(0,0,0,0.1);
overflow: hidden;
}
.Otherpractices ul li{
margin-right: .5rem;
float: left;
text-align: center;
margin-bottom: .3rem;
}
.Otherpractices ul li:nth-child(3n){
margin-right: 0px;
}
.Otherpractices ul li img{
width: 4.85rem;
height: 4.85rem;
margin-bottom: .5rem;
border-radius: 8px;
}
.Otherpractices ul li p{
font-size: 14px;
color: #000;
}
.recommend{
padding-left: .8rem;
padding-right: .8rem;
box-sizing: border-box;
margin-bottom: 2.5rem;
}
.recommend ul{
padding: 1rem .8rem;
background: #fff;
border-radius: 16px;
box-shadow: 0px 0px 32px rgba(0,0,0,0.1);
}
.recommend ul li{
margin-bottom: .8rem;
}
.recommend ul li a{
display: flex;
}
.recommend ul li img{
width: 7.2rem;
height: 4.8rem;
border-radius: .4rem;
margin-right: .8rem;
}
.recommend ul li .recommend_left{
display: flex;
flex-direction: column;
justify-content: space-between;
}
.recommend ul li .recommend_left h3{
font-size: 17px;
color: #000;
font-weight: 400;
}
.recommend ul li .recommend_left p{
font-size: 12px;
color: #949494;
}

View File

@@ -0,0 +1,115 @@
body{
background: #f5f5f5;
}
.header{
width: 100%;
height: 7.5rem;
background: url(../img/likebeijing.png) no-repeat center;
background-size: 100% 100%;
}
.like_headportrait{
width: 300px;
padding-top: 20px;
margin: auto;
color: #fff;
font-size: 16px;
}
.toux{
width: 100%;
display: flex;
align-items: center;
}
.head_lef img{
height: 66px;
width: 66px;
border: 3px solid rgba(255,255,255,0.5);
border-radius: 100%;
margin-right: 10px;
}
.head_right span{
font-size: 12px;
}
.head_list{
display: flex;
width: 100px;
font-size: 12px;
height: 24px;
line-height: 22px;
border-radius: 16px;
border: 1px solid rgba(255,255,255,0.5);
background: rgba(255,255,255,0.2);
padding: 0px 12px;
margin-left: 82px;
}
.head_list p{
margin-right: 5px;
}
.like_list li{
width: 6.2rem;
}
.like_list li:nth-child(2) a{
border-right: 1px solid #eee;
border-left: 1px solid #eee;
}
.like_list li a{
display: flex;
align-items: center;
justify-content: center;
margin: 10px 0px;
}
.like_list li a p{
color: #ff4c35;
}
.like_list li a{
font-size: 14px;
color: #999;
}
.information li{
padding: 0 .8rem;
box-sizing: border-box;
width: 100%;
height: 44px;
background: #fff;
border-bottom: 1px solid #f5f5f5;
}
.information li a{
height: 100%;
justify-content: space-between;
display: flex;
align-items: center;
}
.information li .information_left {
display: flex;
align-items: center;
font-size: 16px;
color: #333;
}
.information li .information_left img{
width: 1.35rem;
height: 1.35rem;
margin-right: .5rem;
}
.information li .information_right{
display: flex;
align-items: center;
}
.information li .information_right p{
font-size: 12px;
color: #ff4c35;
margin-right: 10px;
}
.information li .information_right span{
font-size: 20px;
color: #666;
}
.information li:nth-child(2){
margin-top: .5rem;
}
.information li:nth-child(3){
margin-top: .5rem;
}

View File

@@ -0,0 +1,112 @@
.header{
position: fixed;
display: flex;
justify-content: space-between;
width: 100%;
height: 2.25rem;
background: #fff;
padding: 0px .8rem;
box-sizing: border-box;
align-items: center;
border-bottom: 1px solid #f5f5f5;
z-index: 999;
overflow: hidden;
}
.back a{
font-size: .75rem;
color: #333;
}
.header p{
font-size: .9rem;
color: #000;
font-weight: 600;
}
html,body{
height: 100%;
}
.content{
height: 100%;
scroll-padding-left: .8rem;
scroll-padding-right: .8rem;
padding-top: 3.2rem;
padding-bottom: 3.2rem;
}
.content ul{
padding-left: .8rem;
padding-right: .8rem;
box-sizing: border-box;
}
.content ul li{
position: relative;
width: 8.05rem;
float: left;
margin-right: 1rem;
margin-bottom: .5rem;
text-align: center;
}
.content ul li:nth-child(2n){
margin-right: 0px;
}
.content li a{
width: 100%;
}
.content li a img{
width: 8.05rem;
height: 10.75rem;
border-radius: .4rem;
}
.content li p{
font-size: .8rem;
color: #000;
}
.content li .clear{
position: absolute;
width: 3rem;
height: 1.5rem;
background: #00000063;
top: 10px;
right: 10px;
}
.content li .clear p{
text-align: center;
line-height: 30px;
font-size: 17px;
color: red;
}
.shadow{
width: 100%;
height: 100%;
position: fixed;
z-index: 9999;
top: 0;
background: #00000073;
display: none;
}
.actionsheet{
position: fixed;
bottom: 0;
width: 100%;
box-sizing: border-box;
padding: 0 .8rem;
}
.cancel{
width: 100%;
height: 2.2rem;
border-radius: .4rem;
text-align: center;
line-height: 2.2rem;
color: #000;
background: #fff;
}
.delete{
margin-top: 10px;
width: 100%;
height: 2.2rem;
border-radius: .4rem;
text-align: center;
line-height: 2.2rem;
color: red;
background: #fff;
}

View File

@@ -0,0 +1,57 @@
.header{
display: flex;
align-items: center;
position: fixed;
width: 100%;
height: 2.25rem;
background: #fff;
padding: 0px .8rem;
box-sizing: border-box;
border-bottom: 1px solid #f5f5f5;
z-index: 999;
overflow: hidden;
}
.header p{
font-size: .9rem;
color: #000;
font-weight: 600;
margin: 0 auto;
}
.content{
width: 100%;
padding-top: 2.75rem;
}
.content li{
width: 100%;
padding-left: .8rem;
padding-right: .8rem;
border-bottom: 1px solid rgba(0,0,0,0.05);
box-sizing: border-box;
margin-bottom: .5rem;
}
.content li a .menu_title{
display: flex;
justify-content: space-between;
height: 2.2rem;
align-items: center;
}
.content li a .menu_title h3{
font-size: .9rem;
font-weight: 600;
color: #000000;
}
.content li a .menu_title p{
font-size: .7rem;
color: #999;
font-weight: 300;
}
.content li a .menu_pic{
display: flex;
justify-content: space-between;
padding-bottom: 1rem;
}
.content li a .menu_pic img{
width: 5.4rem;
height: 5.4rem;
}

View File

@@ -0,0 +1,33 @@
.padding {
padding: 0 .8rem;
}
.footer {
position: fixed;
width: 100%;
height: 2.5rem;
background: #fff;
display: flex;
justify-content: space-around;
align-items: center;
left: 0;
bottom: 0;
z-index: 999;
}
.footer a {
display: flex;
flex-direction: column;
text-align: center;
}
.footer a img {
width: 1.4rem;
height: 1.4rem;
}
.footer a p {
font-size: .6rem;
color: #666;
}
.footer a .jihuo{
color: #f15a4f;
}

View File

@@ -0,0 +1,86 @@
.header{
position: fixed;
display: flex;
justify-content: space-between;
width: 100%;
height: 2.25rem;
background: #fff;
padding: 0px .8rem;
box-sizing: border-box;
align-items: center;
border-bottom: 1px solid #f5f5f5;
z-index: 999;
overflow: hidden;
}
.header a{
width: 2.5rem;
height: 1.5rem;
background: #ff4c39;
text-align: center;
border-radius: .1rem;
}
.header a span{
color: #fff;
font-size: .7rem;
line-height: 1.5rem;
}
.header input{
padding-left: .95rem;
width: 60%;
height: 1.5rem;
background: #eee;
color: #333;
font-size: .7rem;
display: block;
line-height: 1.2rem;
border: 0px;
outline: none;
}
.header p{
width: 2.5rem;
height: 1.5rem;
background: #ff4c39;
border-radius: .1rem;
color: #fff;
font-size: .7rem;
box-sizing: border-box;
line-height: 1.5rem;
text-align: center;
}
.content{
padding-top: 2.25rem;
}
.content ul{}
.content ul li{
height: 5.5rem;
border-bottom: 1px solid #ccc;
padding: .8rem;
box-sizing: border-box;
}
.content ul li a{
width: 100%;
height: 100%;
display: flex;
align-items: center;
}
.content ul li a .img{
width: 6rem;
height: 4rem;
position: relative;
overflow: hidden;
margin-right: .5rem;
}
.content ul li a .img img{
display: block;
width: 100%;
margin-top: -1rem;
}
.content ul li a .name h3{
font-size: .9rem;
color: #333;
padding-bottom: 1.75rem;
}
.content ul li a .name p{
font-size: .7rem;
color: #999;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,92 @@
html,body {
height: 100%;
}
.header {
position: fixed;
width: 100%;
height: 3.6rem;
left: 0;
top: 0;
display: flex;
align-items: center;
padding: 0 .8rem;
box-sizing: border-box;
}
.back {
background: #f5f5f5;
height: 2rem;
width: 100%;
border-radius: .2rem;
display: flex;
align-items: center;
padding-left: .8rem;
}
.back i{
color: #666;
}
.header input {
height: 1.1rem;
width: 88%;
border: none;
background: #f5f5f5;
padding-left: .45rem;
outline: none;
}
.content {
height: calc(100% - 3.6rem);
padding-top: 3.6rem;
}
.left_menu {
width: 4rem;
height: 100%;
float: left;
overflow-y: scroll;
background: #f5f5f5;
}
.active_menu {
background: #fff !important;
}
.left_menu .img {
margin: 0 auto;
height: 25px;
width: 25px;
background: url("https://s1.st.meishij.net/p2/20191108/20191108113258_481.png");
background-position: 0 0;
background-size: 25px 500px;
}
.left_menu li {
height: 70px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.left_menu li p{
font-size: .6rem;
color: #333;
margin-top: 4px;
}
.right_content {
width: calc(100% - 4rem);
height: 100%;
float: left;
overflow-y: scroll;
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
align-content: baseline;
}
.right_content li {
width: 33%;
height: 4.5rem;
text-align: center;
}
.right_content li img{
width: 3.1rem;
height: 3.1rem;
}
.right_content li p{
font-size: .6rem;
color: #333;
}

View File

@@ -0,0 +1,116 @@
.header{
position: fixed;
display: flex;
justify-content: space-between;
width: 100%;
height: 2.25rem;
background: #fff;
padding: 0px .8rem;
box-sizing: border-box;
align-items: center;
border-bottom: 1px solid #f5f5f5;
z-index: 999;
overflow: hidden;
}
.back a{
font-size: .75rem;
color: #333;
}
.back a i{
font-weight: 600;
}
.header p{
font-size: .9rem;
color: #000;
font-weight: 600;
}
.header .icon-sousuo{
font-size: 1.25rem;
}
.content{
padding-top: 2.2rem;
padding-left: .8rem;
padding-right: .8rem;
box-sizing: border-box;
}
.content li{
float: left;
margin-top: .8rem;
width: 8.3rem;
box-shadow: 0 .15rem .3rem rgba(0,0,0,0.1);
border-radius: .35rem;
}
.content li:nth-child(2n){
margin-left: .5rem;
}
.content li a .content_pic{
width: 8.3rem;
height: 11.1rem;
background-image: url(https://st-cn.meishij.net/p2/20181105/20181105110641_22213.jpg);
position: relative;
overflow: hidden;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
border-radius: .35rem;
}
.content li a .content_pic .pic_yingyin{
width: 1rem;
height: 1rem;
position: absolute;
top: .25rem;
right: .5rem;
text-align: center;
line-height: 1rem;
background: #00000085;
border-radius: 100%;
}
.content li a .content_pic .pic_yingyin .icon-play{
font-size: .6rem;
color: #fff;
position: absolute;
top: 0;
left: .25rem;
}
.content li a p{
margin: .5rem .5rem 0 .5rem;
font-size: 16px;
color: #333;
font-weight: 600;
}
.pic_pinglun{
margin: 1rem .5rem 0 .5rem;
padding-bottom: .5rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.pic_pinglun .toux_left{
display: flex;
align-items: center;
}
.pic_pinglun .toux_left img{
width: .9rem;
height: .9rem;
border-radius: 100%;
}
.pic_pinglun .toux_left span{
font-size: .45rem;
color: #666;
margin-left: 5px;
}
.pic_pinglun .toux_right{
display: flex;
align-items: center;
}
.pic_pinglun .toux_right .icon-faxian{
font-size: .6rem;
color: #666;
}
.pic_pinglun .toux_right span{
font-size: .45rem;
color: #666;
}

View File

@@ -0,0 +1,38 @@
.banner {
position: relative;
}
.img_hidden {
height: 100%;
overflow: hidden;
}
.nav {
display: flex;
justify-content: space-between;
padding: 0 0.8rem;
box-sizing: border-box;
position: fixed;
width: 100%;
top: .8rem;
z-index: 999;
}
.nav .menu {
height: 1.5rem;
padding: 0 .6rem;
background: rgba(0,0,0,0.5);
border-radius: .75rem;
}
.nav .menu a p {
line-height: 1.5rem;
font-size: .7rem;
color: #fff;
}
.banner video{
width: 100%;
}
.conten{
padding: 0px .8rem;
}
.conten h1{
font-weight: 700;
margin-bottom: 1rem;
}

View File

@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./css/swiper-bundle.min.css">
<style>
img {
width: 100%;
}
</style>
</head>
<body>
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<img src="https://st-cn.meishij.net/p2/20200821/20200821114050_119.png" alt="">
</div>
<div class="swiper-slide">
<img src="https://st-cn.meishij.net/p2/20200820/20200820222119_267.jpg" alt="">
</div>
<div class="swiper-slide">
<img src="https://st-cn.meishij.net/p2/20200818/20200818225021_199.jpg" alt="">
</div>
</div>
<!-- 如果需要分页器 -->
<div class="swiper-pagination"></div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<!-- 如果需要滚动条 -->
<div class="swiper-scrollbar"></div>
</div>
</body>
<script src="./js/swiper-bundle.min.js"></script>
<script src="../js/less.min.js" type="text/javascript"></script>
<script> var mySwiper = new Swiper('.swiper-container', {
direction: 'horizontal',
loop: true,
// 如果需要分页器
pagination: {
el: '.swiper-pagination',
},
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
// 如果需要滚动条
scrollbar: {
el: '.swiper-scrollbar',
},
})
</script>
</html>

View File

@@ -0,0 +1 @@
ff1d2d4e-8c2d-49ac-b61c-b94cc04fd595

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
<defs>
<font id="ratchicons" horiz-adv-x="1000" >
<font-face font-family="ratchicons" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
<missing-glyph horiz-adv-x="1000" />
<glyph glyph-name="and-caret" unicode="&#xe800;" d="m313 225l375 0v376" horiz-adv-x="1000" />
<glyph glyph-name="up-nav" unicode="&#xe81f;" d="m65 146l81-83l354 372l353-372l81 83l-434 456l-435-456z" horiz-adv-x="1000" />
<glyph glyph-name="and-download" unicode="&#xe802;" d="m875 38h-750v62h750v-62z m-312 375v250h-125v-250h-125l187-250l188 250h-125z" horiz-adv-x="1000" />
<glyph glyph-name="and-left" unicode="&#xe803;" d="m306 349l325 373l67-59l-273-314l273-315l-67-59l-325 373l0 1z" horiz-adv-x="1000" />
<glyph glyph-name="and-more-vertical" unicode="&#xe804;" d="m406-25v188h188v-188h-188z m0 563h188v188h-188v-188z m188-281v188h-188v-188h188z" horiz-adv-x="1000" />
<glyph glyph-name="and-more" unicode="&#xe805;" d="m125 444h188v-187h-188v187z m563 0v-187h187v187h-187z m-281-187h187v187h-187v-187z" horiz-adv-x="1000" />
<glyph glyph-name="and-right" unicode="&#xe806;" d="m698 348l-325-373l-67 59l274 315l-274 314l68 59l324-373l0-1z" horiz-adv-x="1000" />
<glyph glyph-name="and-search" unicode="&#xe807;" d="m928 51l-167 167c-17 17-47 15-66-4l-3-3l-69 69c42 54 67 121 67 194c0 173-140 313-314 313s-313-140-313-313s140-314 313-314c71 0 137 24 190 64l69-70c-18-19-19-48-2-65l166-166c17-17 47-16 66 4l59 58c19 19 21 49 4 66z m-801 423c0 137 112 249 249 249s249-112 249-249s-111-249-249-249s-249 111-249 249z" horiz-adv-x="1000" />
<glyph glyph-name="and-share" unicode="&#xe808;" d="m728 215c-33 0-63-14-84-36l-263 153c1 6 2 12 2 18c0 6-1 12-2 18l263 152c21-23 51-37 84-37c62 0 113 51 113 113s-51 114-113 114s-114-51-114-114c0-7 1-14 2-21l-261-150c-21 23-51 38-85 38c-63 0-114-50-114-113s51-113 114-113c33 0 64 15 85 38l261-151c-1-7-2-14-2-22c0-62 51-113 114-113s113 51 113 113s-51 113-113 113z" horiz-adv-x="1000" />
<glyph glyph-name="and-up" unicode="&#xe809;" d="m500 548l374-325l-59-67l-315 273l-314-273l-59 67l373 325l0 0z" horiz-adv-x="1000" />
<glyph glyph-name="back" unicode="&#xe80a;" d="m500 174l-313 176l313 176m312-352l-312 176l312 176" horiz-adv-x="1000" />
<glyph glyph-name="down" unicode="&#xe820;" d="m941 479l-124 127l-317-315l-318 315l-124-127l442-441l441 441z" horiz-adv-x="1000" />
<glyph glyph-name="gear" unicode="&#xe821;" d="m820 274l118 40l0 72l-118 40c-8 34-22 67-40 97l55 111l-51 51l-111-55c-30 18-62 32-97 40l-39 118l-73 0l-40-118c-34-8-67-22-97-40l-111 55l-51-51l55-111c-18-30-32-62-40-97l-117-39l0-73l117-40c9-34 22-67 41-96l-56-111l52-52l111 56c29-19 62-32 96-40l40-119l73 0l39 119c35 8 67 21 97 40l111-56l51 52l-55 111c18 29 32 62 40 96z m-320-174c-139 0-251 112-251 251s112 250 251 250s250-112 250-250s-112-251-250-251z" horiz-adv-x="1000" />
<glyph glyph-name="left" unicode="&#xe822;" d="m628-91l127 123l-314 318l314 318l-127 124l-441-442l441-441z" horiz-adv-x="1000" />
<glyph glyph-name="list" unicode="&#xe823;" d="m1000 632h-750v-62l750-1v63z m0-314v63h-750v-63h750z m-750-187v-61h750v61h-750z m-250 406l125 1v125l-125 0v-126z m0-249h125v125h-125v-125z m0-250h125v125h-125v-125z" horiz-adv-x="1000" />
<glyph glyph-name="pages" unicode="&#xe824;" d="m63 601v-689h687l0 688l-687 1z m625-63v-563h-563v563h563z m-500 250v-125h62v62h625v-625l-62 0v-62h125v750h-750z" horiz-adv-x="1000" />
<glyph glyph-name="refresh" unicode="&#xe825;" d="m813 288c-28-145-161-250-313-250c-172 0-312 139-312 312c0 173 141 312 312 313v-98l221 129l-221 128v-95c0-2 0-2 0-2c-206 0-375-167-375-375s169-375 375-375c187 0 347 133 375 313h-62z" horiz-adv-x="1000" />
<glyph glyph-name="right" unicode="&#xe826;" d="m372 792l-127-124l314-318l-314-318l127-123l441 441l-441 442z" horiz-adv-x="1000" />
<glyph glyph-name="sound" unicode="&#xe827;" d="m825-22c-2 0-3 0-5 0l-16 7c0 0 0 0 0 1c-5 1-8 3-10 6c-1 3-1 7 1 12c1 1 22 40 43 101c20 58 44 147 44 244c0 98-24 186-44 243c-21 61-42 100-43 102c-4 11-2 15 8 21l17 8c2 1 5 2 7 2c7 0 12-5 17-16c1-2 2-4 4-8c10-19 32-63 52-125c25-78 37-156 37-232c0-94-24-182-44-240c-22-63-44-104-45-104l-1-2c-5-11-9-20-22-20c0 0 0 0 0 0z m-574 248c0 0-1 0-1 0h-186v248h186c0 0 1 0 1 0l248 173v-595l-248 174z m474-124c-2 0-4 0-6 0l-16 8c0 0 0 0 0 0c-5 1-8 3-9 6c-2 3-2 7 0 12c1 1 16 26 30 64c14 37 30 94 30 157c0 65-16 121-30 157c-14 38-29 62-30 63c-4 11-2 15 9 21l15 8c3 1 5 2 8 2c6 0 12-5 17-16c1-3 3-6 5-11c17-31 61-115 61-229c0-63-16-120-30-156c-16-39-31-64-31-64c0 0 0 0 0 0l-1-2c-6-11-10-20-22-20c0 0 0 0 0 0z m-84 127c-2 0-4 0-6 0l-15 7c0 1 0 1 0 1c-5 1-8 3-9 6c-2 3-2 7 0 12c0 0 20 43 20 94c0 53-20 91-21 93c-4 11-2 16 9 21l15 8c3 1 5 2 8 2c6 0 12-5 17-16c1-3 3-6 4-9c10-19 23-45 23-104c0-33-21-91-22-93l-1-2c-6-11-10-20-22-20c0 0 0 0 0 0z" horiz-adv-x="1000" />
<glyph glyph-name="sound2" unicode="&#xe828;" d="m251 226c0 0-1 0-1 0h-186v248h186c0 0 1 0 1 0l248 173v-595l-248 174z m474-124c-2 0-4 0-6 0l-16 8c0 0 0 0 0 0c-5 1-8 3-9 6c-2 3-2 7 0 12c1 1 16 26 30 64c14 37 30 94 30 157c0 65-16 121-30 157c-14 38-29 62-30 63c-4 11-2 15 9 21l15 8c3 1 5 2 8 2c6 0 12-5 17-16c1-3 3-6 5-11c17-31 61-115 61-229c0-63-16-120-30-156c-16-39-31-64-31-64c0 0 0 0 0 0l-1-2c-6-11-10-20-22-20c0 0 0 0 0 0z m-84 127c-2 0-4 0-6 0l-15 7c0 1 0 1 0 1c-5 1-8 3-9 6c-2 3-2 7 0 12c0 0 20 43 20 94c0 53-20 91-21 93c-4 11-2 16 9 21l15 8c3 1 5 2 8 2c6 0 12-5 17-16c1-3 3-6 4-9c10-19 23-45 23-104c0-33-21-91-22-93l-1-2c-6-11-10-20-22-20c0 0 0 0 0 0z" horiz-adv-x="1000" />
<glyph glyph-name="sound3" unicode="&#xe80b;" d="m251 226c0 0-1 0-1 0h-186v248h186c0 0 1 0 1 0l248 173v-595l-248 174z m390 3c-2 0-4 0-6 0l-15 7c0 1 0 1 0 1c-5 1-8 3-9 6c-2 3-2 7 0 12c0 0 20 43 20 94c0 53-20 91-21 93c-4 11-2 16 9 21l15 8c3 1 5 2 8 2c6 0 12-5 17-16c1-3 3-6 4-9c10-19 23-45 23-104c0-33-21-91-22-93l-1-2c-6-11-10-20-22-20c0 0 0 0 0 0z" horiz-adv-x="1000" />
<glyph glyph-name="sound4" unicode="&#xe80c;" d="m251 226c0 0-1 0-1 0h-186v248h186c0 0 1 0 1 0l248 173v-595l-248 174z" horiz-adv-x="1000" />
<glyph glyph-name="up" unicode="&#xe80d;" d="m58 222l124-126l318 314l317-314l124 126l-441 441l-442-441z" horiz-adv-x="1000" />
<glyph glyph-name="bars" unicode="&#xe80e;" d="m875 632h-750v-62l750-1l0 63l0 0z m0-314v63h-750v-63h750z m-750-187v-61h750v61h-750z" horiz-adv-x="1000" />
<glyph glyph-name="caret" unicode="&#xe80f;" d="m438 475h-125l187-250l188 250h-125" horiz-adv-x="1000" />
<glyph glyph-name="and-down" unicode="&#xe801;" d="m500 156l-373 325l59 67l314-273l315 273l59-67l-374-325l0 0z" horiz-adv-x="1000" />
<glyph glyph-name="close" unicode="&#xe811;" d="m213 593l530-530l43 44l-529 530l-44-44l0 0z m530 44l-530-530l43-44l531 530l-44 44l0 0z" horiz-adv-x="1000" />
<glyph glyph-name="code" unicode="&#xe812;" d="m680 608l-74-72l184-186l-184-185l74-73l257 258l-257 258z m-360-516l74 72l-184 186l184 186l-74 72l-258-258l258-258z" horiz-adv-x="1000" />
<glyph glyph-name="compose" unicode="&#xe813;" d="m890 651l-405-404l-110-22l22 110l404 405l17-17l-405-404l56-56l404 405l17-17z m15 16l20 20c14 13 14 35 0 48l-40 40c-13 14-35 14-48 0l-20-20m-4-272v-445h-625v625h440l63 62h-566v-750h750v570l-62-62z" horiz-adv-x="1000" />
<glyph glyph-name="down-nav" unicode="&#xe814;" d="m934 537l-81 83l-354-372l-353 372l-81-83l435-455l434 455z" horiz-adv-x="1000" />
<glyph glyph-name="download" unicode="&#xe815;" d="m875 538h-187v-63h125v-500h-625v500h125v63h-188v-626h750v626z m-344-323v635l-62 0v-635l-115 112l-41-39l187-188l188 188l-42 40l-115-113z" horiz-adv-x="1000" />
<glyph glyph-name="edit" unicode="&#xe829;" d="m749 511l-404-404l-110-22l22 110l404 404l16-16l-404-405l56-55l404 404l16-16z m16 16l20 20c14 13 14 35 0 48l-40 40c-13 14-35 14-48 0l-20-20" horiz-adv-x="1000" />
<glyph glyph-name="forward" unicode="&#xe82a;" d="m500 526l313-176l-313-176m-312 352l312-176l-312-176" horiz-adv-x="1000" />
<glyph glyph-name="home" unicode="&#xe82b;" d="m939 350l-438 438l0 0l0 0l-438-438l48-47l54 54v-444h16h51h168h47h109h46h168h55h12v444l54-54l48 47z m-501-370v245h125v-245h-125z m332 444v-444h-161v291h-16h-30h-125h-34h-12v-291h-160v444h0l269 269l269-269h0z" horiz-adv-x="1000" />
<glyph glyph-name="info" unicode="&#xe82c;" d="m500 725c-207 0-375-168-375-375s168-375 375-375s375 168 375 375s-168 375-375 375z m63-625h-125v313h125v-313z m-63 375c-34 0-62 28-62 63c0 34 28 62 62 62s63-28 63-62c0-35-28-63-63-63z" horiz-adv-x="1000" />
<glyph glyph-name="left-nav" unicode="&#xe82d;" d="m663-84l83 81l-372 354l372 354l-83 81l-455-435l455-435z" horiz-adv-x="1000" />
<glyph glyph-name="more-vertical" unicode="&#xe82e;" d="m500 163c52 0 94-42 94-94c0-52-42-94-94-94s-94 42-94 94c0 52 42 94 94 94z m-94 468c0-51 42-93 94-93s94 42 94 93s-42 94-94 94s-94-42-94-94z m0-281c0-52 42-94 94-94s94 42 94 94s-42 94-94 94s-94-42-94-94z" horiz-adv-x="1000" />
<glyph glyph-name="more" unicode="&#xe82f;" d="m313 350c0-52-42-94-94-94s-94 42-94 94s42 94 94 94s94-42 94-94z m468 94c-52 0-93-42-93-94s41-94 93-94s94 42 94 94s-42 94-94 94z m-281 0c-52 0-94-42-94-94c0-52 42-94 94-94s94 42 94 94c0 52-42 94-94 94z" horiz-adv-x="1000" />
<glyph glyph-name="pause" unicode="&#xe830;" d="m438 37h-188v625h188v-625z m312 1h-187v625h187v-625z" horiz-adv-x="1000" />
<glyph glyph-name="person" unicode="&#xe832;" d="m501 847c-275 0-497-222-497-497s222-496 497-496s496 222 496 496s-222 497-496 497z m315-801c-25 11-53 26-79 28c-149 12-152 43-152 106c0 47 30 8 52 118c8 36 15 29 36 95c13 47-12 41-12 41s8 35 12 72c10 96-32 187-175 187c-64 0-94-27-133-57c-41-32-55-76-44-130c7-39 21-77 12-72c0 0-22 6-12-41c21-59 32-59 38-95c18-107 47-70 53-118c6-63-7-94-148-106c-25-2-55-16-79-27c-76 79-123 186-123 303c0 242 197 439 439 439s438-197 438-439c0-118-47-226-123-304z" horiz-adv-x="1000" />
<glyph glyph-name="play" unicode="&#xe816;" d="m250 663l567-313l-567-312" horiz-adv-x="1000" />
<glyph glyph-name="plus" unicode="&#xe817;" d="m469 725v-750h61l1 750l-62 0l0 0z m406-344h-750v-61l750-1l0 62l0 0z" horiz-adv-x="1000" />
<glyph glyph-name="right-nav" unicode="&#xe818;" d="m291 786l-83-81l372-354l-372-354l83-81l455 435l-455 435z" horiz-adv-x="1000" />
<glyph glyph-name="search" unicode="&#xe819;" d="m935-10l-279 279c39 54 62 120 62 191c0 181-147 328-328 328s-327-147-327-328s147-327 327-327c71 0 136 22 190 61l279-280l76 76z m-808 470c0 146 118 263 263 263s264-117 264-263s-118-263-264-263s-263 118-263 263z" horiz-adv-x="1000" />
<glyph glyph-name="share" unicode="&#xe81a;" d="m875 538h-187v-63h125v-500h-625v500h125v63h-188v-626h750v626z m-406 197v-572h62v572l115-112l42 40l-188 187l-187-187l41-41l115 113z" horiz-adv-x="1000" />
<glyph glyph-name="star-filled" unicode="&#xe81b;" d="m500 812l116-354l371 0l-300-218l115-353l-301 218l-300-218l114 353l-300 218l371 0l114 354z" horiz-adv-x="1000" />
<glyph glyph-name="star" unicode="&#xe81c;" d="m987 458l-372 0l-115 354l-114-354l-371 0l301-218l-115-353l301 218l299-218l-115 353l301 218z m-252-478l-234 174l-234-174l99 274l-252 171l295 0l92 290l91-290l296 0l-253-175l100-270z" horiz-adv-x="1000" />
<glyph glyph-name="stop" unicode="&#xe81d;" d="m812 37h-625v625h625v-625z" horiz-adv-x="1000" />
<glyph glyph-name="trash" unicode="&#xe81e;" d="m875 725h-250c0 22 0 50 0 62c0 18-15 34-34 34h-182c-19 0-34-16-34-34c0-14 0-41 0-62h-250v-63h69l57-715c0-19 16-34 34-34h432c19 0 34 15 34 34l58 715h66v63z m-459 33c0 14 11 25 24 25h120c13 0 24-11 24-25c0-6 0-20 0-33h-168c0 12 0 26 0 33z m287-757c0-15-11-26-26-26h-355c-14 0-25 11-25 26l-42 661h490l-42-661z m-273 37h-47l-39 562l46 0l40-562z m187 0l-46 0l39 562l47 0l-40-562z m-94 0h-47v562h47v-562z" horiz-adv-x="1000" />
<glyph glyph-name="check" unicode="&#xe810;" d="m857 537l-81 83l-354-372l-135 128l-81-83l216-211l435 455z" horiz-adv-x="1000" />
</font>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
48a0690a-7b12-43b3-919f-73fe5b598d80

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.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: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1 @@
74b4dba3-856d-4dc2-9442-162049334bd9

View File

@@ -0,0 +1 @@
05806f36-cac1-4a03-9646-80afb0b98b10

View File

@@ -0,0 +1,20 @@
var Config = {
// 开发阶段测试基地址
BaseUrl: 'http://127.0.0.1:3000/api',
// 上线阶段的正式基地址
// BaseUrl: 'http://xxx.com/aaaa/api',
apiUrl: {
bannerIndex: '/index/banner', // 获取banner列表接口
bannerInfo: '/index/bannerInfo', // 获取banner详情接口
threeMeals: '/index/threeMeals', // 每日三餐接口
type: '/index/type', // 九宫格菜单
indexClass: '/index/class', // 大家都在做接口
Foodrecipes:'/video/list',//美食视频
leftMenu:'/type/leftMenu',//分类左边的小类
rightMenu: '/type/rightMenu', // 右边接口
rightMenuList: '/type/rightMenuList', // 点击右边小分类获取分类列表
indexInfo: '/index/info',//详情页面
BanerInfo: '/index/bannerInfo',//banner详情页面
search:'/search/list',//搜索接口
}
}

View File

@@ -0,0 +1 @@
b7260bde-637b-451b-b883-0f65c005233c

View File

@@ -0,0 +1,23 @@
class Banerinfo {
constructor() {
this.bannerinfoMenu();
}
async bannerinfoMenu() {
let res = await Banerservice.BanerInfo({
url: GetQueryString("url"),
});
console.log(res);
$(".img_hidden img").attr("src", res.banner)
$(".content .content_title").text(res.title)
$(".content").append(`${res.content}`)
$(".goodsitem").remove()
$(".headportrait").attr("src", res.comment.img)
$(".content .content_title").text(res.comment.name)
$(".content .content_title").text(res.comment.time)
$(".content .content_title").text(res.comment.content)
}
}
new Banerinfo()

View File

@@ -0,0 +1,49 @@
class ListService {
constructor(props) {
this.page = 1
this.list()
this.scrollLoadData()
}
async list() {
let res = await listervice.rightMenuList({
url: GetQueryString("url"),
p: this.page
});
res.forEach((v,i)=>{
$(".content .content_list ul").append(`
<li>
<a href="info.html?url=${v.url}">
<img src="${v.img}" alt="">
<div class="list_right">
<p>${v.title}</p>
<img src="../img/xingxing.png" alt="">
<div class="evaluate">
<i class="iconfont icon-xin"></i>
<span>${v.like}</span>
<i class="iconfont icon-faxian"></i>
<span>${v.view}</span>
</div>
</div>
</a>
</li>
`)
})
}
scrollLoadData() {
var scroll = new auiScroll({
listen: true,
distance: 10 //判断到达底部的距离isToBottom为true
}, (ret) => {
if(ret.isToBottom){
this.page += 1;
this.list()
}
});
}
}
new ListService()

View File

@@ -0,0 +1,259 @@
class Index {
constructor() {
this.index = 0;
this.doTogetherData = [
{
type: 1,
title: '推荐',
content: [],
page: 1
},
{
type: 2,
title: '时令',
content: [],
page: 1
},
{
type: 3,
title: '食肉',
content: [],
page: 1
},
{
type: 4,
title: '素食',
content: [],
page: 1
},
{
type: 5,
title: '烘焙',
content: [],
page: 1
}
];
this.getBannerList();
this.renderMenu();
this.getThreeMeals();
this.renderDoTogether();
this.DoTogether();
this.scrollLoadData();
}
/**
* 获取轮播图列表
*/
async getBannerList() {
var banner = $(".banner_swiper .swiper-wrapper");
let res = await indexService.bannerIndex({ id: 1 });
res.forEach((val,index) => {
banner.append(`
<div class="swiper-slide">
<a href="./bannerinfo.html?url=${val.url}">
<img src="${val.img}" alt=""/>
</a>
</div>
`)
});
this.initBannerSwiper();
}
// 初始化banner轮播图
initBannerSwiper() {
var mySwiper = new Swiper('.banner_swiper', {
direction: 'horizontal',
loop: true,
// 如果需要分页器
pagination: {
el: '.swiper-pagination',
}
})
}
async getThreeMeals() {
var mrscUl = $(".mrsc ul");
var mrscSwiper = $(".mrsc_swiper .swiper-wrapper");
let res = await indexService.threeMeals({});
console.log(res)
res.forEach((val,index)=>{
mrscUl.append(`
<li class="${index==0? 'active': ''}">${val.title}</li>
`)
mrscSwiper.append(
`
<div class="swiper-slide">
<div class="mrsc_list">
</div>
</div>
`
);
val.content.forEach((v,i)=>{
$(".mrsc_swiper .swiper-wrapper .mrsc_list")
.eq(index).append(
` <a href="./info.html?url=${v.url}">
<div class="mrsc_list_item">
<img src="${v.img}" alt="">
<p class="tips_titles">${v.title}</p>
<span class="tips_text">养</span>
<p class="tips">${v.des}</p>
</div>
</a>
`
);
})
});
this.initMrsc()
}
initMrsc() {
var MrscUl = $(".mrsc ul li");
var MrscSwiper = new Swiper('.mrsc_swiper', {
direction: 'horizontal',
on: {
slideChangeTransitionEnd: function(){
console.log(this.activeIndex);
MrscUl.eq(this.activeIndex).addClass("active").siblings().removeClass("active")
},
},
});
MrscUl.each(function(i,e) {
$(this).on("click", function() {
MrscSwiper.slideTo(i)
});
});
}
async renderMenu() {
let res = await indexService.type({});
console.log(res)
res.forEach((v,i)=>{
$(".menu").append(`
<li>
<a href="./fllist.html?url=${v.href}">
<img src="${v.img}" alt="">
<p>${v.title}</p>
</a>
</li>
`)
})
}
/**
* 渲染内容的
* @returns {Promise<void>}
* @constructor
*/
async DoTogether() {
let res = await indexService.indexClass({
type: this.doTogetherData[this.index].type,
page: this.doTogetherData[this.index].page
});
this.doTogetherData[this.index].content
= [ ...this.doTogetherData[this.index].content, ...res.items ]
$(".do_together_content .roll_father").eq(this.index).empty()
// 渲染列表的
this.doTogetherData[this.index].content.forEach((v,i)=>{
$(".do_together_content .roll_father").eq(this.index).append(`
<div class="do_together_item"
style="height: ${ typeof v.img == 'string' ? 'auto' : '12rem !important' }">
<a href="info.html?url=${v.path}">
<div class="item_img">
${
typeof v.img == 'string'
? `<img src="${v.img}" alt="">`
: `<img src="${v.img[0]}" alt="">`
}
</div>
<div class="item_padd">
<div class="tips_titles">${v.title}</div>
<span class="tips_text">养</span>
${
v.label == null || v.label.length == 0
? ''
: `<p class="tips">${v.label.desc}</p>`
}
</div>
${
v.author.hasOwnProperty("avatar_url")
? `<div class="item_avatr item_pa">
<div class="avatr_left">
<img src="${v.author.avatar_url}" alt="">
<span>${v.author.nickname}</span>
</div>
<div class="avatr_view">
<i class="iconfont icon-yanjing"></i>
<span>${v.viewed_amount}</span>
</div>
</div>`
: ''
}
</div>
</a>
`)
})
// console.log("RenderDoTogether: ", res);
}
/**
* 渲染标题
*/
renderDoTogether() {
this.doTogetherData.forEach((v,i)=>{
$(".do_together_title").append(`
<li class="${i==0?'active':''}">${v.title}</li>
`);
$(".do_together_content").append(`
<div class="roll_father ${i==0?'showRoll':''}"></div>
`)
});
var titleLi = $(".do_together_title li"),
RollFather = $(".do_together_content .roll_father");
var a = this;
titleLi.on('click', function () {
a.index = $(this).index();
$(this).addClass("active").siblings().removeClass("active")
if (a.doTogetherData[a.index].content.length == 0) {
a.DoTogether()
}
RollFather.eq($(this).index()).addClass("showRoll").siblings().removeClass("showRoll")
})
}
scrollLoadData() {
var scroll = new auiScroll({
listen:true,
distance: 10 //判断到达底部的距离isToBottom为true
}, (ret) => {
if(ret.isToBottom){
console.log("滚动到底部")
this.doTogetherData[this.index].page += 1;
this.DoTogether()
}
});
}
}
new Index()

View File

@@ -0,0 +1,178 @@
class Info {
constructor() {
this.getIndexInfo();
this.Url = GetQueryString("url")
}
async getIndexInfo() {
let res = await indexfoService.indexInfo({
url: GetQueryString("url")
})
$(".img_hidden img").attr("src", res.backImg)
$(".info_list .list_title h2").text(res.title)
$(".posttime").text(res.posttime)
res.stepInfo.arr.forEach((v,i)=>{
$(".ddd").append(`
<li>
<div class="i" style="background-position: 0px ${v.position /20}rem;"></div>
<p>${v.title}</p>
</li>
`)
});
$(".list_text p").text(res.stepInfo.message)
if(res.stepInfo.message.length > 44) {
$(".list_text").append(`
<div class="more">
<span>展开</span>
<i class="iconfont icon-houtui-copy-copy"></i>
</div>
`);
$(".more").on("click", function() {
$(".list_text").css({
height: 'auto'
})
$(".list_text .more").remove()
});
};
res.material.main.forEach((v,i)=>{
$(".ms .main ul").eq(0).append(`
<li>
<span>${v.title}</span>
<span>${v.nums}</span>
</li>
`)
})
res.material.accessories.forEach((v,i)=>{
$(".ms .main ul").eq(1).append(`
<li>
<span>${v.title}</span>
<span>${v.nums}</span>
</li>
`)
})
var successImg = 0;
res.DetailedSteps.forEach((v,i)=>{
if(Array.isArray(v.step_img) && v.step_img.length >=2) {
successImg = i
$(".content_list").append(`
<li>
<div class="step 2">${v.step_title}</div>
<img src="${v.step_img[0]}" alt="">
<p>${v.step_text || ''}</p>
<div class="tabs_img">
</div>
</li>
`)
} else{
$(".content_list").append(`
<li>
<div class="step">${v.step_title}</div>
<img src="${v.step_img}" alt="">
<p>${v.step_text || ''}</p>
</li>
`)
}
});
if (successImg != 0) {
res.DetailedSteps[successImg].step_img.forEach((a,b)=>{
$(".content_list li").eq(successImg).find(".tabs_img").append(`
<img style="width: 70px;height:70px;margin-right: .5rem;" src="${a}" alt=""/>
`)
})
$(".content_list li").eq(successImg).find(".tabs_img img").on("click", function(){
$(".content_list li").eq(successImg).find("img").eq(0).attr('src', $(this).attr("src"))
})
}
//收藏
var arr = [],
self = this;
if (localStorage.getItem("like") != null) {
arr = JSON.parse(localStorage.getItem("like"))
}
// 如果已经收藏了
// (arr.filter((v,index)=> v.url == self.Url).length == 0) ? '' : $(".icon-shoucang1").removeClass().addClass("iconfont icon-shoucang")
for (let i = 0; i < arr.length; i++) {
if (arr[i].url.includes(self.Url)) {
$(".icon-shoucang1").removeClass().addClass("iconfont icon-shoucang");
}
}
var xxx;
$(".icon-shoucang1").on("click", function (){
if (arr.length === 0){
addData()
}else{
for (let i = 0; i < arr.length; i++) {
if (arr[i].url.includes(self.Url)) {
xxx = true
break;
}
else {
xxx = false
}
}
if (xxx) {
console.log("已经收藏了");
} else {
addData()
}
}
}) ;
function addData() {
$(".icon-shoucang1").removeClass().addClass("iconfont icon-shoucang");
arr.push({
title: res.title,
url: self.Url,
img: res.backImg
})
localStorage.setItem("like", JSON.stringify(arr))
}
res.OtherRecommen.forEach((v,i)=>{
$(".Otherpractices ul").append(`
<li>
<a href="info.html?url=${v.url}">
<img src="${v.img}" alt="">
<p>${v.title.substring(0,6)}</p>
</a>
</li>
`)
})
res.RelatedRecommen.forEach((v,i)=>{
$(".recommend ul").append(`
<li>
<a href="info.html?url=${v.url}">
<img src="${v.img}" alt="">
<div class="recommend_left">
<h3>${v.title}</h3>
<p>${v.view}</p>
</div>
</a>
</li>
`)
})
}
}
new Info()

View File

@@ -0,0 +1,83 @@
class LikeInfo {
constructor() {
this.ListData = JSON.parse(localStorage.getItem("like"))
this.actionsheet = new auiActionsheet();
this.renderList()
this.deleat()
// this.deleatli()
}
renderList() {
this.ListData.forEach((v, ix) => {
$(".content ul").append(`
<li>
<a href="./info.html?url=${v.url}">
<img src="${v.img}" alt="">
</a>
<p>${v.title}</p>
</li>
`)
});
}
// deleatli(){
// var sss = this;
// $(".content ul li").each(function(i,v){
// console.log(sss.ListData.splice($(this).i, 1));
// })
// // localStorage.setItem("like", JSON.stringify(sss.ListData))
// // $.remove()
// }
deleat() {
var self = this;
var longClick = 0,
timeOutEvent;
$(".content ul li").on({
touchstart: function (e) {
longClick = 0;//设置初始为0
timeOutEvent = setTimeout(function () {
//此处为长按事件-----在此显示遮罩层及删除按钮
// longClick = 1;//假如长按则设置为1
// $(".shadow").css("display", "block")
self.openActionsheet()
e.preventDefault();
}, 300);
},
touchmove: function () {
clearTimeout(timeOutEvent);
timeOutEvent = 0;
e.preventDefault();
},
});
$(".cancel").on("click", function () {
$(".shadow").css("display", "none")
})
}
openActionsheet(){
var ss =this
this.actionsheet.init({
frameBounces:true,//当前页面是否弹动,(主要针对安卓端)
destructiveTitle:'删除',
buttons:['取消']
},function(ret){
if(ret){
if (ret.buttonIndex == 2) {
// ss.deleatli()
ss.ListData.splice($(this).attr("data-index"), 1)
localStorage.setItem("like", JSON.stringify(ss.ListData))
$(this).attr("data-index").remove()
}
}
})
}
}
new LikeInfo()

View File

@@ -0,0 +1,50 @@
class search {
constructor() {
this.page = 1
this.searchfunction();
this.scrollLoadData()
}
searchfunction(){
var dd = this;
$(".header p").on('click',()=>{
this.searchss()
})
}
async searchss(){
var dd=this,
value =$(".header input").val();
console.log($(".header input").val());
let res = await SearchService.search({
q:value,
page:this.page
});
res.forEach((v,i)=>{
$(".content ul").append(`
<li>
<a href="./info.html?url=${v.href}">
<div class="img">
<img src="${v.img}" alt="">
</div>
<div class="name">
<h3>${v.title}</h3>
<p>${v.des}</p>
</div>
</a>
</li>
`)
})
}
scrollLoadData() {
var scroll = new auiScroll({
listen: true,
distance: 10 //判断到达底部的距离isToBottom为true
}, (ret) => {
if(ret.isToBottom){
this.page += 1;
this.searchss()
}
});
}
}
new search()

View File

@@ -0,0 +1,42 @@
class Type {
constructor() {
this.leftMenu()
this.renderRight("/fenlei/shiyongfenlei/")
}
async leftMenu() {
let res = await TypeService.leftMenu({});
res.forEach((value, index) => {
$(".content .left_menu").append(`
<li class="${index==0?'active_menu':''}">
<div class="img" style="background-position: 0 ${value.position}px;"></div>
<p>${value.title}</p>
</li>
`)
});
var leftMenuLi = $(".left_menu li"),
index = 0,
self = this;
$(".left_menu li").on('click', function () {
index = $(this).index();
self.renderRight(res[index].url)
leftMenuLi.eq($(this).index()).addClass("active_menu").siblings().removeClass("active_menu")
});
}
async renderRight(index) {
let res = await TypeService.rightMenu({ url: index })
$(".right_content").empty();
res.forEach((v,i)=>{
$(".right_content").append(`
<li>
<a href="./fllist.html?url=${v.id}">
<img src="${v.img}" alt="">
<p>${v.title.substring(0,4)}</p>
</a>
</li>
`);
})
}
}
new Type()

View File

@@ -0,0 +1,73 @@
class Video {
constructor() {
this.videoMenu();
// this.Url = GetQueryString("url")\
this.page = 1
this.scrollLoadData()
}
async videoMenu() {
let res = await VideoService.Foodrecipes({
page:this.page
});
res.items.forEach((v, i) => {
$(".content").append(`
<li>
<a >
<div class="content_pic" style="background-image: url(${v.bd_photo});">
<div class="pic_yingyin">
<i class="iconfont icon-play"></i>
</div>
</div>
<p>${v.seo_title.substring(0,7)}</p>
<div class="pic_pinglun">
<div class="toux_left">
<img src="../img/ms.jpg" alt="">
<span>美食杰</span>
</div>
<div class="toux_right">
<i class="iconfont icon-faxian"></i>
<span>${v.click_num}</span>
</div>
</div>
</a>
</li>
`)
})
var videoarr = {};
$(function() {
$('.content').find('li').each(function() {
$(this).click(function() {
addData($(this).index());
})
})
})
function addData(index) {
videoarr.title= res.items[index].seo_title,
videoarr.practice= res.items[index].intro,
videoarr.video= res.items[index].xhz_video_url
console.log(videoarr);
localStorage.setItem("video", JSON.stringify(videoarr))
location.href = "./videoinfo.html"
}
}
scrollLoadData(){
var scroll = new auiScroll({
listen: true,
distance: 10 //判断到达底部的距离isToBottom为true
}, (ret) => {
if(ret.isToBottom){
this.page += 1;
this.videoMenu()
}
});
}
}
new Video()

View File

@@ -0,0 +1,16 @@
class VideoInfo {
constructor() {
this.ListData = JSON.parse(localStorage.getItem("video"))
this.renderList()
}
renderList() {
var data =this
console.log(this.ListData);
$(".img_hidden a video").attr("src", data.ListData.video)
$(".conten h1").text(data.ListData.title)
$(".conten p").text(data.ListData.practice)
}
}
new VideoInfo()

View File

@@ -0,0 +1 @@
499e3d1c-bef5-4f71-8adb-499da89a5146

View File

@@ -0,0 +1 @@
15bd74fb-ad5b-4faf-bb52-6dd71da96ab7

View File

@@ -0,0 +1 @@
31a9ea4e-bbee-40b0-994f-e226d9cb333a

View File

@@ -0,0 +1,50 @@
.aui-fold-active {
background: #f4f4f4;
}
.aui-fold-active .aui-fold-content {
display:block;
}
.aui-fold-content {
position: relative;
display: none;
margin: 12px -15px -12px;
padding-left: 15px;
background: #fff;
}
.aui-fold .aui-arrow-right {
position: relative;
display: block;
overflow: hidden;
margin: -12px -15px;
padding: inherit;
white-space: nowrap;
text-overflow: ellipsis;
color: inherit;
}
.aui-fold-ccontent-full {
margin-left: -15px;
margin-right: -15px;
padding: 0;
width: auto;
}
.aui-fold > .aui-arrow-right:after {
content: "\e661";
}
.aui-fold-active > .aui-arrow-right:after{
content: "\e6de"
}
.aui-fold-content .aui-list-view,
.aui-fold-content .aui-user-view {
margin-bottom: 0;
}
.aui-fold-content .aui-list-view:after,
.aui-fold-content .aui-user-view:after,
.aui-fold-content .aui-input-row:first-child:after {
border-top: 0;
}
.aui-fold-content .aui-list-view-cell:last-child:after,
.aui-fold-content .aui-user-view-cell:last-child:after,
.aui-fold-content .aui-input-row:last-child:after,
.aui-fold-content .aui-btn-row:last-child:after {
border-bottom: 0;
}

View File

@@ -0,0 +1,272 @@
/*
* =========================================================================
* APIClud - AUI UI 框架 流浪男 QQ343757327 http://www.auicss.com
* Verson 1.0
* =========================================================================
*/
@charset "UTF-8";
html{
font-family: "Helvetica Neue", Helvetica, sans-serif;
font-size: 20px;
}
html,body {
-webkit-touch-callout:none;
-webkit-text-size-adjust:none;
-webkit-tap-highlight-color:rgba(0, 0, 0, 0);
-webkit-user-select:none;
width: 100%;
}
body {
line-height: 1.5;
font-size: 0.8rem;
color: #212121;
background-color: #f5f5f5;
outline: 0;
}
html,body,header,section,footer,div,ul,ol,li,img,a,span,em,del,legend,center,strong,var,fieldset,form,label,dl,dt,dd,cite,input,hr,time,mark,code,figcaption,figure,textarea,h1,h2,h3,h4,h5,h6,p{
margin:0;
border:0;
padding:0;
font-style:normal;
}
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-user-select: none;
-webkit-tap-highlight-color: transparent;
outline: none;
}
@media only screen and (min-width: 400px) {
html {
font-size: 21.33333333px !important;
}
}
@media only screen and (min-width: 414px) {
html {
font-size: 21px !important;
}
}
@media only screen and (min-width: 480px) {
html {
font-size: 25.6px !important;
}
}
.aui-flex-col,
.aui-flex-row {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
}
.aui-flex-col:before,
.aui-flex-row:before,
.aui-flex-col:after,
.aui-flex-row:after {
content: " ";
display: -webkit-box;
display: -webkit-flex;
display: flex;
box-sizing: border-box;
}
.aui-flex-col:after,
.aui-flex-row:after {
clear: both;
}
.aui-flex-col {
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
flex-direction: row;
}
.aui-flex-row {
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
flex-direction: column;
}
/*栅格*/
.aui-flex-item-1 {
float: left;
width: 8.33333333%;
}
.aui-flex-offset-1 {
margin-left: 8.33333333%;
}
.aui-flex-item-2 {
float: left;
width: 16.66666667%;
}
.aui-flex-offset-2 {
margin-left: 16.66666667%;
}
.aui-flex-item-3 {
float: left;
width: 25%;
}
.aui-flex-offset-3 {
margin-left: 25%;
}
.aui-flex-item-4 {
float: left;
width: 33.33333333%;
}
.aui-flex-offset-4 {
margin-left: 33.33333333%;
}
.aui-flex-item-5 {
float: left;
width: 41.66666667%;
}
.aui-flex-offset-5 {
margin-left: 41.66666667%;
}
.aui-flex-item-6 {
float: left;
width: 50%;
}
.aui-flex-offset-6 {
margin-left: 50%;
}
.aui-flex-item-7 {
float: left;
width: 58.33333333%;
}
.aui-flex-offset-7 {
margin-left: 58.33333333%;
}
.aui-flex-item-8 {
float: left;
width: 66.66666667%;
}
.aui-flex-offset-8 {
margin-left: 66.66666667%;
}
.aui-flex-item-9 {
float: left;
width: 75%;
}
.aui-flex-offset-9 {
margin-left: 75%;
}
.aui-flex-item-10 {
float: left;
width: 83.33333333%;
}
.aui-flex-offset-10 {
margin-left: 83.33333333%;
}
.aui-flex-order-10 {
-webkit-box-ordinal-group: 11;
-webkit-order: 10;
order: 10;
}
.aui-flex-item-11 {
float: left;
width: 91.66666667%;
}
.aui-flex-offset-11 {
margin-left: 91.66666667%;
}
.aui-flex-item-12 {
float: left;
width: 100%;
}
.aui-flex-offset-12 {
margin-left: 100%;
}
.aui-flex-auto {
float: left;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
flex-grow: 1;
}
.aui-flex-between {
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
/*对齐*/
.aui-flex-col.aui-flex-left {
-webkit-box-pack: start;
-webkit-justify-content: flex-start;
justify-content: flex-start;
}
.aui-flex-col.aui-flex-right {
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.aui-flex-col.aui-flex-top {
-webkit-box-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
}
.aui-flex-col.aui-flex-bottom {
-webkit-box-align: end;
-webkit-align-items: flex-end;
align-items: flex-end;
}
.aui-flex-col.aui-flex-center {
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.aui-flex-col.aui-flex-middle {
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
.aui-flex-row.aui-flex-left {
-webkit-box-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
}
.aui-flex-row.aui-flex-right {
-webkit-box-align: end;
-webkit-align-items: flex-end;
align-items: flex-end;
}
.aui-flex-row.aui-flex-top {
-webkit-box-pack: start;
-webkit-justify-content: flex-start;
justify-content: flex-start;
}
.aui-flex-row.aui-flex-bottom {
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.aui-flex-row.aui-flex-center {
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
.aui-flex-row.aui-flex-middle {
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
[class*=aui-flex-item-]{
position: relative;
}
[class*=aui-flex-auto].aui-flex-left {
margin-right: auto;
}
[class*=aui-flex-auto].aui-flex-right {
margin-left: auto;
}
[class*=aui-flex-auto].aui-flex-top {
margin-bottom: auto;
}
[class*=aui-flex-auto].aui-flex-bottom {
margin-top: auto;
}
[class*=aui-flex-auto].aui-flex-center {
margin-left: auto;
margin-right: auto;
}
[class*=aui-flex-auto].aui-flex-middle {
margin-top: auto;
margin-bottom: auto;
}

View File

@@ -0,0 +1,54 @@
/**
* aui-pull-refresh.css 下拉刷新
* verson 0.0.1
* @author 流浪男 && Beck
* http://www.auicss.com
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
.aui-refresh-content {
position: relative;
-webkit-overflow-scrolling: touch;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.aui-refresh-load {
width: 100%;
height: 2.2rem;
position: absolute;
top: -2.2rem;
left: 0;
padding: 0.75rem 0;
}
.aui-refresh-pull-arrow {
width: 1.2rem;
height: 1.2rem;
position: absolute;
left: 50%;
top: 50%;
visibility: visible;
margin-left: -0.6rem;
margin-top: -0.6rem;
background: no-repeat center;
background-image: url('data:image/svg+xml;charset=utf-8,<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><path d="M99.225 3.528c8.34 0 15.104 6.763 15.104 15.105 0 8.34-6.766 15.105-15.105 15.105-8.342 0-15.105-6.763-15.105-15.105S90.883 3.528 99.225 3.528zM76.567 48.843h45.315c4.17 0 7.552 3.38 7.552 7.552v5.035c0 4.172-3.382 7.552-7.552 7.552H76.567c-4.172 0-7.553-3.38-7.553-7.552v-5.035c0-4.172 3.38-7.552 7.553-7.552zm-10.07 35.245h65.455c4.17 0 7.552 3.38 7.552 7.552v5.035c0 4.172-3.382 7.552-7.552 7.552H66.497c-4.172 0-7.553-3.38-7.553-7.552V91.64c0-4.172 3.38-7.552 7.553-7.552zm8.044 87.596c-20.397-23.16-45.805-52.352-45.805-52.352h140.98s-25.146 28.735-45.4 51.884c-33.454 38.234-18.118 36.4-49.774.468z" fill="#707070" class="transform-group"/></svg>');
background-size: 1.2rem 1.2rem;
z-index: 10;
-webkit-transform: rotate(0deg) translate3d(0, 0, 0);
transform: rotate(0deg) translate3d(0, 0, 0);
-webkit-transition-duration: 300ms;
transition-duration: 300ms;
}
.aui-refresh-content.aui-refresh-pull-down .aui-refresh-pull-arrow {
-webkit-transform: rotate(0deg) translate3d(0,0,0);
transform: rotate(0deg) translate3d(0,0,0);
}
.aui-refresh-content.aui-refresh-pull-up .aui-refresh-pull-arrow {
-webkit-transform: rotate(180deg) translate3d(0,0,0);
transform: rotate(180deg) translate3d(0,0,0);
}
.aui-refreshing .aui-refresh-pull-arrow{
background-image: url('data:image/svg+xml;charset=utf-8,<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><path d="M99.917.167C45.52.167 1.28 43.642.03 97.737c1.153-47.204 37.045-85.08 81.153-85.08 44.834 0 81.184 39.147 81.184 87.426 0 10.346 8.387 18.738 18.733 18.738 10.342 0 18.733-8.39 18.733-18.737C199.833 44.9 155.1.167 99.917.167zm0 199.833c54.395 0 98.637-43.475 99.883-97.57-1.15 47.2-37.042 85.082-81.15 85.082-44.833 0-81.183-39.15-81.183-87.43 0-10.34-8.392-18.732-18.738-18.732C8.39 81.35 0 89.737 0 100.083 0 155.267 44.733 200 99.917 200z" fill="#707070" class="transform-group"/></svg>');
-webkit-animation: rotate 1s 0s linear infinite;
animation: rotate 1s 0s linear infinite;
}

View File

@@ -0,0 +1,277 @@
/*
* ===================================================================================================
* APIClud - AUI UI 框架 流浪男 QQ343757327 http://www.auicss.com
* Verson 2.0.0 自定义主题样式
* explain自定义主题样式可以完成AUI内所有背景、控件颜色、字号等的修改可以方便快速的搭建属于自己项目的一套主题色
* ===================================================================================================
*/
/*body背景色及色值*/
body {
color: #d1d1d1;
background-color: #1a1a1a;
}
p {
color: #757575;
}
a {
color: #0062cc;
}
.aui-text-default {
color: #212121 !important;
}
.aui-bg-default {
background-color: #f5f5f5 !important;
}
/*label*/
.aui-label {
padding: 0.3em 0.35em;
font-size: 0.6rem;
color: #616161;
background-color: #e0e0e0;
}
.aui-label-outlined {
border: 1px solid #d9d9d9;
background-color: transparent;
}
.aui-label .aui-iconfont {
font-size: 0.6rem;
}
/*角标*/
.aui-badge {
color: #ffffff;
background-color: #ff2600;
}
/*按钮*/
.aui-btn {
color: #212121;
background: #e0e0e0;
}
.aui-btn:active {
color: #212121;
background-color: #bdbdbd;
}
.aui-btn-outlined {
background: transparent;
border: 1px solid #bdbdbd;
}
.aui-btn-outlined:active {
background: transparent;
}
/*tab*/
.aui-tab .aui-tab-item {
height: 2.2rem;
line-height: 2.2rem;
font-size: 0.7rem;
color: #212121;
background-color: #ffffff;
}
/*tab选中时样式*/
.aui-tab .aui-tab-item.active {
color: #039be5;
border-bottom: 2px solid #039be5;
}
/*单选选中样式*/
.aui-radio:checked,
.aui-radio.aui-checked {
background-color: #edfb3f;
border: solid 1px #edfb3f;
}
/* 单选选中时中间对号颜色*/
.aui-radio:checked:before,
.aui-radio.aui-checked:before,
.aui-radio:checked:after,
.aui-radio.aui-checked:after {
border-color: #212121;
}
/*多选选中样式*/
.aui-checkbox:checked,
.aui-checkbox.aui-checked {
background-color: #edfb3f;
border: solid 1px #edfb3f;
}
/* 多选选中时中间对号颜色*/
.aui-checkbox:checked:before,
.aui-checkbox.aui-checked:before,
.aui-checkbox:checked:after,
.aui-checkbox.aui-checked:after{
border-color: #212121;
}
/*滑动开关*/
.aui-switch:checked {
border-color: #edfb3f;
background-color: #edfb3f;
}
.aui-switch:before {
background-color: #212121;
}
/*顶部导航栏*/
.aui-bar-nav {
background-color: #00bbd4;
color: #212121;
}
.aui-bar-nav .aui-iconfont {
color: #212121;
}
.aui-bar-nav .aui-btn .aui-iconfont {
color: #212121;
}
/*浅色顶部导航拦*/
.aui-bar-light {
color: #03a9f4;
background-color: #ffffff;
}
.aui-bar.aui-bar-light .aui-iconfont {
color: #03a9f4;
}
.aui-bar.aui-bar-light .aui-btn-outlined {
border-color: #03a9f4;
}
/*底部工具栏*/
.aui-bar-tab {
background-color: #ffffff;
color: #757575;
}
/*底部工具栏选中时颜色*/
.aui-bar-tab .active {
color: #039be5;
}
/*按钮工具栏*/
.aui-bar-btn .aui-bar-btn-item {
border-color: #edfb3f;
color: #edfb3f;
}
.aui-bar-btn .aui-bar-btn-item.active {
background-color: #edfb3f;
color: #ffffff;
}
/*顶部导航存在按钮组工具栏时样式*/
.aui-bar-nav .aui-bar-btn-item {
border-color: #ffffff;
}
/*浅色顶部导航存在按钮组工具栏时样式*/
.aui-bar-nav.aui-bar-light .aui-bar-btn-item {
border-color: #03a9f4;
}
/*顶部导航存在按钮组工具栏时选中样式*/
.aui-bar-nav .aui-bar-btn .aui-bar-btn-item.active {
background-color: #ffffff;
color: #03a9f4;
}
/*浅色顶部导航存在按钮组工具栏时选中样式*/
.aui-bar-nav.aui-bar-light .aui-bar-btn .aui-bar-btn-item.active {
background-color: #03a9f4;
color: #ffffff;
}
/*进度条*/
.aui-progress {
background-color: #f0f0f0;
}
/*进度条色带*/
.aui-progress .aui-progress-bar {
background-color: #eefb3f;
}
/*滑块*/
.aui-range input[type='range']{
/*滑块线条背景色*/
background-color: #f0f0f0;
}
.aui-range input[type='range']::-webkit-slider-thumb {
/*滑块圆圈样式*/
border-color: #edfb3f;
background-color: #edfb3f;
}
/*提示条*/
.aui-tips {
background-color: rgba(0,0,0,.6);
}
/*搜索条*/
.aui-searchbar {
background-color: #ebeced;
color: #9e9e9e;
}
/*列表背景色*/
.aui-list .aui-list-item {
color: #d1d1d1;
background-color: #1a1a1a;
}
/*列表头部*/
.aui-list .aui-list-header {
background-color: #242424;
color: #9e9e9e;
}
/*列表项内Ttitle标题*/
.aui-list .aui-list-item-title {
font-size: 0.8rem;
color: #d1d1d1;
}
/*列表文本区域字体*/
.aui-list .aui-list-item-text {
font-size: 0.7rem;
color: #d1d1d1;
}
/*列表右侧箭头*/
.aui-list-item-arrow:before {
border-color: #edfb3f;
}
/*列表右侧其他信息字体颜色*/
.aui-list .aui-list-item-right,
.aui-list-item-title-row em {
color: #edfb3f;
}
/*列表线条颜色*/
.aui-list:before,
.aui-list:after,
.aui-list .aui-list-item:after,
.aui-list.aui-list-in .aui-list-item-inner:after {
background-color: #242424;
}
/*列表项点击颜色*/
.aui-list .aui-list-item:active {
background-color: #f5f5f5;
}
/*媒体列表布局左(右)媒体宽度控制*/
.aui-list .aui-list-item-media {
width: 4.5rem;
}
/*列表内label、icon字体颜色*/
.aui-list .aui-list-item-label,
.aui-list .aui-list-item-label-icon {
color: #d1d1d1;
}
/*卡片列表顶部字体*/
.aui-card-list-header {
font-size: 0.8rem;
color: #212121;
}
/* 卡片列表内容区域*/
.aui-card-list-content,
.aui-card-list-content-padded {
font-size: 0.7rem;
color: #212121;
}
/*卡片列表底部*/
.aui-card-list-footer {
font-size: 0.7rem;
color: #757575;
}
/*信息条*/
.aui-info {
font-size: 0.7rem;
color: #757575;
background-color: transparent;
}
/*输入框类字体颜色*/
input[type="text"],
input[type="password"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="number"],
select,
textarea {
color: #424242;
}

View File

@@ -0,0 +1,278 @@
/*
* ===================================================================================================
* APIClud - AUI UI 框架 流浪男 QQ343757327 http://www.auicss.com
* Verson 2.0.0 自定义主题样式
* explain自定义主题样式可以完成AUI内所有背景、控件颜色、字号等的修改可以方便快速的搭建属于自己项目的一套主题色
* ===================================================================================================
*/
/*body背景色及色值*/
body {
color: #212121;
background-color: #f5f5f5;
}
p {
color: #757575;
}
a {
color: #0062cc;
}
.aui-text-default {
color: #212121 !important;
}
.aui-bg-default {
background-color: #f5f5f5 !important;
}
/*label*/
.aui-label {
padding: 0.3em 0.35em;
font-size: 0.6rem;
color: #616161;
background-color: #e0e0e0;
}
.aui-label-outlined {
border: 1px solid #d9d9d9;
background-color: transparent;
}
.aui-label .aui-iconfont {
font-size: 0.6rem;
}
/*角标*/
.aui-badge {
color: #ffffff;
background-color: #ff2600;
}
/*按钮*/
.aui-btn {
color: #212121;
background: #e0e0e0;
}
.aui-btn:active {
color: #212121;
background-color: #bdbdbd;
}
.aui-btn-outlined {
background: transparent;
border: 1px solid #bdbdbd;
}
.aui-btn-outlined:active {
background: transparent;
}
/*tab*/
.aui-tab .aui-tab-item {
height: 2.2rem;
line-height: 2.2rem;
font-size: 0.7rem;
color: #212121;
background-color: #ffffff;
}
/*tab选中时样式*/
.aui-tab .aui-tab-item.aui-active {
color: #039be5;
border-bottom: 2px solid #039be5;
}
/*单选选中样式*/
.aui-radio:checked,
.aui-radio.aui-checked {
background-color: #03a9f4;
border: solid 1px #03a9f4;
}
/* 单选选中时中间对号颜色*/
.aui-radio:checked:before,
.aui-radio.aui-checked:before,
.aui-radio:checked:after,
.aui-radio.aui-checked:after {
border-color: #ffffff;
}
/*多选选中样式*/
.aui-checkbox:checked,
.aui-checkbox.aui-checked {
background-color: #03a9f4;
border: solid 1px #03a9f4;
}
/* 多选选中时中间对号颜色*/
.aui-checkbox:checked:before,
.aui-checkbox.aui-checked:before,
.aui-checkbox:checked:after,
.aui-checkbox.aui-checked:after{
border-color: #ffffff;
}
/*滑动开关*/
.aui-switch:checked {
border-color: #03a9f4;
background-color: #03a9f4;
}
/*滑动开关圆圈颜色*/
.aui-switch:before {
background-color: #ffffff;
}
/*顶部导航栏*/
.aui-bar-nav {
background-color: #03a9f4;
color: #ffffff;
}
.aui-bar-nav .aui-iconfont {
color: #ffffff;
}
.aui-bar-nav .aui-btn .aui-iconfont {
color: #ffffff;
}
/*浅色顶部导航拦*/
.aui-bar-light {
color: #03a9f4;
background-color: #ffffff;
}
.aui-bar.aui-bar-light .aui-iconfont {
color: #03a9f4;
}
.aui-bar.aui-bar-light .aui-btn-outlined {
border-color: #03a9f4;
}
/*底部工具栏*/
.aui-bar-tab {
background-color: #ffffff;
color: #757575;
}
/*底部工具栏选中时颜色*/
.aui-bar-tab .aui-active {
color: #039be5;
}
/*按钮工具栏*/
.aui-bar-btn .aui-bar-btn-item {
border-color: #03a9f4;
color: #212121;
}
.aui-bar-btn .aui-bar-btn-item.aui-active {
background-color: #03a9f4;
color: #ffffff;
}
/*顶部导航存在按钮组工具栏时样式*/
.aui-bar-nav .aui-bar-btn-item {
border-color: #ffffff;
}
/*浅色顶部导航存在按钮组工具栏时样式*/
.aui-bar-nav.aui-bar-light .aui-bar-btn-item {
border-color: #03a9f4;
}
/*顶部导航存在按钮组工具栏时选中样式*/
.aui-bar-nav .aui-bar-btn .aui-bar-btn-item.aui-active {
background-color: #ffffff;
color: #03a9f4;
}
/*浅色顶部导航存在按钮组工具栏时选中样式*/
.aui-bar-nav.aui-bar-light .aui-bar-btn .aui-bar-btn-item.aui-active {
background-color: #03a9f4;
color: #ffffff;
}
/*进度条*/
.aui-progress {
background-color: #f0f0f0;
}
/*进度条色带*/
.aui-progress .aui-progress-bar {
background-color: #03a9f4;
}
/*滑块*/
.aui-range input[type='range']{
/*滑块线条背景色*/
background-color: #f0f0f0;
}
.aui-range input[type='range']::-webkit-slider-thumb {
/*滑块圆圈样式*/
border-color: #03a9f4;
background-color: #03a9f4;
}
/*提示条*/
.aui-tips {
background-color: rgba(0,0,0,.6);
}
/*搜索条*/
.aui-searchbar {
background-color: #ebeced;
color: #9e9e9e;
}
/*列表背景色*/
.aui-list .aui-list-item {
color: #212121;
background-color: #ffffff;
}
/*列表头部*/
.aui-list .aui-list-header {
background-color: #e0e0e0;
color: #212121;
}
/*列表项内Ttitle标题*/
.aui-list .aui-list-item-title {
font-size: 0.8rem;
color: #212121;
}
/*列表文本区域字体*/
.aui-list .aui-list-item-text {
font-size: 0.7rem;
color: #757575;
}
/*列表右侧箭头*/
.aui-list-item-arrow:before {
border-color: #dddddd;
}
/*列表右侧其他信息字体颜色*/
.aui-list .aui-list-item-right,
.aui-list-item-title-row em {
color: #757575;
}
/*列表线条颜色*/
.aui-list:before,
.aui-list:after,
.aui-list .aui-list-item:after,
.aui-list.aui-list-in .aui-list-item-inner:after {
background-color: #dddddd;
}
/*列表项点击颜色*/
.aui-list .aui-list-item:active {
background-color: #f5f5f5;
}
/*媒体列表布局左(右)媒体宽度控制*/
.aui-list .aui-list-item-media {
width: 4.5rem;
}
/*列表内label、icon字体颜色*/
.aui-list .aui-list-item-label,
.aui-list .aui-list-item-label-icon {
color: #212121;
}
/*卡片列表顶部字体*/
.aui-card-list-header {
font-size: 0.8rem;
color: #212121;
}
/* 卡片列表内容区域*/
.aui-card-list-content,
.aui-card-list-content-padded {
font-size: 0.7rem;
color: #212121;
}
/*卡片列表底部*/
.aui-card-list-footer {
font-size: 0.7rem;
color: #757575;
}
/*信息条*/
.aui-info {
font-size: 0.7rem;
color: #757575;
background-color: transparent;
}
/*输入框类字体颜色*/
input[type="text"],
input[type="password"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="number"],
select,
textarea {
color: #424242;
}

View File

@@ -0,0 +1,113 @@
/**
* aui-slide.css 轮播样式
* verson 0.0.2
* @author 流浪男
* http://www.auicss.com
* @todo more things to abstract, e.g. Loading css etc.
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
.aui-slide-wrap {
display: block;
position: relative;
list-style: none;
margin: 0;
padding: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
.aui-slide-wrap .aui-slide-node {
position: absolute;
top: 0;
left: 0;
margin: 0;
padding: 0;
width: 100%;
height: 100%;
list-style: none;
overflow: hidden;
background: #ffffff;
}
.aui-slide-node-center {
display: -moz-box;
display: -webkit-box;
display: box;
-moz-box-pack: center;
-webkit-box-pack: center;
box-pack: center;
}
.aui-slide-node-middle {
display: -moz-box;
display: -webkit-box;
display: box;
-moz-box-align: center;
-webkit-box-align: center;
box-align: center;
}
.aui-slide-node img {
width: 100%;
height: 100%;
}
.aui-slide-page-wrap {
width: 100%;
height: 30px;
line-height: 30px;
position: absolute;
padding: 0;
left: 0;
right: 0;
bottom: 5px;
z-index: 9999;
text-align: center;
}
.aui-slide-page-dot {
position: relative;
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
list-style: none;
margin: 5px 3px 0 3px;
background: #c7c7c7;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
.aui-slide-page-line {
position: absolute;
bottom: -14px;
height: 1px !important;
position: relative;
display: inline-block;
background: #eeeeee;
-webkit-transition: all 0.5s;
transition: all 0.5s;
}
.aui-slide-page-active {
background: #1abc9c;
from { opacity: 0.3; }
to { opacity: 1 }
}
.aui-slide-prev-btn,
.aui-slide-next-btn {
display: inline-block;
width: 50px;
height: 30px;
line-height: 30px;
font-size: 1.2em;
color: #1abc9c;
background: rgba(249,249,249,0.6);
position: relative;
}
.aui-slide-prev-btn {
border-top-left-radius: 15px;
border-bottom-left-radius: 15px;
}
.aui-slide-next-btn {
border-top-right-radius: 15px;
border-bottom-right-radius: 15px;
}
.aui-slide-prev-btn:active,
.aui-slide-next-btn:active {
color: #f1c40f;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
38835eee-9291-48ce-9422-53733b0d79f3

View File

@@ -0,0 +1,607 @@
/*
* APICloud JavaScript Library
* Copyright (c) 2014 apicloud.com
*/
(function(window){
var u = {};
var isAndroid = (/android/gi).test(navigator.appVersion);
var uzStorage = function(){
var ls = window.localStorage;
if(isAndroid){
ls = os.localStorage();
}
return ls;
};
function parseArguments(url, data, fnSuc, dataType) {
if (typeof(data) == 'function') {
dataType = fnSuc;
fnSuc = data;
data = undefined;
}
if (typeof(fnSuc) != 'function') {
dataType = fnSuc;
fnSuc = undefined;
}
return {
url: url,
data: data,
fnSuc: fnSuc,
dataType: dataType
};
}
u.trim = function(str){
if(String.prototype.trim){
return str == null ? "" : String.prototype.trim.call(str);
}else{
return str.replace(/(^\s*)|(\s*$)/g, "");
}
};
u.trimAll = function(str){
return str.replace(/\s*/g,'');
};
u.isElement = function(obj){
return !!(obj && obj.nodeType == 1);
};
u.isArray = function(obj){
if(Array.isArray){
return Array.isArray(obj);
}else{
return obj instanceof Array;
}
};
u.isEmptyObject = function(obj){
if(JSON.stringify(obj) === '{}'){
return true;
}
return false;
};
u.addEvt = function(el, name, fn, useCapture){
if(!u.isElement(el)){
console.warn('$api.addEvt Function need el param, el param must be DOM Element');
return;
}
useCapture = useCapture || false;
if(el.addEventListener) {
el.addEventListener(name, fn, useCapture);
}
};
u.rmEvt = function(el, name, fn, useCapture){
if(!u.isElement(el)){
console.warn('$api.rmEvt Function need el param, el param must be DOM Element');
return;
}
useCapture = useCapture || false;
if (el.removeEventListener) {
el.removeEventListener(name, fn, useCapture);
}
};
u.one = function(el, name, fn, useCapture){
if(!u.isElement(el)){
console.warn('$api.one Function need el param, el param must be DOM Element');
return;
}
useCapture = useCapture || false;
var that = this;
var cb = function(){
fn && fn();
that.rmEvt(el, name, cb, useCapture);
};
that.addEvt(el, name, cb, useCapture);
};
u.dom = function(el, selector){
if(arguments.length === 1 && typeof arguments[0] == 'string'){
if(document.querySelector){
return document.querySelector(arguments[0]);
}
}else if(arguments.length === 2){
if(el.querySelector){
return el.querySelector(selector);
}
}
};
u.domAll = function(el, selector){
if(arguments.length === 1 && typeof arguments[0] == 'string'){
if(document.querySelectorAll){
return document.querySelectorAll(arguments[0]);
}
}else if(arguments.length === 2){
if(el.querySelectorAll){
return el.querySelectorAll(selector);
}
}
};
u.byId = function(id){
return document.getElementById(id);
};
u.first = function(el, selector){
if(arguments.length === 1){
if(!u.isElement(el)){
console.warn('$api.first Function need el param, el param must be DOM Element');
return;
}
return el.children[0];
}
if(arguments.length === 2){
return this.dom(el, selector+':first-child');
}
};
u.last = function(el, selector){
if(arguments.length === 1){
if(!u.isElement(el)){
console.warn('$api.last Function need el param, el param must be DOM Element');
return;
}
var children = el.children;
return children[children.length - 1];
}
if(arguments.length === 2){
return this.dom(el, selector+':last-child');
}
};
u.eq = function(el, index){
return this.dom(el, ':nth-child('+ index +')');
};
u.not = function(el, selector){
return this.domAll(el, ':not('+ selector +')');
};
u.prev = function(el){
if(!u.isElement(el)){
console.warn('$api.prev Function need el param, el param must be DOM Element');
return;
}
var node = el.previousSibling;
if(node.nodeType && node.nodeType === 3){
node = node.previousSibling;
return node;
}
};
u.next = function(el){
if(!u.isElement(el)){
console.warn('$api.next Function need el param, el param must be DOM Element');
return;
}
var node = el.nextSibling;
if(node.nodeType && node.nodeType === 3){
node = node.nextSibling;
return node;
}
};
u.closest = function(el, selector){
if(!u.isElement(el)){
console.warn('$api.closest Function need el param, el param must be DOM Element');
return;
}
var doms, targetDom;
var isSame = function(doms, el){
var i = 0, len = doms.length;
for(i; i<len; i++){
if(doms[i].isEqualNode(el)){
return doms[i];
}
}
return false;
};
var traversal = function(el, selector){
doms = u.domAll(el.parentNode, selector);
targetDom = isSame(doms, el);
while(!targetDom){
el = el.parentNode;
if(el != null && el.nodeType == el.DOCUMENT_NODE){
return false;
}
traversal(el, selector);
}
return targetDom;
};
return traversal(el, selector);
};
u.contains = function(parent,el){
var mark = false;
if(el === parent){
mark = true;
return mark;
}else{
do{
el = el.parentNode;
if(el === parent){
mark = true;
return mark;
}
}while(el === document.body || el === document.documentElement);
return mark;
}
};
u.remove = function(el){
if(el && el.parentNode){
el.parentNode.removeChild(el);
}
};
u.attr = function(el, name, value){
if(!u.isElement(el)){
console.warn('$api.attr Function need el param, el param must be DOM Element');
return;
}
if(arguments.length == 2){
return el.getAttribute(name);
}else if(arguments.length == 3){
el.setAttribute(name, value);
return el;
}
};
u.removeAttr = function(el, name){
if(!u.isElement(el)){
console.warn('$api.removeAttr Function need el param, el param must be DOM Element');
return;
}
if(arguments.length === 2){
el.removeAttribute(name);
}
};
u.hasCls = function(el, cls){
if(!u.isElement(el)){
console.warn('$api.hasCls Function need el param, el param must be DOM Element');
return;
}
if(el.className.indexOf(cls) > -1){
return true;
}else{
return false;
}
};
u.addCls = function(el, cls){
if(!u.isElement(el)){
console.warn('$api.addCls Function need el param, el param must be DOM Element');
return;
}
if('classList' in el){
el.classList.add(cls);
}else{
var preCls = el.className;
var newCls = preCls +' '+ cls;
el.className = newCls;
}
return el;
};
u.removeCls = function(el, cls){
if(!u.isElement(el)){
console.warn('$api.removeCls Function need el param, el param must be DOM Element');
return;
}
if('classList' in el){
el.classList.remove(cls);
}else{
var preCls = el.className;
var newCls = preCls.replace(cls, '');
el.className = newCls;
}
return el;
};
u.toggleCls = function(el, cls){
if(!u.isElement(el)){
console.warn('$api.toggleCls Function need el param, el param must be DOM Element');
return;
}
if('classList' in el){
el.classList.toggle(cls);
}else{
if(u.hasCls(el, cls)){
u.removeCls(el, cls);
}else{
u.addCls(el, cls);
}
}
return el;
};
u.val = function(el, val){
if(!u.isElement(el)){
console.warn('$api.val Function need el param, el param must be DOM Element');
return;
}
if(arguments.length === 1){
switch(el.tagName){
case 'SELECT':
var value = el.options[el.selectedIndex].value;
return value;
break;
case 'INPUT':
return el.value;
break;
case 'TEXTAREA':
return el.value;
break;
}
}
if(arguments.length === 2){
switch(el.tagName){
case 'SELECT':
el.options[el.selectedIndex].value = val;
return el;
break;
case 'INPUT':
el.value = val;
return el;
break;
case 'TEXTAREA':
el.value = val;
return el;
break;
}
}
};
u.prepend = function(el, html){
if(!u.isElement(el)){
console.warn('$api.prepend Function need el param, el param must be DOM Element');
return;
}
el.insertAdjacentHTML('afterbegin', html);
return el;
};
u.append = function(el, html){
if(!u.isElement(el)){
console.warn('$api.append Function need el param, el param must be DOM Element');
return;
}
el.insertAdjacentHTML('beforeend', html);
return el;
};
u.before = function(el, html){
if(!u.isElement(el)){
console.warn('$api.before Function need el param, el param must be DOM Element');
return;
}
el.insertAdjacentHTML('beforebegin', html);
return el;
};
u.after = function(el, html){
if(!u.isElement(el)){
console.warn('$api.after Function need el param, el param must be DOM Element');
return;
}
el.insertAdjacentHTML('afterend', html);
return el;
};
u.html = function(el, html){
if(!u.isElement(el)){
console.warn('$api.html Function need el param, el param must be DOM Element');
return;
}
if(arguments.length === 1){
return el.innerHTML;
}else if(arguments.length === 2){
el.innerHTML = html;
return el;
}
};
u.text = function(el, txt){
if(!u.isElement(el)){
console.warn('$api.text Function need el param, el param must be DOM Element');
return;
}
if(arguments.length === 1){
return el.textContent;
}else if(arguments.length === 2){
el.textContent = txt;
return el;
}
};
u.offset = function(el){
if(!u.isElement(el)){
console.warn('$api.offset Function need el param, el param must be DOM Element');
return;
}
var sl = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
var st = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
var rect = el.getBoundingClientRect();
return {
l: rect.left + sl,
t: rect.top + st,
w: el.offsetWidth,
h: el.offsetHeight
};
};
u.css = function(el, css){
if(!u.isElement(el)){
console.warn('$api.css Function need el param, el param must be DOM Element');
return;
}
if(typeof css == 'string' && css.indexOf(':') > 0){
el.style && (el.style.cssText += ';' + css);
}
};
u.cssVal = function(el, prop){
if(!u.isElement(el)){
console.warn('$api.cssVal Function need el param, el param must be DOM Element');
return;
}
if(arguments.length === 2){
var computedStyle = window.getComputedStyle(el, null);
return computedStyle.getPropertyValue(prop);
}
};
u.jsonToStr = function(json){
if(typeof json === 'object'){
return JSON && JSON.stringify(json);
}
};
u.strToJson = function(str){
if(typeof str === 'string'){
return JSON && JSON.parse(str);
}
};
u.setStorage = function(key, value){
if(arguments.length === 2){
var v = value;
if(typeof v == 'object'){
v = JSON.stringify(v);
v = 'obj-'+ v;
}else{
v = 'str-'+ v;
}
var ls = uzStorage();
if(ls){
ls.setItem(key, v);
}
}
};
u.getStorage = function(key){
var ls = uzStorage();
if(ls){
var v = ls.getItem(key);
if(!v){return;}
if(v.indexOf('obj-') === 0){
v = v.slice(4);
return JSON.parse(v);
}else if(v.indexOf('str-') === 0){
return v.slice(4);
}
}
};
u.rmStorage = function(key){
var ls = uzStorage();
if(ls && key){
ls.removeItem(key);
}
};
u.clearStorage = function(){
var ls = uzStorage();
if(ls){
ls.clear();
}
};
/*by king*/
u.fixIos7Bar = function(el){
if(!u.isElement(el)){
console.warn('$api.fixIos7Bar Function need el param, el param must be DOM Element');
return;
}
var strDM = api.systemType;
if (strDM == 'ios') {
var strSV = api.systemVersion;
var numSV = parseInt(strSV,10);
var fullScreen = api.fullScreen;
var iOS7StatusBarAppearance = api.iOS7StatusBarAppearance;
if (numSV >= 7 && !fullScreen && iOS7StatusBarAppearance) {
el.style.paddingTop = '20px';
}
}
};
u.fixStatusBar = function(el){
if(!u.isElement(el)){
console.warn('$api.fixStatusBar Function need el param, el param must be DOM Element');
return;
}
var sysType = api.systemType;
if(sysType == 'ios'){
u.fixIos7Bar(el);
}else if(sysType == 'android'){
var ver = api.systemVersion;
ver = parseFloat(ver);
if(ver >= 4.4){
el.style.paddingTop = '25px';
}
}
};
u.toast = function(title, text, time){
var opts = {};
var show = function(opts, time){
api.showProgress(opts);
setTimeout(function(){
api.hideProgress();
},time);
};
if(arguments.length === 1){
var time = time || 500;
if(typeof title === 'number'){
time = title;
}else{
opts.title = title+'';
}
show(opts, time);
}else if(arguments.length === 2){
var time = time || 500;
var text = text;
if(typeof text === "number"){
var tmp = text;
time = tmp;
text = null;
}
if(title){
opts.title = title;
}
if(text){
opts.text = text;
}
show(opts, time);
}
if(title){
opts.title = title;
}
if(text){
opts.text = text;
}
time = time || 500;
show(opts, time);
};
u.post = function(/*url,data,fnSuc,dataType*/){
var argsToJson = parseArguments.apply(null, arguments);
var json = {};
var fnSuc = argsToJson.fnSuc;
argsToJson.url && (json.url = argsToJson.url);
argsToJson.data && (json.data = argsToJson.data);
if(argsToJson.dataType){
var type = argsToJson.dataType.toLowerCase();
if (type == 'text'||type == 'json') {
json.dataType = type;
}
}else{
json.dataType = 'json';
}
json.method = 'post';
api.ajax(json,
function(ret,err){
if (ret) {
fnSuc && fnSuc(ret);
}
}
);
};
u.get = function(/*url,fnSuc,dataType*/){
var argsToJson = parseArguments.apply(null, arguments);
var json = {};
var fnSuc = argsToJson.fnSuc;
argsToJson.url && (json.url = argsToJson.url);
//argsToJson.data && (json.data = argsToJson.data);
if(argsToJson.dataType){
var type = argsToJson.dataType.toLowerCase();
if (type == 'text'||type == 'json') {
json.dataType = type;
}
}else{
json.dataType = 'text';
}
json.method = 'get';
api.ajax(json,
function(ret,err){
if (ret) {
fnSuc && fnSuc(ret);
}
}
);
};
/*end*/
window.$api = u;
})(window);

View File

@@ -0,0 +1,118 @@
/**
* aui-actionsheet.js
* @author 流浪男
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var auiActionsheet = function() {
};
var isShow = false;
auiActionsheet.prototype = {
init: function(params,callback){
this.frameBounces = params.frameBounces;
this.title = params.title;
this.buttons = params.buttons;
this.cancelTitle = params.cancelTitle;
this.destructiveTitle = params.destructiveTitle;
this.maskDiv;
this.actionsheetDiv;
var self = this;
self.open(params,callback);
},
open: function(params,callback) {
var titleHtml='',buttonsHtml='',destructiveHtml='',cancelHtml='',btnHtml='';
var self = this;
if(self.actionsheetDiv || (!self.title && !self.buttons && !self.cancelTitle && !self.destructiveTitle))return;
if(!self.maskDiv){
self.maskDiv = document.createElement("div");
self.maskDiv.className = "aui-mask";
document.body.appendChild(self.maskDiv);
}
self.actionsheetDiv = document.createElement("div");
self.actionsheetDiv.className = "aui-actionsheet";
document.body.appendChild(self.actionsheetDiv);
if(self.title){
titleHtml = '<div class="aui-actionsheet-title aui-border-b aui-font-size-12">'+self.title+'</div>';
}
if(self.buttons && self.buttons.length){
for(var i = 0; i < self.buttons.length;i++){
if(i == self.buttons.length-1){
buttonsHtml += '<div class="aui-actionsheet-btn-item">'+self.buttons[i]+'</div>';
}else{
buttonsHtml += '<div class="aui-actionsheet-btn-item aui-border-b">'+self.buttons[i]+'</div>';
}
}
}
if(self.destructiveTitle){
destructiveHtml = '<div class="aui-actionsheet-btn-item aui-border-t aui-text-danger">'+self.destructiveTitle+'</div>';
}else{
var destructiveHtml = '';
}
if(self.title || (self.buttons && self.buttons.length)){
btnHtml = '<div class="aui-actionsheet-btn">'+titleHtml+''+buttonsHtml+''+destructiveHtml+'</div>';
}
if(self.cancelTitle){
cancelHtml = '<div class="aui-actionsheet-btn"><div class="aui-actionsheet-btn-item">'+self.cancelTitle+'</div></div>';
}
self.actionsheetDiv.insertAdjacentHTML('beforeend', btnHtml+cancelHtml);
var actionsheetHeight = document.querySelector(".aui-actionsheet").offsetHeight;
self.maskDiv.classList.add("aui-mask-in");
self.actionsheetDiv.style.webkitTransform = self.actionsheetDiv.style.transform = "translate3d(0,0,0)";
self.actionsheetDiv.style.opacity = 1;
self.actionsheetDiv.addEventListener("touchmove", function(event){
event.preventDefault();
})
self.maskDiv.addEventListener("touchmove", function(event){
event.preventDefault();
})
if(typeof(api) != 'undefined' && typeof(api) == 'object' && self.frameBounces){
api.setFrameAttr({
bounces:false
});
}
var actionsheetButtons = document.querySelectorAll(".aui-actionsheet-btn-item");
if(actionsheetButtons && actionsheetButtons.length > 0){
setTimeout(function(){
self.maskDiv.onclick = function(){self.close();return;};
for(var ii = 0; ii < actionsheetButtons.length; ii++){
(function(e){
actionsheetButtons[e].onclick = function(){
if(callback){
callback({
buttonIndex: e+1,
buttonTitle: this.textContent
});
};
self.close();
return;
}
})(ii)
}
}, 350)
}
},
close: function(){
var self = this;
if(typeof(api) != 'undefined' && typeof(api) == 'object' && self.frameBounces){
api.setFrameAttr({
bounces:true
});
}
if(self.actionsheetDiv){
var actionsheetHeight = self.actionsheetDiv.offsetHeight;
self.actionsheetDiv.style.webkitTransform = self.actionsheetDiv.style.transform = "translate3d(0,"+actionsheetHeight+"px,0)";
self.maskDiv.style.opacity = 0;
setTimeout(function(){
if(self.maskDiv){
self.maskDiv.parentNode.removeChild(self.maskDiv);
}
self.actionsheetDiv.parentNode.removeChild(self.actionsheetDiv);
self.actionsheetDiv = self.maskDiv = false;
}, 300)
}
}
};
window.auiActionsheet = auiActionsheet;
})(window);

View File

@@ -0,0 +1,44 @@
/**
* aui-collapse.js
* @author 流浪男
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
(function( window, undefined ) {
"use strict";
var auiCollapse = function(params) {
this.init(params);
};
auiCollapse.prototype = {
init: function(params,callback){
var collapseHeader = document.querySelectorAll(".aui-collapse-header");
if(collapseHeader.length){
for(var i=0;i<collapseHeader.length;i++){
(function(e){
collapseHeader[e].onclick = function(){
if(collapseHeader[e].nextSibling.nextElementSibling.className.indexOf("aui-collapse-content") > -1){
if(collapseHeader[e].nextSibling.nextElementSibling.className.indexOf("aui-show") > -1){
collapseHeader[e].nextSibling.nextElementSibling.classList.remove("aui-show");
collapseHeader[e].classList.remove("aui-active");
}else{
if(params.autoHide){
if(document.querySelector(".aui-collapse-header.aui-active")){
document.querySelector(".aui-collapse-header.aui-active").classList.remove("aui-active");
}
if(document.querySelector(".aui-collapse-content.aui-show")){
document.querySelector(".aui-collapse-content.aui-show").classList.remove("aui-show");
}
}
collapseHeader[e].nextSibling.nextElementSibling.classList.toggle("aui-show");
collapseHeader[e].classList.toggle("aui-active");
}
}
}
})(i)
}
}
}
};
window.auiCollapse = auiCollapse;
})(window);

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