合并代码

This commit is contained in:
sx 2025-02-06 23:34:13 +08:00
parent 2bb07b4957
commit 36df835adf
16 changed files with 174 additions and 69 deletions

View File

@ -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" : "拒绝"
},

View File

@ -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',
})
},

View File

@ -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: {

View File

@ -5,8 +5,6 @@ import config from '@/common/js/config.js'
// 接口
import api from '@/api/index.js'
const msgType = {}
// 工具库
const util = {
// 配置参数

View File

@ -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>

View File

@ -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()

View File

@ -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" />

View File

@ -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" />

View File

@ -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() {
//

View File

@ -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">

View File

@ -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
// 01稿
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

View File

@ -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

View File

@ -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()],