初始化(包含登录模块)
This commit is contained in:
19
utils/getHours.js
Normal file
19
utils/getHours.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import store from '@/store/index.js'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
// #ifdef APP-PLUS
|
||||
const nowHour = new Date;
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
const nowHour = new Date;
|
||||
// #endif
|
||||
nowHour.hourNumber = nowHour.getHours() // 当前的小时数
|
||||
nowHour.minuteNumber = nowHour.getMinutes()
|
||||
|
||||
var myHour = {
|
||||
playBgm({mute=false}){
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
module.exports = {nowHour}
|
||||
|
||||
126
utils/iap.js
Normal file
126
utils/iap.js
Normal file
@@ -0,0 +1,126 @@
|
||||
// uni iap
|
||||
|
||||
const ProviderType = {
|
||||
IAP: 'iap'
|
||||
}
|
||||
|
||||
const IapTransactionState = {
|
||||
purchasing: "0", // A transaction that is being processed by the App Store.
|
||||
purchased: "1", // A successfully processed transaction.
|
||||
failed: "2", // A failed transaction.
|
||||
restored: "3", // A transaction that restores content previously purchased by the user.
|
||||
deferred: "4" // A transaction that is in the queue, but its final status is pending external action such as Ask to Buy.
|
||||
};
|
||||
|
||||
class Iap {
|
||||
|
||||
_channel = null;
|
||||
_channelError = null;
|
||||
_productIds = [];
|
||||
|
||||
_ready = false;
|
||||
|
||||
constructor({
|
||||
products
|
||||
}) {
|
||||
this._productIds = products;
|
||||
}
|
||||
|
||||
init() {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.getChannels((channel) => {
|
||||
this._ready = true;
|
||||
resolve(channel);
|
||||
}, (err) => {
|
||||
reject(err);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
getProduct(productIds) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this._channel.requestProduct(productIds || this._productIds, (res) => {
|
||||
resolve(res);
|
||||
}, (err) => {
|
||||
reject(err);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
requestPayment(orderInfo) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.requestPayment({
|
||||
provider: 'appleiap',
|
||||
orderInfo: orderInfo,
|
||||
success: (res) => {
|
||||
resolve(res);
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
restoreCompletedTransactions(username) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this._channel.restoreCompletedTransactions({
|
||||
manualFinishTransaction: true,
|
||||
username
|
||||
}, (res) => {
|
||||
resolve(res);
|
||||
}, (err) => {
|
||||
reject(err);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
finishTransaction(transaction) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this._channel.finishTransaction(transaction, (res) => {
|
||||
resolve(res);
|
||||
}, (err) => {
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getChannels(success, fail) {
|
||||
if (this._channel !== null) {
|
||||
success(this._channel)
|
||||
return
|
||||
}
|
||||
|
||||
if (this._channelError !== null) {
|
||||
fail(this._channelError)
|
||||
return
|
||||
}
|
||||
|
||||
uni.getProvider({
|
||||
service: 'payment',
|
||||
success: (res) => {
|
||||
this._channel = res.providers.find((channel) => {
|
||||
return (channel.id === 'appleiap')
|
||||
})
|
||||
|
||||
if (this._channel) {
|
||||
success(this._channel)
|
||||
} else {
|
||||
this._channelError = {
|
||||
errMsg: 'paymentContext:fail iap service not found'
|
||||
}
|
||||
fail(this._channelError)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
get channel() {
|
||||
return this._channel;
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
Iap,
|
||||
IapTransactionState
|
||||
}
|
||||
4
utils/jquery.min.1.7.js
Normal file
4
utils/jquery.min.1.7.js
Normal file
File diff suppressed because one or more lines are too long
471
utils/music.js
Normal file
471
utils/music.js
Normal file
@@ -0,0 +1,471 @@
|
||||
import store from '@/store/index.js'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
// #ifdef APP-PLUS
|
||||
const bgm = uni.getBackgroundAudioManager();
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
const bgm = {};
|
||||
// #endif
|
||||
// const bgm = uni.createInnerAudioContext();
|
||||
bgm.musicList = [] // 播放目录
|
||||
bgm.src = ''
|
||||
bgm.htimes = 0 // 历史播放秒数
|
||||
bgm.cTime = 0
|
||||
bgm.title = ''
|
||||
bgm.interval=null // 存储定时器
|
||||
bgm.loop = true;
|
||||
bgm.coverImgUrl = ''
|
||||
bgm.oldIndex = 0 // 前面一首的播放索引
|
||||
bgm.playIndex = 0
|
||||
bgm.playing = false // 播放进行时
|
||||
store.state.userInfo.playIndex !== undefined ? bgm.playIndex = store.state.userInfo.playIndex : bgm.playIndex = 0
|
||||
var music = {
|
||||
//
|
||||
//mute 表示是否是播放,,默认不播放
|
||||
playBgm({mute=false}){
|
||||
// console.log(bgm.musicList,'src')
|
||||
if (!bgm) return;
|
||||
if(mute){
|
||||
bgm.pause()
|
||||
}else{
|
||||
// bgm.src = bgm.musicList[bgm.playIndex].url
|
||||
// 判断播放列表是否空
|
||||
if(bgm.musicList.length == 0){
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
showCancel:false,
|
||||
confirmText:'好的',
|
||||
content: '请先选择要播放的音频',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
return
|
||||
}
|
||||
// 没有就添加添加url到播放器,播放新的
|
||||
if(bgm.src == ''){
|
||||
console.log(bgm.playIndex,'播放的索引',store.state.userInfo.playIndex,'播放的时长',store.state.userInfo.playTimes)
|
||||
store.commit('setUserInfo',{'playTitle': bgm.musicList[bgm.playIndex].chapter})
|
||||
store.commit('setUserInfo',{'fengImg': bgm.musicList[bgm.playIndex].bookImage})
|
||||
store.commit('setUserInfo',{'playingInfo': bgm.musicList[bgm.playIndex]})
|
||||
console.log(store.state.userInfo,'chapterName',bgm.playIndex)
|
||||
store.state.userInfo.playTimes ? bgm.htimes = store.state.userInfo.playTimes : ''
|
||||
|
||||
// 设置默认原生播放组件的显示标题和图片
|
||||
// bgm.title = bgm.musicList[bgm.playIndex].chapter
|
||||
bgm.title = '正在播放'
|
||||
console.log('应该显示的title',bgm.musicList[bgm.playIndex].chapter)
|
||||
// bgm.artist = '暂无'
|
||||
//bgm.singer = '暂无'
|
||||
bgm.coverImgUrl = 'https://www.nuttyreading.com/images/logo.png'
|
||||
bgm.image = 'https://www.nuttyreading.com/images/logo.png'
|
||||
|
||||
this.getChartUrl()
|
||||
// 获取历史秒数
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
bgm.onPause(()=>{
|
||||
console.log('暂停背景音乐');
|
||||
bgm.title = '未在播放'
|
||||
this.saveTimes()
|
||||
clearInterval(bgm.interval)
|
||||
bgm.interval = null
|
||||
bgm.playing = false
|
||||
store.commit('setUserInfo',{'playFlag': false})
|
||||
|
||||
})
|
||||
bgm.onPlay(() => {
|
||||
store.commit('setUserInfo',{'playFlag': true})
|
||||
bgm.playing = true
|
||||
console.log('开始播放音乐#######');
|
||||
store.commit('setUserInfo',{'playingInfo': bgm.musicList[bgm.playIndex]})
|
||||
//console.log(store.state.userInfo.playingInfo,'chapterName2222')
|
||||
uni.hideLoading()
|
||||
// 第一次存储
|
||||
//this.saveIndex()
|
||||
//this.saveRate(bgm.musicList[bgm.playIndex])
|
||||
// end
|
||||
bgm.interval = setInterval(()=>{
|
||||
console.log('存一次')
|
||||
this.saveIndex()
|
||||
store.commit('setUserInfo',{'playTimes': bgm.currentTime}) // 本地存储
|
||||
this.saveRate(bgm.musicList[bgm.playIndex]) // 线上存储
|
||||
},180000)
|
||||
})
|
||||
bgm.onError((res) => {
|
||||
console.log(res)
|
||||
bgm.playing = false
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
showCancel:false,
|
||||
confirmText:'好的',
|
||||
content: '音频路径异常,请联系管理员',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
}
|
||||
}
|
||||
});
|
||||
return
|
||||
})
|
||||
bgm.onTimeUpdate((res) =>{
|
||||
// this.currentTime = Math.max(0, this.videoContext.currentTime)
|
||||
setTimeout(()=>{
|
||||
store.commit('setUserInfo',{'currentTime': Math.max(0, bgm.currentTime)})
|
||||
},1000)
|
||||
})
|
||||
bgm.onWaiting(() => {
|
||||
// 加载时
|
||||
uni.showLoading()
|
||||
console.log('加载时')
|
||||
})
|
||||
bgm.onCanplay(() => {
|
||||
// 可以播放时
|
||||
console.log('可以播放时')
|
||||
uni.hideLoading()
|
||||
this.saveIndex()
|
||||
this.saveRate(bgm.musicList[bgm.playIndex])
|
||||
// console.log('历史播放进度,秒数', bgm.htimes)
|
||||
bgm.seek(bgm.htimes)
|
||||
bgm.title = '正在播放'
|
||||
console.log('应该显示的title', bgm.musicList[bgm.playIndex].chapter)
|
||||
bgm.artist = '暂无'
|
||||
//bgm.singer = '暂无'
|
||||
bgm.coverImgUrl = 'https://www.nuttyreading.com/images/logo.png'
|
||||
bgm.image = 'https://www.nuttyreading.com/images/logo.png'
|
||||
// console.log(bgm,'bgm')
|
||||
})
|
||||
bgm.onEnded(() => {
|
||||
bgm.htimes = 0 // 重置播放秒数
|
||||
bgm.playing = false
|
||||
console.log('播放完毕了',bgm.playing)
|
||||
store.commit('setUserInfo',{'playFlag': false})
|
||||
this.setPlayIndex('next') // 下一首
|
||||
})
|
||||
bgm.onPrev(() => {
|
||||
console.log('点了上一曲')
|
||||
if(bgm.playIndex - 1 >= 0){
|
||||
this.setPlayIndex('prve') // 上一首
|
||||
}else{
|
||||
console.log('没有上一首了')
|
||||
}
|
||||
})
|
||||
bgm.onNext(() => {
|
||||
console.log('点了下一曲')
|
||||
if(bgm.playIndex + 1 <= bgm.musicList.length){
|
||||
this.setPlayIndex('next') // 下一首
|
||||
}else{
|
||||
console.log('没有下一首了,到头了')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 添加播放列表
|
||||
setList(list,op,playindex,time){
|
||||
if(bgm.interval){
|
||||
console.log('存在定时器,清空')
|
||||
clearInterval(bgm.interval)
|
||||
bgm.interval = null
|
||||
}
|
||||
console.log(time,'time',playindex,'playindex')
|
||||
bgm.musicList = list
|
||||
//console.log(bgm.musicList,'bgm.musicList')
|
||||
bgm.oldIndex = bgm.playIndex // 暂存上一个播放得index
|
||||
// console.log('地址异常报错前index:',bgm.oldIndex)
|
||||
// playindex ? bgm.playIndex = playindex : bgm.playIndex = 0
|
||||
store.commit('setUserInfo',{'playingInfo': {}})
|
||||
if(playindex){
|
||||
bgm.playIndex = playindex
|
||||
console.log(playindex,'传值了')
|
||||
|
||||
if(time){ // 如果传了历史播放秒数
|
||||
bgm.htimes = time
|
||||
}else{
|
||||
// console.log('重置播放秒数')
|
||||
bgm.htimes = 0
|
||||
}
|
||||
}else{
|
||||
console.log('---------')
|
||||
bgm.htimes = 0
|
||||
bgm.playIndex = 0
|
||||
}
|
||||
|
||||
|
||||
if(op == 'autoPlay'){
|
||||
store.commit('setUserInfo',{'playTimes': 0})
|
||||
if(bgm._options.src == ''){
|
||||
// this.getChartUrl()
|
||||
// console.log(bgm,'+++++++++++')
|
||||
this.playBgm({mute:false})
|
||||
|
||||
}else{
|
||||
console.log(bgm, '----')
|
||||
this.getChartUrl() // 获取对应的播放路径
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
// 获取线上听书进度
|
||||
getListenRate(val,op){
|
||||
let data = {
|
||||
bookId: val.bookid,
|
||||
userId: store.state.userInfo.id,
|
||||
}
|
||||
$http.request({
|
||||
url: "book/listening/getReadRate",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
console.log(res,'历史记录')
|
||||
if(res.readRate.chapterId){
|
||||
var item = res.readRate
|
||||
// 有听书进度时
|
||||
bgm.playIndex = bgm.musicList.findIndex(function(info){
|
||||
// console.log(info,'info')
|
||||
if(item.chapterId == info.chapterId && item.bookId == info.bookid ){
|
||||
return info;
|
||||
}
|
||||
})
|
||||
store.commit('setUserInfo',{'playingInfo':bgm.musicList[bgm.playIndex] })
|
||||
// console.log('线下的播放index是:', store.state.userInfo.playingInfo)
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
if(op == 'autoPlay'){
|
||||
store.commit('setUserInfo',{'playTimes': 0})
|
||||
if(bgm._options.src == ''){
|
||||
// this.getChartUrl()
|
||||
this.playBgm({mute:false})
|
||||
console.log('playBgm')
|
||||
}else{
|
||||
this.getChartUrl() // 获取对应的播放路径
|
||||
// console.log('getChartUrl')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取章节url
|
||||
getChartUrl(){
|
||||
// bgm.stop()
|
||||
|
||||
let data = {
|
||||
'userId': store.state.userInfo.id,
|
||||
'bookId': bgm.musicList[bgm.playIndex].bookId,
|
||||
'chapterId': bgm.musicList[bgm.playIndex].id
|
||||
}
|
||||
console.log(data,'data')
|
||||
$http.post('book/bookchaptercontent/getBooksCatalogue', data)
|
||||
// $http.post('book/bookchaptercontent/getCatal', data)
|
||||
.then(res => {
|
||||
console.log(res,'鉴权结果')
|
||||
if(res.code == 0){
|
||||
if(res.jq==false ){
|
||||
store.commit('setUserInfo',{'playFlag': false})
|
||||
if(bgm.interval){
|
||||
console.log('存在定时器,清空')
|
||||
clearInterval(bgm.interval)
|
||||
bgm.interval = null
|
||||
}
|
||||
// 鉴权失败
|
||||
|
||||
if(res.product == null){
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
confirmText:'好的',
|
||||
content: '您还未拥有此书哦~',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
cancelText: '暂不购买',
|
||||
confirmText:'立即购买',
|
||||
content: '抱歉!该章节需要购买后才可以听哦~',
|
||||
success: function (res1) {
|
||||
if (res1.confirm) {
|
||||
console.log('用户点击确定',res.product);
|
||||
uni.navigateTo({
|
||||
url: '../bookShop/commodityDetail?id=' + res.product
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// bgm.stop()
|
||||
// 有听权限时
|
||||
if(res.chapter.voices != null && res.chapter.voices != ''){ // 空值url:null
|
||||
// 先清除定时器
|
||||
clearInterval(bgm.interval)
|
||||
bgm.interval = null
|
||||
bgm.src = res.chapter.voices
|
||||
store.commit('setUserInfo',{'playIndex': bgm.playIndex})
|
||||
store.commit('setUserInfo',{'playingInfo':bgm.musicList[bgm.playIndex] })
|
||||
}else{
|
||||
bgm.playIndex = bgm.oldIndex
|
||||
console.log('地址异常报错后index:',bgm.playIndex)
|
||||
store.commit('setUserInfo',{'playIndex': bgm.playIndex})
|
||||
store.commit('setUserInfo',{'playingInfo':bgm.musicList[bgm.playIndex] })
|
||||
uni.showToast({
|
||||
title:'音频地址异常',
|
||||
icon:'error',
|
||||
duration:2000
|
||||
})
|
||||
// store.commit('setUserInfo',{'playFlag': false})
|
||||
}
|
||||
|
||||
}
|
||||
}).catch((e)=>{
|
||||
console.log(e,'e')
|
||||
console.log('异常')
|
||||
// bgm.pause()
|
||||
bgm.playIndex = bgm.oldIndex
|
||||
store.commit('setUserInfo',{'playFlag': false})
|
||||
if(bgm.interval){
|
||||
console.log('存在定时器,清空')
|
||||
clearInterval(bgm.interval)
|
||||
bgm.interval = null
|
||||
}
|
||||
})
|
||||
},
|
||||
// 本地存储播放信息
|
||||
saveIndex(){
|
||||
console.log(bgm.playIndex,'存储得index')
|
||||
store.commit('setUserInfo',{'playIndex': bgm.playIndex})
|
||||
store.commit('setUserInfo',{'duration':bgm.duration})
|
||||
store.commit('setUserInfo',{'playTitle': bgm.musicList[bgm.playIndex].chapter})
|
||||
store.commit('setUserInfo',{'fengImg': bgm.musicList[bgm.playIndex].bookImage})
|
||||
|
||||
// store.commit('setUserInfo',{'playFlag': true})
|
||||
store.commit('setUserInfo',{'playingInfo': bgm.musicList[bgm.playIndex]})
|
||||
uni.setStorage({
|
||||
key: 'playingInfo',
|
||||
data: bgm.musicList[bgm.playIndex],
|
||||
success: function () {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
},
|
||||
// 存储播放(本地)
|
||||
saveTimes(){
|
||||
store.commit('setUserInfo',{'playTimes': bgm.currentTime})
|
||||
},
|
||||
// 存储播放进度(线上)
|
||||
saveRate(val){
|
||||
console.log(val,'要存储的线上播放信息',)
|
||||
$http.post('book/listening/save', {
|
||||
'userId': store.state.userInfo.id,
|
||||
'bookId': val.bookId,
|
||||
'chapterId': val.id,
|
||||
'chapterName': val.chapter,
|
||||
'precent': Math.ceil(bgm.currentTime),
|
||||
'loadAnimate':'none', // 请求加载动画
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res,'线上存储进度')
|
||||
if(res.code == 0){
|
||||
console.log(res,'存储完成')
|
||||
}
|
||||
}).catch((e)=>{
|
||||
console.log(e,'e')
|
||||
})
|
||||
},
|
||||
// 设置播放index
|
||||
setPlayIndex(opName){ // 切换音频
|
||||
if(opName == 'next'){ // 下一首
|
||||
if(bgm.playIndex == bgm.musicList.length - 1){
|
||||
uni.showToast({
|
||||
title:'列表播放完毕~~',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
bgm.oldIndex = bgm.playIndex
|
||||
bgm.playIndex += 1
|
||||
console.log('下一首',bgm.playIndex,bgm.oldIndex, store.state.userInfo.playIndex)
|
||||
// bgm.stop()
|
||||
bgm.htimes = 0
|
||||
this.getChartUrl() // 获取章节url
|
||||
//this.playBgm({'mute':false})
|
||||
// store.commit('setUserInfo',{'playFlag': false})
|
||||
|
||||
}else{ // 上一首
|
||||
if(bgm.playIndex == 0){
|
||||
uni.showToast({
|
||||
title:'没有上一首了~',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
bgm.oldIndex = bgm.playIndex
|
||||
bgm.playIndex -= 1
|
||||
console.log('上一首',bgm.playIndex)
|
||||
bgm.htimes = 0
|
||||
this.getChartUrl() // 获取章节url
|
||||
|
||||
}
|
||||
},
|
||||
// 设置封面图片
|
||||
setCoverImg(url){
|
||||
// console.log(bgm.coverImgUrl,'bgm.coverImgUrl')
|
||||
bgm.coverImgUrl = url
|
||||
},
|
||||
// 获取封面图片
|
||||
getCoverImg(){
|
||||
// console.log(bgm.coverImgUrl,'bgm.coverImgUrl')
|
||||
return bgm.coverImgUrl
|
||||
},
|
||||
|
||||
// 播放单曲
|
||||
setOneMusic(item){
|
||||
console.log(item,'item')
|
||||
// 显示播放组件
|
||||
store.commit('setUserInfo',{'playVisible': true})
|
||||
uni.setStorage({
|
||||
key: 'playVisible',
|
||||
data: true,
|
||||
success: function () {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
bgm.htimes = 0
|
||||
bgm.oldIndex = bgm.playIndex
|
||||
bgm.playIndex = bgm.musicList.findIndex(function(info){
|
||||
// console.log(info,'info')
|
||||
if(item.id == info.id && item.bookId == info.bookId ){
|
||||
return info;
|
||||
}
|
||||
})
|
||||
console.log(bgm.playIndex,'bgm.playIndex')
|
||||
this.getChartUrl()
|
||||
|
||||
},
|
||||
|
||||
// 关闭音频
|
||||
setCloseBgm(){
|
||||
if(bgm.interval){
|
||||
console.log('存在定时器,清空')
|
||||
clearInterval(bgm.interval)
|
||||
bgm.interval = null
|
||||
bgm.stop()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
module.exports = {music,bgm}
|
||||
|
||||
3352
utils/turn.js
Normal file
3352
utils/turn.js
Normal file
File diff suppressed because it is too large
Load Diff
2
utils/turnjs.scss
Normal file
2
utils/turnjs.scss
Normal file
@@ -0,0 +1,2 @@
|
||||
.flipbook-viewport{overflow:hidden;width:100%;height:100%;.container{display: flex;justify-content: center;align-items: center;margin: 0 auto;}.flipbook ::v-deep .page{background-color: white;background-repeat: no-repeat;background-size: 100% 100%;-webkit-box-shadow:0 0 20px rgba(0,0,0,0.2);-moz-box-shadow:0 0 20px rgba(0,0,0,0.2);-ms-box-shadow:0 0 20px rgba(0,0,0,0.2);-o-box-shadow:0 0 20px rgba(0,0,0,0.2);box-shadow:0 0 20px rgba(0,0,0,0.2);img {-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;margin:0;}}.shadow{-webkit-transition: -webkit-box-shadow 0.5s;-moz-transition: -moz-box-shadow 0.5s;-o-transition: -webkit-box-shadow 0.5s;-ms-transition: -ms-box-shadow 0.5s;-webkit-box-shadow:0 0 20px #ccc;-moz-box-shadow:0 0 20px #ccc;-o-box-shadow:0 0 20px #ccc;-ms-box-shadow:0 0 20px #ccc;box-shadow:0 0 20px #ccc;}
|
||||
}
|
||||
18
utils/utils.js
Normal file
18
utils/utils.js
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* date转化为hh:mm
|
||||
*/
|
||||
export function dateToStr(date) {
|
||||
if (typeof date !== 'number') {
|
||||
return ''
|
||||
}
|
||||
date = new Date(date)
|
||||
let hh = date.getHours()
|
||||
let mm = date.getMinutes()
|
||||
if (hh<10) {
|
||||
hh = '0' + hh
|
||||
}
|
||||
if (mm<10) {
|
||||
mm = '0' + mm
|
||||
}
|
||||
return hh + ':' + mm
|
||||
}
|
||||
Reference in New Issue
Block a user