index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. <enUpload v-model="imgs" ></enUpload>
  14. <!-- <view class="" @click="toList()">进入列表演示</view>-->
  15. </view>
  16. </template>
  17. <script>
  18. import enInput from "components/en-from/en-input/en-input"
  19. import enSend from "components/en-from/en-send/en-send"
  20. import enCheckbox from "components/en-from/en-checkbox/en-checkbox"
  21. import enRadio from "components/en-from/en-radio/en-radio"
  22. import enSwitch from "components/en-from/en-switch/en-switch"
  23. import enTextarea from "components/en-from/en-textarea/en-textarea"
  24. import enDate from "components/en-from/en-date/en-date"
  25. import enHeadImg from "components/en-from/en-head/en-head-img"
  26. import enUpload from "components/en-from/en-upload/en-upload"
  27. export default {
  28. components: {
  29. enUpload,
  30. enDate,
  31. enTextarea,
  32. enSwitch,
  33. enRadio,
  34. enCheckbox,
  35. enInput,
  36. enSend,
  37. enHeadImg
  38. },
  39. data() {
  40. return {
  41. img:require('@/static/img/2.jpg'),
  42. imgs:[require('@/static/img/2.jpg')],
  43. phone: '13900139001',
  44. birthday: '',
  45. text: '来自火星的你',
  46. content: '你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?你会火星语吗?',
  47. type: ['1'],
  48. sex: '1',
  49. status: 1,
  50. // 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':'乒乓球'}]
  51. checkboxData: [{
  52. 'id': '1',
  53. 'name': '足球'
  54. }, {
  55. 'id': '2',
  56. 'name': '篮球'
  57. }, {
  58. 'id': '3',
  59. 'name': '排球'
  60. }],
  61. radioData: [{
  62. 'id': '1',
  63. 'name': '男'
  64. }, {
  65. 'id': '2',
  66. 'name': '女'
  67. }]
  68. }
  69. },
  70. watch: {
  71. 'imgs': function() {
  72. console.log('new--------imgs', this.imgs)
  73. },
  74. 'birthday': function() {
  75. console.log('new--------birthday', this.birthday)
  76. },
  77. 'content': function() {
  78. console.log('new--------content', this.content)
  79. },
  80. 'type': function() {
  81. console.log('new--------type', this.type)
  82. },
  83. 'phone': function() {
  84. console.log('new--------' + this.phone)
  85. },
  86. 'text': function() {
  87. console.log('new--------' + this.text)
  88. },
  89. 'status': function() {
  90. console.log('new--------' + this.status)
  91. }
  92. },
  93. mounted() {
  94. },
  95. methods: {
  96. getCode() {
  97. console.log('---------------------asdsa')
  98. this.text = 'abc'
  99. this.$refs.enSendObj.setCodeNum()
  100. },
  101. toList() {
  102. uni.navigateTo({
  103. url: '/pages/text/index'
  104. })
  105. },
  106. },
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. .border-item {
  111. border-bottom: 2rpx solid #F0F0F0;
  112. }
  113. .box-data {
  114. padding: 32rpx 32rpx 0;
  115. background-color: #fff;
  116. }
  117. </style>