Procházet zdrojové kódy

景点导览图上传

yf_zd před 5 roky
rodič
revize
b994d4f0e9
1 změnil soubory, kde provedl 11 přidání a 4 odebrání
  1. 11 4
      templates/backstageNet/info/sightseePub.html

+ 11 - 4
templates/backstageNet/info/sightseePub.html

@@ -302,7 +302,7 @@
                             <div class="layui-input-inline">
                                 <button type="button" class="uploadImg uploadImgIcon" id="guideUpImg"></button>
                                 <!-- 隐藏的input -->
-                                <input type="hidden" id="guideUpimg_url" name="guideUpimg_url" value="" />
+                                <input type="hidden" id="guideUpimg_url" name="guide_img" value="" />
                                 <div class="layui-upload-list">
                                     <img class="layui-upload-img" id="demo2">
                                     <p id="demoText"></p>
@@ -451,11 +451,11 @@
                 }
             });
 
-            //新闻图片上传
+            //景点导览图
             var uploadInst2 = upload.render({
                 elem: '#guideUpImg'
-                , url: 'sightsee_photo'
-                , field: 'sightsee_photos'
+                , url: 'guide_img'
+                , field: 'upload'
                 , xhr: function () { } //上传视频进度条
                 , before: function (obj) {
                     $('#guideUpImg').removeClass('uploadImgIcon')
@@ -489,6 +489,7 @@
             form.on('submit(formDemo)', function (data) {
                 window.id = data.field.id
                 var img_url = $('#img_url').val();
+                var guideUpimg_url = $('#guideUpimg_url').val();
                 var location = $('#location').val();
                 if (!img_url) {
                     layer.msg("请上传景点封面图", { icon: 5 });
@@ -498,6 +499,10 @@
                     layer.msg("请点击定位获取位置", { icon: 5 });
                     return false;
                 }
+                if (!guideUpimg_url) {
+                    layer.msg("请上传景点导览图", { icon: 5 });
+                    return false;
+                }
                 var content = editor1.getData();
                 // alert(content)
                 if (!content) {
@@ -548,6 +553,7 @@
                 "openTime": "",
                 "mobile": "",
                 "img_url": "",
+                "guide_img":"",
                 "time":"",
                 "stime":"",
                 "etime":"",
@@ -558,6 +564,7 @@
             map.clearOverlays();
             $('.uploadImg').addClass('uploadImgIcon');
             $('#demo1').removeAttr('src'); //图片链接(base64)
+            $('#demo2').removeAttr('src'); //图片链接(base64)
             fuzhi()
             if (window.id !== '') {
                 var index = parent.layer.getFrameIndex(window.name);