修改支付请求订单详情时间每请求一次加2秒,调整绑定支付宝页面样式

This commit is contained in:
YeMingfei666 2025-06-30 14:20:40 +08:00
parent 90ecd6621d
commit dd666f0d82
5 changed files with 73 additions and 36 deletions

View File

@ -1,5 +1,5 @@
//打包时修改env的值即可
const env = 'production' //test,production,local
const env = 'test' //test,production,local
export const encryptKey = '1234567890123456' // http数据加解密的key

View File

@ -221,7 +221,7 @@
</view>
<view class="pay-list-item" @click="payBtnClick('gold', 1)" v-if="nowDanjiPrice * goldBili > 0">
<image class="hot" src="@/static/images/hot.png" mode=""></image>
<text class="u-font-28 font-bold">{{ nowDanjiPrice * goldBili }}金币解锁单集视频</text>
<text class="u-font-28 font-bold">{{ to2(nowDanjiPrice * goldBili)}}金币解锁单集视频</text>
</view>
<view class="pay-list-item" @click="payBtnClick('money', 1)">
<!-- <image class="hot" src="@/static/images/hot.png" mode=""></image> -->
@ -335,7 +335,11 @@ import { debounce, throttle } from 'lodash';
import * as Api from '@/api/video/index.js';
import infoBox from '@/utils/infoBox.js';
import { computed, reactive, ref, watch, nextTick, onMounted, getCurrentInstance, onUnmounted } from 'vue';
function to2(n){
if(n){
return n.toFixed(2)
}
}
//
function bindWx() {
popupClose('bindWx');

View File

@ -2,8 +2,8 @@
"name" : "斯耀短剧",
"appid" : "__UNI__E0B05B1",
"description" : "",
"versionName" : "1.3.1",
"versionCode" : 131,
"versionName" : "1.3.2",
"versionCode" : 132,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@ -8,10 +8,13 @@
<template #right-icon> <up-input border="none" v-model="data.zhiFuBao" placeholder="请输入要绑定的支付宝手机号"></up-input> </template>
</up-cell>
</up-cell-group>
<button class="confirm-btn" @click="toLogin"
:disabled="data.logining">绑定账户</button>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;margin-top: 32rpx;margin-bottom: 10rpx;">请正确填写收款人的支付宝账户和真实的收款人姓名</view>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx">否则将无法正常收款请须知</view>
<view class="u-flex u-row-center">
<button class="confirm-btn" @click="toLogin"
:disabled="data.logining">绑定账户</button>
</view>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;margin-top: 32rpx;margin-bottom: 10rpx;text-align: center;">请正确填写收款人的支付宝账户和真实的收款人姓名</view>
<view style="font-size: 24upx;color: #999999;padding: 0 15rpx;text-align: center;">否则将无法正常收款请须知</view>
</view>
</template>

View File

@ -9,7 +9,10 @@
reactive
} from 'vue'
import {
onShow,onHide,onUnload,onLoad
onShow,
onHide,
onUnload,
onLoad
} from '@dcloudio/uni-app'
import {
getOrderInfo
@ -18,7 +21,6 @@
orderId: '',
timer: null,
timer1: null,
maxAjaxNum: 5,
ajaxNum: 0,
url: null, //
viewerUrl: '/hybrid/html/web/viewer.html',
@ -32,64 +34,92 @@
getOrderInfo({
orderId: state.orderId
}).then(res => {
state.ajaxNum+=1
console.log(res);
if (res == 1) {
uni.hideLoading()
const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios'
uni.showToast({
title: '支付成功',
icon: 'none'
})
if (isIos) {
uni.navigateBack()
uni.showToast({
title: '支付成功',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
} else {
uni.showToast({
title: '支付成功',
icon: 'none'
})
state.timer1 = setTimeout(() => {
cleartimer()
uni.navigateBack()
}, 500)
}
} else {
}
if(state.ajaxNum>=state.maxAjaxNum){
if (executionCount >= maxExecutions) {
console.log(`已达到最大执行次数(${maxExecutions}),定时器停止`);
uni.navigateBack()
cleartimer()
}
});
}
function cleartimer(){
function cleartimer() {
console.log('cleartimer');
uni.hideLoading()
clearInterval(state.timer)
clearTimeout(state.timer)
clearTimeout(state.timer1)
state.timer=null
state.timer1=null
state.ajaxNum=0
state.timer = null
state.timer1 = null
}
let runOnetime = 2000; // 2
let executionCount = 0; //
const maxExecutions = 5; //
function startDynamicTimer() {
let lastExecutionTime = Date.now();
function executeAndReschedule() {
//
if (executionCount >= maxExecutions) {
console.log(`已达到最大执行次数(${maxExecutions}),定时器停止`);
uni.navigateBack()
cleartimer()
return;
}
const currentTime = Date.now();
const elapsed = currentTime - lastExecutionTime;
lastExecutionTime = currentTime;
getOrder();
//
executionCount++;
console.log('executionCount',executionCount);
// 2
runOnetime += 2000;
//
console.log('executionCount < maxExecutions',executionCount < maxExecutions);
console.log(executionCount , maxExecutions);
if (executionCount < maxExecutions) {
state.timer = setTimeout(executeAndReschedule, runOnetime);
}
}
//
state.timer = setTimeout(executeAndReschedule, runOnetime);
}
onShow(() => {
executionCount=0;
// #ifdef APP
uni.showLoading({
title: '支付中'
})
// #endif
state.ajaxNum=0;
runOnetime = 2000;
getOrder()
clearInterval(state.timer)
state.timer=setInterval(()=>{
getOrder()
},2000)
clearTimeout(state.timer)
//
startDynamicTimer();
})
onHide(() => {
console.log('onHide');