select-remark.vue
1.57 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
<template>
<Page name="select-remark" flank>
<template #content>
<u-textarea placeholder="请输入,点击历史备注快捷填写" v-model="remark"></u-textarea>
<view class="his-title">历史备注</view>
<view class="his-card">
<view @click="clickItem(item)" class="his-item" v-for="(item, index) in hisList" :key="index">
<text>{{ item }}</text>
</view>
</view>
</template>
<template #footer>
<u-button type="primary" @click="onSelect">确定</u-button>
</template>
</Page>
</template>
<script>
export default {
name: 'select-remark',
data() {
return {
remark: '',
hisList: [],
};
},
onLoad(option) {
this.remark = option.remark || '';
this.getHis();
},
methods: {
getHis() {
uni.$u.api.freightOrder.getLatestRemark({}).then(res => {
this.hisList = res.result || [];
});
},
clickItem(v) {
this.remark = v;
},
onSelect() {
uni.$emit('select-remark', this.remark);
uni.navigateBack();
},
},
};
</script>
<style lang="scss">
.page-select-remark {
&__content {
.his-title {
padding: $padding-xs 0;
}
.his-card {
padding: $padding-md $padding-xs;
border-radius: $radius-md;
background: $color-white;
.his-item {
padding: $padding-xs 0;
color: $color-text-minor;
border-bottom: 1px solid $color-border;
text {
overflow-wrap: anywhere;
}
}
.his-item:last-child {
border-bottom: none;
}
}
}
}
</style>