耀实惠小程序
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.

53 lines
983 B

  1. <template>
  2. <view class="edit-name flex-1">
  3. <view class="edit-name-box m-b-60">
  4. <u-input v-model="name" placeholder="请输入新的名称" />
  5. </view>
  6. <u-button type="primary" @click="confirm">完成</u-button>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. data () {
  12. return {
  13. name: ''
  14. }
  15. },
  16. onLoad(options) {
  17. this.name = options?.name
  18. },
  19. methods: {
  20. confirm () {
  21. uni.$emit('EDITNAME', this.name)
  22. this.editUserInfo({name: this.name})
  23. uni.navigateBack({
  24. delta: 1
  25. })
  26. },
  27. editUserInfo (params = {},status= 0) {
  28. uni.showLoading();
  29. this.$api('editUserInfo', params)
  30. .then(res => {
  31. uni.hideLoading();
  32. this.$Toast(res.message)
  33. }).catch(err => {
  34. uni.hideLoading();
  35. this.$Toast(err.message)
  36. })
  37. },
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .edit-name{
  43. background: #F5F6F8;
  44. padding: 34rpx;
  45. &-box {
  46. border-bottom: 2rpx solid #ccc;
  47. padding: 0 20rpx;
  48. }
  49. }
  50. </style>