perfect.vue
6.64 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
<template>
<view>
<view class="pd30" style="padding: 30rpx 30rpx 180rpx;">
<uni-steps :options="list1" :active="active" />
<view class="wBox" v-if="active == 0">
<uni-forms ref="baseForm" :modelValue="form" label-width="100">
<uni-forms-item label="单位名称" required>
<uni-easyinput v-model="form.baseName" :disabled="!editIng"
placeholder="单位名称" /></uni-forms-item>
<uni-forms-item label="单位类型" required>
<uni-data-select :disabled="!editIng" v-model="form.type"
:localdata="typeList"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="联系人" required>
<uni-easyinput v-model="form.contact" :disabled="!editIng" placeholder="请输入联系人姓名" />
</uni-forms-item>
<uni-forms-item label="联系方式" required>
<uni-easyinput v-model="form.phone" :disabled="!editIng" placeholder="请输入联系方式" />
</uni-forms-item>
<uni-forms-item label="所属省份" required>
<uni-data-select v-if="editIng" v-model="form.belongProvinceId"
:localdata="options"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="地址" required>
<uni-data-select v-if="editIng" v-model="form.coordinates1"
:localdata="options"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="详细地址" required><uni-easyinput v-model="form.siteAddress" :disabled="!editIng"
placeholder="请输入详细地址" type='textarea' /></uni-forms-item>
<uni-forms-item label="机构介绍" required><uni-easyinput v-model="form.introduce" placeholder="请输入机构介绍"
:disabled="!editIng" type='textarea' /></uni-forms-item>
</uni-forms>
<view class="fixedBottom">
<button class="btn-red" @click="submit()">提交,下一步</button>
</view>
</view>
<view class="wBox" v-if="active == 1">
<view>
<view>认证状态:
<text v-if="authenticationStatusa == 0 ||!authenticationStatusa" class="text-danger">未认证</text>
<text v-if="authenticationStatusa == 1" class="text-success">认证中</text>
<text v-if="authenticationStatusa == 2" class="text-success">已认证</text>
<text v-if="authenticationStatusa == 3" class="text-danger">认证未通过</text>
<text v-if="authenticationStatusa == 4" class="text-danger">即将过期</text>
<text v-if="authenticationStatusa == 5" class="text-danger">已过期</text>
</view>
<view>
<button v-if="authenticationStatusa==2" type="primary" :disabled="!result"
@click="audioFN1">去缴费</button>
<button v-if="authenticationStatusa!=2" type="primary" :disabled="!result"
@click="audioFN2">去认证</button>
<button v-if="form.deptType!=2" type="primary" @click="auditEditFN">审核详情</button>
</view>
</view>
<uni-forms>
<uni-forms-item label="选择所属协会" required>
<uni-data-select :disabled="!editIng" v-model="form.parentId"
:localdata="typeList" @change="changCase"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="机构名称" required>
<uni-easyinput v-model="form.name" :disabled="!editIng" placeholder="请输入机构名称" />
</uni-forms-item>
</uni-forms>
</view>
</view>
</view>
</template>
<script setup>
import {
ref
} from 'vue';
import * as api from '@/common/api.js';
import {
onLoad,
onShow
} from '@dcloudio/uni-app';
import config from '@/config.js'
const app = getApp();
const form = ref({
type: '1'
});
const typeList = ref([{
value: '1',
text: '企业'
}, {
value: '1',
text: '国家组织'
}, {
value: '1',
text: '社会组织'
}, {
value: '1',
text: '其他'
}])
const options = ref([])
const regionArr = ref();
const regionsList = ref([]);
const ranksList = ref([]);
const current = ref(0);
const groupId = ref(0);
const currIndex = ref(null);
const cptId = ref();
const signType = ref();
const editIng = ref(true);
const isSign = ref(false);
const query = ref({
type: 0
});
const active = ref(0)
const memberInfo = ref({})
const authenticationStatus = ref()
const list1 = ref([{
title: '完善信息'
}, {
title: '会员认证'
}])
onLoad(option => {
if (app.globalData.isLogin) {
init()
} else {
app.firstLoadCallback = () => {
init()
};
}
});
function init() {
getDetail()
getRegionsList()
}
function getDetail() {
api.getMyOwnMemberInfo().then(res => {
if (res.data.memberInfo) {
form.value = res.data.memberInfo
}
form.value.coordinates1 = []
authenticationStatus.value = res.data.authenticationStatus
if (form.value.siteProvinceId) {
form.value.coordinates1.push(form.value.siteProvinceId)
}
if (form.value.siteCityId) {
form.value.coordinates1.push(form.value.siteCityId)
}
if (form.value.siteRegionId) {
form.value.coordinates1.push(form.value.siteRegionId)
}
})
}
function getRegionsList() {
api.regionsList().then(res => {
options.value = res.data;
});
}
function submit() {
// 验证必填项
if (form.value.baseName == '') {
uni.showToast({
title: '请填写单位名称',
duration: 2000,
icon: 'none'
})
return
}
if (form.value.contact == '') {
uni.showToast({
title: '请填写联系人',
duration: 2000,
icon: 'none'
})
return
}
if (form.value.phone == '') {
uni.showToast({
title: '请填写联系电话',
duration: 2000,
icon: 'none'
})
return
}
if (form.value.belongProvinceId == '') {
uni.showToast({
title: '请选择所属省份',
duration: 2000,
icon: 'none'
})
return
}
if (form.value.siteAddress == '') {
uni.showToast({
title: '请填写详细地址',
duration: 2000,
icon: 'none'
})
return
}
if (form.value.coordinates1 == '') {
uni.showToast({
title: '选择所在地址',
duration: 2000,
icon: 'none'
})
return
}
if (form.value.introduce == '') {
uni.showToast({
title: '请填写机构介绍',
duration: 2000,
icon: 'none'
})
return
}
api.createMyMember(form.value).then(res => {
if (res.data.token) {
uni.setStorageSync('token', 'Bearer ' + res.data.token)
}
active.value = 1
})
}
</script>
<style lang="scss" scoped>
.wBox {
width: 700rpx;
padding: 30rpx;
margin: 20rpx auto 0;
background: #FFFFFF;
box-shadow: 0rpx 12rpx 116rpx 0rpx rgba(196, 203, 214, 0.1);
border-radius: 15rpx;
}
</style>