<template>
<view>
<view>返回的数据为:{{note}}</view>
<button type="primary" @click="nextClick">跳转到下一页面</button>
</view>
</template>
<script>
export default {
data() {
return {
note: '',
}
},
onShow() {
let _this= this;
uni.$on('updateNote',function(data){
console.log(data);
_this.note = data;
})
},
methods: {
// 跳转到备注页面
nextClick() {
uni.navigateTo({
url: '/pages/noteForm/noteForm'
})
}
}
}
</script>
<style>
</style>
备注页面
<template>
<view>
<view class="noteBox">
<view class="textareaCon">
<textarea :value="orderNote" placeholder="有什么特殊需求可订单备注一下哦" placeholder-class="placeholderColor"
@input="noteBlur" />
</view>
<view class="formPost_con">
<view class="submitBtn" @click="backClick">完成</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
// 备注
orderNote: '',
}
},
methods: {
// 获取备注内容
noteBlur(e) {
// console.log(e)
var _this = this;
_this.orderNote = e.detail.value;
},
// 完成
backClick() {
var _this = this;
uni.$emit('updateNote', _this.orderNote);
uni.navigateBack({
delta: 1
})
},
}
}
</script>
<style>
page {
background-color: #fff;
}
</style>
<style scoped>
/* 备注 */
.noteBox {}
.textareaCon {
padding: 30rpx;
overflow: hidden;
}
.textareaCon textarea {
width: 100%;
height: 320rpx;
line-height: 30rpx;
padding: 20rpx;
border-radius: 20rpx;
background-color: #F6F6F9;
box-sizing: border-box;
overflow: hidden;
}
.formPost_con {
margin-top: 30rpx;
}
</style>