Browse Source

1

dev_czc
congzc 1 year ago
parent
commit
21b1eee96a
6 changed files with 33 additions and 3 deletions
  1. +1
    -0
      src/pages/camera/index.vue
  2. +1
    -0
      src/pages/chooseStyle/index.vue
  3. +4
    -2
      src/pages/created/index.vue
  4. +10
    -0
      src/pages/createing/index.vue
  5. +4
    -1
      src/pages/login/index.vue
  6. +13
    -0
      src/utils/request.js

+ 1
- 0
src/pages/camera/index.vue View File

@@ -492,6 +492,7 @@ onMounted(() => {
}, 300000);
});
onUnload(() => {
uni.hideLoading();
clearTimeout(resetTimer.value);
});
//#endregion -----------------------


+ 1
- 0
src/pages/chooseStyle/index.vue View File

@@ -289,6 +289,7 @@ onMounted(() => {
}, 300000);
});
onUnload(() => {
uni.hideLoading();
clearTimeout(resetTimer.value);
});
//#endregion -----------------------


+ 4
- 2
src/pages/created/index.vue View File

@@ -97,7 +97,7 @@ onLoad(async (options) => {
// uni.setStorageSync("createTimes", userInfoModulesPinia.createTimes);
});
onUnload(() => {
clearTimeout(timer);
clearTimeout(timer.value);
timer.value = null;
});
const swiperList = ref([]); //轮播图
@@ -128,7 +128,7 @@ async function getSwiperList() {
getSwiperList();
}, 3000);
} else {
clearTimeout(timer);
clearTimeout(timer.value);
timer.value = null;
}
}
@@ -300,7 +300,9 @@ onMounted(() => {
}, 300000);
});
onUnload(() => {
uni.hideLoading();
clearTimeout(resetTimer.value);
clearTimeout(timer.value);
});
//#endregion -----------------------
</script>


+ 10
- 0
src/pages/createing/index.vue View File

@@ -223,6 +223,14 @@ const payCount = ref(300); //支付倒计时数
const payCountTimer = ref(null); //支付倒计时
// 获取登录信息
async function getUser() {
// 页面跳转停止递归
if (
getCurrentPages()[getCurrentPages().length - 1].route !=
"pages/createing/index"
) {
return;
}

// 如果二维码框隐藏,不再执行
if (showQrCode.value == false) {
return;
@@ -311,6 +319,7 @@ onUnload(() => {
uni.hideLoading();
clearInterval(payCountTimer.value);
payCountTimer.value = null;
showQrCode.value == false; // 停止getUser()的递归
// uni.setStorageSync("UserId", null);
});
//#endregion ---------------------
@@ -384,6 +393,7 @@ onMounted(() => {
}, 300000);
});
onUnload(() => {
uni.hideLoading();
clearTimeout(resetTimer.value);
});
//#endregion -----------------------


+ 4
- 1
src/pages/login/index.vue View File

@@ -24,7 +24,10 @@ function toChooseStyle() {
//#region getImei
function Imei() {
try {
const IMEI = window.android.getIMEI();
const IMEI = window.webview.raiseEvent("getIMEI", "test_params");
// window.webview.raiseEvent("getSerial", "test_params");
// window.webview.raiseEvent("getTestStr", "test_params");
// const IMEI = window.android.getIMEI();
// const IMEI = window.android.getSerial();
// const IMEI = window.android.getTestStr();
uni.showToast({


+ 13
- 0
src/utils/request.js View File

@@ -10,12 +10,23 @@ const BASE_URL = 'https://zhixiang.malls.iformall.com/C/';
// const BASE_URL = 'https://test.metavatar.cc/';

// 通用的网络请求函数,接收请求的URL和请求参数,返回一个Promise
const timeoutNum = 30000;
const request = (requestObj) => {
return new Promise((resolve, reject) => {
// const timer = setTimeout(() => {
// reject(new Error('请求超时'));
// console.log('请求超时');
// uni.showToast({
// title: '请求超时,请稍后再试',
// icon: 'none',
// })
// }, timeoutNum);

uni.request({
url: BASE_URL + requestObj.url,
method: requestObj.method, // 这里可以根据需要更改请求方法
data: requestObj.data,
timeout: timeoutNum,
header: {
token: uni.getStorageSync("token"),
},
@@ -45,7 +56,9 @@ const request = (requestObj) => {
icon: 'none',
})
},

})

})
};
export { BASE_URL, request }

Loading…
Cancel
Save