@ -0,0 +1,69 @@ |
|||||
|
<template> |
||||
|
<view class=""> |
||||
|
<uni-popup ref="popup"> |
||||
|
<view class="" style="align-items: center;background-color: #fff; border-radius: 15rpx; margin: 50rpx;"> |
||||
|
<view class="uni-center" |
||||
|
style="font-weight: bold; font-size: 40rpx;padding-top: 20rpx; padding-bottom: 20rpx;"> |
||||
|
{{title}} |
||||
|
</view> |
||||
|
<view class="" style="background-color: black; height: 1rpx; "> |
||||
|
|
||||
|
</view> |
||||
|
<scroll-view scroll-y="" |
||||
|
style="background-color: #fff; align-items: center; border-radius: 10rpx; height: 600rpx; width: 100%"> |
||||
|
<view class="uni-flex " style="flex-direction: column; " v-for="(item,index) in dataList"> |
||||
|
<view class="" style="font-size: 38rpx; padding: 25rpx;" @click="select(item)"> |
||||
|
<text>{{index+1}}. {{item.label}}</text> |
||||
|
</view> |
||||
|
<u-line></u-line> |
||||
|
</view> |
||||
|
|
||||
|
</scroll-view> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
</uni-popup> |
||||
|
|
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dataList: [], |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
methods: { |
||||
|
openScanPopup(list) { |
||||
|
this.dataList = list; |
||||
|
this.$refs.popup.open('center') |
||||
|
}, |
||||
|
closeScanPopup() { |
||||
|
this.$refs.popup.close() |
||||
|
}, |
||||
|
select(item) { |
||||
|
this.closeScanPopup(); |
||||
|
this.$emit("select", item) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
.popup_box { |
||||
|
width: 500rpx; |
||||
|
height: 500rpx; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,45 @@ |
|||||
|
//focus.js
|
||||
|
|
||||
|
/** |
||||
|
* @description 用于各个功能中,光标聚焦到指定input上 |
||||
|
* 用法如下: |
||||
|
* <input :focus="foucsIndex == 1" /> |
||||
|
* 调用 $toFoucs(1) 光标即可聚焦到该input上 |
||||
|
* @author bing |
||||
|
* @date 2023-08-04 15:58 |
||||
|
*/ |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
foucsIndex: 0, |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
/** |
||||
|
* @description 定位光标到指定input框 |
||||
|
* @author bing |
||||
|
* @date 2023-08-04 17:16 |
||||
|
* @param {Number} to 要定位到的input, |
||||
|
* @param {Function} callback 定位之后的回调 |
||||
|
* @param {boolean} hideKeyboard 是否关闭软键盘,默认关闭 |
||||
|
*/ |
||||
|
$toFoucs(to, hideKeyboard = true, callback, ) { |
||||
|
this.foucsIndex = 9999; |
||||
|
this.$nextTick(() => { |
||||
|
this.foucsIndex = to; |
||||
|
hideKeyboard ? this.$hideKeyboard() : "" |
||||
|
callback ? callback() : '' |
||||
|
}) |
||||
|
}, |
||||
|
// 关闭软键盘,防冻
|
||||
|
$hideKeyboard() { |
||||
|
var interval = setInterval(function() { |
||||
|
uni.hideKeyboard(); //隐藏软键盘
|
||||
|
}, 10); |
||||
|
setTimeout(() => { |
||||
|
clearInterval(interval); |
||||
|
}, 1000); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 492 B |
Before Width: | Height: | Size: 471 B |
Before Width: | Height: | Size: 885 B |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 432 B |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 498 B |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 803 B |
Before Width: | Height: | Size: 79 KiB |