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,81 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="../layui/jquery-3.2.1.min.js"></script>
<style>
div#newCss {
border: 1px solid #999;
width: 504px;
height: 140px;
}
</style>
</head>
<body>
<h4>rem样式</h4>
<textarea id="css" cols="60" rows="10"></textarea>
<br />
<input type="button" value="rem转换rpx" onclick="rem2rpx()" />
<h4>转换后的样式</h4>
<div id="newCss"></div>
<input id="aaa">
<input id="bbb">
<script type="text/javascript">
function rem2rpx() {
var oldCss = document.getElementById("css").value.trim(); //".similar_recommend .title{margin:.3rem 0 0;padding-top:.4rem;color:#666;font-size:.28rem;}"
//对原样式根据rem进行拆分成数组,这样除了最后一个元素,数组前边的几个元素都是以原rem样式数值结尾
//拆分后的格式:[".similar_recommend{background:#fff;border-radius:.1", ";height:7.4", ";margin-top:-.3", "}"]
var newCssArr = oldCss.split("rem")
var newCss = "" //转换后新的样式变量
for(var i in newCssArr) {
if(i < newCssArr.length - 1) {
//非最后一个元素,对字符串按照:再次拆分,把rem样式的数值分离出来进行转换
var str = newCssArr[i]
var idx = str.lastIndexOf(':')
var prevStr = str.substring(0, idx + 1)
var nextStr = "" //nextStr格式为 -.3 , -3 , 3 , .3
if(str.indexOf('-.') > -1) {
//nextStr格式为-.3rem或-3rem
nextStr = str.substring(str.indexOf(':-') + 2, str.length)
//nextStr格式为.3rem或3rem
if(nextStr.indexOf('.') > -1) {
nextStr = "0" + nextStr
}
nextStr = "-" + parseInt(nextStr * 100) + "rpx"
} else {
nextStr = str.substring(idx + 1, str.length)
//处理 nextStr="1px .2"的情况
var index = nextStr.indexOf(' ')
if(index >= 0) {
let str1 = nextStr.substring(0, index)
let str2 = nextStr.substring(index + 1, nextStr.length)
str2 = str2.indexOf('.') > -1 ? "0" + str2 : str2
str2 = parseInt(str2 * 100) + "rpx"
nextStr = str1 + ' ' + str2
} else {
nextStr = nextStr.indexOf('.') > -1 ? "0" + nextStr : nextStr
nextStr = parseInt(nextStr * 100) + "rpx"
}
}
//重组数组内的样式字符串
newCss += prevStr + "" + nextStr
} else {
//追加最后一个数组元素
newCss += newCssArr[i]
}
}
document.getElementById("newCss").innerHTML = newCss
}
$("#bbb").keydown(function(event) {
if(event.which == 13) {
console.log("ok")
}
});
</script>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<template lang="pug">
.Allcomment
span 打开APP查看全部评论
</template>
<script>
export default {
name: "AllComment",
}
</script>
<style scoped lang="less">
.Allcomment{
width: 351px;
height: 44px;
border-radius: 4px;
border: solid 1px #d0302c;
text-align: center;
margin-left: 0.307rem;
line-height: 1.5;
span{
width: 139px;
height: 13px;
font-family: PingFangSC-Medium;
font-size: 14px;
font-weight: normal;
font-stretch: normal;
line-height: 24px;
letter-spacing: 0px;
color: #d0302c;
}
}
</style>

View File

