edit.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view>
  3. <view class="flex padding justify-between align-center">
  4. <view class="title">头像</view>
  5. <u-avatar src="/static/avatar.png" size="120"></u-avatar>
  6. </view>
  7. <u-line color="#f1f1f1"></u-line>
  8. <view class="flex padding justify-between align-center">
  9. <view class="title">昵称</view>
  10. <u-input v-model="name" :clearable="false" inputAlign="right" placeholder="请输入昵称"></u-input>
  11. </view>
  12. <u-line color="#f1f1f1"></u-line>
  13. <view class="flex padding justify-between align-center">
  14. <view class="title">性别</view>
  15. <view style="width: 200upx;">
  16. <u-input v-model="sex" type="select" :border="border" @click="sexShow = true"></u-input>
  17. <u-action-sheet :list="actionSheetList" v-model="sexShow" @click="actionSheetCallback"></u-action-sheet>
  18. </view>
  19. </view>
  20. <u-line color="#f1f1f1"></u-line>
  21. <view class="flex padding justify-between align-center" @click="calendarShow = true">
  22. <view class="title">生日</view>
  23. <view>{{birthday}}</view>
  24. <u-calendar v-model="calendarShow" mode="date" @change="change"></u-calendar>
  25. </view>
  26. <u-line color="#f1f1f1"></u-line>
  27. <view class="padding">
  28. <view class="title">个人介绍</view>
  29. </view>
  30. <view style="padding: 0 40upx">
  31. <u-input v-model="introduction" type="textarea" :clearable="false" height="140" :autoHeight="false" maxlength="60" placeholder="请输入个人简介" />
  32. </view>
  33. <view class="flex justify-end padding-right-sm padding-bottom-sm text-gray">{{introduction.length}} / 60</view>
  34. <view class="footer-fixed margin-bottom">
  35. <u-button class="custom-style" shape="circle">保存</u-button>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. return {
  43. name: 'Daniel Hua',
  44. sex: '男',
  45. sexShow: false,
  46. border: true,
  47. show: false,
  48. actionSheetList: [
  49. {
  50. text: '男'
  51. },
  52. {
  53. text: '女'
  54. },
  55. {
  56. text: '保密'
  57. }
  58. ],
  59. calendarShow: false,
  60. birthday: '2020-7-14',
  61. introduction: '',
  62. }
  63. },
  64. methods: {
  65. // 点击actionSheet回调
  66. actionSheetCallback(index) {
  67. this.sex = this.actionSheetList[index].text;
  68. },
  69. change(e) {
  70. console.log(e);
  71. this.birthday = e.result;
  72. }
  73. }
  74. }
  75. </script>
  76. <style>
  77. page {
  78. background-color: #ffffff;
  79. }
  80. </style>
  81. <style lang="scss" scoped>
  82. .title {
  83. font-size: 30upx;
  84. font-weight: bold;
  85. color: #060606;
  86. padding-left: 10upx;
  87. }
  88. .custom-style {
  89. background-color: #5a3ee7;
  90. color: #ffffff;
  91. width: 600rpx;
  92. }
  93. </style>