<script setup>
import {reactive, ref} from "vue";
import XInfoModal from "../../../components/XInfoModal.vue";
import XForm from "../../../components/XForm.vue";
import XFormItem from "../../../components/XFormItem.vue";
import XInput from "../../../components/XInput.vue";

const XFormRef = ref();
const show = defineModel('show');
const rules = {
    wxCode: {
        reg: /^\[1][3-9]\d{9}$/,
        msg: '请输入正确的微信号',
    }
};
const form = reactive({
    wxCode: null,
});

const success = () => {
    XFormRef.value.verify();
}
</script>

<template>
    <x-info-modal v-model:show="show" @success="success">
        <view class="title">修改微信号</view>

        <x-form ref="XFormRef" :model="form" :rules="rules">
            <x-form-item>
                <x-input height="72rpx" placeholder="微信号" v-model:model-value="form.wxCode"></x-input>
            </x-form-item>
        </x-form>
    </x-info-modal>
</template>

<style scoped lang="scss">
.title {
    color: rgb(29, 33, 41);
    font-size: 32rpx;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0;
    text-align: center;
    margin-bottom: 20rpx;
}
</style>
