From b5f084460e9e639358fbf91056a86be8d0a5c4b2 Mon Sep 17 00:00:00 2001
From: yaolonglong <yaolonglong15@163.com>
Date: 星期四, 09 十月 2025 20:18:57 +0800
Subject: [PATCH] 获取验证码功能
---
policy/policyApply/perPage.vue | 100 +++++++++++++++++++++++++++++++++++++++----------
1 files changed, 79 insertions(+), 21 deletions(-)
diff --git a/policy/policyApply/perPage.vue b/policy/policyApply/perPage.vue
index e9f7cca..ccebd16 100644
--- a/policy/policyApply/perPage.vue
+++ b/policy/policyApply/perPage.vue
@@ -2,12 +2,21 @@
<u-popup mode="button" :safeAreaInsetBottom="false" :show="show" @close="close" @open="open" z-index="8000" bgColor="#fff">
<view class="bg-box">
<view class="title">閫夋嫨闅忚浜哄憳</view>
- <scroll-view scroll-y="true" style="height: 600rpx;">
- <u-checkbox-group iconPlacement="right" v-model="checkboxValue1" placement="column" @change="checkboxChange">
- <u-checkbox :customStyle="{marginBottom: '40rpx', }" v-for="(item, index) in checkboxList1" :key="index"
- :name="item.userId" :label="`${item.dept.deptName}--${item.nickName}`">
- </u-checkbox>
- </u-checkbox-group>
+ <u-search v-model="nickName" @search="enforceList" @clear="clearContent" @confirm="enforceList" @custom="enforceList()"></u-search>
+ <scroll-view scroll-y="true" style="height: 500rpx;margin-top: 20rpx; margin-bottom: 100rpx;">
+ <view v-if="checkboxList1.length">
+ <u-checkbox-group iconPlacement="right" v-model="checkboxValue1" placement="column" @change="checkboxChange">
+ <u-checkbox :customStyle="{marginBottom: '40rpx', }" v-for="(item, index) in checkboxList1" :key="index"
+ :name="item.userId" :label="`${item.dept.deptName}--${item.nickName}`">
+ </u-checkbox>
+ </u-checkbox-group>
+ </view>
+ <view class="set-color" v-else>
+ <view class="set-center">
+ <u-icon name="file-text" size="30" color="gray"></u-icon>
+ <view style="width: 100%;margin-top: 20rpx;">鏆傛棤鏁版嵁</view>
+ </view>
+ </view>
</scroll-view>
<view class="set-flex set-flex-content-between down-options">
<view class="button-per">
@@ -22,13 +31,14 @@
</template>
<script>
+ import { enforceList } from '@/api/policy.js'
export default {
- props: {
- list: {
- type: Array,
- default: () => []
- }
- },
+ // props: {
+ // list: {
+ // type: Array,
+ // default: () => []
+ // }
+ // },
data() {
return {
show: false,
@@ -36,18 +46,23 @@
// 鍩烘湰妗堝垪鏁版嵁
checkboxList1: [
],
+ nickName: ""
}
},
watch: {
- list: {
- handler(n) {
- this.checkboxList1 = n
- },
- immediate: true
- }
+ // list: {
+ // handler(n) {
+ // this.checkboxList1 = n
+ // },
+ // immediate: true
+ // }
},
methods: {
+ clearContent() {
+ this.nickName = ""
+ //this.enforceList()
+ },
checkboxChange(n) {
// console.log('change', n);
},
@@ -55,13 +70,42 @@
this.show = false
},
open(list) {
-
this.show = true
+ this.checkboxValue1 = []
+ this.nickName = ""
+ this.checkboxList1 = []
+ this.enforceList()
},
enteryResult() {
- this.$emit('selectValue', this.checkboxValue1)
+ let list = []
+ this.checkboxList1.forEach(item => {
+ if(this.checkboxValue1.includes(item.userId)) {
+ list.push({
+ peerDeptId: item.dept.deptId,
+ peerDeptName: item.dept.deptName,
+ peerId: item.userId,
+ peerPhone: item.phonenumber,
+ peerType: 2,
+ peerUser: item.nickName
+ })
+ }
+ })
+ this.$emit('selectValue', list)
this.close()
- console.log(44)
+ },
+ enforceList() {
+ // if(this.nickName==''){
+ // uni.showToast({
+ // title: '璇疯緭鍏ュ叧閿瓧鎼滅储',
+ // icon: 'none'
+ // })
+ // return
+ // }
+ const value = uni.getStorageSync('userInfo')
+ const id = value.deptId
+ enforceList({nickName:this.nickName,deptId:id}).then(val => {
+ this.checkboxList1 = val.data.data
+ })
}
}
}
@@ -96,4 +140,18 @@
padding: 0 32rpx;
left: 0;
}
+ .set-color{
+ color: gray;
+ text-align: center;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 300rpx;
+ }
+ .set-center{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-wrap: wrap;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.1