puzhibing
2024-03-04 7e7f901b2172281dc294dfbc67e6ad00625f09f4
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
@layout("/common/_container.html"){
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script>
<style>
    .avatar-uploader .el-upload {
        border: 1px dashed #d9d9d9;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        height: 100px;
        width: 100px;
        overflow: hidden;
    }
 
    .avatar-uploader .el-upload:hover {
        border-color: #409EFF;
    }
    .avatar-uploader-icon {
        font-size: 28px;
        color: #8c939d;
        width: 100px;
        height: 100px;
        line-height: 100px;
        margin-top: 32px;
        text-align: center;
    }
    .avatar {
        width: 100px;
        height: 100px;
        display: block;
    }
 
    .col-sm-12 {
        margin-top: 20px;
    }
 
    .col-sm-12 select {
        height: 33px;
    }
    #app1{
        margin-left: 255px;
    }
 
 
</style>
<div class="ibox float-e-margins">
    <div class="ibox-content">
 
        <div class="form-horizontal" id="carInfoForm">
            <input hidden id="id" value="${item.id}">
            <input hidden id="s1" value="${item.registerCondition}">
            <input hidden id="q1" value="${item.cashPrice}">
            <input hidden id="q2" value="${item.playPaiCoin}">
            <input hidden id="q3" value="${item.classPrice}">
            <input hidden id="rname" value="${item.realName}">
            <input hidden id="type" value="${item.status}">
            @if(objectType==1){
            <#label  id="types" name="当前状态" type="text" />
            <div class="form-group" id="provinceCode">
                <label class="col-sm-3 control-label">举办省:</label>
                <div class="col-sm-9">
                    <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange(this)">
                        <option value="">选择省</option>
                        @for(obj in list){
                        <option value="${obj.code}" ${obj.code == item.provinceCode ? 'selected=selected' : ''}>${obj.name}</option>
                        @}
                    </select>
                </div>
            </div>
            <div class="form-group" id="cityCode">
                <label class="col-sm-3 control-label">举办市:</label>
                <div class="col-sm-9">
                    <select class="form-control" id="cCode" name="cCode" onchange="TCarInfoDlg.oneChangeNext(this)">
                        <option value="">选择市</option>
                        @for(obj in list1){
                        <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option>
                        @}
                    </select>
                </div>
            </div>
            @}
            <div class="form-group" id="shop">
                <label class="col-sm-3 control-label">举办门店:</label>
                <div class="col-sm-9">
                    <select class="form-control" id="shopId" name="shopId">
                        @for(obj in list2){
                        <option   value="${obj.id}" ${obj.id == item.storeId ? 'selected=selected' : ''}>${obj.name}</option>
                        @}
                    </select>
                    <input id="storeIds" type="hidden" value="${storeIds}">
                </div>
            </div>
            <#input id="name" name="赛事名称" type="text" value="${item.name}"/>
            <#input id="startTime" name="开始时间" type="text" value="${startTime}"/>
            <#input id="endTime" name="结束时间" type="text" value="${endTime}"/>
            <#input id="registerEndTime" name="截止报名时间" type="text"  value="${registerEndTime}"/>
            @if(type==2){
            <div class="form-group">
                <label class="col-sm-3 control-label">报名条件:</label>
                <div class="col-sm-9">
                    <input type="radio" name="registerCondition" value="1"> 全部用户
                    <input type="radio" name="registerCondition" value="2">仅限年度会员参与
                    <input type="radio" name="registerCondition" value="3">仅限学员参与
                </div>
            </div>
 
            <div class="form-group">
                <label class="col-sm-3 control-label">报名年龄:</label>
                <div class="col-sm-9" style="display: flex">
                    <input class="form-control"  style="width: 100px;"  type="text" id="startAge" value="${item.startAge}"> ~ <input class="form-control"  style="width: 100px;" type="text" id="endAge" value="${item.endAge}">
                </div>
            </div>
 
            <div class="form-group">
                <label class="col-sm-3 control-label">支付方式:</label>
                <div class="col-sm-9">
                    <input type="checkbox" id="t1" onclick="updateType(1,this)"> 现金支付
                    <input type="checkbox" id="t2" onclick="updateType(2,this)"> 玩湃币支付
                    <input type="checkbox" id="t3" onclick="updateType(3,this)"> 课时支付
                </div>
            </div>
 
            <div class="form-group" id="payType1" style="display: none">
                <label class="col-sm-3 control-label">现金支付:</label>
                <div class="col-sm-9">
                    <input class="form-control"  style="width: 200px;"  type="text" id="cashPrice" value="${item.cashPrice}">
                </div>
            </div>
 
            <div class="form-group" id="payType2" style="display: none">
                <label class="col-sm-3 control-label">玩湃币支付:</label>
                <div class="col-sm-9">
                    <input class="form-control"  style="width: 200px;" type="text" id="playPaiCoin" value="${item.playPaiCoin}">
                </div>
            </div>
 
            <div class="form-group" id="payType3" style="display: none">
                <label class="col-sm-3 control-label">课时支付:</label>
                <div class="col-sm-9">
                    <input class="form-control"  style="width: 200px;" type="text" id="classPrice" value="${item.classPrice}">
                </div>
            </div>
            @}
 
            <div class="form-group">
                <label class="col-sm-3 control-label">参加地点:</label>
                <div class="col-sm-9">
                    <input class="form-control"  style="width: 500px;" type="text" id="address" onchange="TCarInfoDlg.searchByStationName(this,1)" value="${item.address}">
                </div>
            </div>
            <div class="col-sm-10" style="margin-left: 397px;width: 70%;" >
                <!-- 创建地图容器-->
                <div id="container" style="height: 500px;" ></div>
            </div>
            <div hidden id="longitude" value="${item.longitude}"></div>
            <div hidden id="latitude" value="${item.latitude}"></div>
 
            <#input id="applicantsNumber" name="报名人数" type="text"  value="${item.applicantsNumber}"/>
            <#input id="baseNumber" name="基础报名人数" type="text"  value="${item.baseNumber}"/>
 
            <div class="form-group">
                <label class="col-sm-3 control-label">是否实名:</label>
                <div class="col-sm-9">
                    <input type="radio" name="realName" value="1"> 是
                    <input type="radio" name="realName" value="0"> 否
                </div>
            </div>
 
            <div class="form-group">
                <label class="col-sm-3 control-label">赛事简介:</label>
                <div class="col-sm-9">
                    <textarea  id="introduction" style="height: 203px; width: 506px;">${item.introduction}</textarea>
                </div>
            </div>
 
            <#avatar id="coverDrawing" name="赛事封面(推荐像素:210*280px):" avatarImg="${item.coverDrawing}" />
            <div class="row" id="app1">
                <div class="form-group">
                    <label class="col-sm-3 control-label head-scu-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>
            <#avatar id="registrationNotes" name="报名须知(推荐像素:宽780px):"  avatarImg="${item.registrationNotes}"/>
 
        </div>
    </div>
 
    <div class="row btn-group-m-t">
        <div class="col-sm-10 col-sm-offset-5">
            @if(type==1){
            <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/>
            @}
            <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/>
        </div>
    </div>
 
