2024-12-18 15:46:27 +08:00
|
|
|
<script setup>
|
|
|
|
/**
|
|
|
|
* 发布视频
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {
|
|
|
|
reactive,
|
|
|
|
getCurrentInstance,
|
2025-01-16 20:18:22 +08:00
|
|
|
ref,
|
|
|
|
computed,
|
2024-12-18 15:46:27 +08:00
|
|
|
} from 'vue';
|
|
|
|
import {
|
|
|
|
onLoad,
|
|
|
|
} from '@dcloudio/uni-app'
|
2025-01-16 20:18:22 +08:00
|
|
|
import {
|
|
|
|
useStore
|
|
|
|
} from 'vuex'
|
2024-12-18 15:46:27 +08:00
|
|
|
// 工具库
|
|
|
|
import util from '@/common/js/util';
|
|
|
|
// api
|
|
|
|
import api from '@/api/index.js'
|
|
|
|
|
|
|
|
const {
|
|
|
|
proxy
|
|
|
|
} = getCurrentInstance()
|
2025-01-16 20:18:22 +08:00
|
|
|
const store = useStore()
|
2024-12-18 15:46:27 +08:00
|
|
|
|
|
|
|
class Form {
|
|
|
|
videoId = ''
|
|
|
|
// 视频地址
|
|
|
|
videoUrl = ''
|
|
|
|
// 缩略图
|
2025-01-02 01:01:23 +08:00
|
|
|
coverUrl = ''
|
2024-12-18 15:46:27 +08:00
|
|
|
// 标题
|
|
|
|
title = ''
|
|
|
|
// 正文
|
2025-01-02 01:01:23 +08:00
|
|
|
description = ''
|
2024-12-18 15:46:27 +08:00
|
|
|
// 话题
|
2025-01-02 01:01:23 +08:00
|
|
|
tags = ''
|
|
|
|
// 视频大小
|
|
|
|
videoSize = ''
|
|
|
|
// 视频时长
|
|
|
|
videoDuration = ''
|
|
|
|
// 视频状态 0草稿 1待审核 2审核失败 3已发布 4已下架
|
|
|
|
status = ''
|
2024-12-18 15:46:27 +08:00
|
|
|
}
|
|
|
|
// 发布视频
|
|
|
|
const form = reactive(new Form())
|
|
|
|
// 话题列表
|
2025-01-02 01:01:23 +08:00
|
|
|
let label = reactive({
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
list: [],
|
|
|
|
})
|
2024-12-18 15:46:27 +08:00
|
|
|
// 话题关键字
|
|
|
|
const labelKeyword = ref('')
|
|
|
|
// 已选择的话题列表
|
|
|
|
const labelSelect = reactive([])
|
|
|
|
// 用户列表
|
|
|
|
const userList = reactive({
|
|
|
|
data: [],
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 20,
|
|
|
|
total: 0,
|
|
|
|
})
|
|
|
|
// 已选择的用户列表
|
|
|
|
const userSelect = reactive([])
|
|
|
|
// 用户关键字
|
|
|
|
const userKeyword = ref('')
|
2025-01-16 20:18:22 +08:00
|
|
|
// 产品列表
|
|
|
|
const product = reactive({
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
list: [],
|
|
|
|
})
|
|
|
|
// 用户信息
|
|
|
|
const userinfo = computed(() => store.state.userinfo)
|
2024-12-18 15:46:27 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
onLoad((option) => {
|
|
|
|
// 视频id
|
|
|
|
if (option.videoId) {
|
|
|
|
form.videoId = option.videoId
|
|
|
|
// 获取标签 获取详情
|
|
|
|
Promise.all([getVideoDetail(), getLabel()]).then(rs => {
|
2025-02-06 23:34:13 +08:00
|
|
|
// 详情
|
2024-12-18 15:46:27 +08:00
|
|
|
const detail = rs[0]
|
2025-02-06 23:34:13 +08:00
|
|
|
// 标签
|
2024-12-18 15:46:27 +08:00
|
|
|
const labels = rs[1]
|
2025-02-06 23:34:13 +08:00
|
|
|
// at用户
|
2024-12-18 15:46:27 +08:00
|
|
|
const users = rs[2]
|
|
|
|
console.log('release getDetail', detail)
|
2025-02-06 23:34:13 +08:00
|
|
|
|
|
|
|
// 视频id
|
|
|
|
form.id = detail.id
|
|
|
|
// 视频大小
|
|
|
|
form.videoSize = detail.videoSize
|
|
|
|
// 宽
|
|
|
|
form.breadth = detail.breadth
|
|
|
|
// 高
|
|
|
|
form.height = detail.height
|
|
|
|
// 时长
|
|
|
|
form.videoDuration = detail.videoDuration
|
2024-12-18 15:46:27 +08:00
|
|
|
// 缩略图
|
2025-02-06 23:34:13 +08:00
|
|
|
form.coverUrl = detail.coverUrl
|
|
|
|
// 视频地址
|
|
|
|
form.videoUrl = detail.videoUrl
|
2024-12-18 15:46:27 +08:00
|
|
|
// 标题
|
|
|
|
form.title = detail.title
|
|
|
|
// 正文
|
2025-02-06 23:34:13 +08:00
|
|
|
form.description = detail.description
|
|
|
|
// //视频状态 0草稿 1待审核 2审核失败 3已发布 4已下架
|
|
|
|
form.status = detail.status
|
2025-02-27 14:53:04 +08:00
|
|
|
// 第几秒展示
|
|
|
|
if (detail.popupTime) form.popupTime = detail.popupTime
|
|
|
|
// 关联视频的商品id
|
|
|
|
if (detail.productId) {
|
|
|
|
form.productId = detail.productId
|
|
|
|
// 商品名称
|
|
|
|
form.productName = detail.productName
|
|
|
|
// 商品价格
|
|
|
|
form.productPrice = detail.productPrice
|
|
|
|
// 商品图片
|
|
|
|
form.productImage = detail.productImage
|
|
|
|
// 商品佣金
|
|
|
|
form.commission = detail.commission
|
|
|
|
}
|
2025-02-06 23:34:13 +08:00
|
|
|
// 回显话题列表
|
|
|
|
if (detail.tagsList) labelSelect.push(...detail.tagsList)
|
2024-12-18 15:46:27 +08:00
|
|
|
// 匹配用户id
|
2025-02-06 23:34:13 +08:00
|
|
|
// detail.subscriber = detail.subscriber.split(',')
|
|
|
|
// detail.subscriberId.split(',').forEach((item, index) => {
|
|
|
|
// userSelect.push({
|
|
|
|
// userId: item,
|
|
|
|
// userNickname: detail.subscriber[index]
|
|
|
|
// })
|
|
|
|
// })
|
2024-12-18 15:46:27 +08:00
|
|
|
})
|
|
|
|
} else {
|
|
|
|
// 获取标签
|
|
|
|
getLabel()
|
|
|
|
}
|
2025-01-16 20:18:22 +08:00
|
|
|
|
|
|
|
// 获取我发布的产品
|
|
|
|
getProductList()
|
2024-12-18 15:46:27 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
// 获取视频详情
|
|
|
|
function getVideoDetail() {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
api.video.getVideoById({
|
2025-02-06 23:34:13 +08:00
|
|
|
data: {
|
|
|
|
id: form.videoId,
|
2024-12-18 15:46:27 +08:00
|
|
|
}
|
|
|
|
}).then(rs => {
|
|
|
|
if (rs.code == 200) {
|
|
|
|
resolve(rs.data)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
util.alert({
|
|
|
|
content: rs.msg,
|
|
|
|
showCancel: false,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 上传图片
|
|
|
|
function uploadImg() {
|
|
|
|
util.upload_image({
|
2025-01-02 01:01:23 +08:00
|
|
|
value: form.coverUrl,
|
2024-12-18 15:46:27 +08:00
|
|
|
type: 1,
|
|
|
|
success: rs => {
|
2025-01-02 01:01:23 +08:00
|
|
|
form.coverUrl = rs.value
|
2024-12-18 15:46:27 +08:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 上传视频
|
|
|
|
function uploadVideo() {
|
|
|
|
util.upload_video({
|
|
|
|
success: rs => {
|
2025-01-02 01:01:23 +08:00
|
|
|
// 视频大小
|
|
|
|
form.videoSize = rs.size
|
|
|
|
// 宽
|
|
|
|
form.breadth = rs.width
|
|
|
|
// 高
|
|
|
|
form.height = rs.height
|
|
|
|
// 时长
|
|
|
|
form.videoDuration = rs.duration
|
|
|
|
// 路径
|
2024-12-18 15:46:27 +08:00
|
|
|
form.videoUrl = rs.value
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2025-01-02 01:01:23 +08:00
|
|
|
// 刷新列表
|
|
|
|
function refreshLabel() {
|
|
|
|
label.pageNum = 1
|
|
|
|
label.total = 0
|
|
|
|
getLabel()
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取更多标签分类
|
|
|
|
function getMoreLabel() {
|
|
|
|
if (label.total <= label.list.length) return
|
|
|
|
label.pageNum++
|
|
|
|
getLabel()
|
|
|
|
}
|
|
|
|
|
2024-12-18 15:46:27 +08:00
|
|
|
// 获取标签分类
|
|
|
|
function getLabel() {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
api.video.getLabel({
|
2025-01-05 19:13:08 +08:00
|
|
|
data: {
|
2025-01-02 01:01:23 +08:00
|
|
|
pageNum: label.pageNum,
|
|
|
|
pageSize: label.pageSize,
|
2025-01-16 20:18:22 +08:00
|
|
|
tagName: labelKeyword.value,
|
2024-12-18 15:46:27 +08:00
|
|
|
}
|
|
|
|
}).then(rs => {
|
|
|
|
if (rs.code == 200) {
|
2025-01-02 01:01:23 +08:00
|
|
|
const result = rs.rows
|
|
|
|
//
|
|
|
|
if (label.pageNum == 1) label.list.length = 0
|
2024-12-18 15:46:27 +08:00
|
|
|
|
|
|
|
// 标签列表输出
|
2025-01-02 01:01:23 +08:00
|
|
|
label.list.push(...result)
|
|
|
|
// 总数
|
|
|
|
label.total = rs.total
|
2024-12-18 15:46:27 +08:00
|
|
|
//
|
2025-01-02 01:01:23 +08:00
|
|
|
resolve(label.list)
|
2024-12-18 15:46:27 +08:00
|
|
|
|
2025-01-02 01:01:23 +08:00
|
|
|
// 结果
|
2024-12-18 15:46:27 +08:00
|
|
|
if (!result[0] && labelKeyword.value) {
|
|
|
|
util.alert({
|
|
|
|
content: `当前没有${labelKeyword.value}的话题,是否添加?`,
|
|
|
|
}).then(rs => {
|
|
|
|
if (rs.confirm) addLabel()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
util.alert({
|
|
|
|
content: rs.msg,
|
|
|
|
showCancel: false,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 添加标签
|
|
|
|
function addLabel() {
|
|
|
|
api.video.setLabel({
|
2025-02-09 21:32:55 +08:00
|
|
|
query: {
|
2025-01-16 20:18:22 +08:00
|
|
|
tagName: labelKeyword.value,
|
2025-02-09 21:32:55 +08:00
|
|
|
status: '1',
|
2024-12-18 15:46:27 +08:00
|
|
|
}
|
|
|
|
}).then(rs => {
|
|
|
|
if (rs.code == 200) {
|
2025-01-02 01:01:23 +08:00
|
|
|
label.list.length = 0
|
|
|
|
// 标签列表输出
|
|
|
|
label.list.push(rs.data)
|
|
|
|
label.total = 1
|
2024-12-18 15:46:27 +08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
util.alert({
|
|
|
|
content: rs.msg,
|
|
|
|
showCancel: false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 选择话题列表
|
|
|
|
* @param {Object} ev
|
|
|
|
* @param {Number} index 需要操作的下标
|
|
|
|
*/
|
|
|
|
function handleSelectLabel(ev, index) {
|
|
|
|
// 是否包含
|
2025-01-16 20:18:22 +08:00
|
|
|
const findIndex = labelSelect.findIndex(item => item.tagId == ev.tagId)
|
2025-01-05 19:13:08 +08:00
|
|
|
//
|
|
|
|
if (findIndex < 0) {
|
|
|
|
if (labelSelect.length >= 5) util.alert('最多上传5个')
|
|
|
|
else labelSelect.push(ev)
|
|
|
|
}
|
2024-12-18 15:46:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 点击标签删除
|
|
|
|
* @param {Object} item
|
|
|
|
*/
|
|
|
|
function handleLabelSelectDel(item, index) {
|
|
|
|
labelSelect.splice(index, 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取更多朋友列表
|
|
|
|
function getMoreUserList() {
|
|
|
|
if (userList.data.length >= userList.total) return
|
|
|
|
userList.pageNum++
|
|
|
|
getUserList()
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取朋友列表
|
|
|
|
function getUserList() {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
api.video.searchFriendByName({
|
|
|
|
path: [userKeyword.value],
|
|
|
|
query: {
|
|
|
|
pageNum: userList.pageNum,
|
|
|
|
pageSize: userList.pageSize,
|
|
|
|
}
|
|
|
|
}).then(rs => {
|
|
|
|
if (rs.code == 200) {
|
|
|
|
if (userList.pageNum) userList.data.length = 0
|
|
|
|
// 追加朋友列表
|
|
|
|
userList.data.push(...rs.rows)
|
|
|
|
// 视频列表
|
|
|
|
userList.total = rs.total
|
|
|
|
resolve(userList.data)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
util.alert({
|
|
|
|
content: rs.msg,
|
|
|
|
showCancel: false,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 选择用户列表
|
|
|
|
* @param {Object} ev
|
|
|
|
* @param {Number} index 需要操作的下标
|
|
|
|
*/
|
|
|
|
function handleSelectUser(ev, index) {
|
|
|
|
// 是否包含
|
|
|
|
const findIndex = userSelect.findIndex(item => item.id == ev.id)
|
|
|
|
|
|
|
|
if (findIndex < 0) userSelect.push(ev)
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 点击用户删除
|
|
|
|
* @param {Object} item
|
|
|
|
*/
|
|
|
|
function handleUserSelectDel(item, index) {
|
|
|
|
userSelect.splice(index, 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
// 发布视频
|
2025-01-02 01:01:23 +08:00
|
|
|
function handleSubmit(status) {
|
2024-12-18 15:46:27 +08:00
|
|
|
const data = {
|
|
|
|
...form
|
|
|
|
}
|
|
|
|
|
2025-01-02 01:01:23 +08:00
|
|
|
//视频状态 0草稿 1待审核 2审核失败 3已发布 4已下架
|
|
|
|
data.status = status ? status : 0
|
|
|
|
console.log('data', data)
|
2024-12-18 15:46:27 +08:00
|
|
|
|
|
|
|
// 验证必填项
|
|
|
|
if (!data.videoUrl) {
|
|
|
|
util.alert('视频不能为空')
|
|
|
|
return
|
|
|
|
}
|
2025-01-02 01:01:23 +08:00
|
|
|
if (!data.coverUrl) {
|
2024-12-18 15:46:27 +08:00
|
|
|
util.alert('封面不能为空')
|
|
|
|
return
|
|
|
|
}
|
2025-02-06 23:34:13 +08:00
|
|
|
if (!data.title) {
|
|
|
|
util.alert('标题不能为空')
|
|
|
|
return
|
|
|
|
}
|
2024-12-18 15:46:27 +08:00
|
|
|
|
2025-01-07 21:09:52 +08:00
|
|
|
// 如果不是草稿箱
|
2025-01-02 01:01:23 +08:00
|
|
|
if (data.status == 1) {
|
|
|
|
if (!data.description) {
|
2024-12-18 15:46:27 +08:00
|
|
|
util.alert('正文不能为空')
|
|
|
|
return
|
|
|
|
}
|
2025-01-08 21:01:16 +08:00
|
|
|
if (!labelSelect[0]) {
|
|
|
|
util.alert('标签不能为空')
|
|
|
|
return
|
|
|
|
}
|
2024-12-18 15:46:27 +08:00
|
|
|
}
|
|
|
|
// 如果有选择的标签
|
|
|
|
if (labelSelect[0]) {
|
2025-01-16 20:18:22 +08:00
|
|
|
data.tags = labelSelect.map(item => item.tagId).join(',')
|
2024-12-18 15:46:27 +08:00
|
|
|
}
|
2025-01-02 01:01:23 +08:00
|
|
|
// if (userSelect[0]) {
|
|
|
|
// data.subscriberId = userSelect.map(item => item.userId).join(',')
|
|
|
|
// data.subscriber = userSelect.map(item => item.userNickname).join(',')
|
|
|
|
// }
|
2024-12-18 15:46:27 +08:00
|
|
|
|
|
|
|
// 发布
|
2025-01-05 19:13:08 +08:00
|
|
|
api.video.saveVideo({
|
2024-12-18 15:46:27 +08:00
|
|
|
data,
|
|
|
|
}).then(rs => {
|
|
|
|
if (rs.code == 200) {
|
|
|
|
util.alert({
|
2025-01-05 23:04:47 +08:00
|
|
|
content: data.status == 1 ? '视频发布成功,请等待后台审核' : '保存草稿成功',
|
2024-12-18 15:46:27 +08:00
|
|
|
showCancel: false,
|
|
|
|
confirmText: '我知道了',
|
|
|
|
}).then(rs => {
|
|
|
|
uni.navigateBack()
|
|
|
|
})
|
|
|
|
return
|
|
|
|
}
|
|
|
|
util.alert({
|
|
|
|
content: rs.msg,
|
|
|
|
showCancel: false,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
2025-01-16 20:18:22 +08:00
|
|
|
|
|
|
|
// 获取更多商品
|
|
|
|
function getMoreProductList() {
|
|
|
|
if (product.list.length >= product.total) return
|
|
|
|
product.pageNum++
|
|
|
|
getProductList()
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取已发布的商品列表
|
|
|
|
function getProductList() {
|
|
|
|
api.shop.getProductionListByUserId({
|
|
|
|
data: {
|
|
|
|
pageNum: product.pageNum,
|
|
|
|
pageSize: product.pageSize,
|
|
|
|
}
|
|
|
|
}).then(rs => {
|
|
|
|
if (rs.code == 200) {
|
|
|
|
if (product.pageNum == 1) product.list.length = 0
|
|
|
|
product.list.push(...rs.rows)
|
|
|
|
product.total = rs.total
|
|
|
|
return
|
|
|
|
}
|
|
|
|
util.alert({
|
|
|
|
content: rs.msg,
|
|
|
|
showCancel: false,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 选择商品
|
|
|
|
* @param {Object} item
|
|
|
|
*/
|
|
|
|
function handleProduct(item) {
|
|
|
|
if (form.productId == item.id) return
|
|
|
|
form.productId = item.id
|
|
|
|
form.productName = item.name
|
|
|
|
form.productPrice = item.price
|
|
|
|
form.productImage = item.sliderImage.split(',')[0]
|
|
|
|
form.commission = item.commission
|
|
|
|
proxy.$refs.productRef.close()
|
|
|
|
}
|
2025-03-08 09:40:51 +08:00
|
|
|
|
|
|
|
// 移除商品
|
|
|
|
function handleRemoveProduct() {
|
|
|
|
if (!form.productId) return
|
|
|
|
util.alert({
|
|
|
|
content: '是否清空所选商品信息',
|
|
|
|
}).then(rs => {
|
|
|
|
if (!rs.confirm) return
|
|
|
|
form.productId = ''
|
|
|
|
form.productName = ''
|
|
|
|
form.productPrice = ''
|
|
|
|
form.productImage = ''
|
|
|
|
form.commission = ''
|
|
|
|
form.popupTime = ''
|
|
|
|
})
|
|
|
|
}
|
2024-12-18 15:46:27 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<view class="appbw">
|
|
|
|
<view class="form mtb30 mlr30 c666 f32">
|
|
|
|
<view class="line mtb20">
|
|
|
|
<view class="key">上传封面</view>
|
|
|
|
<view class="value mt20 imgList">
|
2025-01-02 01:01:23 +08:00
|
|
|
<view class="imgs wh200 br10" v-if="form.coverUrl">
|
|
|
|
<image :src="form.coverUrl" class="br10" mode="aspectFill" />
|
2024-12-18 15:46:27 +08:00
|
|
|
</view>
|
2025-01-07 21:09:52 +08:00
|
|
|
<view class="imgs wh200 upload fmid bfff br10" @click="uploadImg">
|
2024-12-18 15:46:27 +08:00
|
|
|
<uni-icons type="plusempty" color="#E8E8E8" size="50rpx" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="line mtb20">
|
|
|
|
<view class="key">上传视频</view>
|
|
|
|
<view class="value mt20 imgList">
|
|
|
|
<view class="imgs wh200 br10" v-if="form.videoUrl">
|
|
|
|
<video :src="form.videoUrl" class="br10" />
|
|
|
|
</view>
|
2025-01-07 21:09:52 +08:00
|
|
|
<view class="imgs wh200 upload fmid bfff br10" @click="uploadVideo">
|
2024-12-18 15:46:27 +08:00
|
|
|
<uni-icons type="plusempty" color="#E8E8E8" size="50rpx" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="main mtb20 plr20 br20">
|
|
|
|
<view class="title ptb20">
|
2025-01-02 01:01:23 +08:00
|
|
|
<input type="text" class="f32" placeholder="填写标题会有更多曝光率哦~" placeholder-class="placeholderStyle"
|
|
|
|
v-model="form.title" />
|
2024-12-18 15:46:27 +08:00
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="content ptb10">
|
2025-01-02 01:01:23 +08:00
|
|
|
<textarea class="textarea f32" v-model="form.description" placeholder="添加正文" />
|
2024-12-18 15:46:27 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 标签 -->
|
|
|
|
<view class="labels items mt20 df fww c333 f28" v-if="labelSelect[0]">
|
|
|
|
<view class="item fmid mr20 mb20 plr20 bar" v-for="(item,index) in labelSelect" :key="index">
|
2025-01-16 20:18:22 +08:00
|
|
|
<view class="mr10">#{{item.tagName}}</view>
|
2024-12-18 15:46:27 +08:00
|
|
|
<uni-icons type="closeempty" size="28rpx" @click="handleLabelSelectDel(item,index)" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 用户 -->
|
|
|
|
<view class="labels items mt20 df fww c333 f28" v-if="userSelect[0]">
|
|
|
|
<view class="item fmid mr20 mb20 plr20 bar" v-for="(item,index) in userSelect" :key="index">
|
|
|
|
<view class="mr10">@{{item.userNickname}}</view>
|
|
|
|
<uni-icons type="closeempty" size="28rpx" @click="handleLabelSelectDel(item,index)" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 菜单 -->
|
|
|
|
<view class="menu df fww f28">
|
|
|
|
<view class="item mr20 ptb5 plr20 bar" @click="$refs.labelRef.open()">#话题</view>
|
|
|
|
<view class="item mr20 ptb5 plr20 bar" @click="$refs.userRef.open()">@用户</view>
|
|
|
|
<view class="item mr20 ptb5 plr20 bar" v-if="0">@地点</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 地点 -->
|
|
|
|
<view class="mtb20" v-if="0">
|
|
|
|
<view class="key rows">
|
|
|
|
<uni-icons type="location"></uni-icons>
|
|
|
|
<view class="f1">添加地点</view>
|
|
|
|
</view>
|
|
|
|
<view class="value mt20">
|
|
|
|
<scroll-view scroll-x="true" class="scroll wsn">
|
|
|
|
<view class="locate items df f24">
|
|
|
|
<view class="item mr20 ptb5 plr20 bar" v-for="(item,index) in 5" :key="index">北京天安门</view>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
2025-02-05 23:29:54 +08:00
|
|
|
<template v-if="userinfo.isShop == 1">
|
|
|
|
<view class="product mtb20" @click="$refs.productRef.open()">
|
2025-03-08 09:40:51 +08:00
|
|
|
<view class="header rows" @click.stop>
|
|
|
|
<view class="key">添加商品链接</view>
|
|
|
|
<view class="remove">
|
|
|
|
<uni-icons type="trash" color="#999" size="34rpx" @click="handleRemoveProduct" />
|
|
|
|
</view>
|
|
|
|
</view>
|
2025-02-05 23:29:54 +08:00
|
|
|
|
|
|
|
<view class="main mtb20 ptb20 tac br20" v-if="!form.productId">点击选择</view>
|
|
|
|
<view class="main df oh mtb20 plr30 br20" v-else>
|
|
|
|
<view class="df oh mtb20">
|
|
|
|
<view class="col oh df fdc jcsb f1 mr20">
|
|
|
|
<view class="name">{{form.productName}}</view>
|
2025-02-27 14:53:04 +08:00
|
|
|
<view class="price thd mt10 cFF9B27 f28">
|
2025-02-05 23:29:54 +08:00
|
|
|
<text class="price thd mr20">价格{{form.productPrice}}</text>
|
|
|
|
<text class="commission thd">佣金{{form.commission}}</text>
|
|
|
|
</view>
|
2025-01-16 20:18:22 +08:00
|
|
|
</view>
|
|
|
|
|
2025-02-05 23:29:54 +08:00
|
|
|
<view class="wh200 fs0 c999 bfff br10">
|
|
|
|
<image class="br10" :src="form.productImage" mode="aspectFill" />
|
|
|
|
</view>
|
2025-01-16 20:18:22 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
2025-02-05 23:29:54 +08:00
|
|
|
<view class="second df jcr mtb20">
|
|
|
|
<view>需要在第</view>
|
|
|
|
<input type="text" v-model="form.popupTime" class="input" />
|
|
|
|
<view>秒展示</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
2025-01-16 20:18:22 +08:00
|
|
|
|
2024-12-18 15:46:27 +08:00
|
|
|
<view class="fill" style="height: 150rpx;"></view>
|
|
|
|
|
|
|
|
<view class="footer rows plr30 bfff shadow">
|
2025-01-02 01:01:23 +08:00
|
|
|
<view class="btn bar lg disabled w180" @click="handleSubmit(0)">存草稿</view>
|
|
|
|
<view class="btn bar lg colourful f1 ml30" @click="handleSubmit(1)">发布作品</view>
|
2024-12-18 15:46:27 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 话题列表 -->
|
|
|
|
<uni-popup ref="labelRef" type="bottom">
|
|
|
|
<view class="selectionBox ptb20 plr20 bfff c999 f28">
|
|
|
|
<view class="title c333 f34 tac">话题列表</view>
|
|
|
|
<!-- 可选的列表 -->
|
|
|
|
<view class="mt20">
|
2025-01-02 01:01:23 +08:00
|
|
|
<scroll-view scroll-y="true" class="scroll" @scrolltolower="getMoreLabel">
|
2024-12-18 15:46:27 +08:00
|
|
|
<view class="selection">
|
2025-01-02 01:01:23 +08:00
|
|
|
<view class="option df aic" v-for="(item,index) in label.list" :key="index"
|
|
|
|
@click="handleSelectLabel(item,index)" :class="{
|
2025-01-16 20:18:22 +08:00
|
|
|
active: labelSelect.map(node => node.tagId).includes(item.tagId)
|
2024-12-18 15:46:27 +08:00
|
|
|
}">
|
2025-01-16 20:18:22 +08:00
|
|
|
<text class="thd f1">#{{item.tagName}}</text>
|
2024-12-18 15:46:27 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 结果 -->
|
|
|
|
<view class="reult items mt20 df fww c333 f28" v-if="labelSelect[0]">
|
|
|
|
<view class="item fmid mr20 mb20 plr20 bar" v-for="(item,index) in labelSelect" :key="index">
|
2025-01-16 20:18:22 +08:00
|
|
|
<view class="mr10">#{{item.tagName}}</view>
|
2024-12-18 15:46:27 +08:00
|
|
|
<uni-icons type="closeempty" size="28rpx" @click="handleLabelSelectDel(item,index)" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<!-- -->
|
|
|
|
<view class="editBox rows mt20 ptb10 plr20 br20">
|
|
|
|
<view class="c333 f28">#</view>
|
|
|
|
<input class="f1" type="text" v-model="labelKeyword" placeholder="输入你想选择的话题" />
|
2025-01-02 01:01:23 +08:00
|
|
|
<view class="" @click="refreshLabel">搜索</view>
|
2024-12-18 15:46:27 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</uni-popup>
|
|
|
|
|
|
|
|
<!-- at用户列表 -->
|
|
|
|
<uni-popup ref="userRef" type="bottom">
|
|
|
|
<view class="selectionBox ptb20 plr20 bfff c999 f28">
|
|
|
|
<view class="title c333 f34 tac">@用户列表</view>
|
|
|
|
<!-- 可选的列表 -->
|
|
|
|
<view class="mt20">
|
|
|
|
<scroll-view scroll-y="true" class="scroll" @scrolltolower="getMoreUserList">
|
|
|
|
<view class="selection">
|
2025-01-02 01:01:23 +08:00
|
|
|
<view class="option df aic" v-for="(item,index) in userList.data" :key="index"
|
|
|
|
@click="handleSelectUser(item,index)" :class="{
|
2024-12-18 15:46:27 +08:00
|
|
|
active: userSelect.map(node => node.userId).includes(item.userId)
|
|
|
|
}">
|
|
|
|
<text class="thd f1">@{{item.userNickname}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 结果 -->
|
|
|
|
<view class="reult items mt20 df fww c333 f28" v-if="userSelect[0]">
|
|
|
|
<view class="item fmid mr20 mb20 plr20 bar" v-for="(item,index) in userSelect" :key="index">
|
|
|
|
<view class="mr10">@{{item.userNickname}}</view>
|
|
|
|
<uni-icons type="closeempty" size="28rpx" @click="handleUserSelectDel(item,index)" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<!-- -->
|
|
|
|
<view class="editBox rows mt20 ptb10 plr20 br20">
|
|
|
|
<view class="c333 f28">@</view>
|
|
|
|
<input class="f1" type="text" v-model="userKeyword" placeholder="输入你想选择的用户" />
|
|
|
|
<view class="" @click="getUserList">搜索</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</uni-popup>
|
2025-01-16 20:18:22 +08:00
|
|
|
|
|
|
|
<!-- 发布的产品列表 -->
|
|
|
|
<uni-popup ref="productRef" type="bottom">
|
|
|
|
<view class="productAlt popBot bfff">
|
|
|
|
<view class="header ptb30 tac">我的商品展示</view>
|
|
|
|
<view class="listBox">
|
|
|
|
<scroll-view class="scroll" scroll-y="true" @scrolltolower="getMoreProductList">
|
|
|
|
<view class="item df aic mlr20 ptb20" v-for="(item,index) in product.list" :key="index"
|
|
|
|
@click="handleProduct(item)">
|
|
|
|
<view class="wh120">
|
|
|
|
<image class="br10" :src="item.sliderImage.split(',')[0]" mode="aspectFill" />
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="f1 t2hd ml20 c666 f30">
|
|
|
|
<text class="t2hd">{{item.name}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</scroll-view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</uni-popup>
|
2024-12-18 15:46:27 +08:00
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
image,
|
|
|
|
video {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
.upload {
|
|
|
|
background-color: #F4F4F4;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 背景
|
|
|
|
.main {
|
|
|
|
background-color: #F4F4F4;
|
|
|
|
|
|
|
|
// 内容
|
|
|
|
.content {
|
|
|
|
border-top: 2rpx solid #E5E5E5;
|
|
|
|
|
|
|
|
.textarea {
|
|
|
|
width: 100%;
|
|
|
|
height: 300rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 菜单
|
|
|
|
.menu {
|
|
|
|
.item {
|
|
|
|
background-color: #F4F4F4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 选项集合
|
|
|
|
.items {
|
|
|
|
.item {
|
|
|
|
background-color: #F4F4F4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 菜单选择列表
|
|
|
|
.selectionBox {
|
|
|
|
.scroll {
|
|
|
|
height: 420rpx;
|
|
|
|
|
|
|
|
.option {
|
|
|
|
box-sizing: border-box;
|
|
|
|
height: 60rpx;
|
|
|
|
border-bottom: 1rpx solid #E5E5E5;
|
|
|
|
|
|
|
|
// 被选择的
|
|
|
|
&.active {
|
|
|
|
background-color: #E5E5E5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
.editBox {
|
|
|
|
background-color: #F4F4F4;
|
|
|
|
}
|
|
|
|
}
|
2025-01-16 20:18:22 +08:00
|
|
|
|
|
|
|
// 产品
|
|
|
|
.productAlt {
|
|
|
|
.scroll {
|
|
|
|
height: 800rpx;
|
|
|
|
|
|
|
|
.item+.item {
|
|
|
|
border-top: 2rpx solid #eee;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 商家视频展示的秒数
|
|
|
|
.second {
|
|
|
|
|
|
|
|
.input {
|
|
|
|
width: 80rpx;
|
|
|
|
text-align: center;
|
|
|
|
flex: none;
|
|
|
|
border-bottom: 2rpx solid #111;
|
|
|
|
}
|
|
|
|
}
|
2024-12-18 15:46:27 +08:00
|
|
|
</style>
|