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,46 @@
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 usersRouter = require('./routes/users');
var typeRouter = require('./routes/type');
var app = express();
app.all('*', function (req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Content-Type');
res.header('Access-Control-Allow-Methods', '*');
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('/index', indexRouter);
app.use('/users', usersRouter);
app.use('/class', typeRouter)
// 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);
});
module.exports = app;

View File

@@ -0,0 +1,87 @@
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('myapp:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3000');
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 this: http://127.0.0.1:' + addr.port);
}

View File

@@ -0,0 +1,19 @@
module.exports = {
HomeUrl: 'https://m.zongheng.com/h5/index?h5=1',
typeUrl: 'https://m.zongheng.com/h5/category/nav?h5=1',
classInfoUrl: 'https://m.zongheng.com/h5/ajax/category/details',
bookInfoUrl: 'https://m.zongheng.com/h5/book?bookid=',
chapterListInfo: 'https://m.zongheng.com/h5/ajax/chapter/list?h5=1&bookId=',
chapterRead: 'https://m.zongheng.com/h5/ajax/chapter?bookId=',
mysql: {
host : '127.0.0.1',
user : 'root',
password : 'lb714500',
database : 'xiaoshuo',
connectionLimit : 10
},
sql: {
userlogin: 'select id,user_name from user where user_name = ? and user_pwd = ?',
usercollect: 'INSERT INTO `like` ( user_userid , like_bookid ) VALUES (?,? )'
}
}

View File

@@ -0,0 +1,14 @@
const mysql = require('yn-mysql-utils');
const config = require('../config')
class DB {
constructor () {
this.db = new mysql(config.mysql)
}
async Query (params) {
return await this.db.Query(params)
}
}
module.exports = new DB()

View File

@@ -0,0 +1,24 @@
const request = require('request');
const config = require('../config');
class HttRequest {
get (params) {
return new Promise(function(resolve,reject){
var options = {
url: params.url,
headers: {
'User-Agent': 'Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Mobile Safari/537.36'
}
};
request(options, function (error, response, body) {
if (error) {
reject(error.message);
} else {
resolve(body)
}
});
})
}
}
module.exports = new HttRequest();

View File

@@ -0,0 +1,18 @@
{
"name": "myapp",
"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.0",
"yn-mysql-utils": "^1.0.4"
}
}

View File

@@ -0,0 +1,80 @@
const express = require('express');
const router = express.Router();
const $http = require('../http');
const config = require('../config');
const utils = require('../utils');
router.get('/', async function(req, res, next) {
try {
let $ = utils.cheerioLoad(await $http.get({ url: config.HomeUrl }));
let MainData = {
banner: [],
booklist: []
};
// 抓取banner轮播图数据
let BannerData = []
$(".slider-top-pic li").each(function() {
BannerData.push({
imgUrl: $(this).find('img').attr("src"),
href: 'https://m.zongheng.com' + $(this).attr("data-url")
})
});
MainData.banner = BannerData
// 抓取 编辑力荐begin 的数据
let HomeTop = {}
HomeTop.title = $(".home-top .home-card-title i").text()
HomeTop.list = []
$('.home-top .home-book-item').each(function() {
HomeTop.list.push({
imgUrl: $(this).find("img").attr("src"),
title: $(this).find("img").attr("alt"),
id: utils.getUrlParam($(this).attr("data-url"),"bookid"),
desc: $(this).find(".desc").text(),
class: $(this).find(".item-label").text()
})
});
MainData.booklist.push(HomeTop)
// 男生必读 & 女生爱看
let HomeBoy = {}
HomeBoy.title = $(".home-boy .home-card-title i").text()
HomeBoy.list = []
$('.home-boy .home-book-box').each(function() {
HomeBoy.list.push({
imgUrl: $(this).find("img").attr("data-src"),
title: $(this).find("img").attr("alt"),
id: utils.getUrlParam($(this).attr("data-url"),"bookid"),
desc: "",
class: ""
})
});
MainData.booklist.push(HomeBoy)
// 仙侠奇幻
let xianBook = {}
let xian = $(".home-card")[3]
xianBook.title = $(xian).find(".home-card-title .flex--fluid").text()
xianBook.top = {
imgUrl: $(xian).find(".book-img-border img").attr("data-src"),
title: $(xian).find(".font-a").text(),
id: utils.getUrlParam($(xian).find(".home-book-item").attr("data-url"),"bookid"),
desc: $(xian).find(".desc").text(),
class: $(xian).find(".item-label").text(),
}
xianBook.list = []
$(xian).find(".home-row-line").each(function() {
xianBook.list.push({
title: $(this).find("span").text(),
id: utils.getUrlParam($(this).attr("href"),"bookid")
})
})
MainData.booklist.push(xianBook)
utils.JsonData({ res: res, status: 200, data: MainData })
} catch (error) {
utils.JsonData({ res: res, status: 404, data: error.message })
}
});
module.exports = router;

View File

@@ -0,0 +1,147 @@
const express = require('express');
const router = express.Router();
const $http = require('../http');
const config = require('../config');
const utils = require('../utils');
/**
* 获取小说所有分类
* http://127.0.0.1:3000/class/allClass
*/
router.get('/allClass', async function(req, res, next) {
try {
let $ = utils.cheerioLoad(await $http.get({ url: config.typeUrl }));
let typeList = []
$(".cat_box").each(function(i) {
typeList.push({
title: $(this).find(".cat_tit .cat_more").prev().text(),
pid: utils.getUrlParam($(this).find(".cat_tit .cat_more").prev().attr("href"), "cPid")
});
typeList[i]['child'] = []
$(this).find(".cat_list li").each(function() {
typeList[i]['child'].push({
text: $(this).find("a").text(),
cid: utils.getUrlParam($(this).find("a").attr("href"), "cid")
})
})
});
utils.JsonData({ res: res, status: 200, data: typeList })
} catch (error) {
utils.JsonData({ res: res, status: 404, data: error.message })
}
});
/**
* 获取对应小说分类的数据
* http://127.0.0.1:3000/class/classInfo?cPid=1&cid=1001&pageNum=1
* cid == -1 表示请求大分类数据
* cid != -1 表示请求大分类下小分类的数据
*/
router.get('/classInfo', async function(req, res, next) {
let cPid = parseInt(req.query.cPid),
cid = parseInt(req.query.cid),
pageNum = req.query.pageNum,
url = null;
if (cid == -1) {
url = `${config.classInfoUrl}?cPid=${cPid}&cid=-1&type=1&pageSize=10&pageNum=${pageNum}&bookType=0&callback=jsonp1`
} else {
url = `${config.classInfoUrl}?cPid=${cPid}&cid=${cid}&type=1&pageSize=10&pageNum=${pageNum}&bookType=0&callback=jsonp1`
}
try {
let data = JSON.parse((await $http.get({ url: url })).match(/jsonp1\(([\s\S]*?)\)/)[1]);
data.ranklist.forEach((val) => val.coverUrl = 'https://static.zongheng.com/upload/s_image'+val.coverUrl);
utils.JsonData({ res: res, status: 200, data: data })
} catch (error) {
utils.JsonData({ res: res, status: 404, data: error.message })
}
});
/**
* 进入小说详情
* http://127.0.0.1:3000/class/bookInfo?bookid=722486
*/
router.get('/bookInfo', async function(req, res, next) {
try {
let bookid = req.query.bookid;
let $ = utils.cheerioLoad(await $http.get({ url: config.bookInfoUrl+bookid }));
let bookInfo = {};
bookInfo.imgurl = $('.bookimg img').attr("src")
bookInfo.title = $('.booksite .bookname').text()
bookInfo.author = $($('.booksite .info div')[0]).find("span").text()
bookInfo.type = $($('.booksite .info div')[1]).find("span").text()
bookInfo.wordNum = $($('.booksite .info div')[2]).find("span").text()
bookInfo.readNum = $($('.booksite .info div')[3]).find("span").text()
bookInfo.desc = $(".book_intro").text()
bookInfo.newitem = {
text: $('.booksite #lastupdate .last_tit').text(),
zid: $('.booksite #lastupdate').attr("chapterid")
}
bookInfo.zjList = [];
$("#coverl_atz a").each(function() {
bookInfo.zjList.push({
text: $(this).text(),
zid: utils.getUrlParam($(this).attr("href"),"cid")
})
})
utils.JsonData({ res: res, status: 200, data: bookInfo })
} catch (error) {
utils.JsonData({ res: res, status: 404, data: error.message })
}
});
/**
* 获取小说的所有章节目录
* http://127.0.0.1:3000/class/chapterList?bookid=722486&pageNum=1
*/
router.get('/chapterList', async function(req, res, next) {
try {
let bookid = req.query.bookid,
pageNum = req.query.pageNum;
let url = `${config.chapterListInfo}${bookid}&pageNum=${pageNum}&pageSize=20&chapterId=&asc=0&callback=jsonp1`
let data = JSON.parse((await $http.get({ url: url })).match(/jsonp1\(([\s\S]*?)\)/)[1]);
utils.JsonData({ res: res, status: 200, data: data })
} catch (error) {
utils.JsonData({ res: res, status: 404, data: error.message })
}
});
/**
* 获取小说章节的内容
* http://127.0.0.1:3000/class/chapterRead?bookid=722486&chapterId=39865789
*/
router.get('/chapterRead', async function(req, res, next) {
try {
let bookid = req.query.bookid,
chapterId = req.query.chapterId;
let url = `${config.chapterRead}${bookid}&chapterId=${chapterId}&v=1565096009107&callback=jsonp1`
let data = JSON.parse((await $http.get({ url: url })).match(/jsonp1\(([\s\S]*?)\)/)[1]);
utils.JsonData({ res: res, status: 200, data: data })
} catch (error) {
utils.JsonData({ res: res, status: 404, data: error.message })
}
});
/**
* 点击章节目录开始阅读章节
* http://127.0.0.1:3000/class/chapterRead?bookid=722486&chapterId=39865789
*/
router.get('/chapterRead', async function(req, res, next) {
try {
let bookid = req.query.bookid,
chapterId = req.query.chapterId;
let url = `${config.chapterRead}${bookid}&chapterId=${chapterId}&callback=jsonp2`
console.log(url)
let data = JSON.parse((await $http.get({ url: url })).match(/jsonp2\(([\s\S]*?)\)/)[1]);
utils.JsonData({ res: res, status: 200, data: data })
} catch (error) {
utils.JsonData({ res: res, status: 404, data: error.message })
}
});
module.exports = router;

