无关风月
2025-05-08 9486766c806fe1d9e082b2fd02ea1cc558f1b443
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
@layout("/common/_container.html"){
<style>
    .avatar-uploader .el-upload {
        border: 1px dashed #d9d9d9;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        height: 100px;
        width: 100px;
        overflow: hidden;
        display: inline-block;
    }
 
    .avatar-uploader .el-upload:hover {
        border-color: #409eff;
    }
 
    .avatar-uploader-icon {
        font-size: 28px;
        color: #8c939d;
        width: 100px;
        height: 100px;
        line-height: 110px;
        margin-top: 40px;
        text-align: center;
    }
 
    .avatar {
        width: 100px;
        height: 100px;
        display: block;
    }
 
    .col-sm-12 {
        margin-top: 20px;
    }
 
    .col-sm-12 select {
        height: 33px;
    }
</style>
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal" id="carInfoForm">
            <div id="b1">
                <input id="goodsId" value="${id}" hidden="hidden">
                <input id="nums" value="${item.num}" hidden="hidden">
                <#input id="name" name="商品名称" type="text" value="${item.name}" />
 
                <#avatar id="cover" name="商品封面:" avatarImg="${item.cover}" />
 
 
                <div class="row" id="app" style="margin-left: 225px;">
                    <div class="col-sm-6">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">商品图片(请上传不超过五张图片): </label>
                            <div class="col-sm-2" style="width: 100%;margin-left: 11%;margin-top: 1%">
                                <el-upload
                                        :limit="5"
                                        class="avatar-uploader"
                                        action="/tCouponManage/uploadPic"
                                        list-type="picture-card"
                                        accept="."
                                        :file-list="imageUrl2"
                                        :on-success="handleAvatarSuccess"
                                        :on-remove="handleRemove">
                                    <i class="el-icon-plus"></i>
                                </el-upload>
                                <el-dialog :visible.sync="dialogVisible">
                                    <img width="100%" :src="imageUrl2" alt="">
                                </el-dialog>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">发放数量:</label>
                    <div class="col-sm-9">
                        <input class="form-control" id="quantityIssued" name="quantityIssued" type="number" value="${item.quantityIssued}">
                    </div>
                </div>
 
                <div class="form-group">
                    <label class="col-sm-3 control-label">限领数量:</label>
                    <div class="col-sm-9">
                        <input class="form-control" id="pickUpQuantity" name="pickUpQuantity" type="number"  value="${item.pickUpQuantity}">
                    </div>
                </div>
 
                <div class="form-group" style="margin-left:262px">
                    <label class="col-sm-1 control-label">兑换说明:</label>
                    <div class="col-sm-5">
                        <textarea type="text/plain" id="editor"  style="height: 300px;width: 800px;">${item.content}</textarea>
                    </div>
                </div>
 
                <div class="form-group">
                    <label class="col-sm-3 control-label">排序:</label>
                    <div class="col-sm-9">
                        <input class="form-control" id="sort" name="sort" type="number"  value="${item.sort}">
                    </div>
                </div>
            </div>
 
 
        </div>
    </div>
 
    <div class="row btn-group-m-t">
        <div class="col-sm-10 col-sm-offset-5">
            <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TGoodsInfoDlg.editSubmit()"/>
            <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TGoodsInfoDlg.close()"/>
        </div>
    </div>
 
</div>
 
</div>
</div>
<script src="${ctxPath}/js/vue/vue.js"></script>
<script src="${ctxPath}/js/elementui/index.js"></script>
<link rel="stylesheet" href="${ctxPath}/js/elementui/index.css">
<script src="${ctxPath}/modular/system/tGoods/tGoods_info.js"></script>
<script>
    let id = "${pictures}"
    let obj = []
    var vue2 = new Vue({
        el: '#app',
        data: {
            autoUpload: true,//自动上传
            imageUrl1: '',//模型数据,用于上传图片完成后图片预览
            imageUrl2: [],
            dialogVisible: false
        },
        methods: {
            handleAvatarSuccess(res, file) {
                file.url =file.response
                TGoodsInfoDlg.goodsPicArray.push(file);
            },
            beforeAvatarUpload(file) {
                const isLt2M = file.size / 1024 / 1024 < 10;
                if (!isLt2M) {
                    this.$message.error('上传图片大小不能超过 10MB!');
                }
                return isLt2M;
            },
            handleRemove(file, fileList) {
                TGoodsInfoDlg.goodsPicArray = TGoodsInfoDlg.goodsPicArray.filter(item => {
                    return item.uid != file.uid;
                });
            },
            changeImg(){
                var i = id.split(",")
                for (let j = 0; j <i.length; j++) {
                    let obj={
                        fileName:i[j],
                        uuid:i[j],
                        url:i[j],
                        response:i[j],
                    }
                    this.imageUrl2.push(obj)
                }
            },
        },
        created() {
            this.changeImg()
            TGoodsInfoDlg.goodsPicArray = this.imageUrl2
            console.log(TGoodsInfoDlg.goodsPicArray)
        },
    });
</script>
@}