Compare commits

..

No commits in common. "ce71b7942c8a7f95c05d96142d9c6e5b22e7d5bb" and "8e2a23ed6937d99860f7e9e4bb1903116f55df4e" have entirely different histories.

13 changed files with 1559 additions and 1840 deletions

View File

@ -1,121 +0,0 @@
// @ts-nocheck
export {};
; declare global {
const __VLS_intrinsicElements: __VLS_IntrinsicElements;
const __VLS_directiveBindingRestFields: { instance: null, oldValue: null, modifiers: any, dir: any };
const __VLS_unref: typeof import('vue').unref;
const __VLS_placeholder: any;
type __VLS_NativeElements = __VLS_SpreadMerge<SVGElementTagNameMap, HTMLElementTagNameMap>;
type __VLS_IntrinsicElements = import('vue/jsx-runtime').JSX.IntrinsicElements;
type __VLS_Element = import('vue/jsx-runtime').JSX.Element;
type __VLS_GlobalComponents = import('vue').GlobalComponents;
type __VLS_GlobalDirectives = import('vue').GlobalDirectives;
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
type __VLS_SpreadMerge<A, B> = Omit<A, keyof B> & B;
type __VLS_WithComponent<N0 extends string, LocalComponents, Self, N1 extends string, N2 extends string, N3 extends string> =
N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N1] } :
N2 extends keyof LocalComponents ? N2 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N2] } :
N3 extends keyof LocalComponents ? N3 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N3] } :
Self extends object ? { [K in N0]: Self } :
N1 extends keyof __VLS_GlobalComponents ? N1 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N1] } :
N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N2] } :
N3 extends keyof __VLS_GlobalComponents ? N3 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N3] } :
{ [K in N0]: unknown };
type __VLS_FunctionalComponentProps<T, K> =
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
: T extends (props: infer P, ...args: any) => any ? P :
{};
type __VLS_IsFunction<T, K> = K extends keyof T
? __VLS_IsAny<T[K]> extends false
? unknown extends T[K]
? false
: true
: false
: false;
type __VLS_NormalizeComponentEvent<Props, Events, onEvent extends keyof Props, Event extends keyof Events, CamelizedEvent extends keyof Events> = (
__VLS_IsFunction<Props, onEvent> extends true
? Props
: __VLS_IsFunction<Events, Event> extends true
? { [K in onEvent]?: Events[Event] }
: __VLS_IsFunction<Events, CamelizedEvent> extends true
? { [K in onEvent]?: Events[CamelizedEvent] }
: Props
) & Record<string, unknown>;
// fix https://github.com/vuejs/language-tools/issues/926
type __VLS_UnionToIntersection<U> = (U extends unknown ? (arg: U) => unknown : never) extends ((arg: infer P) => unknown) ? P : never;
type __VLS_OverloadUnionInner<T, U = unknown> = U & T extends (...args: infer A) => infer R
? U extends T
? never
: __VLS_OverloadUnionInner<T, Pick<T, keyof T> & U & ((...args: A) => R)> | ((...args: A) => R)
: never;
type __VLS_OverloadUnion<T> = Exclude<
__VLS_OverloadUnionInner<(() => never) & T>,
T extends () => never ? never : () => never
>;
type __VLS_ConstructorOverloads<T> = __VLS_OverloadUnion<T> extends infer F
? F extends (event: infer E, ...args: infer A) => any
? { [K in E & string]: (...args: A) => void; }
: never
: never;
type __VLS_NormalizeEmits<T> = __VLS_PrettifyGlobal<
__VLS_UnionToIntersection<
__VLS_ConstructorOverloads<T> & {
[K in keyof T]: T[K] extends any[] ? { (...args: T[K]): void } : never
}
>
>;
type __VLS_PrettifyGlobal<T> = { [K in keyof T]: T[K]; } & {};
type __VLS_PickFunctionalComponentCtx<T, K> = NonNullable<__VLS_PickNotAny<
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: infer Ctx } ? Ctx : never : any
, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
>>;
type __VLS_OmitStringIndex<T> = {
[K in keyof T as string extends K ? never : K]: T[K];
};
type __VLS_UseTemplateRef<T> = Readonly<import('vue').ShallowRef<T | null>>;
function __VLS_getVForSourceType<T extends number | string | any[] | Iterable<any>>(source: T): [
item: T extends number ? number
: T extends string ? string
: T extends any[] ? T[number]
: T extends Iterable<infer T1> ? T1
: any,
index: number,
][];
function __VLS_getVForSourceType<T>(source: T): [
item: T[keyof T],
key: keyof T,
index: number,
][];
// @ts-ignore
function __VLS_getSlotParams<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>;
// @ts-ignore
function __VLS_getSlotParam<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>[0];
function __VLS_asFunctionalDirective<T>(dir: T): T extends import('vue').ObjectDirective
? NonNullable<T['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']>
: T extends (...args: any) => any
? T
: (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
function __VLS_makeOptional<T>(t: T): { [K in keyof T]?: T[K] };
function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K):
T extends new (...args: any) => any
? (props: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & {
__ctx?: {
attrs?: any;
slots?: K extends { $slots: infer Slots } ? Slots : any;
emit?: K extends { $emit: infer Emit } ? Emit : any;
expose?(exposed: K): void;
props?: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>;
}
}
: T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
: T extends (...args: any) => any ? T
: (_: {} & Record<string, unknown>, ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {} & Record<string, unknown> } };
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
function __VLS_asFunctionalElement<T>(tag: T, endTag?: T): (attrs: T & Record<string, unknown>) => void;
function __VLS_asFunctionalSlot<S>(slot: S): (props: NonNullable<S> extends (props: infer P) => any ? P : {}) => void;
function __VLS_tryAsConstant<const T>(t: T): T;
}

View File

@ -354,9 +354,9 @@ const mine = {
},
/**
* 查看已绑定的银行卡列表
* @param {Object} param
*/
* 查看已绑定的银行卡列表
* @param {Object} param
*/
getBankCards(param) {
return util.request({
url: '/user/bank-cards/getBankCards',
@ -366,8 +366,9 @@ const mine = {
load: true,
})
},
/**
* 添加银行卡
* 添加银行卡
* @param {Object} param
*/
addBankCard(param) {
@ -392,30 +393,6 @@ const mine = {
load: true,
})
},
/**
* 拉黑
* @param {Object} param
*/
blockUser(param) {
return util.request({
url: `/video/statistics/block`,
data: param,
method: 'POST',
})
},
/**
* 解锁他人评论
* @param {Object} param
*/
unlockComment(param) {
return util.request({
url: `/video/comment/unlockOthersComment`,
data: param,
method: 'POST',
})
},
}
export default mine

View File