View File

@@ -0,0 +1,41 @@
var express = require('express');
var router = express.Router();
var db = require("../db");
var config = require("../config")
var utils = require('../utils');
router.get('/getAll', async function(req, res, next) {
let da = await db.Query({
sql: 'select * from user',
par: []
})
res.json(da);
});
router.post('/userLogin', async function(req, res, next) {
var username = req.body.username,
userpwd = req.body.userpwd;
let da = await db.Query({
sql: config.sql.userlogin,
par: [ username, userpwd ]
})
da.length ==0 ? utils.JsonData({ res: res, status: 404, data: "账户密码错误" }):
utils.JsonData({ res: res, status: 200, data: da[0] })
});
router.post('/collection', async function(req, res, next) {
var bookid = req.body.bookid,
uid = req.body.id;
console.log(uid,bookid)
let da = await db.Query({
sql: config.sql.usercollect,
par: [uid, bookid]
})
da.length == 0 ? utils.JsonData({ res: res, status: 404, data: "收藏出错" }):
utils.JsonData({ res: res, status: 200, data: '收藏成功' })
});
module.exports = router;

View File

@@ -0,0 +1,23 @@
const cheerio = require('cheerio')
class utils {
cheerioLoad(html) {
return cheerio.load(html)
}
JsonData (params) {
params.res.json({
status: params.status,
data: params.data
})
}
getUrlParam (path,name) {
path = "?"+path.split("?")[1]
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
var r = path.substr(1).match(reg);
if (r != null) return decodeURIComponent(r[2]); return null;
}
}
module.exports = new utils()

View File

@@ -0,0 +1,11 @@
明天实现 uniapp 首页界面
参考地址:https://m.zongheng.com/
课下任务:
1:实现 小说目录 的接口
小说接口:
https://m.zongheng.com/h5/ajax/chapter?bookId=576044&chapterId=33048748&v=1565096009107&callback=jsonp1

View File

@@ -0,0 +1,31 @@
<script>
export default {
}
</script>
<style lang="less">
ul {
margin: 0;
padding: 0;
}
li {
list-style: none;
}
uni-swiper {
.uni-swiper-dots-horizontal {
bottom: 19px !important;
}
}
.book {
.uni-list-item__container {
padding: 12px 0 !important;
}
.uni-list-item__container::after {
left: 0 !important;
}
}
@import url("./static/css/uni.css");
@import "./common/less/page/my.less";
</style>

View File

@@ -0,0 +1,14 @@
export default {
BaseUrl: 'http://127.0.0.1:3000',
apiUrl: {
index: '/index',
info: '/class/bookInfo',
userLogin: '/users/userLogin',
addLike: '/users/collection',
checkIslike: '/users/checkIslike',
selectUserBook: '/users/selectUserBook',
getClass: '/class/allClass',
getClassify:'/class/classInfo',
startRead: '/class/chapterRead'
}
}

View File

@@ -0,0 +1,74 @@
import config from "./config.js"
class Http {
constructor() {
}
get (params) {
uni.showLoading({
title: '加载中'
});
return new Promise(function(resolve, reject) {
uni.request({
url: `${config.BaseUrl}${params.url}`, //仅为示例,并非真实接口地址。
data: params.data || {},
method: 'GET',
header: params.header || {},
success: (res) => {
uni.hideLoading();
if(res.data.status == 200) {
resolve(res.data.data)
} else {
uni.showToast({
title: res.data.data,
duration: 2000
});
}
},
fail: (error) => {
uni.hideLoading();
uni.showToast({
title: error.message,
duration: 2000
});
}
});
})
}
post (params) {
uni.showLoading({
title: '加载中'
});
return new Promise(function(resolve, reject) {
uni.request({
url: `${config.BaseUrl}${params.url}`, //仅为示例,并非真实接口地址。
data: params.data || {},
method: 'POST',
header: params.header || {},
success: (res) => {
uni.hideLoading();
if(res.data.status == 200) {
resolve(res.data.data)
} else {
resolve(res.data.data)
uni.showToast({
title: res.data.data,
duration: 2000
});
}
},
fail: (error) => {
uni.hideLoading();
uni.showToast({
title: error.message,
duration: 2000
});
}
});
})
}
}
export default new Http()

View File

@@ -0,0 +1,4 @@
import index from "./index";
import info from "./info";
import user from "./user";
export default { ...index, ...info, ...user }

View File

@@ -0,0 +1,14 @@
import Http from "../http.js"
import config from "../config"
export default {
async getIndexData(params) {
return await Http.get({ url: config.apiUrl.index, data: params.data, header: params.header })
},
async getClass(params) {
return await Http.get({ url: config.apiUrl.getClass, data: params.data, header: params.header })
},
async getClassify(params){
return await Http.get({ url: config.apiUrl.getClassify, data: params.data, header: params.header })
}
}

View File

@@ -0,0 +1,11 @@
import Http from "../http.js"
import config from "../config"
export default {
async getBookInfo(params) {
return await Http.get({ url: config.apiUrl.info, data: params.data, header: params.header })
},
async startRead(params) {
return await Http.get({ url: config.apiUrl.startRead, data: params.data, header: params.header })
}
}

View File

@@ -0,0 +1,20 @@
import Http from "../http.js"
import config from "../config"
export default {
async userLogin(params) {
return await Http.post({ url: config.apiUrl.userLogin, data: params.data, header: params.header })
},
async addLike(params) {
return await Http.post({ url: config.apiUrl.addLike, data: params.data, header: params.header })
},
async checkBook(params) {
return await Http.post({ url: config.apiUrl.checkIslike, data: params.data, header: params.header })
},
async selectUserBook(params) {
return await Http.post({ url: config.apiUrl.selectUserBook, data: params.data, header: params.header })
}
}

View File

@@ -0,0 +1,24 @@
export default {
enterInfo(id) {
uni.navigateTo({
url: `/pages/bookinfo/bookinfo?id=${id}`
});
},
checkLogin () {
if (localStorage.getItem("LoginStatus") == null) {
return false;
} else {
return true;
}
},
// 写本地
setLocalStorage(name,value) {
localStorage.setItem(name, JSON.stringify(value))
},
// 读本地
getLocalStorage(name) {
return JSON.parse(localStorage.getItem(name))
},
}

View File

@@ -0,0 +1,22 @@
// 商家主题颜色
@background : #4c86f7;
@pagebackground : #ffffff;
@backgroundF5 : #f5f5f5;
// 字体颜色
@color1 : #4f6d95;
@color2 : #0e2f5e;
@color3 : #333333;
@color4 : #4c86f7;
@color8F : #8f8f8f;
@color81 : #818181;
@colorR : #ed3534;
// 登录页input下边线颜色
@inputbottomline : #e5e5e5;
// 订单详情页背景颜色
@infoBackground : #f7f7f7;
// 卡片背景颜色
@unitBbcolor : #ffffff;

View File

@@ -0,0 +1,3 @@
@import "./reset.less" ;
@import "./color.less" ;
@import "./mixin.less" ;

View File

@@ -0,0 +1,27 @@
// 弹性盒子 水平垂直居中
.alineCenter{
display : flex;
justify-content: center;
align-items: center;
}
// 弹性盒子 多元素垂直居中
.verticalCenter{
display: flex;
flex-flow: column;
align-items: center;
}
// 弹性盒子 单行元素水平居中
.levelCenter{
display: flex;
align-items: center;
}
// 设置下边线
.undeLine(@backgroundColor,@bottom){
content: "";
width: 100%;
height: 2upx;
background-color: @backgroundColor;
position: absolute;
left: 0;
bottom: @bottom;
}

View File

@@ -0,0 +1,20 @@
body {margin:0; padding:0; font:12px/1.5 helvetica,arial,"Microsoft YaHei",\5b8b\4f53;}
div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,blockquote,p{padding:0; margin:0;}
table,td,tr,th{font-size:12px;}
ol,ul {list-style:none;}
li{list-style-type:none;}
img{vertical-align:top;border:0;max-width: 100%; height:auto;}
h1,h2,h3,h4,h5,h6{font-size:inherit; font-weight:normal;}
address,cite,code,em,th,i,var{font-weight:normal; font-style:normal;}
.clearfix{zoom:1;}
.clearfix:after{display:block; overflow:hidden; clear:both; height:0; visibility:hidden; content:".";}
a:link,a:visited
{
color:#000;
text-decoration: none;
}
input
{
outline: 0;
outline: none;
}

View File

