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>
|
||||
|
||||
<video class="u-flex-1 video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
|
||||
@waiting="waiting()" object-fit="cover"
|
||||
@pause="onpause"
|
||||
@waiting="waiting()" object-fit="cover" @pause="onpause" @click="videoClick()"
|
||||
@play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2"
|
||||
: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"
|
||||
: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>
|
||||
|
||||
<view class="info" v-if="!isCommand" :style="infoStyle">
|
||||
|
|
@ -43,8 +43,8 @@
|
|||
<text class="text color-fff u-font-24">分享</text>
|
||||
</view>
|
||||
<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-else src="@/static/images/shuqian_s.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.png" mode=""></image>
|
||||
<text class="text color-fff u-font-24">{{isCollect?'已追':'追剧'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -132,11 +132,10 @@
|
|||
let autoplay = ref(props.item.videoUrl ? true : false)
|
||||
|
||||
const emits = defineEmits(['controlstoggles', 'disappear', 'appear', 'waiting', 'videoPlay', 'ended', 'dianzanClick',
|
||||
'share', 'zhuijuClick', 'popupShow', 'itemMounted', 'toDetail'
|
||||
'share', 'zhuijuClick', 'popupShow', 'itemMounted', 'toDetail', 'showInfo'
|
||||
])
|
||||
|
||||
function controlstoggles(e) {
|
||||
console.log(e);
|
||||
emits('controlstoggles', e)
|
||||
}
|
||||
|
||||
|
|
@ -151,23 +150,38 @@
|
|||
|
||||
}
|
||||
|
||||
|
||||
let isPlying = ref(false)
|
||||
watch(() => isPlying.value, (newval) => {
|
||||
console.log(newval);
|
||||
emits('showInfo', newval)
|
||||
})
|
||||
|
||||
function videoPlay() {
|
||||
isPlying.value = true
|
||||
// #ifdef H5
|
||||
emits('controlstoggles', {
|
||||
detail:{show:true}
|
||||
detail: {
|
||||
show: true
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
|
||||
}
|
||||
|
||||
function onpause() {
|
||||
isPlying.value = false
|
||||
// #ifdef H5
|
||||
emits('controlstoggles', {
|
||||
detail:{show:false}
|
||||
detail: {
|
||||
show: false
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
function ended() {
|
||||
|
||||
}
|
||||
|
|
@ -188,6 +202,17 @@
|
|||
emits('popupShow', key)
|
||||
}
|
||||
|
||||
function videoClick() {
|
||||
console.log('videoClick');
|
||||
if (video) {
|
||||
if (isPlying.value) {
|
||||
video.pause()
|
||||
} else {
|
||||
video.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let first = true
|
||||
|
||||
function appear() {
|
||||
|
|
@ -227,6 +252,8 @@
|
|||
if (props.item.videoUrl && showVideo.value) {
|
||||
video = uni.createVideoContext('myVideo' + props.item.courseDetailsId)
|
||||
video.playbackRate(props.playSpeeds)
|
||||
video.play()
|
||||
console.log('init play');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('------')
|
||||
|
|
@ -240,13 +267,28 @@
|
|||
}
|
||||
})
|
||||
watch(() => showVideo.value, (newval) => {
|
||||
console.log('showVideo change:'+newval);
|
||||
if (newval) {
|
||||
nextTick(()=>{
|
||||
init()
|
||||
})
|
||||
} else {
|
||||
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>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -5,12 +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"
|
||||
:rightStyle="rightStyle" :infoStyle="infoStyle"
|
||||
: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"></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>
|
||||
|
|
@ -22,12 +21,12 @@
|
|||
<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"
|
||||
:rightStyle="rightStyle" :infoStyle="infoStyle"
|
||||
: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"></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>
|
||||
|
|
@ -80,15 +79,19 @@
|
|||
<text class=" color-999 u-font-24">每日前10次付款均可获取抽奖机会,抽奖保底抽中付款金额等额红包,红包可直接提现。当前为第1次付款</text>
|
||||
</view>
|
||||
<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>
|
||||
<text class="u-font-28 font-bold">{{info.price}}元解锁全剧</text>
|
||||
</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>
|
||||
<text class="u-font-28 font-bold">{{nowDanjiPrice*jinbiBili}}金币解锁单集视频</text>
|
||||
</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> -->
|
||||
<text class="u-font-28 font-bold">{{nowDanjiPrice}}元解锁单集视频</text>
|
||||
</view>
|
||||
|
|
@ -121,7 +124,8 @@
|
|||
</view>
|
||||
<view class="u-flex u-flex-row u-m-t-30 u-flex-y-center u-font-28">
|
||||
<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 class="u-flex u-flex-row u-flex-y-center">
|
||||
<text class="u-font-28 color-333">我已经阅读并同意</text>
|
||||
|
|
@ -129,7 +133,7 @@
|
|||
</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>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -225,9 +229,7 @@
|
|||
|
||||
function controlstoggles(e) {
|
||||
control.showControls = e.detail.show
|
||||
console.log(control.showControls );
|
||||
control.showBack = control.showControls
|
||||
console.log(control);
|
||||
}
|
||||
|
||||
const speeds = reactive({
|
||||
|
|
@ -287,7 +289,9 @@
|
|||
show: false,
|
||||
pay: false,
|
||||
payTips: false,
|
||||
speed: false
|
||||
speed: false,
|
||||
data: null,
|
||||
payType: null
|
||||
})
|
||||
|
||||
|
||||
|
|
@ -313,21 +317,83 @@
|
|||
console.log('disappear nowIndex' + nowIndex.value);
|
||||
console.log('cacheIndex' + cacheIndex);
|
||||
nowIndex.value = cacheIndex
|
||||
const item=props.list[nowIndex.value]
|
||||
if (!item.videoUrl) {
|
||||
popupShow('pay', item, nowIndex.value)
|
||||
}
|
||||
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) {
|
||||
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
|
||||
}
|
||||
|
||||
function payBtnClick() {
|
||||
popupClose()
|
||||
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(type, num) {
|
||||
console.log(type, num);
|
||||
popup.payType = `${type}-${num}`
|
||||
popupClose('show')
|
||||
popupShow('payTips')
|
||||
}
|
||||
|
||||
|
|
@ -354,10 +420,13 @@
|
|||
};
|
||||
}
|
||||
//滚动到指定位置
|
||||
let positonmer = null
|
||||
|
||||
function goListPosition(index) {
|
||||
clearTimeout(positonmer)
|
||||
console.log('goListPosition:' + index)
|
||||
const el = refList.value[index]
|
||||
if ($mountedComponents[props.list.length - 1]) {
|
||||
if ($mountedComponents[props.list.length - 1] && $mountedComponents[index]) {
|
||||
domModule.scrollToElement(el, {
|
||||
animated: false
|
||||
})
|
||||
|
|
@ -366,9 +435,10 @@
|
|||
setVideoList(item)
|
||||
insertHistory()
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
// 延迟设置元素位置,(可能视频位置比较靠后数据未渲染完毕)
|
||||
positonmer = setTimeout(() => {
|
||||
goListPosition(index)
|
||||
}, 30)
|
||||
}, 200)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -384,8 +454,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
function popupShow(key = 'show') {
|
||||
function popupShow(key = 'show', item, index) {
|
||||
console.log(item);
|
||||
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 current = ref(0)
|
||||
let videoList = ref([])
|
||||
|
|
@ -537,10 +596,6 @@
|
|||
|
||||
}
|
||||
|
||||
function posterHide() {
|
||||
posterData.show = false
|
||||
}
|
||||
|
||||
|
||||
|
||||
const insertHistory = debounce(() => {
|
||||
|
|
@ -603,7 +658,7 @@
|
|||
}
|
||||
console.log(videoList.value);
|
||||
if (!item.videoUrl) {
|
||||
popupShow('pay')
|
||||
popupShow('pay', item, index)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -633,30 +688,7 @@
|
|||
const nowDanjiPrice = computed(() => {
|
||||
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() {
|
||||
console.log('loadmore');
|
||||
}
|
||||
|
|
@ -666,6 +698,16 @@
|
|||
'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>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
51
http/http.js
51
http/http.js
|
|
@ -1,14 +1,21 @@
|
|||
// 导入全局属性
|
||||
import { sm4DecryptByResData } from "@/utils/encryptUtil.js";
|
||||
import {
|
||||
sm4DecryptByResData
|
||||
} from "@/utils/encryptUtil.js";
|
||||
import infoBox from "@/utils/infoBox.js";
|
||||
import { reject } from "lodash";
|
||||
import {
|
||||
reject
|
||||
} from "lodash";
|
||||
import config from "@/commons/config.js";
|
||||
// 测试服
|
||||
let baseUrl = config.baseApiUrl + "app";
|
||||
const loadingShowTime = 200;
|
||||
|
||||
function getHeader() {
|
||||
const headerObject = {};
|
||||
function getHeader(data) {
|
||||
const header = data ? data.header : {}
|
||||
const headerObject = {
|
||||
...header
|
||||
};
|
||||
headerObject["token"] = uni.getStorageSync("token");
|
||||
return headerObject;
|
||||
}
|
||||
|
|
@ -41,10 +48,13 @@ function commonsProcess(showLoading, httpReqCallback,isreturm) {
|
|||
|
||||
return httpReqCallback()
|
||||
.then((httpData) => {
|
||||
console.log(1)
|
||||
|
||||
reqFinishFunc(); // 请求完毕的动作
|
||||
// 从http响应数据中解构响应数据 [ 响应码、 bodyData ]
|
||||
let { statusCode, data } = httpData;
|
||||
let {
|
||||
statusCode,
|
||||
data
|
||||
} = httpData;
|
||||
// 避免混淆重新命名
|
||||
let bodyData = data;
|
||||
if (isreturm) {
|
||||
|
|
@ -95,15 +105,15 @@ function commonsProcess(showLoading, httpReqCallback,isreturm) {
|
|||
return Promise.resolve(bodyData.data || bodyData.page || bodyData);
|
||||
})
|
||||
.catch((res) => {
|
||||
console.log(2)
|
||||
|
||||
if (res.status == 404) {
|
||||
infoBox.showToast("接口404").then(() => {});
|
||||
infoBox.showErrorToast("接口404").then(() => {});
|
||||
reject();
|
||||
return;
|
||||
}
|
||||
|
||||
if (res.code == 401) {
|
||||
infoBox.showToast(res.message || "请登录").then(() => {
|
||||
infoBox.showErrorToast(res.message || "请登录").then(() => {
|
||||
uni.redirectTo({
|
||||
url: "/pages/login/login",
|
||||
});
|
||||
|
|
@ -111,18 +121,18 @@ function commonsProcess(showLoading, httpReqCallback,isreturm) {
|
|||
});
|
||||
}
|
||||
if (res.code != 0) {
|
||||
infoBox.showToast(res.msg).then(() => {});
|
||||
infoBox.showErrorToast(res.msg).then(() => {});
|
||||
reject();
|
||||
}
|
||||
if (res.code == 500) {
|
||||
infoBox.showToast(res.msg || "服务器异常").then(() => {});
|
||||
infoBox.showErrorToast(res.msg || "服务器异常").then(() => {});
|
||||
reject();
|
||||
}
|
||||
reqFinishFunc(); // 请求完毕的动作
|
||||
|
||||
// 如果没有提示错误, 那么此处提示 异常。
|
||||
if (!isShowErrorToast) {
|
||||
infoBox.showToast(`请求网络异常`);
|
||||
infoBox.showErrorToast(`请求网络异常`);
|
||||
}
|
||||
|
||||
return Promise.reject(res);
|
||||
|
|
@ -136,12 +146,11 @@ function commonsProcess(showLoading, httpReqCallback,isreturm) {
|
|||
function req(uri, data, method = "GET", showLoading = true, extParams = {}) {
|
||||
return commonsProcess(showLoading, () => {
|
||||
return uni.request(
|
||||
Object.assign(
|
||||
{
|
||||
Object.assign({
|
||||
url: baseUrl + uri,
|
||||
data: data,
|
||||
method: method,
|
||||
header: getHeader(),
|
||||
header: getHeader(data),
|
||||
},
|
||||
extParams
|
||||
)
|
||||
|
|
@ -163,7 +172,8 @@ function request(args) {
|
|||
if (params) {
|
||||
let result = ''
|
||||
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
|
||||
.stringify(params[key]), '{}')) {
|
||||
result += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + "&"
|
||||
}
|
||||
})
|
||||
|
|
@ -177,7 +187,7 @@ function request(args) {
|
|||
url: slash(baseUrl, url),
|
||||
data: params || data,
|
||||
method: method,
|
||||
header: getHeader()
|
||||
header: getHeader(data)
|
||||
}, extParams)
|
||||
|
||||
)
|
||||
|
|
@ -206,13 +216,12 @@ function upload(uri, data, file, showLoading = true, extParams = {}) {
|
|||
return commonsProcess(showLoading, () => {
|
||||
return uni
|
||||
.uploadFile(
|
||||
Object.assign(
|
||||
{
|
||||
Object.assign({
|
||||
url: baseUrl + uri,
|
||||
formData: data,
|
||||
name: "file",
|
||||
filePath: file.path || file.url,
|
||||
header: getHeader(),
|
||||
header: getHeader(data),
|
||||
},
|
||||
extParams
|
||||
)
|
||||
|
|
@ -224,7 +233,7 @@ function upload(uri, data, file, showLoading = true, extParams = {}) {
|
|||
})
|
||||
.catch((err) => {
|
||||
uni.hideLoading();
|
||||
infoBox.showToast(`上传失败`);
|
||||
infoBox.showErrorToast(`上传失败`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,6 +192,13 @@
|
|||
{
|
||||
"navigationBarTitleText" : "抽奖"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/pays/pays",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
|
|
|||
|
|
@ -45,16 +45,7 @@
|
|||
<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>
|
||||
|
||||
<u-modal :show="datas.ruleShow" v-if="datas.isExamine == 0" confirm-text="知道了" @confirm='datas.ruleShow = false'
|
||||
: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'
|
||||
<u-modal :show="datas.version.show" :confirm-text="datas.version.confirmText" :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">
|
||||
<view class="" style="padding-top: 30rpx;text-align: left;">
|
||||
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
||||
|
|
@ -62,6 +53,13 @@
|
|||
</scroll-view>
|
||||
</view>
|
||||
</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>
|
||||
|
||||
<script setup>
|
||||
|
|
@ -71,6 +69,7 @@ import {
|
|||
import { announcement, messageselectMessage, courseselectCourse } from '@/api/index/index.js'
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onReachBottom
|
||||
} from '@dcloudio/uni-app'
|
||||
import contentlist from './components/contentlist.vue'
|
||||
|
|
@ -88,6 +87,8 @@ let datas = reactive({
|
|||
ruleShow: false,
|
||||
rule_title: '', // 首页弹窗标题
|
||||
rule_content: '', // 首页弹窗内容
|
||||
ruleIndex: 0,
|
||||
ruleList: [],
|
||||
|
||||
//ios是否在审核 1是审核
|
||||
isExamine: uni.getStorageSync('isExamine'),
|
||||
|
|
@ -104,9 +105,14 @@ onLoad(() => {
|
|||
versionUpdate()
|
||||
getMsg()
|
||||
getrecomVideo()
|
||||
getPop()
|
||||
})
|
||||
|
||||
onReady(() => {
|
||||
announcement({type: 0}).then(res=>{
|
||||
datas.ruleList = res
|
||||
ruleInit()
|
||||
datas.ruleShow = true
|
||||
})
|
||||
})
|
||||
onReachBottom(() => {
|
||||
++datas.page
|
||||
getrecomVideo()
|
||||
|
|
@ -184,6 +190,27 @@ function confirmUpdateVersion(){
|
|||
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) {
|
||||
// if (url.indexOf('/pages/') !== -1 || url.indexOf('/me/') !== -1) {
|
||||
|
|
@ -201,15 +228,7 @@ function goMsg(url) {
|
|||
//#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() {
|
||||
uni.navigateTo({
|
||||
|
|
|
|||
|
|
@ -162,12 +162,11 @@ function toTask() {
|
|||
});
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
onLoad(() => {});
|
||||
onShow(() => {
|
||||
selectByUserIdAjax();
|
||||
collectVideoSummaryAjax();
|
||||
selectUserMoneyAjax();
|
||||
});
|
||||
onShow(() => {
|
||||
userInfo.value = uni.getStorageSync('userInfo');
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<up-navbar title="申请提现"
|
||||
@rightClick="data.ruleShow = true"
|
||||
bgColor="rgb(255, 117, 129)"
|
||||
leftIconColor="#FFF"
|
||||
:titleStyle ="{color:'#FFF'}" >
|
||||
<template #right>
|
||||
<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>
|
||||
</template>
|
||||
</up-navbar>
|
||||
|
|
@ -72,13 +71,13 @@
|
|||
|
||||
</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">
|
||||
<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>
|
||||
</view>
|
||||
|
||||
</up-modal>
|
||||
|
||||
<view style="width: 0;height: 0;overflow: hidden;">
|
||||
|
|
@ -96,27 +95,14 @@
|
|||
import { onReady,onLoad,onShow,onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||
import { selectUserMoney, selectPayDetails, canCash, state, withdraw } from '@/api/me/withdraw.js';
|
||||
import { selectUserById } from '@/api/user/user.js';
|
||||
import { announcement } from '@/api/index/index.js';
|
||||
import { commonType } from '@/api/init.js';
|
||||
import { linkTo } from '@/utils/app.js';
|
||||
|
||||
let data = reactive({
|
||||
ruleShow: true,
|
||||
ruleInfo: `
|
||||
用户在平台中对奖励提现的,适用以下规则:
|
||||
<br/>
|
||||
<br/>
|
||||
1,用户的收益达到最低提现金额要求后,可以申请提现,每日只可以提现一笔。
|
||||
<br/>
|
||||
2,用户需要通过支付宝提现,需按照要求绑定支付宝账号并填写提现金额或其他提现所需信息,请确保提供的信息准确无误,以免提现失败。
|
||||
<br/>
|
||||
3,如果用户发现显示「提现失败」,需确认当前填写或绑定的支付宝账号或银行卡账号是否正确,以及支付宝账号是否可用。如果用户发现显示「提现成功」但没到账
|
||||
<br/>
|
||||
(1)如果用户有多个支付宝账号,请检查用户是否提现到了其他支付宝账号。
|
||||
<br/>
|
||||
(2)高峰期提现人数多会导致网络拥堵,显示提现成功之后72小时内属于正常现象,请耐心等候。
|
||||
<br/>
|
||||
4,每日08:00至次日18:00为提现时间,活动的对应奖励可能延迟到账。提现通常会在72小时内到账,如遇双休日、节假日,提现到账时间可能会延长。活动高峰期间,由于网络拥堵,用户可能存在短时间内无法提现的情况。平台将尽最大努力及时恢复提现功能,但无需因此承担任何责任。
|
||||
<br/>`,
|
||||
rule_title: "",
|
||||
rule_content: "",
|
||||
money: '',
|
||||
mayMoney: '0',
|
||||
list: [],
|
||||
|
|
@ -129,16 +115,24 @@
|
|||
adRewardedVideoloadNum: 0,
|
||||
isWithdraw: false,
|
||||
userInfo: null,
|
||||
ruleIndex: 0,
|
||||
ruleList: []
|
||||
})
|
||||
|
||||
const adRewarded = ref(null);
|
||||
onLoad(() => {
|
||||
getExtractFei();
|
||||
getMoneyDetail();
|
||||
|
||||
})
|
||||
onShow(() => {
|
||||
getcashMoney()
|
||||
getUserInfo();
|
||||
announcement({type: 1}).then(res=>{
|
||||
data.ruleList = res
|
||||
ruleInit()
|
||||
data.ruleShow = true
|
||||
})
|
||||
})
|
||||
onReady(() => {
|
||||
nextTick(()=>{
|
||||
|
|
@ -150,14 +144,49 @@
|
|||
onReachBottom(() => {
|
||||
if (data.page * data.limit < data.totalCount) {
|
||||
data.page = data.page + 1;
|
||||
data.getMoneyDetail();
|
||||
getMoneyDetail();
|
||||
}
|
||||
})
|
||||
onPullDownRefresh(() => {
|
||||
data.page = 1;
|
||||
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() {
|
||||
selectUserById().then(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>
|
||||
<view class="min-page">
|
||||
<my-video-list v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
|
||||
:info="state"
|
||||
></my-video-list>
|
||||
<my-video-list ref="refVideoList" v-if="state.list.length" @swiperChange="swiperChange" :list="state.list" @update="update"
|
||||
:info="state"></my-video-list>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -13,7 +12,7 @@
|
|||
} from '@dcloudio/uni-app'
|
||||
import * as Api from '@/api/video/index.js'
|
||||
import {
|
||||
reactive
|
||||
reactive, ref
|
||||
} from 'vue'
|
||||
import {
|
||||
slice
|
||||
|
|
@ -29,6 +28,7 @@
|
|||
price: 0,
|
||||
title: ''
|
||||
})
|
||||
const refVideoList=ref(null)
|
||||
async function init() {
|
||||
try {
|
||||
const res = await Api.getVideoDetail(options)
|
||||
|
|
@ -44,8 +44,17 @@
|
|||
// }
|
||||
}
|
||||
}
|
||||
function update({index,item}){
|
||||
|
||||
async function update({
|
||||
index,
|
||||
item
|
||||
}) {
|
||||
if(item){
|
||||
state.list[index] = item
|
||||
}else{
|
||||
await init()
|
||||
refVideoList.value.videoListUpdata()
|
||||
}
|
||||
}
|
||||
onLoad((opt) => {
|
||||
Object.assign(options, opt)
|
||||
|
|
@ -56,11 +65,10 @@
|
|||
current,
|
||||
direction,
|
||||
data
|
||||
}) {
|
||||
}
|
||||
}) {}
|
||||
|
||||
onShow(() => {
|
||||
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
@ -71,8 +79,8 @@
|
|||
background-color: #000;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.u-popup {
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
</style>
|
||||
Loading…
Reference in New Issue