</div>
 
</div>
</div>
<script src="${ctxPath}/modular/system/tCompetition/tCompetition_info.js"></script>
<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">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script>
 
<script>
 
    $(document).ready(function() {
        $('#shopId').select2({
            multiple: true,
            closeOnSelect: false
        });
 
        console.log("===========storeIds="+$('#storeIds').val())
        var selectedValues = JSON.parse($('#storeIds').val()); // Replace with the desired selected values
 
        $('#shopId').val(selectedValues); // Set the selected values
 
        $('#shopId').trigger('change')
    });
 
    let id = "${item.imgs}"
    let obj = []
 
    var vue2 = new Vue({
        el: '#app1',
        props: {
            // 数量限制
            limit: {
                type: Number,
                default: 2
            },
        },
        data: {
            autoUpload: true,//自动上传
            imageUrl1: '',//模型数据,用于上传图片完成后图片预览
            imageUrl2: [],
            dialogVisible: false
        },
        methods: {
            handleAvatarSuccess(res, file) {
                file.url =file.response
                TCarInfoDlg.goodsPicArray1.push(file);
            },
            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)
 
                }
            },
            beforeAvatarUpload(file) {
                const isLt2M = file.size / 1024 / 1024 < 10;
                if (!isLt2M) {
                    this.$message.error('上传图片大小不能超过 10MB!');
                }
                return isLt2M;
            },
            handleRemove(file, fileList) {
                TCarInfoDlg.goodsPicArray1 = TCarInfoDlg.goodsPicArray1.filter(item => {
                    return item.uid != file.uid;
                });
            },
        },
        created() {
            this.changeImg()
            TCarInfoDlg.goodsPicArray1 = this.imageUrl2
        },
    });
 
 
    window.onload = function() {
        if($("#type").val()==1){
            $("#types").html("未开始").css("color","goldenrod")
        }else if($("#type").val()==2){
            $("#types").html("已开始").css("color","green")
        }else if($("#type").val()==3){
            $("#types").html("已结束").css("color","red")
        }else if($("#type").val()==4){
            $("#types").html("已取消").css("color","red")
        }
 
 
 
        var OBJradio = document.getElementsByName("registerCondition")
        for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio
            if ($("#s1").val() == OBJradio[i].value) {//判断是否与radio的值相同
                OBJradio[i].checked = true//修改选中状态
            }
        }
        var OBJradio = document.getElementsByName("realName")
        for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio
            if ($("#rname").val() == OBJradio[i].value) {//判断是否与radio的值相同
                OBJradio[i].checked = true//修改选中状态
            }
        }
 
        if($("#q1").val()>0 && $("#type").val()==2){
            $("#payType1").show();
            $("input[id='t1']").attr("checked", "checked")
        }
        if($("#q2").val()>0 && $("#type").val()==2){
            $("#payType2").show();
            $("input[id='t2']").attr("checked", "checked")
        }
        if($("#q3").val()>0 && $("#type").val()==2){
            $("#payType3").show();
            $("input[id='t3']").attr("checked", "checked")
        }
 
    }
 
    laydate.render({
        elem: '#startTime'
        ,type:"datetime"
        ,format: 'yyyy-MM-dd HH:mm'
    });
    laydate.render({
        elem: '#endTime'
        ,type:"datetime",
        format: "yyyy-MM-dd HH:mm"
    });
    laydate.render({
        elem: '#registerEndTime'
        ,type:"datetime",
        format: "yyyy-MM-dd HH:mm"
    });
    laydate.render({
        elem: '#transDateStart'
        ,type:"datetime"
    });
    laydate.render({
        elem: '#transDateStop'
        ,type:"datetime"
    });
    laydate.render({
        elem: '#certifyDateB'
        ,lang:"en"
    });
    laydate.render({
        elem: '#nextFixDate'
        ,lang:"en"
    });
    laydate.render({
        elem: '#GPSInstallDate'
        ,lang:"en"
    });
    laydate.render({
        elem: '#registerDate'
        ,lang:"en"
    });
 
 
    function updateType(e,o) {
        if(e==1){
            if($(o).is(":checked")){
                $("#payType1").show();
            }else {
                $("#payType1").hide();
            }
        }
        if(e==2){
            if($(o).is(":checked")){
                $("#payType2").show();
            }else {
                $("#payType2").hide();
            }
        }
        if(e==3){
            if($(o).is(":checked")){
                $("#payType3").show();
            }else {
                $("#payType3").hide();
            }
        }
    }
</script>
@}