合并代码
This commit is contained in:
parent
2bb07b4957
commit
36df835adf
|
@ -2,14 +2,14 @@
|
|||
"version" : "1",
|
||||
"prompt" : "template",
|
||||
"title" : "隐私政策",
|
||||
"message" : " 请你务必审慎阅读、充分理解“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"http://91f.store/agreement.html\">《用户协议》</a>和<a href=\"http://91f.store/privacy.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||
"message" : " 请你务必审慎阅读、充分理解“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"http://91f.xyz:8085/agreement\">《用户协议》</a>和<a href=\"http://91f.xyz:8085/privacy\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||
"buttonAccept" : "同意并接受",
|
||||
"buttonRefuse" : "暂不同意",
|
||||
"hrefLoader" : "system|default",
|
||||
"backToExit" : "false",
|
||||
"second" : {
|
||||
"title" : "确认提示",
|
||||
"message" : " 进入应用前,你需先同意<a href=\"http://91f.store/agreement.html\">《隐私政策》</a>和<a href=\"http://91f.store/privacy.html\">《隐私政策》</a>",
|
||||
"message" : " 进入应用前,你需先同意<a href=\"http://91f.xyz:8085/agreement\">《用户协议》</a>和<a href=\"http://91f.xyz:8085/privacy\">《隐私政策》</a>",
|
||||
"buttonAccept" : "同意并继续",
|
||||
"buttonRefuse" : "拒绝"
|
||||
},
|
||||
|
|
|
@ -24,6 +24,19 @@ const video = {
|
|||
url: `/video/video/add`,
|
||||
data: param.data,
|
||||
method: 'POST',
|
||||
load: true,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除视频
|
||||
* @param {Object} param
|
||||
*/
|
||||
removeVideo(param) {
|
||||
return util.request({
|
||||
url: `/video/video/deleteVideo`,
|
||||
data: param.data,
|
||||
method: 'POST',
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
@ -6,10 +6,9 @@ const config = {
|
|||
// host: 'h5api',
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
host: 'http://91f.xyz:8080',
|
||||
// host: 'http://91f.xyz:8080',
|
||||
// host: 'http://192.168.0.110:8080',
|
||||
// host: 'http://192.168.0.100:8080',
|
||||
// host: 'http://192.168.0.114:8080',
|
||||
host: 'http://192.168.0.100:8080',
|
||||
// #endif
|
||||
// 支付方式配置
|
||||
payType: {
|
||||
|
|
|
@ -5,8 +5,6 @@ import config from '@/common/js/config.js'
|
|||
// 接口
|
||||
import api from '@/api/index.js'
|
||||
|
||||
const msgType = {}
|
||||
|
||||
// 工具库
|
||||
const util = {
|
||||
// 配置参数
|
||||
|
|
|
@ -50,12 +50,19 @@
|
|||
|
||||
// 重载列表
|
||||
function refreshList() {
|
||||
console.log('listPrototype', listPrototype)
|
||||
listPrototype.pageNum = 1
|
||||
listPrototype.total = 0
|
||||
getList()
|
||||
}
|
||||
|
||||
// 加载更多列表
|
||||
function getMoreList() {
|
||||
console.log('getMoreList', listPrototype)
|
||||
if (listPrototype.total <= listPrototype.data.length) return
|
||||
listPrototype.pageNum++
|
||||
getList()
|
||||
}
|
||||
|
||||
// 获取商品
|
||||
function getList() {
|
||||
api.shop.getProduct({
|
||||
|
@ -90,6 +97,7 @@
|
|||
getList,
|
||||
listPrototype,
|
||||
refreshList,
|
||||
getMoreList,
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -211,7 +211,6 @@
|
|||
})
|
||||
|
||||
onHide(() => {
|
||||
console.log('onHide', current[tabIndex.value], currentVideoRef)
|
||||
// 暂停视频
|
||||
if (proxy.$refs[`videoRef${tabIndex.value}`]) {
|
||||
proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].pause()
|
||||
|
|
|
@ -159,10 +159,10 @@
|
|||
// 菜单
|
||||
let menu = [{
|
||||
name: '编辑',
|
||||
fn: function() {
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: util.setUrl('/pages/release/video', {
|
||||
videoId: detail.videoId,
|
||||
videoId: detail.id,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -174,10 +174,9 @@
|
|||
content: '删除后不可恢复。确认删除?',
|
||||
}).then(rs => {
|
||||
// 删除视频
|
||||
if (rs.confirm) api.video.updateVideo({
|
||||
if (rs.confirm) api.video.deleteVideo({
|
||||
data: {
|
||||
videoId: detail.videoId,
|
||||
isDeleted: 1,
|
||||
id: detail.id,
|
||||
}
|
||||
}).then(rs => {
|
||||
if (rs.code == 200) {
|
||||
|
@ -214,9 +213,10 @@
|
|||
<template>
|
||||
<view class="page f1">
|
||||
<!-- -->
|
||||
<indexVideo ref="indexVideo" :statistic="1" :item="detail" :tabIndex="0" :isMine="isMine" :index="0" :current="0" mode="detail"
|
||||
@showComment="handleShowCommentAlt" @showCollect="handleShowCollectAlt"
|
||||
@showShareFirend="handleShowShareFirend" @like="videoLike" @detailMenu="detailMenu" @dataCenter="handleDataCenter" />
|
||||
<indexVideo ref="indexVideo" :statistic="1" :item="detail" :tabIndex="0" :isMine="isMine" :index="0"
|
||||
:current="0" mode="detail" @showComment="handleShowCommentAlt" @showCollect="handleShowCollectAlt"
|
||||
@showShareFirend="handleShowShareFirend" @like="videoLike" @detailMenu="detailMenu"
|
||||
@dataCenter="handleDataCenter" />
|
||||
|
||||
<!-- 评论弹窗 -->
|
||||
<commentAlt ref="commentRef" />
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
// 视频详情
|
||||
const detail = reactive({})
|
||||
// 是否是自己
|
||||
const isMine = ref(0)
|
||||
const isMine = ref(false)
|
||||
|
||||
onLoad((option) => {
|
||||
if (option.videoId) videoId.value = option.videoId
|
||||
// 是否我的作品
|
||||
if (option.isMine) isMine.value = option.isMine
|
||||
if (option.isMine && option.isMine != 'false') isMine.value = option.isMine
|
||||
|
||||
// 获取视频详情
|
||||
getVideoDetail()
|
||||
|
@ -58,7 +58,6 @@
|
|||
|
||||
// 获取视频详情
|
||||
function getVideoDetail() {
|
||||
console.log('videoId.value', videoId.value)
|
||||
api.video.getVideoById({
|
||||
data: {
|
||||
id: videoId.value,
|
||||
|
@ -160,10 +159,10 @@
|
|||
// 菜单
|
||||
let menu = [{
|
||||
name: '编辑',
|
||||
fn: function() {
|
||||
fn: () => {
|
||||
uni.navigateTo({
|
||||
url: util.setUrl('/pages/release/video', {
|
||||
videoId: detail.videoId,
|
||||
videoId: detail.id,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -175,10 +174,9 @@
|
|||
content: '删除后不可恢复。确认删除?',
|
||||
}).then(rs => {
|
||||
// 删除视频
|
||||
if (rs.confirm) api.video.updateVideo({
|
||||
if (rs.confirm) api.video.removeVideo({
|
||||
data: {
|
||||
videoId: detail.videoId,
|
||||
isDeleted: 1,
|
||||
id: detail.id,
|
||||
}
|
||||
}).then(rs => {
|
||||
if (rs.code == 200) {
|
||||
|
@ -202,12 +200,23 @@
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转数据中心
|
||||
* @param {Object} detail
|
||||
*/
|
||||
function handleDataCenter(detail) {
|
||||
//
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="page f1">
|
||||
<!-- -->
|
||||
<indexVideo ref="indexVideo" :item="detail" :tabIndex="0" :isMine="isMine" :index="0" :current="0" mode="detail" @showComment="handleShowCommentAlt" @showCollect="handleShowCollectAlt" @showShareFirend="handleShowShareFirend" @like="videoLike" @detailMenu="detailMenu" />
|
||||
<indexVideo ref="indexVideo" :statistic="1" :item="detail" :tabIndex="0" :isMine="isMine" :index="0"
|
||||
:current="0" mode="detail" @showComment="handleShowCommentAlt" @showCollect="handleShowCollectAlt"
|
||||
@showShareFirend="handleShowShareFirend" @like="videoLike" @detailMenu="detailMenu"
|
||||
@dataCenter="handleDataCenter" />
|
||||
|
||||
<!-- 评论弹窗 -->
|
||||
<commentAlt ref="commentRef" />
|
||||
|
|
|
@ -83,12 +83,8 @@
|
|||
onLoad(() => {
|
||||
// 初始化
|
||||
handleTabIndex(0)
|
||||
|
||||
// 开启监听
|
||||
uni.$on('focusUser', () => {
|
||||
// 更新用户信息
|
||||
util.getUserinfo()
|
||||
})
|
||||
addListener()
|
||||
})
|
||||
|
||||
onReady(() => {
|
||||
|
@ -97,7 +93,8 @@
|
|||
})
|
||||
|
||||
onUnload(() => {
|
||||
uni.$off('focusUser')
|
||||
// 移除监听
|
||||
removeList()
|
||||
})
|
||||
|
||||
// 滚动
|
||||
|
@ -110,6 +107,26 @@
|
|||
proxy.$refs[tabCurrent.value.ref].getMoreList()
|
||||
})
|
||||
|
||||
// 开启监听
|
||||
function addListener() {
|
||||
// 开启监听
|
||||
uni.$on('focusUser', () => {
|
||||
// 更新用户信息
|
||||
util.getUserinfo()
|
||||
})
|
||||
|
||||
// 开启监听
|
||||
uni.$on('deleteVideo', () => {
|
||||
proxy.$refs[tabCurrent.value.ref].refreshList()
|
||||
})
|
||||
}
|
||||
|
||||
// 移除监听
|
||||
function removeList() {
|
||||
uni.$off('focusUser')
|
||||
uni.$off('deleteVideo')
|
||||
}
|
||||
|
||||
// 举报
|
||||
function handleReport() {
|
||||
// 关闭弹窗
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
import util from '@/common/js/util.js'
|
||||
// 表单
|
||||
const form = reactive({
|
||||
id: '',
|
||||
categoryId: '',
|
||||
sliderImage: [],
|
||||
spec: [],
|
||||
|
@ -23,13 +24,65 @@
|
|||
// 分类下标
|
||||
const categoryIndex = ref('')
|
||||
|
||||
onLoad((options) => {
|
||||
onLoad((option) => {
|
||||
if (option.id) {
|
||||
form.id = option.id
|
||||
Promise.all([getProDetail(), getCategory()]).then(rs => {
|
||||
const detail = rs[0]
|
||||
const cate = rs[1]
|
||||
// 商品图片
|
||||
form.sliderImage = detail.sliderImage.split(',')
|
||||
// 下标
|
||||
categoryIndex.value = cate.findIndex(item => item.id === detail.categoryId)
|
||||
// 商品id
|
||||
form.id = detail.id
|
||||
// 商品规格
|
||||
form.categoryId = detail.categoryId
|
||||
// 商品价格
|
||||
form.price = detail.price
|
||||
// 商品名称
|
||||
form.name = detail.name
|
||||
// 商品成本价
|
||||
form.cost = detail.cost
|
||||
// 商品佣金
|
||||
form.commission = detail.commission
|
||||
// 规格
|
||||
form.spec = detail.specs.map(item => {
|
||||
return {
|
||||
image: item.image,
|
||||
sku: item.sku,
|
||||
stock: item.stock,
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
// 添加商品规格
|
||||
handlePushSpec()
|
||||
// 获取商品分类
|
||||
getCategory()
|
||||
}
|
||||
})
|
||||
|
||||
// 获取商品详情
|
||||
function getProDetail() {
|
||||
return new Promise((resolve, reject) => {
|
||||
api.shop.productDetail({
|
||||
query: {
|
||||
productionId: form.id
|
||||
},
|
||||
}).then(rs => {
|
||||
if (rs.code === 200) {
|
||||
resolve(rs.data)
|
||||
return
|
||||
}
|
||||
util.alert({
|
||||
content: rs.msg,
|
||||
showCancel: false,
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 获取商品分类
|
||||
function getCategory() {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
@ -88,7 +141,6 @@
|
|||
type: 1,
|
||||
success: rs => {
|
||||
item.image = rs.value
|
||||
console.log('spec', form.spec)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -160,7 +212,7 @@
|
|||
</view>
|
||||
|
||||
<view class="line ptb20">
|
||||
<picker :range="category" range-key="name" @change="handleCate">
|
||||
<picker :range="category" range-key="name" :value="categoryIndex" @change="handleCate">
|
||||
<view class="rows">
|
||||
<view class="title w150">类目</view>
|
||||
<view class="col f1">
|
||||
|
|
|
@ -83,35 +83,44 @@
|
|||
form.videoId = option.videoId
|
||||
// 获取标签 获取详情
|
||||
Promise.all([getVideoDetail(), getLabel()]).then(rs => {
|
||||
// 详情
|
||||
const detail = rs[0]
|
||||
// 标签
|
||||
const labels = rs[1]
|
||||
// at用户
|
||||
const users = rs[2]
|
||||
console.log('release getDetail', detail)
|
||||
// 视频地址
|
||||
form.videoUrl = util.format_url(detail.videoUrl, 'video')
|
||||
|
||||
// 视频id
|
||||
form.id = detail.id
|
||||
// 视频大小
|
||||
form.videoSize = detail.videoSize
|
||||
// 宽
|
||||
form.breadth = detail.breadth
|
||||
// 高
|
||||
form.height = detail.height
|
||||
// 时长
|
||||
form.videoDuration = detail.videoDuration
|
||||
// 缩略图
|
||||
form.imageUrl = util.format_url(detail.imageUrl, 'img')
|
||||
form.coverUrl = detail.coverUrl
|
||||
// 视频地址
|
||||
form.videoUrl = detail.videoUrl
|
||||
// 标题
|
||||
form.title = detail.title
|
||||
// 正文
|
||||
form.content = detail.content
|
||||
// 0正常1草稿
|
||||
form.isDraft = detail.isDraft
|
||||
// 匹配话题id
|
||||
// detail.talkId.split(',').forEach(node => {
|
||||
// for (let i = 0; i < labelList.length; i++) {
|
||||
// const item = labelList[i]
|
||||
// if (node == item.id) labelSelect.push(item)
|
||||
// }
|
||||
// })
|
||||
form.description = detail.description
|
||||
// //视频状态 0草稿 1待审核 2审核失败 3已发布 4已下架
|
||||
form.status = detail.status
|
||||
// 回显话题列表
|
||||
if (detail.tagsList) labelSelect.push(...detail.tagsList)
|
||||
// 匹配用户id
|
||||
detail.subscriber = detail.subscriber.split(',')
|
||||
detail.subscriberId.split(',').forEach((item, index) => {
|
||||
userSelect.push({
|
||||
userId: item,
|
||||
userNickname: detail.subscriber[index]
|
||||
})
|
||||
})
|
||||
// detail.subscriber = detail.subscriber.split(',')
|
||||
// detail.subscriberId.split(',').forEach((item, index) => {
|
||||
// userSelect.push({
|
||||
// userId: item,
|
||||
// userNickname: detail.subscriber[index]
|
||||
// })
|
||||
// })
|
||||
})
|
||||
} else {
|
||||
// 获取标签
|
||||
|
@ -126,8 +135,8 @@
|
|||
function getVideoDetail() {
|
||||
return new Promise((resolve, reject) => {
|
||||
api.video.getVideoById({
|
||||
query: {
|
||||
videoId: form.videoId,
|
||||
data: {
|
||||
id: form.videoId,
|
||||
}
|
||||
}).then(rs => {
|
||||
if (rs.code == 200) {
|
||||
|
@ -343,13 +352,13 @@
|
|||
util.alert('封面不能为空')
|
||||
return
|
||||
}
|
||||
|
||||
// 如果不是草稿箱
|
||||
if (data.status == 1) {
|
||||
if (!data.title) {
|
||||
util.alert('标题不能为空')
|
||||
return
|
||||
}
|
||||
|
||||
// 如果不是草稿箱
|
||||
if (data.status == 1) {
|
||||
if (!data.description) {
|
||||
util.alert('正文不能为空')
|
||||
return
|
||||
|
|
|
@ -47,11 +47,13 @@
|
|||
})
|
||||
|
||||
onReachBottom(() => {
|
||||
//
|
||||
// 重载列表
|
||||
proxy.$refs.product.getMoreList()
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
//
|
||||
// 重载列表
|
||||
proxy.$refs.product.refreshList()
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 8.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB |
|
@ -7,7 +7,6 @@ import uni from '@dcloudio/vite-plugin-uni';
|
|||
// let target = 'http://91f.xyz:8080'
|
||||
// let target = 'http://192.168.0.110:8080'
|
||||
let target = 'http://192.168.0.100:8080'
|
||||
// let target = 'http://192.168.0.114:8080'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [uni()],
|
||||
|
|
Loading…
Reference in New Issue