Przeglądaj źródła

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

gyj 2 lat temu
rodzic
commit
e16107be27

+ 8
- 0
api/handlecase/index.js Wyświetl plik

184
 		method: "post",
184
 		method: "post",
185
 		data: data,
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 Wyświetl plik

93
 		method: 'post',
93
 		method: 'post',
94
 		data: data
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 Wyświetl plik

163
 		caseApplicationInsert,
163
 		caseApplicationInsert,
164
 		updateComfire,
164
 		updateComfire,
165
 		caseApplicationSelectById,
165
 		caseApplicationSelectById,
166
-		getUserInfo
166
+		getUserInfo,
167
+		idType
167
 	} from '../../../api/handlecase/index.js'
168
 	} from '../../../api/handlecase/index.js'
168
 	import {
169
 	import {
169
 		getToken
170
 		getToken
173
 		data() {
174
 		data() {
174
 			return {
175
 			return {
175
 				baseUrl: config.baseUrlTJ,
176
 				baseUrl: config.baseUrlTJ,
176
-				certificate: [
177
-				          { value: 0, text: "身份证" },
178
-				          { value: 1, text: "护照" },
179
-				        ],
177
+				certificate: [],
180
 				nationality: [
178
 				nationality: [
181
 					{ value: 0, text: "国内" },
179
 					{ value: 0, text: "国内" },
182
 					{ value: 1, text: "国外" },
180
 					{ value: 1, text: "国外" },
599
 			// 改变证件类型
597
 			// 改变证件类型
600
 			changeDocment(e){
598
 			changeDocment(e){
601
 				console.log(e)
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
 		onLoad(data) {
611
 		onLoad(data) {
617
 			}
624
 			}
618
 			this.getTemplateFn()
625
 			this.getTemplateFn()
619
 			this.getUserInfoNumber()
626
 			this.getUserInfoNumber()
627
+			this.getIdType() //获取证件类型
620
 		},
628
 		},
621
 		onReady() {
629
 		onReady() {
622
 			this.$refs.form.setRules(this.rules)
630
 			this.$refs.form.setRules(this.rules)

+ 34
- 26
pages/register.vue Wyświetl plik

30
 			</view>
30
 			</view>
31
 			<view class="input-item flex align-center">
31
 			<view class="input-item flex align-center">
32
 				<uni-data-select
32
 				<uni-data-select
33
-						style="text-align: left;width: 200px;"
33
+						style="text-align: left;width: 200px;d"
34
 						v-model="registerForm.nationality"
34
 						v-model="registerForm.nationality"
35
 				       :localdata="nationality"
35
 				       :localdata="nationality"
36
 				     ></uni-data-select>
36
 				     ></uni-data-select>
37
 			</view>
37
 			</view>
38
 			<view class="input-item flex align-center">
38
 			<view class="input-item flex align-center">
39
 				<!-- <view class="iconfont icon-user icon"></view> -->
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
 					maxlength="30" />
41
 					maxlength="30" />
42
 			</view>
42
 			</view>
43
 			<view class="input-item flex align-center">
43
 			<view class="input-item flex align-center">
84
 		getCodeImg,
84
 		getCodeImg,
85
 		register,
85
 		register,
86
 		sendCode,
86
 		sendCode,
87
-		wxregister
87
+		wxregister,
88
+		idType
88
 	} from '@/api/login'
89
 	} from '@/api/login'
89
 import constant from '../utils/constant'
90
 import constant from '../utils/constant'
90
 
91
 
109
 					nationality:0
110
 					nationality:0
110
 				},
111
 				},
111
 				sysType:null,
112
 				sysType:null,
112
-				certificate: [
113
-				          { value: 0, text: "身份证" },
114
-				          { value: 1, text: "护照" },
115
-				        ],
113
+				certificate: [],
116
 				nationality: [
114
 				nationality: [
117
 					{ value: 0, text: "国内" },
115
 					{ value: 0, text: "国内" },
118
 					{ value: 1, text: "国外" },
116
 					{ value: 1, text: "国外" },
123
 		created() {
121
 		created() {
124
 			this.getCode()
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
 		methods: {
124
 		methods: {
145
 			// 获取手机验证码
125
 			// 获取手机验证码
146
 			getCodeNumber(data) {
126
 			getCodeNumber(data) {
235
 				})
215
 				})
236
 			},
216
 			},
237
 			certificateValue(e){
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
 </script>
250
 </script>
243
 
251