This commit is contained in:
@fawn-nine
2023-03-03 12:11:23 +08:00
commit f8e1a3015b
502 changed files with 57308 additions and 0 deletions

File diff suppressed because it is too large Load Diff

2942
pages/yRead/angbook.vue Normal file

File diff suppressed because it is too large Load Diff

3350
pages/yRead/animate.min.css vendored Normal file

File diff suppressed because it is too large Load Diff

90
pages/yRead/battery.js Normal file
View File

@@ -0,0 +1,90 @@
const getBattery = function(callback) {
uni.getSystemInfo({
success(res) {
//#ifdef APP-PLUS
if (res.platform === 'ios') {
let UIDevice = plus.ios.import('UIDevice')
let dev = UIDevice.currentDevice()
if (!dev.isBatteryMonitoringEnabled()) {
dev.setBatteryMonitoringEnabled(true)
}
let level = dev.batteryLevel() * 100 // 获取苹果手机电量 电量要*100
let status = dev.batteryState()
callback(level)
} else if (res.platform === 'android') {
let main = plus.android.runtimeMainActivity()
let Intent = plus.android.importClass('android.content.Intent')
let recevier = plus.android.implements(
'io.dcloud.feature.internal.reflect.BroadcastReceiver', {
onReceive: function(context, intent) {
console.log('intent', intent)
let action = intent.getAction()
if (action == Intent.ACTION_BATTERY_CHANGED) {
let level = intent.getIntExtra('level', -1) // 电量
let status = intent.getIntExtra('status', -1) // 充电状态 状态为2代表充电
callback(level)
}
}
}
)
}
//#endif
//#ifdef H5
navigator.getBattery().then(function(battery) {
battery.addEventListener('chargingchange', function() {
console(battery.charging ? '在充电' : '没在充电') //是否在充电
})
battery.addEventListener('dischargingtimechange', function(info) {
console.log(info) //电池剩余时间改变时触发该事件
})
battery.addEventListener('levelchange', function(info) {
console.log(info) //在电池电量水平改变时触发
})
callback(battery.level*100)
})
//#endif
//#ifdef MP-WEIXIN
wx.getBatteryInfoSync({
success(ret){
callback(ret.level)
console.log('是否正在充电:', res.isCharging)
}
})
//#endif
//#ifdef MP-BAIDU
swan.getBatteryInfo({
success(ret){
callback(ret.level)
console.log('是否正在充电:', res.isCharging)
}
})
//#endif
//#ifdef MP-ALIPAY
my.getBatteryInfo({
success(ret){
callback(ret.level)
console.log('是否正在充电:', res.isCharging)
}
})
//#endif
//#ifdef MP-QQ
qq.getBatteryInfoSync({
success(ret){
callback(ret.level)
console.log('是否正在充电:', res.isCharging)
}
})
//#endif
}
})
}
export default {
getBattery
}

27
pages/yRead/brightness.js Normal file
View File

@@ -0,0 +1,27 @@
let Brightness=null
const getBrigthness = function(callbck) {
uni.getScreenBrightness({
success: res => {
Brightness=res.value
callbck(res.value*100)
}
})
}
const setBrigthness = function(data,type,callbck) {
uni.setScreenBrightness({
value:type?Brightness:data/100,
success: res => {
if(type){
callbck(Brightness*100)
}else{
callbck(data)
}
}
})
}
export default {
getBrigthness,
setBrigthness
}

View File