@@ -0,0 +1,143 @@
@import "../lib/index.less";
.a(){
width: 50%;
height: 50px;
text-align: center;
line-height: 50px;
color: #fff;
}
.bookinfo {
.info-title {
height: 440upx;
position: relative;
overflow: hidden;
.title-background {
height: 100%;
background-repeat: no-repeat !important;
background-size: cover !important;
filter: blur(7px) !important;
}
.title-top {
position: absolute;
left: 0;
top: 0;
z-index: 2;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: space-around;
background: linear-gradient(#ffffff00, #ffffff);
img {
width: 190upx;
height: 240upx;
}
.title-top-right {
h3 {
color: white;
font-size: 40upx;
}
p {
color: #6b6b6b;
margin-top: 20upx;
font-size: 32upx;
.author{color: firebrick}
}
}
}
}
.info-message{
padding: 20upx 30upx;
ul{
display: flex;
align-items: center;
justify-content: space-around;
li{
text-align: center;
.readNum{
color: #929292;
font-size: 40upx;
}
.readP{
color: #929292;
font-size: 32upx;
}
}
}
}
.info-desc{
padding: 20upx 30upx;
h4{font-size: 36upx;color: #929292}
.descCont{
margin-top: 20upx;
font-size: 28upx;
text-indent: 2em;
color: #929292;
}
}
.chapter{
margin-top: 10upx;
padding: 10upx 0 0 0;
.chapterTitle{
padding: 10upx;
padding-left: 20upx;
background-color: #f4f4f4;
}
.chapterList{
padding:0 30upx;
.chapterTxt{
padding: 20upx 10upx;
color: #4c4c4c;
border-bottom: 2upx solid #dfdfdf;
}
}
}
.recommend{
padding: 10upx 0;
.recommendTitle{
background-color: #f2f2f2;
border-top: 2upx solid #dfdfdf;
border-bottom: 2upx solid #dfdfdf;
padding: 10upx 20upx;
}
ul {
padding-bottom: 50px;
}
.recommendList{
display: flex;
flex-flow: row;
padding: 20upx 10upx;
margin: 0 20upx;
border-bottom: 2upx solid #dfdfdf;
image{width: 148upx;height: 180upx;}
.bookMsg{
color: #929292;
.bookName{color: #4c4c4c;}
.bookAuthor , .bookType{
font-size: 26upx;
}
}
}
}
.action {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 50px;
background: #fff;
display: flex;
align-items: center;
justify-content: space-around;
.action-read {
.a();
color: #000;
}
.action-like {
.a();
background: red;
}
}
}

View File

@@ -0,0 +1,78 @@
@import "../lib/index.less";
.login{
.uni-page-head{
background-color: #ffffff !important;
}
.userIcon{
width: 100%;
height: 316upx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
.headericon{
width: 135upx;
height: 135upx;
image{
width: 135upx;
height: 135upx;
}
}
}
.loginForm{
padding: 0 90upx;
.inputBox{
margin-bottom: 50upx;
border-bottom: 1upx solid @inputbottomline;
label{
display: flex;
align-items: center;
span{
color: @color3;
display: inline;
}
input{
display: inline-block;
background: none;
}
.username{
padding-left: 24upx;
}
.password{
padding-left: 24upx;
}
}
}
.signIn{
height: 88upx;
background-color: @background;
border-radius: 44upx;
font-size: 32upx;
margin-top: 90upx;
font-weight: normal;
font-stretch: normal;
letter-spacing: 0upx;
color: #ffffff;
}
}
.agree{
width: 100%;
text-align: center;
margin-top: 40upx;
font-size: 26upx;
font-weight: normal;
font-stretch: normal;
.label{color: #a9a9a9;}
a{color: @background; display: inline-block}
}
}

View File

@@ -0,0 +1,7 @@
@import "../lib/index.less";
.my {
.hhhh {
color: red
}
}

View File

@@ -0,0 +1,99 @@
<template>
<text v-if="text" :class="inverted ? 'uni-badge-' + type + ' uni-badge--' + size + ' uni-badge-inverted' : 'uni-badge-' + type + ' uni-badge--' + size" class="uni-badge" @click="onClick()">{{ text }}</text>
</template>
<script>
export default {
name: 'UniBadge',
props: {
type: {
type: String,
default: 'default'
},
inverted: {
type: Boolean,
default: false
},
text: {
type: [String, Number],
default: ''
},
size: { // small.normal
type: String,
default: 'normal'
}
},
methods: {
onClick() {
this.$emit('click')
}
}
}
</script>
<style>
@charset "UTF-8";
.uni-badge {
font-family: 'Helvetica Neue', Helvetica, sans-serif;
box-sizing: border-box;
font-size: 12px;
line-height: 1;
display: inline-block;
padding: 3px 6px;
color: #333;
border-radius: 100px;
background-color: #f1f1f1
}
.uni-badge.uni-badge-inverted {
padding: 0 5px 0 0;
color: #999;
background-color: transparent
}
.uni-badge-primary {
color: #fff;
background-color: #007aff
}
.uni-badge-primary.uni-badge-inverted {
color: #007aff;
background-color: transparent
}
.uni-badge-success {
color: #fff;
background-color: #4cd964
}
.uni-badge-success.uni-badge-inverted {
color: #4cd964;
background-color: transparent
}
.uni-badge-warning {
color: #fff;
background-color: #f0ad4e
}
.uni-badge-warning.uni-badge-inverted {
color: #f0ad4e;
background-color: transparent
}
.uni-badge-error {
color: #fff;
background-color: #dd524d
}
.uni-badge-error.uni-badge-inverted {
color: #dd524d;
background-color: transparent
}
.uni-badge--small {
transform: scale(.8);
transform-origin: center center
}
</style>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,199 @@
<template>
<view :class="disabled ? 'uni-list-item--disabled' : ''" :hover-class="disabled || showSwitch ? '' : 'uni-list-item--hover'" class="uni-list-item" @click="onClick">
<view class="uni-list-item__container">
<view v-if="thumb" class="uni-list-item__icon">
<image :src="thumb" class="uni-list-item__icon-img" />
</view>
<view v-else-if="showExtraIcon" class="uni-list-item__icon">
<uni-icon class="uni-icon-wrapper" :color="extraIcon.color" :size="extraIcon.size" :type="extraIcon.type" />
</view>
<view class="uni-list-item__content">
<view class="uni-list-item__content-title">{{ title }}</view>
<view v-if="note" class="uni-list-item__content-note">{{ note }}</view>
</view>
<view v-if="showBadge || showArrow || showSwitch" class="uni-list-item__extra">
<uni-badge v-if="showBadge" :type="badgeType" :text="badgeText" />
<switch v-if="showSwitch" :disabled="disabled" :checked="switchChecked" @change="onSwitchChange" />
<uni-icon class="uni-icon-wrapper" v-if="showArrow" :size="20" color="#bbb" type="arrowright" />
</view>
</view>
</view>
</template>
<script>
import uniIcon from '../uni-icon/uni-icon.vue'
import uniBadge from '../uni-badge/uni-badge.vue'
export default {
name: 'UniListItem',
components: {
uniIcon,
uniBadge
},
props: {
title: {
type: String,
default: ''
}, // 列表标题
note: {
type: String,
default: ''
}, // 列表描述
disabled: { // 是否禁用
type: Boolean,
default: false
},
showArrow: { // 是否显示箭头
type: Boolean,
default: true
},
showBadge: { // 是否显示数字角标
type: Boolean,
default: false
},
showSwitch: { // 是否显示Switch
type: Boolean,
default: false
},
switchChecked: { // Switch是否被选中
type: Boolean,
default: false
},
badgeText: {
type: [String, Number],
default: ''
}, // badge内容
badgeType: { // badge类型
type: String,
default: 'success'
},
thumb: {
type: String,
default: ''
}, // 缩略图
showExtraIcon: { // 是否显示扩展图标
type: Boolean,
default: false
},
extraIcon: {
type: Object,
default () {
return {
type: 'contact',
color: '#000000',
size: 20
}
}
}
},
data() {
return {
}
},
methods: {
onClick() {
this.$emit('click')
},
onSwitchChange(e) {
this.$emit('switchChange', e.detail)
}
}
}
</script>
<style>
@charset "UTF-8";
.uni-list-item {
font-size: 32upx;
position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center
}
.uni-list-item--disabled {
opacity: .3
}
.uni-list-item--hover {
background-color: #f1f1f1
}
.uni-list-item__container {
padding: 24upx 30upx;
width: 100%;
box-sizing: border-box;
flex: 1;
position: relative;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center
}
.uni-list-item__container:after {
position: absolute;
z-index: 3;
right: 0;
bottom: 0;
left: 30upx;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
background-color: #c8c7cc
}
.uni-list-item__content {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column
}
.uni-list-item__content-title {
font-size: 32upx;
text-overflow: ellipsis;
white-space: nowrap;
color: inherit;
line-height: 1.5;
overflow: hidden
}
.uni-list-item__content-note {
color: #999;
font-size: 28upx;
white-space: normal;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden
}
.uni-list-item__extra {
width: 25%;
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center
}
.uni-list-item__icon {
margin-right: 18upx;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center
}
.uni-list-item__icon-img {
height: 52upx;
width: 52upx
}
.uni-list>.uni-list-item:last-child .uni-list-item-container:after {
height: 0
}
</style>

View File

@@ -0,0 +1,47 @@
<template>
<view class="uni-list">
<slot />
</view>
</template>
<script>
export default {
name: 'UniList'
}
</script>
<style>
@charset "UTF-8";
.uni-list {
background-color: #fff;
position: relative;
width: 100%;
display: flex;
flex-direction: column
}
.uni-list:after {
position: absolute;
z-index: 10;
right: 0;
bottom: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
background-color: #c8c7cc
}
.uni-list:before {
position: absolute;
z-index: 10;
right: 0;
top: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
background-color: #c8c7cc
}
</style>

View File

@@ -0,0 +1,114 @@
<template>
<view :class="{ text: styleType === 'text' }" :style="{ borderColor: styleType === 'text' ? '' : activeColor }" class="segmented-control">
<view v-for="(item, index) in values" :class="[{ text: styleType === 'text' }, { active: index === currentIndex }]" :key="index" :style="{
color:
index === currentIndex
? styleType === 'text'
? activeColor
: '#fff'
: styleType === 'text'
? '#000'
: activeColor,
backgroundColor: index === currentIndex && styleType === 'button' ? activeColor : ''
}" class="segmented-control-item" @click="_onClick(index)">
{{ item }}
</view>
</view>
</template>
<script>
export default {
name: 'UniSegmentedControl',
props: {
current: {
type: Number,
default: 0
},
values: {
type: Array,
default () {
return []
}
},
activeColor: {
type: String,
default: '#007aff'
},
styleType: {
type: String,
default: 'button'
}
},
data() {
return {
currentIndex: 0
}
},
watch: {
current(val) {
if (val !== this.currentIndex) {
this.currentIndex = val
}
}
},
created() {
this.currentIndex = this.current
},
methods: {
_onClick(index) {
if (this.currentIndex !== index) {
this.currentIndex = index
this.$emit('clickItem', index)
}
}
}
}
</script>
<style>
@charset "UTF-8";
.segmented-control {
display: flex;
flex-direction: row;
justify-content: center;
width: 100%;
font-size: 28upx;
box-sizing: border-box;
margin: 0 auto;
overflow: hidden;
border: 1px solid;
border-radius: 10upx
}
.segmented-control.text {
border: 0;
border-radius: 0;
position: relative;
}
.segmented-control-item {
flex: 1;
text-align: center;
line-height: 60upx;
box-sizing: border-box;
border-left: 1px solid
}
.segmented-control-item.active {
color: #fff
}
.segmented-control-item.text {
border-left: 0;
color: #000
}
.segmented-control-item.text.active {
border-bottom-style: solid;
border-bottom:2px solid #4c86f7;
}
.segmented-control-item:first-child {
border-left-width: 0
}
</style>

View File

@@ -0,0 +1,17 @@
import Vue from 'vue'
import App from './App'
import Http from "./common/js/service/import"
import store from './store/index.js'
import utils from './common/js/utils.js'
Vue.config.productionTip = false
Vue.prototype.$http = Http
Vue.prototype.$utils = utils
App.mpType = 'app'
const app = new Vue({
store,
...App
})
app.$mount()

View File

@@ -0,0 +1,80 @@
{
"name" : "appFont",
"appid" : "__UNI__1E9BEEA",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
/* 5+App特有相关 */
"app-plus": {
"usingComponents": true,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* 模块配置 */
"modules": {
},
/* 应用发布信息 */
"distribute": {
/* android打包配置 */
"android": {
"permissions": ["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios": {
},
/* SDK配置 */
"sdkConfigs": {
}
}
},
/* 快应用特有相关 */
"quickapp": {
},
/* 小程序特有相关 */
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false
},
"usingComponents": true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
}
}

View File

@@ -0,0 +1,101 @@
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/city/city",
"style": {
"navigationBarTitleText": "书城"
}
},
{
"path": "pages/book/book",
"style": {
"navigationBarTitleText": "书架"
}
},
{
"path": "pages/class/class",
"style": {
"navigationBarTitleText": "分类"
}
},
{
"path": "pages/class/classify",
"style": {
"onReachBottomDistance": 20,
"navigationBarTitleText": ""
}
},
{
"path": "pages/my/my",
"style": {
"navigationStyle":"custom",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTitleText": ""
}
},
{
"path": "pages/my/login",
"style": {
"navigationStyle":"custom",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTitleText": "登录"
}
},
{
"path": "pages/bookinfo/bookinfo",
"style": {
"navigationBarTitleText": "",
"app-plus": {
"titleNView": {
"type": "default" //transparent
}
}
}
},
{
"path": "pages/bookinfo/read",
"style": {
"navigationBarTitleText": "读书",
"onReachBottomDistance": 20
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#ff0",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#3cc51f",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/book/book",
"iconPath": "static/book.png",
"selectedIconPath": "static/book.png",
"text": "书架"
},
{
"pagePath": "pages/city/city",
"iconPath": "static/city.png",
"selectedIconPath": "static/city.png",
"text": "书城"
},
{
"pagePath": "pages/class/class",
"iconPath": "static/class.png",
"selectedIconPath": "static/class.png",
"text": "分类"
},
{
"pagePath": "pages/my/my",
"iconPath": "static/my.png",
"selectedIconPath": "static/my.png",
"text": "我的"
}
]
}
}

