158 lines
2.9 KiB
Vue
158 lines
2.9 KiB
Vue
<template>
|
|
|
|
<view class="content">
|
|
<image class="logo" @click="goSub" src="/static/logo.png"></image>
|
|
<view class="">
|
|
<Inputli @input="changeTrigger" v-model="form.name" />
|
|
<Inputli @click="onClickName" v-model="form.age" :type="number" :maxlength="11" />
|
|
<Inputli @click="onClickName" v-model="form.sex" />
|
|
<Selectli v-model="form.sex" label="性123别" :array="sexArr" />
|
|
<Dateli v-model="form.startTime" />
|
|
<button @click="onClickSave">提交</button>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { uploadImage } from '../../api/uploadImage.js';
|
|
import { rulesIdCard, rulesPhone } from '../../com/index.js'
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
title: 'Hello',
|
|
imgArr: [],
|
|
form:{
|
|
name: '张三2',
|
|
age: 18,
|
|
sex: '',
|
|
startTime: ''
|
|
},
|
|
sexArr: [],
|
|
// 分页
|
|
total: 0,
|
|
pageSize: 7,
|
|
PageNum: 1,
|
|
isLoading: false // 是否正在加载数据
|
|
|
|
}
|
|
},
|
|
created() {
|
|
// this.signIn(); 开启登录获取用户信息
|
|
this.$setNavigationBar('钉钉示例模板页面')
|
|
setTimeout(()=>{
|
|
this.sexArr = [
|
|
{
|
|
name: '男',
|
|
id: 1
|
|
},
|
|
{
|
|
name: '女',
|
|
id: 2
|
|
},
|
|
{
|
|
name: '未知',
|
|
id: 3
|
|
},
|
|
]
|
|
}, 2000)
|
|
},
|
|
onLoad() {
|
|
console.log(this.$calculator(60, 0.3, '+'))
|
|
|
|
},
|
|
// 上拉加载
|
|
onReachBottom() {
|
|
if (this.PageNum * this.pageSize >= this.total) {
|
|
// 证明没有下一页的数据了
|
|
return this.$msg('没有数据啦!');
|
|
}
|
|
if (this.isLoading) return;
|
|
|
|
},
|
|
// 下拉刷新
|
|
onPullDownRefresh() {
|
|
console.log('下拉刷新了')
|
|
dd.stopPullDownRefresh();
|
|
},
|
|
methods: {
|
|
// 登录
|
|
async signIn() {
|
|
if (uni.getStorageSync('token')) {
|
|
console.log('获取列表数据')
|
|
} else {
|
|
let a = await this.$login();
|
|
console.log('获取列表数据')
|
|
}
|
|
},
|
|
onClickSave(){
|
|
const res = this.$showModel('提交函数')
|
|
res.then(()=>{
|
|
console.log('成功了执行')
|
|
},()=>{
|
|
console.log('点了取消执行')
|
|
})
|
|
console.log(this.form)
|
|
console.log(this.sex)
|
|
},
|
|
onClickName(a) {
|
|
// console.log(a)
|
|
},
|
|
changeTrigger(){
|
|
console.log('11111')
|
|
},
|
|
goSub(){
|
|
console.log(888)
|
|
// uni.redirectTo({
|
|
// url:'/subPackages/sub/sub'
|
|
// })
|
|
dd.navigateToMiniProgram({
|
|
path: '',
|
|
appId: '5000000004861352',
|
|
extraData: { data1: 'test' },
|
|
success: () => {
|
|
console.log(111)
|
|
},
|
|
fail: () => {
|
|
console.log(88)
|
|
},
|
|
complete: () => {},
|
|
});
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.logo {
|
|
height: 200rpx;
|
|
width: 200rpx;
|
|
margin-top: 200rpx;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
margin-bottom: 50rpx;
|
|
}
|
|
|
|
.text-area {
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
|
|
.title {
|
|
font-size: 36rpx;
|
|
color: #8f8f94;
|
|
}
|
|
|
|
</style>
|