合并代码

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", "version" : "1",
"prompt" : "template", "prompt" : "template",
"title" : "隐私政策", "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" : "同意并接受", "buttonAccept" : "同意并接受",
"buttonRefuse" : "暂不同意", "buttonRefuse" : "暂不同意",
"hrefLoader" : "system|default", "hrefLoader" : "system|default",
"backToExit" : "false", "backToExit" : "false",
"second" : { "second" : {
"title" : "确认提示", "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" : "同意并继续", "buttonAccept" : "同意并继续",
"buttonRefuse" : "拒绝" "buttonRefuse" : "拒绝"
}, },

View File

@ -24,6 +24,19 @@ const video = {
url: `/video/video/add`, url: `/video/video/add`,
data: param.data, data: param.data,
method: 'POST', 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', // host: 'h5api',
// #endif // #endif
// #ifndef H5 // #ifndef H5
host: 'http://91f.xyz:8080', // host: 'http://91f.xyz:8080',
// host: 'http://192.168.0.110:8080', // host: 'http://192.168.0.110:8080',
// host: 'http://192.168.0.100:8080', host: 'http://192.168.0.100:8080',
// host: 'http://192.168.0.114:8080',
// #endif // #endif
// 支付方式配置 // 支付方式配置
payType: { payType: {

View File

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

View File

@ -50,12 +50,19 @@
// //
function refreshList() { function refreshList() {
console.log('listPrototype', listPrototype)
listPrototype.pageNum = 1 listPrototype.pageNum = 1
listPrototype.total = 0 listPrototype.total = 0
getList() getList()
} }
//
function getMoreList() {
console.log('getMoreList', listPrototype)
if (listPrototype.total <= listPrototype.data.length) return
listPrototype.pageNum++
getList()
}
// //
function getList() { function getList() {
api.shop.getProduct({ api.shop.getProduct({
@ -90,6 +97,7 @@
getList, getList,
listPrototype, listPrototype,
refreshList, refreshList,
getMoreList,
}) })
</script> </script>

View File

@ -211,7 +211,6 @@
}) })
onHide(() => { onHide(() => {
console.log('onHide', current[tabIndex.value], currentVideoRef)
// 暂停视频 // 暂停视频
if (proxy.$refs[`videoRef${tabIndex.value}`]) { if (proxy.$refs[`videoRef${tabIndex.value}`]) {
proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].pause() proxy.$refs[`videoRef${tabIndex.value}`][current[tabIndex.value]].pause()

View File

@ -159,10 +159,10 @@
// 菜单 // 菜单
let menu = [{ let menu = [{
name: '编辑', name: '编辑',
fn: function() { fn: () => {
uni.navigateTo({ uni.navigateTo({
url: util.setUrl('/pages/release/video', { url: util.setUrl('/pages/release/video', {
videoId: detail.videoId, videoId: detail.id,
}) })
}) })
} }
@ -174,10 +174,9 @@
content: '删除后不可恢复。确认删除?', content: '删除后不可恢复。确认删除?',
}).then(rs => { }).then(rs => {
// 删除视频 // 删除视频
if (rs.confirm) api.video.updateVideo({ if (rs.confirm) api.video.deleteVideo({
data: { data: {
videoId: detail.videoId, id: detail.id,
isDeleted: 1,
} }
}).then(rs => { }).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
@ -214,9 +213,10 @@
<template> <template>
<view class="page f1"> <view class="page f1">
<!-- --> <!-- -->
<indexVideo ref="indexVideo" :statistic="1" :item="detail" :tabIndex="0" :isMine="isMine" :index="0" :current="0" mode="detail" <indexVideo ref="indexVideo" :statistic="1" :item="detail" :tabIndex="0" :isMine="isMine" :index="0"
@showComment="handleShowCommentAlt" @showCollect="handleShowCollectAlt" :current="0" mode="detail" @showComment="handleShowCommentAlt" @showCollect="handleShowCollectAlt"
@showShareFirend="handleShowShareFirend" @like="videoLike" @detailMenu="detailMenu" @dataCenter="handleDataCenter" /> @showShareFirend="handleShowShareFirend" @like="videoLike" @detailMenu="detailMenu"
@dataCenter="handleDataCenter" />
<!-- 评论弹窗 --> <!-- 评论弹窗 -->
<commentAlt ref="commentRef" /> <commentAlt ref="commentRef" />

View File

@ -33,12 +33,12 @@
// //
const detail = reactive({}) const detail = reactive({})
// //
const isMine = ref(0) const isMine = ref(false)
onLoad((option) => { onLoad((option) => {
if (option.videoId) videoId.value = option.videoId 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() getVideoDetail()
@ -58,7 +58,6 @@
// //
function getVideoDetail() { function getVideoDetail() {
console.log('videoId.value', videoId.value)
api.video.getVideoById({ api.video.getVideoById({
data: { data: {
id: videoId.value, id: videoId.value,
@ -160,10 +159,10 @@
// //
let menu = [{ let menu = [{
name: '编辑', name: '编辑',
fn: function() { fn: () => {
uni.navigateTo({ uni.navigateTo({
url: util.setUrl('/pages/release/video', { url: util.setUrl('/pages/release/video', {
videoId: detail.videoId, videoId: detail.id,
}) })
}) })
} }
@ -175,10 +174,9 @@
content: '删除后不可恢复。确认删除?', content: '删除后不可恢复。确认删除?',
}).then(rs => { }).then(rs => {
// //
if (rs.confirm) api.video.updateVideo({ if (rs.confirm) api.video.removeVideo({
data: { data: {
videoId: detail.videoId, id: detail.id,
isDeleted: 1,
} }
}).then(rs => { }).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
@ -202,12 +200,23 @@
} }
}) })
} }
/**
* 跳转数据中心
* @param {Object} detail
*/
function handleDataCenter(detail) {
//
}
</script> </script>
<template> <template>
<view class="page f1"> <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" /> <commentAlt ref="commentRef" />

View File

@ -83,12 +83,8 @@
onLoad(() => { onLoad(() => {
// //
handleTabIndex(0) handleTabIndex(0)
// //
uni.$on('focusUser', () => { addListener()
//
util.getUserinfo()
})
}) })
onReady(() => { onReady(() => {
@ -97,7 +93,8 @@
}) })
onUnload(() => { onUnload(() => {
uni.$off('focusUser') //
removeList()
}) })
// //
@ -110,6 +107,26 @@
proxy.$refs[tabCurrent.value.ref].getMoreList() 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() { function handleReport() {
// //

View File

@ -14,6 +14,7 @@
import util from '@/common/js/util.js' import util from '@/common/js/util.js'
// //
const form = reactive({ const form = reactive({
id: '',
categoryId: '', categoryId: '',
sliderImage: [], sliderImage: [],
spec: [], spec: [],
@ -23,13 +24,65 @@
// //
const categoryIndex = ref('') 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() handlePushSpec()
// //
getCategory() 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() { function getCategory() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -88,7 +141,6 @@
type: 1, type: 1,
success: rs => { success: rs => {
item.image = rs.value item.image = rs.value
console.log('spec', form.spec)
} }
}) })
} }
@ -160,7 +212,7 @@
</view> </view>
<view class="line ptb20"> <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="rows">
<view class="title w150">类目</view> <view class="title w150">类目</view>
<view class="col f1"> <view class="col f1">

View File

@ -83,35 +83,44 @@
form.videoId = option.videoId form.videoId = option.videoId
// //
Promise.all([getVideoDetail(), getLabel()]).then(rs => { Promise.all([getVideoDetail(), getLabel()]).then(rs => {
//
const detail = rs[0] const detail = rs[0]
//
const labels = rs[1] const labels = rs[1]
// at
const users = rs[2] const users = rs[2]
console.log('release getDetail', detail) 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.title = detail.title
// //
form.content = detail.content form.description = detail.description
// 01稿 // // 0稿 1 2 3 4
form.isDraft = detail.isDraft form.status = detail.status
// id //
// detail.talkId.split(',').forEach(node => { if (detail.tagsList) labelSelect.push(...detail.tagsList)
// for (let i = 0; i < labelList.length; i++) {
// const item = labelList[i]
// if (node == item.id) labelSelect.push(item)
// }
// })
// id // id
detail.subscriber = detail.subscriber.split(',') // detail.subscriber = detail.subscriber.split(',')
detail.subscriberId.split(',').forEach((item, index) => { // detail.subscriberId.split(',').forEach((item, index) => {
userSelect.push({ // userSelect.push({
userId: item, // userId: item,
userNickname: detail.subscriber[index] // userNickname: detail.subscriber[index]
}) // })
}) // })
}) })
} else { } else {
// //
@ -126,8 +135,8 @@
function getVideoDetail() { function getVideoDetail() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
api.video.getVideoById({ api.video.getVideoById({
query: { data: {
videoId: form.videoId, id: form.videoId,
} }
}).then(rs => { }).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
@ -343,13 +352,13 @@
util.alert('封面不能为空') util.alert('封面不能为空')
return return
} }
// 稿
if (data.status == 1) {
if (!data.title) { if (!data.title) {
util.alert('标题不能为空') util.alert('标题不能为空')
return return
} }
// 稿
if (data.status == 1) {
if (!data.description) { if (!data.description) {
util.alert('正文不能为空') util.alert('正文不能为空')
return return

View File

@ -47,11 +47,13 @@
}) })
onReachBottom(() => { onReachBottom(() => {
// //
proxy.$refs.product.getMoreList()
}) })
onPullDownRefresh(() => { onPullDownRefresh(() => {
// //
proxy.$refs.product.refreshList()
}) })
onShow(() => { 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://91f.xyz:8080'
// let target = 'http://192.168.0.110:8080' // let target = 'http://192.168.0.110:8080'
let target = 'http://192.168.0.100:8080' let target = 'http://192.168.0.100:8080'
// let target = 'http://192.168.0.114:8080'
export default defineConfig({ export default defineConfig({
plugins: [uni()], plugins: [uni()],