@@ -0,0 +1,511 @@
<template>
<view v-if="audioShow==1" class="page">
<view class="back_btn">
<text class="iconfont icon-fanhui" @tap='pageBack'></text>
</view>
<!-- <cus-navbar id="navbar" title="" titleColor="#fff" bgColor="transparent" @back="hide"></cus-navbar> -->
<view class="top-box" :style="{paddingTop:`${navbarH}px`,marginTop:`-${navbarH}px`}">
<image class="default-cover cover" :src="detail.cover" mode="scaleToFill" @tap="prompthandle"></image>
<view class="book-name" @tap="prompthandle">
<text>{{this.AS_book[0].booktitle}}</text>
<text class="iconfont icon-jinrujiantou"></text>
</view>
<view class="chapter-name" @tap="prompthandle">{{this.AS_book[0].bookchapt}}</view>
<view class="schedule-box">
<view class="rate"></view>
<span class="time" @tap="prompthandle">{{'10:40'}}/{{'12:11'}}</span>
</view>
</view>
<view class="button-box">
<button @tap="prompthandle"><text class="iconfont icon-step-backward side"></text></button>
<!-- <button><text class="iconfont icon-pausecircle-fill center"></text></button> -->
<button @tap="prompthandle"><text class="iconfont icon-playcircle-fill center"></text></button>
<button @tap="prompthandle"><text class="iconfont icon-step-forward side"></text></button>
</view>
<!-- <view class="button-box">
<button @tap="prompthandle">
<text class="iconfont icon-xiazai1 sub-icon"></text>
<text class="sub-text">下载</text>
</button>
<button @tap="prompthandle">
<text class="iconfont icon-shu sub-icon"></text>
<text class="sub-text">加入书架</text>
</button>
<button @tap="prompthandle">
<text class="iconfont icon-xianshishijian sub-icon"></text>
<text class="sub-text">定时</text>
</button>
<button @tap="prompthandle">
<text class="iconfont icon-kuaisushezhi sub-icon"></text>
<text class="sub-text">语速</text>
</button>
<button @tap="prompthandle">
<text class="iconfont icon-menu sub-icon"></text>
<text class="sub-text">658</text>
</button>
</view> -->
<!-- <view class="bottom-btn">
<button @tap="prompthandle">
<text class="dot">AI朗读</text>
<text>成熟大叔音</text>
<text class="iconfont icon-jinrujiantou"></text>
</button>
<button @tap="prompthandle">阅读原文</button>
</view> -->
</view>
<!-- <view id="_drag_button" class="drag text-sm flex justify-start align-center"
:style="'left:'+left+'px;top:'+top+'px;'" @click.stop.prevent="click" @touchmove.stop.prevent="touchmove"
@touchend="touchend"
:class="[!isMove?'transition':'', open?'margin-left animation-slide-left':'animation-slide-right']">
<view v-if="open" class="flex justify-start align-center openDrag">
<view class="audio-title margin-lr-sm">
<view id="title" class="animation" :style="{animationDuration: `${animateDuration}s`}">{{title}}</view>
</view>
<view class="iconfont margin-lr-sm" :class="pause?'icon-kaishi':'icon-zantingtingzhi'" @tap="tapPause">
</view>
<view class="cuIcon-close margin-lr-sm" @tap="tapClose"></view>
</view>
<view v-else class="cuIcon-right margin-lr-xs padding-left-sm" @tap="tapOpen"></view>
</view> -->
</template>
<script>
export default {
props: {
bookId: {
type: String,
default: ''
},
bookName: {
type: String,
default: '从特种兵开始融合万物'
},
chapterName: {
type: String,
default: '第10章犀利的改变'
},
content: {
type: String,
default: ''
},
styleBottom: {
type: Number,
default: 0
},
audioShow: {
type: Number,
required: true
},
playData: {
type: Array,
required: true
},
AS_book: {
type: Array,
default: ''
},
},
data() {
return {
navbarH: this.$NavBar,
visible: true,
promptList: ['呀!不能用', '咦?还是不行', '哈哈哈哈哈,这个也不行', '没想到吧,都不行!'],
promptIndex: 0,
// open: true,
// top: 0,
// left: 0,
// width: 0,
// height: 0,
// offsetWidth: 0,
// offsetHeight: 0,
// windowWidth: 0,
// windowHeight: 0,
// isMove: true,
// edge: 10,
// pause: false,
// audioPlay: false,
// audio: [],
// curAudio: null,
// audioIndex: 0,
// animateDuration: 4,
}
},
computed: {
detail() {
let readHistorys = {
'cover': "http://img.1391.com/api/v1/bookcenter/cover/1/3449780/3449780_fc9244d1c821436d88fb9a7f5b1ea7f5.jpg/"
}
// let idx = readHistorys.findIndex(item => item._id === this.bookId)
return readHistorys
}
},
mounted() {
// const sys = uni.getSystemInfoSync();
// this.windowWidth = sys.windowWidth;
// this.windowHeight = sys.windowHeight;
// if (sys.windowTop) {
// this.windowHeight += sys.windowTop;
// }
// this.getComponentHeight();
// this.toRead();
// this.tapOpen();
},
beforeDestroy() {
this.hide()
// this.tapClose();
},
methods: {
show() {
this.visible = true
},
hide() {
this.visible = false
},
pageBack() {
this.$emit('showValue', 0);
},
prompthandle() {
uni.hideToast()
uni.showToast({
icon: 'none',
title: this.promptList[this.promptIndex % 4]
})
this.promptIndex += 1
}
// getComponentHeight() {
// const query = uni.createSelectorQuery().in(this);
// query.select('#_drag_button').boundingClientRect(data => {
// if (data != null) {
// this.width = data.width;
// this.height = data.height;
// this.offsetWidth = data.width / 2;
// this.offsetHeight = data.height / 2;
// this.top = this.windowHeight - this.height - this.edge - this.styleBottom;
// }
// }).select('#title').boundingClientRect(data => {
// if (data.width > 159) { //计算文本长度
// this.animateDuration = (4 * data.width / 159).toFixed(2) //动画过渡时间
// console.log(this.animateDuration)
// }
// }).exec();
// },
// toRead() {
// this.audioPlay = !this.audioPlay;
// console.log(this.audioPlay)
// if (this.audioPlay) {
// let content = this.content.replace(/<[^>]+>/g, '').replace(/&nbsp;/g, '')
// this.audio = [this.title, ...content.split('。')]
// this.subFunc();
// } else {
// this.curAudio.pause()
// }
// },
// async subFunc() {
// if (this.audioIndex < this.audio.length) {
// this.curAudio = await this.$Voice({
// voiceSet: {
// tex: this.audio[this.audioIndex]
// },
// returnAudio: true
// })
// this.curAudio.onPlay(() => {
// console.log('音频开始播放了')
// })
// this.curAudio.play();
// this.curAudio.onEnded(() => {
// this.curAudio = null;
// this.audioIndex++;
// this.subFunc();
// })
// } else {
// this.tapClose();
// }
// },
// click() {
// this.$emit('btnClick');
// },
// touchmove(e) {
// // 单指触摸
// if (e.touches.length !== 1) {
// return false;
// }
// this.isMove = true;
// let clientY = e.touches[0].clientY - this.offsetHeight;
// // #ifdef H5
// clientY += this.height;
// // #endif
// let edgeBottom = this.windowHeight - this.height - this.edge - this.styleBottom;
// // 上下触及边界
// if (clientY < this.edge) {
// this.top = this.edge;
// } else if (clientY > edgeBottom) {
// this.top = edgeBottom;
// } else {
// this.top = clientY;
// }
// },
// touchend(e) {
// this.isMove = false;
// },
// tapOpen() {
// this.open = true;
// setTimeout(() => {
// this.open = false;
// }, 5000)
// },
// tapPause() {
// this.pause = !this.pause;
// if (this.pause) {
// this.curAudio.pause();
// } else {
// this.curAudio.play();
// }
// },
// tapClose() {
// if (this.curAudio) {
// this.curAudio.stop();
// this.curAudio.destroy();
// this.curAudio = null;
// this.animationData = {}
// // 为了在每个页面都可以监听语音播报悬浮窗
// this.$set(this.$audioDrag, 'show', false)
// this.$set(this.$audioDrag, 'title', null)
// this.$set(this.$audioDrag, 'content', null)
// }
// },
}
}
</script>
<style lang="scss" scoped>
@import url('@/pages/yRead/font.css');
.page {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1024;
background-color: #405568;
.back_btn{
color: #FFFFFF;
background-color: #586A78;
padding: 7px 7px 7px 13px;
}
.top-box {
color: #FFFFFF;
background-color: #586A78;
display: flex;
justify-content: flex-start;
align-items: center;
flex-direction: column;
.cover {
margin-top: 24px;
width: 115px;
height: 163px;
border-radius: 4px;
}
.book-name {
margin-top: 12px;
color: #B8C9D0;
font-size: 14px;
line-height: 16px;
text {
display: inline-block;
vertical-align: middle;
}
}
.chapter-name {
margin-top: 15px;
font-size: 18px;
font-weight: bold;
}
.schedule-box {
position: relative;
margin-top: 24px;
width: 100%;
height: 1px;
background-color: #94A1AA;
.rate {
width: 80%;
height: 1px;
background-color: #FFFFFF;
}
.time {
position: absolute;
left: 80%;
height: 20px;
line-height: 20px;
padding: 0 7px;
border-radius: 13px;
background-color: #FEFEFF;
color: #8D8D8F;
font-size: 9px;
transform: translate(-50%, -50%);
}
}
}
.button-box {
margin-top: 24px;
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
button {
line-height: 1;
background-color: transparent;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
text {
color: #FFFFFF;
white-space: nowrap;
}
.side {
font-size: 34px;
}
.center {
font-size: 63px;
}
.sub-icon {
font-size: 24px;
color: #CBD8E2;
}
.sub-text {
margin-top: 6px;
font-size: 12px;
color: #CBD8E2;
}
}
}
.bottom-btn {
margin-top: 27px;
display: flex;
justify-content: space-around;
align-items: center;
button {
$color: #FFFFFF;
height: 40px;
padding: 0 20px;
color: $color;
background-color: #546776;
font-size: 14px;
border-radius: 40px;
display: flex;
justify-content: center;
align-items: center;
.dot {
position: relative;
padding-right: 17px;
&::after {
content: "";
position: absolute;
top: 50%;
right: 6px;
width: 3px;
height: 3px;
background-color: $color;
border-radius: 50%;
}
}
.icon-jinrujiantou {
margin-left: 20px;
}
}
}
}
// .drag {
// background-color: rgba(0, 0, 0, 0.5);
// box-shadow: 0 0 6rpx rgba(0, 0, 0, 0.4);
// color: $uni-text-color-inverse;
// height: 100rpx;
// position: fixed;
// z-index: 999999;
// &.transition {
// transition: left .3s ease, top .3s ease;
// }
// .audio-title {
// width: 300rpx;
// max-width: 300rpx;
// overflow: hidden;
// white-space: nowrap;
// .animation {
// display: inline-block;
// white-space: nowrap;
// animation: 5s wordsLoop linear 0s infinite;
// }
// @keyframes wordsLoop {
// from {
// transform: translateX(300rpx)
// }
// to {
// transform: translateX(calc(-100%))
// }
// }
// }
// .openDrag {
// animation: dragShow 1s forwards;
// }
// @keyframes dragShow {
// to {
// visibility: visible;
// opacity: 1;
// transform: translateX(0);
// }
// }
// }
</style>

