调用支付接口,未登录的情况下

This commit is contained in:
duan
2025-01-08 15:08:08 +08:00
parent 383ec3607a
commit 9c956be0dc
2 changed files with 28 additions and 25 deletions

View File

@@ -1,7 +1,7 @@
<template> <template>
<view class="subNvueweight"> <view class="subNvueweight">
<list :bounce="false" :loadmoreoffset="wHeight*3" :show-scrollbar="false" ref="listBox" :pagingEnabled="true" <list :bounce="false" :loadmoreoffset="wHeight*3" :show-scrollbar="false" ref="listBox" :pagingEnabled="true"
:scrollable="true"> :scrollable="true">
<image src="components/czgdetail1 (5).JPG" mode=""></image> <image src="components/czgdetail1 (5).JPG" mode=""></image>
<cell v-for="(item,i) in videoList" :key="i" :ref="'list'+item.courseDetailsId"> <cell v-for="(item,i) in videoList" :key="i" :ref="'list'+item.courseDetailsId">
<view class="subNvueswipers-items" @longpress="openBs()" @disappear="disappear(item.courseDetailsId,i)" <view class="subNvueswipers-items" @longpress="openBs()" @disappear="disappear(item.courseDetailsId,i)"
@@ -14,8 +14,8 @@
@ended="ended" :enable-progress-gesture="false" :poster="item.titleImg" @ended="ended" :enable-progress-gesture="false" :poster="item.titleImg"
:ref="'myVideo'+item.courseDetailsId" :id="'myVideo'+item.courseDetailsId" :src="item.videoUrl" :ref="'myVideo'+item.courseDetailsId" :id="'myVideo'+item.courseDetailsId" :src="item.videoUrl"
:autoplay="item.autoPlay" class="detailswipers-items-video"></video> :autoplay="item.autoPlay" class="detailswipers-items-video"></video>
<image v-else @click="!item.videoUrl?openPay():''" :src="item.titleImg" class="detailswipers-items-imgsbg" <image v-else @click="!item.videoUrl?openPay():''" :src="item.titleImg"
mode="aspectFill"> class="detailswipers-items-imgsbg" mode="aspectFill">
</image> </image>
<!-- 返回图标 --> <!-- 返回图标 -->
<image v-if="showBack" src="../static/nvueIcon/backs.png" @click="goBack()" <image v-if="showBack" src="../static/nvueIcon/backs.png" @click="goBack()"
@@ -38,8 +38,8 @@
</view> </view>
<view class="detailswipers-items-right-item" @click="share()"> <view class="detailswipers-items-right-item" @click="share()">
<view class="detailswipers-items-right-item-img"> <view class="detailswipers-items-right-item-img">
<image class="detailswipers-items-right-item-imgs" src="../../static/images/me/share.png" <image class="detailswipers-items-right-item-imgs"
mode=""></image> src="../../static/images/me/share.png" mode=""></image>
</view> </view>
<view class="detaswipers-items-right-item-txt"> <view class="detaswipers-items-right-item-txt">
<text class="detaswipers-items-right-item-txts"> <text class="detaswipers-items-right-item-txts">
@@ -50,8 +50,8 @@
<view class="detailswipers-items-right-item" v-if="isCollect"> <view class="detailswipers-items-right-item" v-if="isCollect">
<view class="detailswipers-items-right-item-img" @click.stop="shoucang()"> <view class="detailswipers-items-right-item-img" @click.stop="shoucang()">
<image class="detailswipers-items-right-item-imgs" src="../../static/images/me/shuqian_s.png" <image class="detailswipers-items-right-item-imgs"
mode=""></image> src="../../static/images/me/shuqian_s.png" mode=""></image>
</view> </view>
<view class="detaswipers-items-right-item-txt"> <view class="detaswipers-items-right-item-txt">
<text class="detaswipers-items-right-item-txts"> <text class="detaswipers-items-right-item-txts">
@@ -61,8 +61,8 @@
</view> </view>
<view class="detailswipers-items-right-item" v-else> <view class="detailswipers-items-right-item" v-else>
<view class="detailswipers-items-right-item-img" @click.stop="shoucang()"> <view class="detailswipers-items-right-item-img" @click.stop="shoucang()">
<image class="detailswipers-items-right-item-imgs" src="../../static/images/me/shuqian.png" <image class="detailswipers-items-right-item-imgs"
mode=""></image> src="../../static/images/me/shuqian.png" mode=""></image>
</view> </view>
<view class="detaswipers-items-right-item-txt"> <view class="detaswipers-items-right-item-txt">
<text class="detaswipers-items-right-item-txts"> <text class="detaswipers-items-right-item-txts">
@@ -497,11 +497,14 @@
this.getDataList(this.courseId, this.courseDetailsId); this.getDataList(this.courseId, this.courseDetailsId);
} }
httpsRequest.getT('/app/course/getRedEnvelopeTips').then(res => { if (uni.getStorageSync('token')) {
if (res.code == 0) { httpsRequest.getT('/app/course/getRedEnvelopeTips').then(res => {
this.getRedEnvelopeTips = res.data if (res.code == 0) {
} this.getRedEnvelopeTips = res.data
}) }
})
}
this.getScale() this.getScale()
}, },
onLoad(e) { onLoad(e) {
@@ -535,7 +538,7 @@
this.getMoneyList() this.getMoneyList()
this.getMyMoney() this.getMyMoney()
} else { } else {
console.log("allId====="+e.allId) console.log("allId=====" + e.allId)
if (e.allId) { if (e.allId) {
const arr = e.allId.split('-') const arr = e.allId.split('-')
this.courseId = arr[0]; this.courseId = arr[0];
@@ -602,7 +605,7 @@
this.courseDetailsId = e; this.courseDetailsId = e;
// 清除已经设置的定时器 // 清除已经设置的定时器
clearTimeout(this.appearTimeout); clearTimeout(this.appearTimeout);
// 设置一个新的延迟执行的定时器 // 设置一个新的延迟执行的定时器
this.appearTimeout = setTimeout(() => { this.appearTimeout = setTimeout(() => {
// 实际要执行的操作 // 实际要执行的操作
@@ -616,15 +619,15 @@
this.scrollIntoView = 'video' + index this.scrollIntoView = 'video' + index
console.log(this.scrollIntoViews, '当前位置') console.log(this.scrollIntoViews, '当前位置')
//播放并更新video的上下文 //播放并更新video的上下文
this.startPlay(index) this.startPlay(index)
//插入历史记录 //插入历史记录
this.setHistor(this.videoList[index].courseId, this.videoList[index].courseDetailsId); this.setHistor(this.videoList[index].courseId, this.videoList[index].courseDetailsId);
this.$forceUpdate() this.$forceUpdate()
}, 500); // 延迟500毫秒执行 }, 500); // 延迟500毫秒执行
}, },
disappear(e, index) { disappear(e, index) {
// if (this.videoContext) { //判断之前是否有视频的上下文 // if (this.videoContext) { //判断之前是否有视频的上下文
// this.videoContext.stop(); // this.videoContext.stop();
// this.videoContext = null; // this.videoContext = null;
@@ -1115,8 +1118,8 @@
this.$refs.popupPya.close() this.$refs.popupPya.close()
}, },
//选择播放 //选择播放
selectPlay(item,type) { selectPlay(item, type) {
if ( this.videoList[this.current].videoUrl == '' && this.videoList[this.current].price <= 0 && !type ) { if (this.videoList[this.current].videoUrl == '' && this.videoList[this.current].price <= 0 && !type) {
this.getDataList(this.courseId, this.courseDetailsId, true, 'select') this.getDataList(this.courseId, this.courseDetailsId, true, 'select')
return; return;
} }
@@ -1245,7 +1248,7 @@
animated: false animated: false
}) })
_this.$forceUpdate() _this.$forceUpdate()
console.log('移动结束', el) console.log('移动结束', el)
// },1000) // },1000)
}) })
}, },
@@ -1371,8 +1374,8 @@
this.$forceUpdate(); this.$forceUpdate();
}) })
} }
if ( t == 'select') { if (t == 'select') {
this.selectPlay(this.videoList[this.current],true) this.selectPlay(this.videoList[this.current], true)
} }
this.$forceUpdate(); this.$forceUpdate();
} }

View File

@@ -853,7 +853,7 @@ export default {
this.getDataList(this.courseId, this.courseDetailsId); this.getDataList(this.courseId, this.courseDetailsId);
} }
if( uni.getStorageSync('token')){ if(uni.getStorageSync('token')){
this.$Request.getT('/app/course/getRedEnvelopeTips').then((res) => { this.$Request.getT('/app/course/getRedEnvelopeTips').then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.getRedEnvelopeTips = res.data; this.getRedEnvelopeTips = res.data;