myDaili.vue
4.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<template>
<view class="dlBox-container">
<!-- 代理表单内容 -->
<view class="dlContent" v-if="isShow">
<view class="name dlItem">
<view class="name-left">
<text>*</text>真实姓名
</view>
<view class="name-right">
<input :disabled='qwer' type="text" v-model="userName" placeholder="请输入您的姓名" />
</view>
</view>
<view class="id dlItem">
<view class="name-left">
<text>*</text>身份证号
</view>
<view class="name-right">
<input :disabled='qwer' maxlength="18" type="idcard" v-model="userID" placeholder="请输入您的身份证号" />
</view>
</view>
<view class="workAddress dlItem">
<view class="name-left s6 ">
单位名称
</view>
<view class="name-right ml">
<input :disabled='qwer' type="text" v-model="danweiAddress" placeholder="请输入您的单位名称" />
</view>
</view>
<view class="telPhone dlItem">
<view class="name-left">
<text>*</text>联系电话
</view>
<view class="name-right">
<input :disabled='qwer' maxlength="11" type="number" v-model="telPhone" placeholder="请输入您的联系电话" />
</view>
</view>
</view>
<!-- 代理申请按钮 -->
<view class="dlBtn flex justifyBetween">
<view class="qxBtn btnCom" @click="FhBtn">
取消
</view>
<view class="qdBtn btnCom" @click="isjiance">
确认
</view>
</view>
</view>
</template>
<script>
let that;
export default {
data() {
return {
qwer: false, //false是能修改
isShow:false,
newArry: [],
userName: "",
userID: "",
danweiAddress: '',
telPhone: '',
showImg: true,
}
},
onShow() {
that = this;
this.$rqs('/api/agent/index').then(res=>{
if(res.data.code == 1){
this.userName =res.data.data.nickname
this.userID =res.data.data.identity
this.telPhone = res.data.data.mobile
this.danweiAddress =''|| res.data.data.unit
this.isShow = true;
}else{
this.isShow = true;
}
})
},
mounted() {
},
onLoad(e) {
console.log(e)
console.log(typeof e.showImg);
if(e.showImg == "false"){
this.qwer = true
}else if(e.b){
this.qwer = true
}
},
watch: {
},
methods: {
//验证输入内容
isjiance(e) {
if(/^(?:[\u4e00-\u9fa5·]{2,16})$/.test(this.userName)){
if(/^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(this.userID)){
if(/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/.test(this.telPhone)){
let data = {
unit:this.danweiAddress || '',
identity:this.userID,
mobile:this.telPhone,
name:this.userName
}
console.log(data.unit);
this.$rqs('/api/agent/add',data).then(res=>{
console.log(res.errMs == 'request:ok');//false
// if(res.errMs == 'request:ok' || )
uni.setStorageSync("phone",this.telPhone)
uni.reLaunch({
url:'../my?a=1'
})
})
}else{
uni.showToast({
icon: 'none',
title: '电话号填写有误'
})
}
}else{
uni.showToast({
icon: 'none',
title: '身份证号填写有误'
})
}
}else{
uni.showToast({
icon: 'none',
title: '真实姓名填写有误'
})
}
},
FhBtn() {
uni.navigateBack({
delta: 1
})
},
QdBtn() {
this.showImg = false;
uni.reLaunch({
url: "../my?e=" + this.showImg
})
}
}
}
</script>
<style>
page {
width: 100%;
height: 100%;
background-color: #EBEBEB;
}
.dlBox-container {
width: 100%;
box-sizing: border-box;
padding: 32rpx 32rpx 0;
}
.dlContent {
height: 472rpx;
border-radius: 16rpx;
box-sizing: border-box;
margin-bottom: 100rpx;
padding: 40rpx 32rpx;
background: rgba(255, 255, 255, 1);
}
.dlItem {
display: flex;
height: 74rpx;
margin-bottom: 32rpx;
border-bottom: 2px solid #f1f1f1;
}
.dlItem:last-child {
margin-bottom: 0;
}
.name-left {
height: 40rpx;
margin-right: 32rpx;
}
.dianhu {
color: #323233;
}
.s,
.ml {
margin-left: 14rpx;
}
.name-left text {
color: #FC4338;
}
.name-right {
height: 40rpx;
font-size: 28rpx;
}
.s6 {
padding-left: 8rpx;
}
.dlBtn {
height: 80rpx;
}
.qxBtn {
background: rgba(255, 255, 255, 1);
}
.qdBtn {
background: linear-gradient(119.1deg, rgba(52, 94, 71, 1) 0%, rgba(62, 85, 78, 1) 100%);
color: #FFFFFF;
}
.aa {
margin-left: 14rpx;
}
.btnCom {
width: 326rpx;
text-align: center;
line-height: 80rpx;
}
</style>