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,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
}
}