update-textarea.vue
2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<template>
<view style=" width: 100%; height: 100%; display: flex;background-color: #F7F7F7;" :style="vuex_theme">
<view class="wrap_box">
<view class="text_gray_26">{{title}}</view>
<view style="min-height: 300rpx;width: 100%;padding: 20rpx 0;">
<u-input v-model="value" type="textarea" :maxlength='maxLength' placeholder="请输入内容" :custom-style="text_black_30"
:placeholder-style="text_gray_30"/>
</view>
<!-- <view class="text_gray_30" style="text-align: right;">{{value.length}}/{{maxLength}}</view> -->
<view style="height: 2rpx;margin: 30rpx 0;background-color: #e5e5e5;"></view>
</view>
<view class="footer">
<view style="width: 100%;height: 1rpx;border: 1rpx solid #f7f7f7;"></view>
<view style="padding: 20rpx 40rpx 70rpx 40rpx;" >
<view class="confirm" @click="confirm">确认</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title:"",
maxLength:300,
curLength:0,
value:'',
}
},
onLoad(option) {
console.log(option)
this.title = "my-special"==option.type?"我的优势":"兴趣爱好"
this.value = option.value?option.value:''
uni.setNavigationBarTitle({title:this.title });
},
methods: {
confirm(){
if(this.value&&this.value.length>0){
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
if("我的优势"==this.title){
if(prevPage.$vm.form){
prevPage.$vm.form.personal_ability = this.value;
}else{
prevPage.$vm.detailObj.personal_ability = this.value;
}
}else{//兴趣爱好
prevPage.$vm.detailObj.hobbies = this.value;
}
console.log(this.value)
uni.navigateBack({
delta:1
})
}else{
uni.showToast({
title:"请输入内容!",
icon:"none"
})
}
}
}
}
</script>
<style lang="scss" scoped>
.wrap_box {
padding: 40rpx;
background-color: #fff;
margin: 20rpx 20rpx 0 20rpx;
width: 100%;
.text_black_30 {
font-size: 30rpx;
font-family:' PingFangSC-Regular, PingFang SC';
font-weight: 500;
color: #000000;
line-height: 30rpx;
}
.text_gray_26 {
font-size: 26rpx;
font-weight: 400;
color: #000000;
}
.text_gray_30 {
font-size: 30rpx;
color:rgba(0,0,0,0.45);
line-height: 30rpx;
}
}
.footer {
width: 100%;
background-color: #fff;
position: fixed;
bottom: 0;
left: 0;
z-index: 999;
.confirm {
background: linear-gradient(180deg, var(--primary-color000) 0%, var(--primary-color) 100%);
box-shadow: 0px 2px 20px 0px var(--primary-color03);
border-radius: 24px;
padding: 24rpx;
text-align: center;
font-size: 34rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
}
</style>