819527061@qq.com
2024-05-11 f73ed7862edc9c3cb78a2610486643a2fa079fde
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
<template>
    <view class="addOpinion-wrap">
        <u-popup v-model="popupShow" mode="center" width="90%" border-radius="8" closeable>
            <view class="addOpinion-wrap-inside">
                <view class="addOpinion-title">意见与建议</view>
                <u-form>
                    <u-form-item>
                        <u-input 
                           :border="true" 
                           type="textarea" 
                           v-model="content" 
                           :height="height"
                           auto-height
                           placeholder="请输入您的意见与建议"></u-input>
                    </u-form-item>
                </u-form>
                <view class="btn-box">
                    <u-button style="margin-right: 40rpx;" type="info" @click="cancel">取消</u-button>
                    <u-button type="success" @click="submit">提交</u-button>
                </view>
            </view>
            
        </u-popup>
    </view>
</template>
 
<script>
    export default {
        name:"addOpinion",
        data() {
            return {
                height:260, //input的高度
                popupShow: false,
                content:'',
            };
        },
        methods: {
            init() {
                this.popupShow = true
                this.content = ''  //清空表单内容
            },
            submit() {
                let params = {
                    content: this.content,
                    customerId: this.$store.state.customerId
                }
                this.$u.api.insertSuggest(params).then(res => {
                    if(res.code == 200) {
                        this.popupShow = false
                        this.$emit('refeshOpinionList')
                        this.$u.toast(res.message)
                    }
                })
            },
            cancel() {
                this.popupShow = false
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .addOpinion-wrap-inside{
        width: 100%;
        padding: 32rpx;
        box-sizing: border-box;
    }
   .addOpinion-title{
       text-align: center;
       font-size: 32rpx;
       color: #111111;
       font-weight: light;
   }
   .btn-box{
       display: flex;
       justify-content: center;
   }
</style>