xunji-wode-qianming.vue
1.64 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
<template>
<view class="container">
<view class="content">
<textarea
class="signature-textarea"
placeholder="暂未填写"
v-model="signature"
:maxlength="50"
auto-height
>
</textarea>
<view class="signature-count">
<text>{{ signature.length }}/50</text>
</view>
</view>
<view class="saveBtn">
<button class="btn" @click="saveSignature">保存</button>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import UserApi from '@/sheep/api/member/user.js';
// 签名内容
const signature = ref('');
onLoad((e) => {
signature.value = e.signature || '';
});
const saveSignature = async () => {
await UserApi.updateSignature({
data: signature.value,
});
};
</script>
<style lang="scss">
.container {
background-color: #f5f5f5;
height: 100%;
.content {
width: 100%;
padding: 20rpx 0;
height: 150rpx;
position: relative;
margin-bottom: 80rpx;
.signature-textarea {
width: 100%;
font-size: 28rpx;
color: #333333;
background-color: #ffffff;
border-radius: 8rpx;
padding: 15rpx;
height: 100% !important;
}
.signature-count {
position: absolute;
bottom: 0rpx;
right: 15rpx;
font-size: 24rpx;
color: #999999;
}
}
.btn {
width: 90%;
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
color: #ffffff;
background-color: #ff6600;
border-radius: 8rpx;
}
}
</style>