View File

@@ -0,0 +1,45 @@
<template>
<div class="book">
<view class="uni-list">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(value, key) in listData" :key="key" @click="goDetail(value)">
<view class="uni-media-list">
<image class="uni-media-list-logo" :src="value.cover"></image>
<view class="uni-media-list-body">
<view class="uni-media-list-text-top">{{ value.title }}</view>
<view class="uni-media-list-text-bottom">
<text>{{ value.author_name }}</text>
<text>{{ value.published_at }}</text>
</view>
</view>
</view>
</view>
</view>
</div>
</template>
<script>
export default {
data() {
return {
listData: []
}
},
onLoad() {
this.getBootList()
},
methods: {
async getBootList () {
let data = await this.$http.selectUserBook({
data: {
id: (JSON.parse(localStorage.getItem("LoginStatus"))).id
}
});
console.log(data)
this.listData = data
}
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,142 @@
<template>
<div class="bookinfo">
<!-- background: url('infoData.imgurl'); -->
<div class="info-title">
<div class="title-background" :style="{ background: 'url('+infoData.imgurl+')' }"></div>
<div class="title-top">
<img :src="infoData.imgurl"/>
<div class="title-top-right">
<h3>{{ infoData.title }}</h3>
<p><span class="author">{{ infoData.author }}</span> | {{ infoData.type }}</p>
</div>
</div>
</div>
<div class="info-message">
<ul>
<li>
<h3 class="readNum">{{ infoData.readNum }}</h3>
<p class="readP">阅读次数</p>
</li>
<li>
<h3 class="readNum">{{ infoData.wordNum }}</h3>
<p class="readP">已更字数</p>
</li>
</ul>
</div>
<div class="info-desc">
<h4>简介</h4>
<p class="descCont">{{ infoData.desc }}</p>
</div>
<!-- 章节目录 -->
<view class="chapter">
<h4 class="chapterTitle">章节目录</h4>
<ul class="chapterList">
<li class="chapterTxt" v-for="(item,index) in infoData.zjList" :key="index">{{ item.text }}</li>
</ul>
</view>
<!-- 推荐 -->
<view class="recommend">
<view class="recommendTitle">喜欢过 {{ infoData.title }} 的人还喜欢 ...</view>
<ul class="recommendUl">
<li class="recommendList" v-for="(items,index) in GET_HOTLIST.list"
:key="index" @click="$utils.enterInfo(items.id)">
<image :src="items.imgUrl" mode="aspectFit"></image>
<view class="bookMsg">
<p class="bookName">{{items.title}}</p>
<p class="bookType">{{items.class}}</p>
</view>
</li>
</ul>
</view>
<view class="action">
<view class="action-read" @click="startRead()">
开始阅读
</view>
<view :class="[ isdouleClick ? 'red action-like' : 'blak action-like']" @click="isdouleClick ? addLike() : '' ">
加入收藏
</view>
</view>
</div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
data() {
return {
isdouleClick: true,
bookid: null,
infoData: {}
}
},
onLoad(option) {
this.bookid = option.id
this.checkBook()
},
onReady () {
this.getIndexData();
},
methods: {
async startRead() {
uni.navigateTo({
url: `/pages/bookinfo/read?bookid=${this.bookid}&chapterId=${this.infoData.zjList[0].zid}`
});
},
async checkBook() {
let data = await this.$http.checkBook({
data: {
bookid: this.bookid,
id: (JSON.parse(localStorage.getItem("LoginStatus"))).id
}
});
if(data != "没有收藏本书") {
this.isdouleClick = false
}
},
async addLike () {
if(this.$utils.checkLogin()) {
let data = await this.$http.addLike({
data: {
bookid: this.bookid,
id: (JSON.parse(localStorage.getItem("LoginStatus"))).id
}
});
this.isdouleClick = false
} else {
uni.navigateTo({
url: '/pages/my/login'
});
}
},
async getIndexData() {
let data = await this.$http.getBookInfo({
data: {
bookid: this.bookid
}
});
this.infoData = data;
uni.setNavigationBarTitle({
title: data.title
});
}
},
computed: {
...mapGetters([
'GET_HOTLIST'
])
}
}
</script>
<style lang="less">
.red{
background: red;
}
.blak {
background: #8d8d8d !important;
}
@import "./../../common/less/page/bookinfo.less";
</style>

View File

@@ -0,0 +1,133 @@
<template>
<view class="read">
<scroll-view style="height: 100%;" scroll-y="true" @scroll="scroll">
<rich-text :nodes="nodes"></rich-text>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
bookid: null,
chapterId: null,
nodes: [],
history: localStorage.getItem("history") == null ? [] : JSON.parse(localStorage.getItem("history")),
currentIndex: null
}
},
onLoad(data) {
this.chapterId = data.chapterId;
this.bookid = data.bookid;
var status = true;
if(this.history.length != 0){
this.history.forEach((val,index) => {
// 如果该书已经被阅读过,那么status true,没有阅读 false
if (val.bookid == data.bookid) {
this.currentIndex = index
status = true
} else {
status = false
}
})
if (status) {
this.chapterId = this.history[this.currentIndex].chapterId;
this.bookid = data.bookid;
} else {
this.history.push({
bookid: data.bookid,
chapterId: data.chapterId
})
localStorage.setItem("history", JSON.stringify(this.history))
}
}
this.getReadList();
},
onReachBottom() {
this.getReadList();
},
methods: {
scroll(e) {
console.log(e)
},
async getReadList () {
if(this.history.length == 0){
this.history.push({
bookid: this.bookid,
chapterId: this.chapterId
})
localStorage.setItem("history", JSON.stringify(this.history))
} else {
this.history.forEach((val,index) => {
// 如果该书已经被阅读过,那么status true,没有阅读 false
if (val.bookid == this.bookid) {
this.currentIndex = index
status = true
} else {
status = false
}
});
if (status) {
this.history[this.currentIndex].chapterId = this.chapterId;
localStorage.setItem("history", JSON.stringify(this.history))
} else {
this.history.push({
bookid: this.bookid,
chapterId: this.chapterId
})
localStorage.setItem("history", JSON.stringify(this.history))
}
};
let data = (await this.$http.startRead({
data: {
bookid: this.bookid,
chapterId: this.chapterId
}
})).result;
uni.setNavigationBarTitle({
title: `${data.bookName} | ${data.chapterName}`
});
data.content = JSON.parse((JSON.stringify(data.content.split("</p>"))).replace(/<p>/g, ""));
data.content.unshift(data.chapterName+data.chapterNum)
data.content.forEach((val) => {
this.nodes.push({
name: 'p',
attrs: {
style: 'margin-bottom:10px;'
},
children: [{
type: 'text',
text: val
}]
})
})
this.chapterId = data.nextChapterId
}
}
}
</script>
<style scoped lang="less">
.read {
font-size: 17px;
background: rgb(230, 224, 208);
padding: 8px;
uni-rich-text {
text-indent: 10px;
}
}
</style>