39
pages/yRead/data.json Normal file

File diff suppressed because one or more lines are too long

42
pages/yRead/edit.vue Normal file
View File

@@ -0,0 +1,42 @@
<template>
<view>
<editor id="editor" class="ql-container" :placeholder="placeholder" @ready="onEditorReady" @blur='result'></editor>
</view>
</template>
<script>
export default {
data() {
return {
placeholder: '开始输入...'
}
},
onLoad() {
},
methods: {
onEditorReady() {
// #ifdef MP-BAIDU
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editorId');
// #endif
// #ifdef APP-PLUS || H5 ||MP-WEIXIN
uni.createSelectorQuery().select('#editor').context((res) => {
this.editorCtx = res.context
}).exec()
// #endif
},
undo() {
this.editorCtx.undo()
},
result(html, text, delta){
console.log(html.detail.html)
}
}
}
</script>
<style lang="less" scoped>
</style>

157
pages/yRead/font.css Normal file
View File

@@ -0,0 +1,157 @@
/* @font-face {
font-family: 'wyg-ht';
src: url('/static/fonts/wyg/font23415.ttf');
} */
/* @font-face {
font-family: 'ml-blod';
src: url('/static/fonts/ml/mlx-bold.ttf');
} */
/* @font-face {
font-family: 'mini-simple';
src: url('/static/fonts/mini/mini-smiple.ttf');
} */
@font-face {
font-family: "iconfont";
/* Project id 2550305 */
src: url('./iconfont.woff2?t=1641877842034') format('woff2'),
url('./iconfont.woff?t=1641877842034') format('woff'),
url('./iconfont.ttf?t=1641877842034') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-xianshishijian:before {
content: "\ee22";
}
.icon-menu:before {
content: "\e63d";
}
.icon-kuaisushezhi:before {
content: "\e795";
}
.icon-jinrujiantou:before {
content: "\e8f1";
}
.icon-shu:before {
content: "\e645";
}
.icon-xiazai1:before {
content: "\e657";
}
.icon-pausecircle-fill:before {
content: "\e7cb";
}
.icon-playcircle-fill:before {
content: "\e7cd";
}
.icon-step-backward:before {
content: "\e8ef";
}
.icon-step-forward:before {
content: "\e8f0";
}
.icon-fl-dian:before {
content: "\e639";
}
.icon-hangjianju:before {
content: "\e622";
}
.icon-zijianju:before {
content: "\e625";
}
.icon-yueduye_zitijianxiao:before {
content: "\e60e";
}
.icon-yueduye_zitizengda:before {
content: "\e60f";
}
.icon-rijian:before {
content: "\e648";
}
.icon-tingshu:before {
content: "\e61e";
}
.icon-shuaxin2:before {
content: "\e638";
}
/* .icon-xiazai:before {
content: "\e641";
}
*/
.icon-paixu:before {
content: "\e60d";
}
.icon-paixu1:before {
content: "\e64e";
}
.icon-sousuo:before {
content: "\e605";
}
.icon-jiantou2:before {
content: "\e623";
}
.icon-jiantou:before {
content: "\e621";
}
.icon-youjiantou:before {
content: "\e75e";
}
.icon-caidan1:before {
content: "\e660";
}
.icon-caidan:before {
content: "\e61e";
}
.icon-shezhi:before {
content: "\e654";
}
.icon-yejian:before {
content: "\e624";
}
.icon-gengduo:before {
content: "\e62b";
}
.icon-fanhui:before {
content: "\e6cd";
}

86
pages/yRead/font.vue Normal file
View File

@@ -0,0 +1,86 @@
<template>
<view class="">
<view class="list">
<view class="item" v-for="(item,index) in detail" :key="index">
<text class="tip">{{item.name}}</text>
<view class="content">
<button v-for="(item1,index1) in item.data" :key="index1" @tap="itemClick(item1.name)">{{item1.zw}}</button>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
detail: []
}
},
created() {
this.loadData()
},
onLoad() {
},
methods: {
loadData() {
let _this=this
uni.showLoading({
icon: 'none',
title: '加载中...'
})
uni.request({
url: './data.json?v=' + Date.now(),
method: 'GET',
success(res) {
_this.detail = res.data.fonts
uni.hideLoading()
}
})
},
itemClick(name){
uni.navigateBack({
delta:1,
success() {
uni.$emit('font',{
name:name
})
}
})
}
}
}
</script>
<style lang="less" scoped>
.list{
padding: 0 30upx;
.item{
display: flex;
flex-direction: column;
.tip{
font-size: 30upx;
color: #1d1d1d;
}
.content{
display: flex;
flex-direction: column;
button{
background-color: #eee;
font-size: 24upx;
margin-bottom: 20upx;
text-align: left;
padding: 0 30upx;
}
button::after{
content: 'none';
}
}
}
}
</style>

454
pages/yRead/iconfont.css Normal file

File diff suppressed because one or more lines are too long

BIN
pages/yRead/iconfont.ttf Normal file

Binary file not shown.

BIN
pages/yRead/iconfont.woff Normal file

Binary file not shown.

BIN
pages/yRead/iconfont.woff2 Normal file

Binary file not shown.