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

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

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