View File

@@ -0,0 +1,181 @@
<template>
<div class="book">
<view class="uni-margin-wrap">
<swiper class="swiper" :indicator-dots="indicatorDots"
:autoplay="autoplay" :interval="interval" :duration="duration">
<swiper-item v-for="(item,index) in BannerList" :key="index">
<a :href="item.href">
<image :src="item.imgUrl" mode="widthFix"/>
</a>
</swiper-item>
</swiper>
</view>
<div class="main" v-for="(item,index) in BookList" :key="index">
<view class="item-list" v-if="item.hasOwnProperty('top')">
<view class="item-title">
{{ item.title }}
</view>
<div class="item-content" @click="enterInfo(item.top.id)">
<image class="hot" mode="scaleToFill" :src="item.top.imgUrl" />
<div class="content-right">
<h3 class="content-title">{{ item.top.title }}</h3>
<p class="content-desc">{{ item.top.desc }}</p>
<div class="content-class"></div>
</div>
</div>
<uni-list class="book-list">
<uni-list-item v-for="(t, inx) in item.list" :title="t.title"
:key="inx" @click="enterInfo(t.id)"/>
</uni-list>
</view>
<view class="item-list" v-else-if="item.title == '编辑力荐' ">
<view class="item-title">
{{ item.title }}
</view>
<div class="item-content" v-for="(o,p) in item.list" :key="p"
@click="enterInfo(o.id)">
<image class="hot" mode="scaleToFill" :src="o.imgUrl" />
<div class="content-right">
<h3 class="content-title">{{ o.title }}</h3>
<p class="content-desc">{{ o.desc }}</p>
<div class="content-class"></div>
</div>
</div>
</view>
<view class="item-list" v-else>
<view class="item-title">
{{ item.title }}
</view>
<div class="item-content">
<ul>
<li v-for="(a,y) in item.list" :key="y" @click="enterInfo(a.id)">
<img mode="scaleToFill" :src="a.imgUrl"/>
<p>{{ a.title }}</p>
</li>
</ul>
</div>
</view>
</div>
</div>
</template>
<script>
import { mapMutations } from "vuex";
import uniList from '@/components/uni-list/uni-list.vue'
import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
export default {
data() {
return {
BannerList: [],
BookList: [],
indicatorDots: true,
autoplay: true,
interval: 3000,
duration: 500
}
},
created() {
this.getIndexData()
},
onLoad() {
},
methods: {
...mapMutations([
'SET_HOTLIST'
]),
async getIndexData() {
let indexData = await this.$http.getIndexData({ data: {}, header:{} });
this.SET_HOTLIST(indexData.booklist[0])
this.BannerList = indexData.banner
this.BookList = indexData.booklist
},
enterInfo(id) {
uni.navigateTo({
url: `/pages/bookinfo/bookinfo?id=${id}`
});
}
},
components: {
uniList,
uniListItem
},
}
</script>
<style lang="less">
.book {
swiper-item {
image {
height: 171px !important;
width: 100%;
}
}
.item-list {
padding: 20rpx;
.item-title {
border-left: 10upx solid #e95e56;
padding-left: 20upx;
font-size: 32upx;
}
.book-list {
margin-top: 5px;
}
.item-content {
ul {
display: flex;
justify-content: flex-start;
width: 100%;
flex-flow: wrap;
li {
width: 30%;
margin-right: 5%;
margin-bottom: 5%;
img {
width: 100%;
height: 320upx;
}
p {
}
&:nth-child(3n) {
margin-right: 0 !important;
}
}
}
display: flex;
flex-direction: row;
margin-top: 10px;
.hot {
width: 114px;
height: 85px;
}
.content-right {
margin-left: 17px;
.content-title {
font-size: 17px;
color: #333;
}
.content-desc {
font-size: 13px;
color: #888;
line-height: 20px;
}
.content-class {
}
}
}
}
}
</style>

View File

@@ -0,0 +1,89 @@
<template>
<view class="type">
<view class="type_left">
<ul>
<li :class="index == currentIndex ? 'active' : '' "
v-for="(item,index ) in leftData" :key="index"
@click="renderRight(index)">{{item.title}}</li>
</ul>
</view>
<view class="type_right">
<ul>
<li v-for="(item,index) in rightData" :key="index" @click="turnToclassify(item.cid)">{{item.text}}</li>
</ul>
</view>
</view>
</template>
<script>
export default {
data() {
return {
currentIndex: 0,
leftData: [],
rightData: [],
pid:''
}
},
onLoad() {},
created(){
this.getData()
},
methods: {
async getData () {
let Data = await this.$http.getClass({ data:{} });
// console.log(Data)
this.leftData = Data
this.renderRight(0)
},
renderRight(index) {
this.currentIndex = index;
this.rightData = this.leftData[index].child;
this.pid = this.leftData[index].pid
// console.log(this.pid)
},
turnToclassify(cid){
uni.navigateTo({
url: `./classify?pid=${this.pid}&cid=${cid}`
});
}
}
}
</script>
<style lang="less">
.type {
.active {
color: red;
}
.type_left {
float: left;
width: 20%;
position: fixed;
height: 100%;
border-right: 1px solid #e6e6e6;
overflow-y: scroll;
ul {
padding-bottom: 88px;
li {
text-align: center;
padding: 10px 0;
}
}
}
.type_right {
float: left;
width: 80%;
position: relative;
left: 20%;
ul {
li {
float: left;
margin: 10px;
}
}
}
}
</style>

View File

