Merge branch 'test' of https://e.coding.net/g-cphe0354/duanju/new_app into gaohao
This commit is contained in:
commit
b693f772bb
|
|
@ -66,3 +66,47 @@ export function tuijianVideo(data){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//解锁10集视频
|
||||||
|
export function buyTenVideo(data){
|
||||||
|
return http.request({
|
||||||
|
url: 'order/insertCourseOrders/limit10',
|
||||||
|
method:'GET',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//解锁单集或者全部视频
|
||||||
|
export function buyVideo(data){
|
||||||
|
return http.request({
|
||||||
|
url: 'order/insertCourseOrders',
|
||||||
|
method:'GET',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//订单支付
|
||||||
|
export function payOrder(data){
|
||||||
|
let payType='h5'
|
||||||
|
// #ifdef APP
|
||||||
|
payType='app'
|
||||||
|
// #endif
|
||||||
|
return http.request({
|
||||||
|
url: 'wuyou/payOrder/'+data.orderId+'?payType='+payType,
|
||||||
|
method:'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//获取订单支付状态
|
||||||
|
export function getOrderInfo(data){
|
||||||
|
return http.request({
|
||||||
|
url: 'wuyou/queryOrder/'+data.orderId,
|
||||||
|
method:'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//金币解锁
|
||||||
|
export function goldPay(data){
|
||||||
|
return http.request({
|
||||||
|
url: 'order/payOrders',
|
||||||
|
method:'POST',
|
||||||
|
data:{...data,header:{
|
||||||
|
'content-type':'application/x-www-form-urlencoded'
|
||||||
|
}}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -2,14 +2,14 @@
|
||||||
<view class="item" @appear="appear" @disappear="disappear" @click.stop>
|
<view class="item" @appear="appear" @disappear="disappear" @click.stop>
|
||||||
|
|
||||||
<video class="u-flex-1 video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
|
<video class="u-flex-1 video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
|
||||||
@waiting="waiting()" object-fit="cover"
|
@waiting="waiting()" object-fit="cover" @pause="onpause" @click="videoClick()"
|
||||||
@pause="onpause"
|
|
||||||
@play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2"
|
@play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2"
|
||||||
:show-loading="true" codec="software" :muted="false" :show-center-play-btn="true" :loop="false"
|
:show-loading="true" codec="software" :muted="false" :show-center-play-btn="true" :loop="false"
|
||||||
:enable-progress-gesture="false" :poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId"
|
:enable-progress-gesture="false" :poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId"
|
||||||
:autoplay="autoplay" @ended="ended" :id="'myVideo'+item.courseDetailsId" :src="item.videoUrl"></video>
|
:autoplay="autoplay" @ended="ended" :id="'myVideo'+item.courseDetailsId" :src="item.videoUrl"></video>
|
||||||
|
|
||||||
<image class="poster" v-else @click="!item.videoUrl?popupShow('pay'):''" :src="item.titleImg" mode="aspectFill">
|
<image class="poster" v-else @click="!item.videoUrl?popupShow('pay',item):''" :src="item.titleImg"
|
||||||
|
mode="aspectFill">
|
||||||
</image>
|
</image>
|
||||||
|
|
||||||
<view class="info" v-if="!isCommand" :style="infoStyle">
|
<view class="info" v-if="!isCommand" :style="infoStyle">
|
||||||
|
|
@ -43,8 +43,8 @@
|
||||||
<text class="text color-fff u-font-24">分享</text>
|
<text class="text color-fff u-font-24">分享</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="zhuiju u-m-b-40 u-flex u-flex-xy-center u-flex-col u-text-center" @click="zhuijuClick">
|
<view class="zhuiju u-m-b-40 u-flex u-flex-xy-center u-flex-col u-text-center" @click="zhuijuClick">
|
||||||
<image class="icon" v-if="isCollect" src="@/static/images/shuqian.png" mode=""></image>
|
<image class="icon" v-if="isCollect" src="@/static/images/shuqian_s.png" mode=""></image>
|
||||||
<image class="icon" v-else src="@/static/images/shuqian_s.png" mode=""></image>
|
<image class="icon" v-else src="@/static/images/shuqian.png" mode=""></image>
|
||||||
<text class="text color-fff u-font-24">{{isCollect?'已追':'追剧'}}</text>
|
<text class="text color-fff u-font-24">{{isCollect?'已追':'追剧'}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -70,17 +70,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rightStyle:{
|
rightStyle: {
|
||||||
type:Object,
|
type: Object,
|
||||||
default:()=>{
|
default: () => {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
infoStyle:{
|
infoStyle: {
|
||||||
type:Object,
|
type: Object,
|
||||||
default:()=>{
|
default: () => {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -124,7 +124,7 @@
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 1
|
default: 1
|
||||||
},
|
},
|
||||||
showControls:{
|
showControls: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
}
|
}
|
||||||
|
|
@ -132,11 +132,10 @@
|
||||||
let autoplay = ref(props.item.videoUrl ? true : false)
|
let autoplay = ref(props.item.videoUrl ? true : false)
|
||||||
|
|
||||||
const emits = defineEmits(['controlstoggles', 'disappear', 'appear', 'waiting', 'videoPlay', 'ended', 'dianzanClick',
|
const emits = defineEmits(['controlstoggles', 'disappear', 'appear', 'waiting', 'videoPlay', 'ended', 'dianzanClick',
|
||||||
'share', 'zhuijuClick', 'popupShow', 'itemMounted', 'toDetail'
|
'share', 'zhuijuClick', 'popupShow', 'itemMounted', 'toDetail', 'showInfo'
|
||||||
])
|
])
|
||||||
|
|
||||||
function controlstoggles(e) {
|
function controlstoggles(e) {
|
||||||
console.log(e);
|
|
||||||
emits('controlstoggles', e)
|
emits('controlstoggles', e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -151,23 +150,38 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let isPlying = ref(false)
|
||||||
|
watch(() => isPlying.value, (newval) => {
|
||||||
|
console.log(newval);
|
||||||
|
emits('showInfo', newval)
|
||||||
|
})
|
||||||
|
|
||||||
function videoPlay() {
|
function videoPlay() {
|
||||||
|
isPlying.value = true
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
emits('controlstoggles', {
|
emits('controlstoggles', {
|
||||||
detail:{show:true}
|
detail: {
|
||||||
|
show: true
|
||||||
|
}
|
||||||
})
|
})
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onpause(){
|
function onpause() {
|
||||||
|
isPlying.value = false
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
emits('controlstoggles', {
|
emits('controlstoggles', {
|
||||||
detail:{show:false}
|
detail: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function ended() {
|
function ended() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -188,6 +202,17 @@
|
||||||
emits('popupShow', key)
|
emits('popupShow', key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function videoClick() {
|
||||||
|
console.log('videoClick');
|
||||||
|
if (video) {
|
||||||
|
if (isPlying.value) {
|
||||||
|
video.pause()
|
||||||
|
} else {
|
||||||
|
video.play()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let first = true
|
let first = true
|
||||||
|
|
||||||
function appear() {
|
function appear() {
|
||||||
|
|
@ -227,6 +252,8 @@
|
||||||
if (props.item.videoUrl && showVideo.value) {
|
if (props.item.videoUrl && showVideo.value) {
|
||||||
video = uni.createVideoContext('myVideo' + props.item.courseDetailsId)
|
video = uni.createVideoContext('myVideo' + props.item.courseDetailsId)
|
||||||
video.playbackRate(props.playSpeeds)
|
video.playbackRate(props.playSpeeds)
|
||||||
|
video.play()
|
||||||
|
console.log('init play');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('------')
|
console.error('------')
|
||||||
|
|
@ -240,13 +267,28 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
watch(() => showVideo.value, (newval) => {
|
watch(() => showVideo.value, (newval) => {
|
||||||
|
console.log('showVideo change:'+newval);
|
||||||
if (newval) {
|
if (newval) {
|
||||||
init()
|
nextTick(()=>{
|
||||||
|
init()
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
video = null
|
video = null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const infoStyle = computed(() => {
|
||||||
|
return {
|
||||||
|
transform: `translateX(${(!isPlying.value||!props.item.videoUrl)?0:'-110%'})`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const rightStyle = computed(() => {
|
||||||
|
return {
|
||||||
|
transform: `translateX(${(!isPlying.value||!props.item.videoUrl)?'0':60}px)`
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,11 @@
|
||||||
@change="swiperChange" :current="current" :circular="true" vertical class="u-flex-1"
|
@change="swiperChange" :current="current" :circular="true" vertical class="u-flex-1"
|
||||||
@transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200">
|
@transition="transition" :indicator-dots="false" :autoplay="false" :interval="0" :duration="200">
|
||||||
<swiper-item v-for="(item,index) in videoList" :key="index">
|
<swiper-item v-for="(item,index) in videoList" :key="index">
|
||||||
<list-item-vue :total="list.length" :item="item" :isCommand="isCommand"
|
<list-item-vue :total="list.length" :item="item" :isCommand="isCommand" :showControls="control.showControls" :current="current"
|
||||||
:rightStyle="rightStyle" :infoStyle="infoStyle"
|
:isCollect="isCollect" @toDetail="toDetail(item,index)" @controlstoggles="controlstoggles"
|
||||||
:showControls="control.showControls" :current="current" :isCollect="isCollect"
|
:playSpeeds="playSpeeds" :index="index" :nowIndex="nowIndex"
|
||||||
@toDetail="toDetail(item,index)" @controlstoggles="controlstoggles" :playSpeeds="playSpeeds"
|
@dianzanClick="dianzanClick(item,index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)"
|
||||||
:index="index" :nowIndex="nowIndex" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
|
@popupShow="popupShow($event,item,index)"></list-item-vue>
|
||||||
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow"></list-item-vue>
|
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -22,12 +21,12 @@
|
||||||
<cell v-for="(item,index) in list" :key="item.courseDetailsId" :ref="setRefList(index)">
|
<cell v-for="(item,index) in list" :key="item.courseDetailsId" :ref="setRefList(index)">
|
||||||
<view class="swipers-items" :style="boxStyle" @longpress="popupShow('speed')">
|
<view class="swipers-items" :style="boxStyle" @longpress="popupShow('speed')">
|
||||||
<list-item-vue :total="list.length" :item="item" :current="current" :isCollect="isCollect"
|
<list-item-vue :total="list.length" :item="item" :current="current" :isCollect="isCollect"
|
||||||
:rightStyle="rightStyle" :infoStyle="infoStyle"
|
:isCommand="isCommand"
|
||||||
:isCommand="isCommand" :showControls="control.showControls" @toDetail="toDetail(item,index)"
|
:showControls="control.showControls" @toDetail="toDetail(item,index)" @itemMounted="itemMounted"
|
||||||
@itemMounted="itemMounted" @controlstoggles="controlstoggles" :index="index" :instance="instance"
|
@controlstoggles="controlstoggles" :index="index" :instance="instance" :nowIndex="nowIndex"
|
||||||
:nowIndex="nowIndex" @appear="appear($event,item,index)" :playSpeeds="playSpeeds"
|
@appear="appear($event,item,index)" :playSpeeds="playSpeeds" @disappear="disappear(item,index)"
|
||||||
@disappear="disappear(item,index)" @dianzanClick="dianzanClick(item,index)" @share="share(item)"
|
@dianzanClick="dianzanClick(item,index)" @share="share(item)" @zhuijuClick="zhuijuClick(item)"
|
||||||
@zhuijuClick="zhuijuClick(item)" @popupShow="popupShow"></list-item-vue>
|
@popupShow="popupShow($event,item,index)"></list-item-vue>
|
||||||
</view>
|
</view>
|
||||||
</cell>
|
</cell>
|
||||||
</list>
|
</list>
|
||||||
|
|
@ -80,15 +79,19 @@
|
||||||
<text class=" color-999 u-font-24">每日前10次付款均可获取抽奖机会,抽奖保底抽中付款金额等额红包,红包可直接提现。当前为第1次付款</text>
|
<text class=" color-999 u-font-24">每日前10次付款均可获取抽奖机会,抽奖保底抽中付款金额等额红包,红包可直接提现。当前为第1次付款</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="colo-333 pay-list font-bold u-font-28 u-m-t-20">
|
<view class="colo-333 pay-list font-bold u-font-28 u-m-t-20">
|
||||||
<view class="pay-list-item" v-if="info&&info.price" @click="payBtnClick">
|
<view class="pay-list-item" v-if="info&&info.price" @click="payBtnClick('money','all')">
|
||||||
<image class="hot" src="@/static/images/hot.png" mode=""></image>
|
<image class="hot" src="@/static/images/hot.png" mode=""></image>
|
||||||
<text class="u-font-28 font-bold">{{info.price}}元解锁全剧</text>
|
<text class="u-font-28 font-bold">{{info.price}}元解锁全剧</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="pay-list-item" @click="payBtnClick">
|
<view class="pay-list-item" v-if="info&&info.wholesalePrice" @click="payBtnClick('money',10)">
|
||||||
|
<image class="hot" src="@/static/images/hot.png" mode=""></image>
|
||||||
|
<text class="u-font-28 font-bold">{{info.price}}元解锁全剧</text>
|
||||||
|
</view>
|
||||||
|
<view class="pay-list-item" @click="payBtnClick('gold',1)">
|
||||||
<image class="hot" src="@/static/images/hot.png" mode=""></image>
|
<image class="hot" src="@/static/images/hot.png" mode=""></image>
|
||||||
<text class="u-font-28 font-bold">{{nowDanjiPrice*jinbiBili}}金币解锁单集视频</text>
|
<text class="u-font-28 font-bold">{{nowDanjiPrice*jinbiBili}}金币解锁单集视频</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="pay-list-item" @click="payBtnClick">
|
<view class="pay-list-item" @click="payBtnClick('money',1)">
|
||||||
<!-- <image class="hot" src="@/static/images/hot.png" mode=""></image> -->
|
<!-- <image class="hot" src="@/static/images/hot.png" mode=""></image> -->
|
||||||
<text class="u-font-28 font-bold">{{nowDanjiPrice}}元解锁单集视频</text>
|
<text class="u-font-28 font-bold">{{nowDanjiPrice}}元解锁单集视频</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -121,7 +124,8 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-flex-row u-m-t-30 u-flex-y-center u-font-28">
|
<view class="u-flex u-flex-row u-m-t-30 u-flex-y-center u-font-28">
|
||||||
<view class="u-flex-y-center">
|
<view class="u-flex-y-center">
|
||||||
<up-checkbox usedAlone shape="circle" v-model="isAgree" :activeColor="color.main"></up-checkbox>
|
<up-checkbox usedAlone shape="circle" v-model:checked="isAgree"
|
||||||
|
:activeColor="color.main"></up-checkbox>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-flex-row u-flex-y-center">
|
<view class="u-flex u-flex-row u-flex-y-center">
|
||||||
<text class="u-font-28 color-333">我已经阅读并同意</text>
|
<text class="u-font-28 color-333">我已经阅读并同意</text>
|
||||||
|
|
@ -129,7 +133,7 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-30 my-bg-main payConfirm">
|
<view class="u-m-t-30 my-bg-main payConfirm" @click="payConfirm">
|
||||||
<text class="u-font-28 color-fff">确认支付</text>
|
<text class="u-font-28 color-fff">确认支付</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -209,7 +213,7 @@
|
||||||
showControls: true
|
showControls: true
|
||||||
})
|
})
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
control.showControls=false
|
control.showControls = false
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
const customStyle = computed(() => {
|
const customStyle = computed(() => {
|
||||||
|
|
@ -225,9 +229,7 @@
|
||||||
|
|
||||||
function controlstoggles(e) {
|
function controlstoggles(e) {
|
||||||
control.showControls = e.detail.show
|
control.showControls = e.detail.show
|
||||||
console.log(control.showControls );
|
|
||||||
control.showBack = control.showControls
|
control.showBack = control.showControls
|
||||||
console.log(control);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const speeds = reactive({
|
const speeds = reactive({
|
||||||
|
|
@ -287,7 +289,9 @@
|
||||||
show: false,
|
show: false,
|
||||||
pay: false,
|
pay: false,
|
||||||
payTips: false,
|
payTips: false,
|
||||||
speed: false
|
speed: false,
|
||||||
|
data: null,
|
||||||
|
payType: null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -313,21 +317,83 @@
|
||||||
console.log('disappear nowIndex' + nowIndex.value);
|
console.log('disappear nowIndex' + nowIndex.value);
|
||||||
console.log('cacheIndex' + cacheIndex);
|
console.log('cacheIndex' + cacheIndex);
|
||||||
nowIndex.value = cacheIndex
|
nowIndex.value = cacheIndex
|
||||||
|
const item=props.list[nowIndex.value]
|
||||||
|
if (!item.videoUrl) {
|
||||||
|
popupShow('pay', item, nowIndex.value)
|
||||||
|
}
|
||||||
cacheIndex = null
|
cacheIndex = null
|
||||||
console.log('disappear,nowIndex=' + nowIndex.value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//非金币支付
|
||||||
|
async function payOrder(data) {
|
||||||
|
const res = await Api.payOrder(data)
|
||||||
|
if (res) {
|
||||||
|
// #ifdef APP
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
window.location.href = res.h5Url
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//金币支付
|
||||||
|
async function goldPay(data) {
|
||||||
|
console.log(popup.index);
|
||||||
|
const res = await Api.goldPay(data)
|
||||||
|
if (res) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '解锁成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
popupClose()
|
||||||
|
emits('update', {
|
||||||
|
index: popup.index
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
//确认支付
|
//确认支付
|
||||||
function payConfirm() {
|
async function payConfirm() {
|
||||||
if (!isAgree.value) {
|
if (!isAgree.value) {
|
||||||
return infoBox.showToast('请阅读并同意 《付费须知说明》')
|
return infoBox.showToast('请阅读并同意 《付费须知说明》')
|
||||||
}
|
}
|
||||||
|
const [type, num] = popup.payType.split('-');
|
||||||
|
console.log(type, num);
|
||||||
|
let data = {
|
||||||
|
courseId: popup.data.courseId
|
||||||
|
}
|
||||||
|
if (num == 1) {
|
||||||
|
data.courseDetailsId = popup.data.courseDetailsId
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = num == '10' ? await Api.buyTenVideo(data) : await Api.buyVideo(data)
|
||||||
|
if (res) {
|
||||||
|
if (type == 'gold') {
|
||||||
|
goldPay({
|
||||||
|
orderId: res.orders.ordersId
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
payOrder({
|
||||||
|
orderId: res.orders.ordersId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function payBtnClick() {
|
function payBtnClick(type, num) {
|
||||||
popupClose()
|
console.log(type, num);
|
||||||
|
popup.payType = `${type}-${num}`
|
||||||
|
popupClose('show')
|
||||||
popupShow('payTips')
|
popupShow('payTips')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -354,10 +420,13 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
//滚动到指定位置
|
//滚动到指定位置
|
||||||
|
let positonmer = null
|
||||||
|
|
||||||
function goListPosition(index) {
|
function goListPosition(index) {
|
||||||
|
clearTimeout(positonmer)
|
||||||
console.log('goListPosition:' + index)
|
console.log('goListPosition:' + index)
|
||||||
const el = refList.value[index]
|
const el = refList.value[index]
|
||||||
if ($mountedComponents[props.list.length - 1]) {
|
if ($mountedComponents[props.list.length - 1] && $mountedComponents[index]) {
|
||||||
domModule.scrollToElement(el, {
|
domModule.scrollToElement(el, {
|
||||||
animated: false
|
animated: false
|
||||||
})
|
})
|
||||||
|
|
@ -366,9 +435,10 @@
|
||||||
setVideoList(item)
|
setVideoList(item)
|
||||||
insertHistory()
|
insertHistory()
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
// 延迟设置元素位置,(可能视频位置比较靠后数据未渲染完毕)
|
||||||
|
positonmer = setTimeout(() => {
|
||||||
goListPosition(index)
|
goListPosition(index)
|
||||||
}, 30)
|
}, 200)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -384,8 +454,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function popupShow(key = 'show') {
|
function popupShow(key = 'show', item, index) {
|
||||||
|
console.log(item);
|
||||||
popup[key] = true
|
popup[key] = true
|
||||||
|
if (item) {
|
||||||
|
popup.data = item
|
||||||
|
popup.index = index
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -419,22 +494,6 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const posterData = reactive({
|
|
||||||
show: false,
|
|
||||||
// 用户姓名
|
|
||||||
name: '小明',
|
|
||||||
// 用户头像
|
|
||||||
logo: '/static/images/share.png',
|
|
||||||
// 商品名称
|
|
||||||
title: '精美时尚苹果手机一部',
|
|
||||||
// 商品价格
|
|
||||||
money: '5200.90',
|
|
||||||
// 商品图片(小程序需要换成自己服务器白名单设置的地址)
|
|
||||||
img: '',
|
|
||||||
// 商品链接
|
|
||||||
url: 'https://www.apple.com.cn/iphone/'
|
|
||||||
|
|
||||||
})
|
|
||||||
let nowIndex = ref(0)
|
let nowIndex = ref(0)
|
||||||
let current = ref(0)
|
let current = ref(0)
|
||||||
let videoList = ref([])
|
let videoList = ref([])
|
||||||
|
|
@ -537,10 +596,6 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function posterHide() {
|
|
||||||
posterData.show = false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const insertHistory = debounce(() => {
|
const insertHistory = debounce(() => {
|
||||||
|
|
@ -603,7 +658,7 @@
|
||||||
}
|
}
|
||||||
console.log(videoList.value);
|
console.log(videoList.value);
|
||||||
if (!item.videoUrl) {
|
if (!item.videoUrl) {
|
||||||
popupShow('pay')
|
popupShow('pay', item, index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -633,30 +688,7 @@
|
||||||
const nowDanjiPrice = computed(() => {
|
const nowDanjiPrice = computed(() => {
|
||||||
return videoList.value[current.value].price
|
return videoList.value[current.value].price
|
||||||
})
|
})
|
||||||
const rightStyle=computed(()=>{
|
|
||||||
// #ifdef H5
|
|
||||||
return {
|
|
||||||
transform: `translateX(${!control.showControls?'0':60}px)`
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
// #ifdef APP
|
|
||||||
return {
|
|
||||||
transform: `translateX(${control.showControls?'0':60}px)`
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
})
|
|
||||||
const infoStyle=computed(()=>{
|
|
||||||
// #ifdef H5
|
|
||||||
return {
|
|
||||||
transform: `translateX(${!control.showControls?0:'-110%'})`
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
// #ifdef APP
|
|
||||||
return {
|
|
||||||
transform: `translateX(${control.showControls?0:'-110%'})`
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
})
|
|
||||||
function loadmore() {
|
function loadmore() {
|
||||||
console.log('loadmore');
|
console.log('loadmore');
|
||||||
}
|
}
|
||||||
|
|
@ -666,6 +698,16 @@
|
||||||
'width': '750rpx',
|
'width': '750rpx',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function videoListUpdata(){
|
||||||
|
videoList.value=videoList.value.map(v=>{
|
||||||
|
const item=props.list.find(listItem=>listItem.courseDetailsId==v.courseDetailsId)
|
||||||
|
return item?item:v
|
||||||
|
})
|
||||||
|
}
|
||||||
|
defineExpose({
|
||||||
|
videoListUpdata
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
361
http/http.js
361
http/http.js
|
|
@ -1,152 +1,161 @@
|
||||||
// 导入全局属性
|
// 导入全局属性
|
||||||
import { sm4DecryptByResData } from "@/utils/encryptUtil.js";
|
import {
|
||||||
|
sm4DecryptByResData
|
||||||
|
} from "@/utils/encryptUtil.js";
|
||||||
import infoBox from "@/utils/infoBox.js";
|
import infoBox from "@/utils/infoBox.js";
|
||||||
import { reject } from "lodash";
|
import {
|
||||||
|
reject
|
||||||
|
} from "lodash";
|
||||||
import config from "@/commons/config.js";
|
import config from "@/commons/config.js";
|
||||||
// 测试服
|
// 测试服
|
||||||
let baseUrl = config.baseApiUrl + "app";
|
let baseUrl = config.baseApiUrl + "app";
|
||||||
const loadingShowTime = 200;
|
const loadingShowTime = 200;
|
||||||
|
|
||||||
function getHeader() {
|
function getHeader(data) {
|
||||||
const headerObject = {};
|
const header = data ? data.header : {}
|
||||||
headerObject["token"] = uni.getStorageSync("token");
|
const headerObject = {
|
||||||
return headerObject;
|
...header
|
||||||
|
};
|
||||||
|
headerObject["token"] = uni.getStorageSync("token");
|
||||||
|
return headerObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通用处理逻辑
|
// 通用处理逻辑
|
||||||
function commonsProcess(showLoading, httpReqCallback,isreturm) {
|
function commonsProcess(showLoading, httpReqCallback, isreturm) {
|
||||||
// 判断是否请求完成(用作 是否loading )
|
// 判断是否请求完成(用作 是否loading )
|
||||||
// 包括: 'ing', 'ingLoading', 'finish'
|
// 包括: 'ing', 'ingLoading', 'finish'
|
||||||
let reqState = "ing";
|
let reqState = "ing";
|
||||||
// 是否已经提示的错误信息
|
// 是否已经提示的错误信息
|
||||||
let isShowErrorToast = false;
|
let isShowErrorToast = false;
|
||||||
// 请求完成, 需要处理的动作
|
// 请求完成, 需要处理的动作
|
||||||
let reqFinishFunc = () => {
|
let reqFinishFunc = () => {
|
||||||
if (reqState == "ingLoading") {
|
if (reqState == "ingLoading") {
|
||||||
// 关闭loading弹层
|
// 关闭loading弹层
|
||||||
infoBox.hideLoading();
|
infoBox.hideLoading();
|
||||||
}
|
}
|
||||||
reqState = "finish"; // 请求完毕
|
reqState = "finish"; // 请求完毕
|
||||||
};
|
};
|
||||||
// 明确显示loading
|
// 明确显示loading
|
||||||
if (showLoading) {
|
if (showLoading) {
|
||||||
// xx ms内响应完成,不提示loading
|
// xx ms内响应完成,不提示loading
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (reqState == "ing") {
|
if (reqState == "ing") {
|
||||||
reqState = "ingLoading";
|
reqState = "ingLoading";
|
||||||
infoBox.showLoading();
|
infoBox.showLoading();
|
||||||
}
|
}
|
||||||
}, loadingShowTime);
|
}, loadingShowTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
return httpReqCallback()
|
return httpReqCallback()
|
||||||
.then((httpData) => {
|
.then((httpData) => {
|
||||||
console.log(1)
|
|
||||||
reqFinishFunc(); // 请求完毕的动作
|
|
||||||
// 从http响应数据中解构响应数据 [ 响应码、 bodyData ]
|
|
||||||
let { statusCode, data } = httpData;
|
|
||||||
// 避免混淆重新命名
|
|
||||||
let bodyData = data;
|
|
||||||
if(isreturm){
|
|
||||||
return Promise.resolve(bodyData.data || bodyData.page|| bodyData);
|
|
||||||
}
|
|
||||||
if (statusCode == 500) {
|
|
||||||
isShowErrorToast = true;
|
|
||||||
return Promise.reject(bodyData); // 跳转到catch函数
|
|
||||||
}
|
|
||||||
|
|
||||||
if (statusCode == 401) {
|
reqFinishFunc(); // 请求完毕的动作
|
||||||
// 提示信息
|
// 从http响应数据中解构响应数据 [ 响应码、 bodyData ]
|
||||||
isShowErrorToast = true;
|
let {
|
||||||
return Promise.reject(bodyData); // 跳转到catch函数
|
statusCode,
|
||||||
}
|
data
|
||||||
// http响应码不正确
|
} = httpData;
|
||||||
if (statusCode != 200 && statusCode != 204 && statusCode != 201) {
|
// 避免混淆重新命名
|
||||||
isShowErrorToast = true;
|
let bodyData = data;
|
||||||
data.message =
|
if (isreturm) {
|
||||||
data.message == "Bad credentials" ? "用户名或密码错误" : data.message;
|
return Promise.resolve(bodyData.data || bodyData.page || bodyData);
|
||||||
infoBox.showToast(data.message || "服务器异常");
|
}
|
||||||
return Promise.reject(bodyData); // 跳转到catch函数
|
if (statusCode == 500) {
|
||||||
}
|
isShowErrorToast = true;
|
||||||
if (bodyData.code == 401) {
|
return Promise.reject(bodyData); // 跳转到catch函数
|
||||||
// 提示信息
|
}
|
||||||
isShowErrorToast = true;
|
|
||||||
return Promise.reject(bodyData); // 跳转到catch函数
|
|
||||||
}
|
|
||||||
if (bodyData.code == 500) {
|
|
||||||
// 提示信息
|
|
||||||
isShowErrorToast = true;
|
|
||||||
return Promise.reject(bodyData); // 跳转到catch函数
|
|
||||||
}
|
|
||||||
if (bodyData.code != 0) {
|
|
||||||
infoBox.showToast(data.message);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 加密数据
|
if (statusCode == 401) {
|
||||||
if (!bodyData.data && bodyData.encryptData) {
|
// 提示信息
|
||||||
return Promise.resolve({
|
isShowErrorToast = true;
|
||||||
bizData: sm4DecryptByResData(bodyData.encryptData),
|
return Promise.reject(bodyData); // 跳转到catch函数
|
||||||
code: bodyData.code,
|
}
|
||||||
});
|
// http响应码不正确
|
||||||
}
|
if (statusCode != 200 && statusCode != 204 && statusCode != 201) {
|
||||||
|
isShowErrorToast = true;
|
||||||
|
data.message =
|
||||||
|
data.message == "Bad credentials" ? "用户名或密码错误" : data.message;
|
||||||
|
infoBox.showToast(data.message || "服务器异常");
|
||||||
|
return Promise.reject(bodyData); // 跳转到catch函数
|
||||||
|
}
|
||||||
|
if (bodyData.code == 401) {
|
||||||
|
// 提示信息
|
||||||
|
isShowErrorToast = true;
|
||||||
|
return Promise.reject(bodyData); // 跳转到catch函数
|
||||||
|
}
|
||||||
|
if (bodyData.code == 500) {
|
||||||
|
// 提示信息
|
||||||
|
isShowErrorToast = true;
|
||||||
|
return Promise.reject(bodyData); // 跳转到catch函数
|
||||||
|
}
|
||||||
|
if (bodyData.code != 0) {
|
||||||
|
infoBox.showToast(data.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 构造请求成功的响应数据
|
// 加密数据
|
||||||
return Promise.resolve(bodyData.data || bodyData.page|| bodyData);
|
if (!bodyData.data && bodyData.encryptData) {
|
||||||
})
|
return Promise.resolve({
|
||||||
.catch((res) => {
|
bizData: sm4DecryptByResData(bodyData.encryptData),
|
||||||
console.log(2)
|
code: bodyData.code,
|
||||||
if (res.status == 404) {
|
});
|
||||||
infoBox.showToast("接口404").then(() => {});
|
}
|
||||||
reject();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.code == 401) {
|
// 构造请求成功的响应数据
|
||||||
infoBox.showToast(res.message || "请登录").then(() => {
|
return Promise.resolve(bodyData.data || bodyData.page || bodyData);
|
||||||
uni.redirectTo({
|
})
|
||||||
url: "/pages/login/login",
|
.catch((res) => {
|
||||||
});
|
|
||||||
reject();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (res.code != 0) {
|
|
||||||
infoBox.showToast(res.msg).then(() => {});
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
if (res.code == 500) {
|
|
||||||
infoBox.showToast(res.msg || "服务器异常").then(() => {});
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
reqFinishFunc(); // 请求完毕的动作
|
|
||||||
|
|
||||||
// 如果没有提示错误, 那么此处提示 异常。
|
if (res.status == 404) {
|
||||||
if (!isShowErrorToast) {
|
infoBox.showErrorToast("接口404").then(() => {});
|
||||||
infoBox.showToast(`请求网络异常`);
|
reject();
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return Promise.reject(res);
|
if (res.code == 401) {
|
||||||
})
|
infoBox.showErrorToast(res.message || "请登录").then(() => {
|
||||||
.finally(() => {
|
uni.redirectTo({
|
||||||
// finally 是 then结束后再执行, 此处不适用。 需要在请求完成后立马调用: reqFinishFunc()
|
url: "/pages/login/login",
|
||||||
});
|
});
|
||||||
|
reject();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (res.code != 0) {
|
||||||
|
infoBox.showErrorToast(res.msg).then(() => {});
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
if (res.code == 500) {
|
||||||
|
infoBox.showErrorToast(res.msg || "服务器异常").then(() => {});
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
reqFinishFunc(); // 请求完毕的动作
|
||||||
|
|
||||||
|
// 如果没有提示错误, 那么此处提示 异常。
|
||||||
|
if (!isShowErrorToast) {
|
||||||
|
infoBox.showErrorToast(`请求网络异常`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.reject(res);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
// finally 是 then结束后再执行, 此处不适用。 需要在请求完成后立马调用: reqFinishFunc()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 默认 显示loading(控制 xxs 内 不提示loading )
|
// 默认 显示loading(控制 xxs 内 不提示loading )
|
||||||
function req(uri, data, method = "GET", showLoading = true, extParams = {}) {
|
function req(uri, data, method = "GET", showLoading = true, extParams = {}) {
|
||||||
return commonsProcess(showLoading, () => {
|
return commonsProcess(showLoading, () => {
|
||||||
return uni.request(
|
return uni.request(
|
||||||
Object.assign(
|
Object.assign({
|
||||||
{
|
url: baseUrl + uri,
|
||||||
url: baseUrl + uri,
|
data: data,
|
||||||
data: data,
|
method: method,
|
||||||
method: method,
|
header: getHeader(data),
|
||||||
header: getHeader(),
|
},
|
||||||
},
|
extParams
|
||||||
extParams
|
)
|
||||||
)
|
);
|
||||||
);
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 默认 显示loading(控制 xxs 内 不提示loading )
|
// 默认 显示loading(控制 xxs 内 不提示loading )
|
||||||
|
|
@ -158,16 +167,17 @@ function request(args) {
|
||||||
method = "GET",
|
method = "GET",
|
||||||
showLoading = true,
|
showLoading = true,
|
||||||
extParams = {},
|
extParams = {},
|
||||||
isreturm=false
|
isreturm = false
|
||||||
} = args
|
} = args
|
||||||
if (params) {
|
if (params) {
|
||||||
let result = ''
|
let result = ''
|
||||||
Object.keys(params).forEach((key) => {
|
Object.keys(params).forEach((key) => {
|
||||||
if (!Object.is(params[key], undefined) && !Object.is(params[key], null) && !Object.is(JSON.stringify(params[key]), '{}')) {
|
if (!Object.is(params[key], undefined) && !Object.is(params[key], null) && !Object.is(JSON
|
||||||
result += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + "&"
|
.stringify(params[key]), '{}')) {
|
||||||
}
|
result += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + "&"
|
||||||
|
}
|
||||||
})
|
})
|
||||||
url = url+'?'+(result.slice(0,result.length-1))
|
url = url + '?' + (result.slice(0, result.length - 1))
|
||||||
params = null
|
params = null
|
||||||
}
|
}
|
||||||
let headerObject = {}
|
let headerObject = {}
|
||||||
|
|
@ -177,60 +187,59 @@ function request(args) {
|
||||||
url: slash(baseUrl, url),
|
url: slash(baseUrl, url),
|
||||||
data: params || data,
|
data: params || data,
|
||||||
method: method,
|
method: method,
|
||||||
header: getHeader()
|
header: getHeader(data)
|
||||||
}, extParams)
|
}, extParams)
|
||||||
|
|
||||||
)
|
)
|
||||||
},isreturm)
|
}, isreturm)
|
||||||
}
|
}
|
||||||
// 处理/
|
// 处理/
|
||||||
function slash(baseUrl, url) {
|
function slash(baseUrl, url) {
|
||||||
let u = "";
|
let u = "";
|
||||||
if (baseUrl[baseUrl.length - 1] == "/") {
|
if (baseUrl[baseUrl.length - 1] == "/") {
|
||||||
u += baseUrl;
|
u += baseUrl;
|
||||||
} else {
|
} else {
|
||||||
u = u + baseUrl + "/";
|
u = u + baseUrl + "/";
|
||||||
}
|
}
|
||||||
if (url[0] == "/") {
|
if (url[0] == "/") {
|
||||||
u = u + url.slice(1);
|
u = u + url.slice(1);
|
||||||
} else {
|
} else {
|
||||||
u = u + url;
|
u = u + url;
|
||||||
}
|
}
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传
|
// 上传
|
||||||
function upload(uri, data, file, showLoading = true, extParams = {}) {
|
function upload(uri, data, file, showLoading = true, extParams = {}) {
|
||||||
// 放置token
|
// 放置token
|
||||||
let headerObject = {};
|
let headerObject = {};
|
||||||
return commonsProcess(showLoading, () => {
|
return commonsProcess(showLoading, () => {
|
||||||
return uni
|
return uni
|
||||||
.uploadFile(
|
.uploadFile(
|
||||||
Object.assign(
|
Object.assign({
|
||||||
{
|
url: baseUrl + uri,
|
||||||
url: baseUrl + uri,
|
formData: data,
|
||||||
formData: data,
|
name: "file",
|
||||||
name: "file",
|
filePath: file.path || file.url,
|
||||||
filePath: file.path || file.url,
|
header: getHeader(data),
|
||||||
header: getHeader(),
|
},
|
||||||
},
|
extParams
|
||||||
extParams
|
)
|
||||||
)
|
)
|
||||||
)
|
.then((httpData) => {
|
||||||
.then((httpData) => {
|
// uni.upload 返回bodyData 的是 string类型。 需要解析。
|
||||||
// uni.upload 返回bodyData 的是 string类型。 需要解析。
|
httpData.data = JSON.parse(httpData.data);
|
||||||
httpData.data = JSON.parse(httpData.data);
|
return Promise.resolve(httpData);
|
||||||
return Promise.resolve(httpData);
|
})
|
||||||
})
|
.catch((err) => {
|
||||||
.catch((err) => {
|
uni.hideLoading();
|
||||||
uni.hideLoading();
|
infoBox.showErrorToast(`上传失败`);
|
||||||
infoBox.showToast(`上传失败`);
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
req: req,
|
req: req,
|
||||||
request,
|
request,
|
||||||
upload: upload,
|
upload: upload,
|
||||||
};
|
};
|
||||||
|
|
@ -192,6 +192,13 @@
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : "抽奖"
|
"navigationBarTitleText" : "抽奖"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/pays/pays",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|
|
||||||
|
|
@ -45,16 +45,7 @@
|
||||||
<image v-if="datas.isExamine == 0" @click="goMsg('/me/VjgyqAzklr/VjgyqAzklr')" src="@/static/index/red-pack-new.gif"
|
<image v-if="datas.isExamine == 0" @click="goMsg('/me/VjgyqAzklr/VjgyqAzklr')" src="@/static/index/red-pack-new.gif"
|
||||||
style="width: 200rpx;height: 200rpx;position: fixed;right: 10rpx;bottom: 180rpx;" mode=""></image>
|
style="width: 200rpx;height: 200rpx;position: fixed;right: 10rpx;bottom: 180rpx;" mode=""></image>
|
||||||
|
|
||||||
<u-modal :show="datas.ruleShow" v-if="datas.isExamine == 0" confirm-text="知道了" @confirm='datas.ruleShow = false'
|
<u-modal :show="datas.version.show" :confirm-text="datas.version.confirmText" :showCancelButton="datas.version.cancelText" @confirm='confirmUpdateVersion'
|
||||||
:title="datas.rule_title" :title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)">
|
|
||||||
<view class="" style="padding-top: 30rpx;text-align: left;">
|
|
||||||
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
|
||||||
<rich-text style="color:#666" :nodes="datas.rule_content"></rich-text>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</u-modal>
|
|
||||||
|
|
||||||
<u-modal :show="datas.version.show" :confirm-text="datas.version.confirmText" :cancel-text="datas.version.cancelText" :showCancelButton="datas.version.cancelText!=''" @confirm='confirmUpdateVersion'
|
|
||||||
:title="datas.version.title" :title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)" @cancel="datas.version.show = false">
|
:title="datas.version.title" :title-style="{ fontWeight: '700' }" confirm-color="rgb(255, 117, 129)" @cancel="datas.version.show = false">
|
||||||
<view class="" style="padding-top: 30rpx;text-align: left;">
|
<view class="" style="padding-top: 30rpx;text-align: left;">
|
||||||
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
||||||
|
|
@ -62,6 +53,13 @@
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</u-modal>
|
</u-modal>
|
||||||
|
<up-modal :show="datas.ruleShow" v-if="datas.isExamine == 0" confirm-text="知道了" title="规则说明" :title="datas.rule_title" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm" confirm-color="rgb(255, 117, 129)">
|
||||||
|
<view class="u-p-30 u-text-left">
|
||||||
|
<scroll-view scroll-y="true" style="max-height: 50vh;" >
|
||||||
|
<rich-text style="text-align: justify;font-size: 18px;color: #666;" :nodes="datas.rule_content"></rich-text>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</up-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -71,6 +69,7 @@ import {
|
||||||
import { announcement, messageselectMessage, courseselectCourse } from '@/api/index/index.js'
|
import { announcement, messageselectMessage, courseselectCourse } from '@/api/index/index.js'
|
||||||
import {
|
import {
|
||||||
onLoad,
|
onLoad,
|
||||||
|
onReady,
|
||||||
onReachBottom
|
onReachBottom
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
import contentlist from './components/contentlist.vue'
|
import contentlist from './components/contentlist.vue'
|
||||||
|
|
@ -88,6 +87,8 @@ let datas = reactive({
|
||||||
ruleShow: false,
|
ruleShow: false,
|
||||||
rule_title: '', // 首页弹窗标题
|
rule_title: '', // 首页弹窗标题
|
||||||
rule_content: '', // 首页弹窗内容
|
rule_content: '', // 首页弹窗内容
|
||||||
|
ruleIndex: 0,
|
||||||
|
ruleList: [],
|
||||||
|
|
||||||
//ios是否在审核 1是审核
|
//ios是否在审核 1是审核
|
||||||
isExamine: uni.getStorageSync('isExamine'),
|
isExamine: uni.getStorageSync('isExamine'),
|
||||||
|
|
@ -104,9 +105,14 @@ onLoad(() => {
|
||||||
versionUpdate()
|
versionUpdate()
|
||||||
getMsg()
|
getMsg()
|
||||||
getrecomVideo()
|
getrecomVideo()
|
||||||
getPop()
|
|
||||||
})
|
})
|
||||||
|
onReady(() => {
|
||||||
|
announcement({type: 0}).then(res=>{
|
||||||
|
datas.ruleList = res
|
||||||
|
ruleInit()
|
||||||
|
datas.ruleShow = true
|
||||||
|
})
|
||||||
|
})
|
||||||
onReachBottom(() => {
|
onReachBottom(() => {
|
||||||
++datas.page
|
++datas.page
|
||||||
getrecomVideo()
|
getrecomVideo()
|
||||||
|
|
@ -184,6 +190,27 @@ function confirmUpdateVersion(){
|
||||||
plus.runtime.openURL(iosLink, function(res) {});
|
plus.runtime.openURL(iosLink, function(res) {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function ruleInit(){
|
||||||
|
datas.rule_title = datas.ruleList[datas.ruleIndex].title
|
||||||
|
datas.rule_content = datas.ruleList[datas.ruleIndex].content
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 规则确认
|
||||||
|
*/
|
||||||
|
function ruleConfirm() {
|
||||||
|
datas.ruleShow = false
|
||||||
|
datas.ruleIndex++
|
||||||
|
console.log(datas.ruleIndex >= datas.ruleList.length)
|
||||||
|
if( datas.ruleIndex >= datas.ruleList.length) {
|
||||||
|
datas.ruleIndex = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
setTimeout(res=>{
|
||||||
|
ruleInit()
|
||||||
|
datas.ruleShow = true
|
||||||
|
},300)
|
||||||
|
}
|
||||||
|
|
||||||
// 跳转公告链接
|
// 跳转公告链接
|
||||||
function goMsg(url) {
|
function goMsg(url) {
|
||||||
// if (url.indexOf('/pages/') !== -1 || url.indexOf('/me/') !== -1) {
|
// if (url.indexOf('/pages/') !== -1 || url.indexOf('/me/') !== -1) {
|
||||||
|
|
@ -201,15 +228,7 @@ function goMsg(url) {
|
||||||
//#endif
|
//#endif
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
// 获取弹窗信息
|
|
||||||
async function getPop() {
|
|
||||||
let res = await announcement()
|
|
||||||
if (res.state == 1) {
|
|
||||||
datas.ruleShow = true
|
|
||||||
datas.rule_title = res.title
|
|
||||||
datas.rule_content = res.content
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 搜索跳转
|
// 搜索跳转
|
||||||
function moreVideo() {
|
function moreVideo() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
|
||||||
|
|
@ -162,12 +162,11 @@ function toTask() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {});
|
||||||
|
onShow(() => {
|
||||||
selectByUserIdAjax();
|
selectByUserIdAjax();
|
||||||
collectVideoSummaryAjax();
|
collectVideoSummaryAjax();
|
||||||
selectUserMoneyAjax();
|
selectUserMoneyAjax();
|
||||||
});
|
|
||||||
onShow(() => {
|
|
||||||
userInfo.value = uni.getStorageSync('userInfo');
|
userInfo.value = uni.getStorageSync('userInfo');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<up-navbar title="申请提现"
|
<up-navbar title="申请提现"
|
||||||
@rightClick="data.ruleShow = true"
|
|
||||||
bgColor="rgb(255, 117, 129)"
|
bgColor="rgb(255, 117, 129)"
|
||||||
leftIconColor="#FFF"
|
leftIconColor="#FFF"
|
||||||
:titleStyle ="{color:'#FFF'}" >
|
:titleStyle ="{color:'#FFF'}" >
|
||||||
<template #right>
|
<template #right>
|
||||||
<view class="u-p-r-30 u-flex u-col-center" style="color: #fff;">
|
<view class="u-p-r-30 u-flex u-col-center" style="color: #fff;">
|
||||||
<text class="rule-btn" @click="data.ruleShow = true">规则</text>
|
<text class="rule-btn" @click="showRule">规则</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</up-navbar>
|
</up-navbar>
|
||||||
|
|
@ -72,13 +71,13 @@
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<up-modal :show="data.ruleShow" confirm-text="知道了" title="规则说明" :title-style="{fontWeight:'700'}" @confirm="data.ruleShow=false" confirm-color="rgb(255, 117, 129)">
|
|
||||||
|
<up-modal :show="data.ruleShow" confirm-text="知道了" title="规则说明" :title="data.rule_title" :title-style="{fontWeight:'700'}" @confirm="ruleConfirm" confirm-color="rgb(255, 117, 129)">
|
||||||
<view class="u-p-30 u-text-left">
|
<view class="u-p-30 u-text-left">
|
||||||
<scroll-view scroll-y="true" style="max-height: 50vh;" >
|
<scroll-view scroll-y="true" style="max-height: 50vh;" >
|
||||||
<rich-text style="text-align: justify;font-size: 18px;color: #666;" :nodes="data.ruleInfo"></rich-text>
|
<rich-text style="text-align: justify;font-size: 18px;color: #666;" :nodes="data.rule_content"></rich-text>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</up-modal>
|
</up-modal>
|
||||||
|
|
||||||
<view style="width: 0;height: 0;overflow: hidden;">
|
<view style="width: 0;height: 0;overflow: hidden;">
|
||||||
|
|
@ -96,27 +95,14 @@
|
||||||
import { onReady,onLoad,onShow,onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
import { onReady,onLoad,onShow,onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||||
import { selectUserMoney, selectPayDetails, canCash, state, withdraw } from '@/api/me/withdraw.js';
|
import { selectUserMoney, selectPayDetails, canCash, state, withdraw } from '@/api/me/withdraw.js';
|
||||||
import { selectUserById } from '@/api/user/user.js';
|
import { selectUserById } from '@/api/user/user.js';
|
||||||
|
import { announcement } from '@/api/index/index.js';
|
||||||
import { commonType } from '@/api/init.js';
|
import { commonType } from '@/api/init.js';
|
||||||
import { linkTo } from '@/utils/app.js';
|
import { linkTo } from '@/utils/app.js';
|
||||||
|
|
||||||
let data = reactive({
|
let data = reactive({
|
||||||
ruleShow: true,
|
ruleShow: true,
|
||||||
ruleInfo: `
|
rule_title: "",
|
||||||
用户在平台中对奖励提现的,适用以下规则:
|
rule_content: "",
|
||||||
<br/>
|
|
||||||
<br/>
|
|
||||||
1,用户的收益达到最低提现金额要求后,可以申请提现,每日只可以提现一笔。
|
|
||||||
<br/>
|
|
||||||
2,用户需要通过支付宝提现,需按照要求绑定支付宝账号并填写提现金额或其他提现所需信息,请确保提供的信息准确无误,以免提现失败。
|
|
||||||
<br/>
|
|
||||||
3,如果用户发现显示「提现失败」,需确认当前填写或绑定的支付宝账号或银行卡账号是否正确,以及支付宝账号是否可用。如果用户发现显示「提现成功」但没到账
|
|
||||||
<br/>
|
|
||||||
(1)如果用户有多个支付宝账号,请检查用户是否提现到了其他支付宝账号。
|
|
||||||
<br/>
|
|
||||||
(2)高峰期提现人数多会导致网络拥堵,显示提现成功之后72小时内属于正常现象,请耐心等候。
|
|
||||||
<br/>
|
|
||||||
4,每日08:00至次日18:00为提现时间,活动的对应奖励可能延迟到账。提现通常会在72小时内到账,如遇双休日、节假日,提现到账时间可能会延长。活动高峰期间,由于网络拥堵,用户可能存在短时间内无法提现的情况。平台将尽最大努力及时恢复提现功能,但无需因此承担任何责任。
|
|
||||||
<br/>`,
|
|
||||||
money: '',
|
money: '',
|
||||||
mayMoney: '0',
|
mayMoney: '0',
|
||||||
list: [],
|
list: [],
|
||||||
|
|
@ -129,16 +115,24 @@
|
||||||
adRewardedVideoloadNum: 0,
|
adRewardedVideoloadNum: 0,
|
||||||
isWithdraw: false,
|
isWithdraw: false,
|
||||||
userInfo: null,
|
userInfo: null,
|
||||||
|
ruleIndex: 0,
|
||||||
|
ruleList: []
|
||||||
})
|
})
|
||||||
|
|
||||||
const adRewarded = ref(null);
|
const adRewarded = ref(null);
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getExtractFei();
|
getExtractFei();
|
||||||
getMoneyDetail();
|
getMoneyDetail();
|
||||||
|
|
||||||
})
|
})
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
getcashMoney()
|
getcashMoney()
|
||||||
getUserInfo();
|
getUserInfo();
|
||||||
|
announcement({type: 1}).then(res=>{
|
||||||
|
data.ruleList = res
|
||||||
|
ruleInit()
|
||||||
|
data.ruleShow = true
|
||||||
|
})
|
||||||
})
|
})
|
||||||
onReady(() => {
|
onReady(() => {
|
||||||
nextTick(()=>{
|
nextTick(()=>{
|
||||||
|
|
@ -150,14 +144,49 @@
|
||||||
onReachBottom(() => {
|
onReachBottom(() => {
|
||||||
if (data.page * data.limit < data.totalCount) {
|
if (data.page * data.limit < data.totalCount) {
|
||||||
data.page = data.page + 1;
|
data.page = data.page + 1;
|
||||||
data.getMoneyDetail();
|
getMoneyDetail();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
onPullDownRefresh(() => {
|
onPullDownRefresh(() => {
|
||||||
data.page = 1;
|
data.page = 1;
|
||||||
data.list = []
|
data.list = []
|
||||||
data.getMoneyDetail();
|
getMoneyDetail();
|
||||||
})
|
})
|
||||||
|
function ruleInit(){
|
||||||
|
data.rule_title = data.ruleList[data.ruleIndex].title
|
||||||
|
data.rule_content = data.ruleList[data.ruleIndex].content
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 规则弹窗打开
|
||||||
|
*/
|
||||||
|
function showRule() {
|
||||||
|
if( data.ruleList.length <= 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "暂未配置规则",
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ruleInit()
|
||||||
|
data.ruleShow = true
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 规则确认
|
||||||
|
*/
|
||||||
|
function ruleConfirm() {
|
||||||
|
data.ruleShow = false
|
||||||
|
data.ruleIndex++
|
||||||
|
console.log(data.ruleIndex >= data.ruleList.length)
|
||||||
|
if( data.ruleIndex >= data.ruleList.length) {
|
||||||
|
data.ruleIndex = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
setTimeout(res=>{
|
||||||
|
ruleInit()
|
||||||
|
data.ruleShow = true
|
||||||
|
},300)
|
||||||
|
}
|
||||||
|
|
||||||
function getUserInfo() {
|
function getUserInfo() {
|
||||||
selectUserById().then(res=>{
|
selectUserById().then(res=>{
|
||||||
data.userInfo = res;
|
data.userInfo = res;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
<template>
|
||||||
|
<view style="width: 100%;">
|
||||||
|
<web-view id="webview" :src="state.url" style="width: 100%;"></web-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
reactive
|
||||||
|
} from 'vue'
|
||||||
|
import {
|
||||||
|
onShow,onHide,onUnload,onLoad
|
||||||
|
} from '@dcloudio/uni-app'
|
||||||
|
import {
|
||||||
|
getOrderInfo
|
||||||
|
} from '@/api/video/index.js'
|
||||||
|
const state = reactive({
|
||||||
|
orderId: '',
|
||||||
|
timer: null,
|
||||||
|
maxAjaxNum: 5,
|
||||||
|
ajaxNum: 0,
|
||||||
|
url: null, //要打开的外部链接
|
||||||
|
viewerUrl: '/hybrid/html/web/viewer.html',
|
||||||
|
webviewStyles: {
|
||||||
|
width: '750px',
|
||||||
|
height: '100%',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function getOrder() {
|
||||||
|
getOrderInfo({
|
||||||
|
orderId: state.orderId
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data == 1) {
|
||||||
|
uni.hideLoading()
|
||||||
|
const sysInfo = uni.getSystemInfoSync();
|
||||||
|
let isIos = sysInfo.platform == 'ios'
|
||||||
|
if (isIos) {
|
||||||
|
uni.navigateBack()
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1500)
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
state.timer = setTimeout(() => {
|
||||||
|
clearTimeout(state.timer)
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// #ifdef APP
|
||||||
|
uni.showLoading({
|
||||||
|
title: '支付中'
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onShow(() => {
|
||||||
|
getOrder()
|
||||||
|
})
|
||||||
|
onHide(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
})
|
||||||
|
onUnload(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
})
|
||||||
|
onLoad((option) => {
|
||||||
|
console.log(option);
|
||||||
|
state.url = option.url
|
||||||
|
state.orderId = option.orderId
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.webview {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="min-page">
|
<view class="min-page">
|
||||||
<my-video-list v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
|
<my-video-list ref="refVideoList" v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
|
||||||
:info="state"
|
:info="state"></my-video-list>
|
||||||
></my-video-list>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -13,13 +12,13 @@
|
||||||
} from '@dcloudio/uni-app'
|
} from '@dcloudio/uni-app'
|
||||||
import * as Api from '@/api/video/index.js'
|
import * as Api from '@/api/video/index.js'
|
||||||
import {
|
import {
|
||||||
reactive
|
reactive, ref
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import {
|
import {
|
||||||
slice
|
slice
|
||||||
} from 'lodash'
|
} from 'lodash'
|
||||||
const boxStyle={
|
const boxStyle = {
|
||||||
height:'835px'
|
height: '835px'
|
||||||
}
|
}
|
||||||
let options = {}
|
let options = {}
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
|
@ -29,6 +28,7 @@
|
||||||
price: 0,
|
price: 0,
|
||||||
title: ''
|
title: ''
|
||||||
})
|
})
|
||||||
|
const refVideoList=ref(null)
|
||||||
async function init() {
|
async function init() {
|
||||||
try {
|
try {
|
||||||
const res = await Api.getVideoDetail(options)
|
const res = await Api.getVideoDetail(options)
|
||||||
|
|
@ -44,8 +44,17 @@
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function update({index,item}){
|
|
||||||
state.list[index]=item
|
async function update({
|
||||||
|
index,
|
||||||
|
item
|
||||||
|
}) {
|
||||||
|
if(item){
|
||||||
|
state.list[index] = item
|
||||||
|
}else{
|
||||||
|
await init()
|
||||||
|
refVideoList.value.videoListUpdata()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onLoad((opt) => {
|
onLoad((opt) => {
|
||||||
Object.assign(options, opt)
|
Object.assign(options, opt)
|
||||||
|
|
@ -56,11 +65,10 @@
|
||||||
current,
|
current,
|
||||||
direction,
|
direction,
|
||||||
data
|
data
|
||||||
}) {
|
}) {}
|
||||||
}
|
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
init()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -71,8 +79,8 @@
|
||||||
background-color: #000;
|
background-color: #000;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.u-popup{
|
|
||||||
|
.u-popup {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
Loading…
Reference in New Issue