companyshenhe.vue
6.5 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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<template>
<view class="content">
<view class="writebox commnonpadding">
<view class="companyitem flextwo">
<view class="companyitemleft">企业名称</view>
<view class="cright">
<input type="text" placeholder="请填写企业名称" placeholder-class="entercom" @input="enterword" :data-name="'company_name'"/>
</view>
</view>
<view class="companyitem flextwo">
<view class="companyitemleft">企业联系人</view>
<view class="cright">
<input type="text" placeholder="请填写企业联系人" placeholder-class="entercom" @input="enterword" :data-name="'name'"/>
</view>
</view>
<view class="companyitem flextwo">
<view class="companyitemleft">联系电话</view>
<view class="cright">
<input type="number" placeholder="请填写联系电话" placeholder-class="entercom" @input="enterword" :data-name="'mobile'"/>
</view>
</view>
<view class="companyitem">
<view class="companyitemleft">营业执照</view>
<view class="compantphoto" @click="chooseImage">
<image :src="image==''?'../../static/picadd.png':image" mode=""></image>
</view>
</view>
<view class="companyitem flextwo">
<view class="companyitemleft">注册地址</view>
<view class="cright">
<input type="text" placeholder="请填写注册地址" placeholder-class="entercom" @input="enterword" :data-name="'site'"/>
</view>
</view>
<view class="companyitem flextwo">
<view class="companyitemleft">社会统一信用代码</view>
<view class="cright">
<input type="text" placeholder="请填写社会统一信用代码" placeholder-class="entercom" @input="enterword" :data-name="'code'"/>
</view>
</view>
<view class="companyitem flextwo">
<view class="companyitemleft">账单结算周期</view>
<view class="cright">
<input type="text" placeholder="请填写账单结算周期" placeholder-class="entercom" @input="enterword" :data-name="'period'"/>
</view>
</view>
<view class="companyitem flextwo">
<view class="companyitemleft">邀请码</view>
<view class="cright">
<input type="text" placeholder="请填写邀请码" placeholder-class="entercom" @input="enterword" :data-name="'salesman_number'"/>
</view>
</view>
</view>
<view class="flexone xieyibox commnonpadding">
<view class='agreeimg' @click="attencheck">
<image src="../../static/nosel.png" mode="" v-if="atten==false"></image>
<image src="../../static/selright.png" mode="" v-else></image>
</view>
<view class="agreetext">我已阅读 <text class="xieyitext">《某某某服务协议 》</text></view>
</view>
<view class="huiyuanbot boxsizing shenhe">
<view class="behuiyuanbtn" @click="submitshen">提交审核</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
showbanben: false,
obj:{
company_name:'',
name:'',
site:'',
code:'',
period:'',
salesman_number:''
},
image:'',
atten:false,
}
},
onLoad() {
},
methods: {
// 是否同意协议
attencheck(){
this.atten=!this.atten
},
enterword(e){
let name=e.currentTarget.dataset.name;
console.log(name);
this.obj[name]=e.detail.value;
},
// 选择上传照片
chooseImage() {
let that = this;
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
success: function (res) {
console.log(res.tempFilePaths[0])
app.upload('image', res.tempFilePaths[0],"post").then((res) => {
console.log('上传文件', res);
console.log(app.globalData.baseUrl)
that.image=app.globalData.imgurl+res.url;
console.log(that.image)
// that.cimage.push(res.kurl)
}).catch((err) => {
console.log(err)
})
},
fail: function (res) { }
})
},
// 提交审核
submitshen(){
let that = this;
if(that.obj.company_name==''){
uni.showToast({
title:"请填写企业名称",
icon:'none'
})
return false
}
if(that.obj.name==''){
uni.showToast({
title:"请填写企业联系人",
icon:'none'
})
return false
}
if(that.obj.mobile==''){
uni.showToast({
title:"请填写联系电话",
icon:'none'
})
return false
}
if(that.obj.mobile!=''){
var reg=/^[1][3,4,5,6,,7,8,9][0-9]{9}$/;
if(!reg.test(that.obj.mobile)){
uni.showToast({
title:'请填写正确的联系电话',
icon:'none'
})
return false
}
}
if(that.image==''){
uni.showToast({
title:"请上传营业执照",
icon:'none'
})
return false
}
if(that.obj.site==''){
uni.showToast({
title:"请填写注册地址",
icon:'none'
})
return false
}
if(that.obj.code==''){
uni.showToast({
title:"请填写社会统一信用代码",
icon:'none'
})
return false
}
if(that.obj.period==''){
uni.showToast({
title:"请填写账单结算周期",
icon:'none'
})
return false
}
if(that.atten==false){
uni.showToast({
title:"请勾选服务协议",
icon:"none"
})
return false
}
var url = 'member/submit_company_vip_audit';
var params = {
company_name:that.obj.company_name,
name:that.obj.name,
mobile:that.obj.mobile,
image:that.image,
site:that.obj.site,
code:that.obj.code,
period:that.obj.period,
salesman_number:that.obj.salesman_number
}
console.log('7766554', params)
app.post(url, params).then((res) => {
console.log(res);
uni.showToast({
title:'注册成功',
icon:"none"
})
setTimeout(function(){
uni.navigateBack({
checked:true
})
},1500)
}).catch((err) => {
console.log(err)
uni.showToast({
title:err.msg,
icon:'none'
})
})
},
}
}
</script>
<style>
@import url('../../base/usercenter');
page {
background: #F9F9FB;
}
.shenhe {
/* bottom:10rpx; */
position: unset;
}
.writebox {
background: #fff;
}
</style>