index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="box-data">
  3. <Nav title="首页"></Nav>
  4. <view class="border-item"></view>
  5. <enInput v-model="text" label="姓名姓名"></enInput>
  6. <enSend v-model="phone" ref="enSendObj" @getCode="getCode"></enSend>
  7. <enCheckbox v-model="type" label="爱好爱好" :checkboxData="checkboxData"></enCheckbox>
  8. <enRadio v-model="sex" label="性别性别" :radioData="radioData"></enRadio>
  9. <enSwitch v-model="status" label="状态试"></enSwitch>
  10. <enTextarea v-model="content" label="个人简介"></enTextarea>
  11. <enDate v-model="birthday" type="datetime" label="生日生日"></enDate>
  12. <enHeadImg v-model="img" label="修改头像"></enHeadImg>
  13. <view class="" @click="toList()">进入列表演示</view>
  14. </view>
  15. </template>
  16. <script>
  17. import enInput from "components/en-from/en-input/en-input"
  18. import enSend from "components/en-from/en-send/en-send"
  19. import enCheckbox from "components/en-from/en-checkbox/en-checkbox"
  20. import enRadio from "components/en-from/en-radio/en-radio"
  21. import enSwitch from "components/en-from/en-switch/en-switch"
  22. import enTextarea from "components/en-from/en-textarea/en-textarea"
  23. import enDate from "components/en-from/en-date/en-date"
  24. import enHeadImg from "@/components/en-utils/en-head-img.vue"
  25. export default {
  26. components: {
  27. enDate,
  28. enTextarea,
  29. enSwitch,
  30. enRadio,
  31. enCheckbox,
  32. enInput,
  33. enSend,
  34. enHeadImg
  35. },
  36. data() {
  37. return {
  38. img:require('@/static/img/2.jpg'),
  39. phone: '13900139001',
  40. birthday: '',
  41. text: '来自火星的你',
  42. content: '你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?',
  43. type: ['1'],
  44. sex: '1',
  45. status: 1,
  46. // checkboxData:[{'id':'1','name':'足球'},{'id':'2','name':'篮球'},{'id':'3','name':'排球'},{'id':'4','name':'羽毛球'},{'id':'5','name':'乒乓球'},{'id':'6','name':'铅球'},{'id':'7','name':'棒球'},{'id':'8','name':'冰球'},{'id':'9','name':'网球'},{'id':'10','name':'乒乓球'}]
  47. checkboxData: [{
  48. 'id': '1',
  49. 'name': '足球'
  50. }, {
  51. 'id': '2',
  52. 'name': '篮球'
  53. }, {
  54. 'id': '3',
  55. 'name': '排球'
  56. }],
  57. radioData: [{
  58. 'id': '1',
  59. 'name': '男'
  60. }, {
  61. 'id': '2',
  62. 'name': '女'
  63. }]
  64. }
  65. },
  66. watch: {
  67. 'birthday': function() {
  68. console.log('new--------birthday', this.birthday)
  69. },
  70. 'content': function() {
  71. console.log('new--------content', this.content)
  72. },
  73. 'type': function() {
  74. console.log('new--------type', this.type)
  75. },
  76. 'phone': function() {
  77. console.log('new--------' + this.phone)
  78. },
  79. 'text': function() {
  80. console.log('new--------' + this.text)
  81. },
  82. 'status': function() {
  83. console.log('new--------' + this.status)
  84. }
  85. },
  86. mounted() {
  87. },
  88. methods: {
  89. getCode() {
  90. console.log('---------------------asdsa')
  91. this.text = 'abc'
  92. this.$refs.enSendObj.setCodeNum()
  93. },
  94. toList() {
  95. uni.navigateTo({
  96. url: '/pages/text/index'
  97. })
  98. },
  99. },
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. .border-item {
  104. border-bottom: 2rpx solid #F0F0F0;
  105. }
  106. .box-data {
  107. padding: 32rpx 32rpx 0;
  108. background-color: #fff;
  109. }
  110. </style>