ZhangWenQiang 6 лет назад
Родитель
Сommit
87a05b0be6
1 измененных файлов с 29 добавлено и 22 удалено
  1. 29 22
      src/main/webapp/webpage/modules/hpmessage/hpBizParamForm.jsp

+ 29 - 22
src/main/webapp/webpage/modules/hpmessage/hpBizParamForm.jsp

@@ -21,21 +21,18 @@
 
 		$(document).ready(function() {
 
-            $('[name="shareFlagA"]').bootstrapSwitch({
-                onText:"开启",
-                offText:"关闭",
-                onColor:"success",// 设置ON文本颜色     (info/success/warning/danger/primary)
-                offColor:"info",// 设置OFF文本颜色        (info/success/warning/danger/primary)
-                size:"small",// 设置控件大小,从小到大  (mini/small/normal/large)
-                handleWidth:"35",//设置控件宽度
-                onSwitchChange:function(event,state){
-                    if(state==true){
-                        $('#shareFlag').val(1)
-                    }else{
-                        $('#shareFlag').val(0)
-                    }
+            $("label[name='onoffswitch']").on('click',function (e) {
+                var onswitch= document.getElementById("onoffswitch").checked;
+                if (onswitch) {
+                    $('#shareFlag').val(0)
+					jp.info("关闭");
+                }
+                else {
+                    $('#shareFlag').val(1)
+                    jp.info("开启");
                 }
             });
+
 			jp.ajaxForm("#inputForm",function(data){
 				if(data.success){
 				    jp.success(data.msg);
@@ -61,15 +58,25 @@
 				<div class="form-group">
 					<label class="col-sm-2 control-label">小程序分享:</label>
 					<div class="col-sm-6">
-						<input type="hidden" name="shareFlag" id="shareFlag" value="${hpBizParam.shareFlag}">
-						<c:choose>
-							<c:when test="${hpBizParam.shareFlag==null}">
-								<input name="shareFlagA" type="checkbox" data-size="small">
-							</c:when>
-							<c:otherwise>
-								<input id="shareFlagA"  name="shareFlagA" type="checkbox" data-size="small" ${hpBizParam.shareFlag=="1"?"checked":""}>
-							</c:otherwise>
-						</c:choose>
+						<div class="onoffswitch">
+							<input type="hidden" name="shareFlag" id="shareFlag" value="${hpBizParam.shareFlag}">
+							<c:choose>
+								<c:when test="${hpBizParam.shareFlag==null}">
+									<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="onoffswitch">
+									<label class="onoffswitch-label" for="onoffswitch"  name="onoffswitch">
+										<span class="onoffswitch-inner"></span>
+										<span class="onoffswitch-switch"></span>
+									</label>
+								</c:when>
+								<c:otherwise>
+									<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="onoffswitch" ${hpBizParam.shareFlag=="1"?"checked":""}>
+									<label class="onoffswitch-label" for="onoffswitch"  name="onoffswitch">
+										<span class="onoffswitch-inner"></span>
+										<span class="onoffswitch-switch"></span>
+									</label>
+								</c:otherwise>
+							</c:choose>
+						</div>
 					</div>
 				</div>
 				<div class="form-group">