@ -426,7 +426,7 @@ const video = {
*/
reportVideo(param) {
return util.request({
url: `/video/videoReport`,
url: `/report/reportVideo`,
data: param.data,
method: 'POST',
})

View File

@ -1,138 +1,138 @@
<script setup>
/**
* 视频菜单组件
*
*/
/**
* 视频菜单组件
*
*/
import {
ref,
reactive,
onMounted
} from 'vue'
import video from '../../api/video';
import util from '../../common/js/util';
import {
ref,
reactive,
onMounted
} from 'vue'
import video from '../../api/video';
import util from '../../common/js/util';
//
const props = defineProps({
//
list: {
type: Array,
},
// list menu checkbox
mode: {
type: String,
default: 'list',
},
// 0
limit: {
type: Number,
default: 0,
},
// 0 1
isMine: {
type: [String, Number],
default: 0,
},
// 0 1
statistic: {
type: [String, Number],
default: 0,
},
})
//
const emit = defineEmits(['item'])
// id
const videoInfo = reactive({
videoId: '',
coverUrl: '',
})
//
const videoContext = ref(null)
//
const videoUrl = ref('')
//
const props = defineProps({
//
list: {
type: Array,
},
// list menu checkbox
mode: {
type: String,
default: 'list',
},
// 0
limit: {
type: Number,
default: 0,
},
// 0 1
isMine: {
type: [String, Number],
default: 0,
},
// 0 1
statistic: {
type: [String, Number],
default: 0,
},
})
//
const emit = defineEmits(['item'])
// id
const ids = defineModel('ids')
//
const videoContext = ref(null)
//
const videoUrl = ref('')
onMounted(() => {
//
videoContext.value = uni.createVideoContext('video')
})
onMounted(() => {
//
videoContext.value = uni.createVideoContext('video')
})
//
function requestFullScreen() {
videoContext.value.requestFullScreen()
}
//
function requestFullScreen() {
videoContext.value.requestFullScreen()
}
//
function pause() {
//
videoContext.value.pause()
}
//
function pause() {
//
videoContext.value.pause()
}
/**
* 点击视频播放
* @param {Object} item
*/
function handleVideo(item) {
//
if (props.mode == 'list') {
uni.navigateTo({
url: util.setUrl('/pages/index/videoDetail', {
videoId: item.id,
isMine: props.isMine,
statistic: props.statistic,
/**
* 点击视频播放
* @param {Object} item
*/
function handleVideo(item) {
//
if (props.mode == 'list') {
uni.navigateTo({
url: util.setUrl('/pages/index/videoDetail', {
videoId: item.id,
isMine: props.isMine,
statistic: props.statistic,
})
})
})
// videoUrl.value = item.format_videoUrl
//
// requestFullScreen()
// videoUrl.value = item.format_videoUrl
//
// requestFullScreen()
}
//
else if (props.mode == 'menu') {
emit('item', item)
}
//
else if (props.mode == 'checkbox') {
const findIndex = ids.value.findIndex(node => node == item.videoId)
if (findIndex >= 0) ids.value.splice(findIndex, 1)
else {
//
if (props.limit != 0 && props.limit <= ids.value.length) return
ids.value.push(item.videoId)
}
}
}
//
else if (props.mode == 'menu') {
emit('item', item)
}
//
else if (props.mode == 'checkbox') {
videoInfo.videoId = item.id
videoInfo.coverUrl = item.coverUrl
videoUrl.value = item.videoUrl
emit('videoInfo', videoInfo)
}
}
/**
* 视频进入退出全屏
* @param {Object} ev
*/
function videoFullscreenchange(ev) {
//
if (ev.detail.fullScreen) videoContext.value.play()
else pause()
}
/**
* 视频进入退出全屏
* @param {Object} ev
*/
function videoFullscreenchange(ev) {
//
if (ev.detail.fullScreen) videoContext.value.play()
else pause()
}
defineExpose({
videoContext,
pause,
requestFullScreen,
})
defineExpose({
videoContext,
pause,
requestFullScreen,
})
</script>
<template>
<view>
<!-- 视频菜单 -->
<view class="list">
<view class="item pr" v-for="(item, index) in list" :key="index" @click="handleVideo(item)">
<view class="item pr" v-for="(item,index) in list" :key="index" @click="handleVideo(item)">
<image :src="item.coverUrl" mode="aspectFill" />
<view class="window pfull"></view>
<!-- 选项 -->
<view class="amount pa r0 t0 df ptb10 plr10" v-if="mode == 'checkbox'">
<uni-icons type="circle-filled" size="50rpx" color="#20D200" v-if="videoInfo.videoId == item.id" />
<uni-icons type="circle-filled" size="50rpx" color="#20D200" v-if="ids.includes(item.videoId)" />
<uni-icons type="circle" color="#fff" size="50rpx" v-else />
</view>
<view class="amount pa l0 r0 b0 df ptb10 plr10" v-if="item.play">
<image class="wh24" src="/static/amount.png" mode="aspectFit" />
<view class="txt f1 ml10 cfff f20">{{ item.play }}</view>
<view class="txt f1 ml10 cfff f20">{{item.play}}</view>
</view>
</view>
</view>
@ -145,37 +145,37 @@ defineExpose({
</template>
<style lang="scss" scoped>
//
.list {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 5rpx;
//
.list {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 5rpx;
.item {
height: 360rpx;
.item {
height: 360rpx;
image {
width: 100%;
height: 100%;
image {
width: 100%;
height: 100%;
}
}
.window {
background-color: rgba(0, 0, 0, .1);
}
//
.amount {
.txt {
opacity: .5;
}
}
}
.window {
background-color: rgba(0, 0, 0, .1);
//
.videoContext {
position: absolute;
width: 0;
height: 0;
}
//
.amount {
.txt {
opacity: .5;
}
}
}
//
.videoContext {
position: absolute;
width: 0;
height: 0;
}
</style>

View File

@ -1,21 +0,0 @@
<script setup>
/**
* 未实名认证组件
*/
</script>
<template>
<view class="nologin pr fmid fdc">
<view class="title f40 b">请先实名认证</view>
<navigator url="/pages/mine/realname" class="button btn pro bar black mt60">去实名认证</navigator>
</view>
</template>
<style lang="scss" scoped>
//
.nologin {
.button {
width: 80%;
}
}
</style>

View File

@ -7,14 +7,18 @@ export {};
const __VLS_unref: typeof import('vue').unref;
const __VLS_placeholder: any;
type __VLS_NativeElements = __VLS_SpreadMerge<SVGElementTagNameMap, HTMLElementTagNameMap>;
const __VLS_nativeElements = {
...{} as SVGElementTagNameMap,
...{} as HTMLElementTagNameMap,
};
type __VLS_IntrinsicElements = import('vue/jsx-runtime').JSX.IntrinsicElements;
type __VLS_Element = import('vue/jsx-runtime').JSX.Element;
type __VLS_GlobalComponents = import('vue').GlobalComponents;
type __VLS_GlobalDirectives = import('vue').GlobalDirectives;
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
type __VLS_SpreadMerge<A, B> = Omit<A, keyof B> & B;
type __VLS_unknownDirective = (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
type __VLS_WithComponent<N0 extends string, LocalComponents, Self, N1 extends string, N2 extends string, N3 extends string> =
N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N1] } :
N2 extends keyof LocalComponents ? N2 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : { [K in N0]: LocalComponents[N2] } :
@ -77,12 +81,19 @@ export {};
};
type __VLS_UseTemplateRef<T> = Readonly<import('vue').ShallowRef<T | null>>;
function __VLS_getVForSourceType<T extends number | string | any[] | Iterable<any>>(source: T): [
item: T extends number ? number
: T extends string ? string
: T extends any[] ? T[number]
: T extends Iterable<infer T1> ? T1
: any,
function __VLS_getVForSourceType(source: number): [number, number][];
function __VLS_getVForSourceType(source: string): [string, number][];
function __VLS_getVForSourceType<T extends any[]>(source: T): [
item: T[number],
index: number,
][];
function __VLS_getVForSourceType<T extends { [Symbol.iterator](): Iterator<any> }>(source: T): [
item: T extends { [Symbol.iterator](): Iterator<infer T1> } ? T1 : never,
index: number,
][];
// #3845
function __VLS_getVForSourceType<T extends number | { [Symbol.iterator](): Iterator<any> }>(source: T): [
item: number | (Exclude<T, number> extends { [Symbol.iterator](): Iterator<infer T1> } ? T1 : never),
index: number,
][];
function __VLS_getVForSourceType<T>(source: T): [
@ -98,24 +109,21 @@ export {};
? NonNullable<T['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']>
: T extends (...args: any) => any
? T
: (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
: __VLS_unknownDirective;
function __VLS_withScope<T, K>(ctx: T, scope: K): ctx is T & K;
function __VLS_makeOptional<T>(t: T): { [K in keyof T]?: T[K] };
function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K):
T extends new (...args: any) => any
? (props: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & {
__ctx?: {
attrs?: any;
slots?: K extends { $slots: infer Slots } ? Slots : any;
emit?: K extends { $emit: infer Emit } ? Emit : any;
expose?(exposed: K): void;
props?: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>;
}
}
? (props: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & { __ctx?: {
attrs?: any,
slots?: K extends { $slots: infer Slots } ? Slots : any,
emit?: K extends { $emit: infer Emit } ? Emit : any
} & { props?: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>; expose?(exposed: K): void; } }
: T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
: T extends (...args: any) => any ? T
: (_: {} & Record<string, unknown>, ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {} & Record<string, unknown> } };
function __VLS_asFunctionalElement<T>(tag: T, endTag?: T): (_: T & Record<string, unknown>) => void;
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
function __VLS_asFunctionalElement<T>(tag: T, endTag?: T): (attrs: T & Record<string, unknown>) => void;
function __VLS_asFunctionalSlot<S>(slot: S): (props: NonNullable<S> extends (props: infer P) => any ? P : {}) => void;
function __VLS_normalizeSlot<S>(s: S): S extends () => infer R ? (props: {}) => R : S;
function __VLS_tryAsConstant<const T>(t: T): T;
}

View File

@ -1,204 +1,203 @@
<script setup>
/**
* 视频举报
*/
import {
ref,
reactive,
computed,
getCurrentInstance
} from 'vue'
import {
onLoad,
} from '@dcloudio/uni-app'
//
import util from '@/common/js/util';
// api
import api from '@/api/index.js'
//
import videoMenu from '@/components/index/videoMenu.vue';
/**
* 视频举报
*/
import {
ref,
reactive,
computed,
getCurrentInstance
} from 'vue'
import {
onLoad,
} from '@dcloudio/uni-app'
//
import util from '@/common/js/util';
// api
import api from '@/api/index.js'
//
import videoMenu from '@/components/index/videoMenu.vue';
const {
proxy
} = getCurrentInstance()
//
const reportList = reactive([{
name: '发布不正当的内容或信息',
},
{
name: '传播涩情资源',
},
{
name: '冒充他人',
},
{
name: '涉嫌诈骗',
},
{
name: '侵犯权益',
},
{
name: '其他',
}
])
//
const reportIndex = ref('')
//
const form = reactive({
userId: '',
videoId: '',
reasonForReporting: '',
particulars: '',
videoPictureUrl: '',
coverUrl: ''
})
//
const list = reactive({
data: [],
pageSize: 10,
pageNum: 1,
total: 0,
})
//
const videos = computed(() => {
let result = form.videoId.map(item => {
return list.data.find(node => node.videoId == item) || {}
const {
proxy
} = getCurrentInstance()
//
const reportList = reactive([{
name: '发布不正当的内容或信息',
},
{
name: '传播涩情资源',
},
{
name: '冒充他人',
},
{
name: '涉嫌诈骗',
},
{
name: '侵犯权益',
},
{
name: '其他',
}
])
//
const reportIndex = ref('')
//
const form = reactive({
userId: '',
videoId: [],
reason: '',
context: '',
pic: [],
})
//
const list = reactive({
data: [],
pageSize: 10,
pageNum: 1,
total: 0,
})
//
const videos = computed(() => {
let result = form.videoId.map(item => {
return list.data.find(node => node.videoId == item) || {}
})
return result
})
return result
})
onLoad((option) => {
// id
if (option.userId) form.userId = option.userId
onLoad((option) => {
// id
if (option.userId) form.userId = option.userId
//
getList()
})
/**
* 选择举报列表
* @param {Object} ev 携带参数
*/
function handleReportList(ev) {
const index = ev.detail.value
if (reportIndex.value === index) return
reportIndex.value = index
}
//
function refreshList() {
list.pageNum = 1
list.total = 0
getList()
}
//
function getMoreList() {
if (list.data.length >= list.rows) return
list.pageNum++
getList()
}
//
getList()
})
function getList() {
//
api.video.myVideoList({
query: {
isDraft: 0,
userId: form.userId,
pageSize: list.pageSize,
pageNum: list.pageNum,
}
}).then(rs => {
if (rs.code == 200) {
if (list.pageNum == 1) list.data.length = []
list.data.push(...rs.rows.map(item => {
item.format_videoUrl = util.format_url(item.videoUrl, 'video')
item.format_imageUrl = util.format_url(item.imageUrl, 'img')
return item
}))
list.total = rs.total
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
/**
* 选择举报列表
* @param {Object} ev 携带参数
*/
function handleReportList(ev) {
const index = ev.detail.value
if (reportIndex.value === index) return
reportIndex.value = index
}
//
function uploadImg() {
util.upload_image({
value: form.pic,
})
}
//
function refreshList() {
list.pageNum = 1
list.total = 0
getList()
}
/**
* 删除多媒体
* @param {Number} index 列表下标
* @param {String} key 操作的键
*/
function removeMedia(index, key) {
util.alert({
content: '确认要删除吗?',
}).then(rs => {
if (rs.confirm) form[key].splice(index, 1)
})
}
//
function getList() {
//
api.video.myWorks({
query: {
userId: form.userId,
pageSize: list.pageSize,
pageNum: list.pageNum,
//
function handleSubmit() {
//
const data = {
...form
}
}).then(rs => {
if (rs.code == 200) {
if (list.pageNum == 1) list.data.length = []
list.data.push(...rs.rows.map(item => {
item.format_videoUrl = util.format_url(item.videoUrl, 'video')
item.format_imageUrl = util.format_url(item.imageUrl, 'img')
return item
}))
list.total = rs.total
//
if (reportIndex == '') {
util.alert('请选择举报理由')
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function uploadImg() {
util.upload_image({
type: 1,
success: rs => {
form.videoPictureUrl = rs.value
}
})
}
/**
* 删除多媒体
* @param {Number} index 列表下标
* @param {String} key 操作的键
*/
function removeMedia(key) {
util.alert({
content: '确认要删除吗?',
}).then(rs => {
if (key == 'videoId') {
form.videoId = null
form.coverUrl = null
}
if (key == 'videoPictureUrl') form.videoPictureUrl = null
})
}
//
function handleSubmit() {
//
const data = {
...form
}
//
if (reportIndex == '') {
util.alert('请选择举报理由')
return
}
if (!data.particulars) {
util.alert('详细描述不能为空')
return
}
if (data.particulars.length > 100) {
util.alert('详细描述自述超过100')
return
}
if (!data.videoPictureUrl) {
util.alert('请上传举报图片')
return
}
if (!data.videoId) {
util.alert('请选择举报视频')
return
}
data.reasonForReporting = reportList[reportIndex.value].name
api.video.reportVideo({
data: data,
}).then(rs => {
if (rs.code == 200) {
util.alert('举报成功,请等待后台审核')
setTimeout(() => {
uni.navigateBack()
}, 500)
if (!data.context) {
util.alert('详细描述不能为空')
return
}
if (data.context.length > 100) {
util.alert('详细描述自述超过100')
return
}
if (!data.pic[0]) {
util.alert('请上传举报图片')
return
}
if (!data.videoId[0]) {
util.alert('请选择举报视频')
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function videoInfo(param) {
console.log('选中视频信息', param);
form.videoId = param.videoId;
form.coverUrl = param.coverUrl;
}
//
data.reason = reportList[reportIndex.value].name
data.pic = data.pic.map(node => {
node = util.replace_url('node')
return node
}).join(',')
data.videoId = data.videoId.join(',')
api.video.reportVideo({
data: data,
}).then(rs => {
if (rs.code == 200) {
util.alert('举报成功,请等待后台审核')
setTimeout(() => {
uni.navigateBack()
}, 500)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script>
<template>
@ -209,7 +208,7 @@ function videoInfo(param) {
<view class="key mr20">举报理由</view>
<picker class="f1" :range="reportList" rangeKey="name" @change="handleReportList">
<view class="inputBox ptb10 plr10">
<text v-if="reportList[reportIndex]">{{ reportList[reportIndex].name }}</text>
<text v-if="reportList[reportIndex]">{{reportList[reportIndex].name}}</text>
<text v-else class="placeholderStyle">请选择举报理由</text>
</view>
</picker>
@ -219,10 +218,10 @@ function videoInfo(param) {
<view class="key">详细描述</view>
<view class="inputBox mt20 ptb15 plr15">
<textarea v-model="form.particulars" placeholder="请详细填写,以提高举报成功率。" />
<textarea v-model="form.context" placeholder="请详细填写,以提高举报成功率。" />
</view>
<view class="hint mt10 tar f20">{{ form.particulars.length }}/100</view>
<view class="hint mt10 tar f20">{{form.context.length}}/100</view>
</view>
<view class="line mtb50 uploadBox">
@ -234,15 +233,14 @@ function videoInfo(param) {
</view>
<view class="imgList images mt20">
<view v-if="!form.videoPictureUrl" class="item upload fmid pr mr20 br10" @click="uploadImg">
<view class="item upload fmid pr mr20 br10" @click="uploadImg">
<uni-icons type="plusempty" color="#D8D8D8" size="100rpx" />
</view>
<view v-else class="imgs item mr20 br10">
<image class="br10" :src="form.videoPictureUrl" mode="aspectFill" />
<view class="imgs item mr20 br10" v-for="(item,index) in form.pic" :key="index">
<image class="br10" :src="item" mode="aspectFill" />
<view class="close">
<uni-icons type="clear" size="30rpx" color="red"
@click="removeMedia('videoPictureUrl')" />
<uni-icons type="clear" size="30rpx" color="red" @click="removeMedia(index,'pic')" />
</view>
</view>
</view>
@ -253,15 +251,15 @@ function videoInfo(param) {
<view class="key">选择视频</view>
<view class="list pr mt20">
<view v-if="!form.coverUrl" class="item fmid oh br10" @click="$refs.select.open()">
<view class="item fmid oh br10" @click="$refs.select.open()">
<uni-icons type="plusempty" color="#D8D8D8" size="100rpx" />
</view>
<view v-else class="item pr br10">
<image :src="form.coverUrl" mode="aspectFill" />
<view class="item pr br10" v-for="(item,index) in videos" :key="index">
<image :src="item.format_imageUrl" mode="aspectFill" />
<view class="close">
<uni-icons type="clear" size="30rpx" color="red" @click="removeMedia('videoId')" />
<uni-icons type="clear" size="30rpx" color="red" @click="removeMedia(index,'videoId')" />
</view>
</view>
</view>
@ -281,7 +279,7 @@ function videoInfo(param) {
<view class="header rows ptb20 plr20">
<view class="title plr30 c333 f34">
<text>作品</text>
<text class="ml10">{{ list.total }}</text>
<text class="ml10">{{list.total}}</text>
</view>
<view class="fmid c999 f28" @click="refreshList">
@ -292,7 +290,7 @@ function videoInfo(param) {
<!-- 视频菜单 -->
<scroll-view scroll-y="true" class="scroll">
<videoMenu :list="list.data" @videoInfo="videoInfo" mode="checkbox" />
<videoMenu :list="list.data" v-model:ids="form.videoId" mode="checkbox" />
</scroll-view>
</view>
</view>
@ -302,66 +300,66 @@ function videoInfo(param) {
</template>
<style lang="scss">
image {
width: 100%;
height: 100%;
}
//
.form {
.hint {
color: #a7a7a7;
image {
width: 100%;
height: 100%;
}
}
//
.uploadBox {
//
.form {
//
.uploads {
.cartoon {
top: 0;
right: -100rpx;
width: 530rpx;
height: 249rpx;
.hint {
color: #a7a7a7;
}
}
//
.images .item {
width: 150rpx;
height: 150rpx;
background-color: #F3F3F5;
}
.uploadBox {
//
.list {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 20rpx;
//
.uploads {
.cartoon {
top: 0;
right: -100rpx;
width: 530rpx;
height: 249rpx;
}
}
//
.images .item {
width: 150rpx;
height: 150rpx;
background-color: #F3F3F5;
}
//
.item {
height: 290rpx;
background-color: #F1F1F1;
.list {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 20rpx;
//
.close {
position: absolute;
top: 0;
right: 0;
transform: translate(50%, -50%);
z-index: 1;
//
.item {
height: 290rpx;
background-color: #F1F1F1;
//
.close {
position: absolute;
top: 0;
right: 0;
transform: translate(50%, -50%);
z-index: 1;
}
}
}
}
}
//
.product {
.scroll {
height: 80vh;
//
.product {
.scroll {
height: 80vh;
}
}
}
</style>

View File

@ -1,289 +1,233 @@
<script setup>
/**
* 他人用户视频主页
*/
import {
ref,
reactive,
getCurrentInstance,
computed,
} from 'vue';
import {
onLoad,
onPageScroll,
onReachBottom,
onHide
} from '@dcloudio/uni-app'
import {
useStore
} from 'vuex'
//
import util from '@/common/js/util';
// api
import api from '@/api/index.js'
//
import statusBar from '@/components/header/statusBar.vue'
//
import apex from '@/components/header/apex.vue'
//
import videoMenu from '@/components/index/videoMenu.vue'
/**
* 他人用户视频主页
*/
import {
ref,
reactive,
getCurrentInstance,
computed,
} from 'vue';
import {
onLoad,
onPageScroll,
onReachBottom,
onHide
} from '@dcloudio/uni-app'
import {
useStore
} from 'vuex'
//
import util from '@/common/js/util';
// api
import api from '@/api/index.js'
//
import statusBar from '@/components/header/statusBar.vue'
//
import apex from '@/components/header/apex.vue'
//
import videoMenu from '@/components/index/videoMenu.vue'
//
const {
proxy
} = getCurrentInstance()
//
const store = useStore()
//
const scrollTop = ref(false)
// id
const userId = ref('')
//
const detail = reactive({})
//
const listProperty = reactive({
data: [],
pageSize: 9,
pageNum: 1,
total: 0,
})
//
let userinfo = computed(() => {
let result = store.state.userinfo
return result
})
//
onLoad((option) => {
// id
if (option.userId) userId.value = option.userId
//
getUserinfo()
//
getList()
})
onHide(() => {
//
proxy.$refs.videoMenuRef.pause()
})
//
onPageScroll((ev) => {
scrollTop.value = ev.scrollTop > 44 ? true : false
})
onReachBottom(() => {
//
getMoreList()
})
//
function getUserinfo() {
api.video.getUserInfo({
query: {
userId: userId.value,
myId: userinfo.value.id,
}
}).then(rs => {
if (rs.code == 200) {
console.log('userinfo', rs)
const result = rs.data
Object.assign(detail, result)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function getMoreList() {
if (listProperty.total <= listProperty.data.length) return
listProperty.pageNum++
getList()
}
//
function getList() {
//
const {
proxy
} = getCurrentInstance()
//
api.video.myWorks({
query: {
// id
userId: userId.value,
pageSize: listProperty.pageSize,
pageNum: listProperty.pageNum,
}
}).then(rs => {
if (rs.code == 200) {
if (listProperty.pageNum == 1) listProperty.data.length = 0
listProperty.data.push(...rs.rows)
listProperty.total = rs.total
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
const store = useStore()
//
const scrollTop = ref(false)
// id
const userId = ref('')
//
const detail = reactive({})
//
const listProperty = reactive({
data: [],
pageSize: 9,
pageNum: 1,
total: 0,
})
}
//
function handleReport() {
//
proxy.$refs.menuRef.close()
//
uni.showActionSheet({
itemList: ['举报'],
}).then(rs => {
const index = rs.tapIndex
if (index == 0) {
uni.navigateTo({
url: util.setUrl('/pages/index/report', {
userId: userId.value,
}),
})
}
//
let userinfo = computed(() => {
let result = store.state.userinfo
return result
})
}
//
function handleBlack() {
// let text = detail.isBlock ? '' : ''
// util.alert({
// content: `${text}${detail.userNickname}`,
// }).then(rs => {
// let obj = {
// blockUserId: detail.id,
// status: detail.isBlock ? 1 : 0
// }
// api.mine.blockUser(obj).then(res => {
// if (res.code == 200) {
// util.alert('')
// getUserinfo()
// //
// proxy.$refs.menuRef.close()
// }
// })
// })
}
//
function handleCopyAccount() {
//
uni.setClipboardData({
data: detail.account,
showToast: false,
success: rs => {
util.alert('复制成功')
}
//
onLoad((option) => {
// id
if (option.userId) userId.value = option.userId
//
getUserinfo()
//
getList()
})
}
//
function handleAttention() {
let targetAtt = detail.isAttention == 0 ? 1 : 0
api.video.attention({
data: {
// id
userId: userinfo.value.id,
// id
attentionId: detail.id,
//
isAttention: targetAtt,
}
}).then(rs => {
if (rs.code == 200) {
//
detail.isAttention = targetAtt
//
getUserinfo()
//
uni.$emit('focusUser', {
userId: detail.id,
result: detail.isAttention,
})
//
uni.$emit('updateFocusList')
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
onHide(() => {
//
proxy.$refs.videoMenuRef.pause()
})
}
//
function handleBlock() {
// //
// detail.isBlock = !detail.isBlock
// api.video.videoBlock({
// query: {
// type: detail.isBlock ? 0 : 1,
// userId: detail.id,
// }
// }).then(rs => {
// if (rs.code == 200) {
// return
// }
// detail.isBlock = !detail.isBlock
// util.alert({
// content: rs.msg,
// showCancel: false,
// })
// })
}
//
function handleMessage() {
util.toChat({
name: detail.userNickname,
msgId: detail.id,
type: 'C2C',
//
onPageScroll((ev) => {
scrollTop.value = ev.scrollTop > 44 ? true : false
})
return
}
//
function userComments() {
if (detail.isLock) {
toCommentsList()
} else {
//
util.alert({
content: `确认消耗${detail.consumeFruit}个榴莲果解锁评论吗?`,
onReachBottom(() => {
//
getMoreList()
})
//
function getUserinfo() {
api.video.getUserInfo({
query: {
userId: userId.value,
myId: userinfo.value.id,
}
}).then(rs => {
unlockComments()
if (rs.code == 200) {
console.log('userinfo', rs)
const result = rs.data
Object.assign(detail, result)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
}
//
function unlockComments() {
api.mine.unlockComment({ userId: detail.id }).then(res => {
if (res.code == 200) {
util.alert('解锁成功!')
if (res.data.isLock) {
toCommentsList()
getUserinfo()
//
function getMoreList() {
if (listProperty.total <= listProperty.data.length) return
listProperty.pageNum++
getList()
}
//
function getList() {
//
api.video.myWorks({
query: {
// id
userId: userId.value,
pageSize: listProperty.pageSize,
pageNum: listProperty.pageNum,
}
}
})
}
//
function toCommentsList() {
uni.navigateTo({
url: util.setUrl('/pages/mine/myComment', {
userId: detail.id,
}),
})
}
}).then(rs => {
if (rs.code == 200) {
if (listProperty.pageNum == 1) listProperty.data.length = 0
listProperty.data.push(...rs.rows)
listProperty.total = rs.total
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function handleReport() {
//
proxy.$refs.menuRef.close()
//
uni.showActionSheet({
itemList: ['举报'],
}).then(rs => {
const index = rs.tapIndex
if (index == 0) {
uni.navigateTo({
url: '/pages/index/report',
})
}
})
}
//
function handleCopyAccount() {
//
uni.setClipboardData({
data: detail.account,
showToast: false,
success: rs => {
util.alert('复制成功')
}
})
}
//
function handleAttention() {
let targetAtt = detail.isAttention == 0 ? 1 : 0
api.video.attention({
data: {
// id
userId: userinfo.value.id,
// id
attentionId: detail.id,
//
isAttention: targetAtt,
}
}).then(rs => {
if (rs.code == 200) {
//
detail.isAttention = targetAtt
//
getUserinfo()
//
uni.$emit('focusUser', {
userId: detail.userId,
result: detail.isAttention,
})
//
uni.$emit('updateFocusList')
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function handleBlock() {
//
detail.isBlock = !detail.isBlock
//
api.video.videoBlock({
query: {
type: detail.isBlock ? 0 : 1,
userId: detail.userId,
}
}).then(rs => {
if (rs.code == 200) {
return
}
detail.isBlock = !detail.isBlock
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function handleMessage() {
util.toChat({
name: detail.userNickname,
msgId: detail.userId,
type: 'C2C',
})
return
}
</script>
<template>
@ -295,9 +239,9 @@ function toCommentsList() {
<view class="window pfull"></view>
</view>
<apex :bgColor="scrollTop ? '#fff' : '#fff0'" :color="scrollTop ? '#333' : '#fff'">
<apex :bgColor="scrollTop?'#fff':'#fff0'" :color="scrollTop ? '#333' : '#fff'">
<template #content v-if="scrollTop">
<view class="">{{ detail.userNickname }}</view>
<view class="">{{detail.userNickname}}</view>
</template>
<template #right>
@ -314,8 +258,8 @@ function toCommentsList() {
</view>
<view class="user f1 ml20 cfff">
<view class="f36 b">{{ detail.userNickname }}</view>
<view class="f24">账号{{ detail.account }}</view>
<view class="f36 b">{{detail.userNickname}}</view>
<view class="f24">账号{{detail.account}}</view>
</view>
</view>
</view>
@ -326,25 +270,25 @@ function toCommentsList() {
<view class="number df">
<view class="option mr40" v-if="0">
<text class="value f36">{{ detail.userPraised }}</text>
<text class="value f36">{{detail.userPraised}}</text>
<text class="key ml10 c666 f24">获赞</text>
</view>
<view class="option mr40">
<text class="value f36">{{ detail.userFans }}</text>
<text class="value f36">{{detail.userFans}}</text>
<text class="key ml10 c666 f24">粉丝</text>
</view>
<view class="option mr40">
<text class="value f36">{{ detail.userAttention }}</text>
<text class="value f36">{{detail.userAttention}}</text>
<text class="key ml10 c666 f24">关注</text>
</view>
</view>
<view class="" @click="userComments">他的评论</view>
<view class="">他的评论</view>
</view>
<!-- 个人介绍 -->
<view class="desc mtb20 c333 f28">{{ detail.userBrief }}</view>
<view class="desc mtb20 c333 f28">{{detail.userBrief}}</view>
<!-- 橱窗 -->
<view class="shopwindow df aic mtb30" v-if="detail.isShop == 1 && 0">
@ -368,7 +312,7 @@ function toCommentsList() {
<view class="product mt30">
<view class="title plr30 c333 f32">
<text>作品</text>
<text class="ml10">{{ listProperty.total }}</text>
<text class="ml10">{{listProperty.total}}</text>
</view>
<view class="list mt20">
@ -382,9 +326,9 @@ function toCommentsList() {
<view class="menuAlt ptb50 plr40 ">
<view class="header df">
<view class="user f1 c111">
<view class="nickname f28">{{ detail.userNickname }}</view>
<view class="nickname f28">{{detail.userNickname}}</view>
<view class="df aic mt10">
<text class="f20">账号{{ detail.account }}</text>
<text class="f20">账号{{detail.account}}</text>
<image class="wh30 ml10" src="/static/copy.png" mode="aspectFit" @click="handleCopyAccount" />
<view class="f1"></view>
</view>
@ -401,7 +345,7 @@ function toCommentsList() {
<view class="txt mt20 c111 f20">分享主页</view>
</view> -->
<view class="option ver jcc bfff br10" @click="handleMessage">
<view class="option ver jcc bfff br10">
<image class="wh50" src="/static/email.png" mode="aspectFit" />
<view class="txt mt20 c111 f20">私信Ta</view>
</view>
@ -414,14 +358,14 @@ function toCommentsList() {
<view class="option ver jcc bfff br10" @click="handleBlack">
<image class="wh50" src="/static/blackList.png" mode="aspectFit" />
<view class="txt mt20 c111 f20">
<text>{{ detail.isBlock ? '取消拉黑' : '拉黑' }}</text>
<text>拉黑</text>
</view>
</view>
</view>
<!-- 列表 -->
<view class="list mtb20 plr20 c111 f24 bfff br10" v-if="0">
<view class="item rows ptb25">
<view class="list mtb20 plr20 c111 f24 bfff br10">
<view class="item rows ptb25" v-if="0">
<view class="key">设置备注</view>
<view class="inputBox tac">
<input class="c111 f24" type="text" placeholder="请输入备注" />
@ -441,47 +385,47 @@ function toCommentsList() {
</template>
<style lang="scss">
//
.apex {
//
.apex {
//
.userinfo {
.avatar {
padding: 5rpx;
background-color: #fff;
}
}
}
//
.container {
margin-top: -30rpx;
border-radius: 15rpx 15rpx 0 0;
background-color: #fff;
}
//
.menuAlt {
border-radius: 24rpx 24rpx 0 0;
background: #F2F2F2;
//
.select {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 20rpx;
//
.option {
height: 160rpx;
//
.userinfo {
.avatar {
padding: 5rpx;
background-color: #fff;
}
}
}
//
.list {
.inputBox {
width: 220rpx;
//
.container {
margin-top: -30rpx;
border-radius: 15rpx 15rpx 0 0;
background-color: #fff;
}
//
.menuAlt {
border-radius: 24rpx 24rpx 0 0;
background: #F2F2F2;
//
.select {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 20rpx;
//
.option {
height: 160rpx;
}
}
//
.list {
.inputBox {
width: 220rpx;
}
}
}
}
</style>

View File

@ -1,144 +1,97 @@
<script setup>
//
import {
ref,
reactive,
computed,
getCurrentInstance,
} from 'vue';
import {
onLoad,
onReady,
onUnload,
onPageScroll,
onReachBottom,
onPullDownRefresh
} from '@dcloudio/uni-app'
import {
useStore,
} from 'vuex'
import api from '@/api/index.js'
//
import util from '@/common/js/util';
//
import {
ref,
reactive,
computed,
getCurrentInstance,
} from 'vue';
import {
onLoad,
onReady,
onUnload,
onPageScroll,
onReachBottom,
} from '@dcloudio/uni-app'
import {
useStore,
} from 'vuex'
import api from '@/api/index.js'
//
import util from '@/common/js/util';
//
const store = useStore()
//
const list = reactive({
data: [],
pageSize: 20,
pageNum: 1,
total: 0,
})
//
const userinfo = computed(() => {
return store.state.userinfo
})
//
const store = useStore()
//
const list = reactive({
data: [],
pageSize: 20,
pageNum: 1,
total: 0,
})
//
const userinfo = computed(() => {
let result = store.state.userinfo
return result
})
onLoad((option) => {
if (option.userId) {
uni.setNavigationBarTitle({
title: '他的评论'
})
getList(option.userId)
} else {
getList()
onLoad(() => {
getLst()
})
//
function refreshVideoList() {
list.pageNum = 1
list.total = 0
getLst()
}
})
onReachBottom(() => {
//
getMoreVideoList()
})
//
function getMoreVideoList() {
if (list.data.length >= list.total) return
list.pageNum++
getLst()
}
onPullDownRefresh(() => {
//
refreshVideoList()
})
//
function refreshVideoList() {
list.pageNum = 1
list.total = 0
getLst()
}
//
function getMoreVideoList() {
if (list.data.length >= list.total) return
list.pageNum++
getLst()
}
//
function getLst() {
api.mine.myComment({
query: {
userId: userinfo.value.id,
pageNum: list.pageNum,
pageSize: list.pageSize,
}
}).then(rs => {
if (rs.code == 200) {
if (list.pageNum) list.data.length = 0
//
list.data.push(...rs.rows.map(item => {
return item
}))
//
list.total = rs.total
console.log('list', list.data)
return
}
util.alert({
content: rs.msg,
showCancel: false,
//
function getLst() {
api.mine.myComment({
query: {
userId: userinfo.value.id,
pageNum: list.pageNum,
pageSize: list.pageSize,
}
}).then(rs => {
if (rs.code == 200) {
if (list.pageNum) list.data.length = 0
//
list.data.push(...rs.rows.map(item => {
return item
}))
//
list.total = rs.total
console.log('list', list.data)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
}).finally(() => {
uni.stopPullDownRefresh()
})
}).finally(() => {
uni.stopPullDownRefresh()
})
}
//
function getList(id) {
api.mine.myComment({
query: {
userId: id ? id : userinfo.value.id,
pageNum: list.pageNum,
pageSize: list.pageSize,
}
}).then(rs => {
if (rs.code == 200) {
if (list.pageNum) list.data.length = 0
//
list.data.push(...rs.data[0].CommentVo.map(item => {
return item
}))
//
list.total = rs.total
console.log('list', list.data)
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
}).finally(() => {
uni.stopPullDownRefresh()
})
}
}
</script>
<template>
<view class="appbw">
<view class="listBox plr30 ">
<view class="list ptb30 plr10" v-for="(item, index) in list.data" :key="index">
<view class="list ptb30 plr10" v-for="(item,index) in list.data" :key="index">
<view class="rows">
<view class="message">
<view class="title f32 c333">评论了{{ item.commentType }}</view>
<view class="content t2hd mtb15 c333 f32">{{ item.content }}</view>
<view class="time mt15 f28 c999">{{ item.createTime }}</view>
<view class="title f32 c333">评论了 视频</view>
<view class="content t2hd mtb15 c333 f32">{{item.content}}</view>
<view class="time mt15 f28 c999">{{item.createTime}}</view>
</view>
<view class="image ml20" v-if="item.imageUrl">
<image class="wh120 br10" :src="item.imageUrl" mode="aspectFill" />
@ -153,12 +106,12 @@ function getList(id) {
</template>
<style scoped lang="scss">
//
.listBox {
//
.listBox {
//
.list+.list {
border-top: 2rpx solid #eee;
//
.list+.list {
border-top: 2rpx solid #eee;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -16,274 +16,265 @@
</template>
<script setup>
import {
ref,
defineEmits
} from 'vue'
//
import TencentCloudChat from '@tencentcloud/chat';
const props = defineProps({
msg: {
type: Object
},
})
const emit = defineEmits(['send'])
//
// #ifdef APP-PLUS
const recorderManager = uni.getRecorderManager();
// #endif
//
const voiceLength = ref(0);
//
const voiceTimer = ref(null);
//
const voiceText = ref('按住 说话');
//
const voiceTis = ref('手指上滑 取消发送');
//
const voiceFlg = ref(false);
// Y
const voicePageY = ref(0);
//
const voiceStop = ref(false);
const str = '';
//
const sv = {
//
touchstartVoice: (e) => {
voicePageY.value = (e.changedTouches[0].pageY).toFixed(2);
recorderManager.start({
duration: 60000, // ms 60000010
sampleRate: 44100, //
numberOfChannels: 1, //
encodeBitRate: 192000, //
format: "mp3"
});
voiceLength.value = 0;
voiceFlg.value = true
console.log('recorder start success');
//,
voiceTimer.value = setInterval(() => {
voiceLength.value += 0.1;
}, 100);
import {
ref,
defineEmits
} from 'vue'
//
import TencentCloudChat from '@tencentcloud/chat';
const props = defineProps({
msg: {
type: Object
},
})
const emit = defineEmits(['send'])
//
// #ifdef APP-PLUS
const recorderManager = uni.getRecorderManager();
// #endif
//
const voiceLength = ref(0);
//
const voiceTimer = ref(null);
//
const voiceText = ref('按住 说话');
//
const voiceTis = ref('手指上滑 取消发送');
//
const voiceFlg = ref(false);
// Y
const voicePageY = ref(0);
//
const voiceStop = ref(false);
const str = '';
//
const sv = {
//
touchstartVoice: (e) => {
voicePageY.value = (e.changedTouches[0].pageY).toFixed(2);
recorderManager.start({
duration: 60000, // ms 60000010
sampleRate: 44100, //
numberOfChannels: 1, //
encodeBitRate: 192000, //
format: "mp3"
});
voiceLength.value = 0;
voiceFlg.value = true
console.log('recorder start success');
//,
voiceTimer.value = setInterval(() => {
voiceLength.value += 0.1;
}, 100);
console.log('touchstartVoice', voicePageY.value);
},
//
touchmoveVoice: (e) => {
// UI
if (!voiceFlg.value) {
return;
}
let numTemp = voicePageY.value - ((e.changedTouches[0].pageY).toFixed(2));
if (numTemp >= 60) {
console.log('取消发送');
voiceStop.value = true
voiceTis.value = '松开手指 取消发送'
} else {
console.log('继续发送');
voiceStop.value = false
voiceTis.value = '手指上滑 取消发送'
}
},
//
touchendVoice: () => {
// UI
if (!voiceFlg.value) {
return;
}
clearInterval(voiceTimer.value);
voiceText.value = '按住 说话'
voiceTis.value = "手指上滑 取消发送"
console.log('touchendVoice');
sv.stop();
},
//
touchcancelVoice: () => {
clearInterval(voiceTimer.value);
// UI
voiceText.value = '按住 说话'
voiceTis.value = "手指上滑 取消发送"
//
voiceStop.value = true
console.log('touchcancelVoice');
sv.stop();
},
stop: () => {
voiceTimer.value = null;
voiceFlg.value = false
recorderManager.stop(); //
console.log('录音结束');
}
};
// #ifdef APP-PLUS
//
recorderManager.onStop((res) => {
//
if (voiceStop.value) {
return
}
//
if (voiceStop.value) {
uni.showToast({
icon: "none",
title: "取消发送",
duration: 2000
})
return
}
if (voiceLength.value < 1) {
uni.showToast({
icon: "none",
title: "语音时长过短",
duration: 2000
})
return
}
if (voiceLength.value > 60) {
uni.showToast({
icon: "none",
title: "语音时长过长",
duration: 2000
})
return
}
console.log('file', res)
try {
let message = uni.$chat.createAudioMessage({
to: props.msg.id,
conversationType: props.msg.type,
payload: {
file: res
},
//
onProgress: function (event) {
console.log('file uploading:', event)
console.log('touchstartVoice', voicePageY.value);
},
//
touchmoveVoice: (e) => {
// UI
if (!voiceFlg.value) {
return;
}
})
let obj = {
query: {
toUserId: message.to,
formId: message.from,
msgType: message.type,
},
data: message
let numTemp = voicePageY.value - ((e.changedTouches[0].pageY).toFixed(2));
if (numTemp >= 60) {
console.log('取消发送');
voiceStop.value = true
voiceTis.value = '松开手指 取消发送'
} else {
console.log('继续发送');
voiceStop.value = false
voiceTis.value = '手指上滑 取消发送'
}
},
//
touchendVoice: () => {
// UI
if (!voiceFlg.value) {
return;
}
clearInterval(voiceTimer.value);
voiceText.value = '按住 说话'
voiceTis.value = "手指上滑 取消发送"
console.log('touchendVoice');
sv.stop();
},
//
touchcancelVoice: () => {
clearInterval(voiceTimer.value);
// UI
voiceText.value = '按住 说话'
voiceTis.value = "手指上滑 取消发送"
//
voiceStop.value = true
console.log('touchcancelVoice');
sv.stop();
},
stop: () => {
voiceTimer.value = null;
voiceFlg.value = false
recorderManager.stop(); //
console.log('录音结束');
}
emit('send', obj)
} catch (e) {
console.log('message catch', e)
}
//
};
// #ifdef APP-PLUS
//
recorderManager.onStop((res) => {
//
if (voiceStop.value) {
return
}
//
if (voiceStop.value) {
uni.showToast({
icon: "none",
title: "取消发送",
duration: 2000
})
return
}
if (voiceLength.value < 1) {
uni.showToast({
icon: "none",
title: "语音时长过短",
duration: 2000
})
return
}
if (voiceLength.value > 60) {
uni.showToast({
icon: "none",
title: "语音时长过长",
duration: 2000
})
return
}
console.log('file', res)
})
// #endif
try {
let message = uni.$chat.createAudioMessage({
to: props.msg.id,
conversationType: props.msg.type,
payload: {
file: res
},
//
onProgress: function(event) {
console.log('file uploading:', event)
}
})
emit('send', message)
} catch (e) {
console.log('message catch', e)
}
//
})
// #endif
</script>
<style scoped lang="scss">
.voice_box {
padding: 20rpx 0;
margin: 0 20rpx;
border-radius: 50rpx;
background: #fff;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.hidden {
display: none !important;
}
.record {
width: 40vw;
height: 40vw;
position: fixed;
top: 55%;
left: 30%;
background-color: rgba(0, 0, 0, .6);
border-radius: 20rpx;
.ing {
width: 100%;
height: 30vw;
.voice_box {
padding: 20rpx 0;
margin: 0 20rpx;
border-radius: 50rpx;
background: #fff;
flex: 1;
display: flex;
justify-content: center;
align-items: center;
//
@keyframes volatility {
0% {
background-position: 0% 130%;
}
20% {
background-position: 0% 150%;
}
30% {
background-position: 0% 155%;
}
40% {
background-position: 0% 150%;
}
50% {
background-position: 0% 145%;
}
70% {
background-position: 0% 150%;
}
80% {
background-position: 0% 155%;
}
90% {
background-position: 0% 140%;
}
100% {
background-position: 0% 135%;
}
}
background-image: linear-gradient(to bottom, #f09b37, #fff 50%);
background-size: 100% 200%;
animation: volatility 1.5s ease-in-out -1.5s infinite alternate;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-size: 150rpx;
color: #f09b37;
justify-content: center;
}
.cancel {
width: 100%;
height: 30vw;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 150rpx;
.hidden {
display: none !important;
}
.tis {
width: 100%;
height: 10vw;
display: flex;
justify-content: center;
font-size: 28rpx;
color: #fff;
.record {
width: 40vw;
height: 40vw;
position: fixed;
top: 55%;
left: 30%;
background-color: rgba(0, 0, 0, .6);
border-radius: 20rpx;
&.change {
.ing {
width: 100%;
height: 30vw;
display: flex;
justify-content: center;
align-items: center;
//
@keyframes volatility {
0% {
background-position: 0% 130%;
}
20% {
background-position: 0% 150%;
}
30% {
background-position: 0% 155%;
}
40% {
background-position: 0% 150%;
}
50% {
background-position: 0% 145%;
}
70% {
background-position: 0% 150%;
}
80% {
background-position: 0% 155%;
}
90% {
background-position: 0% 140%;
}
100% {
background-position: 0% 135%;
}
}
background-image: linear-gradient(to bottom, #f09b37, #fff 50%);
background-size: 100% 200%;
animation: volatility 1.5s ease-in-out -1.5s infinite alternate;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-size: 150rpx;
color: #f09b37;
}
.cancel {
width: 100%;
height: 30vw;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 150rpx;
}
.tis {
width: 100%;
height: 10vw;
display: flex;
justify-content: center;
font-size: 28rpx;
color: #fff;
&.change {
color: #f09b37;
}
}
}
}
</style>

View File

@ -2,8 +2,6 @@
//
import uQRCode from '@/common/js/uqrcode.js'
//
import noAuth from '@/components/mine/noAuth.vue'
import {
ref,
reactive,
@ -62,11 +60,7 @@ function init() {
</script>
<template>
<view class="page" v-if="!userinfo.isRealName">
<noAuth class="f1" />
</view>
<view class="app" v-else>
<view class="app">
<!-- -->
<view class="container ver mtb30 mlr30 tac">
<!-- 二维码插件 width height设置宽高 -->

View File

@ -20,8 +20,6 @@ import TencentCloudChat from '@tencentcloud/chat';
import apex from '@/components/header/apex'
//
import noLogin from '@/components/login/noLogin.vue'
//
import noAuth from '@/components/mine/noAuth.vue'
//
import book from '@/components/news/book'
//
@ -109,7 +107,7 @@ function imLoading() {
//
function removeListener() {
// #ifdef APP
uni.$chat.off(TencentCloudChat.EVENT.SDK_READY, () => { });
uni.$chat.off(TencentCloudChat.EVENT.SDK_READY,()=>{});
// #endif
}
@ -180,10 +178,6 @@ function getUserInfos(userRecommend) {
<noLogin class="f1" />
</view>
<view class="page" v-else-if="!userinfo.isRealName">
<noAuth class="f1" />
</view>
<view class="page" v-else>
<apex>
<template #left>