@@ -0,0 +1,116 @@
<template lang="pug">
.comment
.title 全部评论
ul.list(v-if="commentList.length != 0")
li(v-for="(item,index) in commentList")
img(class="tx" :src="item.image")
.right
.right_top
.name
p {{ item.nick_name }}
span {{ item.create_time }}
.zan
img(src="/static/img/icon/give_thumbs-up.png")
span {{ item.praise_count }}
.right_bottom {{ item.content }}
.nodata(v-else)
img(src="/static/img/hm_bg_img_no.png")
p 快来发表你的评论吧
</template>
<script>
export default {
name: 'Comment',
props: {
commentList: {
type: Array,
default: () => []
}
},
data () {
return {}
},
created () {
},
methods: {}
}
</script>
<style scoped lang="less">
.comment {
.title {
height: 15.5px;
background-color: #ffffff;
font-family: PingFangSC-Bold;
font-size: 16px;
color: #333333;
padding: 0 0.32rem;
box-sizing: border-box;
line-height: 16.8px;
margin-bottom: 0.373rem;
}
.list {
padding: 0 0.32rem;
box-sizing: border-box;
li {
display: flex;
justify-content: flex-start;
margin-bottom: 0.933rem;
.tx {
width: 0.933rem;
height: 0.947rem;
margin-right: 0.267rem;
border-radius: 100%;
}
.right {
.right_top {
margin-bottom: 0.507rem;
display: flex;
justify-content: space-between;
align-items: center;
.name {
font-size: 0;
p {
font-size: 0.373rem;
color: #333333;
}
span {
font-size: 0.267rem;
color: #999999;
}
}
.zan {
img {
width: 0.347rem;
height: 0.36rem;
margin-right: 0.133rem;
vertical-align: middle;
}
span {
font-size: 0.32rem;
color: #999999;
}
}
}
.right_bottom {
font-size: 0.373rem;
color: #333333;
}
}
}
}
.nodata {
text-align: center;
margin-top: 0.84rem;
img {
width: 209px;
height: 175px;
margin-bottom: 0.68rem;
}
p {
font-size: 14px;
color: #999999;
}
}
}
</style>

View File

