提交 ade564ef 编写于 作者: DCloud_JSON's avatar DCloud_JSON

优化设置页面打开卡顿问题

上级 64d418f3
......@@ -8,7 +8,7 @@
const debug = true;//开启后,会alert错误信息
export default function request(name,params,callback=false,{showLoading=false,loadText='',fail=()=>{}}={}){
// console.log('request');
showLoading||loadText? uni.showLoading({title:loadText}):'';
showLoading||loadText? uni.showLoading({title:loadText,mask:true}):'';
let routers = name.split('/');
var action = false
if (routers.length>1){
......
......@@ -156,7 +156,7 @@
}, {
"path": "pages/ucenter/login-page/pwd-retrieve/pwd-retrieve",
"style": {
"navigationBarTitleText": ""
"navigationBarTitleText": "重置密码"
}
}, {
"path": "pages/ucenter/login-page/phone-code/phone-code",
......
......@@ -109,7 +109,7 @@
icon: 'none',
title: '出错了,新闻ID为空'
})
}
}
},
methods: {
setFavorite() {
......
......@@ -50,8 +50,8 @@
e=>{
console.log(e);
this.loginSuccess(e)
}
)
},
{showLoading:true})
}
}
}
......
<template>
<view class="content">
<!-- 顶部文字 -->
<text class="title">重置密码</text>
<text v-show="isPhone" class="login-iknow" >{{tipText}}</text>
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-forms ref="form" :value="formData" :rules="rules">
......@@ -163,7 +162,7 @@
<style>
@import url("../common/login-page.css");
.content-top-title {
margin-bottom: 6px;
.content{
padding-top: 36rpx;
}
</style>
......@@ -9,10 +9,10 @@
<uni-list class="mt10" :border="false">
<!-- #ifdef APP-PLUS -->
<!-- 检查push过程未结束不显示,push设置项 -->
<uni-list-item title="清理缓存" @click="clearTmp" link></uni-list-item>
<uni-list-item v-if="pushIsOn != 'wait'" @click.native="openSetting()" title="推送功能" showSwitch :switchChecked="pushIsOn"></uni-list-item>
<uni-list-item title="清理缓存" @click="clearTmp" link></uni-list-item>
<uni-list-item v-if="pushIsOn != 'wait'" @click.native="pushIsOn?pushServer.off():pushServer.on()" title="推送功能" showSwitch :switchChecked="pushIsOn"></uni-list-item>
<!-- #endif -->
<uni-list-item v-if="supportMode.includes('fingerPrint')" title="指纹解锁" @click="startSoterAuthentication('fingerPrint')" link></uni-list-item>
<uni-list-item v-if="supportMode.includes('fingerPrint')" title="指纹解锁" @click.native="startSoterAuthentication('fingerPrint')" link></uni-list-item>
<uni-list-item v-if="supportMode.includes('facial')" title="人脸解锁" @click="startSoterAuthentication('facial')" link></uni-list-item>
</uni-list>
<!-- #endif -->
......@@ -26,17 +26,15 @@
</template>
<script>
import {
isOn,
setting
} from './dc-push/push.js';
import pushServer from './dc-push/push.js';
import {
mapMutations,
mapGetters
} from 'vuex';
export default {
data() {
return {
return {
pushServer:pushServer,
supportMode:[],
pushIsOn:"wait"
}
......@@ -64,8 +62,8 @@
// 检查手机端获取推送是否开启
//#ifdef APP-PLUS
setTimeout(()=>{
this.pushIsOn = isOn();
},1)
this.pushIsOn = pushServer.isOn();
},300)
//#endif
},
methods: {
......@@ -89,17 +87,23 @@
/**
* 开始生物认证
*/
startSoterAuthentication(checkAuthMode) {
startSoterAuthentication(checkAuthMode) {
console.log(checkAuthMode);
let title = {"fingerPrint":"指纹解锁","facial":"人脸解锁"}[checkAuthMode]
// 检查是否开启认证
this.checkIsSoterEnrolledInDevice({checkAuthMode,title})
.then(() => {
.then(() => {
console.log(checkAuthMode,title);
// 开始认证
uni.startSoterAuthentication({
checkAuthModes: [requestAuthMode],
requestAuthModes: [checkAuthMode],
challenge: '123456', // 微信端挑战因子
authContent: `请用${title}`,
success: (res) => {
authContent: `请用${title}`,
complete: (res) => {
console.log(res);
},
success: (res) => {
console.log(res);
if (res.errCode == 0) {
/**
* 验证成功后开启自己的业务逻辑
......@@ -133,7 +137,8 @@
return new Promise((resolve, reject) => {
uni.checkIsSoterEnrolledInDevice({
checkAuthMode,
success: (res) => {
success: (res) => {
console.log(res);
if (res.isEnrolled) {
return resolve(res);
}
......@@ -218,13 +223,6 @@
console.log(e);
}
});
},
/**
* 打开设置页面
*/
openSetting() {
console.log('openSetting');
setting();
}
}
}
......
'use strict';
exports.main = async (event, context) => {
//event为客户端上传的参数
//返回数据给客户端
return uniCloud.database().collection('opendb-news-articles').field({'_id':false}).get()
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册