这个是else if (name === '咖密') { let type = true ...
Tạo vào: 10 tháng 12, 2025
Trả lời bằng GPT-5.1 Thinking bởi Chat01
Tạo vào: 10 tháng 12, 2025
Trả lời bằng GPT-5.1 Thinking bởi Chat01
这个是else if (name === '咖密') {
let type = true
if(pas.value.defaultSecretPasswordType===1){
<template> <view :class="['app-container', theme]"> <view class="content"> <view class="overlay"> <!-- 顶部 Header --> <view class="header" :style="{ paddingTop: statusBarHeight + 'px', height: headerBarHeight + 'px' }"> <view class="header-inner"> <view class="left-box" @click="navigateBack"> <uni-icons type="left" color="#000000" size="26" /> </view> <view class="center-box"> <text class="title-text">咖密</text> </view> <view class="right-box"> <text class="desc-text"></text> </view> </view> </view>textuni.navigateTo({ url: '/pages/sociAlize/Coffee/setpassword/gesture?decrypt=' + type }) }else if(pas.value.defaultSecretPasswordType===2){ uni.navigateTo({ url: '/pages/sociAlize/Coffee/setpassword/Textpassword?decrypt=' + type }) } // uni.navigateTo({ // url: '/pages/sociAlize/Coffee/Coffeeability' // }) 点击咖密进入uni.navigateTo({ url: '/pages/sociAlize/Coffee/setpassword/gesture?decrypt=' + type }) 因为type是2 这是gesture 页面是手势的加密页面 <!-- /pages/sociAlize/Coffee/setpassword/gesture.vue -->
</template> <script setup> import { ref, reactive, onMounted } from 'vue' import { onLoad } from '@dcloudio/uni-app' import { storeToRefs } from 'pinia' import { useMainStore } from '@/store/index.js' import { getStatusBarHeight, getTitleBarHeight } from '@/utils/system.js' import ajax from '@/api/ajax.js' import GestureLock from '@/components/GestureLock/GestureLock.vue' const GESTURE_TYPE = 1 const store = useMainStore?.() || {} const { theme = ref('') } = storeToRefs?.(store) || { theme: ref('') } const statusBarHeight = ref(getStatusBarHeight()) const headerBarHeight = ref(getTitleBarHeight()) const ui = reactive({ mode: 'set', // set | check tips: '请绘制手势密码', line: '#007aff', error: '#fa3534', fill: '#ffffff', stroke: '#c0c0c0' }) const state = reactive({ consumerId: '', secretGesturePasswordId: '', secretStringPasswordId: '', defaultSecretPasswordType: 0, // from 参数(用于校验成功后跳转) redirectAfterCheck: '', redirectTarget: '' }) const lockRef = ref(null) const setFlow = reactive({ first: '', pendingConfirm: false, submitting: false }) // API const API = { passwordSave: (payload) => ajax.post({ url: 'password', method: 'post', data: payload }), validatePassword: (id, password) => ajax.post({ url: 'validatePassword', method: 'post', data: { id, password } }), consumerSecretPassword: ({ consumerId, passwordId, defaultSecretPasswordType }) => ajax.post({ url: 'consumerSecretPassword', method: 'post', data: { consumerId, passwordId, defaultSecretPasswordType } }), consumerSecretPasswordShow: (consumerId) => ajax.post({ url: 'consumerSecretPasswordShow', method: 'post', data: { consumerId } }) } function navigateBack() { uni.navigateBack() } onLoad((option = {}) => { // consumerId:默认取自己 if (option.consumerId) state.consumerId = option.consumerId else if (store?.user?.id) state.consumerId = store.user.id else state.consumerId = uni.getStorageSync('consumerId') || '' // 允许从外部传入模式 / passwordId,用于“只校验”的场景 if (option.mode === 'check') ui.mode = 'check' if (option.passwordId) { state.secretGesturePasswordId = option.passwordId } if (option.redirect) { state.redirectAfterCheck = option.redirect } if (option.target) { state.redirectTarget = option.target } }) onMounted(() => { refreshProfile() }) // 查询当前用户的咖密配置 async function refreshProfile() { try { if (!state.consumerId) return const res = await API.consumerSecretPasswordShow(state.consumerId) console.log(res,'手势设置的回显密码') const data = res?.data || res if (!data) return state.secretGesturePasswordId = data.secretGesturePasswordId || state.secretGesturePasswordId || '' state.secretStringPasswordId = data.secretStringPasswordId || '' state.defaultSecretPasswordType = typeof data.defaultSecretPasswordType === 'number' ? data.defaultSecretPasswordType : Number(data.defaultSecretPasswordType || 0) } catch (e) {} } function switchMode(m) { ui.mode = m ui.tips = m === 'set' ? setFlow.pendingConfirm ? '请再次绘制确认' : '请绘制手势密码' : '请绘制已设置的手势进行验证' lockRef.value?.reset() } async function onPatternComplete(pwd) { if (ui.mode === 'set') await handleSetFlow(pwd) else await handleCheckFlow(pwd) } // 设置流程 async function handleSetFlow(pwd) { if (!setFlow.pendingConfirm) { setFlow.first = pwd setFlow.pendingConfirm = true ui.tips = '请再次绘制确认' lockRef.value?.flashSuccess(300) return } if (pwd !== setFlow.first) { ui.tips = '与第一次不一致,请重试' setFlow.first = '' setFlow.pendingConfirm = false lockRef.value?.flashError() return } if (setFlow.submitting) return setFlow.submitting = true try { const payload = { id: state.secretGesturePasswordId || undefined, password: pwd, type: GESTURE_TYPE } const saveRes = await API.passwordSave(payload) const newId = saveRes?.data?.id || saveRes?.id if (!newId) throw new Error('保存失败') state.secretGesturePasswordId = newId // 设置为默认手势(全局咖密) if (state.consumerId) { let res = await API.consumerSecretPassword({ consumerId: state.consumerId, passwordId: newId, defaultSecretPasswordType: GESTURE_TYPE }) console.log(res,'手势设置的密码') state.defaultSecretPasswordType = GESTURE_TYPE } ui.tips = '设置成功' lockRef.value?.flashSuccess() setFlow.first = '' setFlow.pendingConfirm = false uni.showToast({ title: '设置成功', icon: 'success' }) } catch (e) { ui.tips = '保存失败,请重试' lockRef.value?.flashError() } finally { setFlow.submitting = false } } // 验证流程 async function handleCheckFlow(pwd) { const id = state.secretGesturePasswordId if (!id) { ui.tips = '尚未设置手势密码' lockRef.value?.flashError() return } try { const res = await API.validatePassword(id, pwd) const result = res?.data?.result || res?.result if (result === 'success') { ui.tips = '验证成功' lockRef.value?.flashSuccess() uni.showToast({ title: '验证成功', icon: 'success' }) // 如果从好友页过来,需要验证通过后进入聊天页面 if (state.redirectAfterCheck) { setTimeout(() => { uni.navigateTo({ url: state.redirectAfterCheck + (state.redirectTarget ? state.redirectTarget : '') }) }, 200) } } else { ui.tips = result || '密码错误' lockRef.value?.flashError() } } catch (e) { ui.tips = '验证失败,请稍后再试' lockRef.value?.flashError() } } async function setAsDefault() { if (!state.secretGesturePasswordId || !state.consumerId) return try { await API.consumerSecretPassword({ consumerId: state.consumerId, passwordId: state.secretGesturePasswordId, defaultSecretPasswordType: GESTURE_TYPE }) state.defaultSecretPasswordType = GESTURE_TYPE uni.showToast({ title: '已设为默认(手势)', icon: 'success' }) } catch (e) { uni.showToast({ title: '设置默认失败', icon: 'none' }) } } </script> <style lang="scss" scoped> @import '@/assets/styles/global.scss'; .content { min-height: 100vh; position: relative; background-size: cover; } .overlay { position: absolute; inset: 0; background-size: cover; } .header { width: 94%; margin: 0 auto; } .header-inner { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; } .left-box, .right-box { position: absolute; top: 0; bottom: 0; width: 120rpx; display: flex; align-items: center; } .left-box { left: 0; justify-content: flex-start; } .right-box { right: 0; justify-content: flex-end; } .center-box { flex: none; } .page-body { width: 94%; margin: 0 auto; padding-bottom: 40rpx; } .card { margin-top: 24rpx; padding: 24rpx; background: #fff; border-radius: 16rpx; .row { display: flex; margin-bottom: 12rpx; font-size: 28rpx; } .label { color: #666; width: 260rpx; } .val { color: #111; flex: 1; } } .tabs { margin-top: 24rpx; display: flex; background: #fff; border-radius: 16rpx; overflow: hidden; .tab { flex: 1; text-align: center; padding: 22rpx 0; font-size: 30rpx; color: #666; } .tab.active { color: #007aff; font-weight: 600; background: #f5f8ff; } } .lock-wrap { margin-top: 30rpx; background: #fff; border-radius: 16rpx; padding: 20rpx 0 40rpx; } .btns { margin-top: 24rpx; display: grid; grid-template-columns: 1fr 1fr; gap: 20rpx; .btn { border-radius: 12rpx; } .primary { background: #007aff; color: #fff; } } </style>这是手势页面的组件GestureLock<!-- /components/GestureLock/GestureLock.vue --> <template> <view class="g-box"> <canvas canvas-id="gesture" id="gesture" class="g-canvas" @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd" /> <view class="g-tips">{{ innerTips }}</view> </view> </template> <script setup> import { ref, watch, getCurrentInstance } from 'vue' import { onReady } from '@dcloudio/uni-app' const props = defineProps({ tips: { type: String, default: '请绘制手势密码' }, minPoints: { type: Number, default: 4 }, lineColor: { type: String, default: '#D89833' }, errorColor: { type: String, default: '#fa3534' }, fillColor: { type: String, default: '#ffffff' }, strokeColor: { type: String, default: '#c0c0c0' }, radiusRpx: { type: Number, default: 40 }, marginRpx: { type: Number, default: 80 } }) const emit = defineEmits(['complete']) const innerTips = ref(props.tips) watch( () => props.tips, (v) => (innerTips.value = v) ) let ctx = null let canvasRect = { width: 0, height: 0, left: 0, top: 0 } let scale = 1 let nodes = [] let activeIdx = [] let touching = false let lastPos = { x: 0, y: 0 } onReady(() => { const inst = getCurrentInstance() const proxy = inst?.proxy uni .createSelectorQuery() .in(proxy) .select('#gesture') .boundingClientRect((rect) => { canvasRect = rect || { width: 0, height: 0, left: 0, top: 0 } if (!canvasRect.width) { // 防止 App 上取不到 rect 宽度 const sys = uni.getSystemInfoSync() canvasRect.width = sys.windowWidth || 300 canvasRect.height = canvasRect.width } scale = canvasRect.width / 750 ctx = uni.createCanvasContext('gesture', proxy) buildNodes() draw() }) .exec() }) function buildNodes() { const r = props.radiusRpx * scale const margin = props.marginRpx * scale const w = canvasRect.width const sideGap = (w - 2 * margin - 6 * r) / 2 nodes = [] for (let i = 0; i < 9; i++) { const row = Math.floor(i / 3) const col = i % 3 nodes.push({ x: margin + r + col * (2 * r + sideGap), y: margin + r + row * (2 * r + sideGap), r }) } } function draw(color = props.lineColor) { if (!ctx) return ctx.clearRect(0, 0, canvasRect.width, canvasRect.height) nodes.forEach((n, i) => { ctx.beginPath() ctx.arc(n.x, n.y, n.r, 0, Math.PI * 2) const hit = activeIdx.includes(i) ctx.setFillStyle(hit ? color : props.fillColor) ctx.setStrokeStyle(hit ? color : props.strokeColor) ctx.setLineWidth(2) ctx.fill() ctx.stroke() }) if (activeIdx.length > 0) { ctx.beginPath() ctx.setStrokeStyle(color) ctx.setLineWidth(4) ctx.setLineCap('round') ctx.moveTo(nodes[activeIdx[0]].x, nodes[activeIdx[0]].y) for (let k = 1; k < activeIdx.length; k++) { ctx.lineTo(nodes[activeIdx[k]].x, nodes[activeIdx[k]].y) } if (touching) ctx.lineTo(lastPos.x, lastPos.y) ctx.stroke() } ctx.draw() } function touchStart(e) { touching = true activeIdx = [] processPoint(e.touches[0]) } function touchMove(e) { if (!touching) return processPoint(e.touches[0]) } function touchEnd() { if (!touching) return touching = false const pwd = activeIdx.join('') if (activeIdx.length < props.minPoints) { innerTips.value = `至少连接 ${props.minPoints} 个点` flashError(600) setTimeout(reset, 600) return } emit('complete', pwd) } function processPoint(t) { const p = localXY(t) lastPos = p const idx = nodes.findIndex((n) => distance(n, p) <= n.r) if (idx !== -1 && !activeIdx.includes(idx)) { activeIdx.push(idx) try { uni.vibrateShort() } catch (e) {} } draw() } function localXY(t) { const x = typeof t.x === 'number' ? t.x : t.clientX - (canvasRect.left || 0) const y = typeof t.y === 'number' ? t.y : t.clientY - (canvasRect.top || 0) return { x, y } } function distance(a, b) { return Math.hypot(a.x - b.x, a.y - b.y) } function reset() { activeIdx = [] draw() } function flashError(delay = 800) { draw(props.errorColor) setTimeout(() => draw(), delay) } function flashSuccess(delay = 300) { draw(props.lineColor) setTimeout(() => draw(), delay) } defineExpose({ reset, flashError, flashSuccess }) </script> <style scoped> .g-box { display: flex; flex-direction: column; align-items: center; padding-top: 40rpx; } .g-canvas { width: 750rpx; height: 750rpx; } .g-tips { margin-top: 30rpx; font-size: 30rpx; color: #333; } </style> 目前是在这里跳这个 else if(pas.value.defaultSecretPasswordType===2){text<!-- 内容 --> <view class="page-body"> <view class="card"> <view class="row"> <text class="label">手势密码ID:</text> <text class="val">{{ state.secretGesturePasswordId || '未设置' }}</text> </view> <view class="row"> <text class="label">默认解锁方式:</text> <text class="val"> {{ state.defaultSecretPasswordType === GESTURE_TYPE ? '手势' : state.defaultSecretPasswordType === 2 ? '文字' : '未设置' }} </text> </view> </view> <view class="tabs"> <view class="tab" :class="{ active: ui.mode === 'set' }" @click="switchMode('set')"> 设置/重设 </view> <view class="tab" :class="{ active: ui.mode === 'check' }" @click="switchMode('check')"> 验证 </view> </view> <view class="lock-wrap"> <GestureLock ref="lockRef" :tips="ui.tips" :min-points="4" :line-color="ui.line" :error-color="ui.error" :fill-color="ui.fill" :stroke-color="ui.stroke" @complete="onPatternComplete" /> </view> <view class="btns"> <button class="btn primary" @click="setAsDefault" :disabled="!state.secretGesturePasswordId"> 设为默认(手势) </button> </view> </view> </view> </view> </view>
<template> <view :class="['app-container', theme]"> <view class="content"> <view class="overlay"> <!-- 顶部 Header --> <view class="header" :style="{ paddingTop: statusBarHeight + 'px', height: headerBarHeight + 'px' }"> <view class="header-inner"> <view class="left-box" @click="navigateBack"> <uni-icons type="left" color="#000000" size="26" /> </view> <view class="center-box"> <text class="title-text">咖密</text> </view> <view class="right-box"> <text class="desc-text"></text> </view> </view> </view>textuni.navigateTo({ url: '/pages/sociAlize/Coffee/setpassword/Textpassword?decrypt=' + type }) } 是属于直接验证密码的 这个gesture页面是<!-- /pages/sociAlize/Coffee/setpassword/gesture.vue -->
</template> <script setup> import { usecontacts } from '@/store/usecontacts.js' import { ref, reactive, onMounted } from 'vue' import { onLoad } from '@dcloudio/uni-app' import { storeToRefs } from 'pinia' import { useMainStore } from '@/store/index.js' import { getStatusBarHeight, getTitleBarHeight } from '@/utils/system.js' import ajax from '@/api/ajax.js' import GestureLock from '@/components/GestureLock/GestureLock.vue' const GESTURE_TYPE = 1 const store = useMainStore?.() || {} const { theme = ref('') } = storeToRefs?.(store) || { theme: ref('') } const statusBarHeight = ref(getStatusBarHeight()) const headerBarHeight = ref(getTitleBarHeight()) const storeer = usecontacts() const { indexList, groupedItemArr, newfriend, webProjectUrl, navOffsetTop, itemArr, pas } = storeToRefs(storeer) const { difference, FriendDetails, getInitial, setNavOffsetTop, refreshIndexLayoutFromStore, getGetcontacts } = storeer const ui = reactive({ mode: 'set', // set | check tips: '请绘制手势密码', line: '#007aff', error: '#fa3534', fill: '#ffffff', stroke: '#c0c0c0' }) const state = reactive({ consumerId: '', secretGesturePasswordId: '', secretStringPasswordId: '', defaultSecretPasswordType: 0, // from 参数(用于校验成功后跳转) redirectAfterCheck: '', redirectTarget: '' }) const lockRef = ref(null) const setFlow = reactive({ first: '', pendingConfirm: false, submitting: false }) // API const API = { passwordSave: (payload) => ajax.post({ url: 'password', method: 'post', data: payload }), validatePassword: (id, password) => ajax.post({ url: 'validatePassword', method: 'post', data: { id, password } }), consumerSecretPassword: ({ consumerId, passwordId, defaultSecretPasswordType }) => ajax.post({ url: 'consumerSecretPassword', method: 'post', data: { consumerId, passwordId, defaultSecretPasswordType } }), consumerSecretPasswordShow: (consumerId) => ajax.post({ url: 'consumerSecretPasswordShow', method: 'post', data: { consumerId } }) } function navigateBack() { uni.navigateBack() } onLoad((option = {}) => { // consumerId:默认取自己 if (option.consumerId) state.consumerId = option.consumerId else if (store?.user?.id) state.consumerId = store.user.id else state.consumerId = uni.getStorageSync('consumerId') || '' // 允许从外部传入模式 / passwordId,用于“只校验”的场景 if (option.mode === 'check') ui.mode = 'check' if (option.passwordId) { state.secretGesturePasswordId = option.passwordId } if (option.redirect) { state.redirectAfterCheck = option.redirect } if (option.target) { state.redirectTarget = option.target } }) onMounted(() => { refreshProfile() }) // 查询当前用户的咖密配置 async function refreshProfile() { try { if (!state.consumerId) return const res = await API.consumerSecretPasswordShow(state.consumerId) console.log(res,'手势设置的回显密码') const data = res?.data || res if (!data) return state.secretGesturePasswordId = data.secretGesturePasswordId || state.secretGesturePasswordId || '' state.secretStringPasswordId = data.secretStringPasswordId || '' state.defaultSecretPasswordType = typeof data.defaultSecretPasswordType === 'number' ? data.defaultSecretPasswordType : Number(data.defaultSecretPasswordType || 0) } catch (e) {} } function switchMode(m) { ui.mode = m ui.tips = m === 'set' ? setFlow.pendingConfirm ? '请再次绘制确认' : '请绘制手势密码' : '请绘制已设置的手势进行验证' lockRef.value?.reset() } async function onPatternComplete(pwd) { if (ui.mode === 'set') await handleSetFlow(pwd) else await handleCheckFlow(pwd) } // 设置流程 async function handleSetFlow(pwd) { if (!setFlow.pendingConfirm) { setFlow.first = pwd setFlow.pendingConfirm = true ui.tips = '请再次绘制确认' lockRef.value?.flashSuccess(300) return } if (pwd !== setFlow.first) { ui.tips = '与第一次不一致,请重试' setFlow.first = '' setFlow.pendingConfirm = false lockRef.value?.flashError() return } if (setFlow.submitting) return setFlow.submitting = true try { const payload = { id: state.secretGesturePasswordId || undefined, password: pwd, type: GESTURE_TYPE } const saveRes = await API.passwordSave(payload) const newId = saveRes?.data?.id || saveRes?.id if (!newId) throw new Error('保存失败') state.secretGesturePasswordId = newId // 设置为默认手势(全局咖密) if (state.consumerId) { let res = await API.consumerSecretPassword({ consumerId: state.consumerId, passwordId: newId, defaultSecretPasswordType: GESTURE_TYPE }) console.log(res,'手势设置的密码') state.defaultSecretPasswordType = GESTURE_TYPE } ui.tips = '设置成功' lockRef.value?.flashSuccess() setFlow.first = '' setFlow.pendingConfirm = false uni.showToast({ title: '设置成功', icon: 'success' }) } catch (e) { ui.tips = '保存失败,请重试' lockRef.value?.flashError() } finally { setFlow.submitting = false } } // 验证流程 async function handleCheckFlow(pwd) { const id = state.secretGesturePasswordId if (!id) { ui.tips = '尚未设置手势密码' lockRef.value?.flashError() return } try { const res = await API.validatePassword(id, pwd) const result = res?.data?.result || res?.result if (result === 'success') { ui.tips = '验证成功' lockRef.value?.flashSuccess() uni.showToast({ title: '验证成功', icon: 'success' }) // 如果从好友页过来,需要验证通过后进入聊天页面 if (state.redirectAfterCheck) { setTimeout(() => { uni.navigateTo({ url: state.redirectAfterCheck + (state.redirectTarget ? state.redirectTarget : '') }) }, 200) } } else { ui.tips = result || '密码错误' lockRef.value?.flashError() } } catch (e) { ui.tips = '验证失败,请稍后再试' lockRef.value?.flashError() } } async function setAsDefault() { if (!state.secretGesturePasswordId || !state.consumerId) return try { await API.consumerSecretPassword({ consumerId: state.consumerId, passwordId: state.secretGesturePasswordId, defaultSecretPasswordType: GESTURE_TYPE }) state.defaultSecretPasswordType = GESTURE_TYPE uni.showToast({ title: '已设为默认(手势)', icon: 'success' }) } catch (e) { uni.showToast({ title: '设置默认失败', icon: 'none' }) } } </script> <style lang="scss" scoped> @import '@/assets/styles/global.scss'; .content { min-height: 100vh; position: relative; background-size: cover; } .overlay { position: absolute; inset: 0; background-size: cover; } .header { width: 94%; margin: 0 auto; } .header-inner { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; } .left-box, .right-box { position: absolute; top: 0; bottom: 0; width: 120rpx; display: flex; align-items: center; } .left-box { left: 0; justify-content: flex-start; } .right-box { right: 0; justify-content: flex-end; } .center-box { flex: none; } .page-body { width: 94%; margin: 0 auto; padding-bottom: 40rpx; } .card { margin-top: 24rpx; padding: 24rpx; background: #fff; border-radius: 16rpx; .row { display: flex; margin-bottom: 12rpx; font-size: 28rpx; } .label { color: #666; width: 260rpx; } .val { color: #111; flex: 1; } } .tabs { margin-top: 24rpx; display: flex; background: #fff; border-radius: 16rpx; overflow: hidden; .tab { flex: 1; text-align: center; padding: 22rpx 0; font-size: 30rpx; color: #666; } .tab.active { color: #007aff; font-weight: 600; background: #f5f8ff; } } .lock-wrap { margin-top: 30rpx; background: #fff; border-radius: 16rpx; padding: 20rpx 0 40rpx; } .btns { margin-top: 24rpx; display: grid; grid-template-columns: 1fr 1fr; gap: 20rpx; .btn { border-radius: 12rpx; } .primary { background: #007aff; color: #fff; } } </style>是有个pas.value.secretGesturePasswordId 这个就是手势的密码 然后验证密码就是 validatePassword 31.validatePassword密码验证text<!-- 内容 --> <view class="page-body"> <view class="card"> <view class="row"> <text class="label">手势密码ID:</text> <text class="val">{{ state.secretGesturePasswordId || '未设置' }}</text> </view> <view class="row"> <text class="label">默认解锁方式:</text> <text class="val"> {{ state.defaultSecretPasswordType === GESTURE_TYPE ? '手势' : state.defaultSecretPasswordType === 2 ? '文字' : '未设置' }} </text> </view> </view> <view class="tabs"> <view class="tab" :class="{ active: ui.mode === 'set' }" @click="switchMode('set')"> 设置/重设 </view> <view class="tab" :class="{ active: ui.mode === 'check' }" @click="switchMode('check')"> 验证 </view> </view> <view class="lock-wrap"> <GestureLock ref="lockRef" :tips="ui.tips" :min-points="4" :line-color="ui.line" :error-color="ui.error" :fill-color="ui.fill" :stroke-color="ui.stroke" @complete="onPatternComplete" /> </view> <view class="btns"> <button class="btn primary" @click="setAsDefault" :disabled="!state.secretGesturePasswordId"> 设为默认(手势) </button> </view> </view> </view> </view> </view>
入口参数
String id,
String password 要验证的密码
返回值
result(success时验证通过,其他为错误信息) password就是之前设置的密码 id 就是pas.value.secretGesturePasswordId 然后验证通过就到了这个
if (res?.data?.result === 'success') {
uni.navigateTo({
url: '/pages/sociAlize/Coffee/Coffeeability'
})
} else {
showToast(res.data.result || '验证失败', 'error')
} 这个页面 现在的要求是从if(pas.value.defaultSecretPasswordType===1){
textuni.navigateTo({ url: '/pages/sociAlize/Coffee/setpassword/gesture?decrypt=' + type }) }else if(pas.value.defaultSecretPasswordType===2){ uni.navigateTo({ url: '/pages/sociAlize/Coffee/setpassword/Textpassword?decrypt=' + type }) }这里来的直接验证密码就好了 通过直接跳转 不用再像之前的一二次验证了 之前的一二次验证是设置密码这是验证密码一个页面区分一下 到时候我给你一个截图就像 图片一样样式就好了 通过直接跳转就行 对了 这个gesture页面 微信小程序可以显示真机就不显示这个九空格了 你修复下什么原因 然后写一个 完整的gesture页面和 GestureLock组件页面实现所有的功能和修复app真机不显示的线条的问题两个页面都返回完整的页面 在真机上园和线条都不出来不知道为什么 加参数可以改这个else if (name === '咖密') { let type = true if(pas.value.defaultSecretPasswordType===1){ uni.navigateTo({ url: '/pages/sociAlize/Coffee/setpassword/gesture?decrypt=' + type }) }else if(pas.value.defaultSecretPasswordType===2){ uni.navigateTo({ url: '/pages/sociAlize/Coffee/setpassword/Textpassword?decrypt=' + type }) } // uni.navigateTo({ // url: '/pages/sociAlize/Coffee/Coffeeability' // }) } 参数