帧视界壹通告,付费看视频的微信小程序
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.

133 lines
2.7 KiB

  1. <template>
  2. <view class='updateUserInfo'>
  3. <!--顶部导航栏-->
  4. <navbar leftClick @leftClick="$utils.navigateBack" title="修改个人信息" />
  5. <!--主页面-->
  6. <view class="frame">
  7. <view class="item">
  8. <view>头像</view>
  9. <view>11</view>
  10. </view>
  11. <view class="item">
  12. <view class="label">昵称</view>
  13. <view class="value">
  14. <uv-input v-model="form.nickName" placeholder="昵称" border="bottom" clearable
  15. @change="keyWordChange"></uv-input>
  16. </view>
  17. </view>
  18. <view class="item" @click="sexChange">
  19. <view class="label">性别</view>
  20. <view>{{form.sex}}<span style="color: #8b8f97;">&nbsp;&nbsp;&nbsp;></span></view>
  21. </view>
  22. <view class="item">
  23. <view class="label">联系方式</view>
  24. <view class="value">
  25. <uv-input v-model="form.phone" placeholder="联系方式" border="bottom" clearable
  26. @change="keyWordChange"></uv-input>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- ActionSheet 操作菜单 -->
  31. <uv-action-sheet ref="actionSheet" :actions="sexList" title="性别" @select="select" @close="close">
  32. </uv-action-sheet>
  33. <!--确认修改个人信息按钮-->
  34. <button @click="confirmEditUserInfo" class="bottomBtn">
  35. 确认修改
  36. </button>
  37. </view>
  38. </template>
  39. <script>
  40. import '../../common.css'; // 引入公共 CSS 文件
  41. export default {
  42. data() {
  43. return {
  44. form: {
  45. sex: '男',
  46. nickName: '库里yyds',
  47. phone: '15346993500',
  48. },
  49. sexList: [{
  50. name: '男',
  51. value: 1
  52. },
  53. {
  54. name: '女',
  55. value: 0
  56. },
  57. ]
  58. }
  59. },
  60. methods: {
  61. confirmEditUserInfo() {
  62. this.$api('infoUpdateInfo', {}, res => {
  63. if (res.code == 200) {
  64. // 修改VueX中的信息,是否有密码啥的
  65. uni.showToast({
  66. title: '修改成功',
  67. icon: 'success'
  68. })
  69. setTimeout(() => {
  70. uni.navigateTo({
  71. url: '/pages/index/index'
  72. })
  73. }, 300)
  74. }
  75. })
  76. },
  77. sexChange() {
  78. this.$refs.actionSheet.open() //打开ActionSheet 操作菜单
  79. },
  80. // ActionSheet 操作菜单选中
  81. select(e) {
  82. console.log('选中该项:', e);
  83. this.form.sex = e.name
  84. this.$refs.actionSheet.close() //关闭操作菜单
  85. },
  86. // ActionSheet 操作菜单关闭
  87. close() {
  88. this.$refs.actionSheet.close() //关闭操作菜单
  89. },
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. * {
  95. box-sizing: border-box;
  96. margin: 0;
  97. padding: 0;
  98. }
  99. .updateUserInfo {
  100. .frame {
  101. padding: 28rpx 28rpx 0 28rpx;
  102. .item {
  103. display: flex;
  104. justify-content: space-between;
  105. // border-bottom: 1px solid #c9c9c9;
  106. margin-top: 20rpx;
  107. padding: 20rpx;
  108. .label {
  109. width: 60%;
  110. }
  111. .value {
  112. width: 40%;
  113. text-align: right;
  114. }
  115. }
  116. }
  117. }
  118. </style>