liujie
6 天以前 0b982ca67a35defc06d279740749948e9ec20f6a
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
@layout("/common/_container.html"){
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>添加</h5>
            </div>
            <div class="ibox-content" id="couponInfoForm">
 
                <div class="row row-lg">
                    <div class="col-sm-12" style="cursor: pointer;text-align: right;">
 
                        <div class="initialLevel col-sm-12 control-label form-group"  >
                            <div class="initialLevel col-sm-3 control-label form-group"  >
                                <span style="color:red">*</span>
                                <label class="control-label" >优惠券名称:</label>
                                <input id="couponName" name="couponName" type="text" maxlength="20" placeholder="最多输入20个字符" style="height: 30px" required="required">
                            </div>
                        </div>
 
                        <div class="initialLevel col-sm-12 control-label form-group"  >
                            <div class="initialLevel col-sm-3 control-label form-group"  >
                                <span style="color:red">*</span>
                                <label class="control-label" >优惠券类型:</label>
                                <select id="couponType" name="couponType" onclick="TCoupon.changeCouponType()" style="height: 30px;width: 180px" required>
                                    <option value="">请选择优惠券类型</option>
<!--                                    <option value="1">活动券</option>-->
                                    <option value="2">新人券</option>
                                    <option value="3">分享券</option>
                                    <option value="4">消费优惠券</option>
                                    <option value="5">充值优惠券</option>
                                </select>
                            </div>
                        </div>
 
                        <div class="initialLevel col-sm-12 control-label form-group"  >
                            <div class="initialLevel col-sm-12 control-label form-group" id="tt" >
                                <div class="initialLevel col-sm-3 control-label form-group"  >
                                    <span style="color:red">*</span>
                                    <label id="label3" class="control-label">赠送条件:分享</label>
                                    <label id="label4" class="control-label">赠送条件:订单满</label>
                                    <label id="label5" class="control-label">赠送条件:充值</label>
                                    <input id="sendNum" name="sendNum"   maxlength="12" placeholder="最多12位数字" style="height: 30px" required>
                                </div>
                                <div class="initialLevel col-sm-3 control-label form-group" style="text-align: left" >
                                    <label id="label-3">人,赠送优惠卷</label>
                                    <label id="label-4">元,赠送优惠卷</label>
                                    <label id="label-5">元,赠送优惠卷</label>
                                </div>
                            </div>
 
                            <div class="initialLevel col-sm-3 control-label form-group"  >
                                <span style="color:red">*</span>
                                <label class=" control-label">服务类类型:</label>
                                <select id="couponServiceType" name="couponServiceType" style="height: 30px;width: 180px" required>
                                    <option value="">请选择服务类类型</option>
                                    <option value="1">通用型</option>
                                </select>
                            </div>
                        </div>
 
<!--                        <div class="initialLevel col-sm-12 control-label form-group" id="coupon1"  >-->
<!--                            <div class="initialLevel col-sm-3 control-label form-group"  >-->
<!--                                <label class="control-label">优惠券限制数量:</label>-->
<!--                                <input id="couponCount" name="couponCount1" type="number" min="0" maxlength="12" placeholder="最多12位数字" style="height: 30px" required>-->
<!--                            </div>-->
<!--                        </div>-->
 
<!--                        <div class="initialLevel col-sm-12 control-label form-group" id="coupon2" >-->
<!--                            <div class="initialLevel col-sm-3 control-label form-group"  >-->
<!--                                <span style="color:red">*</span>-->
<!--                                <label class="control-label">优惠券限制数量:</label>-->
<!--                                <input id="couponCount" name="couponCount2" type="number" min="1" placeholder="请输入优惠券限制数量" style="height: 30px" required>-->
<!--                            </div>-->
<!--                        </div>-->
 
                        <div class="initialLevel col-sm-12 control-label form-group"  >
                            <div class="initialLevel col-sm-3 control-label form-group"  >
                                <span style="color:red">*</span>
                                <label class="control-label">条件金额:</label>
                                <input id="couponConditionalAmount" name="couponConditionalAmount" type="number" min="1"  maxlength="12" placeholder="最多12位数字" style="height: 30px" required>
                            </div>
                        </div>
 
                        <div class="initialLevel col-sm-12 control-label form-group"  >
                            <div class="initialLevel col-sm-3 control-label form-group"  >
                                <span style="color:red">*</span>
                                <label class="control-label">优惠金额:</label>
                                <input id="couponPreferentialAmount" name="couponPreferentialAmount" type="number" min="1"  maxlength="12" placeholder="最多12位数字" style="height: 30px" required>
                            </div>
                        </div>
 
 
 
                        <div class="initialLevel col-sm-12 control-label form-group"  >
                            <div class="initialLevel col-sm-3 control-label form-group"  >
                                <span style="color:red">*</span>
                                <label class="control-label">有效期:</label>
                                <input id="couponValidity" name="couponValidity" type="number" min="1"  maxlength="12" placeholder="最多12位数字" style="height: 30px" required>
                            </div>
                            <div class="initialLevel col-sm-3 control-label form-group" style="text-align: left" >
                                <label>天</label>
                            </div>
                        </div>
 
                        <div class="initialLevel col-sm-12 control-label form-group"  >
                            <div class="initialLevel col-sm-3 control-label form-group"  >
                                <span style="color:red">*</span>
                                <label class="control-label">优惠券总量:</label>
                                <input id="remainingQuantity" name="remainingQuantity" min="1"  type="number" maxlength="12" placeholder="最多12位数字" style="height: 30px" required>
                            </div>
                        </div>
 
                        <div class="initialLevel col-sm-12 control-label form-group" hidden id="changeCouponSendQuantity" >
                            <div class="initialLevel col-sm-3 control-label form-group"  >
                                <span style="color:red">*</span>
                                <label class="control-label">赠送数量:</label>
                                <input id="couponSendQuantity" name="couponSendQuantity"  min="1" type="number" placeholder="请输入赠送数量" style="height: 30px" required>
                            </div>
                            <div class="initialLevel col-sm-3 control-label form-group" style="text-align: left" >
                                <label>张</label>
                            </div>
                        </div>
                    </div>
                </div>
 
                <div class="row btn-group-m-t">
                    <div class="col-sm-10" style="text-align: center">
                        <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCouponInfoDlg.addSubmit()"/>
                        <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCouponInfoDlg.close()"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/modular/system/tCoupon/tCoupon_info.js"></script>
<script src="${ctxPath}/static/modular/system/tCoupon/tCoupon.js"></script>
<script type="text/javascript">
 
    function changeLabels() {
        var selectedValue = document.getElementById("couponType").value;
 
        if (selectedValue === "3") {
            document.getElementById("tt").style.display = "block";
            document.getElementById("label3").style.display = "inline-block";
            document.getElementById("label-3").style.display = "inline-block";
            document.getElementById("label4").style.display = "none";
            document.getElementById("label-4").style.display = "none";
            document.getElementById("label5").style.display = "none";
            document.getElementById("label-5").style.display = "none";
        } else if (selectedValue === "4") {
            document.getElementById("tt").style.display = "block";
            document.getElementById("label3").style.display = "none";
            document.getElementById("label-3").style.display = "none";
            document.getElementById("label5").style.display = "none";
            document.getElementById("label-5").style.display = "none";
            document.getElementById("label4").style.display = "inline-block";
            document.getElementById("label-4").style.display = "inline-block";
        } else if (selectedValue === "5") {
            document.getElementById("tt").style.display = "block";
            document.getElementById("label3").style.display = "none";
            document.getElementById("label-3").style.display = "none";
            document.getElementById("label4").style.display = "none";
            document.getElementById("label-4").style.display = "none";
            document.getElementById("label5").style.display = "inline-block";
            document.getElementById("label-5").style.display = "inline-block";
        } else {
            // 如果选择的值既不是1也不是2,将所有标签隐藏
            document.getElementById("tt").style.display = "none";
            document.getElementById("label3").style.display = "none";
            document.getElementById("label-3").style.display = "none";
            document.getElementById("label4").style.display = "none";
            document.getElementById("label-4").style.display = "none";
            document.getElementById("label5").style.display = "none";
            document.getElementById("label-5").style.display = "none";
        }
    }
 
    // 添加事件监听器,当下拉框值发生变化时调用changeLabels函数
    document.getElementById("couponType").addEventListener("change", changeLabels);
 
    // 初始化页面时执行一次changeLabels函数,确保初始状态正确
    changeLabels();
 
    $(function () {
        $("#coupon1").show()
        $("#coupon2").hide()
    });
    //监听下拉菜单的变动操作
    $("#couponType").change(function(){
        if(this.value == 1){
            $("#coupon1").show()
            $("#coupon2").hide()
        }
        if(this.value == 2){
            $("#coupon1").hide()
            $("#coupon2").show()
        }
    })
</script>
@}