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

View File

@ -24,10 +24,10 @@
type: String,
default: 'list',
},
// 0
// 0 1
limit: {
type: Number,
default: 0.
default: 0,
},
// 0 1
isMine: {
@ -87,8 +87,13 @@
const findIndex = ids.value.findIndex(node => node == item.id)
if (findIndex >= 0) ids.value.splice(findIndex, 1)
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)
}
}

View File

@ -37,68 +37,54 @@
} = getCurrentInstance()
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 list = reactive({
data: [],
pageSize: 10,
pageNum: 1,
total: 0,
})
//
const form = reactive({
userId: userinfo.value.userId,
videoId: [],
reason: '',
context: '',
pic: [],
})
//
const apply = reactive({
author: '',
mobile: '',
mail: '',
address: '',
})
//
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) || {}
})
//
const myVideo = ref({})
//
const collecVideo = ref({})
//
const playNum = ref('')
// 5 7
const transactionType = ref('')
//
const selectVideo = computed(() => myVideo.value || collecVideo.value || {})
//
const price = computed(() => {
let result = parseFloat(playNum.value)
if (transactionType.value == 5) result = result
if (transactionType.value == 7) result = result + durainChangeFullPlayLimit.value
return result
})
// id
const videoIds = computed(() => {
let result = [...myVideoIds]
if (collectVideo.value.id) result.push(collectVideo.value.id)
return result
//
const showPlayCount = computed(() => {
return (playNum.value || 0) * durainChangeShowPlay.value
})
//
const purse = computed(() => store.state.purse)
onLoad(() => {
//
//
getList()
//
addListener()
//
getDurainViews()
//
getShowPlayConfig()
//
getFullPlayConfig()
//
util.getPurse()
})
@ -111,7 +97,8 @@
function addListener() {
//
uni.$on('selectPushCollectVideo', (item) => {
collectVideo.value = item
myVideo.value = {}
collecVideo.value = item
})
}
@ -120,12 +107,29 @@
uni.$off('selectPushCollectVideo')
}
//
function getDurainViews() {
api.durian.getDurainViews({}).then(rs => {
//
function getShowPlayConfig() {
api.durian.getShowPlayConfig({}).then(rs => {
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
}
util.alert({
@ -171,92 +175,80 @@
})
}
//
function handleShowView() {
console.log('videoIds', videoIds.value)
if (videoIds.value.length < 1) {
util.alert({
content: "请选择投流视频",
showCancel: false,
})
/**
* 选择我的视频
* @param {Object} item 选择的视频对象
*/
function handleMyWork(item) {
myVideo.value = item
collecVideo.value = {}
proxy.$refs.select.close()
}
//
function handleShowViewRef() {
if (!selectVideo.value.id) {
util.alert("请选择需要投流的视频")
return
}
//
proxy.$refs.views.open()
proxy.$refs.viewsRef.open()
}
//
function handleShowApplyRef() {
if (!myVideo.value.id) {
util.alert("请选择自己的作品")
return
}
proxy.$refs.applyRef.open()
}
//
function pushVideo() {
if (purse.value.fruit <= videoIds.value.length * 10) {
function handlePushShow() {
if (purse.value.fruit <= playNum.value * durainChangeShowPlay.value) {
util.alert({
content: "榴莲果不足",
showCancel: false,
})
return
}
proxy.$refs.views.close()
//
transactionType.value = 5
proxy.$refs.viewsRef.close()
proxy.$refs.payPwdRef.open()
}
//
function applyVideo() {
if (videoIds.value.length < 1) {
util.alert({
content: "请选择投流视频",
showCancel: false,
})
return
}
if (userinfo.value.fruit <= videoIds.value.length * 10) {
function handlePushFull() {
if (purse.value.fruit <= playNum.value * durainChangeFullPlay.value + durainChangeFullPlayLimit.value) {
util.alert({
content: "榴莲果不足",
showCancel: false,
})
return
}
api.video.applyVideo({
data: {
videoIds: videoIds.value.join(","),
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,
})
})
//
transactionType.value = 7
proxy.$refs.applyRef.close()
proxy.$refs.payPwdRef.open()
}
/**
* 确认取消投流
* @param {Object} item
* @param {Object} index
* 取消选择的收藏的别人的视频
*/
function handleCancel(item, index) {
function handleCancel() {
util.alert({
content: `确认取消投流${item.title}`,
content: `确认取消投流${selectVideo.title}`,
}).then(rs => {
if (!rs.confirm) return
collectVideo.value = {}
selectVideo.value = {}
})
}
//
function pushCollect() {
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({
data: {
//
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
videoIds: videoIds.value,
videoIds: [selectVideo.value.id],
}
}).then(rs => {
if (rs.code === 200) {
@ -308,27 +303,25 @@
</template>
</apex>
<!-- -->
<view class="first oh mtb30 mlr20 plr20 bfff br10">
<view class="first oh mtb30 mlr20 plr20 bfff br10" @click="$refs.select.open()">
<view class="rows mtb30 c333 f36">
<view class="col">
<view class="df aic">
<view class="">我想投流的视频</view>
<uni-icons type="bottom" />
</view>
<view class="hint mt10 f28">点击选择视频已选择{{myVideos.length}}</view>
</view>
<view class="line uploadBox">
<view class="key" @click="$refs.select.open()">选择视频</view>
<view class="line uploadBox f28">
<view class="key">选择自己的作品</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">
<view class="list df">
<view class="item oh pr fs0 mr20 br20" v-for="(item,index) in myVideos" :key="index">
<image class="poster br20" :src="item.coverUrl" mode="aspectFill" />
<view class="item oh pr fs0 mr20 br20">
<image class="poster br20" :src="myVideo.coverUrl" mode="aspectFill" />
<!-- <view class="window pfull"></view> -->
</view>
</view>
@ -347,23 +340,24 @@
</view>
<!-- 限制只能分享别人的视频限制一个 -->
<view class="collectList" v-if="collectVideo.id">
<view class="collectList" v-if="collecVideo.id">
<view class="item df mtb30">
<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>
<view class="f1 df jcsb fdc">
<view class="f1">
<view class="f38 b">{{collectVideo.title}}</view>
<view class="mtb20 c666 f28">{{collectVideo.userNickname}}</view>
<view class="f38 b">{{collecVideo.title}}</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 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>
@ -371,42 +365,51 @@
</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="list mtb20">
<view class="item fmid fdc br10" @click="handleShowView">
<view class="item fmid fdc br10" @click="handleShowViewRef">
<view class="">展示播放量</view>
<view class="mtb10 c666 f20">无需平台审核</view>
<view class="button btn black">投流</view>
<!-- <view class="mtb10 c666 f20">无需平台审核</view> -->
<view class="button btn black mt10">投流</view>
</view>
<view class="item fmid fdc br10" @click="$refs.applyRef.open()">
<view class="item fmid fdc br10" @click="handleShowApplyRef">
<view>完播播放量</view>
<view class="mtb10 c666 f20">需申请平台审核</view>
<view class="button btn black">申请</view>
<!-- <view class="mtb10 c666 f20">需申请平台审核</view> -->
<view class="button btn black mt10">申请</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 class="fill" style="height: 210rpx;"></view>
<!-- 填充 -->
<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 class="content rows pt30 plr30">
<view class="f1 c333 f48">当前拥有{{userinfo.fruit}}榴莲果</view>
<!-- <view class="btn colourful f1">一键投放</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="title mt50 mb30 tac">
<view>展示播放量</view>
@ -414,56 +417,39 @@
<view class="form f28">
<view class="row mtb20">
<view class="key">耗榴莲果投流视频/</view>
<view class="key">耗榴莲果投流视频</view>
<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 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>
</uni-popup>
<!-- 申请表单 -->
<!-- 完播量申请 -->
<uni-popup ref="applyRef" type="center">
<view class="applyAlt popMid plr60 c333 f36 bfff">
<view class="title mt50 mb30 tac">
<view>完播播放量</view>
<view class="">消耗10颗榴莲果</view>
<view class="">消耗{{durainChangeFullPlayLimit}}榴莲果</view>
</view>
<view class="form f28">
<view class="row rows mtb20">
<view class="key">视频作者</view>
<view class="value inputBox f1 plr20">
<input v-model="apply.author" type="text" 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 class="row mtb20">
<view class="key">消耗榴莲果</view>
<view class="value inputBox f1 mt20 plr20">
<input v-model="playNum" type="number" placeholder="请输入榴莲果数量" />
</view>
</view>
</view>
<view class="notice mt30 f20">不论是否申请成功榴莲果直接销毁</view>
<view class="btn lg black mt10 mb40" @click="applyVideo">提交申请</view>
<view class="notice mt30 f20">申请成功则消耗全部榴莲果申请不成功则返回申请榴莲果</view>
<view class="btn lg black mt10 mb40" @click="handlePushFull">提交申请</view>
</view>
</uni-popup>
@ -484,7 +470,7 @@
<!-- 视频菜单 -->
<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>
</view>
</uni-popup>

View File

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