@@ -0,0 +1,108 @@
<template>
<view class="classify">
<view class="classify_title">
<p>奇幻玄幻--东方玄幻</p>
</view>
<ul>
<li v-for="(item,index) in classifyList" :key="index" @click="enterInfo( item.bookId)">
<view class="bookList">
<img :src="item.coverUrl">
<view class="message">
<h3 class="title">{{ item.bookName }}</h3>
<p>作者:{{ item.authorName }}</p>
<p>更新至:{{ item.updteChapterName }}</p>
<p class="introduction">简介:{{ item.description }}</p>
</view>
</view>
</li>
</ul>
</view>
</template>
<script>
export default{
data() {
return {
cid: null,
cPid: null,
pageNum: 1,
classifyList:[],
categoryName:'',//大分类
subCateName:''//小分类
}
},
onLoad(option) {
this.cid = option.cid
this.cPid = option.pid
this.getClassifyData()
},
onReachBottom() {
this.pageNum++;
this.getClassifyData();
},
methods:{
async getClassifyData () {
let Data = await this.$http.getClassify({ data:{ cPid:this.cPid, cid:this.cid ,pageNum: this.pageNum} });
this.classifyList = [...this.classifyList, ...Data.ranklist]
this.categoryName = this.classifyList[0].categoryName
this.subCateName =this.classifyList[0].subCateName
uni.setNavigationBarTitle({
title: this.classifyList[0].subCateName
});
},
enterInfo(id) {
uni.navigateTo({
url: `/pages/bookinfo/bookinfo?id=${id}`
});
}
}
}
</script>
<style lang="less">
.classify{
.classify_title{
height: 60upx;
background-color: #f2f2f2;
font-size: 28upx;
border-bottom: 1upx solid #dfdfdf;
display: flex;
align-items: center;
padding-left: 20upx;
}
ul{
width: 100%;
height: 100%;
li{
height: 90px;
padding: 20upx;
position: relative;
border-bottom: 1upx solid #dfdfdf;
.bookList{
width: 100%;
height: 100%;
display: flex;
flex-flow: row;
justify-content: flex-start;
img{width:140upx;height: 160upx}
.message{
margin-left: 20upx;
.title{
font-size: 32upx;
}
p{font-size: 24upx; color: #8f8f8f}
.introduction{
width: 580upx;
font-size: 24upx; color: #8f8f8f;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,201 @@
<template>
<view class="login">
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" style-type="text" active-color="#4c86f7"></uni-segmented-control>
<view class="content">
<view v-show="current === 0">
<view class="signIn">
<view class="userIcon">
<image src="../../static/icon.png" mode=""></image>
</view>
<view class="txtInput">
<view class="inputBox">
<label for="username">
<span class="inputIcon"><image src="../../static/username.png" mode=""></image></span>
<input type="text" value="" class="username" v-model="loginMessage.username" placeholder="请输入用户名"/>
</label>
</view>
<view class="inputBox">
<label for="password">
<span class="inputIcon"><image src="../../static/password.png" mode=""></image></span>
<input type="text" value="" class=" password" v-model="loginMessage.password" placeholder="请输入密码"/>
</label>
</view>
<button type="primary" form-type="submit" >登录</button>
</view>
</view>
</view>
<view v-show="current === 1">
<view class="signOut">
<view class="inputBox">
<label for="username">
<span>用户名</span>
<input type="text" value="" class="username" v-model="signOutmessage.username" placeholder="请输入用户名"/>
</label>
<label for="phone">
<span>手机号</span>
<input type="text" value="" class="phone" v-model="signOutmessage.phone" placeholder="请输入手机号"/>
</label>
<label for="password">
<span>密码</span>
<input type="text" value="" class="password" v-model="signOutmessage.password" placeholder="请输入密码"/>
</label>
</view>
<button type="primary" form-type="submit" >注册</button>
</view>
</view>
</view>
</view>
</template>
<script>
import uniSegmentedControl from "@/components/uni-segmented-control/uni-segmented-control.vue"
export default{
components: {uniSegmentedControl},
data() {
return {
items: ['登录','注册'],
current: 0,
loginMessage: {
username: '',
userpwd: ''
},
signOutmessage:{
username:'',
phone:'',
userpwd:''
}
}
},
methods:{
onClickItem(index) {
// 列表切换
if (this.current !== index) {
this.current = index;
}
uni.setNavigationBarTitle({
title: this.items[index]
});
},
async login(){
let data = await this.$http.userLogin({
data: this.loginMessage
});
console.log(data)
this.$utils.setLocalStorage("LoginStatus",data)
}
}
}
</script>
<!-- ffb400 -->
<style lang="less">
.login{
padding: 20upx;
.content{
.signIn{
.userIcon{
width: 100%;
height: 300upx;
display: flex;
justify-content: center;
align-items: center;
image{
width: 180upx;
height: 180upx;
}
}
.txtInput{
padding: 20upx;
.inputBox{
label{
width: 80%;
margin: 0 auto;
display: flex;
align-items: center;
margin-top: 20upx;
.inputIcon{
image{width: 60upx; height: 60upx;}
}
input{
color: #999999;
font-size: 28upx;
margin-left: 20upx;
display: inline-block;
background: none;
padding: 10upx 0;
position: relative;
}
input::after{
content: "";
width: 0;
height: 2upx;
background-color: #4c86f7;
position: absolute;
left: 50%;
bottom: 0;
opacity: 0;
transition: all 0.3s ease-in-out;
}
}
label:hover input::after{
width: 100%;
left: 0;
opacity: 1;
}
}
uni-button{
height: 70upx;
margin-top: 100upx;
box-shadow: 0 0 10upx #4c86f7;
border-radius: 50upx;
line-height: 70upx;
font-size: 32upx;
}
}
}
.signOut{
min-height: 540upx;
background: url("./../../static/novel.png") top left no-repeat;
background-size: 100%;
position: relative;
margin-top: 20upx;
.inputBox{
padding-top: 540upx;
label{
width: 68%;
margin: 0 auto;
display: flex;
align-items: center;
margin-top: 30upx;
display: flex;
justify-content: space-between;
span{
color: #999999;
}
input{
color: #999999;
font-size: 28upx;
margin-left: 20upx;
display: inline-block;
background: none;
padding: 10upx;
position: relative;
border-radius: 20upx;
box-shadow: 0 0 6upx #4c86f7;
}
}
}
uni-button{
height: 70upx;
margin-top: 100upx;
box-shadow: 0 0 10upx #4c86f7;
border-radius: 50upx;
line-height: 70upx;
font-size: 32upx;
}
}
}
}
</style>

View File

@@ -0,0 +1,229 @@
<template>
<view class="my">
<view class="logined" v-if="isLogin">
<view class="myTitle">
<image src="../../static/defaulticon.png" mode="aspectFit"></image>
<view class="userMsg">
<h3>Mr.Right</h3>
<p>这家伙真懒,签名都不设置</p>
</view>
</view>
<view class="nav">
<ul>
<li><image src="../../static/collection.png" mode="aspectFit"></image><p>收藏</p></li>
<li><image src="../../static/read.png" mode="aspectFit"></image><p>阅读</p></li>
<li><image src="../../static/message.png" mode="aspectFit"></image><p>消息</p></li>
</ul>
</view>
<view class="other">
<view class="vip">
<view class="otherTitle"> <image src="../../static/vip.png" mode="aspectFit"></image> vip会员</view>
<p>立即开通 > </p>
</view>
<ul>
<li>
<view class="icon"><image src="../../static/like.png" mode="aspectFit"></image>想读</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/upload.png" mode="aspectFit"></image> 上传</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/buy.png" mode="aspectFit"></image> 已购买</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/histroy.png" mode="aspectFit"></image>浏览记录</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/help.png" mode="aspectFit"></image>帮助中心</view>
<p>0</p>
</li>
</ul>
</view>
<button type="primary">退出</button>
</view>
<view class="unlogin" v-else="">
<view class="myTitle">
<image src="../../static/defaulticon.png" mode="aspectFit"></image>
<view class="userMsg">
<h3>您还未登录</h3>
<view class="toLogin" @click="toLogin()">登录</view>
</view>
</view>
<view class="nav">
<ul>
<li><image src="../../static/collection.png" mode="aspectFit"></image><p>收藏</p></li>
<li><image src="../../static/read.png" mode="aspectFit"></image><p>阅读</p></li>
<li><image src="../../static/message.png" mode="aspectFit"></image><p>消息</p></li>
</ul>
</view>
<view class="other">
<view class="vip">
<view class="otherTitle"> <image src="../../static/vip.png" mode="aspectFit"></image> vip会员</view>
<p>立即开通 > </p>
</view>
<ul>
<li>
<view class="icon"><image src="../../static/like.png" mode="aspectFit"></image>想读</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/upload.png" mode="aspectFit"></image> 上传</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/buy.png" mode="aspectFit"></image> 已购买</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/histroy.png" mode="aspectFit"></image>浏览记录</view>
<p>0</p>
</li>
<li>
<view class="icon"><image src="../../static/help.png" mode="aspectFit"></image>帮助中心</view>
<p>0</p>
</li>
</ul>
</view>
</view>
</view>
</template>
<script>
import { mapGetters, mapMutations, mapActions } from 'vuex'
export default {
data() {
return {
isLogin: false
}
},
created() {
},
onShow() {
// this.$utils.AuthenticateLogin()
},
methods: {
toLogin(){
uni.navigateTo({
url: './login'
});
}
},
computed: {
}
}
</script>
<style lang="less">
.my{
.myTitle{
height: 200upx;
display: flex;
align-items: center;
flex-flow: row;
padding: 0upx 40upx;
.toLogin{
text-align: center;
border-radius: 50upx;
width: 180upx;
height: 50upx;
color: #ffffff;
background-color: #efa716;
}
image{
width: 120upx;
}
.userMsg{
margin-left: 40upx;
h3{
font-size: 36upx;
color: #3c3c3c;
font-weight: bold;
}
p{
font-size: 28upx;
color: #999999;
}
}
}
.nav{
height: 100upx;
padding: 20upx 0;
border-top: 1upx solid #f3f3f3;
border-bottom: 1upx solid #f3f3f3;
ul{
height: 100%;
display: flex;
flex-flow: row;
flex-wrap: nowrap;
align-items: center;
justify-content: space-around;
li{
height: 100%;
display: inline-flex;
justify-content: center;
align-items: center;
flex-flow: column;
color: #999999;
image{
width: 72upx;
}
}
}
}
.other{
display: flex;
flex-flow: column;
color: #999999;
.vip{
height: 100upx;
display: flex;
flex-flow: row;
align-items: center;
justify-content: space-between;
padding: 0 20upx;
border-top: 8upx solid #f3f3f3;
border-bottom: 10upx solid #f3f3f3;
.otherTitle{
height: 100%;
display: inline-flex;
justify-content: center;
align-items: center;
}
}
image{
width: 32upx;
height: 32upx;
margin-right: 20upx;
}
ul{
li{
height: 100upx;
border-bottom: 1upx solid #f3f3f3;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20upx;
.icon{
display: flex;
justify-content: center;
flex-flow: row;
align-items: center;
}
}
}
}
uni-button{
width: 600upx;
height: 80upx;
border-radius: 40upx;
line-height: 80upx;
margin-top: 20upx;
}
}
</style>

View File

@@ -0,0 +1,70 @@
<template>
<view class="login">
<view class="userIcon">
<view class="headericon">
<image src="../../static/icon.png" mode="aspectFit"></image>
</view>
</view>
<view class="loginForm">
<form action="" method="" name="">
<view class="inputBox">
<label for="username">
<span>手机号</span><input type="text" v-model="loginMessage.username" class="uni-input username" id="username" placeholder="请填写手机号" />
</label>
</view>
<view class="inputBox">
<label for="password">
<span>密 &nbsp; 码</span><input type="text" v-model="loginMessage.userpwd" class="uni-input password" id="password" placeholder="请输入你的密码" />
</label>
</view>
<button type="primary" form-type="submit" class="signIn" @click="login()" >登录</button>
</form>
</view>
</view>
</template>
<script>
export default{
data() {
return {
loginMessage: {
username: '',
userpwd: ''
}
}
},
created() {
},
onLoad() {
},
methods:{
getStatus () {
},
nochecked () {
uni.showToast({
title: "请先勾选协议",
duration: 2000
});
},
async login(){
let data = await this.$http.userLogin({
data: this.loginMessage
});
console.log(data)
localStorage.setItem("LoginStatus", JSON.stringify(data))
uni.switchTab({
url: '/pages/city/city'
});
}
// terunTo(){
// }
}
}
</script>
<style lang="less">
@import "./../../common/less/page/login.less";
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

View File

@@ -0,0 +1,3 @@
export default {
GET_HOTLIST: state => state.city.HotList,
}

View File

@@ -0,0 +1,13 @@
import Vue from 'vue';
import Vuex from 'vuex';
import getters from "./getters.js"
import city from "./modules/city.js"
import bookinfo from "./modules/bookinfo.js"
Vue.use(Vuex);
const store = new Vuex.Store({
modules: { city , bookinfo },
getters
})
export default store;

View File

@@ -0,0 +1,10 @@
export default {
state: {
info: "这是详情"
},
mutations: {
set_info(state, par) {
state.info = par;
}
}
}

View File

@@ -0,0 +1,17 @@
export default {
state: {
HotList: {}
},
// 帮我们写 state 里面的数据
mutations: {
SET_HOTLIST(state, list) {
state.HotList = list;
},
},
actions: {
getData({commit}) {
let list = [1,2,3,4,5,6,7];
commit("set_List",list)
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -0,0 +1,76 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color:#333;//基本色
$uni-text-color-inverse:#fff;//反色
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0;
/* 背景颜色 */
$uni-bg-color:#ffffff;
$uni-bg-color-grey:#f8f8f8;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
/* 边框颜色 */
$uni-border-color:#c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm:24upx;
$uni-font-size-base:28upx;
$uni-font-size-lg:32upx;
/* 图片尺寸 */
$uni-img-size-sm:40upx;
$uni-img-size-base:52upx;
$uni-img-size-lg:80upx;
/* Border Radius */
$uni-border-radius-sm: 4upx;
$uni-border-radius-base: 6upx;
$uni-border-radius-lg: 12upx;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 10px;
$uni-spacing-row-base: 20upx;
$uni-spacing-row-lg: 30upx;
/* 垂直间距 */
$uni-spacing-col-sm: 8upx;
$uni-spacing-col-base: 16upx;
$uni-spacing-col-lg: 24upx;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2C405A; // 文章标题颜色
$uni-font-size-title:40upx;
$uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:36upx;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:30upx;

View File

@@ -0,0 +1 @@
@import './common/main.acss';

View File

@@ -0,0 +1,4 @@
require('./common/runtime.js')
require('./common/vendor.js')
require('./common/main.js')

View File

@@ -0,0 +1,46 @@
{
"pages": [
"pages/city/city",
"pages/book/book",
"pages/class/class",
"pages/my/my",
"pages/bookinfo/bookinfo"
],
"window": {
"defaultTitle": "uni-app",
"titleBarColor": "#ff0",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"textColor": "#7A7E83",
"selectedColor": "#3cc51f",
"backgroundColor": "#ffffff",
"items": [
{
"pagePath": "pages/book/book",
"name": "书架",
"icon": "static/book.png",
"activeIcon": "static/book_select.png"
},
{
"pagePath": "pages/city/city",
"name": "书城",
"icon": "static/city.png",
"activeIcon": "static/city_select.png"
},
{
"pagePath": "pages/class/class",
"name": "分类",
"icon": "static/class.png",
"activeIcon": "static/class_select.png"
},
{
"pagePath": "pages/my/my",
"name": "我的",
"icon": "static/my.png",
"activeIcon": "static/my_select.png"
}
]
},
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
(my["webpackJsonp"]=my["webpackJsonp"]||[]).push([["common/main"],{"034b":function(n,t,u){"use strict";u.r(t);var a=u("c042"),e=u.n(a);for(var c in a)"default"!==c&&function(n){u.d(t,n,function(){return a[n]})}(c);t["default"]=e.a},"42a4":function(n,t,u){"use strict";var a=u("bca5"),e=u.n(a);e.a},a36e:function(n,t,u){"use strict";u.r(t);var a=u("034b");for(var e in a)"default"!==e&&function(n){u.d(t,n,function(){return a[n]})}(e);u("42a4");var c,o,r=u("2877"),f=Object(r["a"])(a["default"],c,o,!1,null,null,null);t["default"]=f.exports},bca5:function(n,t,u){},c042:function(n,t,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a={};t.default=a}},[["773a","common/runtime","common/vendor"]]]);

View File

@@ -0,0 +1 @@
(function(e){function n(n){for(var r,o,a=n[0],c=n[1],l=n[2],s=0,p=[];s<a.length;s++)o=a[s],i[o]&&p.push(i[o][0]),i[o]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);f&&f(n);while(p.length)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,n=0;n<u.length;n++){for(var t=u[n],r=!0,o=1;o<t.length;o++){var a=t[o];0!==i[a]&&(r=!1)}r&&(u.splice(n--,1),e=c(c.s=t[0]))}return e}var r={},o={"common/runtime":0},i={"common/runtime":0},u=[];function a(e){return c.p+""+e+".js"}function c(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,c),t.l=!0,t.exports}c.e=function(e){var n=[],t={"components/uni-list-item/uni-list-item":1,"components/uni-list/uni-list":1,"components/uni-badge/uni-badge":1,"components/uni-icon/uni-icon":1};o[e]?n.push(o[e]):0!==o[e]&&t[e]&&n.push(o[e]=new Promise(function(n,t){for(var r=({"components/uni-list-item/uni-list-item":"components/uni-list-item/uni-list-item","components/uni-list/uni-list":"components/uni-list/uni-list","components/uni-badge/uni-badge":"components/uni-badge/uni-badge","components/uni-icon/uni-icon":"components/uni-icon/uni-icon"}[e]||e)+".acss",i=c.p+r,u=document.getElementsByTagName("link"),a=0;a<u.length;a++){var l=u[a],s=l.getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(s===r||s===i))return n()}var p=document.getElementsByTagName("style");for(a=0;a<p.length;a++){l=p[a],s=l.getAttribute("data-href");if(s===r||s===i)return n()}var f=document.createElement("link");f.rel="stylesheet",f.type="text/css",f.onload=n,f.onerror=function(n){var r=n&&n.target&&n.target.src||i,u=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");u.request=r,delete o[e],f.parentNode.removeChild(f),t(u)},f.href=i;var m=document.getElementsByTagName("head")[0];m.appendChild(f)}).then(function(){o[e]=0}));var r=i[e];if(0!==r)if(r)n.push(r[2]);else{var u=new Promise(function(n,t){r=i[e]=[n,t]});n.push(r[2]=u);var l,s=document.createElement("script");s.charset="utf-8",s.timeout=120,c.nc&&s.setAttribute("nonce",c.nc),s.src=a(e),l=function(n){s.onerror=s.onload=null,clearTimeout(p);var t=i[e];if(0!==t){if(t){var r=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src,u=new Error("Loading chunk "+e+" failed.\n("+r+": "+o+")");u.type=r,u.request=o,t[1](u)}i[e]=void 0}};var p=setTimeout(function(){l({type:"timeout",target:s})},12e4);s.onerror=s.onload=l,document.head.appendChild(s)}return Promise.all(n)},c.m=e,c.c=r,c.d=function(e,n,t){c.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,n){if(1&n&&(e=c(e)),8&n)return e;if(4&n&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(c.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)c.d(t,r,function(n){return e[n]}.bind(null,r));return t},c.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(n,"a",n),n},c.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},c.p="/",c.oe=function(e){throw console.error(e),e};var l=my["webpackJsonp"]=my["webpackJsonp"]||[],s=l.push.bind(l);l.push=n,l=l.slice();for(var p=0;p<l.length;p++)n(l[p]);var f=s;t()})([]);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,60 @@
@charset "UTF-8";
.uni-badge {
font-family: 'Helvetica Neue', Helvetica, sans-serif;
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-size: 12px;
line-height: 1;
display: inline-block;
padding: 3px 6px;
color: #333;
border-radius: 100px;
background-color: #f1f1f1
}
.uni-badge.uni-badge-inverted {
padding: 0 5px 0 0;
color: #999;
background-color: transparent
}
.uni-badge-primary {
color: #fff;
background-color: #007aff
}
.uni-badge-primary.uni-badge-inverted {
color: #007aff;
background-color: transparent
}
.uni-badge-success {
color: #fff;
background-color: #4cd964
}
.uni-badge-success.uni-badge-inverted {
color: #4cd964;
background-color: transparent
}
.uni-badge-warning {
color: #fff;
background-color: #f0ad4e
}
.uni-badge-warning.uni-badge-inverted {
color: #f0ad4e;
background-color: transparent
}
.uni-badge-error {
color: #fff;
background-color: #dd524d
}
.uni-badge-error.uni-badge-inverted {
color: #dd524d;
background-color: transparent
}
.uni-badge--small {
-webkit-transform: scale(.8);
-ms-transform: scale(.8);
transform: scale(.8);
-webkit-transform-origin: center center;
-ms-transform-origin: center center;
transform-origin: center center
}

View File

@@ -0,0 +1 @@
<block a:if="{{text}}"><text data-event-opts="{{[['tap',[['onClick']]]]}}" class="{{(('uni-badge')+' '+(inverted?'uni-badge-'+type+' uni-badge--'+size+' uni-badge-inverted':'uni-badge-'+type+' uni-badge--'+size))}}" onTap="__e">{{text}}</text></block>

View File

@@ -0,0 +1,10 @@
;my.defineComponent || (my.defineComponent = Component);(my["webpackJsonp"]=my["webpackJsonp"]||[]).push([["components/uni-badge/uni-badge"],{1648:function(t,e,n){"use strict";n.r(e);var u=n("2323"),a=n("6000");for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);n("d3be");var i=n("2877"),c=Object(i["a"])(a["default"],u["a"],u["b"],!1,null,null,null);e["default"]=c.exports},2323:function(t,e,n){"use strict";var u=function(){var t=this,e=t.$createElement;t._self._c},a=[];n.d(e,"a",function(){return u}),n.d(e,"b",function(){return a})},"42ba":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u={name:"UniBadge",props:{type:{type:String,default:"default"},inverted:{type:Boolean,default:!1},text:{type:[String,Number],default:""},size:{type:String,default:"normal"}},methods:{onClick:function(){this.$emit("click")}}};e.default=u},"55c0":function(t,e,n){},6000:function(t,e,n){"use strict";n.r(e);var u=n("42ba"),a=n.n(u);for(var r in u)"default"!==r&&function(t){n.d(e,t,function(){return u[t]})}(r);e["default"]=a.a},d3be:function(t,e,n){"use strict";var u=n("55c0"),a=n.n(u);a.a}}]);
;(my["webpackJsonp"] = my["webpackJsonp"] || []).push([
'components/uni-badge/uni-badge-create-component',
{
'components/uni-badge/uni-badge-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('c11b')['createComponent'](__webpack_require__("1648"))
})
},
[['components/uni-badge/uni-badge-create-component']]
]);

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"component": true
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
<view data-event-opts="{{[['tap',[['_onClick',['$event']]]]]}}" class="{{(('uni-icon')+' '+('uni-icon-'+type))}}" style="{{'color:'+(color)+';'+('font-size:'+(size+'px')+';')}}" onTap="__e"></view>

View File

@@ -0,0 +1,10 @@
;my.defineComponent || (my.defineComponent = Component);(my["webpackJsonp"]=my["webpackJsonp"]||[]).push([["components/uni-icon/uni-icon"],{"208d":function(n,t,e){"use strict";var u=e("b900"),i=e.n(u);i.a},"3d96":function(n,t,e){"use strict";e.r(t);var u=e("6df5"),i=e("50c2");for(var r in i)"default"!==r&&function(n){e.d(t,n,function(){return i[n]})}(r);e("208d");var c=e("2877"),o=Object(c["a"])(i["default"],u["a"],u["b"],!1,null,null,null);t["default"]=o.exports},"50c2":function(n,t,e){"use strict";e.r(t);var u=e("7929"),i=e.n(u);for(var r in u)"default"!==r&&function(n){e.d(t,n,function(){return u[n]})}(r);t["default"]=i.a},"6df5":function(n,t,e){"use strict";var u=function(){var n=this,t=n.$createElement;n._self._c},i=[];e.d(t,"a",function(){return u}),e.d(t,"b",function(){return i})},7929:function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u={name:"UniIcon",props:{type:{type:String,default:""},color:{type:String,default:"#333333"},size:{type:[Number,String],default:16}},methods:{_onClick:function(){this.$emit("click")}}};t.default=u},b900:function(n,t,e){}}]);
;(my["webpackJsonp"] = my["webpackJsonp"] || []).push([
'components/uni-icon/uni-icon-create-component',
{
'components/uni-icon/uni-icon-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('c11b')['createComponent'](__webpack_require__("3d96"))
})
},
[['components/uni-icon/uni-icon-create-component']]
]);

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"component": true
}

View File

@@ -0,0 +1,152 @@
@charset "UTF-8";
.uni-list-item {
font-size: 32rpx;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center
}
.uni-list-item--disabled {
opacity: .3
}
.uni-list-item--hover {
background-color: #f1f1f1
}
.uni-list-item__container {
padding: 24rpx 30rpx;
width: 100%;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center
}
.uni-list-item__container:after {
position: absolute;
z-index: 3;
right: 0;
bottom: 0;
left: 30rpx;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
-ms-transform: scaleY(.5);
transform: scaleY(.5);
background-color: #c8c7cc
}
.uni-list-item__content {
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
overflow: hidden;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column
}
.uni-list-item__content-title {
font-size: 32rpx;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
color: inherit;
line-height: 1.5;
overflow: hidden
}
.uni-list-item__content-note {
color: #999;
font-size: 28rpx;
white-space: normal;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden
}
.uni-list-item__extra {
width: 25%;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
-ms-flex-pack: end;
justify-content: flex-end;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center
}
.uni-list-item__icon {
margin-right: 18rpx;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center
}
.uni-list-item__icon-img {
height: 52rpx;
width: 52rpx
}
.uni-list>.uni-list-item:last-child .uni-list-item-container:after {
height: 0
}

View File

@@ -0,0 +1 @@
<view class="{{(('uni-list-item')+' '+(disabled?'uni-list-item--disabled':''))}}" hover-class="{{disabled||showSwitch?'':'uni-list-item--hover'}}" data-event-opts="{{[['tap',[['onClick',['$event']]]]]}}" onTap="__e"><view class="uni-list-item__container"><block a:if="{{thumb}}"><view class="uni-list-item__icon"><image class="uni-list-item__icon-img" src="{{thumb}}"></image></view></block><block a:else><block a:if="{{showExtraIcon}}"><view class="uni-list-item__icon"><uni-icon class="uni-icon-wrapper" vue-id="1" color="{{extraIcon.color}}" size="{{extraIcon.size}}" type="{{extraIcon.type}}" onVueInit="__l"></uni-icon></view></block></block><view class="uni-list-item__content"><view class="uni-list-item__content-title">{{title}}</view><block a:if="{{note}}"><view class="uni-list-item__content-note">{{note}}</view></block></view><block a:if="{{showBadge||showArrow||showSwitch}}"><view class="uni-list-item__extra"><block a:if="{{showBadge}}"><uni-badge vue-id="2" type="{{badgeType}}" text="{{badgeText}}" onVueInit="__l"></uni-badge></block><block a:if="{{showSwitch}}"><switch disabled="{{disabled}}" checked="{{switchChecked}}" data-event-opts="{{[['change',[['onSwitchChange',['$event']]]]]}}" onChange="__e"></switch></block><block a:if="{{showArrow}}"><uni-icon class="uni-icon-wrapper" vue-id="3" size="{{20}}" color="#bbb" type="arrowright" onVueInit="__l"></uni-icon></block></view></block></view></view>

View File

@@ -0,0 +1,10 @@
;my.defineComponent || (my.defineComponent = Component);(my["webpackJsonp"]=my["webpackJsonp"]||[]).push([["components/uni-list-item/uni-list-item"],{1798:function(t,e,n){"use strict";n.r(e);var u=n("d465"),i=n("d2f6");for(var o in i)"default"!==o&&function(t){n.d(e,t,function(){return i[t]})}(o);n("1db7");var a=n("2877"),c=Object(a["a"])(i["default"],u["a"],u["b"],!1,null,null,null);e["default"]=c.exports},"1db7":function(t,e,n){"use strict";var u=n("744d"),i=n.n(u);i.a},"744d":function(t,e,n){},b99d:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=function(){return n.e("components/uni-icon/uni-icon").then(n.bind(null,"3d96"))},i=function(){return n.e("components/uni-badge/uni-badge").then(n.bind(null,"1648"))},o={name:"UniListItem",components:{uniIcon:u,uniBadge:i},props:{title:{type:String,default:""},note:{type:String,default:""},disabled:{type:Boolean,default:!1},showArrow:{type:Boolean,default:!0},showBadge:{type:Boolean,default:!1},showSwitch:{type:Boolean,default:!1},switchChecked:{type:Boolean,default:!1},badgeText:{type:[String,Number],default:""},badgeType:{type:String,default:"success"},thumb:{type:String,default:""},showExtraIcon:{type:Boolean,default:!1},extraIcon:{type:Object,default:function(){return{type:"contact",color:"#000000",size:20}}}},data:function(){return{}},methods:{onClick:function(){this.$emit("click")},onSwitchChange:function(t){this.$emit("switchChange",t.detail)}}};e.default=o},d2f6:function(t,e,n){"use strict";n.r(e);var u=n("b99d"),i=n.n(u);for(var o in u)"default"!==o&&function(t){n.d(e,t,function(){return u[t]})}(o);e["default"]=i.a},d465:function(t,e,n){"use strict";var u=function(){var t=this,e=t.$createElement;t._self._c},i=[];n.d(e,"a",function(){return u}),n.d(e,"b",function(){return i})}}]);
;(my["webpackJsonp"] = my["webpackJsonp"] || []).push([
'components/uni-list-item/uni-list-item-create-component',
{
'components/uni-list-item/uni-list-item-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('c11b')['createComponent'](__webpack_require__("1798"))
})
},
[['components/uni-list-item/uni-list-item-create-component']]
]);

View File

@@ -0,0 +1,7 @@
{
"usingComponents": {
"uni-icon": "/components/uni-icon/uni-icon",
"uni-badge": "/components/uni-badge/uni-badge"
},
"component": true
}

View File

@@ -0,0 +1,43 @@
@charset "UTF-8";
.uni-list {
background-color: #fff;
position: relative;
width: 100%;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column
}
.uni-list:after {
position: absolute;
z-index: 10;
right: 0;
bottom: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
-ms-transform: scaleY(.5);
transform: scaleY(.5);
background-color: #c8c7cc
}
.uni-list:before {
position: absolute;
z-index: 10;
right: 0;
top: 0;
left: 0;
height: 1px;
content: '';
-webkit-transform: scaleY(.5);
-ms-transform: scaleY(.5);
transform: scaleY(.5);
background-color: #c8c7cc
}

View File

@@ -0,0 +1 @@
<view class="uni-list"><slot></slot></view>

View File

@@ -0,0 +1,10 @@
;my.defineComponent || (my.defineComponent = Component);(my["webpackJsonp"]=my["webpackJsonp"]||[]).push([["components/uni-list/uni-list"],{"1a25":function(n,t,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={name:"UniList"};t.default=e},"1b0d":function(n,t,u){"use strict";u.r(t);var e=u("87d8"),a=u("a040");for(var r in a)"default"!==r&&function(n){u.d(t,n,function(){return a[n]})}(r);u("2a0b");var i=u("2877"),c=Object(i["a"])(a["default"],e["a"],e["b"],!1,null,null,null);t["default"]=c.exports},"2a0b":function(n,t,u){"use strict";var e=u("69dc"),a=u.n(e);a.a},"69dc":function(n,t,u){},"87d8":function(n,t,u){"use strict";var e=function(){var n=this,t=n.$createElement;n._self._c},a=[];u.d(t,"a",function(){return e}),u.d(t,"b",function(){return a})},a040:function(n,t,u){"use strict";u.r(t);var e=u("1a25"),a=u.n(e);for(var r in e)"default"!==r&&function(n){u.d(t,n,function(){return e[n]})}(r);t["default"]=a.a}}]);
;(my["webpackJsonp"] = my["webpackJsonp"] || []).push([
'components/uni-list/uni-list-create-component',
{
'components/uni-list/uni-list-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('c11b')['createComponent'](__webpack_require__("1b0d"))
})
},
[['components/uni-list/uni-list-create-component']]
]);

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"component": true
}

