2025.03.29 ~ 2025.03.30 工作代码提交

This commit is contained in:
sx 2025-03-31 09:45:26 +08:00
parent 2503d40ca1
commit 79742a0a1e
4 changed files with 179 additions and 173 deletions

View File

@ -75,8 +75,9 @@ export const durian = {
load: true, load: true,
}) })
}, },
/** /**
* 榴莲果配置 * 榴莲果互转配置
* @param {Object} param * @param {Object} param
*/ */
durianFruitConfig() { durianFruitConfig() {
@ -85,17 +86,31 @@ export const durian = {
method: 'GET', method: 'GET',
}) })
}, },
/** /**
* 获取榴莲果兑换量比例 * 获取榴莲果兑换播量比例
* @param {Object} param * @param {Object} param
*/ */
getDurainViews(param) { getShowPlayConfig(param) {
return util.request({ return util.request({
url: `/coreplay/durianFruitTransactionType/5`, url: `/coreplay/durianFruitTransactionType/5`,
method: 'GET', method: 'GET',
data: param.data, data: param.data,
}) })
}, },
/**
* 获取榴莲果兑换完播量比例
* @param {Object} param
*/
getFullPlayConfig(param) {
return util.request({
url: `/coreplay/durianFruitTransactionType/7`,
method: 'GET',
data: param.data,
})
},
/** /**
* 获取榴莲果交易列表 * 获取榴莲果交易列表
* @param {Object} param * @param {Object} param

View File

@ -24,10 +24,10 @@
type: String, type: String,
default: 'list', default: 'list',
}, },
// 0 // 0 1
limit: { limit: {
type: Number, type: Number,
default: 0. default: 0,
}, },
// 0 1 // 0 1
isMine: { isMine: {
@ -87,8 +87,13 @@
const findIndex = ids.value.findIndex(node => node == item.id) const findIndex = ids.value.findIndex(node => node == item.id)
if (findIndex >= 0) ids.value.splice(findIndex, 1) if (findIndex >= 0) ids.value.splice(findIndex, 1)
else { else {
//
if (props.limit == 1) {
ids.value[0] = item.id
return
}
// //
if (props.limit != 0 && props.limit <= ids.value.length) return else if (props.limit != 0 && props.limit <= ids.value.length) return
ids.value.push(item.id) ids.value.push(item.id)
} }
} }

View File

@ -37,68 +37,54 @@
} = getCurrentInstance() } = getCurrentInstance()
const store = useStore() const store = useStore()
// //
const durainView = ref(0) const durainChangeShowPlay = ref(0)
//
const durainChangeFullPlay = ref(0)
//
const durainChangeFullPlayLimit = ref(0)
// //
const userinfo = computed(() => store.state.userinfo) const userinfo = computed(() => store.state.userinfo)
// //
const list = reactive({ const list = reactive({
data: [], data: [],
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
total: 0, total: 0,
}) })
// //
const form = reactive({ const myVideo = ref({})
userId: userinfo.value.userId, //
videoId: [], const collecVideo = ref({})
reason: '', //
context: '', const playNum = ref('')
pic: [], // 5 7
}) const transactionType = ref('')
// //
const apply = reactive({ const selectVideo = computed(() => myVideo.value || collecVideo.value || {})
author: '', //
mobile: '', const price = computed(() => {
mail: '', let result = parseFloat(playNum.value)
address: '', if (transactionType.value == 5) result = result
}) if (transactionType.value == 7) result = result + durainChangeFullPlayLimit.value
//
const collectVideo = ref({})
// id
const myVideoIds = reactive([])
//
const viewCount = ref('')
//
const viewTotal = computed(() => {
let total = Number(viewCount.value) || 0
let count = myVideoIds.length
if (collectVideo.value.id) count++
return total * count
})
//
const myVideos = computed(() => {
let result = myVideoIds.map(item => {
return list.data.find(node => node.id == item) || {}
})
return result return result
}) })
// id //
const videoIds = computed(() => { const showPlayCount = computed(() => {
let result = [...myVideoIds] return (playNum.value || 0) * durainChangeShowPlay.value
if (collectVideo.value.id) result.push(collectVideo.value.id)
return result
}) })
// //
const purse = computed(() => store.state.purse) const purse = computed(() => store.state.purse)
onLoad(() => { onLoad(() => {
// //
getList() getList()
// //
addListener() addListener()
// //
getDurainViews() getShowPlayConfig()
//
getFullPlayConfig()
// //
util.getPurse() util.getPurse()
}) })
@ -111,7 +97,8 @@
function addListener() { function addListener() {
// //
uni.$on('selectPushCollectVideo', (item) => { uni.$on('selectPushCollectVideo', (item) => {
collectVideo.value = item myVideo.value = {}
collecVideo.value = item
}) })
} }
@ -120,12 +107,29 @@
uni.$off('selectPushCollectVideo') uni.$off('selectPushCollectVideo')
} }
// //
function getDurainViews() { function getShowPlayConfig() {
api.durian.getDurainViews({}).then(rs => { api.durian.getShowPlayConfig({}).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
// //
durainView.value = rs.data.proportion durainChangeShowPlay.value = rs.data.proportion
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function getFullPlayConfig() {
api.durian.getFullPlayConfig({}).then(rs => {
if (rs.code == 200) {
//
durainChangeFullPlay.value = rs.data.proportion
//
durainChangeFullPlayLimit.value = rs.data.minConsumption
return return
} }
util.alert({ util.alert({
@ -171,92 +175,80 @@
}) })
} }
// /**
function handleShowView() { * 选择我的视频
console.log('videoIds', videoIds.value) * @param {Object} item 选择的视频对象
if (videoIds.value.length < 1) { */
util.alert({ function handleMyWork(item) {
content: "请选择投流视频", myVideo.value = item
showCancel: false, collecVideo.value = {}
}) proxy.$refs.select.close()
}
//
function handleShowViewRef() {
if (!selectVideo.value.id) {
util.alert("请选择需要投流的视频")
return return
} }
// proxy.$refs.viewsRef.open()
proxy.$refs.views.open() }
//
function handleShowApplyRef() {
if (!myVideo.value.id) {
util.alert("请选择自己的作品")
return
}
proxy.$refs.applyRef.open()
} }
// //
function pushVideo() { function handlePushShow() {
if (purse.value.fruit <= videoIds.value.length * 10) { if (purse.value.fruit <= playNum.value * durainChangeShowPlay.value) {
util.alert({ util.alert({
content: "榴莲果不足", content: "榴莲果不足",
showCancel: false, showCancel: false,
}) })
return return
} }
proxy.$refs.views.close() //
transactionType.value = 5
proxy.$refs.viewsRef.close()
proxy.$refs.payPwdRef.open() proxy.$refs.payPwdRef.open()
} }
// //
function applyVideo() { function handlePushFull() {
if (videoIds.value.length < 1) { if (purse.value.fruit <= playNum.value * durainChangeFullPlay.value + durainChangeFullPlayLimit.value) {
util.alert({
content: "请选择投流视频",
showCancel: false,
})
return
}
if (userinfo.value.fruit <= videoIds.value.length * 10) {
util.alert({ util.alert({
content: "榴莲果不足", content: "榴莲果不足",
showCancel: false, showCancel: false,
}) })
return return
} }
//
api.video.applyVideo({ transactionType.value = 7
data: { proxy.$refs.applyRef.close()
videoIds: videoIds.value.join(","), proxy.$refs.payPwdRef.open()
author: apply.author,
mobile: apply.mobile,
address: apply.address,
mail: apply.mail
}
}).then(rs => {
if (rs.code === 200) {
proxy.$refs.applyRef.close()
util.alert('申请成功,请等待后台审核')
util.getUserinfo()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
} }
/** /**
* 确认取消投流 * 取消选择的收藏的别人的视频
* @param {Object} item
* @param {Object} index
*/ */
function handleCancel(item, index) { function handleCancel() {
util.alert({ util.alert({
content: `确认取消投流${item.title}`, content: `确认取消投流${selectVideo.title}`,
}).then(rs => { }).then(rs => {
if (!rs.confirm) return if (!rs.confirm) return
collectVideo.value = {} selectVideo.value = {}
}) })
} }
// //
function pushCollect() { function pushCollect() {
link(util.setUrl('/pages/index/dataCenter/pushVideoCollects', { link(util.setUrl('/pages/index/dataCenter/pushVideoCollects', {
ids: collectVideo.value.id, ids: selectVideo.value.id,
})) }))
} }
@ -267,23 +259,26 @@
}) })
} }
// /**
function handlePwdConfirm(ev) { * 二级密码确认
* @param {Object} event 二级密码
*/
function handlePwdConfirm(event) {
// //
api.durian.consume({ api.durian.consume({
data: { data: {
// //
userId: userinfo.value.id, userId: userinfo.value.id,
// //
transactionType: 5, transactionType: transactionType.value,
// //
fruitAmount: viewTotal.value, fruitAmount: price.value,
// //
totalAmount: viewTotal.value, totalAmount: price.value,
// //
secondPassword: ev, secondPassword: event,
// id // id
videoIds: videoIds.value, videoIds: [selectVideo.value.id],
} }
}).then(rs => { }).then(rs => {
if (rs.code === 200) { if (rs.code === 200) {
@ -308,27 +303,25 @@
</template> </template>
</apex> </apex>
<!-- --> <view class="first oh mtb30 mlr20 plr20 bfff br10" @click="$refs.select.open()">
<view class="first oh mtb30 mlr20 plr20 bfff br10">
<view class="rows mtb30 c333 f36"> <view class="rows mtb30 c333 f36">
<view class="col"> <view class="col">
<view class="df aic"> <view class="df aic">
<view class="">我想投流的视频</view> <view class="">我想投流的视频</view>
<uni-icons type="bottom" /> <uni-icons type="bottom" />
</view> </view>
<view class="hint mt10 f28">点击选择视频已选择{{myVideos.length}}</view>
</view> </view>
<view class="line uploadBox"> <view class="line uploadBox f28">
<view class="key" @click="$refs.select.open()">选择视频</view> <view class="key">选择自己的作品</view>
</view> </view>
</view> </view>
<view class="listBox mtb30" v-if="myVideos[0]"> <view class="listBox mtb30" v-if="myVideo.id">
<scroll-view scroll-x="true" class="scroll"> <scroll-view scroll-x="true" class="scroll">
<view class="list df"> <view class="list df">
<view class="item oh pr fs0 mr20 br20" v-for="(item,index) in myVideos" :key="index"> <view class="item oh pr fs0 mr20 br20">
<image class="poster br20" :src="item.coverUrl" mode="aspectFill" /> <image class="poster br20" :src="myVideo.coverUrl" mode="aspectFill" />
<!-- <view class="window pfull"></view> --> <!-- <view class="window pfull"></view> -->
</view> </view>
</view> </view>
@ -347,23 +340,24 @@
</view> </view>
<!-- 限制只能分享别人的视频限制一个 --> <!-- 限制只能分享别人的视频限制一个 -->
<view class="collectList" v-if="collectVideo.id"> <view class="collectList" v-if="collecVideo.id">
<view class="item df mtb30"> <view class="item df mtb30">
<view class="poster oh pr fs0 mr20 br10"> <view class="poster oh pr fs0 mr20 br10">
<image class="image br10" :src="collectVideo.coverUrl" mode="aspectFill" /> <image class="image br10" :src="collecVideo.coverUrl" mode="aspectFill" />
<!-- <view class="window pfull br10"></view> --> <!-- <view class="window pfull br10"></view> -->
</view> </view>
<view class="f1 df jcsb fdc"> <view class="f1 df jcsb fdc">
<view class="f1"> <view class="f1">
<view class="f38 b">{{collectVideo.title}}</view> <view class="f38 b">{{collecVideo.title}}</view>
<view class="mtb20 c666 f28">{{collectVideo.userNickname}}</view> <view class="mtb20 c666 f28">{{collecVideo.userNickname}}</view>
<!-- 如果是商家发布的带链接的视频 增加显示 商家出让佣金 --> <!-- 如果是商家发布的带链接的视频 增加显示 商家出让佣金 -->
<view class="cFF9B27 f24" v-if="collectVideo.productId">商家出让佣金 {{collectVideo.commission}} <view class="cFF9B27 f24" v-if="collecVideo.productId">商家出让佣金 {{collecVideo.commission}}
</view> </view>
</view> </view>
<view class=""> <view class="">
<view class="btn bar black w200" @click.stop="handleCancel(collectVideo,index)">取消</view> <view class="btn bar black w200" @click.stop="handleCancel()">取消</view>
</view> </view>
</view> </view>
</view> </view>
@ -371,42 +365,51 @@
</view> </view>
<!-- 我想要 --> <!-- 我想要 -->
<view class="second oh mtb20 ml20 plr20 c333 f36 br10 bfff"> <view class="second oh mtb20 mlr20 plr20 c333 f36 br10 bfff">
<view class="title mtb20">我想要</view> <view class="title mtb20">我想要</view>
<view class="list mtb20"> <view class="list mtb20">
<view class="item fmid fdc br10" @click="handleShowView"> <view class="item fmid fdc br10" @click="handleShowViewRef">
<view class="">展示播放量</view> <view class="">展示播放量</view>
<view class="mtb10 c666 f20">无需平台审核</view> <!-- <view class="mtb10 c666 f20">无需平台审核</view> -->
<view class="button btn black">投流</view> <view class="button btn black mt10">投流</view>
</view> </view>
<view class="item fmid fdc br10" @click="$refs.applyRef.open()"> <view class="item fmid fdc br10" @click="handleShowApplyRef">
<view>完播播放量</view> <view>完播播放量</view>
<view class="mtb10 c666 f20">需申请平台审核</view> <!-- <view class="mtb10 c666 f20">需申请平台审核</view> -->
<view class="button btn black">申请</view> <view class="button btn black mt10">申请</view>
</view> </view>
</view> </view>
<!-- 规则 -->
<view class="rule mtb20 c666 f24">
<view class="c333">投流说明</view>
<view>1. 只能选择一个视频用来投流推广</view>
<view>2. 展示播放量可以选择自己发布的视频和收藏的视频</view>
<view>3. 完播播放量只能选择自己的视频需要先向平台发起申请</view>
</view>
</view> </view>
<view class="fill" style="height: 210rpx;"></view> <view class="fill" style="height: 210rpx;"></view>
<!-- 填充 --> <!-- 填充 -->
<view class="footerBar footer bfff shadow"> <view class="footerBar footer bfff shadow">
<view class="hint ptb10 plr30 c333">消耗{{videoIds.length}}*1 榴莲果可提升 {{videoIds.length}}*{{durainView}}+ 展示量 <view class="hint ptb10 plr30 c333">
<view>消耗 1 榴莲果可提升 {{durainChangeShowPlay}}+ 展示播放量</view>
<view>消耗 1 榴莲果可提升 {{durainChangeFullPlay}}+ 完播播放量</view>
</view> </view>
<view class="content rows pt30 plr30"> <view class="content rows pt30 plr30">
<view class="f1 c333 f48">当前拥有{{userinfo.fruit}}榴莲果</view> <view class="f1 c333 f48">当前拥有{{userinfo.fruit}}榴莲果</view>
<!-- <view class="btn colourful f1">一键投放</view> -->
</view> </view>
</view> </view>
</view> </view>
<!-- 二级支付 --> <!-- 二级支付 -->
<payPwd ref="payPwdRef" :price="viewTotal" unitKey="durian" @confirm="handlePwdConfirm" /> <payPwd ref="payPwdRef" :price="price" unitKey="durian" @confirm="handlePwdConfirm" />
<!-- 展播量 --> <!-- 展播量申请 -->
<uni-popup ref="views" type="center"> <uni-popup ref="viewsRef" type="center">
<view class="viewAlt popMid plr30 bfff"> <view class="viewAlt popMid plr30 bfff">
<view class="title mt50 mb30 tac"> <view class="title mt50 mb30 tac">
<view>展示播放量</view> <view>展示播放量</view>
@ -414,56 +417,39 @@
<view class="form f28"> <view class="form f28">
<view class="row mtb20"> <view class="row mtb20">
<view class="key">耗榴莲果投流视频/</view> <view class="key">耗榴莲果投流视频</view>
<view class="value inputBox f1 mt10 plr20"> <view class="value inputBox f1 mt10 plr20">
<input v-model="viewCount" type="number" placeholder="单个视频消耗榴莲果数量" /> <input v-model="playNum" type="number" placeholder="请输入榴莲果数量" />
</view> </view>
</view> </view>
</view> </view>
<view class="c999 f26">总消耗{{viewTotal}}个榴莲果{{videoIds.length}}个视频投流</view> <view class="notice mt30 f20">预计获得 {{showPlayCount}}+ 展示播放量</view>
<view class="btn lg black mt10 mb40" @click="pushVideo">推流</view> <view class="btn lg black mt10 mb40" @click="handlePushShow">推流</view>
</view> </view>
</uni-popup> </uni-popup>
<!-- 申请表单 --> <!-- 完播量申请 -->
<uni-popup ref="applyRef" type="center"> <uni-popup ref="applyRef" type="center">
<view class="applyAlt popMid plr60 c333 f36 bfff"> <view class="applyAlt popMid plr60 c333 f36 bfff">
<view class="title mt50 mb30 tac"> <view class="title mt50 mb30 tac">
<view>完播播放量</view> <view>完播播放量</view>
<view class="">消耗10颗榴莲果</view> <view class="">消耗{{durainChangeFullPlayLimit}}榴莲果</view>
</view> </view>
<view class="form f28"> <view class="form f28">
<view class="row rows mtb20"> <view class="row mtb20">
<view class="key">视频作者</view> <view class="key">消耗榴莲果</view>
<view class="value inputBox f1 plr20"> <view class="value inputBox f1 mt20 plr20">
<input v-model="apply.author" type="text" placeholder="请输入视频作者" /> <input v-model="playNum" type="number" placeholder="请输入榴莲果数量" />
</view>
</view>
<view class="row rows mtb20">
<view class="key">手机号</view>
<view class="value inputBox f1 plr20">
<input v-model="apply.mobile" type="text" placeholder="请输入手机号" />
</view>
</view>
<view class="row rows mtb20">
<view class="key">邮箱号</view>
<view class="value inputBox f1 plr20">
<input v-model="apply.mail" type="text" placeholder="请输入邮箱号" />
</view>
</view>
<view class="row rows mtb20">
<view class="key">地址</view>
<view class="value inputBox f1 plr20">
<input v-model="apply.address" type="text" placeholder="请输入地址" />
</view> </view>
</view> </view>
</view> </view>
<view class="notice mt30 f20">不论是否申请成功榴莲果直接销毁</view> <view class="notice mt30 f20">申请成功则消耗全部榴莲果申请不成功则返回申请榴莲果</view>
<view class="btn lg black mt10 mb40" @click="applyVideo">提交申请</view>
<view class="btn lg black mt10 mb40" @click="handlePushFull">提交申请</view>
</view> </view>
</uni-popup> </uni-popup>
@ -484,7 +470,7 @@
<!-- 视频菜单 --> <!-- 视频菜单 -->
<scroll-view scroll-y="true" class="scroll" @scrolltolower="getMoreList"> <scroll-view scroll-y="true" class="scroll" @scrolltolower="getMoreList">
<videoMenu :list="list.data" v-model:ids="myVideoIds" mode="checkbox" /> <videoMenu :list="list.data" mode="menu" @item="handleMyWork" />
</scroll-view> </scroll-view>
</view> </view>
</uni-popup> </uni-popup>

View File

@ -228,7 +228,7 @@
}) })
} }
// //
function getConfig() { function getConfig() {
api.durian.durianFruitConfig().then(rs => { api.durian.durianFruitConfig().then(rs => {
if (rs.code == 200) { if (rs.code == 200) {