Browse Source

fix: 索组件

master
zhang_li 8 months ago
parent
commit
22311df623
  1. 2
      .env.development
  2. 115
      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

115
src/components/search/index.vue

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