@@ -0,0 +1,128 @@
<template lang="pug">
.recommend2
.recommend(v-if="vertical")
.recommend-title
span 相关推荐
ul
li(v-for='(item) in relevant')
.recommend-text
span {{item.title}}
p {{item.create_time}}
.recommend-img
img(:src='item.icon')
.recommend1(v-else)
.recommend-title1
span 相关推荐
ul
li(v-for='(val) in relevant')
.recommend-img1
img(:src='val.icon')
span {{val.title}}
</template>
<script>
export default {
name: 'Recommend',
props: {
relevant: {
type: Array,
default: () => []
},
NewsList: {
type: Array,
default: () => []
},
vertical: {
type: Boolean,
default: true
}
},
methods: {
}
}
</script>
<style scoped lang="less">
.recommend2{
padding-right: 25rpx;
.recommend1 {
padding-left: 24rpx;
border-top: 1rpx solid #f3f3f3;
.recommend-title1{
height: 100rpx;
overflow: hidden;
span {
display: block;
margin-top: 32rpx;
font-size: 32rpx;
font-weight: 700;
}
}
ul {
display: flex;
overflow-x: scroll;
border-bottom: 1px solid #f3f3f3;
padding: 0!important;
li {
list-style: none;
margin-left: 24rpx;
span{
display: block;
margin-top: 0;
margin-bottom: 40rpx;
font-size: 28rpx;
}
.recommend-img1 img{
width: 274rpx;
height: 156rpx;
border-radius: 4rpx;
}
}
}
}
.recommend {
padding-left: 24rpx;
border-top: 16rpx solid #f3f3f3;
border-bottom: 29rpx solid #f3f3f3;
.recommend-title{
height: 101rpx;
overflow: hidden;
span {
display: block;
margin-top: 36rpx;
font-size: 32rpx;
}
}
ul {
padding-right: 23rpx;
padding-left: 23rpx;
li {
height: 258rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #f3f3f3;
.recommend-text {
display: flex;
flex-flow: column;
span{
width: 312rpx;
font-size: 32rpx;
}
p {
margin-top: 40rpx;
font-size: 24rpx;
color: #999999;
}
}
.recommend-img img{
width: 226rpx;
height: 170rpx;
border-radius: 4rpx;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,53 @@
<template lang="pug">
.title
.title-left
img.logo(src="../static/img/icon/gw_img_logo.png")
img.text-img(src="../static/img/icon/logo_text_icon.png")
button 打开
</template>
<script>
export default {
name: "Top",
};
</script>
<style scoped lang="less">
.title {
height: 100rpx;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #4c4c4c;
display: flex;
left: 0;
right: 0;
top: 0;
.title-left {
margin-left: 12rpx;
display: flex;
align-items: center;
.logo {
margin-top: 5.625rpx;
width: 65rpx;
height: 65rpx;
}
.text-img {
margin-left: 9.4875rpx;
width: 132rpx;
height: 46rpx;
}
}
button {
width: 144rpx;
height: 52rpx;
line-height: 52rpx;
margin-right: 19.9875rpx;
color: #fff;
background-color: #d0302c;
border-radius: 8rpx;
border: none;
font-size: 12rpx;
}
}
</style>

View File

@@ -0,0 +1,87 @@
<template>
<div class="tvlist">
<div v-for="(item, index) in TvList" :key="index" @click="tolink(item)">
<span :class="item.id == currentId ? 's_active' : ''">{{
item.title
}}</span
><img v-if="item.id == currentId" src="/static/img/act-list.gif" />
</div>
</div>
</template>
<script>
export default {
name: "TvList",
props: {
showIcon: {
type: Boolean,
default: true,
},
showActive: {
type: Boolean,
default: true,
},
},
data() {
return {
currentId: 0,
//保存的是首页第二个包河TV接口里的数据
TvList: [],
};
},
created() {
this.getList();
this.changeStaus();
},
methods: {
changeStaus() {
let id = this.$route.query.id;
if (id != undefined) {
this.currentId = id;
}
},
//首页第二个包河TV接口
async getList() {
this.TvList = await this.$http.index.channelList({
page: this.page,
count: 20,
});
console.log(this.TvList);
},
//点击跳转带参数
tolink(item) {
uni.navigateTo({
url: `/pages/watchtv/watchtv?url=${item.play_url}&id=${item.id}`,
});
},
},
};
</script>
<style scoped lang="less">
.tvlist {
div {
height: 120rpx;
background-color: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 0.813rem;
padding-right: 0.36rem;
box-sizing: border-box;
border-bottom: 0.013rem solid #e5e5e5;
span {
font-family: PingFangSC-Bold;
font-size: 0.427rem;
color: #333333;
}
.s_active {
color: #d0302c !important;
}
img {
width: 27rpx;
height: 30rpx;
}
}
}
</style>

View File

@@ -0,0 +1,59 @@
<template>
<view class="swiper_list">
<swiper class="swiper"
:autoplay="autoplay"
:current="currentIndex"
:interval="interval"
@change="SwiperChange">
<swiper-item v-for="(item,index) in list" :key="index">
<img :src="item.url" alt="">
</swiper-item>
</swiper>
<div class="numbers">{{ currentIndex + 1 }} / {{ list.length }}</div>
</view>
</template>
<script>
export default {
props: {
list: {
type: Array,
default: () => []
}
},
data() {
return {
autoplay: true,
interval: 3000,
currentIndex: 0
}
},
methods: {
SwiperChange(e) {
this.currentIndex = e.detail.current
}
}
}
</script>
<style scoped>
.swiper_list {
position: relative;
}
.numbers {
width: 50px;
height: 24px;
background-color: #000000;
border-radius: 12px;
opacity: 0.6;
color: #ffffff;
font-size: 13px;
text-align: center;
line-height: 24px;
position: absolute;
right: 10px;
bottom: 20px;
}
</style>

View File

@@ -0,0 +1,54 @@
<template>
<view class="mysss">
<!--#ifdef H5-->
<view class="video-js" ref="video">
</view>
<!-- #endif -->
<!--#ifdef APP-PLUS-->
<video
class="my_video"
object-fit="fill"
:src="src"
controls></video>
<!-- #endif -->
</view>
</template>
<script>
//
export default {
props: {
src: {
type: String,
default: ''
}
},
data() {
return {
};
},
mounted() {
// #ifdef H5
var video = document.createElement('video')
video.id = 'video'
video.style = 'width: 100%;height: 150px;'
video.controls = true
var source = document.createElement('source')
source.src = this.src
video.appendChild(source)
this.$refs.video.$el.appendChild(video)
videojs('video')
// #endif
},
}
</script>
<style>
.my_video {
width: 100%;
}
</style>