移动系统liao
2024-05-09 5d6cb15ac86d9174393cb9d1538d69b567e2c26c
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
173
174
175
176
177
<script type="text/html" template lay-done="layui.data.sendParams(d);">
    <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsGoodsComment-editForm" id="LAY-app-CoreCmsGoodsComment-editForm">
        <input type="hidden" name="id" value="{{d.params.data.id || '' }}" />
        <table class="layui-table ">
            <colgroup>
                <col width="100">
                <col>
            </colgroup>
            <tbody>
 
                <tr>
                    <td>
                        <label for="id">序列</label>
                    </td>
                    <td>
                        {{ d.params.data.id || '' }}
                    </td>
                </tr>
 
                <tr>
                    <td>
                        <label for="commentId">评价用户</label>
                    </td>
                    <td>
                        <a href="javascript:void(0);" onclick="layui.coreHelper.viewImage('{{ d.params.data.avatarImage || layui.setter.noImagePicUrl }}')"><image style="max-width:60px;max-height:60px;border-radius: 30px;" src="{{d.params.data.avatarImage || layui.setter.noImagePicUrl }}" /></a>   {{ d.params.data.nickName || '' }}  【{{ d.params.data.mobile || '' }}】
 
                    </td>
                </tr>
 
                <tr>
                    <td>
                        <label for="score">评价星级</label>
                    </td>
                    <td>
                        {{ d.params.data.score || '' }}
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="goodsId">商品名称</label>
                    </td>
                    <td>
                        {{ d.params.data.goodName || '' }}
                    </td>
                </tr>
 
                <tr>
                    <td>
                        <label for="orderId">评价订单</label>
                    </td>
                    <td>
                        {{ d.params.data.orderId || '' }}
                    </td>
                </tr>
 
                <tr>
                    <td>
                        <label for="addon">货品规格</label>
                    </td>
                    <td>
                        {{ d.params.data.addon || '' }}
                    </td>
                </tr>
 
                <tr>
                    <td>
                        <label for="images">评价图片</label>
                    </td>
                    <td>
                        {{#  layui.each(d.params.data.imagesArr, function(index, item){ }}
                        <a href="javascript:void(0);" onclick="layui.coreHelper.viewImage('{{ item || '' }}')"><image style="max-width:128px;max-height:128px;" src="{{item || '' }}" /></a>&nbsp;
                        {{#  }); }}
                    </td>
                </tr>
 
                <tr>
                    <td>
                        <label for="contentBody">评价内容</label>
                    </td>
                    <td>
                        {{ d.params.data.contentBody || '' }}
                    </td>
                </tr>
 
                <tr>
                    <td>
                        <label for="sellerContent">商家回复</label>
                    </td>
                    <td>
                        {{ d.params.data.sellerContent || '' }}
                    </td>
                </tr>
 
                <tr>
                    <td>
                        <label for="isDisplay">前台显示</label>
                    </td>
                    <td>
                        <input type="checkbox" disabled name="isDisplay" value="{{d.params.data.isDisplay}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="isDisplay" {{ d.params.data.isDisplay ? 'checked' : '' }}>
                    </td>
                </tr>
 
                <tr>
                    <td>
                        <label for="createTime">创建时间</label>
                    </td>
                    <td>
                        {{ d.params.data.createTime || '' }}
                    </td>
                </tr>
 
            </tbody>
        </table>
 
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label  layui-form-required">商家回复</label>
            <div class="layui-input-block">
                <textarea name="data" class="layui-textarea" lay-verType="tips" lay-verify="required" placeholder="请输入商家回复" lay-reqText="请输入商家回复">{{d.params.data.sellerContent || '' }}</textarea>
            </div>
        </div>
 
 
        <div class="layui-form-item text-right core-hidden">
            <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsGoodsComment-editForm-submit" id="LAY-app-CoreCmsGoodsComment-editForm-submit" value="确认回复">
        </div>
    </div>
</script>
<script>
    var debug = layui.setter.debug;
    layui.data.sendParams = function (d) {
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d.params.data); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
            function () {
                var $ = layui.$
                    , form = layui.form
                    , admin = layui.admin
                    , laydate = layui.laydate
                    , upload = layui.upload
                    , cropperImg = layui.cropperImg
                    , coreHelper = layui.coreHelper;
 
                //评价图片逗号分隔最多五张图片裁剪上传
                $('#upBtnimages').click(function () {
                    cropperImg.cropImg({
                        aspectRatio: 1 / 1,
                        imgSrc: $('#viewImgBoximages').attr('src'),
                        onCrop: function (data) {
                            var loadIndex = layer.load(2);
                            coreHelper.Post("api/Tools/UploadFilesFByBase64", { base64: data }, function (res) {
                                if (0 === res.code) {
                                    $('#viewImgBoximages').attr('src', res.data.fileUrl);
                                    $("#imagesInput").val(res.data.fileUrl);
                                    layer.msg(res.msg);
                                    layer.close(loadIndex);
                                } else {
                                    layer.close(loadIndex);
                                    layer.msg(res.msg, { icon: 2, anim: 6 });
                                }
                            });
                        }
                    });
                });
 
                laydate.render({
                    elem: '#editTime-CoreCmsGoodsComment-createTime',
                    type: 'datetime'
                });
                form.verify({
 
                    verifyorderId: [/^[\S]{0,16}$/, '评价订单ID最大只允许输入16位字符,且不能出现空格'],
                });
                //重载form
                form.render(null, 'LAY-app-CoreCmsGoodsComment-editForm');
            })
    };
</script>