zhongrj
2024-03-21 542f2f5f4e8097bd9d436a52119feeeec63bdfaa
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
<template>
    <view>
        <view class="content bgc-ff">
            <u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="90"
                :labelStyle="{fontSize:'28rpx'}">
                <u-form-item label="姓名" prop="info.name" borderBottom>
                    <u-input v-model="info.name" border="none" placeholder="请输入姓名" placeholderClass="f-28 c-99"
                        inputAlign="right"></u-input>
                </u-form-item>
 
                <u-form-item label="电话" prop="info.phone" borderBottom>
                    <u-input v-model="info.phone" type="number" border="none" placeholder="请输入电话"
                        placeholderClass="f-28 c-99" inputAlign="right"></u-input>
                </u-form-item>
 
                <u-form-item label="身份证号码" prop="info.name" borderBottom>
                    <u-input v-model="info.idCard" type="idcard" border="none" placeholder="请输入身份证号码"
                        placeholderClass="f-28 c-99" inputAlign="right"></u-input>
                </u-form-item>
 
                <u-form-item label="地址" prop="info.address" borderBottom>
                    <u-textarea v-model="info.address" border="none" placeholder="请输入地址" placeholderClass="f-28 c-99"
                        inputAlign="right"></u-textarea>
                </u-form-item>
 
                <u-form-item label="申请事由" prop="info.workContent" :borderBottom="false" ref="item1">
                    <u-textarea v-model="info.remark" border="none" placeholder="请输入申请事由" placeholderClass="f-28 c-99"
                        inputAlign="right"></u-textarea>
                </u-form-item>
            </u-form>
        </view>
 
 
 
        <button class="submit-btn" @click="sumitInfo">提交</button>
        <button class="list-btn" @click="navigatorPage">我申请的记录</button>
 
 
    </view>
 
</template>
 
<script>
    import uploadMixin from "@/mixin/uploadMixin";
    import {
        saveResideApply
    } from "@/api/reside/reside.js"
 
 
 
    export default {
        mixins: [uploadMixin],
        data() {
            return {
                info: {
                    name: "",
                    phone: "",
                    idCard: "",
                    address: ""
                },
                form: {
                    images: []
                },
                rules: {
                    'name': {
                        type: 'string',
                        required: true,
                        message: '请输入姓名',
                        trigger: ['blur', 'change']
                    },
                    'phone': [{
                            type: 'string',
                            required: true,
                            message: '请输入手机号',
                            trigger: ['blur', 'change']
                        },
 
                        {
 
                            validator: (rule, value, callback) => {
                                return uni.$u.test.mobile(value);
                            },
                            message: '手机号码不正确',
                            trigger: ['change', 'blur']
 
                        }
 
                    ],
                    'address': {
                        type: 'string',
                        required: true,
                        message: '请选择地址',
                        trigger: ['blur', 'change']
                    },
                },
            }
        },
 
 
        methods: {
            getLocation() {
                uni.chooseLocation({
                    success: (res) => {
                        this.$set(this.info, "address", res.address);
                        this.$set(this.info, "lat", res.latitude);
                        this.$set(this.info, "lng", res.longitude)
                    }
                })
            },
 
            sumitInfo() {
                this.$refs.form.validate().then(valid => {
                    let data = this.info;
                    data.houseCode = uni.getStorageSync("siteInfo").houseCode
                    saveResideApply(data).then(res => {
                        if (res.code == 200) {
                            this.$showTips("提交成功", "success")
                            setTimeout(() => {
                                uni.navigateBack();
                            }, 300)
                        }
                    })
                })
            },
 
            navigatorPage() {
                uni.navigateTo({
                    url: "record"
                })
            }
 
        }
    }
</script>
 
<style lang="less">
    page {
        background-color: #F5F5F5;
    }
 
    .content {
        margin: 20rpx 30rpx;
        padding: 0 30rpx;
    }
 
    .row {
        padding: 20rpx 0;
        border-bottom: 1px solid
    }
 
    .location-btn {
        width: 116rpx;
        height: 46rpx;
        line-height: 46rpx;
        border-radius: 4rpx;
        border: 1px solid currentColor;
        padding: 0;
        background-color: #fff;
    }
 
    .upload {
        margin: 0 30rpx;
        padding: 30rpx;
 
        .upload-item {
            width: 140rpx;
            height: 140rpx;
            border: 1px solid #EEEEEE;
        }
    }
 
    .address-row {
        flex: 1;
        justify-content: flex-end;
        align-items: center;
    }
 
    .address-content {
        width: calc(100% - 116rpx - 20rpx);
        margin-right: 20rpx;
        text-align: right;
    }
 
    .location-btn {
        width: 116rpx;
        height: 46rpx;
        line-height: 46rpx;
        border-radius: 4rpx;
        border: 1px solid currentColor;
        padding: 0;
        background-color: #fff;
        text-align: center;
    }
 
    .submit-btn {
        width: 690rpx;
        height: 78rpx;
        line-height: 78rpx;
        background: linear-gradient(163deg, #01BDFC 0%, #017BFC 100%);
        border-radius: 8rpx 8rpx 8rpx 8rpx;
        font-size: 32rpx;
        color: #fff;
        margin-top: 50rpx;
    }
 
    .list-btn {
        width: 690rpx;
        height: 78rpx;
        line-height: 78rpx;
        background: linear-gradient(163deg, #c7d7dc 0%, #c3cdd8 100%);
        border-radius: 8rpx 8rpx 8rpx 8rpx;
        font-size: 32rpx;
        color: #fff;
        margin-top: 50rpx;
    }
</style>