introduceYourselfEdit.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view>
  3. <view class="u-cell-group">
  4. <u--textarea :height="300" v-model="value" autoHeight placeholder="简单的介绍您自己~"></u--textarea>
  5. </view>
  6. <view class="footer-bar">
  7. <u-button shape="circle" :customStyle="{
  8. color: '#fff',
  9. background: 'var(--theme-color-gradient)'
  10. }" @click="onSubmit">确认修改</u-button>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import { onShow } from '@dcloudio/uni-app';
  16. export default {
  17. data() {
  18. return {
  19. value: '',
  20. }
  21. },
  22. onLoad() {
  23. },
  24. onLoad(query) {
  25. console.log(query,'query')
  26. this.value = (query.introduceYourself === undefined || query.introduceYourself === 'undefined') ? '' : decodeURIComponent(query.introduceYourself)
  27. },
  28. onShow() {
  29. },
  30. methods: {
  31. goBack() {
  32. uni.navigateBack()
  33. },
  34. onSubmit() {
  35. // 获取页面栈
  36. const pages = getCurrentPages()
  37. // 上一页实例
  38. const prevPage = pages[pages.length - 2]
  39. // 直接修改上一页data里的字段
  40. prevPage.$data.baseInfo.introduceYourself = this.value
  41. uni.navigateBack()
  42. }
  43. }
  44. }
  45. </script>
  46. <style scoped lang="scss">
  47. .u-cell-group {
  48. padding: 30rpx;
  49. }
  50. </style>