<template>
    <view>
        <u--input placeholder="请输入内容" border="surround" v-model="group_name"></u--input>

        <u-button type="primary" text="确定" @click="onCreate"></u-button>
    </view>
</template>

<script>
    import {
        createGroup
    } from '@/apis/interfaces/im.js'

    export default {
        data() {
            return {
                group_name: '',
            }
        },
        onLoad() {

        },
        methods: {
            onCreate() {
                console.log('阿斯利康');
                createGroup({
                    name: this.group_name
                }).then(res => {
                    console.log(res);
                    uni.showToast({
                        title: '创建成功'
                    })
                    uni.navigateBack()
                }).catch(err => {
                    console.log(err);
                    uni.showToast({
                        icon: 'none',
                        title: err
                    })
                })
            }
        }
    }
</script>

<style>

</style>
