增加支付跳转盘抽奖

This commit is contained in:
2025-01-13 17:37:51 +08:00
parent 8029d157b6
commit f410719b46
4 changed files with 42 additions and 35 deletions

View File

@@ -2,7 +2,7 @@
"version" : "1.0",
"configurations" : [
{
"playground" : "standard",
"playground" : "custom",
"type" : "uni-app:app-android"
},
{

View File

@@ -5,11 +5,11 @@
@change="swiperChange" :current="current" :circular="true" vertical class="u-flex-1"
@transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200">
<swiper-item v-for="(item,index) in videoList" :key="index">
<list-item-vue :total="list.length" :item="item" :isCommand="isCommand" :showControls="control.showControls" :current="current"
:isCollect="isCollect" @toDetail="toDetail(item,index)" @controlstoggles="controlstoggles"
:playSpeeds="playSpeeds" :index="index" :nowIndex="nowIndex"
@dianzanClick="dianzanClick(item,index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)"
@popupShow="popupShow($event,item,index)"></list-item-vue>
<list-item-vue :total="list.length" :item="item" :isCommand="isCommand"
:showControls="control.showControls" :current="current" :isCollect="isCollect"
@toDetail="toDetail(item,index)" @controlstoggles="controlstoggles" :playSpeeds="playSpeeds"
:index="index" :nowIndex="nowIndex" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow($event,item,index)"></list-item-vue>
</swiper-item>
</swiper>
</view>
@@ -21,12 +21,11 @@
<cell v-for="(item,index) in list" :key="item.courseDetailsId" :ref="setRefList(index)">
<view class="swipers-items" :style="boxStyle" @longpress="popupShow('speed')">
<list-item-vue :total="list.length" :item="item" :current="current" :isCollect="isCollect"
:isCommand="isCommand"
:showControls="control.showControls" @toDetail="toDetail(item,index)" @itemMounted="itemMounted"
@controlstoggles="controlstoggles" :index="index" :instance="instance" :nowIndex="nowIndex"
@appear="appear($event,item,index)" :playSpeeds="playSpeeds" @disappear="disappear(item,index)"
@dianzanClick="dianzanClick(item,index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)"
@popupShow="popupShow($event,item,index)"></list-item-vue>
:isCommand="isCommand" :showControls="control.showControls" @toDetail="toDetail(item,index)"
@itemMounted="itemMounted" @controlstoggles="controlstoggles" :index="index" :instance="instance"
:nowIndex="nowIndex" @appear="appear($event,item,index)" :playSpeeds="playSpeeds"
@disappear="disappear(item,index)" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow($event,item,index)"></list-item-vue>
</view>
</cell>
</list>
@@ -317,7 +316,7 @@
console.log('disappear nowIndex' + nowIndex.value);
console.log('cacheIndex' + cacheIndex);
nowIndex.value = cacheIndex
const item=props.list[nowIndex.value]
const item = props.list[nowIndex.value]
if (!item.videoUrl) {
popupShow('pay', item, nowIndex.value)
}
@@ -331,6 +330,7 @@
async function payOrder(data) {
const res = await Api.payOrder(data)
if (res) {
uni.setStorageSync('nobuyCourseId',popup.data.courseId)
// #ifdef APP
uni.navigateTo({
url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url
@@ -401,6 +401,7 @@
function jiClick(item, index) {
initing=false
let newCurrent = (current.value + 1) % 3;
videoList.value[newCurrent] = item;
current.value = newCurrent;
@@ -427,24 +428,27 @@
clearTimeout(positonmer)
console.log('goListPosition:' + index)
const el = refList.value[index]
if ($mountedComponents[props.list.length - 1] && $mountedComponents[index]) {
domModule.scrollToElement(el, {
animated: false
})
initing = false;
const item = props.list[index]
setVideoList(item)
insertHistory()
} else {
// 延迟设置元素位置,(可能视频位置比较靠后数据未渲染完毕)
positonmer = setTimeout(() => {
goListPosition(index)
}, 200)
if (initing) {
if (!$mountedComponents[props.list.length - 1]) {
positonmer = setTimeout(() => {
goListPosition(index)
}, 200)
return
}
}
domModule.scrollToElement(el, {
animated: false
})
initing = false;
const item = props.list[index]
setVideoList(item)
insertHistory()
}
function popupClose(key) {
if (key) {
popup[key] = false
@@ -699,11 +703,11 @@
'width': '750rpx',
}
})
function videoListUpdata(){
videoList.value=videoList.value.map(v=>{
const item=props.list.find(listItem=>listItem.courseDetailsId==v.courseDetailsId)
return item?item:v
function videoListUpdata() {
videoList.value = videoList.value.map(v => {
const item = props.list.find(listItem => listItem.courseDetailsId == v.courseDetailsId)
return item ? item : v
})
}
defineExpose({

View File

@@ -31,8 +31,7 @@
getOrderInfo({
orderId: state.orderId
}).then(res => {
console.log(res);
if (res.data == 1) {
if (res == 1) {
uni.hideLoading()
const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios'

View File

@@ -73,9 +73,13 @@
await init()
refVideoList.value.videoListUpdata()
const drawRes=await Api.getDrawCount()
if(drawRes.count>0){
console.log(drawRes);
const nobuyCourseId=uni.getStorageSync('nobuyCourseId')
const item=state.list.find(v=>v.courseId==nobuyCourseId)
uni.clearStorageSync('nobuyCourseId')
if(drawRes.count*1>0&&nobuyCourseId!==null&&nobuyCourseId!==undefined&&item.videoUrl){
uni.navigateTo({
url:'pages/me/prizeDraw'
url:'/pages/me/prizeDraw'
})
}
}