This commit is contained in:
duan 2025-01-14 11:41:40 +08:00
commit b9c8f40061
5 changed files with 76 additions and 38 deletions

View File

@ -5,9 +5,9 @@ import http from '@/http/http.js'
*/ */
export const login = (data) => { export const login = (data) => {
return http.request({ return http.request({
url: '/Login/registerCode', url: '/Login',
method: 'POST', method: 'POST',
params: data data: data
}) })
} }
@ -23,11 +23,11 @@ export const setSendMsg = (mobile,type) => {
/** /**
* 注册 * 注册
*/ */
export const register = (params) => { export const register = (data) => {
return http.request({ return http.request({
url: '/Login/registerCode', url: '/Login/register',
method: 'POST', method: 'POST',
params: params data: data
}) })
} }

View File

@ -107,13 +107,13 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
.catch((res) => { .catch((res) => {
if (res.status == 404) { if (res.status == 404) {
infoBox.showErrorToast("接口404").then(() => {}); infoBox.showToast("接口404").then(() => {});
reject(); reject();
return; return;
} }
if (res.code == 401) { if (res.code == 401) {
infoBox.showErrorToast(res.message || "请登录").then(() => { infoBox.showToast(res.message || "请登录").then(() => {
uni.redirectTo({ uni.redirectTo({
url: "/pages/login/login", url: "/pages/login/login",
}); });
@ -121,18 +121,18 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
}); });
} }
if (res.code != 0) { if (res.code != 0) {
infoBox.showErrorToast(res.msg).then(() => {}); infoBox.showToast(res.msg).then(() => {});
reject(); reject();
} }
if (res.code == 500) { if (res.code == 500) {
infoBox.showErrorToast(res.msg || "服务器异常").then(() => {}); infoBox.showToast(res.msg || "服务器异常").then(() => {});
reject(); reject();
} }
reqFinishFunc(); // 请求完毕的动作 reqFinishFunc(); // 请求完毕的动作
// 如果没有提示错误, 那么此处提示 异常。 // 如果没有提示错误, 那么此处提示 异常。
if (!isShowErrorToast) { if (!isShowErrorToast) {
infoBox.showErrorToast(`请求网络异常`); infoBox.showToast(`请求网络异常`);
} }
return Promise.reject(res); return Promise.reject(res);
@ -233,7 +233,7 @@ function upload(uri, data, file, showLoading = true, extParams = {}) {
}) })
.catch((err) => { .catch((err) => {
uni.hideLoading(); uni.hideLoading();
infoBox.showErrorToast(`上传失败`); infoBox.showToast(`上传失败`);
}); });
}); });
} }

View File

@ -96,9 +96,9 @@
data.sending = false; data.sending = false;
data.sendTime = '获取验证码'; data.sendTime = '获取验证码';
} else { } else {
data.count = count - 1; data.count = data.count - 1;
data.sending = true; data.sending = true;
data.sendTime = count - 1 + '秒后重新获取'; data.sendTime = data.count - 1 + '秒后重新获取';
setTimeout(countDown.bind(this), 1000); setTimeout(countDown.bind(this), 1000);
} }
} }

View File

@ -122,14 +122,15 @@
* 验证码倒计时 * 验证码倒计时
*/ */
function countDown() { function countDown() {
console.log(data.count)
if (data.count === 1) { if (data.count === 1) {
data.count = 60; data.count = 60;
data.sending = false; data.sending = false;
data.sendTime = '获取验证码'; data.sendTime = '获取验证码';
} else { } else {
data.count = count - 1; data.count = data.count - 1;
data.sending = true; data.sending = true;
data.sendTime = count - 1 + '秒后重新获取'; data.sendTime = data.count - 1 + '秒后重新获取';
setTimeout(countDown.bind(this), 1000); setTimeout(countDown.bind(this), 1000);
} }
} }

View File

