Sfoglia il codice sorgente

小程序修改证件类型取动态数据

gyj 2 anni fa
parent
commit
e16107be27
4 ha cambiato i file con 63 aggiunte e 31 eliminazioni
  1. 8
    0
      api/handlecase/index.js
  2. 8
    0
      api/login.js
  3. 13
    5
      pages/handlecase/component/newlyAddedCase.vue
  4. 34
    26
      pages/register.vue

+ 8
- 0
api/handlecase/index.js Vedi File

@@ -184,4 +184,12 @@ export function msCaseSign(data) {
184 184
 		method: "post",
185 185
 		data: data,
186 186
 	})
187
+}
188
+//证件类型
189
+export function idType(data) {
190
+	return request({
191
+		url: '/system/dict/data/type/id_type',
192
+		method: 'get',
193
+		params: data
194
+	})
187 195
 }

+ 8
- 0
api/login.js Vedi File

@@ -93,4 +93,12 @@ export function wxregister(data) {
93 93
 		method: 'post',
94 94
 		data: data
95 95
 	})
96
+}
97
+// 获取证件类型
98
+export function idType(data){
99
+	return request({
100
+		url: '/system/dict/data/type/id_type',
101
+		method: 'get',
102
+		params: data
103
+	})
96 104
 }

+ 13
- 5
pages/handlecase/component/newlyAddedCase.vue Vedi File

@@ -163,7 +163,8 @@
163 163
 		caseApplicationInsert,
164 164
 		updateComfire,
165 165
 		caseApplicationSelectById,
166
-		getUserInfo
166
+		getUserInfo,
167
+		idType
167 168
 	} from '../../../api/handlecase/index.js'
168 169
 	import {
169 170
 		getToken
@@ -173,10 +174,7 @@
173 174
 		data() {
174 175
 			return {
175 176
 				baseUrl: config.baseUrlTJ,
176
-				certificate: [
177
-				          { value: 0, text: "身份证" },
178
-				          { value: 1, text: "护照" },
179
-				        ],
177
+				certificate: [],
180 178
 				nationality: [
181 179
 					{ value: 0, text: "国内" },
182 180
 					{ value: 1, text: "国外" },
@@ -599,6 +597,15 @@
599 597
 			// 改变证件类型
600 598
 			changeDocment(e){
601 599
 				console.log(e)
600
+			},
601
+			// 获取证件类型
602
+			getIdType(){
603
+				idType().then(res =>{
604
+					console.log(res)
605
+					res.data.forEach(item =>{
606
+						this.certificate.push({value:item.dictSort,text:item.dictLabel})
607
+					})
608
+				})
602 609
 			}
603 610
 		},
604 611
 		onLoad(data) {
@@ -617,6 +624,7 @@
617 624
 			}
618 625
 			this.getTemplateFn()
619 626
 			this.getUserInfoNumber()
627
+			this.getIdType() //获取证件类型
620 628
 		},
621 629
 		onReady() {
622 630
 			this.$refs.form.setRules(this.rules)

+ 34
- 26
pages/register.vue Vedi File

@@ -30,14 +30,14 @@
30 30
 			</view>
31 31
 			<view class="input-item flex align-center">
32 32
 				<uni-data-select
33
-						style="text-align: left;width: 200px;"
33
+						style="text-align: left;width: 200px;d"
34 34
 						v-model="registerForm.nationality"
35 35
 				       :localdata="nationality"
36 36
 				     ></uni-data-select>
37 37
 			</view>
38 38
 			<view class="input-item flex align-center">
39 39
 				<!-- <view class="iconfont icon-user icon"></view> -->
40
-				<input v-model="registerForm.identityNo" class="input" type="text" :placeholder="registerForm.idType==0?'请输入身份证号':'请输入护照'"
40
+				<input v-model="registerForm.identityNo" class="input" type="text" placeholder="请输入证件号码"
41 41
 					maxlength="30" />
42 42
 			</view>
43 43
 			<view class="input-item flex align-center">
@@ -84,7 +84,8 @@
84 84
 		getCodeImg,
85 85
 		register,
86 86
 		sendCode,
87
-		wxregister
87
+		wxregister,
88
+		idType
88 89
 	} from '@/api/login'
89 90
 import constant from '../utils/constant'
90 91
 
@@ -109,10 +110,7 @@ import constant from '../utils/constant'
109 110
 					nationality:0
110 111
 				},
111 112
 				sysType:null,
112
-				certificate: [
113
-				          { value: 0, text: "身份证" },
114
-				          { value: 1, text: "护照" },
115
-				        ],
113
+				certificate: [],
116 114
 				nationality: [
117 115
 					{ value: 0, text: "国内" },
118 116
 					{ value: 1, text: "国外" },
@@ -123,24 +121,6 @@ import constant from '../utils/constant'
123 121
 		created() {
124 122
 			this.getCode()
125 123
 		},
126
-		onLoad(option) {
127
-			this.sysType = uni.getStorageSync('sysType');
128
-			// this.passportVal = option;
129
-			if(option.valus==1){
130
-				this.registerForm.idType =1
131
-				this.registerForm.nationality =1
132
-			}else{
133
-				let {
134
-					params
135
-				} = option
136
-				// this.improvedetail = JSON.parse(improvedetail)
137
-				let paramsObj = JSON.parse(params);
138
-				this.registerForm.name = paramsObj.nickName;
139
-				this.registerForm.identityNo = paramsObj.idCard
140
-				this.registerForm.id = paramsObj.id
141
-			}
142
-			
143
-		},
144 124
 		methods: {
145 125
 			// 获取手机验证码
146 126
 			getCodeNumber(data) {
@@ -235,9 +215,37 @@ import constant from '../utils/constant'
235 215
 				})
236 216
 			},
237 217
 			certificateValue(e){
238
-				this.registerForm.idType = e
218
+				// this.registerForm.idType = e
219
+			},
220
+			// 获取证件类型
221
+			getIdType(){
222
+				idType().then(res=>{
223
+					res.data.forEach(item=>{
224
+						 this.certificate.push({value:item.dictSort,text:item.dictLabel})
225
+					})
226
+					console.log(this.certificate)
227
+				})
239 228
 			}
240 229
 		},
230
+		onLoad(option) {
231
+			this.sysType = uni.getStorageSync('sysType');
232
+			// this.passportVal = option;
233
+			console.log(option)
234
+			if(option.valus==1){
235
+				this.registerForm.idType =0
236
+				this.registerForm.nationality =0
237
+			}else{
238
+				let {
239
+					params
240
+				} = option
241
+				// this.improvedetail = JSON.parse(improvedetail)
242
+				let paramsObj = JSON.parse(params);
243
+				this.registerForm.name = paramsObj.nickName;
244
+				this.registerForm.identityNo = paramsObj.idCard
245
+				this.registerForm.id = paramsObj.id
246
+			}
247
+			this.getIdType()
248
+		},
241 249
 	}
242 250
 </script>
243 251