Browse Source

fix: 索组件

master
zhang_li 8 months ago
parent
commit
22311df623
  1. 2
      .env.development
  2. 103
      src/components/search/index.vue
  3. 469
      src/components/verifition/Verify.vue
  4. 14
      src/components/verifition/utils/ase.js
  5. 17
      src/components/verifition/utils/request.js
  6. 555
      src/components/verifition/verifyPoint/verifyPoint.vue
  7. 661
      src/components/verifition/verifySlider/verifySlider.vue

2
.env.development

@ -1,3 +1,3 @@
VITE_BASE_URL=http://192.168.0.106:12080/admin-api VITE_BASE_URL=http://localhost:12080/admin-api
VITE_BASE_URL_IMAGE=http://localhost:12080/admin-api VITE_BASE_URL_IMAGE=http://localhost:12080/admin-api

103
src/components/search/index.vue

@ -1,18 +1,10 @@
<template> <template>
<view class="content"> <view class="content">
<view class="screen-input"> <view class="screen-input">
<u-search <u-search v-model='keyWord' :show-action='false' :bg-color="searchData.bgBolor ||'white'"
v-model='keyWord' :border-color="searchData.borderColor ||'#E4E4E4'" :shape="searchData.shape ||'square'"
:show-action='false' :height="searchData.height || 80" :placeholder="searchData.placeholder ||'请输入设备名称'" :clearabled="true"
:bg-color="searchData.bgBolor ||'white'" @search='search' @clear='clear'>
:border-color="searchData.borderColor ||'#E4E4E4'"
:shape="searchData.shape ||'square'"
:height="searchData.height || 80"
:placeholder="searchData.placeholder ||'请输入设备名称'"
:clearabled="true"
@search='search'
@clear='clear'
>
</u-search> </u-search>
</view> </view>
<view class="screen-btn" @click="screen" v-if="isShowScreen"> <view class="screen-btn" @click="screen" v-if="isShowScreen">
@ -22,40 +14,72 @@
</view> </view>
</template> </template>
<script> <script setup lang="ts">
export default { import {
props: { ref,
searchData:{ defineProps,
defineEmits
} from 'vue'
const keyWord = ref('')
const props = defineProps({
searchData: {
type: Object, type: Object,
default:()=>{return {}}, default: () => { return {} },
require:false require: false
}, },
isShowScreen: { isShowScreen: {
type: Boolean, type: Boolean,
default:()=>{return true}, default: () => { return true },
require:false require: false
},
},
data() {
return {
keyWord: '',
} }
}, });
methods: { function search() {
// console.log( keyWord.value)
search() { emits('search', keyWord.value)
this.$emit('search', this.keyWord)
},
//
clear() {
this.$emit('search', '')
},
//
screen() {
this.$emit('screen')
} }
//
function clear() {
emits('search', '')
} }
//
function screen() {
emits('screen')
} }
const emits = defineEmits(['search','screen']);
// export default {
// props: {
// searchData:{
// type: Object,
// default:()=>{return {}},
// require:false
// },
// isShowScreen: {
// type: Boolean,
// default:()=>{return true},
// require:false
// },
// },
// data() {
// return {
// keyWord: '',
// }
// },
// methods: {
// //
// search() {
// this.$emit('search', this.keyWord)
// },
// //
// clear() {
// this.$emit('search', '')
// },
// //
// screen() {
// this.$emit('screen')
// }
// }
// }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -73,7 +97,7 @@
.screen-btn { .screen-btn {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left:20rpx; margin-left: 20rpx;
image { image {
width: 30rpx; width: 30rpx;
@ -81,5 +105,4 @@
} }
} }
} }
</style> </style>

469
src/components/verifition/Verify.vue

File diff suppressed because one or more lines are too long

14
src/components/verifition/utils/ase.js

@ -1,14 +0,0 @@
import CryptoJS from 'crypto-js'
/**
* @word 要加密的内容
* @keyWord String 服务器随机返回的关键字
* */
export function aesEncrypt(word, keyWord = "XwKsGlMcdPMEhR1B") {
var key = CryptoJS.enc.Utf8.parse(keyWord);
var srcs = CryptoJS.enc.Utf8.parse(word);
var encrypted = CryptoJS.AES.encrypt(srcs, key, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
});
return encrypted.toString();
}

17
src/components/verifition/utils/request.js

@ -1,17 +0,0 @@
import config from '@/config'
const baseUrl = config.baseUrl
export const myRequest = (option = {}) => {
return new Promise((reslove, reject) => {
uni.request({
url: baseUrl + option.url,
data: option.data,
method: option.method || "GET",
success: (result) => {
reslove(result)
},
fail: (error) => {
reject(error)
}
})
})
}

555
src/components/verifition/verifyPoint/verifyPoint.vue

File diff suppressed because one or more lines are too long

661
src/components/verifition/verifySlider/verifySlider.vue

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save