@ -60,11 +60,12 @@
</view> </view>
</view> </view>
<!-- 激励视频广告 --> <!-- 激励视频广告 -->
<!-- <ad-rewarded-video v-if="adRewardedVideo" ref="adRewardedVideo" adpid="1531580352" :loadnext="true" <view style="width: 0;height: 0;overflow: hidden;">
v-slot:default="{ loading, error }" :url-callback="datas.urlCallback" @load="onadload" @close="onadclose" <!-- 激励视频广告 -->
@error="onaderror"> <ad-rewarded-video v-if="datas.adRewardedShow" ref="adRewarded" adpid="1507000689" :loadnext="true"
<view class="ad-error" v-if="error">{{ error }}</view> :url-callback="datas.urlCallback" @load="onadload" @close="onadclose" @error="onaderror">
</ad-rewarded-video> --> </ad-rewarded-video>
</view>
</view> </view>
</template> </template>
@ -73,6 +74,7 @@
useCommonStore useCommonStore
} from '@/store/common.js' } from '@/store/common.js'
const $common = useCommonStore() const $common = useCommonStore()
import { selectUserMoney, selectPayDetails, canCash, state, withdraw } from '@/api/me/withdraw.js';
import { import {
reactive, reactive,
getCurrentInstance, getCurrentInstance,
@ -80,6 +82,7 @@
} from "vue"; } from "vue";
import { import {
onShow, onShow,
onReady,
onReachBottom onReachBottom
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { import {
@ -95,9 +98,11 @@
// ios // ios
isExamine: $common.isExamine, isExamine: $common.isExamine,
urlCallback: {}, urlCallback: {},
adRewardedVideo: true, adRewardedShow: true,
adRewardedVideoloadNum: 0,
}) })
const adRewarded = ref(null);
onShow(() => { onShow(() => {
getTaskdata() getTaskdata()
getsignIn() getsignIn()
@ -108,24 +113,59 @@
// currentInstance.ctx.$refs.adRewardedVideo.load(); // currentInstance.ctx.$refs.adRewardedVideo.load();
// }) // })
}) })
//广 onReady(() => {
nextTick(()=>{
data.adRewardedVideoloadNum = 0
adRewarded.value.load();
})
getCanCash()
})
/**
* 获取看广告状态
*/
async function getCanCash() {
canCash().then(res => {
data.isWithdraw = !res;
})
}
/**
* 广告加载失败回调
* @param {Object} e
*/
function onaderror(e) {
if ( data.adRewardedVideoloadNum >=3 ) {
data.adRewardedShow = false;
return
}
data.adRewardedVideoloadNum++
setTimeout(() => {
adRewarded.value.load();
}, 1000); // 10
console.log("广告加载失败")
}
/**
* 广告数据加载成功回调
* @param {Object} e
*/
function onadload(e) {
data.adRewardedShow = true;
console.log('广告数据加载成功');
}
/**
* 广告播放成功回调
* @param {Object} e
*/
async function onadclose(e) { async function onadclose(e) {
const detail = e.detail const detail = e.detail
if (detail && detail.isEnded) { if (detail && detail.isEnded) {
// //
// /sqx_fast/app/ad/state let res = await state({
let res = await this.$Request.getT('app/ad/state', { extraKey: data.urlCallback.extra
extraKey: this.urlCallback.extra
})
this.$Request.getT('/app/common/type/921').then(res => {
if (res.code == 0) {
console.log(res)
uni.showToast({
title: '获得' + res.data.value + '分钟免费时长',
icon: 'none'
})
}
}) })
getCanCash()
} else { } else {
// 退 // 退
} }
@ -171,7 +211,7 @@
userId: uni.getStorageSync('userId'), userId: uni.getStorageSync('userId'),
extra: uni.getStorageSync('userId') + "" + new Date().getTime(), extra: uni.getStorageSync('userId') + "" + new Date().getTime(),
} }
currentInstance.ctx.$refs.adRewardedVideo.show(); adRewarded.value.show();
} else { } else {
uni.switchTab({ uni.switchTab({
url: "/pages/index/index" url: "/pages/index/index"
@ -204,9 +244,6 @@
} }
function onadload(e) {
datas.adRewardedVideo = true;
}
// //
async function getsignIn() { async function getsignIn() {
let res = await getUserSignData() let res = await getUserSignData()