changeVipDetail.vue
5.54 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
<template>
<view>
<uni-collapse>
<uni-collapse-item :title="n.personCode+' - '+n.oldName" v-for="n in list" :key="n.id" open>
<view class="collapseBody">
<view>
<label>姓名:</label>
{{n.oldName}}
<text class="text-primary" v-if="n.oldName!=n.newName">变更为 </text>
<text class="text-danger" v-if="n.oldName!=n.newName">{{ n.newName }}</text>
</view>
<view>
<label>性别:</label>
{{ n.oldSex==0?'男':'女' }}
<text class="text-primary" v-if="n.oldSex!=n.newSex">变更为 </text>
<text class="text-danger" v-if="n.oldSex!=n.newSex">{{ n.newSex==0?'男':'女' }}</text>
</view>
<view>
<label>证件类型:</label>
{{ cardType[n.oldIdcType].label }}
<text class="text-primary" v-if="n.oldIdcType!=n.newIdcType">变更为 </text>
<text class="text-danger" v-if="n.oldIdcType!=n.newIdcType">{{ cardType[n.newIdcType].label }}
</text>
</view>
<view>
<label>证件号:</label>
{{ n.oldIdcCode }}
<text class="text-primary" v-if="n.oldIdcCode!=n.newIdcCode">变更为 </text>
<text class="text-danger" v-if="n.oldIdcCode!=n.newIdcCode">{{ n.newIdcCode }}</text>
</view>
<view>
<label>出生日期:</label>
{{ n.oldBirth?.slice(0,10) }}
<text v-if="n.oldBirth!=n.newBirth" class="text-gray">变更为 </text>
<text class="text-danger" v-if="n.oldBirth!=n.newBirth">{{ n.newBirth?.slice(0,10) }}</text>
</view>
<view v-if="n.fileUrl">
<label>附件: </label>
<text class="text-primary" @click="showImg(n)">
查看附件
</text>
</view>
<view>
<label>会员状态:</label>
<text class="text-primary" v-if="n.personCertStage==0">
新会员
</text>
<text class="text-primary" v-if="n.personCertStage==1">
待提交
</text>
<text class="text-warning" v-if="n.personCertStage==2">
缴费中
</text>
<text class="text-success" v-if="n.personCertStage==3">
正常
</text>
<text class="text-danger" v-if="n.personCertStage==4">
过期
</text>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
</template>
<script setup>
import {
ref
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
import * as api from '@/common/api.js'
import config from '@/config.js'
const queryParams = ref({})
const total = ref(0)
const list = ref([])
const popup = ref(null)
const type = ref('')
const form = ref({})
const cardType = ref([{
label: '身份证',
value: '0'
},
{
label: '港澳台通行证 ',
value: '1'
},
{
label: '中国护照',
value: '2'
},
{
label: '护照',
value: '3'
},
{
label: '户口本',
value: '4'
},
{
label: '香港身份证',
value: '5'
}
])
onLoad((option) => {
if (option.rangeId) {
queryParams.value.rangeId = option.rangeId
getList()
}
})
function getList() {
uni.showLoading({
title: '加载中'
})
api.addInfoModeList(queryParams.value).then(res => {
list.value = res.rows
list.value.forEach(item => {
item.fileUrl = JSON.parse(item.fileUrl)
})
total.value = res.total
uni.hideLoading()
})
}
function handleChange(a, b) {
type.value = b
form.value = a
console.log(form.value.newName)
popup.value.open()
}
function handleDelete(row) {
uni.showModal({
content: `确认删除会员${row.newName}`,
success: function(res) {
if (res.confirm) {
api.infoMod([row.id]).then(res => {
uni.showToast({
title: '操作成功'
})
getList()
})
}
}
})
}
function showImg(n) {
var str = config.baseUrl_api + n.fileUrl[0]?.url
if (n.fileUrl[0]?.url.indexOf('png') > -1 || n.fileUrl[0]?.url.indexOf('jpg') > -1 || n.fileUrl[0]?.url.indexOf(
'jpeg') > -1) {
uni.previewImage({
urls: [str],
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
} else {
goWebView(str)
}
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
}
</script>
<style scoped lang="scss">
.flexbox {
padding: 30rpx 30rpx 0
}
.danger-button {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.collapseBody {
padding: 0 30rpx;
box-sizing: border-box;
font-size: 28rpx;
view {
margin: 0 0 20rpx;
label {
width: 5em;
color: #999;
display: inline-block;
text-align: right;
}
}
}
.popBody {
background: #fff;
padding: 30rpx;
}
</style>