This commit is contained in:
2025-01-17 10:08:16 +08:00
10 changed files with 151 additions and 67 deletions

View File

@@ -111,21 +111,19 @@
<script setup>
import { ref, reactive } from 'vue';
import { onLoad,onShow, onPullDownRefresh } from '@dcloudio/uni-app';
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
import { linkTo } from '@/utils/app.js';
import {
useCommonStore
} from '@/store/common.js'
const $common = useCommonStore()
import { useCommonStore } from '@/store/common.js';
const $common = useCommonStore();
const userInfo = ref({});
// 获取最近的三条观看历史
const recordThree = ref([]);
onShow(()=>{
onShow(() => {
// 判断ios是否审核
$common.init()
})
$common.init();
});
async function selectByUserIdAjax() {
try {
const res = await selectByUserId({ page: 1, limit: 3, classify: 3 });
@@ -179,7 +177,7 @@ onPullDownRefresh(async () => {
}, 500);
});
onLoad(() => {
onShow(() => {
selectByUserIdAjax();
collectVideoSummaryAjax();
selectUserMoneyAjax();

View File

@@ -101,7 +101,7 @@
import { linkTo } from '@/utils/app.js';
let data = reactive({
ruleShow: true,
ruleShow: false,
rule_title: "",
rule_content: "",
money: '',
@@ -114,6 +114,7 @@
urlCallback: {},
adpid: null,
adRewardedShow: false,
adRewardedNum: 0,
adRewardedVideoloadNum: 0,
isWithdraw: false,
userInfo: null,
@@ -131,6 +132,7 @@
// }
getExtractFei();
getMoneyDetail();
getCanCash()
})
onShow(() => {
@@ -147,7 +149,6 @@
data.adRewardedVideoloadNum = 0
adRewardedw.value.load();
})
getCanCash()
})
onReachBottom(() => {
if (data.page * data.limit < data.totalCount) {
@@ -184,7 +185,6 @@
function ruleConfirm() {
data.ruleShow = false
data.ruleIndex++
console.log(data.ruleIndex >= data.ruleList.length)
if( data.ruleIndex >= data.ruleList.length) {
data.ruleIndex = 0
return
@@ -208,7 +208,14 @@
*/
async function getCanCash() {
canCash().then(res => {
data.isWithdraw = !res;
data.isWithdraw = res;
console.log(res)
if( uni.getStorageSync('adRewardedNum') >= 3 ){
data.isWithdraw = true;
// uni.setStorageSync('adRewardedNum',0)
} else {
uni.setStorageSync('adRewardedNum',((uni.getStorageSync('adRewardedNum')||0)+1))
}
})
}
@@ -218,6 +225,7 @@
*/
function onadload(e) {
data.adRewardedShow = true;
uni.setStorageSync('adRewardedNum',0)
console.log('广告数据加载成功');
}
@@ -244,9 +252,12 @@
const detail = e.detail
if (detail && detail.isEnded) {
// 正常播放结束
console.log(data.urlCallback.extra)
let res = await state({
extraKey: data.urlCallback.extra
})
console.log(res)
uni.setStorageSync('adRewardedNum',0)
getCanCash()
} else {
// 播放中途退出
@@ -341,17 +352,22 @@
}
function getMoney() {
let data =
uni.showLoading({
title: '提现中'
});
withdraw({
amount: data.money
}).then(res => {
console.log(res)
data.money = ''
uni.setStorageSync('adRewardedNum',0)
setTimeout(function() {
getcashMoney()
}, 1500)
uni.showToast({
title: res.msg,
icon: 'none'
})
}).catch(res =>{
if (res.code == 9991) {
uni.showToast({
@@ -361,6 +377,7 @@
setTimeout(function() {
linkTo('/pages/me/withdraw/alipay')
}, 1500)
}else{
}
})
@@ -398,6 +415,7 @@
success: (e) => {
if (e.confirm) {
console.log(data.money)
getMoney();
getMoneyDetail();
}