lianbingjie 5 жил өмнө
parent
commit
ce0823d813

+ 1 - 1
README.md

@@ -14,4 +14,4 @@ pkg目录,已经在版本控制中排除,不会被提交。
 系统配置文件统一放在config.json中。
 
 v2.9.6
-剑鱼P13-样式统一依赖common分支
+剑鱼P13-样式统一依赖common分支

+ 5 - 2
core/src/qfw/manage/course.go

@@ -502,6 +502,7 @@ func (this *CourseManage) CreateOnLineApi() {
 	c_type, _ := this.GetInteger("type") //课程类型:线下课程(1招标管理课程、2投标实物课程)、3线上课程
 	name := this.GetString("name")//课程名称
 	picUrl := this.GetString("picUrl")//头图
+	picUrl2 := this.GetString("picUrl2")//头图
 	price := this.GetString("price")//课程金额
 	if price == "" {
 		price = "0"
@@ -525,7 +526,7 @@ func (this *CourseManage) CreateOnLineApi() {
 
 	r := func() *FuncResult {
 		//数据校验
-		if name == "" || picUrl == "" || videoUrl == "" || c_type != 3 ||
+		if name == "" || picUrl == "" || picUrl2 == "" || videoUrl == "" || c_type != 3 ||
 			courseDate == "" || endTime == "" {
 			return &FuncResult{false, errors.New("参数不完整"), nil}
 		}
@@ -583,6 +584,7 @@ func (this *CourseManage) CreateOnLineApi() {
 			"s_name":         name,
 			"i_type":         c_type,
 			"s_picUrl":      picUrl,
+			"s_picUrl2":      picUrl2,
 			"s_videoUrl":      videoUrl,
 			"s_fileUrl":      fileUrl,
 			"i_price":        price3,
@@ -782,8 +784,9 @@ func (this *CourseManage) OnLineDetail(flag, id string) error{
 		if id == "" {
 			return errors.New("请求参数有误")
 		}
-		rData := mongodb.FindById("jy_course", id, `{"_id":1,"i_status":1,"s_content":1,"s_name":1,"s_picUrl":1,"i_price":1,"l_publishtime":1,"l_endtime":1,"s_associatedCourses":1,"i_clickRate":1,"s_videoUrl":1,"s_fileUrl":1,"s_courseDate":1,"i_tradeRate":1}`)
+		rData := mongodb.FindById("jy_course", id, `{"_id":1,"i_status":1,"s_content":1,"s_name":1,"s_picUrl":1,"s_picUrl2":1,"i_price":1,"l_publishtime":1,"l_endtime":1,"s_associatedCourses":1,"i_clickRate":1,"s_videoUrl":1,"s_fileUrl":1,"s_courseDate":1,"i_tradeRate":1}`)
 		this.T["picUrl"] = (*rData)["s_picUrl"]
+		this.T["picUrl2"] = (*rData)["s_picUrl2"]
 		this.T["name"] = (*rData)["s_name"]
 		this.T["videoUrl"] = (*rData)["s_videoUrl"]
 		this.T["fileUrl"] = (*rData)["s_fileUrl"]

+ 26 - 4
core/src/web/templates/manage/course/onLineContent.html

@@ -129,11 +129,20 @@
                     <main>
                         <div class="items">
                             <div class="items-left">
-                                头图:
+                                头图(大)
                             </div>
                             <div class="items-right">
                                 <input id="picUrl"  style="width: 25%;" type="text" placeholder="请输入图片地址" value="{{.T.picUrl}}">
-                                <button type="button"  class="btn btn-primary" onClick="upload(this, 'img')" style="color: #4E5051;margin-top: -4px;height: 36px;">上传</button>
+                                <button type="button" name="picUrl" class="btn btn-primary" onClick="upload(this, 'img')" style="color: #4E5051;margin-top: -4px;height: 36px;">上传</button>
+                            </div>
+                        </div>
+                        <div class="items">
+                            <div class="items-left">
+                                头图(小):
+                            </div>
+                            <div class="items-right">
+                                <input id="picUrl2"  style="width: 25%;" type="text" placeholder="请输入图片地址" value="{{.T.picUrl2}}">
+                                <button type="button" name="picUrl2"  class="btn btn-primary" onClick="upload(this, 'img')" style="color: #4E5051;margin-top: -4px;height: 36px;">上传</button>
                             </div>
                         </div>
                         <div class="items">
@@ -266,6 +275,7 @@
 <script type="text/javascript" src="/js/bootbox.js"></script>
 <script>
     var picUrl = "";
+    var picUrl2 = "";
     var name = "";
     var videoUrl = "";
     var price = {{.T.price}};
@@ -315,6 +325,7 @@
     function submit($Obj, flag) {
         $($Obj).attr("disabled", "disabled");
         picUrl = $("#picUrl").val();
+        picUrl2 = $("#picUrl2").val();
         name = $("#name").val();
         videoUrl = $("#videoUrl").val();
         fileUrl = $("#fileUrl").val();
@@ -337,7 +348,12 @@
 
         //数据校验
         if (!picUrl) {
-            bootbox.alert("请输入头图地址");
+            bootbox.alert("请上传或输入头图(大)地址");
+            $($Obj).removeAttr("disabled");
+            return
+        }
+        if (!picUrl2) {
+            bootbox.alert("请上传或输入头图(小)地址");
             $($Obj).removeAttr("disabled");
             return
         }
@@ -381,6 +397,7 @@
 
         var param = {
             picUrl: picUrl,
+            picUrl2: picUrl2,
             name: name,
             videoUrl: videoUrl,
             fileUrl: fileUrl,
@@ -458,7 +475,12 @@
             afterUpload:function(data){ //此处可以重写,上传后的处理
                 if(data.flag == true){
                     if (type == "img"){
-                        $("#picUrl").val(data.url)
+                        if(obj.name == "picUrl"){
+                            $("#picUrl").val(data.url)
+                        }
+                        if(obj.name == "picUrl2"){
+                            $("#picUrl2").val(data.url)
+                        }
                     }
                     if (type == "file"){
                         $("#fileUrl").val(data.url)