You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.5 KiB

3 years ago
<template>
<view class="container">
<uni-card :is-shadow="false" :border="false" is-full>
<view class="form">
<view class="line">
<uni-data-checkbox v-model="type" :localdata="my"></uni-data-checkbox>
<text>我的邮箱</text>
<uni-easyinput v-model="form.contact" />
</view>
<view class="line">
<uni-data-checkbox v-model="type1" :localdata="my"></uni-data-checkbox>
<text>其他邮箱</text>
<uni-easyinput v-model="form.contact" placeholder="请输入其他邮箱" />
</view>
<button type="primary" @click="submit('valiForm')">确认</button>
</view>
</uni-card>
</view>
</template>
<script>
export default {
data() {
return {
type: 0,
type1: 1,
my: [{
text: '',
value: 0
}],
other: [{
text: '',
value: 1
}],
form: {
name: '',
provience: '',
city: '',
industryId: '',
age: '',
introduction: '',
sex: 2,
hobby: [5],
datetimesingle: 1627529992399
}
}
},
onLoad() {
console.log(getApp())
},
methods: {
onchange(e) {
console.log('---------onchange:', e);
},
submit(ref) {
this.$refs[ref].validate().then(res => {
console.log('success', res);
uni.showToast({
title: `校验通过`
})
}).catch(err => {
console.log('err', err);
})
},
}
}
</script>
<style scoped lang="scss">
.form {
padding: 15px;
background-color: #fff;
}
.line {
display: flex;
align-items: center;
margin-bottom: 15px;
text {
margin: 0 10px 0 -20px;
}
}
</style>