View File

@@ -0,0 +1,70 @@
.book swiper-item image {
height: 171px !important;
width: 100%;
}
.book .item-list {
padding: 20rpx;
}
.book .item-list .item-title {
border-left: 10rpx solid #e95e56;
padding-left: 20rpx;
font-size: 32rpx;
}
.book .item-list .book-list {
margin-top: 5px;
}
.book .item-list .item-content {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
margin-top: 10px;
}
.book .item-list .item-content ._ul {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: start;
-webkit-justify-content: flex-start;
-ms-flex-pack: start;
justify-content: flex-start;
width: 100%;
-webkit-flex-flow: wrap;
-ms-flex-flow: wrap;
flex-flow: wrap;
}
.book .item-list .item-content ._ul ._li {
width: 30%;
margin-right: 5%;
margin-bottom: 5%;
}
.book .item-list .item-content ._ul ._li ._img {
width: 100%;
height: 320rpx;
}
.book .item-list .item-content ._ul ._li:nth-child(3n) {
margin-right: 0 !important;
}
.book .item-list .item-content .hot {
width: 114px;
height: 85px;
}
.book .item-list .item-content .content-right {
margin-left: 17px;
}
.book .item-list .item-content .content-right .content-title {
font-size: 17px;
color: #333;
}
.book .item-list .item-content .content-right .content-desc {
font-size: 13px;
color: #888;
line-height: 20px;
}

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