Merge pull request 'xbx' (#126) from xbx into master

Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/126
This commit is contained in:
luyuan 2020-11-12 10:40:08 +08:00
commit c43c74e967
14 changed files with 159 additions and 58 deletions

View File

@ -852,8 +852,8 @@ export async function cancellive(id: number, status: number){
/**
*
*/
export async function changetel(e: string) {
const res = await put(`member/${store.state.userinfo.memberid}`,{mobile:e});
export async function changetel(code: string,e: string) {
const res = await put(`member/${store.state.userinfo.memberid}`,{code: code, mobile:e});
console.log(res)
if(res.code == 0){
message.success("修改成功")
@ -1049,3 +1049,13 @@ export async function getset() {
const res = await get('getset');
return res.data;
}
export async function setheadimg(src: string){
const res = await put(`member/${store.state.userinfo.memberid}`,{img: src});
console.log(res)
}
export async function setusername(src: string){
const res = await put(`member/${store.state.userinfo.memberid}`,{name: src});
console.log(res)
}

View File

@ -35,7 +35,7 @@
</template>
<style lang="scss" scoped>
.videoitem{
width: 226px;
min-width: 226px;
// height: 198px;
background-color: #fff;
border-radius: 17px;
@ -46,7 +46,8 @@
position: relative;
box-shadow: 0px 5px 6px 0px rgba(158, 158, 158, 0.11);
.cover{
width: 100%;
width: 226px;
min-width: 100%;
height: 127px;
}
.play{

View File

@ -15,7 +15,8 @@
</div>
<div class="all" @click="findall(replyid)" >
<span>{{lan.$t('suoyouhuifu')}}</span>
<img src="@/static/images/arrowdownblue.png" alt="">
<img v-show="!iszk" src="@/static/images/arrowdownblue.png" alt="">
<img v-show="iszk" src="@/static/images/arrowdownblueup.png" alt="">
</div>
</div>
<div class="cont">
@ -23,7 +24,13 @@
</div>
<div class="bottom">
<div class="date">{{date}}</div>
<div class="reply" @click="reply(username)">{{lan.$t('huifu')}}</div>
<div style="display: flex">
<div class="del" @click="del(replyid)">
{{lan.$t('shanchu')}}
</div>
<div class="reply" @click="reply(username)">{{lan.$t('huifu')}}</div>
</div>
</div>
<div class="huifu" v-if="ifshow">
@ -113,16 +120,24 @@
font-size: 10px;
color: #08AE98;
}
.del{
font-size: 10px;
color:#D12C2D!important;
flex-shrink: 0;
margin-right: 28px;
}
}
.huifu{
border-top: solid 1px #eee;
margin-left: 56px;
margin-top: 30px;
}
}
</style>
<script lang="ts">
import { getcommentlist } from '@/api';
import { delreply, getcommentlist } from '@/api';
import { useI18n } from '@/utils/i18n';
import { message } from 'ant-design-vue';
import { defineComponent, onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
import ReviewItemtwo from "./ReviewItemtwo.vue"
@ -160,6 +175,7 @@ export default defineComponent({
const reviewlist=ref({})
const videoid=ref(useRoute().query.id)
const ifshow=ref(false)
const iszk = ref(false)
onMounted(async () => {
reviewlist.value=await getcommentlist({type: 2,id: videoid.value})
})
@ -195,9 +211,36 @@ export default defineComponent({
}
async function findall(e: number){
console.log("all")
if(iszk.value){
iszk.value = false;
ifshow.value= false;
return ;
}
iszk.value = true
replylist.value =await getcommentlist({type: 3,id: e})
ifshow.value=ifshow.value==false?true:false
ifshow.value = true;
}
async function reload() {
if(iszk.value == true){
iszk.value = false;
if(prop.replyid){
findall(prop.replyid)
}
}
}
async function del(e?: number){
console.log(e)
const res=await delreply(e)
if(res.code != 0){
message.error(res.msg)
}
reload()
}
return {
stars,
reply,
@ -206,7 +249,10 @@ export default defineComponent({
reviewlist,
refresh,
ifshow,
lan
lan,
del,
iszk,
reload
}
}
})

View File

@ -14,7 +14,7 @@
<!-- <div class="reply" @click="reply(username)">
回复
</div> -->
<div class="del" @click="del(replyid)" v-if="parseInt(memberid)==myid">
<div class="del" @click="del(replyid)">
{{lan.$t('shanchu')}}
</div>
</div>
@ -100,6 +100,7 @@
import { delreply } from '@/api';
import store from '@/store';
import { useI18n } from '@/utils/i18n';
import { message } from 'ant-design-vue';
import { defineComponent, ref } from 'vue';
export default defineComponent({
@ -139,6 +140,8 @@ export default defineComponent({
const res=await delreply(e)
if(res.code==0){
context.emit("reload",prop.replyid)
}else {
message.error(res.msg)
}
console.log(res)

View File

@ -36,7 +36,7 @@
</template>
<style lang="scss" scoped>
.videoitem{
width: 226px;
min-width: 226px;
// height: 198px;
background-color: #fff;
border-radius: 17px;
@ -47,7 +47,8 @@
box-shadow: 0px 5px 6px 0px rgba(158, 158, 158, 0.11);
cursor: pointer;
.cover{
width: 100%;
width: 226px;
min-width: 100%;
height: 127px;
// background-color: #0f0;
}

View File

@ -18,6 +18,7 @@
:replyid="i.commentid"
@replying="reply"
@findall="findreply"
:ref="el => {list[j] = el}"
></ReviewItem>
@ -124,6 +125,7 @@ export default defineComponent({
const replylist =ref({})
const videoid=ref(useRoute().query.id)
const url = useRoute().path
const list = ref<any>([])
onMounted(async () => {
let type = 1;
if(url == '/regime/livedetail'){
@ -132,6 +134,7 @@ export default defineComponent({
type = 2;
}
reviewlist.value=await getcommentlist({type: type,id: videoid.value})
})
console.log(useRoute().query)
console.log(store.state.userinfo.memberid,"userifno")
@ -151,7 +154,12 @@ export default defineComponent({
data.value.content=commentval.value
console.log(data.value,2221)
if(uinfo.value.name){
addcomment(toRaw(data.value))
addcomment(toRaw(data.value)).then(()=>{
for(const i in list.value){
list.value[i].reload()
}
})
}else{
message.error(lan.$t('xuanzehuifuxuesheng'))
}
@ -183,7 +191,8 @@ export default defineComponent({
haslist,
reviewlist,
refresh,
lan
lan,
list
}

View File

@ -94,7 +94,7 @@ export default {
shipinyaoqiu: "Video requirements:",
shipinyaoqiu1: "The time required for uploading video is within 30s",
shipinyaoqiu2: "Support file size 100m",
shipinyaoqiu3: "File extension: FIV, MP4",
shipinyaoqiu3: "File extension: FLV, MP4, MOV, AVI, WAV",
ziwojieshao: "self-introduction",
lianxifangshi: "contact information",
genghuanshoujihao: "Change mobile phone number",
@ -300,7 +300,7 @@ export default {
shijirenshu: "Actual number of live broadcast",
shijishichang: "Actual live broadcast duration",
cshipinyaoqiu1: "The video should be no longer than 10 minutes",
cshipinyaoqiu2: "Video size cannot exceed 500MB",
cshipinyaoqiu2: "Video size cannot exceed 500M",
shichangtishi:"",
renshutishi: '',
tixianzhu: "",

View File

@ -94,7 +94,7 @@ export default {
shipinyaoqiu:"视频要求:",
shipinyaoqiu1:"上传视频时间要求为30s之内",
shipinyaoqiu2:"支持文件大小100M",
shipinyaoqiu3:"文件扩展名fiv、mp4",
shipinyaoqiu3:"文件扩展名flv、mp4、mov、avi、wav",
fengmianyaoqiu:"封面要求:",
fengmianyaoqiu1:"文件扩展名jpgpng",
fengmianyaoqiu2:"文件大小限制2M",
@ -300,7 +300,7 @@ export default {
shijirenshu: "实际直播人数",
shijishichang: "实际直播时长",
cshipinyaoqiu1: "视频长度不能超过10分钟",
cshipinyaoqiu2: "视频大小不能超过500mb",
cshipinyaoqiu2: "视频大小不能超过500m",
shichangtishi:"",
renshutishi: '',
tixianzhu:"",

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -59,16 +59,19 @@ export function getValue(key: string): any{
* @param name
*/
export function provenimg(name: string): boolean{
export function provenimg(file: any): boolean | void{
const type = ['png', 'jpg'];
const ntypearr = name.split('.');
const ntypearr = file.name.split('.');
const ntype = ntypearr[ntypearr.length - 1];
console.log(ntype)
let istype = false
for(const i in type){
if(type[i] == ntype){
return true;
istype = true
}
}
return false;
console.log(istype)
return istype;
}
/**
@ -76,9 +79,9 @@ export function provenimg(name: string): boolean{
* @param name
*/
export function provenvideo(name: string): boolean{
const type = ['flv', 'mp4'];
const ntypearr = name.split('.');
export function provenvideo(file: any): boolean{
const type = ['flv', 'mp4', 'wmv', 'mov', 'avi'];
const ntypearr = file.name.split('.');
const ntype = ntypearr[ntypearr.length - 1];
for(const i in type){
if(type[i] == ntype){

View File

@ -9,6 +9,7 @@
class="avatar-uploader"
:show-upload-list="false"
:customRequest="uploadspic"
:beforeUpload="imgs"
@change="handleChange"
>
<a-avatar :size="85" shape="circle" :src="userinfo.img">
@ -37,6 +38,7 @@
size="small"
v-model:value="userinfo.name"
:placeholder="lan.$t('shuruxinnicheng')"
@pressEnter="setname"
/>
</div>
</div>
@ -176,7 +178,7 @@
<a-upload
list-type="picture"
:customRequest="uploads"
:beforeUpload="beforeVideoUpload"
:beforeUpload="video"
>
<div class="upload-image">
<PlaySquareOutlined
@ -525,10 +527,12 @@ import {
interests,
putmember,
sendsms,
setheadimg,
setusername,
} from "@/api/index";
import { message } from "ant-design-vue";
import { useI18n } from "@/utils/i18n";
import { provenvideo } from '@/utils/common';
import { provenimg, provenvideo } from '@/utils/common';
export default defineComponent({
name: "Archives",
@ -735,7 +739,7 @@ export default defineComponent({
);
console.log(res, "xiugai");
if (res) {
const res1 = await changetel(mynewtel.value);
const res1 = await changetel(myquhao.value, mynewtel.value);
if (res1) {
store.dispatch("setUserInfo");
updatePhoneVisible.value = false;
@ -971,16 +975,29 @@ export default defineComponent({
// picinfo.fileId=res.fileId
// picinfo.url=res.video.url
formData.value.img = res.video.url;
setheadimg(res.video.url);
}
function beforeVideoUpload(file: any){
console.log(file)
const type = provenvideo(file.name);
if(!type){
message.error("文件类型错误,请重新选择")
}
return false;
// function beforeVideoUpload(file: any){
// console.log(file)
// const type = provenvideo(file.name);
// // if(!type){
// // message.error(",")
// // }
// return type;
// }
function video(file: any){
return provenvideo(file)
}
function imgs(file: any){
return provenimg(file)
}
function setname(){
setusername(formData.value.name).then(()=>{
showname.value = true;
})
}
// function selguojia(e: any){
// userinfo.value.countryValue = e;
// console.log(e)
@ -1029,7 +1046,9 @@ export default defineComponent({
lan,
interestslist,
isdisabled,
beforeVideoUpload
setname,
video,
imgs
};
},
});

View File

@ -37,11 +37,11 @@
</div>
<div class="data">
<div class="label">{{lan.$t('zongguankanshu')}}</div>
<div class="right">{{statistics.videoInfo?statistics.videoInfo.sum:0}}</div>
<div class="right">{{statistics.videoInfo?statistics.videoInfo.watch:0}}</div>
</div>
<div class="data">
<div class="label">{{lan.$t('pingjundefen')}}</div>
<div class="right">{{statistics.videoInfo?statistics.videoInfo.sum:0}}</div>
<div class="right">{{statistics.videoInfo?statistics.videoInfo.avg:0}}</div>
</div>
<img src="@/static/images/shipintj.png" alt="" class="zhuzi" />
</div>

View File

@ -14,7 +14,7 @@
<a-upload
list-type="picture"
:customRequest="uploadspic"
:before-upload="beforeUploadpic"
:beforeUpload="imgs"
>
<div
class="upload-image"
@ -59,7 +59,7 @@
<a-upload
list-type="picture"
:customRequest="uploads"
:before-upload="beforeUpload"
:beforeUpload="video"
>
<div class="upload-image" v-if="form.fileurl.length == 0">
<PlaySquareOutlined
@ -131,7 +131,7 @@
import { defineComponent, onMounted, reactive, Ref, ref, toRaw } from "vue";
import { PlaySquareOutlined, PlusOutlined } from "@ant-design/icons-vue";
import NavBottom from "@/components/NavBottom.vue";
import { previewCover, provenimg } from "@/utils/common";
import { previewCover, provenimg, provenvideo } from "@/utils/common";
import { FromSend, ImgInfo, VideoInfo } from "@/types";
import { uploadflie } from "@/utils/vod";
import { setvideo, videoadd, videodetail } from "@/api";
@ -227,16 +227,14 @@ export default defineComponent({
file: File;
}
async function uploadspic(file: AntUpload) {
if (ifalowupload.value) {
const res = await uploadflie(file.file, (info: any) => {
console.log(info);
uploadpicprogress.value = info.percent.toFixed(2) * 100;
});
console.log(res);
form.value.img = res.video.url;
} else {
return;
}
}
function beforeUploadpic(info?: any) {
@ -256,7 +254,6 @@ export default defineComponent({
const uploadprogress: Ref<number> = ref(0);
const ifallowvideo = ref<boolean>(false);
async function uploads(file: AntUpload) {
if (ifallowvideo.value) {
console.log(file);
videofile.value = file.file;
videos.value[0].addEventListener("durationchange", () => {
@ -271,7 +268,6 @@ export default defineComponent({
form.value.fileid = res.fileId;
form.value.fileurl = res.video.url;
}
}
function beforeVideoUpload(info?: any) {
@ -326,6 +322,13 @@ export default defineComponent({
ifallowvideo.value = true;
}
}
function video(file: any){
return provenvideo(file)
}
function imgs(file: any){
return provenimg(file)
}
return {
labelCol: { span: 4 },
@ -349,7 +352,9 @@ export default defineComponent({
ifalowupload,
beforeVideoUpload,
lan,
beforeUploadpic
beforeUploadpic,
video,
imgs
};
},
});

View File

@ -14,7 +14,7 @@
<a-upload
list-type="picture"
:customRequest="uploadspic"
:before-upload="beforeUploadpic"
:before-upload="imgs"
>
<div
class="upload-image"
@ -61,7 +61,7 @@
<a-upload
list-type="picture"
:customRequest="uploads"
:before-upload="beforeUpload"
:before-upload="video"
>
<div class="upload-image" v-if="form.fileurl.length == 0">
<PlaySquareOutlined
@ -94,7 +94,7 @@
</div>
</a-upload>
<div class="demand">
<p class="one-line-hide">
<p>
{{ lan.$t("shipinyaoqiu") }}
</p>
<p>1.{{ lan.$t("shipinyaoqiu1") }}</p>
@ -233,7 +233,7 @@ import { PlaySquareOutlined, PlusOutlined } from "@ant-design/icons-vue";
import { useForm } from "@ant-design-vue/use";
import NavBottom from "@/components/NavBottom.vue";
import RankList from "./RankList.vue";
import { previewCover } from "@/utils/common";
import { previewCover, provenimg, provenvideo } from "@/utils/common";
import { FromSend, ImgInfo } from "@/types/index";
import { uploadflie } from "@/utils/vod";
import { cancellive, getlivest, liveadd, liveinfo, setlive } from "@/api";
@ -475,7 +475,6 @@ export default defineComponent({
}
}
async function uploads(file: AntUpload) {
if (ifallowupload.value) {
console.log(file);
videofile.value = file.file;
videos.value[0].addEventListener("durationchange", () => {
@ -490,11 +489,9 @@ export default defineComponent({
form.value.fileid = res.fileId;
form.value.fileurl = res.video.url;
}
}
const ifallowpic = ref<boolean>(false);
async function uploadspic(file: AntUpload) {
if (ifallowpic.value) {
const res = await uploadflie(file.file, (info: any) => {
console.log(info);
uploadpicprogress.value = info.percent.toFixed(2) * 100;
@ -504,7 +501,6 @@ export default defineComponent({
// picinfo.fileId=res.fileId
// picinfo.url=res.video.url
form.value.img = res.video.url;
}
}
getlivest().then((res) => {
@ -540,6 +536,12 @@ export default defineComponent({
})
}
}
function video(file: any){
return provenvideo(file)
}
function imgs(file: any){
return provenimg(file)
}
return {
labelCol: { span: 4 },
@ -574,7 +576,9 @@ export default defineComponent({
disabledDate,
isbianji,
onquxiao,
isquxiao
isquxiao,
video,
imgs
};
},
});
@ -672,7 +676,7 @@ export default defineComponent({
font-size: 10px;
font-weight: 500;
color: #808080;
width: 134px;
// width: 134px;
> p {
margin: 0;
}